diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/service/impl/BackApplyInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/service/impl/BackApplyInfoServiceImpl.java index 540c586d..b286fb57 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/service/impl/BackApplyInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/service/impl/BackApplyInfoServiceImpl.java @@ -161,7 +161,7 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService { ajaxResult.put("data", backApplyRequestVo); if (CollectionUtils.isNotEmpty(newCodeList)) { // 拼接消息内容 - StringBuffer msgBuilder = new StringBuffer("您所选择的编码设备编号 +"); + StringBuffer msgBuilder = new StringBuffer("您所选择的编码设备编号"); for (int i = 0; i < newCodeList.size(); i++) { String code = newCodeList.get(i).getMaCode(); msgBuilder.append(code); @@ -169,7 +169,7 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService { msgBuilder.append(", "); } } - msgBuilder.append("+已被他人完成退料,请注意查看!"); + msgBuilder.append("已被他人完成退料,请注意查看!"); String msg = msgBuilder.toString(); msg = msg.replaceAll("\n",""); ajaxResult.put("msg", msg); @@ -725,13 +725,26 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService { // 将applyInfoList中状态不为在用的数据收集到新集合中 if (CollectionUtils.isNotEmpty(applyInfoList)) { for (BackApplyInfo applyInfo : applyInfoList) { - if (!"2".equals(applyInfo.getMaStatus())) { - codeList.add(applyInfo); + if (StringUtils.isNotBlank(applyInfo.getMaStatus())) { + if (!"2".equals(applyInfo.getMaStatus())) { + codeList.add(applyInfo); + } } } } if (CollectionUtils.isNotEmpty(codeList)) { - return AjaxResult.error("您所选择的编码设备中有设备已被他人完成退料,请编辑后重新提交!"); + StringBuilder msgBuilder = new StringBuilder("您所选择的编码设备编号"); + for (int i = 0; i < codeList.size(); i++) { + String maCode = codeList.get(i).getMaCode(); + msgBuilder.append(maCode); + if (i < codeList.size() - 1) { + msgBuilder.append(", "); + } + } + msgBuilder.append("已被他人完成退料,请编辑后重新提交!"); + String msg = msgBuilder.toString(); + msg = msg.replaceAll("\n", ""); + return AjaxResult.error(msg); } int result = 0; //先查询退料详情信息 @@ -746,7 +759,7 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService { if (CollectionUtils.isNotEmpty(listL4)) { for (TypeTreeNode typeTreeNode : listL4) { if (applyDetail.getTypeId().equals(typeTreeNode.getTypeId())) { - if (applyDetail.getPreNum().compareTo(applyDetail.getNum()) > 0) { + if (applyDetail.getPreNum().compareTo(typeTreeNode.getNum()) > 0) { return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), "退料数量不能大于在用数量"); } } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/ScrapAuditInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/ScrapAuditInfo.java index 4d96a4c5..0869c746 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/ScrapAuditInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/ScrapAuditInfo.java @@ -31,6 +31,10 @@ public class ScrapAuditInfo { @Excel(name = "规格型号") private String typeModelName; + @ApiModelProperty(value = "报废数量") + @Excel(name = "报废数量") + private BigDecimal scrapNum; + @ApiModelProperty(value = "购置单价") @Excel(name = "原值(元)") private BigDecimal buyPrice; diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/ScrapRecordInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/ScrapRecordInfo.java index a9d41a77..38370101 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/ScrapRecordInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/ScrapRecordInfo.java @@ -31,6 +31,10 @@ public class ScrapRecordInfo { @Excel(name = "规格型号") private String typeModelName; + @ApiModelProperty(value = "报废数量") + @Excel(name = "报废数量") + private BigDecimal scrapNum; + @ApiModelProperty(value = "购置单价") @Excel(name = "原值(元)") private BigDecimal buyPrice; diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/work/service/impl/SysWorkflowRecordHistoryServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/work/service/impl/SysWorkflowRecordHistoryServiceImpl.java index ef4f27db..9e0acac9 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/work/service/impl/SysWorkflowRecordHistoryServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/work/service/impl/SysWorkflowRecordHistoryServiceImpl.java @@ -209,6 +209,7 @@ public class SysWorkflowRecordHistoryServiceImpl implements SysWorkflowRecordHis backApplyInfo.setCode(code); backApplyInfo.setCreateBy(SecurityUtils.getUsername()); backApplyInfo.setCreateTime(DateUtils.getNowDate()); + backApplyInfo.setDirectId(Long.valueOf(directApplyInfo.getId())); // 保存退料信息到 tm_task 表中 int result = 0; result = taskMapper.insertTmTask(task); @@ -243,6 +244,7 @@ public class SysWorkflowRecordHistoryServiceImpl implements SysWorkflowRecordHis applyInfo.setPhone(info.getLeasePhone()); applyInfo.setCreateBy(SecurityUtils.getUsername()); applyInfo.setCreateTime(DateUtils.getNowDate()); + applyInfo.setDirectId(Long.valueOf(directApplyInfo.getId())); /** 设置审批人为默认的董班长 --防止代码冲突 **/ int count = leaseApplyInfoMapper.insertLeaseApplyInfo(applyInfo); if (count > 0) { diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/back/BackApplyInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/back/BackApplyInfoMapper.xml index 434bfbd4..d28a6763 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/back/BackApplyInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/back/BackApplyInfoMapper.xml @@ -225,7 +225,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" bcd.parent_id AS parentId, bcd.create_by AS createBy, bcd.ma_id AS maId, - mm.ma_status AS maStatus + mm.ma_status AS maStatus, + mm.ma_code AS maCode FROM back_check_details bcd LEFT JOIN back_apply_info bai ON bai.id = bcd.parent_id diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/ComplexQueryMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/ComplexQueryMapper.xml index 2f0e7ddc..255aa382 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/ComplexQueryMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/ComplexQueryMapper.xml @@ -569,7 +569,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" mt2.type_name AS typeName, mt2.type_id AS thirdTypeId, mt.type_name AS typeModelName, - SUM(IF(sad.status IN ('0','1'), IFNULL(sad.scrap_num, 0), 0)) AS pendingScrapNum, + SUM(IF(sad.ledger_status = '0', IFNULL(sad.scrap_num, 0), 0)) AS pendingScrapNum, SUM(IF(sad.ledger_status = '1', IFNULL(sad.scrap_num, 0), 0)) AS scrapNum FROM scrap_apply_details sad LEFT JOIN ma_type mt ON mt.type_id = sad.type_id @@ -634,7 +634,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN tm_task tt ON bs.task_id = tt.task_id LEFT JOIN ma_type_keeper mtk ON mtk.type_id = bs.type_id LEFT JOIN sys_user su ON mtk.user_id = su.user_id - WHERE bs.in_num != 0 and bs.result_msg = '操作成功' + WHERE bs.in_num != 0 and (bs.result_msg = '操作成功' OR bs.result_msg = '入库成功') AND bs.type_id = #{typeId} @@ -835,13 +835,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" WHEN '3' then '盘点报废' ELSE '' END - as scrapType + as scrapType, + sad.scrap_num AS scrapNum FROM scrap_apply_details sad LEFT JOIN ma_type mt ON mt.type_id = sad.type_id LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id LEFT JOIN ma_machine mm ON mm.ma_id = sad.ma_id LEFT JOIN sys_user su ON sad.audit_by = su.user_id - WHERE 1 = 1 + WHERE sad.ledger_status = '0' AND sad.type_id = #{typeId} @@ -855,6 +856,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ) GROUP BY mm.ma_code ,mt.type_id + ORDER BY sad.create_time DESC