From ea8859c58b8fd24a54f7a838d6f8eaa98d57fb65 Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期三, 18 十二月 2024 11:44:07 +0800
Subject: [PATCH] 1、大理片笼进出片任务新增限制:进片玻璃数大于可用格子时,不允许进片 2、超过最大尺寸且直通通道有玻璃时 不能进片 3、大理片超过最大高度走直通通道 4、fixbug:笼子厚度限制

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

diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassRelationInfoServiceImpl.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassRelationInfoServiceImpl.java
index f7c5a54..39f344b 100644
--- a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassRelationInfoServiceImpl.java
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassRelationInfoServiceImpl.java
@@ -64,8 +64,7 @@
                 .eq(HollowGlassRelationInfo::getWidth, width)
                 .eq(HollowGlassRelationInfo::getHeight, height)
                 .eq(HollowGlassRelationInfo::getLayer, layer)
-                .isNull(HollowGlassRelationInfo::getTemperingLayoutId)
-                .isNull(HollowGlassRelationInfo::getTemperingFeedSequence)
+                .eq(HollowGlassRelationInfo::getState, Const.HOLLOW_RELATION_NEW)
                 .orderByAsc(HollowGlassRelationInfo::getHollowSequence)
                 .last("limit 1")
         );
@@ -78,19 +77,24 @@
                     .eq(HollowGlassRelationInfo::getWidth, width)
                     .eq(HollowGlassRelationInfo::getHeight, height)
                     .eq(HollowGlassRelationInfo::getLayer, layer)
-                    .isNull(HollowGlassRelationInfo::getTemperingLayoutId)
-                    .isNull(HollowGlassRelationInfo::getTemperingFeedSequence)
+                    .eq(HollowGlassRelationInfo::getState, Const.HOLLOW_RELATION_NEW)
                     .orderByAsc(HollowGlassRelationInfo::getHollowSequence)
                     .last("limit 1")
             );
         }
         HollowBigStorageCageDetails hollowDetails = hollowBigStorageCageDetailsService.getOne(new LambdaQueryWrapper<HollowBigStorageCageDetails>()
-                .eq(HollowBigStorageCageDetails::getVirtualSlot, relationInfoOne.getVirtualSlot()).in(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL_ZERO)
+                .eq(HollowBigStorageCageDetails::getFlowCardId, relationInfoOne.getFlowCardId())
+                .eq(HollowBigStorageCageDetails::getLayer, layer)
+                .eq(HollowBigStorageCageDetails::getVirtualSlot, relationInfoOne.getVirtualSlot())
+                .in(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL_ZERO)
                 .orderByDesc(HollowBigStorageCageDetails::getSequence).last("limit 1"));
         HollowBigStorageCage storageCage = null;
         if (null == hollowDetails) {
             storageCage = hollowBigStorageCageService.getOne(new LambdaQueryWrapper<HollowBigStorageCage>()
-                    .eq(HollowBigStorageCage::getEnableState, Const.SLOT_ON).eq(HollowBigStorageCage::getRemainWidth, slotWidth).last("limit 1"));
+                    .eq(HollowBigStorageCage::getEnableState, Const.SLOT_ON).eq(HollowBigStorageCage::getRemainWidth, slotWidth)
+                    .le(HollowBigStorageCage::getMinThickness, relationInfoOne.getThickness())
+                    .ge(HollowBigStorageCage::getMaxThickness, relationInfoOne.getThickness())
+                    .orderByAsc(HollowBigStorageCage::getMaxThickness).last("limit 1"));
             HollowBigStorageDTO storageDTO = new HollowBigStorageDTO();
             BeanUtils.copyProperties(storageCage, storageDTO);
             BeanUtils.copyProperties(relationInfoOne, storageDTO);
