铭牌信息查询
This commit is contained in:
parent
f58a96fd7a
commit
8b14acfa29
|
|
@ -122,4 +122,7 @@ public class PurchaseDto {
|
||||||
|
|
||||||
/** 规格型号 */
|
/** 规格型号 */
|
||||||
private String typeModelName;
|
private String typeModelName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "物资厂家名称")
|
||||||
|
private String supplier;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ public class MachineController extends BaseController {
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(Machine machine)
|
public TableDataInfo list(Machine machine)
|
||||||
{
|
{
|
||||||
if (machine.getPrefix()==null || machine.getPrefix()==null){
|
if (machine.getPrefix()==null){
|
||||||
startPage();
|
startPage();
|
||||||
}
|
}
|
||||||
List<MachineVo> list = machineService.selectMachineList(machine);
|
List<MachineVo> list = machineService.selectMachineList(machine);
|
||||||
|
|
@ -116,8 +116,8 @@ public class MachineController extends BaseController {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "获取机具设备管理详细信息")
|
@ApiOperation(value = "获取机具设备管理详细信息")
|
||||||
@RequiresPermissions("ma:machine:query")
|
//@RequiresPermissions("ma:machine:query")
|
||||||
@GetMapping(value = "/getInfoByMaCode")
|
@GetMapping(value = "/getInfoByCode")
|
||||||
public AjaxResult getInfoByMaCode(Machine machine) {
|
public AjaxResult getInfoByMaCode(Machine machine) {
|
||||||
try {
|
try {
|
||||||
return AjaxResult.success(machineService.getInfoByMaCode(machine));
|
return AjaxResult.success(machineService.getInfoByMaCode(machine));
|
||||||
|
|
|
||||||
|
|
@ -215,7 +215,7 @@ public class Machine extends BaseEntity
|
||||||
private String inTime;
|
private String inTime;
|
||||||
@ApiModelProperty(value = "服务工程数")
|
@ApiModelProperty(value = "服务工程数")
|
||||||
private int serviceNum;
|
private int serviceNum;
|
||||||
@ApiModelProperty(value = "检验次数")
|
@ApiModelProperty(value = "更换配件次数")
|
||||||
private int checkNum;
|
private int checkNum;
|
||||||
@ApiModelProperty(value = "报废时间")
|
@ApiModelProperty(value = "报废时间")
|
||||||
private String scrapTime;
|
private String scrapTime;
|
||||||
|
|
|
||||||
|
|
@ -172,5 +172,5 @@ public interface MachineMapper
|
||||||
* @param machine
|
* @param machine
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
MachineVo getInfoByMaCode(Machine machine);
|
List<Machine> getInfoByMaCode(Machine machine);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -125,5 +125,5 @@ public interface IMachineService
|
||||||
* @param machine
|
* @param machine
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
MachineVo getInfoByMaCode(Machine machine);
|
List<Machine> getInfoByMaCode(Machine machine);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -313,6 +313,9 @@ public class MachineServiceImpl implements IMachineService
|
||||||
public AjaxResult getHisByQrcode(Machine machine) {
|
public AjaxResult getHisByQrcode(Machine machine) {
|
||||||
//1根据二维码查询基础信息
|
//1根据二维码查询基础信息
|
||||||
Machine baseInfo = machineMapper.getInfoByQrcode(machine);
|
Machine baseInfo = machineMapper.getInfoByQrcode(machine);
|
||||||
|
if (baseInfo == null) {
|
||||||
|
return AjaxResult.error("扫描二维码信息为空");
|
||||||
|
}
|
||||||
machine.setMaId(baseInfo.getMaId());
|
machine.setMaId(baseInfo.getMaId());
|
||||||
//2根据二维码查询初次入库时间
|
//2根据二维码查询初次入库时间
|
||||||
Machine inTime = machineMapper.getInTimeByQrcode(machine);
|
Machine inTime = machineMapper.getInTimeByQrcode(machine);
|
||||||
|
|
@ -436,13 +439,9 @@ public class MachineServiceImpl implements IMachineService
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public MachineVo getInfoByMaCode(Machine machine) {
|
public List<Machine> getInfoByMaCode(Machine machine) {
|
||||||
MachineVo machineVo = machineMapper.getInfoByMaCode(machine);
|
List<Machine> infoByMaCode = machineMapper.getInfoByMaCode(machine);
|
||||||
Map<String, String> machineStatus = remoteConfig.getDictValue("ma_machine_status");
|
return infoByMaCode;
|
||||||
if (StringUtils.isNotBlank(machineVo.getMaStatus())) {
|
|
||||||
machineVo.setStatusName(StringUtils.isBlank(machineStatus.get(machineVo.getMaStatus())) ? "" : machineStatus.get(machineVo.getMaStatus()));
|
|
||||||
}
|
|
||||||
return machineVo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.bonus.material.purchase.mapper;
|
||||||
import com.bonus.material.basic.domain.dto.BoxBindWarehouseDto;
|
import com.bonus.material.basic.domain.dto.BoxBindWarehouseDto;
|
||||||
import com.bonus.material.purchase.domain.PurchaseCheckDetails;
|
import com.bonus.material.purchase.domain.PurchaseCheckDetails;
|
||||||
import com.bonus.common.biz.domain.purchase.PurchaseDto;
|
import com.bonus.common.biz.domain.purchase.PurchaseDto;
|
||||||
|
import com.bonus.material.purchase.domain.PurchaseCheckInfo;
|
||||||
import com.bonus.material.purchase.domain.vo.PurchaseVo;
|
import com.bonus.material.purchase.domain.vo.PurchaseVo;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|
@ -135,4 +136,10 @@ public interface PurchaseBindMapper {
|
||||||
*/
|
*/
|
||||||
List<PurchaseCheckDetails> getMachineByCode(PurchaseDto dto);
|
List<PurchaseCheckDetails> getMachineByCode(PurchaseDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据任务id查询供应商
|
||||||
|
* @param taskId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
PurchaseCheckInfo selectSupplierByTaskId(String taskId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,17 +9,18 @@ import com.bonus.common.biz.enums.MaTypeManageTypeEnum;
|
||||||
import com.bonus.common.biz.enums.PurchaseTaskStatusEnum;
|
import com.bonus.common.biz.enums.PurchaseTaskStatusEnum;
|
||||||
import com.bonus.common.core.exception.ServiceException;
|
import com.bonus.common.core.exception.ServiceException;
|
||||||
import com.bonus.common.core.utils.DateUtils;
|
import com.bonus.common.core.utils.DateUtils;
|
||||||
|
import com.bonus.common.core.utils.StringUtils;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.common.security.utils.SecurityUtils;
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
import com.bonus.material.purchase.config.RemoteConfig;
|
import com.bonus.material.purchase.config.RemoteConfig;
|
||||||
import com.bonus.common.biz.domain.purchase.PurchaseDto;
|
import com.bonus.common.biz.domain.purchase.PurchaseDto;
|
||||||
import com.bonus.material.purchase.domain.PurchaseCheckDetails;
|
import com.bonus.material.purchase.domain.PurchaseCheckDetails;
|
||||||
|
import com.bonus.material.purchase.domain.PurchaseCheckInfo;
|
||||||
import com.bonus.material.purchase.mapper.PurchaseBindMapper;
|
import com.bonus.material.purchase.mapper.PurchaseBindMapper;
|
||||||
import com.bonus.material.purchase.mapper.PurchaseCheckDetailsMapper;
|
import com.bonus.material.purchase.mapper.PurchaseCheckDetailsMapper;
|
||||||
import com.bonus.material.purchase.mapper.PurchaseStorageMapper;
|
import com.bonus.material.purchase.mapper.PurchaseStorageMapper;
|
||||||
import com.bonus.material.purchase.service.IPurchaseBindService;
|
import com.bonus.material.purchase.service.IPurchaseBindService;
|
||||||
import com.bonus.material.purchase.domain.vo.PurchaseVo;
|
import com.bonus.material.purchase.domain.vo.PurchaseVo;
|
||||||
import com.bonus.material.task.mapper.TmTaskMapper;
|
|
||||||
import com.google.zxing.WriterException;
|
import com.google.zxing.WriterException;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
|
@ -30,7 +31,6 @@ import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import java.util.zip.ZipEntry;
|
import java.util.zip.ZipEntry;
|
||||||
import java.util.zip.ZipOutputStream;
|
import java.util.zip.ZipOutputStream;
|
||||||
|
|
||||||
|
|
@ -145,6 +145,12 @@ public class PurchaseBindServiceImpl implements IPurchaseBindService {
|
||||||
return AjaxResult.error(1114,"设备编码与库中重复,请勿重复添加");
|
return AjaxResult.error(1114,"设备编码与库中重复,请勿重复添加");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 根据taskId查询厂商
|
||||||
|
PurchaseCheckInfo purchaseCheckInfo = purchaseBindMapper.selectSupplierByTaskId(dto.getTaskId());
|
||||||
|
PurchaseCheckDetails purchaseCheckDetails = new PurchaseCheckDetails();
|
||||||
|
purchaseCheckDetails.setTaskId(Long.valueOf(dto.getTaskId()));
|
||||||
|
purchaseCheckDetails.setTypeId(Long.valueOf(dto.getTypeId()));
|
||||||
|
List<PurchaseCheckDetails> details = purchaseCheckDetailsMapper.selectPurchaseCheckDetailsList(purchaseCheckDetails);
|
||||||
for (final PurchaseDto purchaseDto : dto.getDtoList()) {
|
for (final PurchaseDto purchaseDto : dto.getDtoList()) {
|
||||||
purchaseDto.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString()).setCreateTime(DateUtils.getNowDate());
|
purchaseDto.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString()).setCreateTime(DateUtils.getNowDate());
|
||||||
purchaseDto.setTaskId(dto.getTaskId()).setTypeId(dto.getTypeId()).setStatus(0);
|
purchaseDto.setTaskId(dto.getTaskId()).setTypeId(dto.getTypeId()).setStatus(0);
|
||||||
|
|
@ -159,6 +165,14 @@ public class PurchaseBindServiceImpl implements IPurchaseBindService {
|
||||||
purchaseBindMapper.insert(purchaseDto);
|
purchaseBindMapper.insert(purchaseDto);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
if (purchaseCheckInfo != null && !StringUtils.isBlank(purchaseCheckInfo.getSupplier())) {
|
||||||
|
purchaseDto.setSupplier(purchaseCheckInfo.getSupplier());
|
||||||
|
}
|
||||||
|
if (CollectionUtils.isNotEmpty(details)) {
|
||||||
|
if (StringUtils.isNotBlank(details.get(0).getProductionTime())){
|
||||||
|
purchaseDto.setProductDate(details.get(0).getProductionTime());
|
||||||
|
}
|
||||||
|
}
|
||||||
if (1 != purchaseStorageMapper.insertMachine(purchaseDto)) {
|
if (1 != purchaseStorageMapper.insertMachine(purchaseDto)) {
|
||||||
return AjaxResult.error(1116,"插入maMachine时SQL执行失败!");
|
return AjaxResult.error(1116,"插入maMachine时SQL执行失败!");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -669,17 +669,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
limit 100
|
limit 100
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getInfoByMaCode" resultType="com.bonus.material.ma.domain.vo.MachineVo">
|
<select id="getInfoByMaCode" resultType="com.bonus.material.ma.domain.Machine">
|
||||||
SELECT
|
SELECT
|
||||||
ma.ma_id as maId,
|
ma.ma_id as maId,
|
||||||
ma.type_id as typeId,
|
ma.type_id as typeId,
|
||||||
mt4.type_name as itemType,
|
|
||||||
mt3.type_name as materialType,
|
|
||||||
mt2.type_name as materialName,
|
mt2.type_name as materialName,
|
||||||
CASE WHEN ma.machine_name IS NOT NULL THEN ma.machine_name ELSE mt.type_name END as materialModel,
|
CASE WHEN ma.machine_name IS NOT NULL THEN ma.machine_name ELSE mt.type_name END as materialModel,
|
||||||
ma.ma_code as maCode,
|
ma.ma_code as maCode,
|
||||||
ma.pre_code as preCode,
|
ma.pre_code as preCode,
|
||||||
ma.ma_status as maStatus,
|
sda.dict_label as maStatus,
|
||||||
ma.qr_code as qrCode,
|
ma.qr_code as qrCode,
|
||||||
ma.buy_price as buyPrice,
|
ma.buy_price as buyPrice,
|
||||||
ma.ma_vender as maVender,
|
ma.ma_vender as maVender,
|
||||||
|
|
@ -694,7 +692,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
ma.erp_code as erpCode,
|
ma.erp_code as erpCode,
|
||||||
ma.transfer_code as transferCode,
|
ma.transfer_code as transferCode,
|
||||||
ma.in_out_num as inOutNum,
|
ma.in_out_num as inOutNum,
|
||||||
tt.code as buyTask,
|
|
||||||
ma.own_house as ownHouse,
|
ma.own_house as ownHouse,
|
||||||
ma.company_id as companyId,
|
ma.company_id as companyId,
|
||||||
ma.create_time as createTime,
|
ma.create_time as createTime,
|
||||||
|
|
@ -702,11 +699,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
ma.inspect_man as inspectMan,
|
ma.inspect_man as inspectMan,
|
||||||
ma.inspect_status as inspectStatus,
|
ma.inspect_status as inspectStatus,
|
||||||
ma.phone as phone,
|
ma.phone as phone,
|
||||||
GROUP_CONCAT( DISTINCT su1.user_id ORDER BY su1.user_id SEPARATOR ',' ) AS keeperId,
|
|
||||||
GROUP_CONCAT( DISTINCT su1.nick_name ORDER BY su1.user_id SEPARATOR ',' ) AS keeperName,
|
|
||||||
GROUP_CONCAT( DISTINCT su2.user_id ORDER BY su2.user_id SEPARATOR ',' ) AS repairId,
|
|
||||||
GROUP_CONCAT( DISTINCT su2.nick_name ORDER BY su2.user_id SEPARATOR ',' ) AS repairName,
|
|
||||||
baa.asset_name as assetName,
|
|
||||||
ma.assets_id as assetsId,
|
ma.assets_id as assetsId,
|
||||||
ma.remark as remark
|
ma.remark as remark
|
||||||
FROM
|
FROM
|
||||||
|
|
@ -719,12 +711,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
and mt3.`level` = '2' and mt3.del_flag = '0'
|
and mt3.`level` = '2' and mt3.del_flag = '0'
|
||||||
LEFT JOIN ma_type mt4 ON mt3.parent_id = mt4.type_id
|
LEFT JOIN ma_type mt4 ON mt3.parent_id = mt4.type_id
|
||||||
and mt4.`level` = '1' and mt4.del_flag = '0'
|
and mt4.`level` = '1' and mt4.del_flag = '0'
|
||||||
LEFT JOIN ma_type_keeper mtk on ma.type_id = mtk.type_id
|
LEFT JOIN sys_dict_data sda on sda.dict_value = ma.ma_status
|
||||||
LEFT JOIN sys_user su1 on mtk.user_id = su1.user_id
|
and sda.dict_type = "ma_machine_status"
|
||||||
LEFT JOIN ma_type_repair mtr on ma.type_id = mtr.type_id
|
where
|
||||||
LEFT JOIN sys_user su2 on mtr.user_id = su2.user_id
|
1=1
|
||||||
LEFT JOIN bm_asset_attributes baa on ma.assets_id = baa.id
|
<if test="maCode != null and maCode != ''">
|
||||||
LEFT JOIN tm_task tt on tt.task_id=ma.buy_task
|
and ma.ma_code LIKE CONCAT('%',#{maCode},'%')
|
||||||
where ma.ma_code = #{maCode}
|
</if>
|
||||||
|
<if test="qrCode != null and qrCode != ''">
|
||||||
|
and ma.qr_code = #{qrCode}
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -428,4 +428,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
pmi.id
|
pmi.id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectSupplierByTaskId" resultType="com.bonus.material.purchase.domain.PurchaseCheckInfo">
|
||||||
|
SELECT
|
||||||
|
pci.id as id,
|
||||||
|
pci.task_id as taskId,
|
||||||
|
pci.supplier_id as supplierId,
|
||||||
|
msi.supplier as supplier
|
||||||
|
FROM
|
||||||
|
purchase_check_info pci
|
||||||
|
LEFT JOIN tm_task t ON t.task_id = pci.task_id
|
||||||
|
LEFT JOIN ma_supplier_info msi ON pci.supplier_id = msi.supplier_id
|
||||||
|
WHERE
|
||||||
|
t.task_id = #{taskId}
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="productDate != null">out_fac_time,</if>
|
<if test="productDate != null">out_fac_time,</if>
|
||||||
<if test="outFacCode != null">out_fac_code,</if>
|
<if test="outFacCode != null">out_fac_code,</if>
|
||||||
<if test="taskId != null and taskId != ''">buy_task,</if>
|
<if test="taskId != null and taskId != ''">buy_task,</if>
|
||||||
|
<if test="supplier != null and supplier != ''">ma_vender,</if>
|
||||||
create_time
|
create_time
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
|
@ -24,6 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="productDate != null">#{productDate},</if>
|
<if test="productDate != null">#{productDate},</if>
|
||||||
<if test="outFacCode != null">#{outFacCode},</if>
|
<if test="outFacCode != null">#{outFacCode},</if>
|
||||||
<if test="taskId != null and taskId != ''">#{taskId},</if>
|
<if test="taskId != null and taskId != ''">#{taskId},</if>
|
||||||
|
<if test="supplier != null and supplier != ''">#{supplier},</if>
|
||||||
now()
|
now()
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue