From c6cb57f307b0c62a05cac78cfd828c313f10e611 Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期二, 15 四月 2025 10:58:25 +0800
Subject: [PATCH] 1、卧式理片笼新增任务逻辑 2、入参时间加入时区

---
 hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassRelationInfoServiceImpl.java |   57 +++++++++++++++++++++++++++++----------------------------
 1 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassRelationInfoServiceImpl.java b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassRelationInfoServiceImpl.java
index 53b5663..75754d3 100644
--- a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassRelationInfoServiceImpl.java
+++ b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassRelationInfoServiceImpl.java
@@ -16,6 +16,7 @@
 import com.mes.hollow.entity.dto.HollowBigStorageDTO;
 import com.mes.hollow.entity.dto.HollowGlassDetailsDTO;
 import com.mes.hollow.entity.dto.LackDetailsDTO;
+import com.mes.hollow.entity.vo.HollowAllFlowCardVO;
 import com.mes.hollow.entity.vo.HollowBigStorageDetailsQueryVO;
 import com.mes.hollow.mapper.HollowGlassRelationInfoMapper;
 import com.mes.hollow.service.HollowBigStorageCageDetailsService;
@@ -29,7 +30,7 @@
 
 import javax.annotation.Resource;
 import java.util.ArrayList;
-import java.util.HashMap;
+import java.util.Comparator;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -289,7 +290,7 @@
     }
 
     @Override
-    public Map<String, List<FlowCardGlassInfoDTO>> queryHollowAllFlowCard(HollowBigStorageDetailsQueryVO query) {
+    public List<HollowAllFlowCardVO> queryHollowAllFlowCard(HollowBigStorageDetailsQueryVO query) {
         List<HollowBigStorageCageDetails> detailsList = hollowBigStorageCageDetailsService.list(new LambdaQueryWrapper<HollowBigStorageCageDetails>()
                 .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN)
                 .like(StringUtils.isNotBlank(query.getFilmsId()), HollowBigStorageCageDetails::getFilmsId, query.getFilmsId())
@@ -299,37 +300,32 @@
         );
         if (CollectionUtil.isEmpty(detailsList)) {
             log.info("绗煎唴鏃犵幓鐠�");
-            return new HashMap<>();
+            return new ArrayList<>();
         }
         Map<String, List<HollowBigStorageCageDetails>> listMap = detailsList.stream().collect(Collectors.groupingBy(HollowBigStorageCageDetails::getFlowCardId));
-        List<FlowCardGlassInfoDTO> dtos = new ArrayList<>();
+        List<HollowAllFlowCardVO> resultList = new ArrayList<>();
         listMap.forEach((e, v) -> {
+            HollowAllFlowCardVO hollowAllFlowCardVO = new HollowAllFlowCardVO();
             HollowBigStorageCageDetails cageDetails = v.get(0);
-            dtos.addAll(hollowBigStorageCageDetailsService.hollowIsAll(e, cageDetails.getTotalLayer(), Boolean.FALSE));
+            hollowAllFlowCardVO.setFlowCardId(e);
+            if (cageDetails.getHollowSequence() == 0) {
+                hollowAllFlowCardVO.setIsThroughSlot(Boolean.TRUE);
+            } else {
+                hollowAllFlowCardVO.setIsThroughSlot(Boolean.FALSE);
+            }
+            //鎸夌収娴佺▼鍗¤幏鍙栧搴旂殑浜у搧鍚嶇О
+            String productName = baseMapper.queryProductNameByFlowCardId(cageDetails.getFlowCardId());
+            hollowAllFlowCardVO.setProductName(productName);
+            List<FlowCardGlassInfoDTO> flowCardInfoList = hollowBigStorageCageDetailsService.hollowIsAll(e, cageDetails.getTotalLayer(), Boolean.FALSE);
+            hollowAllFlowCardVO.setFlowCardGlassInfoDTOList(flowCardInfoList);
+            resultList.add(hollowAllFlowCardVO);
         });
-        Map<String, FlowCardGlassInfoDTO> result = dtos.stream()
-                .collect(Collectors.toMap(
-                        FlowCardGlassInfoDTO::getFlowCardId,
-                        dto -> {
-                            FlowCardGlassInfoDTO newDto = new FlowCardGlassInfoDTO();
-                            newDto.setFlowCardId(dto.getFlowCardId());
-                            newDto.setSumCount(dto.getSumCount());
-                            newDto.setPairCount(dto.getPairCount());
-                            newDto.setRealCount(dto.getRealCount());
-                            newDto.setLayer(dto.getLayer());
-                            return newDto;
-                        },
-                        (dto1, dto2) -> {
-                            dto1.setRealCount(dto1.getRealCount() + dto2.getRealCount()); // 绱姞 realCount
-                            dto1.setLayer(Math.max(dto1.getLayer(),dto2.getLayer())); // 绱姞 鏈�澶у眰鏁�
-                            return dto1; // 杩斿洖鍚堝苟鍚庣殑瀵硅薄
-                        }
-                ));
-        return dtos.stream().collect(Collectors.groupingBy(FlowCardGlassInfoDTO::getFlowCardId));
+        return resultList;
+//        return dtos.stream().collect(Collectors.groupingBy(e -> e.getFlowCardId() + ":" + e.getProductName()));
     }
 
     @Override
