From 93b488aa57cfd99a94a242c38b007a0d9e35f69b Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期二, 03 十二月 2024 13:55:27 +0800
Subject: [PATCH] 1、fixbug:调度任务改为为非强制性出片

---
 hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageDetailsMapper.xml |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageDetailsMapper.xml b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageDetailsMapper.xml
index 0c164f2..003bd62 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageDetailsMapper.xml
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageDetailsMapper.xml
@@ -99,6 +99,7 @@
                 (#{item.glassId}, #{item.targetSlot})
             </foreach>
             )
+            and state !=101
         </where>
     </update>
 
@@ -134,7 +135,9 @@
              details_temp as (
                  select t.engineer_id, t.tempering_layout_id, t.virtual_slot, count(1) as slot_count
                  from big_storage_glass_relation_info t
-                          left join big_storage_cage_details t1 on t.glass_id = t1.glass_id
+                          left join big_storage_cage_details t1 on
+                         t.engineer_id = t1.engineer_id and t.tempering_layout_id = t1.tempering_layout_id and
+                         t.tempering_feed_sequence = t1.tempering_feed_sequence
                  where t1.state = 100
                  group by t.engineer_id, t.tempering_layout_id, t.virtual_slot
              ),
@@ -153,15 +156,19 @@
 
     <select id="queryNeedDispatchSlot" resultMap="baseSlotSequenceDTO">
         with glass_id_temp as (
-            select glass_id
+            select engineer_id, tempering_layout_id, tempering_feed_sequence
             from big_storage_glass_relation_info
             where (engineer_id, tempering_layout_id, virtual_slot) =
                   (#{engineerId}, #{temperingLayoutId}, #{virtualSlot})
         )
-        select t.slot, max(t1.slot_sequence) as max_sequence, min(t1.slot_sequence) as min_sequence
+        select t.slot, max(t1.tempering_feed_sequence) as max_sequence, min(t1.tempering_feed_sequence) as min_sequence
         from big_storage_cage_details t
-                 inner join big_storage_glass_relation_info t1 on t.glass_id = t1.glass_id
-        where t.glass_id in (select * from glass_id_temp)
+                 inner join big_storage_glass_relation_info t1
+                            on t.engineer_id = t1.engineer_id and t.tempering_layout_id = t1.tempering_layout_id and
+                               t.tempering_feed_sequence = t1.tempering_feed_sequence
+        where (t.engineer_id, t.tempering_layout_id, t.tempering_feed_sequence) in
+              (select engineer_id, tempering_layout_id, tempering_feed_sequence from glass_id_temp)
+          and t.state = 100
         group by t.slot
         order by max_sequence
     </select>

--
Gitblit v1.8.0