From 023ad15fe4d9645eeb0966f469c29cf8702656bc Mon Sep 17 00:00:00 2001 From: mashuai Date: Thu, 11 Sep 2025 20:02:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../material/basic/domain/BmQrcodeInfo.java | 3 + .../impl/MaterialLeaseInfoServiceImpl.java | 4 +- .../lease/mapper/LeaseApplyInfoMapper.java | 14 +++ .../impl/LeaseApplyInfoServiceImpl.java | 19 +++- .../repair/controller/RepairController.java | 26 ++++++ .../repair/domain/vo/RepairProjectInfo.java | 86 +++++++++++++++++++ .../mapper/RepairInputDetailsMapper.java | 7 ++ .../material/repair/mapper/RepairMapper.java | 7 ++ .../repair/service/RepairService.java | 7 ++ .../impl/RepairInputDetailsServiceImpl.java | 18 ++++ .../service/impl/RepairServiceImpl.java | 15 ++++ .../material/clz/MaterialLeaseInfoMapper.xml | 14 ++- .../material/lease/LeaseApplyInfoMapper.xml | 36 +++++--- .../mapper/material/ma/MachineMapper.xml | 6 +- .../material/push/ProDataUseInfoMapper.xml | 2 + .../repair/RepairInputDetailsMapper.xml | 15 +++- .../mapper/material/repair/RepairMapper.xml | 64 ++++++++++++++ 17 files changed, 322 insertions(+), 21 deletions(-) create mode 100644 bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/vo/RepairProjectInfo.java diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmQrcodeInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmQrcodeInfo.java index 13d3a3c2..b4f7311c 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmQrcodeInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmQrcodeInfo.java @@ -90,4 +90,7 @@ public class BmQrcodeInfo extends BaseEntity @ApiModelProperty(value = "工程ID") private Long proId; + @ApiModelProperty(value = "机具ID") + private Long maId; + } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/MaterialLeaseInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/MaterialLeaseInfoServiceImpl.java index 8a3d1bee..ad7ab015 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/MaterialLeaseInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/MaterialLeaseInfoServiceImpl.java @@ -1620,8 +1620,8 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService { boolean isValid = CollectionUtil.isEmpty(clzList) && CollectionUtil.isNotEmpty(recordList); // 构建结果消息 String msg = isValid - ? "监测到" + bmQrcodeInfo.getQrCode() + "符合出库条件,请确认是否出库!" - : "监测到" + bmQrcodeInfo.getQrCode() + "编码不符合出库条件,请检查后重新提交!"; + ? "监测到" + bmQrcodeInfo.getMaCode() + "符合出库条件,请确认是否出库!" + : "监测到" + bmQrcodeInfo.getMaCode() + "编码不符合出库条件,请检查后重新提交!"; if (!isValid) { recordList = new ArrayList<>(); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseApplyInfoMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseApplyInfoMapper.java index c0e9b748..68574082 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseApplyInfoMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseApplyInfoMapper.java @@ -237,4 +237,18 @@ public interface LeaseApplyInfoMapper { * @return */ int updateLeaseNumTwo(LeaseApplyDetails leaseApplyDetails); + + /** + * 查询领用单的领用单出库数量 + * @param leaseApplyDetails + * @return + */ + LeaseApplyDetails getPublishNum(LeaseApplyDetails leaseApplyDetails); + + /** + * 修改领用单的领用单出库数量 + * @param leaseApplyDetails + * @return + */ + int updateLeasePublish(LeaseApplyDetails leaseApplyDetails); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java index 6b602579..c0bdf6ab 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java @@ -754,14 +754,25 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { public AjaxResult updateLeaseNum(LeaseApplyDetails leaseApplyDetails) { try { if (leaseApplyDetails.getNewTypeId()!= null){ + // 根据parentId查询发布数量 + LeaseApplyDetails applyDetails = leaseApplyInfoMapper.getPublishNum(leaseApplyDetails); + // 根据传入的值判断少了多少发布数量 + if (applyDetails != null) { + BigDecimal num = leaseApplyDetails.getPublishNum().subtract(leaseApplyDetails.getPreNum()); + leaseApplyDetails.setPublishNum(applyDetails.getPublishNum().subtract(num)); + } int res = leaseApplyInfoMapper.updateLeaseNum(leaseApplyDetails); - if (res<=0){ - return AjaxResult.error("修改失败"); + if (res <= 0){ + return AjaxResult.error("修改领用表失败"); + } + res = leaseApplyInfoMapper.updateLeasePublish(leaseApplyDetails); + if (res <= 0){ + return AjaxResult.error("修改领料发布表失败"); } } else { int res = leaseApplyInfoMapper.updateLeaseNumTwo(leaseApplyDetails); - if (res<=0){ - return AjaxResult.error("修改失败"); + if (res <= 0){ + return AjaxResult.error("修改领料表失败"); } } return AjaxResult.success("修改成功"); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/controller/RepairController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/controller/RepairController.java index 8132d00b..4410305c 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/controller/RepairController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/controller/RepairController.java @@ -411,5 +411,31 @@ public class RepairController extends BaseController { return AjaxResult.success(list); } + /** + * 查询在修工程维修列表 + * @param bean + * @return + */ + @ApiOperation(value = "查询在修工程维修列表") + @GetMapping("/getRepairProjectList") + public AjaxResult getRepairProjectList(RepairProjectInfo bean) { + startPage(); + List list = service.getRepairProjectList(bean); + return AjaxResult.success(getDataTable(list)); + } + + /** + * 导出在修工程维修列表 + * @param response + * @param bean + */ + @ApiOperation(value = "导出在修工程维修列表") + @PostMapping("/exportRepairProjectList") + public void exportRepairProjectList(HttpServletResponse response, RepairProjectInfo bean) { + List list = service.getRepairProjectList(bean); + ExcelUtil util = new ExcelUtil(RepairProjectInfo.class); + util.exportExcel(response, list, "在修工程维修列表"); + } + } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/vo/RepairProjectInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/vo/RepairProjectInfo.java new file mode 100644 index 00000000..23020a81 --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/vo/RepairProjectInfo.java @@ -0,0 +1,86 @@ +package com.bonus.material.repair.domain.vo; + +import com.bonus.common.core.annotation.Excel; +import com.bonus.common.core.web.domain.BaseEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.ToString; + +import java.math.BigDecimal; + +/** + * 维修详细对象 repair_apply_details + * + * @author xsheng + * @date 2024-10-16 + */ + + +@Data +@ToString +public class RepairProjectInfo extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 维修时间 */ + @Excel(name = "维修时间", width = 20) + @ApiModelProperty(value = "维修时间") + private String repairTime; + + /** 维修单号 */ + @Excel(name = "维修单号") + @ApiModelProperty(value = "维修单号") + private String repairCode; + + /** 规格ID */ + @ApiModelProperty(value = "规格ID") + private Long typeId; + + /** 退料单位 */ + @Excel(name = "退料单位", width = 30) + @ApiModelProperty(value = "退料单位") + private String backUnitName; + + /** 退料工程 */ + @Excel(name = "退料工程", width = 40) + @ApiModelProperty(value = "退料工程") + private String backProjectName; + + /** 机具类型 */ + @Excel(name = "机具类型") + @ApiModelProperty(value = "机具类型") + private String maTypeName; + + /** 机具规格 */ + @Excel(name = "机具规格") + @ApiModelProperty(value = "机具规格") + private String maTypeModel; + + /** 机具单位 */ + @Excel(name = "机具单位") + @ApiModelProperty(value = "机具单位") + private String unitName; + + /** 在修数量 */ + @Excel(name = "在修数量") + @ApiModelProperty(value = "在修数量(定损+维修)") + private BigDecimal repairNum; + + @ApiModelProperty(value = "定损数量") + private BigDecimal dsNum; + + @ApiModelProperty(value = "维修数量") + private BigDecimal num; + + @ApiModelProperty(value = "开始时间") + private String startTime; + + @ApiModelProperty(value = "结束时间") + private String endTime; + + @ApiModelProperty(value = "关键字") + private String keyWord; + +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/mapper/RepairInputDetailsMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/mapper/RepairInputDetailsMapper.java index c4010fdc..ed35c826 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/mapper/RepairInputDetailsMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/mapper/RepairInputDetailsMapper.java @@ -152,4 +152,11 @@ public interface RepairInputDetailsMapper { * @return */ int selectRepairInputDetailsByAuditId(RepairInputDetails input); + + /** + * 根据taskId以及typeId查询该设备是否已经入库 + * @param repairInputDetails + * @return + */ + RepairInputDetails selectInfoNum(RepairInputDetails repairInputDetails); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/mapper/RepairMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/mapper/RepairMapper.java index ec0a98cc..4243cc5f 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/mapper/RepairMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/mapper/RepairMapper.java @@ -434,4 +434,11 @@ public interface RepairMapper { * @return */ List getDetailsListAppTwo(RepairPartDetails bean); + + /** + * 查询在修工程维修列表 + * @param bean + * @return + */ + List getRepairProjectList(RepairProjectInfo bean); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/service/RepairService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/service/RepairService.java index 0785cfc4..b2e9ee00 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/service/RepairService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/service/RepairService.java @@ -159,4 +159,11 @@ public interface RepairService { * @return */ List getAppRepairMaTypeListNew(RepairTaskDetails bean); + + /** + * 查询在修工程维修列表 + * @param bean + * @return + */ + List getRepairProjectList(RepairProjectInfo bean); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/service/impl/RepairInputDetailsServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/service/impl/RepairInputDetailsServiceImpl.java index 27aaf281..6b600753 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/service/impl/RepairInputDetailsServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/service/impl/RepairInputDetailsServiceImpl.java @@ -608,8 +608,26 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService // 编码类型入库 if (CollectionUtils.isNotEmpty(repairInputDetails.getMaCodeList())) { + for (RepairInputDetails inputDetails : repairInputDetails.getMaCodeList()) { + inputDetails.setTaskId(repairInputDetails.getTaskId()); + inputDetails.setTypeId(repairInputDetails.getTypeId()); + // 根据taskId以及typeId查询该设备是否已经入库 + RepairInputDetails info = repairInputDetailsMapper.selectInfoNum(inputDetails); + if (info != null) { + if (info.getInputNum().compareTo(info.getRepairNum()) >= 0) { + throw new ServiceException("该设备已经入库,请勿重复入库"); + } + } + } result += processCodeTypeStorage(repairInputDetails); } else { + // 根据taskId以及typeId查询该设备是否已经入库 + RepairInputDetails inputDetails = repairInputDetailsMapper.selectInfoNum(repairInputDetails); + if (inputDetails != null) { + if (inputDetails.getInputNum().compareTo(inputDetails.getRepairNum()) >= 0) { + throw new ServiceException("该设备已经入库,请勿重复入库"); + } + } // 数量类型入库 result += processQuantityTypeStorage(repairInputDetails); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/service/impl/RepairServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/service/impl/RepairServiceImpl.java index 0ca5d492..82a9245a 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/service/impl/RepairServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/service/impl/RepairServiceImpl.java @@ -1795,6 +1795,21 @@ public class RepairServiceImpl implements RepairService { } } + /** + * 查询在修工程维修列表 + * @param bean + * @return + */ + @Override + public List getRepairProjectList(RepairProjectInfo bean) { + try { + return repairMapper.getRepairProjectList(bean); + } catch (Exception e) { + log.error("查询在修工程维修列表", e.getMessage()); + return new ArrayList<>(); + } + } + /** * 查询修试查询-维修配件查询列表 * diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/MaterialLeaseInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/MaterialLeaseInfoMapper.xml index 4e3fd027..b0727cc0 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/MaterialLeaseInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/MaterialLeaseInfoMapper.xml @@ -1228,7 +1228,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id AND mt1.del_flag = '0' where sai.status = '0' - AND mm.ma_code = #{maCode} + + AND mm.ma_id = #{maId} + + + AND mm.ma_code = #{maCode} + AND mt.type_id = #{typeId} @@ -1259,7 +1264,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" bu.type_id in (32, 36) AND bp.pro_id = #{proId} AND sai.`status` = '0' - AND mm.ma_code like concat('%',#{maCode},'%') + + AND mm.ma_code like concat('%',#{maCode},'%') + + + AND mm.ma_id = #{maId} + AND mt.type_id = #{typeId} diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyInfoMapper.xml index 7663548d..273b2da6 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyInfoMapper.xml @@ -806,24 +806,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" is_confirm = 2 where id = #{id} + update lease_apply_details - set pre_num = #{preNum}, - publish_num=#{preNum} - + set publish_num=#{publishNum} where parent_id = #{parentId} - and new_type = #{newTypeId}; - - update lease_publish_details - set num = #{preNum} - where parent_id = #{parentId} - and new_type = #{newTypeId}; + AND new_type = #{newTypeId} + update lease_apply_details - set pre_num = #{preNum} + set pre_num = #{preNum} where parent_id = #{parentId} - and type_id = #{typeId} + AND type_id = #{typeId} + + + + update lease_publish_details + set num = #{preNum} + where parent_id = #{parentId} + AND new_type = #{newTypeId} + AND publish_task = #{publishTask} + diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/MachineMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/MachineMapper.xml index 7b7ba06b..1d31f0eb 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/MachineMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/MachineMapper.xml @@ -734,7 +734,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" mm.type_id as typeId, sd.dict_label as maStatus, mm.qr_code as qrCode, - mm.ma_vender as maVender, + -- 判断ma_vender是否为数字,是则取msi.supplier,否则取mm.ma_vender + CASE + WHEN mm.ma_vender REGEXP '^[0-9]+$' THEN msi.supplier + ELSE mm.ma_vender + END as maVender, mm.out_fac_time as outFacTime, mm.out_fac_code as outFacCode, mm.assets_code as assetsCode, diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/push/ProDataUseInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/push/ProDataUseInfoMapper.xml index 63710bf5..6abddfd8 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/push/ProDataUseInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/push/ProDataUseInfoMapper.xml @@ -74,8 +74,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" CASE mt.manage_type WHEN 0 THEN IFNULL(subquery0.num, 0) + IFNULL(subquery1.usNum, 0) + IFNULL(subquery2.repairNum, 0) + + IFNULL(subquery2.dsNum, 0) + IFNULL(subquery3.repairAuditNum, 0) ELSE IFNULL(mt.storage_num, 0) + IFNULL(subquery1.usNum, 0) + IFNULL(subquery2.repairNum, 0) + + IFNULL(subquery2.dsNum, 0) + IFNULL(subquery3.repairAuditNum, 0) END AS inventoryNum, mt2.is_statics AS isStatics FROM ma_type mt diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/repair/RepairInputDetailsMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/repair/RepairInputDetailsMapper.xml index c9ecdfe6..d60cd8f1 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/repair/RepairInputDetailsMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/repair/RepairInputDetailsMapper.xml @@ -142,7 +142,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" GROUP BY rd.task_id ) AS combined_results ORDER BY - taskStatus, createTime DESC @@ -588,6 +587,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where audit_id = #{auditId} + + update bm_qrcode_box set box_status = 6 where box_code = #{boxCode} diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/repair/RepairMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/repair/RepairMapper.xml index c73f74e7..1ff3001b 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/repair/RepairMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/repair/RepairMapper.xml @@ -1396,6 +1396,70 @@ GROUP BY rad.task_id, rad.type_id, rad.ma_id + + update repair_apply_details