-    public Map<String, FlowCardGlassInfoDTO> queryHollowAllFlowCardSummary(HollowBigStorageDetailsQueryVO query) {
+    public List<FlowCardGlassInfoDTO> queryHollowAllFlowCardSummary(HollowBigStorageDetailsQueryVO query) {
         List<HollowBigStorageCageDetails> detailsList = hollowBigStorageCageDetailsService.list(new LambdaQueryWrapper<HollowBigStorageCageDetails>()
                 .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN)
                 .like(StringUtils.isNotBlank(query.getFilmsId()), HollowBigStorageCageDetails::getFilmsId, query.getFilmsId())
@@ -339,7 +335,7 @@
         );
         if (CollectionUtil.isEmpty(detailsList)) {
             log.info("绗煎唴鏃犵幓鐠�");
-            return new HashMap<>();
+            return null;
         }
         Map<String, List<HollowBigStorageCageDetails>> listMap = detailsList.stream().collect(Collectors.groupingBy(HollowBigStorageCageDetails::getFlowCardId));
         List<FlowCardGlassInfoDTO> dtos = new ArrayList<>();
@@ -362,12 +358,17 @@
                         },
                         (dto1, dto2) -> {
                             dto1.setRealCount(dto1.getRealCount() + dto2.getRealCount()); // 绱姞 realCount
-                            dto1.setLayer(Math.max(dto1.getLayer(),dto2.getLayer())); // 绱姞 鏈�澶у眰鏁�
+                            dto1.setLayer(Math.max(dto1.getLayer(), dto2.getLayer())); // 绱姞 鏈�澶у眰鏁�
                             dto1.setSlotCount(dto1.getSlotCount() + dto2.getSlotCount());
                             return dto1; // 杩斿洖鍚堝苟鍚庣殑瀵硅薄
                         }
                 ));
-        return result;
+        List<FlowCardGlassInfoDTO> resultList = new ArrayList<>(result.values());
+        List<FlowCardGlassInfoDTO> sortedList = resultList.stream()
+                .sorted(Comparator.comparing(FlowCardGlassInfoDTO::getRealCount).reversed()  // 绗竴涓瓧娈靛�掑簭
+                        .thenComparing(FlowCardGlassInfoDTO::getSumCount, Comparator.reverseOrder()))  // 绗簩涓瓧娈靛�掑簭
+                .collect(Collectors.toList());
+        return sortedList;
     }
 
     @Override

--
Gitblit v1.8.0