@@ -104,7 +108,10 @@
         if (null == relationInfoBefore) {
             //琛ㄧず搴忓彿娌℃湁鎴栬��  搴忓彿涓�1鍙堜笉鏄涓�鍧楁潵鐨� 鏂板紑涓�鏍�
             storageCage = hollowBigStorageCageService.getOne(new LambdaQueryWrapper<HollowBigStorageCage>()
-                    .eq(HollowBigStorageCage::getEnableState, Const.SLOT_ON).eq(HollowBigStorageCage::getRemainWidth, slotWidth).last("limit 1"));
+                    .eq(HollowBigStorageCage::getEnableState, Const.SLOT_ON).eq(HollowBigStorageCage::getRemainWidth, slotWidth)
+                    .le(HollowBigStorageCage::getMinThickness, relationInfoOne.getThickness())
+                    .ge(HollowBigStorageCage::getMaxThickness, relationInfoOne.getThickness())
+                    .orderByAsc(HollowBigStorageCage::getMaxThickness).last("limit 1"));
         } else {
             HollowBigStorageCageDetails beforeGlass = hollowBigStorageCageDetailsService.getOne(new LambdaQueryWrapper<HollowBigStorageCageDetails>()
                     .in(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL_ZERO)
@@ -114,7 +121,10 @@
             );
             if (null == beforeGlass) {
                 storageCage = hollowBigStorageCageService.getOne(new LambdaQueryWrapper<HollowBigStorageCage>()
-                        .eq(HollowBigStorageCage::getEnableState, Const.SLOT_ON).eq(HollowBigStorageCage::getRemainWidth, slotWidth).last("limit 1"));
+                        .eq(HollowBigStorageCage::getEnableState, Const.SLOT_ON).eq(HollowBigStorageCage::getRemainWidth, slotWidth)
+                        .le(HollowBigStorageCage::getMinThickness, relationInfoOne.getThickness())
+                        .ge(HollowBigStorageCage::getMaxThickness, relationInfoOne.getThickness())
+                        .orderByAsc(HollowBigStorageCage::getMaxThickness).last("limit 1"));
             } else {
                 storageCage = hollowBigStorageCageService.getOne(new LambdaQueryWrapper<HollowBigStorageCage>()
                         .eq(HollowBigStorageCage::getEnableState, Const.SLOT_ON).eq(HollowBigStorageCage::getSlot, beforeGlass.getSlot()));
@@ -200,6 +210,7 @@
                     hollow.setVirtualSlot(temp.get(0).getVirtualSlot());
                     hollow.setFilmsId(glassInfo.getFilmsid());
                     hollow.setThickness(glassInfo.getThickness());
+                    hollow.setState(Const.HOLLOW_RELATION_NEW);
                     temp.add(hollow);
                     flag = true;
                     break;
@@ -214,6 +225,7 @@
                 hollow.setVirtualSlot(slotNumber++);
                 hollow.setFilmsId(glassInfo.getFilmsid());
                 hollow.setThickness(glassInfo.getThickness());
+                hollow.setState(Const.HOLLOW_RELATION_NEW);
                 newList.add(hollow);
                 tempHollowList.add(newList);
             }
@@ -242,11 +254,16 @@
         return dtos.stream().collect(Collectors.groupingBy(FlowCardGlassInfoDTO::getFlowCardId));
     }
 
+    //    @Override
+//    public Map<Integer, List<LackDetailsDTO>>  queryLackByFlowCard(String flowCardId) {
+//        List<LackDetailsDTO> lackDetailsList = this.baseMapper.queryLackByFlowCard(flowCardId);
+//        Map<Integer, List<LackDetailsDTO>> listMap = lackDetailsList.stream().collect(Collectors.groupingBy(LackDetailsDTO::getLayer));
+//        return listMap;
+//    }
     @Override
-    public Map<Integer, List<LackDetailsDTO>>  queryLackByFlowCard(String flowCardId) {
+    public List<LackDetailsDTO> queryLackByFlowCard(String flowCardId) {
         List<LackDetailsDTO> lackDetailsList = this.baseMapper.queryLackByFlowCard(flowCardId);
-        Map<Integer, List<LackDetailsDTO>> listMap = lackDetailsList.stream().collect(Collectors.groupingBy(LackDetailsDTO::getLayer));
-        return listMap;
+        return lackDetailsList;
     }
 
 }

--
Gitblit v1.8.0