试运行问题修改

This commit is contained in:
csyue 2024-06-05 15:44:39 +08:00
parent c316048317
commit 2a0556f200
7 changed files with 37 additions and 16 deletions

View File

@ -8,6 +8,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List;
import java.util.Objects; import java.util.Objects;
/** /**
@ -117,17 +118,17 @@ public class PurchaseMacodeInfo extends BaseEntity
@ApiModelProperty(value = "单位名称") @ApiModelProperty(value = "单位名称")
private String unitName; private String unitName;
public String getUserIds() { public List<String> getUserIds() {
return userIds; return userIds;
} }
public void setUserIds(String userIds) { public void setUserIds(List<String> userIds) {
this.userIds = userIds; this.userIds = userIds;
} }
/** 审核员用户id */ /** 审核员用户id */
@ApiModelProperty(value = "审核员用户id") @ApiModelProperty(value = "审核员用户id")
private String userIds; private List<String> userIds;
/** /**
* 类型管理方式 * 类型管理方式

View File

@ -3,6 +3,8 @@ package com.bonus.sgzb.material.domain;
import com.bonus.sgzb.common.core.annotation.Excel; import com.bonus.sgzb.common.core.annotation.Excel;
import lombok.Data; import lombok.Data;
import java.util.List;
/** /**
* @author 10488 * @author 10488
* 修试入库详细 * 修试入库详细
@ -67,5 +69,5 @@ public class RepairTestInputDetailVo {
private String status; private String status;
/** 修试管理入库审核人员*/ /** 修试管理入库审核人员*/
private String userIds; private List<String> userIds;
} }

View File

@ -282,4 +282,6 @@ public interface PurchaseMacodeInfoMapper {
int updateMaTypeNum(MachinePart wholeSetDetail); int updateMaTypeNum(MachinePart wholeSetDetail);
List<PurchaseMacodeInfo> selectPurchaseMacodeInfoListDetails(PurchaseMacodeInfo purchaseMacodeInfo); List<PurchaseMacodeInfo> selectPurchaseMacodeInfoListDetails(PurchaseMacodeInfo purchaseMacodeInfo);
List<String> selectKeepUser(Integer typeId);
} }

View File

@ -8,6 +8,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.bonus.sgzb.base.api.domain.*; import com.bonus.sgzb.base.api.domain.*;
import com.bonus.sgzb.common.core.utils.StringUtils; import com.bonus.sgzb.common.core.utils.StringUtils;
@ -427,7 +428,14 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
*/ */
@Override @Override
public List<PurchaseMacodeInfo> selectPutinDetails(PurchaseMacodeInfo purchaseMacodeInfo) { public List<PurchaseMacodeInfo> selectPutinDetails(PurchaseMacodeInfo purchaseMacodeInfo) {
return purchaseMacodeInfoMapper.selectPutinDetails(purchaseMacodeInfo); List<PurchaseMacodeInfo> purchaseMacodeInfos = purchaseMacodeInfoMapper.selectPutinDetails(purchaseMacodeInfo);
for (PurchaseMacodeInfo macodeInfo : purchaseMacodeInfos) {
List<String> userIds = purchaseMacodeInfoMapper.selectKeepUser(macodeInfo.getTypeId().intValue());
if (CollUtil.isNotEmpty(userIds)){
macodeInfo.setUserIds(userIds);
}
}
return purchaseMacodeInfos;
} }
@Override @Override

View File

