From df702972ff8ae890991021663d919f47dc864606 Mon Sep 17 00:00:00 2001
From: zhangc <zc@123>
Date: 星期二, 24 十二月 2024 10:35:23 +0800
Subject: [PATCH] 优化ReportDataHandler响应处理逻辑

---
 src/main/java/com/zy/asrs/task/AutoMoveCreateExecuteScheduler.java |   25 +++++++++++++++----------
 1 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/src/main/java/com/zy/asrs/task/AutoMoveCreateExecuteScheduler.java b/src/main/java/com/zy/asrs/task/AutoMoveCreateExecuteScheduler.java
index e032675..682cf0c 100644
--- a/src/main/java/com/zy/asrs/task/AutoMoveCreateExecuteScheduler.java
+++ b/src/main/java/com/zy/asrs/task/AutoMoveCreateExecuteScheduler.java
@@ -6,9 +6,7 @@
 import com.zy.asrs.entity.AgvLocMast;
 import com.zy.asrs.entity.AgvWrkMast;
 import com.zy.asrs.entity.WrkMastExecute;
-import com.zy.asrs.service.AgvBasDevpService;
-import com.zy.asrs.service.AgvLocMastService;
-import com.zy.asrs.service.AgvWrkMastService;
+import com.zy.asrs.service.*;
 import com.zy.asrs.service.impl.WrkMastExecuteServiceImpl;
 import com.zy.asrs.task.handler.AutoMoveCreateExecuteHandler;
 import com.zy.common.service.AgvCommonService;
@@ -37,14 +35,16 @@
     @Autowired
     private AgvCommonService agvCommonService;
     @Autowired
-    private WrkMastExecuteServiceImpl wrkMastExecuteService;
+    private WrkMastExecuteService wrkMastExecuteService;
+    @Autowired
+    private WrkMastExecuteLogService wrkMastExecuteLogService;
 
     /**
      * 鐢熸垚agv_wrk_mast_execute浠诲姟
      */
-    @Scheduled(cron = "0/2 * * * * ? ")
+//    @Scheduled(cron = "0/2 * * * * ? ")
     private void autoMove(){
-        List<AgvWrkMast> agvWrkMastList = agvWrkMastService.selectList(new EntityWrapper<AgvWrkMast>().eq("io_type", 121).eq("wrk_sts",11));
+        List<AgvWrkMast> agvWrkMastList = agvWrkMastService.selectList(new EntityWrapper<AgvWrkMast>().eq("io_type", 121).eq("wrk_sts",11).orderBy("io_pri",false));
         for (AgvWrkMast agvWrkMast:agvWrkMastList){
             try{
                 Date now = new Date();
@@ -109,15 +109,20 @@
     /**
      * 瀹屾垚agv_wrk_mast_execute浠诲姟
      */
-    @Scheduled(cron = "0/2 * * * * ? ")
+//    @Scheduled(cron = "0/2 * * * * ? ")
     private void autoMoveEnd(){
-        List<AgvWrkMast> agvWrkMastList = agvWrkMastService.selectList(new EntityWrapper<AgvWrkMast>().eq("io_type", 121).eq("wrk_sts",12));
+        List<AgvWrkMast> agvWrkMastList = agvWrkMastService.selectList(new EntityWrapper<AgvWrkMast>().eq("io_type", 121).eq("wrk_sts",12).orderBy("io_pri",false));
         for (AgvWrkMast agvWrkMast:agvWrkMastList){
             try{
                 WrkMastExecute wrkMastExecute = wrkMastExecuteService.selectOne(new EntityWrapper<WrkMastExecute>().eq("io_type", 121).eq("wrk_no", agvWrkMast.getWrkNo().longValue()));
-                if (!Cools.isEmpty(wrkMastExecute) && wrkMastExecute.getWrkSts()==2 && wrkMastExecute.getNowPosition()==4){
-                    agvWrkMast.setWrkSts(14L);//浠诲姟瀹屾垚
+                if (!Cools.isEmpty(wrkMastExecute) && wrkMastExecute.getWrkSts()==3L && wrkMastExecute.getNowPosition()==3){
+                    agvWrkMast.setWrkSts(205L);//浠诲姟瀹屾垚
+                    agvWrkMast.setModiTime(new Date());
                     agvWrkMastService.updateById(agvWrkMast);
+                    //鐢熸垚agv_wrk_mast_execute浠诲姟鍘嗗彶妗�
+                    wrkMastExecuteLogService.save(wrkMastExecute);
+                    //鍒犻櫎鎵ц妗f
+                    wrkMastExecuteService.deleteById(wrkMastExecute);
                 }
             }catch (Exception e){
                 log.error("瀹屾垚agv_wrk_mast_execute浠诲姟寮傚父===銆嬪紓甯稿師鍥狅細"+e.getMessage());

--
Gitblit v1.9.1