From 64e3ed8867c2646bef997d23b5e2990e3a25d945 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期四, 02 五月 2024 18:34:46 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java |   62 +++++++++++++++++++-----------
 1 files changed, 39 insertions(+), 23 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
index 9a781a5..55ace44 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -196,8 +196,19 @@
                         }
 
                         //StaDesc staDesc1 = staDescService.selectOne(new EntityWrapper<StaDesc>().eq("stn_no",inSta.getBackSta()));
-                        if (taskWrk.getTargetPoint() != null && taskWrk.getStartPoint() != null){
+                        boolean sign = true;
+                        if (inSta.getBarcode() == 7 || inSta.getBarcode() == 8){
+
+                        }else {
+                            if (taskWrk.getCrnNo() != inSta.getBarcode()){
+                                sign = false;
+                            }
+                        }
+                        if (taskWrk.getTargetPoint() != null && taskWrk.getStartPoint() != null && sign){
                             if ( taskWrk.getWrkNo() != null && taskWrk.getWrkNo().shortValue() == workNo ){
+                                continue;
+                            }
+                            if (taskWrk.getStatus() != 2){
                                 continue;
                             }
                             //鑾峰彇鍫嗗灈鏈虹珯鐐�
@@ -258,6 +269,11 @@
                                 taskWrk.setOriginTargetPoint(getWmsDto.getTargetLocationCode());
                                 taskWrk.setTargetPoint(Utils.getWcsLocNo(getWmsDto.getTargetLocationCode()));
                                 taskWrk.setStartPoint(String.valueOf(inSta.getBackSta()));
+                                if (inSta.getBarcode() == 7 || inSta.getBarcode() == 8){
+
+                                }else {
+                                    taskWrk.setCrnNo(inSta.getBarcode());
+                                }
                                 if (!taskWrkService.updateById(taskWrk)){
                                     log.error("淇濆瓨wms搴撲綅鍙峰け璐�");
                                 }
@@ -452,12 +468,12 @@
                 if (taskWrkMapper.updateById(taskWrk) == 0) {
                     log.error("淇敼宸ヤ綔妗g姸鎬� 2.璁惧涓婅蛋 => 3.鍚婅溅鍏ュ簱涓� 澶辫触锛侊紒锛屽伐浣滃彿={}", taskWrk.getWrkNo());
                 }
-                TaskWrk taskWrk2 = taskWrkService.selectByWrkNo(staProtocol.getWorkNo().intValue());
+                TaskWrk taskWrk2 = taskWrkService.selectByWrkNo(taskWrk.getWrkNo());
 
                 if (taskWrk2.getWrkSts() != 3){
                     continue;
                 }
-                log.error("杩涘叆淇敼宸ヤ綔妗f祦绋嬪畬鎴�,taskWrk=", JSON.toJSONString(taskWrk));
+                log.error("杩涘叆淇敼宸ヤ綔妗f祦绋嬪畬鎴�,taskWrk=", taskWrk.getWrkNo());
 
 
                 //鍙栧嚭鍛戒护
@@ -789,27 +805,27 @@
                 }
 
                 //鑾峰彇鎸囦护ID
-                Integer commandId = crnProtocol.getCommandId();
-                CommandInfo commandInfo = new CommandInfo();
-                if (Cools.isEmpty(commandId)){
-                    commandInfo = commandInfoService.selectOne(new EntityWrapper<CommandInfo>()
-                            .eq("wrk_no",crnProtocol.getTaskNo())
-                            .eq("device","Crn"));
-                }else {
-                    commandInfo = commandInfoService.selectById(commandId);
-                }
+//                Integer commandId = crnProtocol.getCommandId();
+//                CommandInfo commandInfo = new CommandInfo();
+//                if (Cools.isEmpty(commandId)){
+//                    commandInfo = commandInfoService.selectOne(new EntityWrapper<CommandInfo>()
+//                            .eq("wrk_no",crnProtocol.getTaskNo())
+//                            .eq("device","Crn"));
+//                }else {
+//                    commandInfo = commandInfoService.selectById(commandId);
+//                }
 
 
-                if (commandInfo == null) {
-                    //鎸囦护涓嶅瓨鍦�
-                    continue;
-                }
-                if (commandInfo.getCommandStatus() == 3){
-                    continue;
-                }
-                commandInfo.setCommandStatus(CommandStatusType.COMPLETE.id);//鎸囦护瀹屾垚
-                commandInfo.setCompleteTime(new Date());//鎸囦护瀹屾垚鏃堕棿
-                if (commandInfoService.updateById(commandInfo)) {//淇敼鎴愬姛鍚庡浣嶅爢鍨涙満
+//                if (commandInfo == null) {
+//                    //鎸囦护涓嶅瓨鍦�
+//                    continue;
+//                }
+//                if (commandInfo.getCommandStatus() == 3){
+//                    continue;
+//                }
+//                commandInfo.setCommandStatus(CommandStatusType.COMPLETE.id);//鎸囦护瀹屾垚
+//                commandInfo.setCompleteTime(new Date());//鎸囦护瀹屾垚鏃堕棿
+//                if (commandInfoService.updateById(commandInfo)) {//淇敼鎴愬姛鍚庡浣嶅爢鍨涙満
                     // 鍫嗗灈鏈哄浣�
                     crnThread.setResetFlag(true);
                     if (taskWrk.getIoType() == 1 || taskWrk.getIoType() == 3){
@@ -820,7 +836,7 @@
                     if (!taskWrkService.updateById(taskWrk)){
                         log.error(taskWrk.getTaskNo()+ " 鍫嗗灈鏈轰换鍔″畬鎴愶紝鏀瑰彉浠诲姟鐘舵�佸け璐�");
                     }
-                }
+//                }
             }
         }
     }

--
Gitblit v1.9.1