From ea964162520805dd36e740f0a72fa909e78cade0 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期三, 20 十二月 2023 13:42:07 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/task/TaskLogScheduler.java | 2
src/main/java/com/zy/asrs/utils/Utils.java | 17 ++++++--
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 41 +++++++++++++++-----
src/main/java/com/zy/core/thread/SiemensDevpThread.java | 4 +-
4 files changed, 45 insertions(+), 19 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 95d3a6d..0b0eabe 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -155,12 +155,14 @@
if (workNo == 0 && stano == 0){
continue;
}
+ if (!staProtocol.isPakMk()){
+ continue;
+ }
// News.warn("鎵爜鍏ュ簱澶辫触锛寋}鍏ュ簱绔欏洜{}寮傚父锛屾墭鐩樺凡琚��鍥�", inSta.getStaNo(), errMsg);
staProtocol.setWorkNo(workNo);
staProtocol.setStaNo(inSta.getBackSta().shortValue());
devpThread.setPakMk(staProtocol.getSiteId(), false);
MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(3, staProtocol));
-
TaskWrk taskWrk = taskWrkMapper.selectByWrkNo(Integer.valueOf(workNo));
if (taskWrk != null) {
taskWrk.setMemo(errMsg);//灏嗛敊璇爜瀛樺叆澶囨敞瀛楁杩涜灞曠ず
@@ -208,7 +210,7 @@
staProtocol.setWorkNo(taskWrk.getWrkNo().shortValue());
staProtocol.setStaNo(staDesc.getCrnStn().shortValue());
MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(3, staProtocol));
- Thread.sleep(200);
+ Thread.sleep(500);
}else {
//TaskWrk taskWrk = taskWrkService.selectByTaskNo(param.getTaskNo());
toWmsDTO.setWarehouseId("1688469798893297665");
@@ -577,6 +579,13 @@
if (commandInfos.isEmpty()) {
continue;//鍛戒护绌�
}
+
+ //鍒ゆ柇鏈鍛戒护鏄惁鎵ц
+ CommandInfo commandInfo2 = commandInfos.get(commandInfos.size() - 1);
+ if (commandInfo2.getCommandStatus() != CommandStatusType.CREATE.id) {
+ continue;//鎸囦护宸叉墽琛�
+ }
+
CommandInfo commandInfo = commandInfos.get(commandStep);
CommandPackage commandPackage = JSON.parseObject(commandInfo.getCommand(), CommandPackage.class);//鍙栧嚭鍛戒护鎶ユ枃
CrnCommand crnCommand = JSON.parseObject(commandPackage.getCommand().toString(), CrnCommand.class);
@@ -619,6 +628,24 @@
.eq("wrk_sts",11)
.eq("io_type",3));
for (TaskWrk taskWrk : taskWrks){
+
+ // 鍙屾繁搴撲綅涓旀祬搴撲綅鏈夎揣锛屽垯闇�鍏堝娴呭簱浣嶈繘琛屽簱浣嶇Щ杞�
+ if (Utils.isDeepLoc(slaveProperties, taskWrk.getStartPoint())) {
+ String shallowLocNo = Utils.getShallowLoc(slaveProperties, taskWrk.getStartPoint());
+ TaskWrk hallowLocNoTask = taskWrkMapper.selectByStartPoint(shallowLocNo);
+ if (!Cools.isEmpty(hallowLocNoTask)){
+ continue;
+ }
+ }
+ // 鍫嗗灈鏈烘帶鍒惰繃婊�
+ if (!crnProtocol.getStatusType().equals(CrnStatusType.IDLE) || crnProtocol.getTaskNo() != 0) {
+ continue;
+ }
+
+ // 宸茬粡瀛樺湪鍚婅溅鎵ц浠诲姟鏃讹紝鍒欒繃婊�
+ if (taskWrkMapper.selectCrnWorking(slave.getId()) != null) {
+ continue;
+ }
if (Cools.isEmpty(taskWrk.getTargetPoint())){
List<Integer> list = openServiceImpl.getInEnableRoadway();
Map<String, Object> map = new HashMap<>();
@@ -656,7 +683,7 @@
continue;
}
- }
+ }
if (taskWrk == null || Cools.isEmpty(taskWrk.getTargetPoint()) || taskWrk.getTargetPoint().equals("") || taskWrk.getWrkNo() == null) {
continue;
}
@@ -668,15 +695,7 @@
// 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
- // 鍫嗗灈鏈烘帶鍒惰繃婊�
- if (!crnProtocol.getStatusType().equals(CrnStatusType.IDLE) || crnProtocol.getTaskNo() != 0) {
- continue;
- }
- // 宸茬粡瀛樺湪鍚婅溅鎵ц浠诲姟鏃讹紝鍒欒繃婊�
- if (taskWrkMapper.selectCrnWorking(slave.getId()) != null) {
- continue;
- }
// 1.鍫嗗灈鏈哄紑濮嬬Щ鍔�
diff --git a/src/main/java/com/zy/asrs/task/TaskLogScheduler.java b/src/main/java/com/zy/asrs/task/TaskLogScheduler.java
index 627c146..151707c 100644
--- a/src/main/java/com/zy/asrs/task/TaskLogScheduler.java
+++ b/src/main/java/com/zy/asrs/task/TaskLogScheduler.java
@@ -72,7 +72,7 @@
taskOverToWms.setSourceLocationCode(taskWrk.getOriginStartPoint()); //婧愬簱浣�
//鍒ゆ柇鎵樼洏鏄惁璧板埌鍑哄簱绔�
BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", taskWrk.getTargetPoint()));
- if (!basDevp.getWrkNo().equals(taskWrk.getWrkNo()) && !basDevp.getOutEnable().equals("Y")){
+ if (!basDevp.getWrkNo().equals(taskWrk.getWrkNo()) || !basDevp.getOutEnable().equals("Y")){
continue;
}
} else if (taskWrk.getIoType() ==3) {
diff --git a/src/main/java/com/zy/asrs/utils/Utils.java b/src/main/java/com/zy/asrs/utils/Utils.java
index 2a205e2..da37396 100644
--- a/src/main/java/com/zy/asrs/utils/Utils.java
+++ b/src/main/java/com/zy/asrs/utils/Utils.java
@@ -7,9 +7,7 @@
import com.zy.core.properties.SlaveProperties;
import java.text.DecimalFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
+import java.util.*;
/**
* Created by vincent on 2020/8/27
@@ -224,10 +222,19 @@
*/
public static String getShallowLoc(SlaveProperties slaveProperties, String deepLoc) {
int row = getRow(deepLoc);
- int remainder = (int) Arith.remainder(row, slaveProperties.getGroupCount());
- int shallowRow = remainder == 1 ? (row + 1) : (row - 1);
+// int remainder = (int) Arith.remainder(row, slaveProperties.getGroupCount());
+ int shallowRow = getShallowRow(row);
return zerofill(String.valueOf(shallowRow), 2) + deepLoc.substring(2);
}
+ public static int getShallowRow(Integer row){
+ Map<Integer, Integer> map = new HashMap<>();
+ map.put(1,2);map.put(4,3);
+ map.put(7,8);map.put(10,9);
+ map.put(11,12);map.put(14,13);
+ map.put(15,16);map.put(18,17);
+ map.put(19,20);
+ return map.get(row);
+ }
/**
* 鑾峰彇 娣卞簱浣嶆帓瀵瑰簲鐨勬祬搴撲綅鎺�
diff --git a/src/main/java/com/zy/core/thread/SiemensDevpThread.java b/src/main/java/com/zy/core/thread/SiemensDevpThread.java
index f1118d8..2481e3e 100644
--- a/src/main/java/com/zy/core/thread/SiemensDevpThread.java
+++ b/src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -573,7 +573,7 @@
return;
} else {
OutputQueue.DEVP.offer(MessageFormat.format("銆恵0}銆� 杈撻�佺嚎鍛戒护涓嬪彂鎴愬姛 [id:{1}] >>>>> {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(staProtocol)));
- log.info("杈撻�佺嚎鍛戒护涓嬪彂 [id:{}] >>>>> 鍛戒护涓嬪彂鎴愬姛锛� {}", slave.getId(), JSON.toJSON(staProtocol));
+ //log.info("杈撻�佺嚎鍛戒护涓嬪彂 [id:{}] >>>>> 鍛戒护涓嬪彂鎴愬姛锛� {}", slave.getId(), JSON.toJSON(staProtocol));
Integer siteId = staProtocol.getSiteId();
staProtocol = station.get(siteId);
@@ -654,7 +654,7 @@
return;
} else {
OutputQueue.DEVP.offer(MessageFormat.format("銆恵0}銆� 杈撻�佺嚎鍛戒护涓嬪彂鎴愬姛 [id:{1}] >>>>> {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(staProtocol)));
- log.info("杈撻�佺嚎鍛戒护涓嬪彂 [id:{}] >>>>> 鍛戒护涓嬪彂鎴愬姛锛� {}", slave.getId(), JSON.toJSON(staProtocol));
+ //log.info("杈撻�佺嚎鍛戒护涓嬪彂 [id:{}] >>>>> 鍛戒护涓嬪彂鎴愬姛锛� {}", slave.getId(), JSON.toJSON(staProtocol));
Integer siteId = staProtocol.getSiteId();
staProtocol = station.get(siteId);
--
Gitblit v1.9.1