From c823892f961b266199731ddd365d2dd4af4bf382 Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期二, 03 十二月 2024 08:50:27 +0800
Subject: [PATCH] 1、中空线初步版本,待优化 2、fixbug 钢化后摆片顺序错乱

---
 hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/service/impl/HollowGlassQueueInfoServiceImpl.java   |   44 ------
 hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/HollowGlassOutRelationInfo.java                   |    8 +
 hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowBigStorageCageDetailsServiceImpl.java |    5 
 hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/mapper/HollowBigStorageCageDetailsMapper.java            |    1 
 hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java  |    3 
 hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/HollowBigStorageCageDetails.java                  |    9 -
 hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/FlowCardVirtualSlotDTO.java                   |    4 
 hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/service/HollowGlassQueueInfoService.java            |    4 
 hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/controller/HollowGlassQueueInfoController.java      |   11 -
 hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowBigStorageCageDetailsService.java          |    1 
 hangzhoumesParent/common/servicebase/src/main/java/com/mes/base/entity/HollowBigStorageCageBaseInfo.java                                 |   64 ++++++++++
 hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassOutRelationInfoService.java           |    2 
 hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageHollowTask.java                            |  104 ++++++++++-------
 hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageNewTask.java                         |    9 
 hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/entity/HollowGlassQueueInfo.java                    |    8 -
 hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml                       |   79 ++++++++++--
 hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowGlassOutRelationInfoController.java     |    4 
 17 files changed, 227 insertions(+), 133 deletions(-)

diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/base/entity/HollowBigStorageCageBaseInfo.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/base/entity/HollowBigStorageCageBaseInfo.java
new file mode 100644
index 0000000..261ec06
--- /dev/null
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/base/entity/HollowBigStorageCageBaseInfo.java
@@ -0,0 +1,64 @@
+package com.mes.base.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @Author : zhoush
+ * @Date: 2024/6/21 9:40
+ * @Description:
+ */
+@Data
+public class HollowBigStorageCageBaseInfo {
+
+    /**
+     * 宸ョ▼鍙�
+     */
+    @ApiModelProperty(value = "宸ョ▼鍙�", position = 16)
+    private String engineerId;
+    /**
+     * 鐜荤拑id
+     */
+    @ApiModelProperty(value = "鐜荤拑id")
+    private String glassId;
+    /**
+     * 閽㈠寲鐗堝浘id
+     */
+    @ApiModelProperty(value = "閽㈠寲鐗堝浘id", position = 12)
+    private Integer temperingLayoutId;
+
+    /**
+     * 閽㈠寲鐗堝浘鐗囧簭
+     */
+    @ApiModelProperty(value = "閽㈠寲鐗堝浘鐗囧簭", position = 13)
+    private Integer temperingFeedSequence;
+
+    /**
+     * 瀹�
+     */
+    @ApiModelProperty(value = "瀹�")
+    private double width;
+    /**
+     * 瀹�
+     */
+    @ApiModelProperty(value = "楂�")
+    private double height;
+
+    /**
+     * 鏍煎瓙鍙�
+     */
+    @ApiModelProperty(value = "鐜荤拑id")
+    private Integer slot;
+
+    /**
+     * /*灞傚彿
+     */
+    private Integer layer;
+
+    /**
+     * 鏍煎瓙鍙�
+     */
+    @ApiModelProperty(value = "鐜荤拑id")
+
+    private Integer isPair;
+}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageNewTask.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageNewTask.java
index 4788c66..d4cbd15 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageNewTask.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageNewTask.java
@@ -90,8 +90,6 @@
     @Value("${mes.outCarMaxSize}")
     private Integer outCarMaxSize;
 
-    @Value("${mes.sequence.order}")
-    private boolean sequenceOrder;
     @Value("${mes.temperingOutTargetPosition}")
     private Integer temperingOutTargetPosition;
     @Value("${mes.artificialOutTargetPosition}")
@@ -225,7 +223,8 @@
         //鏄惁鍏佽閽㈠寲
         //鏄惁鏈夋鍦ㄩ挗鍖栫殑鐜荤拑:閽㈠寲灏忕墖琛ㄥ叧鑱斿巻鍙蹭换鍔¤〃锛岀瓫閫夋湭鍑虹鐨勭幓鐠冧俊鎭�
 //            鑾峰彇褰撳墠閽㈠寲浠诲姟鏈畬鎴愬嚭鐗囩殑鐜荤拑淇℃伅
-        List<TemperingGlassInfo> unFinishTemperingGlassInfoList = temperingGlassInfoService.list(new LambdaQueryWrapper<TemperingGlassInfo>().eq(TemperingGlassInfo::getState, Const.TEMPERING_NEW));
+        List<TemperingGlassInfo> unFinishTemperingGlassInfoList = temperingGlassInfoService.list(new LambdaQueryWrapper<TemperingGlassInfo>()
+                .eq(TemperingGlassInfo::getState, Const.TEMPERING_NEW).orderByAsc(TemperingGlassInfo::getTemperingFeedSequence));
         if (CollectionUtil.isNotEmpty(unFinishTemperingGlassInfoList)) {
 //            List<String> glassIdList = unFinishTemperingGlassInfoList.stream().map(TemperingGlassInfo::getGlassId).collect(Collectors.toList());
 //            List<BigStorageCageHistoryTask> historyTaskList = bigStorageCageHistoryTaskService.list(new LambdaQueryWrapper<BigStorageCageHistoryTask>()
@@ -260,7 +259,7 @@
                             .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN)
                             .eq(GlassInfo::getTemperingLayoutId, item.getTemperingLayoutId())
                             .eq(GlassInfo::getEngineerId, item.getEngineerId())