@ -1,5 +1,6 @@
package com.bonus.sgzb.material.service.impl; package com.bonus.sgzb.material.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.bonus.sgzb.common.core.constant.HttpStatus; import com.bonus.sgzb.common.core.constant.HttpStatus;
import com.bonus.sgzb.common.core.exception.ServiceException; 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.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.security.utils.SecurityUtils; import com.bonus.sgzb.common.security.utils.SecurityUtils;
import com.bonus.sgzb.material.domain.*; 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.RepairTestInputMapper;
import com.bonus.sgzb.material.mapper.TaskMapper; import com.bonus.sgzb.material.mapper.TaskMapper;
import com.bonus.sgzb.material.mapper.TmTaskAgreementMapper; import com.bonus.sgzb.material.mapper.TmTaskAgreementMapper;
@ -37,6 +39,9 @@ public class RepairTestInputServiceImpl implements RepairTestInputService {
@Resource(name = "RepairTestInputMapper") @Resource(name = "RepairTestInputMapper")
private RepairTestInputMapper mapper; private RepairTestInputMapper mapper;
@Resource
private PurchaseMacodeInfoMapper purchaseMacodeInfoMapper;
@Resource @Resource
private TaskMapper taskMapper; private TaskMapper taskMapper;
@ -50,7 +55,14 @@ public class RepairTestInputServiceImpl implements RepairTestInputService {
@Override @Override
public List<RepairTestInputDetailVo> getRepairedDetailList(RepairTestInputDto dto) { public List<RepairTestInputDetailVo> getRepairedDetailList(RepairTestInputDto dto) {
return mapper.getRepairedDetailList(dto); List<RepairTestInputDetailVo> repairedDetailList = mapper.getRepairedDetailList(dto);
for (RepairTestInputDetailVo repairTestInputDetailVo : repairedDetailList) {
List<String> userIds = purchaseMacodeInfoMapper.selectKeepUser(repairTestInputDetailVo.getTypeId());
if (CollUtil.isNotEmpty(userIds)) {
repairTestInputDetailVo.setUserIds(userIds);
}
}
return repairedDetailList;
} }
@Override @Override
@ -79,7 +91,7 @@ public class RepairTestInputServiceImpl implements RepairTestInputService {
RepairAuditDetails detail = new RepairAuditDetails(); RepairAuditDetails detail = new RepairAuditDetails();
detail.setRepairId(Long.valueOf(dto.getId())); detail.setRepairId(Long.valueOf(dto.getId()));
detail.setTypeId(Long.valueOf(dto.getTypeId())); detail.setTypeId(Long.valueOf(dto.getTypeId()));
if (StringHelper.isNotEmpty(dto.getMaId())){ if (StringHelper.isNotEmpty(dto.getMaId())) {
detail.setMaId(Long.valueOf(dto.getMaId())); detail.setMaId(Long.valueOf(dto.getMaId()));
} }
detail.setRepairNum(new BigDecimal(dto.getRepairNum())); detail.setRepairNum(new BigDecimal(dto.getRepairNum()));
@ -168,14 +180,14 @@ public class RepairTestInputServiceImpl implements RepairTestInputService {
Date nowDate = DateUtils.getNowDate(); Date nowDate = DateUtils.getNowDate();
String format = dateFormat.format(nowDate); String format = dateFormat.format(nowDate);
String taskNum = taskMapper.selectTaskNumByMonths(nowDate, taskType); String taskNum = taskMapper.selectTaskNumByMonths(nowDate, taskType);
if (StringHelper.isNotEmpty(taskNum)){ if (StringHelper.isNotEmpty(taskNum)) {
// 将字符串转换为整数 // 将字符串转换为整数
int num = Integer.parseInt(taskNum); int num = Integer.parseInt(taskNum);
// 执行加一操作 // 执行加一操作
num++; num++;
// 将结果转换回字符串格式并确保结果是四位数不足四位则在前面补0 // 将结果转换回字符串格式并确保结果是四位数不足四位则在前面补0
taskNum = String.format("%04d", num); taskNum = String.format("%04d", num);
}else { } else {
taskNum = "0001"; taskNum = "0001";
} }
String codeNum = code + format + "-" + taskNum; String codeNum = code + format + "-" + taskNum;

View File

@ -364,7 +364,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
pcd.task_id taskId, pcd.task_id taskId,
mt.CODE specsCode, mt.CODE specsCode,
mt1.CODE typeCode, mt1.CODE typeCode,
GROUP_CONCAT( mtk.user_id ) AS userIds,
CASE CASE
WHEN pmi.ma_code IS NULL THEN WHEN pmi.ma_code IS NULL THEN
CASE 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_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 mt ON pcd.type_id = mt.type_id
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.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 WHERE
pcd.task_id = #{taskId} pcd.task_id = #{taskId}
AND pcd.`status` != 3 AND pcd.`status` != 3
@ -394,8 +392,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and (mt.type_name like concat('%',#{dictName},'%') or and (mt.type_name like concat('%',#{dictName},'%') or
mt1.type_name like concat('%',#{dictName},'%')) mt1.type_name like concat('%',#{dictName},'%'))
</if> </if>
GROUP BY
pcd.type_id
ORDER BY ORDER BY
STATUS, STATUS,
pmi.id pmi.id
@ -552,6 +548,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND pcd.`status` != 3 AND pcd.`status` != 3
AND pcd.`status` != 5 AND pcd.`status` != 5
</select> </select>
<select id="selectKeepUser" resultType="java.lang.String">
SELECT user_id FROM ma_type_keeper WHERE type_id = #{typeId}
</select>
<update id="updateTypeByTypeId"> <update id="updateTypeByTypeId">
update ma_type set num = #{num} where type_id = #{typeId} update ma_type set num = #{num} where type_id = #{typeId}

View File

@ -124,11 +124,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
rid.update_by AS updateBy, rid.update_by AS updateBy,
rid.update_time AS updateTime, rid.update_time AS updateTime,
rid.remark, 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` CASE rid.`status` WHEN '0' THEN '进行中' WHEN '1' THEN '已入库' WHEN '2' THEN '驳回' ELSE '进行中' END AS `status`
FROM repair_input_details rid FROM repair_input_details rid
LEFT JOIN ma_machine mm ON rid.ma_id = mm.ma_id 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 ( 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 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 FROM ma_type mt
@ -150,7 +148,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="typeId!=null and typeId!=''"> <if test="typeId!=null and typeId!=''">
AND a.typeId = #{typeId} AND a.typeId = #{typeId}
</if> </if>
GROUP BY rid.type_id
ORDER BY rid.create_time DESC ORDER BY rid.create_time DESC
</select> </select>
<!--查询机具类型-库存数量--> <!--查询机具类型-库存数量-->