From 1e749905c93495f82667d8ca52eeadf5db3a735e Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期三, 13 八月 2025 11:11:58 +0800
Subject: [PATCH] 1、中空线优先级开关 默认关闭 lisec优先, 开启 韩江线优先
---
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/controller/HollowGlassOutRelationInfoController.java | 6 ++++++
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java | 6 ++++++
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageHollowTask.java | 13 +++++++++++--
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassOutRelationInfoService.java | 2 ++
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/PushMessageToIndex.java | 9 ++++++++-
5 files changed, 33 insertions(+), 3 deletions(-)
diff --git a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/controller/HollowGlassOutRelationInfoController.java b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/controller/HollowGlassOutRelationInfoController.java
index 47cec31..7585d13 100644
--- a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/controller/HollowGlassOutRelationInfoController.java
+++ b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/controller/HollowGlassOutRelationInfoController.java
@@ -97,6 +97,12 @@
return Result.build(200, "淇敼鎴愬姛", hollowGlassOutRelationInfoService.dispatchHollowSwitch(flag));
}
+ @ApiOperation("涓┖浼樺厛绾у紑鍏�")
+ @PostMapping("/priorityHollowSwitch")
+ public Result<Boolean> priorityHollowSwitch(Boolean flag) {
+ return Result.build(200, "淇敼鎴愬姛", hollowGlassOutRelationInfoService.priorityHollowSwitch(flag));
+ }
+
@ApiOperation("鎵嬪姩鐢熸垚鏉庤禌鍏嬫枃浠�")
@PostMapping("/generateHollowLisecFile")
public Result<String> generateHollowLisecFile(String flowCardId, int cell, int isForce) throws IOException {
diff --git a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassOutRelationInfoService.java b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassOutRelationInfoService.java
index 398d723..5760c51 100644
--- a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassOutRelationInfoService.java
+++ b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassOutRelationInfoService.java
@@ -25,6 +25,8 @@
Boolean dispatchHollowSwitch(Boolean flag);
+ Boolean priorityHollowSwitch(Boolean flag);
+
List<String> hollowTaskList(int cell);
List<HollowGlassQueueInfo> appointHollowTaskDetails(String flowCardId, int cell);
diff --git a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java
index 2de2d63..49bb670 100644
--- a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java
+++ b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java
@@ -97,6 +97,12 @@
}
@Override
+ public Boolean priorityHollowSwitch(Boolean flag) {
+ redisUtil.setCacheObject("priorityHollowSwitch", flag);
+ return redisUtil.getCacheObject("priorityHollowSwitch");
+ }
+
+ @Override
public List<String> hollowTaskList(int cell) {
//鏌ヨ浠诲姟琛ㄤ腑鏈潯绾挎墍鏈夋湭瀹屾垚鐨勪换鍔′俊鎭�
List<HollowGlassOutRelationInfo> list = this.list(new LambdaQueryWrapper<HollowGlassOutRelationInfo>()
diff --git a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageHollowTask.java b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageHollowTask.java
index 8f3118e..97cf082 100644
--- a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageHollowTask.java
+++ b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageHollowTask.java
@@ -103,6 +103,9 @@
private static final String BIG_STORAGE_CAGE_IN_TWO_TASK = "big_storage_cage_in_two_task";
private static final String BIG_STORAGE_CAGE_OUT_TWO_TASK = "big_storage_cage_out_two_task";
+
+ private static final List<Integer> ONE_LINE_FIRST = Arrays.asList(930, 931, 932);
+ private static final List<Integer> TWO_LINE_FIRST = Arrays.asList(931, 930, 932);
/**
* 鐩撮�氭牸瀛�
*/
@@ -391,9 +394,15 @@
//nothing
log.info("浜�/涓夌嚎绾跨┖闂茬姸鎬佽幏鍙栧紓甯�");
}
+ List<Integer> resultList = new ArrayList<>();
+ if (redisUtil.getCacheObject("priorityHollowSwitch")) {
+ resultList = TWO_LINE_FIRST;
+ } else {
+ resultList = ONE_LINE_FIRST;
+ }
HollowGlassOutRelationInfo hollowGlassOutRelationInfo = null;
int cell = -1;
- for (int i = 930; i <= 932; i++) {
+ for (Integer i : resultList) {
if (null == hollowGlassOutRelationInfo) {
Boolean entity = map.get(i);
cell = i;
@@ -408,7 +417,7 @@
break;
}
}
- for (int i = 930; i <= 932; i++) {
+ for (Integer i : resultList) {
if (null == hollowGlassOutRelationInfo) {
cell = i;
hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService
diff --git a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/PushMessageToIndex.java b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/PushMessageToIndex.java
index ba1d20e..6dee99b 100644
--- a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/PushMessageToIndex.java
+++ b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/PushMessageToIndex.java
@@ -5,7 +5,6 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.xingshuangs.iot.protocol.modbus.service.ModbusTcp;
import com.github.xingshuangs.iot.protocol.s7.serializer.S7Serializer;
-import com.kangaroohy.milo.model.ReadWriteEntity;
import com.kangaroohy.milo.service.MiloService;
import com.mes.bigstoragecagetask.entity.BigStorageCageTask;
import com.mes.bigstoragecagetask.entity.BigStorageTaskVO;
@@ -332,6 +331,14 @@
dispatchHollowSwitch = redisUtil.getCacheObject("dispatchHollowSwitch");
}
jsonObject.append("dispatchHollowSwitch", dispatchHollowSwitch);
+ //璋冨害寮�鍏�
+ boolean priorityHollowSwitch = false;
+ if (redisUtil.getCacheObject("priorityHollowSwitch") == null) {
+ redisUtil.setCacheObject("priorityHollowSwitch", false);
+ } else {
+ dispatchHollowSwitch = redisUtil.getCacheObject("priorityHollowSwitch");
+ }
+ jsonObject.append("dispatchHollowSwitch", dispatchHollowSwitch);
//鐞嗙墖绗间娇鐢ㄦ儏鍐�
List<Map<String, Object>> bigStorageCageUsage = hollowBigStorageCageService.selectBigStorageCageUsage();
--
Gitblit v1.8.0