-                            .orderBy(Boolean.TRUE, sequenceOrder, GlassInfo::getTemperingFeedSequence));
+                            .orderByAsc(GlassInfo::getTemperingFeedSequence));
                     if (CollectionUtil.isNotEmpty(temperingGlassInfos)) {
                         temperingGlassInfoService.saveBatch(temperingGlassInfos);
                         computeOutGlassInfoByVirtualSlot(temperingGlassInfos, "big_storage_cage_out_one_task", temperingOutTargetPosition, Const.GLASS_STATE_OUT_ING, Const.BIG_STORAGE_BEFORE_OUT);
@@ -644,7 +643,7 @@
         log.info("灏嗗嚭鐗囩幓鐠儃}鐜荤拑鐘舵�佹敼涓哄嚭鐗囦腑", glassIds);
         bigStorageCageDetailsService.update(new LambdaUpdateWrapper<BigStorageCageDetails>()
                 .set(BigStorageCageDetails::getState, state)
-                .set(Const.RAW_GLASS_TASK_TYPE_DISPATCH.equals(taskType), BigStorageCageBaseInfo::getSlot, targetSlot)
+                .set(Const.BIG_STORAGE_BEFORE_DISPATCH.equals(taskType), BigStorageCageBaseInfo::getSlot, targetSlot)
                 .ne(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT)
                 .in(BigStorageCageDetails::getGlassId, glassIds));
         try {
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowGlassOutRelationInfoController.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowGlassOutRelationInfoController.java
index f8eaebd..12b593a 100644
--- a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowGlassOutRelationInfoController.java
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowGlassOutRelationInfoController.java
@@ -26,8 +26,8 @@
 
     @ApiOperation("棰嗗彇浠诲姟")
     @PostMapping("/receiveTask")
-    public Result<HollowGlassOutRelationInfo> receiveTask(String flowCardId, int cell) {
-        return Result.success(hollowGlassOutRelationInfoService.receiveTask(flowCardId, cell));
+    public Result<HollowGlassOutRelationInfo> receiveTask(String flowCardId, int cell, int totalPairQuantity) {
+        return Result.success(hollowGlassOutRelationInfoService.receiveTask(flowCardId, cell, totalPairQuantity));
     }
 
 }
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/HollowBigStorageCageDetails.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/HollowBigStorageCageDetails.java
index 806280e..fb77157 100644
--- a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/HollowBigStorageCageDetails.java
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/HollowBigStorageCageDetails.java
@@ -2,7 +2,7 @@
 
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
-import com.mes.base.entity.BigStorageCageBaseInfo;
+import com.mes.base.entity.HollowBigStorageCageBaseInfo;
 import lombok.Data;
 
 import java.util.Date;
@@ -14,7 +14,7 @@
  * @since 2024-11-21 09:23:12
  */
 @Data
-public class HollowBigStorageCageDetails extends BigStorageCageBaseInfo {
+public class HollowBigStorageCageDetails extends HollowBigStorageCageBaseInfo {
     /**
      * /*澶х悊鐗囩璇︽儏琛╥d
      */
@@ -67,10 +67,6 @@
      * /*灞傚彿
      */
     private Integer hollowSequence;
-    /**
-     * /*灞傚彿
-     */
-    private Integer layer;
 
     /**
      * 鍒涘缓鏃堕棿
@@ -80,7 +76,6 @@
      * 鏇存柊鏃堕棿
      */
     private Date updateTime;
-
 
 }
 
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/HollowGlassOutRelationInfo.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/HollowGlassOutRelationInfo.java
index 47eddfe..4882347 100644
--- a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/HollowGlassOutRelationInfo.java
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/HollowGlassOutRelationInfo.java
@@ -36,6 +36,14 @@
      */
     private Integer state;
     /**
+     * 鎬婚厤瀵规暟閲�
+     */
+    private Integer totalPairQuantity;
+    /**
+     * 宸插畬鎴愰厤瀵规暟閲�
+     */
+    private Integer pairQuantity;
+    /**
      * /*鍒涘缓鏃堕棿
      */
     private Date createTime;
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/FlowCardVirtualSlotDTO.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/FlowCardVirtualSlotDTO.java
index 00bd252..84670d9 100644
--- a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/FlowCardVirtualSlotDTO.java
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/FlowCardVirtualSlotDTO.java
@@ -15,6 +15,10 @@
      */
     private String flowCardId;
     /**
+     * 灞傚彿
+     */
+    private Integer layer;
+    /**
      * /*铏氭嫙鏍煎瓙
      */
     private Integer virtualSlot;
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/mapper/HollowBigStorageCageDetailsMapper.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/mapper/HollowBigStorageCageDetailsMapper.java
index ebf5b15..699d21d 100644
--- a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/mapper/HollowBigStorageCageDetailsMapper.java
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/mapper/HollowBigStorageCageDetailsMapper.java
@@ -26,5 +26,6 @@
 
     List<BigStorageSequenceDTO> queryNeedDispatchSlot(FlowCardVirtualSlotDTO flowCardVirtualSlotDTO);
 
+    List<HollowBigStorageCageDetails> queryOutGlassList(@Param("flowCardId") String flowCardId, @Param("cell") int cell);
 }
 
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowBigStorageCageDetailsService.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowBigStorageCageDetailsService.java
index ab13d98..0e1feb6 100644
--- a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowBigStorageCageDetailsService.java
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowBigStorageCageDetailsService.java
@@ -26,5 +26,6 @@
 
     List<BigStorageSequenceDTO> queryNeedDispatchSlot(FlowCardVirtualSlotDTO flowCardVirtualSlotDTO);
 
+    List<HollowBigStorageCageDetails> queryOutGlassList(String flowCardId, int cell);
 }
 
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassOutRelationInfoService.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassOutRelationInfoService.java
index da3e21a..999c34e 100644
--- a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassOutRelationInfoService.java
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassOutRelationInfoService.java
@@ -11,6 +11,6 @@
  */
 public interface HollowGlassOutRelationInfoService extends IService<HollowGlassOutRelationInfo> {
 
-    HollowGlassOutRelationInfo receiveTask(String flowCardId, int cell);
+    HollowGlassOutRelationInfo receiveTask(String flowCardId, int cell, int totalPairQuantity);
 }
 
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowBigStorageCageDetailsServiceImpl.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowBigStorageCageDetailsServiceImpl.java
index 5f11afe..9331204 100644
--- a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowBigStorageCageDetailsServiceImpl.java
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowBigStorageCageDetailsServiceImpl.java
@@ -43,5 +43,10 @@
     public List<BigStorageSequenceDTO> queryNeedDispatchSlot(FlowCardVirtualSlotDTO flowCardVirtualSlotDTO) {
         return baseMapper.queryNeedDispatchSlot(flowCardVirtualSlotDTO);
     }
+
+    @Override
+    public List<HollowBigStorageCageDetails> queryOutGlassList(String flowCardId, int cell) {
+        return baseMapper.queryOutGlassList(flowCardId, cell);
+    }
 }
 
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java
index 76e0636..63438cc 100644
--- a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java
@@ -27,7 +27,7 @@
     GlassInfoService glassInfoService;
 
     @Override
