diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/PurchaseMacodeInfo.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/PurchaseMacodeInfo.java index 9e479e72..1eeec65d 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/PurchaseMacodeInfo.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/PurchaseMacodeInfo.java @@ -8,6 +8,7 @@ import org.apache.commons.lang3.builder.ToStringStyle; import java.math.BigDecimal; import java.util.Date; +import java.util.List; import java.util.Objects; /** @@ -117,17 +118,17 @@ public class PurchaseMacodeInfo extends BaseEntity @ApiModelProperty(value = "单位名称") private String unitName; - public String getUserIds() { + public List getUserIds() { return userIds; } - public void setUserIds(String userIds) { + public void setUserIds(List userIds) { this.userIds = userIds; } /** 审核员用户id */ @ApiModelProperty(value = "审核员用户id") - private String userIds; + private List userIds; /** * 类型管理方式 diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/RepairTestInputDetailVo.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/RepairTestInputDetailVo.java index 6aabe402..6edad573 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/RepairTestInputDetailVo.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/RepairTestInputDetailVo.java @@ -3,6 +3,8 @@ package com.bonus.sgzb.material.domain; import com.bonus.sgzb.common.core.annotation.Excel; import lombok.Data; +import java.util.List; + /** * @author 10488 * 修试入库详细 @@ -67,5 +69,5 @@ public class RepairTestInputDetailVo { private String status; /** 修试管理入库审核人员*/ - private String userIds; + private List userIds; } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseMacodeInfoMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseMacodeInfoMapper.java index 9d8f7232..7d58e759 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseMacodeInfoMapper.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseMacodeInfoMapper.java @@ -282,4 +282,6 @@ public interface PurchaseMacodeInfoMapper { int updateMaTypeNum(MachinePart wholeSetDetail); List selectPurchaseMacodeInfoListDetails(PurchaseMacodeInfo purchaseMacodeInfo); + + List selectKeepUser(Integer typeId); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseMacodeInfoServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseMacodeInfoServiceImpl.java index 02d3fa20..82581601 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseMacodeInfoServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseMacodeInfoServiceImpl.java @@ -8,6 +8,7 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; +import cn.hutool.core.collection.CollUtil; import com.alibaba.fastjson.JSONObject; import com.bonus.sgzb.base.api.domain.*; import com.bonus.sgzb.common.core.utils.StringUtils; @@ -427,7 +428,14 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService */ @Override public List selectPutinDetails(PurchaseMacodeInfo purchaseMacodeInfo) { - return purchaseMacodeInfoMapper.selectPutinDetails(purchaseMacodeInfo); + List purchaseMacodeInfos = purchaseMacodeInfoMapper.selectPutinDetails(purchaseMacodeInfo); + for (PurchaseMacodeInfo macodeInfo : purchaseMacodeInfos) { + List userIds = purchaseMacodeInfoMapper.selectKeepUser(macodeInfo.getTypeId().intValue()); + if (CollUtil.isNotEmpty(userIds)){ + macodeInfo.setUserIds(userIds); + } + } + return purchaseMacodeInfos; } @Override diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/RepairTestInputServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/RepairTestInputServiceImpl.java index fa790853..e0ace689 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/RepairTestInputServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/RepairTestInputServiceImpl.java @@ -1,5 +1,6 @@ package com.bonus.sgzb.material.service.impl; +import cn.hutool.core.collection.CollUtil; import com.alibaba.fastjson.JSONObject; import com.bonus.sgzb.common.core.constant.HttpStatus; import com.bonus.sgzb.common.core.exception.ServiceException; @@ -10,6 +11,7 @@ import com.bonus.sgzb.common.core.utils.StringUtils; import com.bonus.sgzb.common.core.web.domain.AjaxResult; import com.bonus.sgzb.common.security.utils.SecurityUtils; import com.bonus.sgzb.material.domain.*; +import com.bonus.sgzb.material.mapper.PurchaseMacodeInfoMapper; import com.bonus.sgzb.material.mapper.RepairTestInputMapper; import com.bonus.sgzb.material.mapper.TaskMapper; import com.bonus.sgzb.material.mapper.TmTaskAgreementMapper; @@ -37,6 +39,9 @@ public class RepairTestInputServiceImpl implements RepairTestInputService { @Resource(name = "RepairTestInputMapper") private RepairTestInputMapper mapper; + @Resource + private PurchaseMacodeInfoMapper purchaseMacodeInfoMapper; + @Resource private TaskMapper taskMapper; @@ -50,7 +55,14 @@ public class RepairTestInputServiceImpl implements RepairTestInputService { @Override public List getRepairedDetailList(RepairTestInputDto dto) { - return mapper.getRepairedDetailList(dto); + List repairedDetailList = mapper.getRepairedDetailList(dto); + for (RepairTestInputDetailVo repairTestInputDetailVo : repairedDetailList) { + List userIds = purchaseMacodeInfoMapper.selectKeepUser(repairTestInputDetailVo.getTypeId()); + if (CollUtil.isNotEmpty(userIds)) { + repairTestInputDetailVo.setUserIds(userIds); + } + } + return repairedDetailList; } @Override @@ -79,7 +91,7 @@ public class RepairTestInputServiceImpl implements RepairTestInputService { RepairAuditDetails detail = new RepairAuditDetails(); detail.setRepairId(Long.valueOf(dto.getId())); detail.setTypeId(Long.valueOf(dto.getTypeId())); - if (StringHelper.isNotEmpty(dto.getMaId())){ + if (StringHelper.isNotEmpty(dto.getMaId())) { detail.setMaId(Long.valueOf(dto.getMaId())); } detail.setRepairNum(new BigDecimal(dto.getRepairNum())); @@ -168,14 +180,14 @@ public class RepairTestInputServiceImpl implements RepairTestInputService { Date nowDate = DateUtils.getNowDate(); String format = dateFormat.format(nowDate); String taskNum = taskMapper.selectTaskNumByMonths(nowDate, taskType); - if (StringHelper.isNotEmpty(taskNum)){ + if (StringHelper.isNotEmpty(taskNum)) { // 将字符串转换为整数 int num = Integer.parseInt(taskNum); // 执行加一操作 num++; // 将结果转换回字符串格式,并确保结果是四位数,不足四位则在前面补0 taskNum = String.format("%04d", num); - }else { + } else { taskNum = "0001"; } String codeNum = code + format + "-" + taskNum; diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseMacodeInfoMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseMacodeInfoMapper.xml index e0023024..3124dbc3 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseMacodeInfoMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseMacodeInfoMapper.xml @@ -364,7 +364,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" pcd.task_id taskId, mt.CODE specsCode, mt1.CODE typeCode, - GROUP_CONCAT( mtk.user_id ) AS userIds, CASE WHEN pmi.ma_code IS NULL THEN CASE @@ -385,7 +384,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN ma_machine mm ON pmi.ma_code = mm.ma_code LEFT JOIN ma_type mt ON pcd.type_id = mt.type_id LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id - LEFT JOIN ma_type_keeper mtk ON mtk.type_id = pcd.type_id WHERE pcd.task_id = #{taskId} AND pcd.`status` != 3 @@ -394,8 +392,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and (mt.type_name like concat('%',#{dictName},'%') or mt1.type_name like concat('%',#{dictName},'%')) - GROUP BY - pcd.type_id ORDER BY STATUS, pmi.id @@ -552,6 +548,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND pcd.`status` != 3 AND pcd.`status` != 5 + update ma_type set num = #{num} where type_id = #{typeId} diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/RepairTestInputMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/RepairTestInputMapper.xml index 14731e2d..e6435cf4 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/RepairTestInputMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/RepairTestInputMapper.xml @@ -124,11 +124,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" rid.update_by AS updateBy, rid.update_time AS updateTime, rid.remark, - GROUP_CONCAT( mtk.user_id ) AS userIds, CASE rid.`status` WHEN '0' THEN '进行中' WHEN '1' THEN '已入库' WHEN '2' THEN '驳回' ELSE '进行中' END AS `status` FROM repair_input_details rid LEFT JOIN ma_machine mm ON rid.ma_id = mm.ma_id - LEFT JOIN ma_type_keeper mtk ON rid.type_id = mtk.type_id LEFT JOIN ( SELECT mt.type_id AS typeId,mt2.type_id AS typeId2,mt.type_name AS typeName,mt2.type_name AS typeName2,mt.manage_type FROM ma_type mt @@ -150,7 +148,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND a.typeId = #{typeId} - GROUP BY rid.type_id ORDER BY rid.create_time DESC