فهرست منبع

PC端,约检确认列表增加“检验员”列

yangguanjin 1 هفته پیش
والد
کامیت
914a644842

+ 4 - 0
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/controller/admin/appointmentconfirmorder/vo/AppointmentConfirmOrderRespVO.java

@@ -3,6 +3,7 @@ package cn.start.tz.module.pressure2.controller.admin.appointmentconfirmorder.vo
 //import cn.start.tz.module.pressure2.controller.admin.orderexception.vo.OrderExceptionRespVO;
 import cn.start.tz.module.pressure2.controller.admin.boilerorderexception.vo.BoilerOrderExceptionRespVO;
 import cn.start.tz.module.system.api.dept.dto.DeptRespDTO;
+import cn.start.tz.module.system.api.user.dto.AdminUserRespDTO;
 import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
 import com.alibaba.excel.annotation.ExcelProperty;
 import io.swagger.v3.oas.annotations.media.Schema;
@@ -163,6 +164,9 @@ public class AppointmentConfirmOrderRespVO {
     @Schema(description = "小组信息")
     private List<TeamItemVO> teamList;
 
+    @Schema(description = "检验员")
+    private List<AdminUserRespDTO> members;
+
     @Schema(description = "统一社会信用代码")
     private String socialCreditCode;
     /**

+ 61 - 0
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/service/appointmentconfirmorder/AppointmentConfirmOrderServiceImpl.java

@@ -26,7 +26,9 @@ import cn.start.tz.module.member.api.templatesendlog.dto.TemplateSendLogRespDto;
 import cn.start.tz.module.pressure2.controller.admin.boilerorderexception.vo.BoilerOrderExceptionSaveReqVO;
 import cn.start.tz.module.pressure2.dal.dataobject.acceptorder.AcceptOrderDO;
 import cn.start.tz.module.pressure2.dal.dataobject.equippipeschedulinguser.EquipPipeSchedulingUserDO;
+import cn.start.tz.module.pressure2.dal.dataobject.pipeappointmentconfirmorderuser.PipeAppointmentConfirmOrderUserDO;
 import cn.start.tz.module.pressure2.dal.mysql.equipboilerscheduling.EquipBoilerSchedulingMapper;
+import cn.start.tz.module.pressure2.dal.mysql.pipeappointmentconfirmorderuser.PipeAppointmentConfirmOrderUserMapper;
 import cn.start.tz.module.pressure2.enums.IndexTodoTypeNameEnum;
 import cn.start.tz.module.pressure2.enums.RedisKeyEnums;
 import cn.start.tz.module.pressure2.controller.admin.appointmentconfirmorder.vo.*;
@@ -146,6 +148,9 @@ public class AppointmentConfirmOrderServiceImpl implements AppointmentConfirmOrd
     @Resource
     private BoilerAppointmentConfirmOrderUserMapper appointmentConfirmOrderUserMapper;
 
+    @Resource
+    private PipeAppointmentConfirmOrderUserMapper pipeAppointmentConfirmOrderUserMapper;
+
     @Resource
     private AppointmentConfirmOrderRefuseItemMapper appointmentConfirmOrderRefuseItemMapper;
 
@@ -358,6 +363,62 @@ public class AppointmentConfirmOrderServiceImpl implements AppointmentConfirmOrd
             pageReqVO.getWarningDay()[1] = pageReqVO.getWarningDay()[1] == null ? 99999 : pageReqVO.getWarningDay()[1];
         }
         List<AppointmentConfirmOrderRespVO> list = appointmentConfirmOrderMapper.selectPage(pageReqVO);
+        Map<Integer, Set<String>> equipMainTypeToIdSetMap = new HashMap<>();
+        Map<String, AppointmentConfirmOrderRespVO> appointmentIdToEntityMap = new HashMap<>();
+        for (AppointmentConfirmOrderRespVO appointmentConfirmOrderRespVO : list) {
+            Set<String> confirmOrderIdSet = equipMainTypeToIdSetMap.computeIfAbsent(appointmentConfirmOrderRespVO.getEquipMainType(), key -> new HashSet<>());
+            confirmOrderIdSet.add(appointmentConfirmOrderRespVO.getId());
+            appointmentIdToEntityMap.put(appointmentConfirmOrderRespVO.getId(), appointmentConfirmOrderRespVO);
+        }
+
+        Map<String, Set<String>> userIdToConfirmOrderIdSetMap = new HashMap<>();
+        for (Map.Entry<Integer, Set<String>> equipMainTypeToIdSetEntry : equipMainTypeToIdSetMap.entrySet()) {
+            Integer equipMainType = equipMainTypeToIdSetEntry.getKey();
+            Set<String> confirOrderIdSet = equipMainTypeToIdSetEntry.getValue();
+            // 锅炉
+            if (equipMainType == 200) {
+                List<BoilerAppointmentConfirmOrderUserDO> boilerAppointmentConfirmOrderUserDOS = appointmentConfirmOrderUserMapper.selectList(BoilerAppointmentConfirmOrderUserDO::getOrderId, confirOrderIdSet);
+                for (BoilerAppointmentConfirmOrderUserDO boilerAppointmentConfirmOrderUserDO : boilerAppointmentConfirmOrderUserDOS) {
+                    String confirmOrderId = boilerAppointmentConfirmOrderUserDO.getOrderId();
+                    String userId = boilerAppointmentConfirmOrderUserDO.getUserId();
+                    Set<String> confirmOrderIdSet = userIdToConfirmOrderIdSetMap.computeIfAbsent(userId, k -> new HashSet<>());
+                    confirmOrderIdSet.add(confirmOrderId);
+                }
+            }
+            // 管道
+            if (equipMainType == 300) {
+                List<PipeAppointmentConfirmOrderUserDO> pipeAppointmentConfirmOrderUserDOS = pipeAppointmentConfirmOrderUserMapper.selectList(PipeAppointmentConfirmOrderUserDO::getOrderId, confirOrderIdSet);
+                for (PipeAppointmentConfirmOrderUserDO pipeAppointmentConfirmOrderUserDO : pipeAppointmentConfirmOrderUserDOS) {
+                    String confirmOrderId = pipeAppointmentConfirmOrderUserDO.getOrderId();
+                    String userId = pipeAppointmentConfirmOrderUserDO.getUserId();
+                    Set<String> confirmOrderIdSet = userIdToConfirmOrderIdSetMap.computeIfAbsent(userId, k -> new HashSet<>());
+                    confirmOrderIdSet.add(confirmOrderId);
+                }
+            }
+        }
+
+        Set<String> allUserIdSet = userIdToConfirmOrderIdSetMap.keySet();
+        Map<String, AdminUserRespDTO> userMap = adminUserApi.getUserMap(allUserIdSet);
+        for (Map.Entry<String, AdminUserRespDTO> userEntry : userMap.entrySet()) {
+            String userId = userEntry.getKey();
+            AdminUserRespDTO user = userEntry.getValue();
+            Set<String> confirmOrderIds = userIdToConfirmOrderIdSetMap.get(userId);
+            confirmOrderIds = confirmOrderIds == null ? new HashSet<>() : confirmOrderIds;
+            for (String confirmOrderId : confirmOrderIds) {
+                AppointmentConfirmOrderRespVO appointmentConfirmOrderRespVO = appointmentIdToEntityMap.get(confirmOrderId);
+                if (appointmentConfirmOrderRespVO == null) {
+                    continue;
+                }
+                List<AdminUserRespDTO> members = appointmentConfirmOrderRespVO.getMembers();
+                if (members == null) {
+                    members = new ArrayList<>();
+                    appointmentConfirmOrderRespVO.setMembers(members);
+                }
+                members.add(user);
+            }
+        }
+
+
         pageResult.setTotal(appointmentConfirmOrderMapper.selectPageCount(pageReqVO));
         if (CollUtil.isNotEmpty(list)) {
             List<String> deptIds = list.stream().map(AppointmentConfirmOrderRespVO::getDeptId).filter(Objects::nonNull).toList();