-    public HollowGlassOutRelationInfo receiveTask(String flowCardId, int cell) {
+    public HollowGlassOutRelationInfo receiveTask(String flowCardId, int cell, int totalPairQuantity) {
         GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getFlowCardId, flowCardId).last("limit 1"));
         HollowGlassOutRelationInfo info = new HollowGlassOutRelationInfo();
         if (null == glassInfo) {
@@ -39,6 +39,7 @@
         info.setTotalLayer(glassInfo.getTotalLayer());
         info.setTotalLayer(glassInfo.getTotalLayer());
         info.setState(Const.HOLLOW_FLOW_CARD_NEW);
+        info.setTotalPairQuantity(totalPairQuantity);
         this.save(info);
         return info;
     }
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/controller/HollowGlassQueueInfoController.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/controller/HollowGlassQueueInfoController.java
index 668f35f..34c1fe9 100644
--- a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/controller/HollowGlassQueueInfoController.java
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/controller/HollowGlassQueueInfoController.java
@@ -26,15 +26,8 @@
 
     @ApiOperation("寮哄埗鍑虹墖")
     @PostMapping("/forceOutGlass")
-    public Result<String> forceOutGlass(String flowCardId, int cell) {
-        hollowGlassQueueInfoService.forceOutGlass(flowCardId, cell);
-        return Result.success("success");
-    }
-
-    @ApiOperation("鍒囨崲绾胯矾寮哄埗鍑虹墖")
-    @PostMapping("/changeForceOutGlass")
-    public Result<String> changeForceOutGlass(String flowCardId, int cell) {
-        hollowGlassQueueInfoService.changeForceOutGlass(flowCardId, cell);
+    public Result<String> forceOutGlass(String flowCardId, int cell, int totalPairQuantity) {
+        hollowGlassQueueInfoService.forceOutGlass(flowCardId, cell, totalPairQuantity);
         return Result.success("success");
     }
 
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/entity/HollowGlassQueueInfo.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/entity/HollowGlassQueueInfo.java
index 9f3da49..c7095e2 100644
--- a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/entity/HollowGlassQueueInfo.java
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/entity/HollowGlassQueueInfo.java
@@ -2,7 +2,7 @@
 
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
-import com.mes.base.entity.BigStorageCageBaseInfo;
+import com.mes.base.entity.HollowBigStorageCageBaseInfo;
 import lombok.Data;
 
 import java.util.Date;
@@ -14,7 +14,7 @@
  * @since 2024-11-30 10:19:55
  */
 @Data
-public class HollowGlassQueueInfo extends BigStorageCageBaseInfo {
+public class HollowGlassQueueInfo extends HollowBigStorageCageBaseInfo {
     /**
      * /*澶х悊鐗囩璇︽儏琛╥d
      */
@@ -62,10 +62,6 @@
      * /*鎬诲眰鍙�
      */
     private Integer totalLayer;
-    /**
-     * /*灞傚彿
-     */
-    private Integer layer;
     /**
      * /*鍒涘缓鏃堕棿
      */
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/service/HollowGlassQueueInfoService.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/service/HollowGlassQueueInfoService.java
index 484fd88..a394fa8 100644
--- a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/service/HollowGlassQueueInfoService.java
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/service/HollowGlassQueueInfoService.java
@@ -13,9 +13,7 @@
  */
 public interface HollowGlassQueueInfoService extends IService<HollowGlassQueueInfo> {
 
-    void forceOutGlass(String flowCardId, int cell);
-
-    void changeForceOutGlass(String flowCardId, int cell);
+    void forceOutGlass(String flowCardId, int cell, int totalPairQuantity);
 
     List<HollowGlassQueueInfo> queryHollowGlassQueueInfo(int cell);
 }
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/service/impl/HollowGlassQueueInfoServiceImpl.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/service/impl/HollowGlassQueueInfoServiceImpl.java
index e7354e6..0c41e55 100644
--- a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/service/impl/HollowGlassQueueInfoServiceImpl.java
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/service/impl/HollowGlassQueueInfoServiceImpl.java
@@ -34,19 +34,13 @@
     HollowGlassOutRelationInfoService hollowGlassOutRelationInfoService;
 
     @Override
-    public void forceOutGlass(String flowCardId, int cell) {
-        hollowGlassOutRelationInfoService.receiveTask(flowCardId, cell);
+    public void forceOutGlass(String flowCardId, int cell, int totalPairQuantity) {
+        hollowGlassOutRelationInfoService.receiveTask(flowCardId, cell, totalPairQuantity);
         hollowGlassOutRelationInfoService.update(new LambdaUpdateWrapper<HollowGlassOutRelationInfo>()
                 .eq(HollowGlassOutRelationInfo::getFlowCardId, flowCardId)
                 .set(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START)
         );
-        List<HollowBigStorageCageDetails> hollowBigStorageCageDetailsList = hollowBigStorageCageDetailsService.list(new LambdaQueryWrapper<HollowBigStorageCageDetails>()
-                .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN)
-                .eq(HollowBigStorageCageDetails::getFlowCardId, flowCardId)
-                .orderByAsc(HollowBigStorageCageDetails::getVirtualSlot)
-                .orderBy(Boolean.TRUE, cell != 931, HollowBigStorageCageDetails::getSequence)
-                .orderByAsc(HollowBigStorageCageDetails::getHollowSequence)
-        );
+        List<HollowBigStorageCageDetails> hollowBigStorageCageDetailsList = hollowBigStorageCageDetailsService.queryOutGlassList(flowCardId, cell);
 
         List<HollowGlassQueueInfo> hollowQueues = hollowBigStorageCageDetailsList.stream().map(queue -> {
             HollowGlassQueueInfo queueInfo = new HollowGlassQueueInfo();
@@ -57,38 +51,6 @@
         }).collect(Collectors.toList());
         this.saveBatch(hollowQueues);
     }
-
-    @Override
-    public void changeForceOutGlass(String flowCardId, int cell) {
-        hollowGlassOutRelationInfoService.update(new LambdaUpdateWrapper<HollowGlassOutRelationInfo>()
-                .eq(HollowGlassOutRelationInfo::getFlowCardId, flowCardId)
-                .set(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START)
-        );
-        //鎯呭喌鍘嗗彶浠诲姟涓湭鍋氬畬鐨勭幓鐠冧俊鎭�
-        this.remove(new LambdaQueryWrapper<HollowGlassQueueInfo>()
-                .eq(HollowGlassQueueInfo::getFlowCardId, flowCardId)
-                .eq(HollowGlassQueueInfo::getCell, cell)
-                .eq(HollowGlassQueueInfo::getState, Const.TEMPERING_NEW)
-        );
-        //鎸夌収绾胯矾閲嶆柊鍘荤悊鐗囩鏌ヨ鐜荤拑淇℃伅
-        List<HollowBigStorageCageDetails> hollowBigStorageCageDetailsList = hollowBigStorageCageDetailsService.list(new LambdaQueryWrapper<HollowBigStorageCageDetails>()
-                .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN)
-                .eq(HollowBigStorageCageDetails::getFlowCardId, flowCardId)
-                .orderByAsc(HollowBigStorageCageDetails::getVirtualSlot)
-                .orderBy(Boolean.TRUE, cell != 931, HollowBigStorageCageDetails::getSequence)
-                .orderByAsc(HollowBigStorageCageDetails::getHollowSequence)
-        );
-
-        List<HollowGlassQueueInfo> hollowQueues = hollowBigStorageCageDetailsList.stream().map(queue -> {
-            HollowGlassQueueInfo queueInfo = new HollowGlassQueueInfo();
-            BeanUtils.copyProperties(queue, queueInfo);
-            queueInfo.setState(Const.TEMPERING_NEW);
-            queueInfo.setCell(cell);
-            return queueInfo;
-        }).collect(Collectors.toList());
-        this.saveBatch(hollowQueues);
-    }
-
     @Override
     public List<HollowGlassQueueInfo> queryHollowGlassQueueInfo(int cell) {
         HollowGlassOutRelationInfo one = hollowGlassOutRelationInfoService.getOne(new LambdaUpdateWrapper<HollowGlassOutRelationInfo>()
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageHollowTask.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageHollowTask.java
index 443b283..bbfea54 100644
--- a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageHollowTask.java
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageHollowTask.java
@@ -7,7 +7,7 @@
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.kangaroohy.milo.model.ReadWriteEntity;
 import com.kangaroohy.milo.service.MiloService;
-import com.mes.base.entity.BigStorageCageBaseInfo;
+import com.mes.base.entity.HollowBigStorageCageBaseInfo;
 import com.mes.bigstoragecagetask.entity.BigStorageCageTask;
 import com.mes.bigstoragecagetask.service.BigStorageCageTaskService;
 import com.mes.common.config.Const;
@@ -71,6 +71,9 @@
     private HollowGlassQueueInfoService hollowGlassQueueInfoService;
     @Resource
     private HollowGlassOutRelationInfoService hollowGlassOutRelationInfoService;
+
+    private static final String BIG_STORAGE_CAGE_IN_TWO_TASK = "big_storage_cage_in_two_task";
+    private static final String BIG_STORAGE_CAGE_OUT_TWO_TASK = "big_storage_cage_out_two_task";
     @Autowired(required = false)
     MiloService miloService;
     @Resource
@@ -87,14 +90,6 @@
 
     @Value("${mes.outCarMaxSize}")
     private Integer outCarMaxSize;
-
-    @Value("${mes.sequence.order}")
-    private boolean sequenceOrder;
-
-    @Value("${mes.temperingOutTargetPosition}")
-    private Integer temperingOutTargetPosition;
-    @Value("${mes.artificialOutTargetPosition}")
-    private Integer artificialOutTargetPosition;
 
     @Scheduled(fixedDelay = 1000)
     public void inBigStorageTask() throws Exception {
@@ -173,7 +168,7 @@
                     .eq(HollowBigStorageCage::getSlot, bigStorageDTO.getSlot()));
             task.setTargetSlot(bigStorageDTO.getSlot());
             task.setGlassId(info.getGlassId());
-            bigStorageCageTaskService.updateTaskMessage("big_storage_cage_in_two_task", task);
+            bigStorageCageTaskService.updateTaskMessage(BIG_STORAGE_CAGE_IN_TWO_TASK, task);
             //瀛樻斁鍘嗗彶浠诲姟
             HollowBigStorageCageHistoryTask historyTask = new HollowBigStorageCageHistoryTask();
             BeanUtils.copyProperties(task, historyTask);
@@ -227,7 +222,7 @@
             return;
         }
         //鑾峰彇鍑虹墖浠诲姟琛�
-        List<BigStorageCageTask> outTaskList = bigStorageCageTaskService.queryTaskMessage("big_storage_cage_out_two_task");
+        List<BigStorageCageTask> outTaskList = bigStorageCageTaskService.queryTaskMessage(BIG_STORAGE_CAGE_OUT_TWO_TASK);
         if (CollectionUtil.isNotEmpty(outTaskList)) {
             log.info("鏈夋鍦ㄦ墽琛岀殑鍑虹墖浠诲姟锛岀粨鏉熸湰娆″嚭鐗囦换鍔�");
             return;
@@ -270,10 +265,12 @@
             List<HollowGlassQueueInfo> unFinishHollowQueueList = hollowGlassQueueInfoService.list(new LambdaQueryWrapper<HollowGlassQueueInfo>()
                     .eq(HollowGlassQueueInfo::getFlowCardId, hollowGlassOutRelationInfo.getFlowCardId())
                     .eq(HollowGlassQueueInfo::getCell, cell)
-                    .eq(HollowGlassQueueInfo::getState, Const.TEMPERING_NEW));
+                    .eq(HollowGlassQueueInfo::getState, Const.TEMPERING_NEW)
+                    .orderByAsc(HollowGlassQueueInfo::getHollowSequence));
             if (CollectionUtil.isNotEmpty(unFinishHollowQueueList)) {
                 log.info("鏈夋鍦ㄥ嚭鐗囩殑涓┖浠诲姟");
-                computeOutGlassInfo(unFinishHollowQueueList, "big_storage_cage_out_two_task", hollowGlassOutRelationInfo.getCell(), Const.GLASS_STATE_OUT_ING, Const.BIG_STORAGE_AFTER_OUT);
+                Integer isPair = unFinishHollowQueueList.get(0).getIsPair();
+                hollowOutGlassByIsPair(unFinishHollowQueueList, hollowGlassOutRelationInfo.getCell(), isPair, hollowGlassOutRelationInfo.getTotalLayer());
                 Date endDate = new Date();
                 log.info("澶х悊鐗囩鍑虹墖浠诲姟缁撴潫鏃堕棿锛歿}锛屽叡鑰楁椂锛歿}ms,缁撴潫鎵爜浠诲姟", endDate, endDate.getTime() - startDate.getTime());
                 return;
@@ -297,12 +294,7 @@
                         //鐜荤拑鍒伴綈鍖呮嫭宸插嚭鐗囩殑
                         //鍒伴綈锛屽皢鐜荤拑灏忕墖鏁版嵁瀛樺叆涓┖灏忕墖琛紝閫昏緫鐢熸垚鍑虹墖浠诲姟  缁撴潫
                         for (FlowCardGlassInfoDTO item : flowCardGlassInfoDTO) {
-                            List<HollowBigStorageCageDetails> hollowBigStorageCageDetailsList = hollowBigStorageCageDetailsService.list(new LambdaQueryWrapper<HollowBigStorageCageDetails>()
-                                    .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN)
-                                    .eq(HollowBigStorageCageDetails::getFlowCardId, item.getFlowCardId())
-                                    .orderByAsc(HollowBigStorageCageDetails::getHollowSequence)
-                                    .orderBy(Boolean.TRUE, cell != 931, HollowBigStorageCageDetails::getLayer)
-                            );
+                            List<HollowBigStorageCageDetails> hollowBigStorageCageDetailsList = hollowBigStorageCageDetailsService.queryOutGlassList(item.getFlowCardId(), cell);
                             int finalCell = cell;
                             List<HollowGlassQueueInfo> hollowQueues = hollowBigStorageCageDetailsList.stream().map(queue -> {
                                 HollowGlassQueueInfo queueInfo = new HollowGlassQueueInfo();
@@ -313,7 +305,8 @@
                             }).collect(Collectors.toList());
                             if (CollectionUtil.isNotEmpty(hollowQueues)) {
                                 hollowGlassQueueInfoService.saveBatch(hollowQueues);
-                                computeOutGlassInfo(hollowQueues, "big_storage_cage_out_two_task", cell, Const.GLASS_STATE_OUT_ING, Const.BIG_STORAGE_AFTER_OUT);
+                                Integer isPair = hollowQueues.get(0).getIsPair();
+                                hollowOutGlassByIsPair(hollowQueues, cell, isPair, e.getTotalLayer());
                                 //灏嗕腑绌轰换鍔$姸鎬佹敼涓哄紑濮�
                                 hollowGlassOutRelationInfoService.update(new LambdaUpdateWrapper<HollowGlassOutRelationInfo>()
                                         .eq(HollowGlassOutRelationInfo::getFlowCardId, e.getFlowCardId())
@@ -327,19 +320,8 @@
                     }
                 }
             }
-            //鏄惁鏈変汉宸ヤ笅鐗囦换鍔�   鏈夌洿鎺ュ嚭
-            List<HollowBigStorageCageDetails> artificialList = hollowBigStorageCageDetailsService.list(new LambdaQueryWrapper<HollowBigStorageCageDetails>()
-                    .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_ARTIFICIAL)
-                    .orderByAsc(HollowBigStorageCageDetails::getSlot)
-                    .orderByAsc(HollowBigStorageCageDetails::getId).last("limit " + outCarMaxSize));
-            if (CollectionUtil.isNotEmpty(artificialList)) {
-                computeOutGlassInfo(artificialList, "big_storage_cage_out_two_task", artificialOutTargetPosition, Const.GLASS_STATE_OUT_ING, Const.BIG_STORAGE_AFTER_OUT);
-                Date endDate = new Date();
-                log.info("澶х悊鐗囩鍑虹墖浠诲姟缁撴潫鏃堕棿锛歿}锛屽叡鑰楁椂锛歿}ms,缁撴潫鎵爜浠诲姟", endDate, endDate.getTime() - startDate.getTime());
-                return;
-            }
         }
-
+//        redisUtil.setCacheObject("dispatchHollowSwitch",true);
         //鏄惁瀛樺湪闇�瑕佸唴閮ㄨ皟搴︾殑鏍煎瓙:鎵ц鍐呴儴璋冨害浠诲姟
         if (redisUtil.getCacheObject("dispatchHollowSwitch")) {
             //todo:鑾峰彇绗煎唴鍗曟牸宸茬粡鍒伴綈鐨勭幓鐠冩牸瀛愪俊鎭�
@@ -363,7 +345,7 @@
                         int targetSlot = item.getSlot();
                         list = hollowBigStorageCageDetailsService.list(new LambdaQueryWrapper<HollowBigStorageCageDetails>()
                                 .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN).eq(HollowBigStorageCageDetails::getSlot, startSlot));
-                        computeOutGlassInfo(list, "big_storage_cage_out_two_task", targetSlot, Const.GLASS_STATE_SCHEDULE_ING, Const.BIG_STORAGE_AFTER_DISPATCH);
+                        hollowOutGlassByIsPair(list, targetSlot, 0, 0);
                         List<Integer> slotList = new ArrayList<>();
                         slotList.add(targetSlot);
                         updateSlotRemainBySlots(slotList);
@@ -474,7 +456,7 @@
             return;
         }
         //鑾峰彇杩涚墖浠诲姟琛�
-        List<BigStorageCageTask> outTaskList = bigStorageCageTaskService.queryTaskMessage("big_storage_cage_out_one_task");
+        List<BigStorageCageTask> outTaskList = bigStorageCageTaskService.queryTaskMessage(BIG_STORAGE_CAGE_OUT_TWO_TASK);
         if (CollectionUtil.isEmpty(outTaskList)) {
             log.info("褰撳墠澶ц溅鏃犺繘鐗囩幓鐠冿紝缁撴潫瀹屾垚杩涚墖浠诲姟");
             return;
@@ -553,7 +535,7 @@
             }
         }
 //       閲嶇疆浠诲姟琛ㄦ暟鎹�
-        bigStorageCageTaskService.updateOutTaskMessage("big_storage_cage_out_one_task");
+        bigStorageCageTaskService.updateOutTaskMessage(BIG_STORAGE_CAGE_OUT_TWO_TASK);
         //娓呯┖鍚姩鐘舵��
         //鍚憃pc鍙戦�佸惎鍔ㄤ俊鍙�
         miloService.writeToOpcWord(generateReadWriteEntity("DLP2B.DLP2B.MesReply", 0));
@@ -660,29 +642,59 @@
         log.info("鍑虹墖浠诲姟-鏃犲姩浣滄墽琛屽畬鎴�");
     }
 
