From 703b5ccba0938375e19cad42406c68aee2658997 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期四, 23 五月 2024 14:13:15 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 110 ++++++++++++++++++++++++++++++++++--------------------
1 files changed, 69 insertions(+), 41 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 2619446..0ae1e4f 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -194,11 +194,21 @@
if (Cools.isEmpty(taskWrk)){
continue;
}
- List<Integer> list = new ArrayList<>();
- list.add(taskWrk.getCrnNo());
+
//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;
}
//鑾峰彇鍫嗗灈鏈虹珯鐐�
@@ -219,11 +229,18 @@
toWmsDTO.setWarehouseId("1688469798893297665");
toWmsDTO.setContainerCode(barcode);
toWmsDTO.setApplyType("TUNNEL_LOCATION");
+ List<Integer> list = new ArrayList<>();
+
if (inSta.getBarcode() == 7 || inSta.getBarcode() == 8){
toWmsDTO.setTaskTunnel(taskWrk.getCrnNo());
+ list.add(taskWrk.getCrnNo());
}else {
toWmsDTO.setTaskTunnel(inSta.getBarcode());
+ list.add(inSta.getBarcode());
}
+
+
+
toWmsDTO.setCanInboundTunnels(list);
String response = null;
try {
@@ -252,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搴撲綅鍙峰け璐�");
}
@@ -335,6 +357,8 @@
} else if (taskWrk.getIoType() == 2) {
taskWrk.setWrkSts(14);
}
+ Date now = new Date();
+ taskWrk.setCompleteTime(now);
if (!taskWrkService.updateById(taskWrk)){
log.error(taskWrk.getTaskNo()+ " 鍫嗗灈鏈轰换鍔″畬鎴愶紝鏀瑰彉浠诲姟鐘舵�佸け璐�");
}
@@ -442,16 +466,17 @@
log.error("杩涘叆淇敼宸ヤ綔妗f祦绋�");
Date now = new Date();
taskWrk.setWrkSts(3);
+ taskWrk.setExecuteTime(now);
taskWrk.setModiTime(now);
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());
//鍙栧嚭鍛戒护
@@ -620,6 +645,7 @@
// 淇敼宸ヤ綔妗g姸鎬� 11.鐢熸垚鍑哄簱ID => 12.鍚婅溅鍑哄簱涓�
Date now = new Date();
taskWrk.setWrkSts(12);
+ taskWrk.setExecuteTime(now);
taskWrk.setModiTime(now);
if (taskWrkMapper.updateById(taskWrk) == 0) {
log.error("淇敼宸ヤ綔妗g姸鎬� 11.鐢熸垚鍑哄簱ID => 12.鍚婅溅鍑哄簱涓� 澶辫触锛侊紒锛屽伐浣滃彿={}", taskWrk.getWrkNo());
@@ -783,27 +809,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){
@@ -811,10 +837,12 @@
} else if (taskWrk.getIoType() == 2) {
taskWrk.setWrkSts(14);
}
+ Date now = new Date();
+ taskWrk.setCompleteTime(now);
if (!taskWrkService.updateById(taskWrk)){
log.error(taskWrk.getTaskNo()+ " 鍫嗗灈鏈轰换鍔″畬鎴愶紝鏀瑰彉浠诲姟鐘舵�佸け璐�");
}
- }
+// }
}
}
}
@@ -1006,24 +1034,24 @@
public synchronized void autoCompleteTask() {
List<TaskWrk> taskWrks = taskWrkMapper.selectWorkingTask();
for (TaskWrk taskWrk : taskWrks) {
- //鑾峰彇鍛戒护闆嗗悎
- List<CommandInfo> commandInfos = commandInfoService.selectByTaskNo(taskWrk.getTaskNo());
- if (taskWrk.getCommandStep() < commandInfos.size()) {
- continue;//褰撳墠姝ュ簭娌℃湁鍒拌揪鏈�鍚庝竴鏉″懡浠�
- }
-
- //鍒ゆ柇鏈鍛戒护鏄惁鎵ц瀹屾垚
- if (!commandInfos.isEmpty()){
- CommandInfo commandInfo = commandInfos.get(commandInfos.size() - 1);
- if (commandInfo.getCommandStatus() != CommandStatusType.COMPLETE.id) {
- continue;//鎸囦护鏈畬鎴�
- }
- }
+// //鑾峰彇鍛戒护闆嗗悎
+// List<CommandInfo> commandInfos = commandInfoService.selectByTaskNo(taskWrk.getTaskNo());
+// if (taskWrk.getCommandStep() < commandInfos.size()) {
+// continue;//褰撳墠姝ュ簭娌℃湁鍒拌揪鏈�鍚庝竴鏉″懡浠�
+// }
+//
+// //鍒ゆ柇鏈鍛戒护鏄惁鎵ц瀹屾垚
+// if (!commandInfos.isEmpty()){
+// CommandInfo commandInfo = commandInfos.get(commandInfos.size() - 1);
+// if (commandInfo.getCommandStatus() != CommandStatusType.COMPLETE.id) {
+// continue;//鎸囦护鏈畬鎴�
+// }
+// }
Date now = new Date();
//鎸囦护宸插畬鎴愶紝鏇存柊浠诲姟
- if (taskWrk.getIoType() == 1) {
+ if (taskWrk.getIoType() == 1 && taskWrk.getWrkSts() == 5) {
//鍏ュ簱浠诲姟
// taskWrk.setWrkSts(4);//3.鍚婅溅鍏ュ簱涓� => 4.鍏ュ簱瀹屾垚
taskWrk.setStatus(TaskStatusType.OVER.id);
@@ -1037,7 +1065,7 @@
locMast.setModiTime(now);
locMast.setModiUser(9999L);
locMastService.updateById(locMast);
- } else if (taskWrk.getIoType() == 2) {
+ } else if (taskWrk.getIoType() == 2 && taskWrk.getWrkSts() == 15) {
//鍑哄簱浠诲姟
// taskWrk.setWrkSts(14);//12.鍚婅溅鍑哄簱涓� => 14.鍑哄簱瀹屾垚
taskWrk.setStatus(TaskStatusType.OVER.id);
@@ -1051,7 +1079,7 @@
locMast.setModiTime(now);
locMast.setModiUser(9999L);
locMastService.updateById(locMast);
- } else if (taskWrk.getIoType() == 3) {
+ } else if (taskWrk.getIoType() == 3 && taskWrk.getWrkSts() == 5) {
//鏇存柊璧峰搴撲綅鐘舵��
LocMast locMastStart = locMastService.selectByLocNo(taskWrk.getStartPoint());
--
Gitblit v1.9.1