+
+    private <T extends HollowBigStorageCageBaseInfo> Boolean hollowOutGlassByIsPair(List<T> list, int targetSlot, int isPair, int totalLayer) {
+        List<T> resultList = new ArrayList<>();
+        int taskType = Const.BIG_STORAGE_AFTER_OUT;
+        int taskState = Const.GLASS_STATE_OUT_ING;
+        for (T t : list) {
+            if (isPair == (t.getIsPair() == null ? 0 : t.getIsPair())) {
+                resultList.add(t);
+            }
+        }
+        if (isPair == 0) {
+            taskType = Const.BIG_STORAGE_AFTER_DISPATCH;
+            taskState = Const.GLASS_STATE_SCHEDULE_ING;
+            totalLayer = 0;
+        }
+        return computeOutGlassInfo(resultList, BIG_STORAGE_CAGE_OUT_TWO_TASK, targetSlot, taskState, taskType, totalLayer);
+    }
+
     /**
      * 鍑虹墖涓�娆′粎鐢熸垚涓�杞︾幓鐠�
      *
-     * @param list
      * @param <T>
+     * @param list
+     * @param totalLayer
      * @return
      */
-    private <T extends BigStorageCageBaseInfo> Boolean computeOutGlassInfo(List<T> list, String tableName, int targetSlot, int state, int taskType) {
+    private <T extends HollowBigStorageCageBaseInfo> Boolean computeOutGlassInfo(List<T> list, String tableName, int targetSlot, int state, int taskType, int totalLayer) {
         //浠诲姟鏁版嵁:鑾峰彇杞﹀瓙瀛樻斁鐜荤拑鏈�澶ф暟閲�,鐜荤拑闂撮殧
-        List<BigStorageCageTask> bigStorageCageTaskList = new ArrayList<>();
+        List<BigStorageCageTask> tempList = new ArrayList<>();
+        List<T> tempTList = new ArrayList<>();
         //鎵撹溅鍓╀綑灏哄
         Integer remainWidth = carWidth;
         for (T e : list) {
-            if (bigStorageCageTaskList.size() >= outCarMaxSize || Math.max((int) e.getWidth(), (int) e.getHeight()) > remainWidth) {
+            if (tempList.size() >= outCarMaxSize || Math.max((int) e.getWidth(), (int) e.getHeight()) > remainWidth) {
                 break;
             }
             //璁$畻褰撳墠鍑虹墖杞﹀墿灏哄
             remainWidth = remainWidth - Math.max((int) e.getWidth(), (int) e.getHeight()) - glassGap;
-            bigStorageCageTaskList.add(new BigStorageCageTask(e.getGlassId(), e.getSlot(), targetSlot,
+            tempTList.add(e);
+            tempList.add(new BigStorageCageTask(e.getGlassId(), e.getSlot(), targetSlot,
                     0));
         }
-        Assert.isFalse(CollectionUtil.isEmpty(bigStorageCageTaskList), "鏈幏鍙栧嚭鐗囨暟鎹紝缁撴潫鍑虹墖浠诲姟");
-        log.info("鑾峰彇鍑虹墖浠诲姟鏁版嵁{}鏉★紝鎵ц淇濆瓨", bigStorageCageTaskList.size());
+        Assert.isFalse(CollectionUtil.isEmpty(tempList), "鏈幏鍙栧嚭鐗囨暟鎹紝缁撴潫鍑虹墖浠诲姟");
+        log.info("鑾峰彇鍑虹墖浠诲姟鏁版嵁{}鏉★紝鎵ц淇濆瓨", tempList.size());
+        List<BigStorageCageTask> bigStorageCageTaskList = tempList;
+        if (taskType == Const.BIG_STORAGE_AFTER_OUT) {
+            if (tempList.size() <= totalLayer) {
+                bigStorageCageTaskList = tempList;
+            } else {
+                int remainCount = tempList.size() % totalLayer;
+//                tempList.subList(0,)
+            }
+        }
         List<String> glassIds = bigStorageCageTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList());
         int glassCount = bigStorageCageTaskList.size();
         //鐢熸垚鍑虹墖浠诲姟鏉℃暟涓嶈冻6琛ュ叏
@@ -704,7 +716,7 @@
         log.info("灏嗗嚭鐗囩幓鐠儃}鐜荤拑鐘舵�佹敼涓哄嚭鐗囦腑", glassIds);
         hollowBigStorageCageDetailsService.update(new LambdaUpdateWrapper<HollowBigStorageCageDetails>()
                 .set(HollowBigStorageCageDetails::getState, state)
-                .set(Const.RAW_GLASS_TASK_TYPE_DISPATCH.equals(taskType), BigStorageCageBaseInfo::getSlot, targetSlot)
+                .set(Const.BIG_STORAGE_AFTER_DISPATCH.equals(taskType), HollowBigStorageCageDetails::getSlot, targetSlot)
                 .ne(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_OUT)
                 .in(HollowBigStorageCageDetails::getGlassId, glassIds));
         try {
@@ -747,4 +759,10 @@
                 .value(value)
                 .build();
     }
+//
+//    private List<BigStorageCageTask> computeOutTaskList(List<BigStorageCageTask> taskList, int totalLayer, int target) {
+////        if (target == 931){}
+//        if (taskList.get(0).get)
+//            return null;
+//    }
 }
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml
index c8d05a5..b94c140 100644
--- a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml
@@ -14,6 +14,7 @@
     </resultMap>
     <resultMap id="virtualSlotSequenceDTO" type="com.mes.hollow.entity.dto.FlowCardVirtualSlotDTO">
         <result column="flow_card_id" property="flowCardId"/>
+        <result column="layer" property="layer"/>
         <result column="virtual_slot" property="virtualSlot"/>
     </resultMap>
     <resultMap id="baseSlotSequenceDTO" type="com.mes.hollow.entity.dto.BigStorageSequenceDTO">
@@ -135,40 +136,88 @@
 
     <select id="queryIsAllNeedDispatchVirtualSlot" resultMap="virtualSlotSequenceDTO">
         with relation_temp as (
-            select flow_card_id, virtual_slot, count(1) as slot_count
+            select flow_card_id, layer, virtual_slot, count(1) as slot_count
             from hollow_glass_relation_info
-            group by flow_card_id, virtual_slot
+            group by flow_card_id, layer, virtual_slot
         ),
              details_temp as (
-                 select flow_card_id, virtual_slot, count(1) as slot_count
+                 select flow_card_id, layer, virtual_slot, count(1) as slot_count
                  from hollow_big_storage_cage_details
                  where state = 100
-                 group by flow_card_id, virtual_slot
+                 group by flow_card_id, layer, virtual_slot
              ),
              result_one as (
                  select t.*, t1.slot_count as tslot_count
                  from relation_temp t
                           INNER JOIN details_temp t1 on t.flow_card_id = t1.flow_card_id and
+                                                        t.layer = t1.layer and
                                                         t.virtual_slot = t1.virtual_slot
                  where t.slot_count = t1.slot_count
              )
-        select flow_card_id, virtual_slot
+        select flow_card_id, layer, virtual_slot
         from result_one
-        order by flow_card_id, virtual_slot
+        order by flow_card_id, layer, virtual_slot
     </select>
 
     <select id="queryNeedDispatchSlot" resultMap="baseSlotSequenceDTO">
-        with glass_id_temp as (
-            select glass_id
-            from big_storage_glass_relation_info
-            where (flow_card_id, virtual_slot) =
-                  (#{flowCardId}, #{virtualSlot})
-        )
         select slot, max(sequence) as max_sequence, min(sequence) as min_sequence
-        from big_storage_cage_details
-        where glass_id in (select * from glass_id_temp)
-          and state = 100
+        from hollow_big_storage_cage_details
+        where (flow_card_id, layer, virtual_slot) = (#{flowCardId}, #{layer}, #{virtualSlot})
         group by slot
         order by max_sequence
     </select>
+    <select id="queryOutGlassList" resultType="com.mes.hollow.entity.HollowBigStorageCageDetails">
+        with flow_card_id_layer as (
+        select flow_card_id, max(total_layer) as total_layer
+        FROM hollow_big_storage_cage_details
+        group by flow_card_id
+        ),
+        details_sequence_count_temp as (
+        SELECT flow_card_id, hollow_sequence, count(1) as max_count
+        FROM hollow_big_storage_cage_details
+        and state = 100
+        group by flow_card_id, hollow_sequence
+        ),
+        glass_out_temp as (
+        select t1.*, case when t.total_layer = t1.max_count then 1 else 0 end is_pair
+        from flow_card_id_layer t
+        inner join details_sequence_count_temp t1 on t.flow_card_id = t1.flow_card_id
+        ),
+        result_detail as (
+        select t.id,
+        t.device_id,
+        t.virtual_slot,
+        t.slot,
+        t.glass_id,
+        t.sequence,
+        t.flow_card_id,
+        t.glass_type,
+        t.width,
+        t.height,
+        t.thickness,
+        t.tempering_layout_id,
+        t.tempering_feed_sequence,
+        t.state,
+        t.gap,
+        t.engineer_id,
+        t.total_layer,
+        t.layer,
+        t.create_time,
+        t.update_time,
+        t.hollow_sequence,
+        t.films_id,
+        t1.is_pair
+        from hollow_big_storage_cage_details t
+        INNER JOIN glass_out_temp t1
+        on t.flow_card_id = t1.flow_card_id and t.hollow_sequence = t1.hollow_sequence
+        where t.state = 100
+        and t.flow_card_id = #{flowCardId}
+        )
+        select *
+        from result_detail
+        order by flow_card_id, hollow_sequence
+        <if test="cell != 931">
+            desc
+        </if>
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0