From a6720987358933753d9b90acda9103003cfb37ee Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期五, 13 六月 2025 17:09:57 +0800
Subject: [PATCH] 更新通讯依赖版本为1.5.4,中空大理片,钢化大理片S7,modbus测试完成代码提交
---
hangzhoumesParent/common/pom.xml | 2
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/s7/entity/S7DataZKDLPTwo.java | 74 ++-
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/s7/entity/S7DataSP.java | 2
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/s7/entity/S7DataDLPTwo.java | 113 +++--
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/config/ModbusConfig.java | 27 +
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OPCPlcSlicecage.java | 59 ++
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/s7/entity/S7DataWL.java | 8
hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/s7/entity/S7DataCC.java | 2
hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/s7/entity/S7DataSP.java | 2
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/s7/entity/S7DataZKDLPOne.java | 59 +-
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/s7/entity/S7DataMBExtra.java | 10
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/s7/entity/S7DataMB.java | 2
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/s7/entity/S7DataWLExtra.java | 2
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/s7/entity/S7DataZKExtra.java | 24 +
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/s7/entity/S7DataDLPOne.java | 106 ++--
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/config/S7Config.java | 2
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/OpcHollowRemoveTask.java | 93 +++-
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageNewTask.java | 179 +++++++--
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/config/S7Config.java | 13
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageHollowTask.java | 194 ++++++++-
hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/s7/entity/S7DataGHOne.java | 2
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/PushMessageToIndex.java | 114 +++++-
hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/s7/entity/S7DataGHTwo.java | 2
23 files changed, 788 insertions(+), 303 deletions(-)
diff --git a/hangzhoumesParent/common/pom.xml b/hangzhoumesParent/common/pom.xml
index 939354a..2896170 100644
--- a/hangzhoumesParent/common/pom.xml
+++ b/hangzhoumesParent/common/pom.xml
@@ -163,7 +163,7 @@
<dependency>
<groupId>com.github.xingshuangs</groupId>
<artifactId>iot-communication</artifactId>
- <version>1.4.2</version>
+ <version>1.5.4</version>
</dependency>
<!--寮曞叆redis,鎺掗櫎lettuce鐨勫紩鐢�-->
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/s7/entity/S7DataMB.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/s7/entity/S7DataMB.java
index 73315dc..56c3b8c 100644
--- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/s7/entity/S7DataMB.java
+++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/s7/entity/S7DataMB.java
@@ -1,6 +1,6 @@
package com.mes.s7.entity;
-import com.github.xingshuangs.iot.protocol.common.enums.EDataType;
+import com.github.xingshuangs.iot.common.enums.EDataType;
import com.github.xingshuangs.iot.protocol.s7.serializer.S7Variable;
import lombok.Data;
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/s7/entity/S7DataMBExtra.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/s7/entity/S7DataMBExtra.java
index d76ea7b..0178d45 100644
--- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/s7/entity/S7DataMBExtra.java
+++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/s7/entity/S7DataMBExtra.java
@@ -1,6 +1,6 @@
package com.mes.s7.entity;
-import com.github.xingshuangs.iot.protocol.common.enums.EDataType;
+import com.github.xingshuangs.iot.common.enums.EDataType;
import com.github.xingshuangs.iot.protocol.s7.serializer.S7Variable;
import lombok.AllArgsConstructor;
import lombok.Builder;
@@ -43,16 +43,16 @@
@S7Variable(address = "DB49.102", type = EDataType.UINT16)
private Integer thicknessTwo;
- @S7Variable(address = "DB49.2", type = EDataType.STRING, count = 20)
+ @S7Variable(address = "DB49.2", type = EDataType.STRING, count = 14)
private String plcGlassIdOne;
- @S7Variable(address = "DB49.24", type = EDataType.STRING, count = 20)
+ @S7Variable(address = "DB49.24", type = EDataType.STRING, count = 14)
private String mesGlassIdOne;
- @S7Variable(address = "DB49.54", type = EDataType.STRING, count = 20)
+ @S7Variable(address = "DB49.54", type = EDataType.STRING, count = 14)
private String plcGlassIdTwo;
- @S7Variable(address = "DB49.76", type = EDataType.STRING, count = 20)
+ @S7Variable(address = "DB49.76", type = EDataType.STRING, count = 14)
private String mesglassIdTwo;
}
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/s7/entity/S7DataWL.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/s7/entity/S7DataWL.java
index 0cd82b1..6c4412b 100644
--- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/s7/entity/S7DataWL.java
+++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/s7/entity/S7DataWL.java
@@ -1,6 +1,6 @@
package com.mes.s7.entity;
-import com.github.xingshuangs.iot.protocol.common.enums.EDataType;
+import com.github.xingshuangs.iot.common.enums.EDataType;
import com.github.xingshuangs.iot.protocol.s7.serializer.S7Variable;
import lombok.AllArgsConstructor;
import lombok.Builder;
@@ -43,13 +43,13 @@
@S7Variable(address = "DB49.118", type = EDataType.FLOAT32)
private Float speed;
- @S7Variable(address = "DB49.2", type = EDataType.STRING, count = 20)
+ @S7Variable(address = "DB49.2", type = EDataType.STRING, count = 14)
private String glassIdIn;
- @S7Variable(address = "DB49.24", type = EDataType.STRING, count = 20)
+ @S7Variable(address = "DB49.24", type = EDataType.STRING, count = 14)
private String glassIdOut;
- @S7Variable(address = "DB49.94", type = EDataType.STRING, count = 20)
+ @S7Variable(address = "DB49.94", type = EDataType.STRING, count = 14)
private String glassId;
@S7Variable(address = "DB49.112.0", type = EDataType.BOOL)
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/s7/entity/S7DataWLExtra.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/s7/entity/S7DataWLExtra.java
index d581ac1..c6204c5 100644
--- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/s7/entity/S7DataWLExtra.java
+++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/s7/entity/S7DataWLExtra.java
@@ -1,6 +1,6 @@
package com.mes.s7.entity;
-import com.github.xingshuangs.iot.protocol.common.enums.EDataType;
+import com.github.xingshuangs.iot.common.enums.EDataType;
import com.github.xingshuangs.iot.protocol.s7.serializer.S7Variable;
import lombok.Data;
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/config/S7Config.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/config/S7Config.java
index d9cc5b7..987b744 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/config/S7Config.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/config/S7Config.java
@@ -16,12 +16,14 @@
@Bean(name = "s7SerializerDLPOne")
public S7Serializer s7SerializerDLPOne() {
S7PLC s7PLC = new S7PLC(EPlcType.S1500, "192.168.20.140");
+// S7PLC s7PLC = new S7PLC(EPlcType.S1500, "10.153.19.191");
return S7Serializer.newInstance(s7PLC);
}
@Bean(name = "s7SerializerDLPTwo")
public S7Serializer s7SerializerDLPTwo() {
S7PLC s7PLC = new S7PLC(EPlcType.S1500, "192.168.20.140");
+// S7PLC s7PLC = new S7PLC(EPlcType.S1500, "10.153.19.191");
return S7Serializer.newInstance(s7PLC);
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OPCPlcSlicecage.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OPCPlcSlicecage.java
index 0277d2d..46df258 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OPCPlcSlicecage.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OPCPlcSlicecage.java
@@ -85,8 +85,8 @@
List<BigStorageTaskVO> inTaskList = new ArrayList();
// ReadWriteEntity fromOpcUa = miloService.readFromOpcUa("DLP1A.DLP1A.FROM1");
String fromOpcUa = s7DataDLPOne.getFrom1().toString();
- List<Short> states = s7DataDLPOne.getStates();
- List<Short> tos = s7DataDLPOne.getTos();
+ List<Integer> states = s7DataDLPOne.getStates();
+ List<Integer> tos = s7DataDLPOne.getTos();
List<String> ids = s7DataDLPOne.getIds();
for (int i = 1; i <= 6; i++) {
// ReadWriteEntity requestWord = miloService.readFromOpcUa("DLP1A.DLP1A.DI" + i);
@@ -150,7 +150,60 @@
//鍑虹墖浠诲姟鏁版嵁
- List<BigStorageCageTask> outTaskList = bigStorageCageTaskService.queryTaskMessage("big_storage_cage_out_one_task");
+// List<BigStorageCageTask> outTaskList = bigStorageCageTaskService.queryTaskMessage("big_storage_cage_out_one_task");
+ List<BigStorageCageTask> outTaskList = new ArrayList<>();
+ for (int i = 0; i < 6; i++) {
+
+ BigStorageCageTask bigStorageCageTask = new BigStorageCageTask();
+ String glassId = "";
+ Integer startSlot = 0;
+ Integer targetSlot = 0;
+ Integer taskState = 0;
+ switch (i) {
+ case 0:
+ glassId = s7DataWLTwo.getId1();
+ startSlot = s7DataWLTwo.getFrom1();
+ targetSlot = s7DataWLTwo.getTo1();
+ taskState = s7DataWLTwo.getState1();
+ ;
+ break;
+ case 1:
+ glassId = s7DataWLTwo.getId2();
+ startSlot = s7DataWLTwo.getFrom2();
+ targetSlot = s7DataWLTwo.getTo2();
+ taskState = s7DataWLTwo.getState2();
+ break;
+ case 2:
+ glassId = s7DataWLTwo.getId3();
+ startSlot = s7DataWLTwo.getFrom3();
+ targetSlot = s7DataWLTwo.getTo3();
+ taskState = s7DataWLTwo.getState3();
+ break;
+ case 3:
+ glassId = s7DataWLTwo.getId4();
+ startSlot = s7DataWLTwo.getFrom4();
+ targetSlot = s7DataWLTwo.getTo4();
+ taskState = s7DataWLTwo.getState4();
+ break;
+ case 4:
+ glassId = s7DataWLTwo.getId5();
+ startSlot = s7DataWLTwo.getFrom5();
+ targetSlot = s7DataWLTwo.getTo5();
+ taskState = s7DataWLTwo.getState5();
+ break;
+ case 5:
+ glassId = s7DataWLTwo.getId6();
+ startSlot = s7DataWLTwo.getFrom6();
+ targetSlot = s7DataWLTwo.getTo6();
+ taskState = s7DataWLTwo.getState6();
+ break;
+ }
+ bigStorageCageTask.setGlassId(glassId);
+ bigStorageCageTask.setStartSlot(startSlot);
+ bigStorageCageTask.setTargetSlot(targetSlot);
+ bigStorageCageTask.setTaskState(taskState);
+ outTaskList.add(bigStorageCageTask);
+ }
jsonObject.append("bigStorageCageDetailsOutTask", outTaskList);
} catch (Exception e) {
//todo:涓嶅仛浠诲姟澶勭悊
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageNewTask.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageNewTask.java
index b32a032..12c9e54 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageNewTask.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageNewTask.java
@@ -119,7 +119,7 @@
// ReadWriteEntity mesReplyEntity = miloService.readFromOpcUa("DLP1A.DLP1A.MesReply");
// if ("1".equals(mesReplyEntity.getValue() + "")) {
String mesReplyEntity = s7DataDLPOne.getMesReply().toString();
- if (!"1".equals(mesReplyEntity)) {
+ if ("1".equals(mesReplyEntity)) {
log.info("鏈夋鍦ㄦ墽琛岀殑浠诲姟锛岀粨鏉熻繘鐗囦换鍔�");
return;
}
@@ -128,13 +128,13 @@
// ReadWriteEntity fromOpcUa = miloService.readFromOpcUa("DLP1A.DLP1A.FROM1");
String fromOpcUa = s7DataDLPOne.getFrom1().toString();
- List<Short> states = s7DataDLPOne.getStates();
+ List<String> ids = s7DataDLPOne.getIds();
List<String> glassIdList = new ArrayList<>();
- for (int i = 1; i <= 6; i++) {
+ for (int i = 0; i < 6; i++) {
// ReadWriteEntity requestWord = miloService.readFromOpcUa("DLP1A.DLP1A.DI" + i);
- String requestWord = states.get(i).toString();
+ String requestWord = ids.get(i);
// if (null != requestWord.getValue()) {
- if (null != requestWord) {
+ if (null != requestWord && !requestWord.isEmpty()) {
BigStorageCageTask task = new BigStorageCageTask();
// task.setGlassId(requestWord.getValue() + "");
task.setGlassId(requestWord);
@@ -159,7 +159,7 @@
//鍚憄lc鍙戦�佹姤璀�:褰撳墠澶ц溅杩涚墖鐜荤拑鏁伴噺涓巑es璇诲彇鍒扮殑鏁伴噺涓嶅尮閰�
// miloService.writeToOpcWord(generateReadWriteEntity("DLP1A.DLP1A.alarmSignal", 1));
s7DataDLPOne = new S7DataDLPOne();
- s7DataDLPOne.setAlramSignal((short) 1);
+ s7DataDLPOne.setAlarmSignal(1);
s7SerializerDLPOne.write(s7DataDLPOne);
return;
}
@@ -170,7 +170,7 @@
//鍚憄lc鍙戦�佹姤璀�:鍚屼竴杞﹁繘鐗囩幓鐠冨瓨鍦ㄧ浉鍚�
// miloService.writeToOpcWord(generateReadWriteEntity("DLP1A.DLP1A.alarmSignal", 2));
s7DataDLPOne = new S7DataDLPOne();
- s7DataDLPOne.setAlramSignal((short) 2);
+ s7DataDLPOne.setAlarmSignal(2);
s7SerializerDLPOne.write(s7DataDLPOne);
return;
}
@@ -182,7 +182,7 @@
//鍚憄lc鍙戦�佹姤璀�:鐞嗙墖绗煎瓨鍦ㄧ浉鍚岀殑杩涚墖鐜荤拑
// miloService.writeToOpcWord(generateReadWriteEntity("DLP1A.DLP1A.alarmSignal", 4));
s7DataDLPOne = new S7DataDLPOne();
- s7DataDLPOne.setAlramSignal((short) 4);
+ s7DataDLPOne.setAlarmSignal(4);
s7SerializerDLPOne.write(s7DataDLPOne);
return;
}
@@ -193,7 +193,7 @@
//鍚憄lc鍙戦�佹姤璀�:杩涚墖浠诲姟鏁伴噺涓庣郴缁熸煡璇㈠埌鐨勭幓鐠冩暟閲忎笉鍖归厤
// miloService.writeToOpcWord(generateReadWriteEntity("DLP1A.DLP1A.alarmSignal", 8));
s7DataDLPOne = new S7DataDLPOne();
- s7DataDLPOne.setAlramSignal((short) 8);
+ s7DataDLPOne.setAlarmSignal(8);
s7SerializerDLPOne.write(s7DataDLPOne);
return;
}
@@ -214,7 +214,7 @@
//鍚憄lc鍙戦�佹姤璀�:绗煎唴鏍煎瓙鍓╀綑鏁伴噺涓嶈冻
// miloService.writeToOpcWord(generateReadWriteEntity("DLP1A.DLP1A.alarmSignal", 16));
s7DataDLPOne = new S7DataDLPOne();
- s7DataDLPOne.setAlramSignal((short) 16);
+ s7DataDLPOne.setAlarmSignal(16);
s7SerializerDLPOne.write(s7DataDLPOne);
return;
}
@@ -230,7 +230,7 @@
//鍚憄lc鍙戦�佹姤璀�:鐩撮�氱墖鍙板瓨鍦ㄧ幓鐠冿紝鏃犳硶缁х画鐩撮��
// miloService.writeToOpcWord(generateReadWriteEntity("DLP1A.DLP1A.alarmSignal", 64));
s7DataDLPOne = new S7DataDLPOne();
- s7DataDLPOne.setAlramSignal((short) 64);
+ s7DataDLPOne.setAlarmSignal(64);
s7SerializerDLPOne.write(s7DataDLPOne);
return;
}
@@ -260,7 +260,7 @@
.eq(BigStorageCage::getSlot, bigStorageDTO.getSlot()));
task.setTargetSlot(bigStorageDTO.getSlot());
task.setGlassId(info.getGlassId());
- bigStorageCageTaskService.updateTaskMessage("big_storage_cage_in_one_task", task);
+// bigStorageCageTaskService.updateTaskMessage("big_storage_cage_in_one_task", task);
//瀛樻斁鍘嗗彶浠诲姟
BigStorageCageHistoryTask historyTask = new BigStorageCageHistoryTask();
BeanUtils.copyProperties(task, historyTask);
@@ -283,7 +283,7 @@
} else {
BigStorageCageTask task = inTaskList.get(0);
task.setTargetSlot(THROUGH_SLOT);
- bigStorageCageTaskService.updateTaskMessage("big_storage_cage_in_one_task", task);
+// bigStorageCageTaskService.updateTaskMessage("big_storage_cage_in_one_task", task);
//瀛樻斁鍘嗗彶浠诲姟
BigStorageCageHistoryTask historyTask = new BigStorageCageHistoryTask();
BeanUtils.copyProperties(task, historyTask);
@@ -314,8 +314,8 @@
// list.add(generateReadWriteEntity("DLP1A.DLP1A.MesReply", 1));
// miloService.writeToOpcWord(list);
s7DataDLPOne = new S7DataDLPOne();
- for (int i = 0; i < inTaskList.size() && i < 6; i++) {
- short value = (short) Integer.parseInt(inTaskList.get(i).getTargetSlot().toString());
+ for (int i = 0; i < inTaskList.size(); i++) {
+ Integer value = Integer.parseInt(inTaskList.get(i).getTargetSlot().toString());
switch (i) {
case 0:
s7DataDLPOne.setTo1(value);
@@ -338,7 +338,9 @@
}
}
s7SerializerDLPOne.write(s7DataDLPOne);
-
+ s7DataDLPOne = new S7DataDLPOne();
+ s7DataDLPOne.setMesReply(1);
+ s7SerializerDLPOne.write(s7DataDLPOne);
}
@Scheduled(fixedDelay = 1000)
@@ -360,7 +362,8 @@
return;
}
//鑾峰彇鍑虹墖浠诲姟琛�
- List<BigStorageCageTask> outTaskList = bigStorageCageTaskService.queryTaskMessage("big_storage_cage_out_one_task");
+ List<BigStorageCageTask> outTaskList = getOutTaskList(s7DataWLTwo);
+// List<BigStorageCageTask> outTaskList = bigStorageCageTaskService.queryTaskMessage("big_storage_cage_out_one_task");
if (CollectionUtil.isNotEmpty(outTaskList)) {
log.info("鏈夋鍦ㄦ墽琛岀殑鍑虹墖浠诲姟锛岀粨鏉熸湰娆″嚭鐗囦换鍔�");
return;
@@ -544,7 +547,7 @@
}
// if (null != requestWord.getValue()) {
- if (null != requestWord) {
+ if (!requestWord.isEmpty()) {
BigStorageCageTask task = new BigStorageCageTask();
// task.setGlassId(requestWord.getValue() + "");
// task.setTargetSlot(Integer.parseInt(toOpcUa.getValue() + ""));
@@ -602,7 +605,7 @@
.eq(BigStorageCageHistoryTask::getGlassId, item.getGlassId()));
item.setTargetSlot(0);
//娓呯┖浠诲姟琛ㄦ暟鎹�
- bigStorageCageTaskService.updateTaskMessage("big_storage_cage_in_one_task", item);
+// bigStorageCageTaskService.updateTaskMessage("big_storage_cage_in_one_task", item);
}
//娓呯┖鍚姩鐘舵��
//鍚憃pc鍙戦�佸惎鍔ㄤ俊鍙�
@@ -613,14 +616,14 @@
// }
// list.add(generateReadWriteEntity("DLP1A.DLP1A.MesReply", 0));
// miloService.writeToOpcWord(list);
- s7DataDLPOne =new S7DataDLPOne();
- s7DataDLPOne.setTo1((short)0);
- s7DataDLPOne.setTo2((short)0);
- s7DataDLPOne.setTo3((short)0);
- s7DataDLPOne.setTo4((short)0);
- s7DataDLPOne.setTo5((short)0);
- s7DataDLPOne.setTo6((short)0);
- s7DataDLPOne.setMesReply((short)0);
+ s7DataDLPOne = new S7DataDLPOne();
+ s7DataDLPOne.setTo1(0);
+ s7DataDLPOne.setTo2(0);
+ s7DataDLPOne.setTo3(0);
+ s7DataDLPOne.setTo4(0);
+ s7DataDLPOne.setTo5(0);
+ s7DataDLPOne.setTo6(0);
+ s7DataDLPOne.setMesReply(0);
s7SerializerDLPOne.write(s7DataDLPOne);
}
@@ -634,8 +637,9 @@
log.info("褰撳墠涓洪潪鑱旀満鐘舵�侊紝缁撴潫瀹屾垚鍑虹墖浠诲姟");
return;
}
- //鑾峰彇杩涚墖浠诲姟琛�
- List<BigStorageCageTask> outTaskList = bigStorageCageTaskService.queryTaskMessage("big_storage_cage_out_one_task");
+ //鑾峰彇鍑虹墖浠诲姟琛�
+ List<BigStorageCageTask> outTaskList = getOutTaskList(s7DataWLTwo);
+// List<BigStorageCageTask> outTaskList = bigStorageCageTaskService.queryTaskMessage("big_storage_cage_out_one_task");
if (CollectionUtil.isEmpty(outTaskList)) {
log.info("褰撳墠澶ц溅鏃犺繘鐗囩幓鐠冿紝缁撴潫瀹屾垚杩涚墖浠诲姟");
return;
@@ -719,12 +723,13 @@
}
}
// 閲嶇疆浠诲姟琛ㄦ暟鎹�
- bigStorageCageTaskService.updateOutTaskMessage("big_storage_cage_out_one_task");
+// bigStorageCageTaskService.updateOutTaskMessage("big_storage_cage_out_one_task");
+ resetOutTask();
//娓呯┖鍚姩鐘舵��
//鍚憃pc鍙戦�佸惎鍔ㄤ俊鍙�
// miloService.writeToOpcWord(generateReadWriteEntity("DLP1B.DLP1B.MesReply", 0));
- S7DataDLPTwo s7DataDLPTwo=new S7DataDLPTwo();
- s7DataDLPTwo.setMesReply((short)0);
+ S7DataDLPTwo s7DataDLPTwo = new S7DataDLPTwo();
+ s7DataDLPTwo.setMesReply(0);
s7SerializerDLPTwo.write(s7DataDLPTwo);
}
@@ -858,12 +863,54 @@
List<String> glassIds = bigStorageCageTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList());
int glassCount = bigStorageCageTaskList.size();
//鐢熸垚鍑虹墖浠诲姟鏉℃暟涓嶈冻6琛ュ叏
- while (bigStorageCageTaskList.size() < 6) {
- bigStorageCageTaskList.add(new BigStorageCageTask("", 0, 0, 0));
- }
+// while (bigStorageCageTaskList.size() < 6) {
+// bigStorageCageTaskList.add(new BigStorageCageTask("", 0, 0, 0));
+// }
//娓呯┖浠诲姟琛ㄦ暟鎹�
- bigStorageCageTaskService.removeAll("big_storage_cage_out_one_task");
- bigStorageCageTaskService.saveTaskMessage(tableName, bigStorageCageTaskList);
+ resetOutTask();
+ S7DataDLPTwo s7DataDLPTwo = new S7DataDLPTwo();
+ for (int i = 0; i < bigStorageCageTaskList.size() && i < 6; i++) {
+ String glassId = bigStorageCageTaskList.get(i).getGlassId();
+ Integer startSlot = bigStorageCageTaskList.get(i).getStartSlot();
+ Integer target = bigStorageCageTaskList.get(i).getTargetSlot();
+ if (startSlot > 0) {
+ switch (i) {
+ case 0:
+ s7DataDLPTwo.setId1(glassId);
+ s7DataDLPTwo.setFrom1(startSlot);
+ s7DataDLPTwo.setTo1(target);
+ break;
+ case 1:
+ s7DataDLPTwo.setId2(glassId);
+ s7DataDLPTwo.setFrom2(startSlot);
+ s7DataDLPTwo.setTo2(target);
+ break;
+ case 2:
+ s7DataDLPTwo.setId3(glassId);
+ s7DataDLPTwo.setFrom3(startSlot);
+ s7DataDLPTwo.setTo3(target);
+ break;
+ case 3:
+ s7DataDLPTwo.setId4(glassId);
+ s7DataDLPTwo.setFrom4(startSlot);
+ s7DataDLPTwo.setTo4(target);
+ break;
+ case 4:
+ s7DataDLPTwo.setId5(glassId);
+ s7DataDLPTwo.setFrom5(startSlot);
+ s7DataDLPTwo.setTo5(target);
+ break;
+ case 5:
+ s7DataDLPTwo.setId6(glassId);
+ s7DataDLPTwo.setFrom6(startSlot);
+ s7DataDLPTwo.setTo6(target);
+ break;
+ }
+ }
+ }
+ s7SerializerDLPTwo.write(s7DataDLPTwo);
+// bigStorageCageTaskService.removeAll("big_storage_cage_out_one_task");
+// bigStorageCageTaskService.saveTaskMessage(tableName, bigStorageCageTaskList);
List<BigStorageCageHistoryTask> historyList = bigStorageCageTaskList.stream().filter(e -> StringUtils.isNotBlank(e.getGlassId())).map(e -> {
BigStorageCageHistoryTask history = new BigStorageCageHistoryTask();
BeanUtils.copyProperties(e, history);
@@ -881,8 +928,8 @@
.in(BigStorageCageDetails::getGlassId, glassIds));
try {
// miloService.writeToOpcWord(generateReadWriteEntity("DLP1B.DLP1B.MesReply", 1));
- S7DataDLPTwo s7DataDLPTwo=new S7DataDLPTwo();
- s7DataDLPTwo.setMesReply((short)1);
+ s7DataDLPTwo = new S7DataDLPTwo();
+ s7DataDLPTwo.setMesReply(1);
s7SerializerDLPTwo.write(s7DataDLPTwo);
} catch (Exception e) {
e.printStackTrace();
@@ -941,8 +988,8 @@
.in(BigStorageCageDetails::getGlassId, glassIds));
try {
// miloService.writeToOpcWord(generateReadWriteEntity("DLP1B.DLP1B.MesReply", 1));
- S7DataDLPTwo s7DataDLPTwo=new S7DataDLPTwo();
- s7DataDLPTwo.setMesReply((short)1);
+ S7DataDLPTwo s7DataDLPTwo = new S7DataDLPTwo();
+ s7DataDLPTwo.setMesReply(1);
s7SerializerDLPTwo.write(s7DataDLPTwo);
} catch (Exception e) {
e.printStackTrace();
@@ -985,4 +1032,54 @@
.value(value)
.build();
}
+
+ //閲嶇疆浠诲姟琛�
+ private void resetOutTask() {
+ S7DataDLPTwo s7DataDLPTwo = new S7DataDLPTwo();
+ s7DataDLPTwo.setId1("");
+ s7DataDLPTwo.setId2("");
+ s7DataDLPTwo.setId3("");
+ s7DataDLPTwo.setId4("");
+ s7DataDLPTwo.setId5("");
+ s7DataDLPTwo.setId6("");
+ s7DataDLPTwo.setFrom1(0);
+ s7DataDLPTwo.setFrom2(0);
+ s7DataDLPTwo.setFrom3(0);
+ s7DataDLPTwo.setFrom4(0);
+ s7DataDLPTwo.setFrom5(0);
+ s7DataDLPTwo.setFrom6(0);
+ s7DataDLPTwo.setTo1(0);
+ s7DataDLPTwo.setTo2(0);
+ s7DataDLPTwo.setTo3(0);
+ s7DataDLPTwo.setTo4(0);
+ s7DataDLPTwo.setTo5(0);
+ s7DataDLPTwo.setTo6(0);
+ s7DataDLPTwo.setState1(0);
+ s7DataDLPTwo.setState2(0);
+ s7DataDLPTwo.setState3(0);
+ s7DataDLPTwo.setState4(0);
+ s7DataDLPTwo.setState5(0);
+ s7DataDLPTwo.setState6(0);
+ s7SerializerDLPTwo.write(s7DataDLPTwo);
+ }
+
+ //璇诲彇鍑虹墖鍦板潃
+ private List<BigStorageCageTask> getOutTaskList(S7DataDLPTwo s7DataDLPTwo) {
+ List<BigStorageCageTask> outTaskList = new ArrayList<>();
+ List<String> glassIds = s7DataDLPTwo.getIds();
+ List<Integer> startSlots = s7DataDLPTwo.getFroms();
+ List<Integer> endSlots = s7DataDLPTwo.getTos();
+ List<Integer> states = s7DataDLPTwo.getStates();
+ for (int i = 0; i < 6; i++) {
+ if (glassIds.get(i) != null && !glassIds.get(i).isEmpty()) {
+ BigStorageCageTask bigStorageCageTask = new BigStorageCageTask();
+ bigStorageCageTask.setGlassId(glassIds.get(i));
+ bigStorageCageTask.setStartSlot(startSlots.get(i));
+ bigStorageCageTask.setTargetSlot(endSlots.get(i));
+ bigStorageCageTask.setTaskState(states.get(i));
+ outTaskList.add(bigStorageCageTask);
+ }
+ }
+ return outTaskList;
+ }
}
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/s7/entity/S7DataDLPOne.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/s7/entity/S7DataDLPOne.java
index 0d4ee2a..d5718aa 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/s7/entity/S7DataDLPOne.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/s7/entity/S7DataDLPOne.java
@@ -1,6 +1,6 @@
package com.mes.s7.entity;
-import com.github.xingshuangs.iot.protocol.common.enums.EDataType;
+import com.github.xingshuangs.iot.common.enums.EDataType;
import com.github.xingshuangs.iot.protocol.s7.serializer.S7Variable;
import lombok.Data;
@@ -19,91 +19,91 @@
@S7Variable(address = "DB3.3118.0", type = EDataType.BOOL)
private Boolean mesControl;
- @S7Variable(address = "DB19.0", type = EDataType.INT16)
- private Short requestMes;
+ @S7Variable(address = "DB8.0", type = EDataType.UINT16)
+ private Integer requestMes;
- @S7Variable(address = "DB19.2", type = EDataType.INT16)
- private Short mesReply;
+ @S7Variable(address = "DB8.2", type = EDataType.UINT16)
+ private Integer mesReply;
- @S7Variable(address = "DB19.140", type = EDataType.INT16)
- private Short from1;
+ @S7Variable(address = "DB8.140", type = EDataType.UINT16)
+ private Integer from1;
- @S7Variable(address = "DB19.142", type = EDataType.INT16)
- private Short from2;
+ @S7Variable(address = "DB8.142", type = EDataType.UINT16)
+ private Integer from2;
- @S7Variable(address = "DB19.144", type = EDataType.INT16)
- private Short from3;
+ @S7Variable(address = "DB8.144", type = EDataType.UINT16)
+ private Integer from3;
- @S7Variable(address = "DB19.146", type = EDataType.INT16)
- private Short from4;
+ @S7Variable(address = "DB8.146", type = EDataType.UINT16)
+ private Integer from4;
- @S7Variable(address = "DB19.148", type = EDataType.INT16)
- private Short from5;
+ @S7Variable(address = "DB8.148", type = EDataType.UINT16)
+ private Integer from5;
- @S7Variable(address = "DB19.150", type = EDataType.INT16)
- private Short from6;
+ @S7Variable(address = "DB8.150", type = EDataType.UINT16)
+ private Integer from6;
- @S7Variable(address = "DB19.152", type = EDataType.INT16)
- private Short to1;
+ @S7Variable(address = "DB8.152", type = EDataType.UINT16)
+ private Integer to1;
- @S7Variable(address = "DB19.154", type = EDataType.INT16)
- private Short to2;
+ @S7Variable(address = "DB8.154", type = EDataType.UINT16)
+ private Integer to2;
- @S7Variable(address = "DB19.156", type = EDataType.INT16)
- private Short to3;
+ @S7Variable(address = "DB8.156", type = EDataType.UINT16)
+ private Integer to3;
- @S7Variable(address = "DB19.158", type = EDataType.INT16)
- private Short to4;
+ @S7Variable(address = "DB8.158", type = EDataType.UINT16)
+ private Integer to4;
- @S7Variable(address = "DB19.160", type = EDataType.INT16)
- private Short to5;
+ @S7Variable(address = "DB8.160", type = EDataType.UINT16)
+ private Integer to5;
- @S7Variable(address = "DB19.162", type = EDataType.INT16)
- private Short to6;
+ @S7Variable(address = "DB8.162", type = EDataType.UINT16)
+ private Integer to6;
- @S7Variable(address = "DB19.164", type = EDataType.INT16)
- private Short state1;
+ @S7Variable(address = "DB8.164", type = EDataType.UINT16)
+ private Integer state1;
- @S7Variable(address = "DB19.166", type = EDataType.INT16)
- private Short state2;
+ @S7Variable(address = "DB8.166", type = EDataType.UINT16)
+ private Integer state2;
- @S7Variable(address = "DB19.168", type = EDataType.INT16)
- private Short state3;
+ @S7Variable(address = "DB8.168", type = EDataType.UINT16)
+ private Integer state3;
- @S7Variable(address = "DB19.170", type = EDataType.INT16)
- private Short state4;
+ @S7Variable(address = "DB8.170", type = EDataType.UINT16)
+ private Integer state4;
- @S7Variable(address = "DB19.172", type = EDataType.INT16)
- private Short state5;
+ @S7Variable(address = "DB8.172", type = EDataType.UINT16)
+ private Integer state5;
- @S7Variable(address = "DB19.174", type = EDataType.INT16)
- private Short state6;
+ @S7Variable(address = "DB8.174", type = EDataType.UINT16)
+ private Integer state6;
- @S7Variable(address = "DB19.1246", type = EDataType.INT16)
- private Short glassCount;
+ @S7Variable(address = "DB8.1246", type = EDataType.UINT16)
+ private Integer glassCount;
- @S7Variable(address = "DB19.8", type = EDataType.STRING, count = 20)
+ @S7Variable(address = "DB8.8", type = EDataType.STRING, count = 14)
private String id1;
- @S7Variable(address = "DB19.30", type = EDataType.STRING, count = 20)
+ @S7Variable(address = "DB8.30", type = EDataType.STRING, count = 14)
private String id2;
- @S7Variable(address = "DB19.52", type = EDataType.STRING, count = 20)
+ @S7Variable(address = "DB8.52", type = EDataType.STRING, count = 14)
private String id3;
- @S7Variable(address = "DB19.74", type = EDataType.STRING, count = 20)
+ @S7Variable(address = "DB8.74", type = EDataType.STRING, count = 14)
private String id4;
- @S7Variable(address = "DB19.96", type = EDataType.STRING, count = 20)
+ @S7Variable(address = "DB8.96", type = EDataType.STRING, count = 14)
private String id5;
- @S7Variable(address = "DB19.118", type = EDataType.STRING, count = 20)
+ @S7Variable(address = "DB8.118", type = EDataType.STRING, count = 14)
private String id6;
- @S7Variable(address = "MW1002", type = EDataType.INT16)
- private Short alramSignal;
+ @S7Variable(address = "MW1002", type = EDataType.UINT16)
+ private Integer alarmSignal;
- public List<Short> getStates() {
+ public List<Integer> getStates() {
return Arrays.asList(state1, state2, state3, state4, state5, state6);
}
@@ -111,7 +111,7 @@
return Arrays.asList(id1, id2, id3, id4, id5, id6);
}
- public List<Short> getTos() {
+ public List<Integer> getTos() {
return Arrays.asList(to1, to2, to3, to4, to5, to6);
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/s7/entity/S7DataDLPTwo.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/s7/entity/S7DataDLPTwo.java
index 553f37c..969ab04 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/s7/entity/S7DataDLPTwo.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/s7/entity/S7DataDLPTwo.java
@@ -1,8 +1,12 @@
package com.mes.s7.entity;
-import com.github.xingshuangs.iot.protocol.common.enums.EDataType;
+import com.github.xingshuangs.iot.common.enums.EDataType;
import com.github.xingshuangs.iot.protocol.s7.serializer.S7Variable;
+import io.swagger.models.auth.In;
import lombok.Data;
+
+import java.util.Arrays;
+import java.util.List;
/**
* @Author : zhoush
@@ -16,83 +20,98 @@
@S7Variable(address = "DB3.3118.0", type = EDataType.BOOL)
private Boolean mesControl;
- @S7Variable(address = "DB19.4", type = EDataType.INT16)
- private Short requestMes;
+ @S7Variable(address = "DB8.4", type = EDataType.UINT16)
+ private Integer requestMes;
- @S7Variable(address = "DB19.6", type = EDataType.INT16)
- private Short mesReply;
+ @S7Variable(address = "DB8.6", type = EDataType.UINT16)
+ private Integer mesReply;
- @S7Variable(address = "DB19.308", type = EDataType.INT16)
- private Short from1;
+ @S7Variable(address = "DB8.308", type = EDataType.UINT16)
+ private Integer from1;
- @S7Variable(address = "DB19.310", type = EDataType.INT16)
- private Short from2;
+ @S7Variable(address = "DB8.310", type = EDataType.UINT16)
+ private Integer from2;
- @S7Variable(address = "DB19.312", type = EDataType.INT16)
- private Short from3;
+ @S7Variable(address = "DB8.312", type = EDataType.UINT16)
+ private Integer from3;
- @S7Variable(address = "DB19.314", type = EDataType.INT16)
- private Short from4;
+ @S7Variable(address = "DB8.314", type = EDataType.UINT16)
+ private Integer from4;
- @S7Variable(address = "DB19.316", type = EDataType.INT16)
- private Short from5;
+ @S7Variable(address = "DB8.316", type = EDataType.UINT16)
+ private Integer from5;
- @S7Variable(address = "DB19.318", type = EDataType.INT16)
- private Short from6;
+ @S7Variable(address = "DB8.318", type = EDataType.UINT16)
+ private Integer from6;
- @S7Variable(address = "DB19.320", type = EDataType.INT16)
- private Short to1;
+ @S7Variable(address = "DB8.320", type = EDataType.UINT16)
+ private Integer to1;
- @S7Variable(address = "DB19.322", type = EDataType.INT16)
- private Short to2;
+ @S7Variable(address = "DB8.322", type = EDataType.UINT16)
+ private Integer to2;
- @S7Variable(address = "DB19.324", type = EDataType.INT16)
- private Short to3;
+ @S7Variable(address = "DB8.324", type = EDataType.UINT16)
+ private Integer to3;
- @S7Variable(address = "DB19.326", type = EDataType.INT16)
- private Short to4;
+ @S7Variable(address = "DB8.326", type = EDataType.UINT16)
+ private Integer to4;
- @S7Variable(address = "DB19.328", type = EDataType.INT16)
- private Short to5;
+ @S7Variable(address = "DB8.328", type = EDataType.UINT16)
+ private Integer to5;
- @S7Variable(address = "DB19.330", type = EDataType.INT16)
- private Short to6;
+ @S7Variable(address = "DB8.330", type = EDataType.UINT16)
+ private Integer to6;
- @S7Variable(address = "DB19.332", type = EDataType.INT16)
- private Short state1;
+ @S7Variable(address = "DB8.332", type = EDataType.UINT16)
+ private Integer state1;
- @S7Variable(address = "DB19.334", type = EDataType.INT16)
- private Short state2;
+ @S7Variable(address = "DB8.334", type = EDataType.UINT16)
+ private Integer state2;
- @S7Variable(address = "DB19.336", type = EDataType.INT16)
- private Short state3;
+ @S7Variable(address = "DB8.336", type = EDataType.UINT16)
+ private Integer state3;
- @S7Variable(address = "DB19.338", type = EDataType.INT16)
- private Short state4;
+ @S7Variable(address = "DB8.338", type = EDataType.UINT16)
+ private Integer state4;
- @S7Variable(address = "DB19.340", type = EDataType.INT16)
- private Short state5;
+ @S7Variable(address = "DB8.340", type = EDataType.UINT16)
+ private Integer state5;
- @S7Variable(address = "DB19.342", type = EDataType.INT16)
- private Short state6;
+ @S7Variable(address = "DB8.342", type = EDataType.UINT16)
+ private Integer state6;
- @S7Variable(address = "DB19.176", type = EDataType.STRING, count = 20)
+ @S7Variable(address = "DB8.176", type = EDataType.STRING, count = 14)
private String id1;
- @S7Variable(address = "DB19.198", type = EDataType.STRING, count = 20)
+ @S7Variable(address = "DB8.198", type = EDataType.STRING, count = 14)
private String id2;
- @S7Variable(address = "DB19.220", type = EDataType.STRING, count = 20)
+ @S7Variable(address = "DB8.220", type = EDataType.STRING, count = 14)
private String id3;
- @S7Variable(address = "DB19.242", type = EDataType.STRING, count = 20)
+ @S7Variable(address = "DB8.242", type = EDataType.STRING, count = 14)
private String id4;
- @S7Variable(address = "DB19.264", type = EDataType.STRING, count = 20)
+ @S7Variable(address = "DB8.264", type = EDataType.STRING, count = 14)
private String id5;
- @S7Variable(address = "DB19.286", type = EDataType.STRING, count = 20)
+ @S7Variable(address = "DB8.286", type = EDataType.STRING, count = 14)
private String id6;
+ public List<Integer> getStates() {
+ return Arrays.asList(state1, state2, state3, state4, state5, state6);
+ }
+
+ public List<String> getIds() {
+ return Arrays.asList(id1, id2, id3, id4, id5, id6);
+ }
+
+ public List<Integer> getTos() {
+ return Arrays.asList(to1, to2, to3, to4, to5, to6);
+ }
+
+ public List<Integer> getFroms() {
+ return Arrays.asList(from1, from2, from3, from4, from5, from6);
+ }
}
diff --git a/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/s7/entity/S7DataCC.java b/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/s7/entity/S7DataCC.java
index 2db8d03..3764667 100644
--- a/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/s7/entity/S7DataCC.java
+++ b/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/s7/entity/S7DataCC.java
@@ -1,6 +1,6 @@
package com.mes.s7.entity;
-import com.github.xingshuangs.iot.protocol.common.enums.EDataType;
+import com.github.xingshuangs.iot.common.enums.EDataType;
import com.github.xingshuangs.iot.protocol.s7.serializer.S7Variable;
import lombok.Data;
diff --git a/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/s7/entity/S7DataSP.java b/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/s7/entity/S7DataSP.java
index f3be3ab..75a6e09 100644
--- a/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/s7/entity/S7DataSP.java
+++ b/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/s7/entity/S7DataSP.java
@@ -1,6 +1,6 @@
package com.mes.s7.entity;
-import com.github.xingshuangs.iot.protocol.common.enums.EDataType;
+import com.github.xingshuangs.iot.common.enums.EDataType;
import com.github.xingshuangs.iot.protocol.s7.serializer.S7Variable;
import lombok.Data;
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/s7/entity/S7DataSP.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/s7/entity/S7DataSP.java
index f3be3ab..75a6e09 100644
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/s7/entity/S7DataSP.java
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/s7/entity/S7DataSP.java
@@ -1,6 +1,6 @@
package com.mes.s7.entity;
-import com.github.xingshuangs.iot.protocol.common.enums.EDataType;
+import com.github.xingshuangs.iot.common.enums.EDataType;
import com.github.xingshuangs.iot.protocol.s7.serializer.S7Variable;
import lombok.Data;
diff --git a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/s7/entity/S7DataGHOne.java b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/s7/entity/S7DataGHOne.java
index 8f6c82a..66ba975 100644
--- a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/s7/entity/S7DataGHOne.java
+++ b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/s7/entity/S7DataGHOne.java
@@ -1,6 +1,6 @@
package com.mes.s7.entity;
-import com.github.xingshuangs.iot.protocol.common.enums.EDataType;
+import com.github.xingshuangs.iot.common.enums.EDataType;
import com.github.xingshuangs.iot.protocol.s7.serializer.S7Variable;
import lombok.AllArgsConstructor;
import lombok.Builder;
diff --git a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/s7/entity/S7DataGHTwo.java b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/s7/entity/S7DataGHTwo.java
index b5684c4..2afc86c 100644
--- a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/s7/entity/S7DataGHTwo.java
+++ b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/s7/entity/S7DataGHTwo.java
@@ -1,6 +1,6 @@
package com.mes.s7.entity;
-import com.github.xingshuangs.iot.protocol.common.enums.EDataType;
+import com.github.xingshuangs.iot.common.enums.EDataType;
import com.github.xingshuangs.iot.protocol.s7.serializer.S7Variable;
import lombok.Data;
diff --git a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/config/ModbusConfig.java b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/config/ModbusConfig.java
new file mode 100644
index 0000000..a6cb76b
--- /dev/null
+++ b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/config/ModbusConfig.java
@@ -0,0 +1,27 @@
+package com.mes.config;
+
+import com.github.xingshuangs.iot.protocol.modbus.service.ModbusTcp;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * @Author : zhoush
+ * @Date: 2025/4/30 13:50
+ * @Description:
+ */
+@Configuration
+public class ModbusConfig {
+
+ @Bean(name = "CMJ1ModbusTcp")
+ public ModbusTcp CMJ1ModbusTcp() {
+// return new ModbusTcp("127.0.0.1");
+ return new ModbusTcp("192.168.30.160");
+ }
+
+ @Bean(name = "CMJ2ModbusTcp")
+ public ModbusTcp CMJ2ModbusTcp() {
+// return new ModbusTcp("127.0.0.1");
+ return new ModbusTcp("192.168.30.162");
+ }
+
+}
diff --git a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/config/S7Config.java b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/config/S7Config.java
index 75016c8..dfeb362 100644
--- a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/config/S7Config.java
+++ b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/config/S7Config.java
@@ -15,13 +15,22 @@
public class S7Config {
@Bean(name = "s7SerializerZKDLPOne")
public S7Serializer s7SerializerZKDLPOne() {
- S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.30.100");
+ S7PLC s7PLC = new S7PLC(EPlcType.S1500, "192.168.30.100");
+// S7PLC s7PLC = new S7PLC(EPlcType.S1500, "10.153.19.191");
return S7Serializer.newInstance(s7PLC);
}
@Bean(name = "s7SerializerZKDLPTwo")
public S7Serializer s7SerializerZKDLPTwo() {
- S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.30.100");
+ S7PLC s7PLC = new S7PLC(EPlcType.S1500, "192.168.30.100");
+// S7PLC s7PLC = new S7PLC(EPlcType.S1500, "10.153.19.191");
+ return S7Serializer.newInstance(s7PLC);
+ }
+
+ @Bean(name = "s7SerializerZKQ2")
+ public S7Serializer s7SerializerZKQ2() {
+ S7PLC s7PLC = new S7PLC(EPlcType.S1500, "192.168.30.140");
+// S7PLC s7PLC = new S7PLC(EPlcType.S1500, "10.153.19.191");
return S7Serializer.newInstance(s7PLC);
}
diff --git a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/OpcHollowRemoveTask.java b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/OpcHollowRemoveTask.java
index f684f6c..58519fe 100644
--- a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/OpcHollowRemoveTask.java
+++ b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/OpcHollowRemoveTask.java
@@ -1,5 +1,6 @@
package com.mes.job;
+import com.github.xingshuangs.iot.protocol.modbus.service.ModbusTcp;
import com.kangaroohy.milo.model.ReadWriteEntity;
import com.kangaroohy.milo.service.MiloService;
import com.mes.hollow.entity.vo.HollowGlassFormulaVO;
@@ -7,6 +8,7 @@
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@@ -28,6 +30,16 @@
@Autowired(required = false)
MiloService miloService;
+ @Autowired
+ @Qualifier("CMJ1ModbusTcp")
+ ModbusTcp CMJ1ModbusTcp;
+
+ @Autowired
+ @Qualifier("CMJ2ModbusTcp")
+ ModbusTcp CMJ2ModbusTcp;
+
+ private Integer offset = 40001;
+
/**
* 鏀跺埌闄よ啘鏈鸿姹傚強鐜荤拑id
*
@@ -44,25 +56,36 @@
}
private void hollowRemoveChildTask(String cell) throws Exception {
- ReadWriteEntity requestEntity = miloService.readFromOpcUa(cell + "mesControl");
- if ("0".equals(requestEntity.getValue() + "")) {
+ ModbusTcp modbusTcp = null;
+ if ("CMJ1.CMJ1.".equals(cell)) {
+ modbusTcp = CMJ1ModbusTcp;
+ } else {
+ modbusTcp = CMJ2ModbusTcp;
+ }
+ Integer requestEntity = modbusTcp.readUInt16(42001 - offset);
+// ReadWriteEntity requestEntity = miloService.readFromOpcUa(cell + "mesControl");
+// if ("0".equals(requestEntity.getValue() + "")) {
+ if (0 == requestEntity) {
log.info("褰撳墠闄よ啘鏈轰负鍗曟満鐘舵��");
return;
}
- int request = Integer.parseInt(requestEntity.getValue() + "");
+// int request = Integer.parseInt(requestEntity.getValue() + "");
+ int request = requestEntity;
int flagRequest = request & 3;
if (flagRequest != 3) {
log.info("褰撳墠鏈敹鍒拌姹傜幓鐠僫d鏁版嵁锛岀粨鏉熶换鍔�");
return;
}
- ReadWriteEntity glassIdEntity = miloService.readFromOpcUa(cell + "glassId");
- if (null == glassIdEntity.getValue() || StringUtils.isBlank(glassIdEntity.getValue() + "")) {
+ String glassIdEntity = modbusTcp.readString(42003 - offset, 20);
+ if (null == glassIdEntity || StringUtils.isBlank(glassIdEntity)) {
+// ReadWriteEntity glassIdEntity = miloService.readFromOpcUa(cell + "glassId");
+// if (null == glassIdEntity.getValue() || StringUtils.isBlank(glassIdEntity.getValue() + "")) {
log.info("褰撳墠鏈敹鍒扮幓鐠僫d鏁版嵁锛岀粨鏉熶换鍔�");
return;
}
- log.info("褰撳墠闇�瑕侀櫎鑶滅殑鐜荤拑id涓猴細{}", glassIdEntity.getValue() + "");
+ log.info("褰撳墠闇�瑕侀櫎鑶滅殑鐜荤拑id涓猴細{}", glassIdEntity);
//鎸夌収鐜荤拑id鑾峰彇瀵瑰簲鐨勪换鍔d
- HollowGlassFormulaVO detailsVO = hollowFormulaDetailsService.queryFormulaDetailsByGlassId(glassIdEntity.getValue() + "", null, null);
+ HollowGlassFormulaVO detailsVO = hollowFormulaDetailsService.queryFormulaDetailsByGlassId(glassIdEntity, null, null);
if (null == detailsVO) {
log.info("鐜荤拑id涓嶅瓨鍦紝璇锋鏌ユ暟鎹�");
return;
@@ -71,27 +94,37 @@
List<ReadWriteEntity> ualist = new ArrayList<>();
List<ReadWriteEntity> wordlist = new ArrayList<>();
-
+ int Id = 0;
if (detailsVO.getFilmRemove() == 0) {
// 10111011
int sendId = request & 63;
- sendId = sendId + 4;
- wordlist.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "mesControl", sendId));
+ Id = sendId + 4;
+// wordlist.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "mesControl", sendId));
+ modbusTcp.writeUInt16(42001 - offset, sendId);
} else {
// 鍏堝皢瀵瑰簲鐨勪綅缃负0锛岃幏寰楄姹傜殑鐜荤拑鏁版嵁锛� 鐒跺悗灏嗗搴斾綅鍊� 110111011
int sendId = request & 63;
- sendId = sendId + 4 + 64;
- wordlist.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "mesControl", sendId));
- ualist.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "glassTop", detailsVO.getTopRemove()));
- ualist.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "glassBottom", detailsVO.getBottomRemove()));
- ualist.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "glassLeft", detailsVO.getLeftRemove()));
- ualist.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "glassRight", detailsVO.getRightRemove()));
+ Id = sendId + 4 + 64;
+
+ modbusTcp.writeUInt32(42019 - offset, detailsVO.getTopRemove());
+ modbusTcp.writeUInt32(42021 - offset, detailsVO.getTopRemove());
+ modbusTcp.writeUInt32(42023 - offset, detailsVO.getTopRemove());
+ modbusTcp.writeUInt32(42025 - offset, detailsVO.getTopRemove());
+// wordlist.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "mesControl", sendId));
+// ualist.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "glassTop", detailsVO.getTopRemove()));
+// ualist.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "glassBottom", detailsVO.getBottomRemove()));
+// ualist.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "glassLeft", detailsVO.getLeftRemove()));
+// ualist.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "glassRight", detailsVO.getRightRemove()));
}
- ualist.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "thickness", (int) (detailsVO.getThickness() * 10)));
- ualist.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "firstLength", (int) (Math.max(detailsVO.getWidth(), detailsVO.getHeight())) * 10));
- ualist.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "secondLength", (int) (Math.min(detailsVO.getWidth(), detailsVO.getHeight())) * 10));
- miloService.writeToOpcWord(wordlist);
- miloService.writeToOpcUa(ualist);
+ modbusTcp.writeUInt32(42013 - offset, (int) (detailsVO.getThickness() * 10));
+ modbusTcp.writeUInt32(42015 - offset, (int) (Math.max(detailsVO.getWidth(), detailsVO.getHeight())) * 10);
+ modbusTcp.writeUInt32(42017 - offset, (int) (Math.min(detailsVO.getWidth(), detailsVO.getHeight())) * 10);
+ modbusTcp.writeUInt16(42001 - offset, Id);
+// ualist.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "thickness", (int) (detailsVO.getThickness() * 10)));
+// ualist.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "firstLength", (int) (Math.max(detailsVO.getWidth(), detailsVO.getHeight())) * 10));
+// ualist.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "secondLength", (int) (Math.min(detailsVO.getWidth(), detailsVO.getHeight())) * 10));
+// miloService.writeToOpcWord(wordlist);
+// miloService.writeToOpcUa(ualist);
return;
}
@@ -111,8 +144,15 @@
}
public void finishHollowRemoveChildTask(String cell) throws Exception {
- ReadWriteEntity requestEntity = miloService.readFromOpcUa(cell + "mesControl");
- int request = Integer.parseInt(requestEntity.getValue() + "");
+// ReadWriteEntity requestEntity = miloService.readFromOpcUa(cell + "mesControl");
+ ModbusTcp modbusTcp = null;
+ if ("CMJ1.CMJ1.".equals(cell)) {
+ modbusTcp = CMJ1ModbusTcp;
+ } else {
+ modbusTcp = CMJ2ModbusTcp;
+ }
+ int requestEntity = modbusTcp.readUInt16(42001 - offset);
+ int request = requestEntity;
int flagRequest = request & 9;
if (flagRequest != 9) {
log.info("褰撳墠鏈敹鍒伴櫎鑶滄満ID鎺ユ敹瀹屾垚淇″彿锛岀粨鏉熶换鍔�");
@@ -120,9 +160,10 @@
}
//鍚戠數姘斿彂閫佹竻妤氫俊鍙�
int sendId = request & 251;
- List<ReadWriteEntity> list = new ArrayList<>();
- list.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "mesControl", sendId));
- miloService.writeToOpcWord(list);
+// List<ReadWriteEntity> list = new ArrayList<>();
+// list.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "mesControl", sendId));
+// miloService.writeToOpcWord(list);
+ modbusTcp.writeUInt16(42001 - offset, sendId);
}
}
\ No newline at end of file
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 5cfe3f2..5641094 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
@@ -6,6 +6,7 @@
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+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;
@@ -36,6 +37,7 @@
import com.mes.hollowtask.service.HollowBigStorageCageHistoryTaskService;
import com.mes.s7.entity.S7DataZKDLPOne;
import com.mes.s7.entity.S7DataZKDLPTwo;
+import com.mes.s7.entity.S7DataZKExtra;
import com.mes.sysconfig.service.SysConfigService;
import com.mes.temperingglass.entity.TemperingGlassInfo;
import com.mes.temperingglass.service.TemperingGlassInfoService;
@@ -91,6 +93,14 @@
@Qualifier("s7SerializerZKDLPTwo")
private S7Serializer s7SerializerZKDLPTwo;
+ @Autowired
+ @Qualifier("s7SerializerZKQ2")
+ private S7Serializer s7SerializerZKQ2;
+
+ @Autowired
+ @Qualifier("CMJ1ModbusTcp")
+ ModbusTcp CMJ1ModbusTcp;
+
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";
/**
@@ -122,6 +132,7 @@
@Scheduled(fixedDelay = 1000)
public void inBigStorageTask() throws Exception {
S7DataZKDLPOne s7DataZKDLPOne = s7SerializerZKDLPOne.read(S7DataZKDLPOne.class);
+ log.info("杩涚墖浠诲姟璇诲彇s7DataZKDLPOne:{}", s7DataZKDLPOne);
// ReadWriteEntity inkageEntity = miloService.readFromOpcUa("DLP2A.DLP2A.mesControl");
// if (true != Boolean.parseBoolean(inkageEntity.getValue() + "")) {
Boolean inkageEntity = s7DataZKDLPOne.getMesControl();
@@ -148,12 +159,12 @@
// ReadWriteEntity fromOpcUa = miloService.readFromOpcUa("DLP2A.DLP2A.FROM1");
String fromOpcUa = s7DataZKDLPOne.getFrom1().toString();
List<String> glassIdList = new ArrayList<>();
- List<Integer> requestWords = s7DataZKDLPOne.getStates();
+ List<String> requestWords = s7DataZKDLPOne.getIds();
for (int i = 1; i <= 6; i++) {
// ReadWriteEntity requestWord = miloService.readFromOpcUa("DLP2A.DLP2A.DI" + i);
- Integer requestWord = requestWords.get(i - 1);
+ String requestWord = requestWords.get(i - 1);
// if (null != requestWord.getValue()) {
- if (null != requestWord) {
+ if (null != requestWord && !requestWord.isEmpty()) {
BigStorageCageTask task = new BigStorageCageTask();
// task.setGlassId(requestWord.getValue() + "");
task.setGlassId(requestWord.toString());
@@ -268,7 +279,7 @@
.eq(HollowBigStorageCage::getSlot, bigStorageDTO.getSlot()));
task.setTargetSlot(bigStorageDTO.getSlot());
task.setGlassId(info.getGlassId());
- bigStorageCageTaskService.updateTaskMessage(BIG_STORAGE_CAGE_IN_TWO_TASK, task);
+// bigStorageCageTaskService.updateTaskMessage(BIG_STORAGE_CAGE_IN_TWO_TASK, task);
//瀛樻斁鍘嗗彶浠诲姟
HollowBigStorageCageHistoryTask historyTask = new HollowBigStorageCageHistoryTask();
BeanUtils.copyProperties(task, historyTask);
@@ -301,7 +312,7 @@
} else {
BigStorageCageTask task = inTaskList.get(0);
task.setTargetSlot(THROUGH_SLOT);
- bigStorageCageTaskService.updateTaskMessage("big_storage_cage_in_two_task", task);
+// bigStorageCageTaskService.updateTaskMessage("big_storage_cage_in_two_task", task);
//瀛樻斁鍘嗗彶浠诲姟
HollowBigStorageCageHistoryTask historyTask = new HollowBigStorageCageHistoryTask();
BeanUtils.copyProperties(task, historyTask);
@@ -367,12 +378,16 @@
}
}
s7SerializerZKDLPOne.write(s7DataZKDLPOne);
+ s7DataZKDLPOne = new S7DataZKDLPOne();
+ s7DataZKDLPOne.setMesReply(1);
+ s7SerializerZKDLPOne.write(s7DataZKDLPOne);
}
@Scheduled(fixedDelay = 1000)
public void outBigStorageTask() throws Exception {
Date startDate = new Date();
S7DataZKDLPTwo s7DataZKDLPTwo = s7SerializerZKDLPTwo.read(S7DataZKDLPTwo.class);
+ log.info("杩涚墖浠诲姟璇诲彇s7DataZKDLPTwo:{}", s7DataZKDLPTwo);
// ReadWriteEntity inkageEntity = miloService.readFromOpcUa("DLP2B.DLP2B.mesControl");
// if (true != Boolean.parseBoolean(inkageEntity.getValue() + "")) {
Boolean inkageEntity = s7DataZKDLPTwo.getMesControl();
@@ -388,17 +403,27 @@
return;
}
//鑾峰彇鍑虹墖浠诲姟琛�
- List<BigStorageCageTask> outTaskList = bigStorageCageTaskService.queryTaskMessage(BIG_STORAGE_CAGE_OUT_TWO_TASK);
+// List<BigStorageCageTask> outTaskList = bigStorageCageTaskService.queryTaskMessage(BIG_STORAGE_CAGE_OUT_TWO_TASK);
+
+ List<BigStorageCageTask> outTaskList = getOutTaskList(s7DataZKDLPTwo);
+
if (CollectionUtil.isNotEmpty(outTaskList)) {
log.info("鏈夋鍦ㄦ墽琛岀殑鍑虹墖浠诲姟锛岀粨鏉熸湰娆″嚭鐗囦换鍔�");
return;
}
//鑾峰彇绌洪棽涓旈鍙栦换鍔$殑鏁版嵁淇℃伅锛屾病鏈変换鍔$洿鎺ヨ蛋鐜荤拑璋冨害
- HashMap<Integer, ReadWriteEntity> map = new HashMap<>();
- ReadWriteEntity oneEntity = miloService.readFromOpcUa("CMJ1.CMJ1.isFree");
- ReadWriteEntity twoEntity = miloService.readFromOpcUa("ZKQ2.ZKQ2.isFree");
- ReadWriteEntity threeEntity = miloService.readFromOpcUa("ZKQ2.ZKQ2.isFree03");
+
+ HashMap<Integer, Boolean> map = new HashMap<>();
+ S7DataZKExtra s7DataZKExtra = s7SerializerZKQ2.read(S7DataZKExtra.class);
+ Boolean oneEntity = CMJ1ModbusTcp.readUInt16(42027 - 40001) != 0;
+ log.info("璇诲彇浠诲姟{}", CMJ1ModbusTcp.readUInt16(42027 - 40001));
+ Boolean twoEntity = s7DataZKExtra.getIsFree();
+ Boolean threeEntity = s7DataZKExtra.getIsFree03();
+// HashMap<Integer, ReadWriteEntity> map = new HashMap<>();
+// ReadWriteEntity oneEntity = miloService.readFromOpcUa("CMJ1.CMJ1.isFree");
+// ReadWriteEntity twoEntity = miloService.readFromOpcUa("ZKQ2.ZKQ2.isFree");
+// ReadWriteEntity threeEntity = miloService.readFromOpcUa("ZKQ2.ZKQ2.isFree03");
map.put(930, oneEntity);
map.put(931, twoEntity);
map.put(932, threeEntity);
@@ -406,9 +431,10 @@
int cell = -1;
for (int i = 930; i <= 932; i++) {
if (null == hollowGlassOutRelationInfo) {
- ReadWriteEntity entity = map.get(i);
+ Boolean entity = map.get(i);
cell = i;
- if (null != entity.getValue() && ("1".equals(entity.getValue() + "") || Boolean.parseBoolean(entity.getValue() + ""))) {
+// if (null != entity.getValue() && ("1".equals(entity.getValue() + "") || Boolean.parseBoolean(entity.getValue() + ""))) {
+ if (null != entity && entity) {
hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService
.getOne(new LambdaQueryWrapper<HollowGlassOutRelationInfo>()
.eq(HollowGlassOutRelationInfo::getCell, cell)
@@ -526,37 +552,37 @@
String toOpcUa = "";
String fromOpcUa = "";
switch (i) {
- case 0:
+ case 1:
requestWord = s7DataZKDLPOne.getId1().toString();
statetWord = s7DataZKDLPOne.getState1().toString();
toOpcUa = s7DataZKDLPOne.getTo1().toString();
fromOpcUa = s7DataZKDLPOne.getFrom1().toString();
break;
- case 1:
+ case 2:
requestWord = s7DataZKDLPOne.getId2().toString();
statetWord = s7DataZKDLPOne.getState2().toString();
toOpcUa = s7DataZKDLPOne.getTo2().toString();
fromOpcUa = s7DataZKDLPOne.getFrom2().toString();
break;
- case 2:
+ case 3:
requestWord = s7DataZKDLPOne.getId3().toString();
statetWord = s7DataZKDLPOne.getState3().toString();
toOpcUa = s7DataZKDLPOne.getTo3().toString();
fromOpcUa = s7DataZKDLPOne.getFrom3().toString();
break;
- case 3:
+ case 4:
requestWord = s7DataZKDLPOne.getId4().toString();
statetWord = s7DataZKDLPOne.getState4().toString();
toOpcUa = s7DataZKDLPOne.getTo4().toString();
fromOpcUa = s7DataZKDLPOne.getFrom4().toString();
break;
- case 4:
+ case 5:
requestWord = s7DataZKDLPOne.getId5().toString();
statetWord = s7DataZKDLPOne.getState5().toString();
toOpcUa = s7DataZKDLPOne.getTo5().toString();
fromOpcUa = s7DataZKDLPOne.getFrom5().toString();
break;
- case 5:
+ case 6:
requestWord = s7DataZKDLPOne.getId6().toString();
statetWord = s7DataZKDLPOne.getState6().toString();
toOpcUa = s7DataZKDLPOne.getTo6().toString();
@@ -565,7 +591,7 @@
}
// if (null != requestWord.getValue()) {
- if (null != requestWord) {
+ if (null != requestWord && !requestWord.isEmpty()) {
BigStorageCageTask task = new BigStorageCageTask();
// task.setGlassId(requestWord.getValue() + "");
// task.setTargetSlot(Integer.parseInt(toOpcUa.getValue() + ""));
@@ -649,7 +675,7 @@
.eq(HollowBigStorageCageHistoryTask::getGlassId, item.getGlassId()));
item.setTargetSlot(0);
//娓呯┖浠诲姟琛ㄦ暟鎹�
- bigStorageCageTaskService.updateTaskMessage("big_storage_cage_in_one_task", item);
+// bigStorageCageTaskService.updateTaskMessage("big_storage_cage_in_one_task", item);
}
//娓呯┖鍚姩鐘舵��
//鍚憃pc鍙戦�佸惎鍔ㄤ俊鍙�
@@ -667,6 +693,8 @@
s7DataZKDLPOne.setTo4(0);
s7DataZKDLPOne.setTo5(0);
s7DataZKDLPOne.setTo6(0);
+ s7SerializerZKDLPOne.write(s7DataZKDLPOne);
+ s7DataZKDLPOne = new S7DataZKDLPOne();
s7DataZKDLPOne.setMesReply(0);
s7SerializerZKDLPOne.write(s7DataZKDLPOne);
}
@@ -681,10 +709,11 @@
log.info("褰撳墠涓洪潪鑱旀満鐘舵�侊紝缁撴潫瀹屾垚鍑虹墖浠诲姟");
return;
}
- //鑾峰彇杩涚墖浠诲姟琛�
- List<BigStorageCageTask> outTaskList = bigStorageCageTaskService.queryTaskMessage(BIG_STORAGE_CAGE_OUT_TWO_TASK);
+ //鑾峰彇鍑虹墖浠诲姟琛�
+// List<BigStorageCageTask> outTaskList = bigStorageCageTaskService.queryTaskMessage(BIG_STORAGE_CAGE_OUT_TWO_TASK);
+ List<BigStorageCageTask> outTaskList = getOutTaskList(s7DataZKDLPTwo);
if (CollectionUtil.isEmpty(outTaskList)) {
- log.info("褰撳墠澶ц溅鏃犺繘鐗囩幓鐠冿紝缁撴潫瀹屾垚杩涚墖浠诲姟");
+ log.info("褰撳墠澶ц溅鏃犲嚭鐗囩幓鐠冿紝缁撴潫瀹屾垚鍑虹墖浠诲姟");
return;
}
List<BigStorageCageTask> unFinishTaskList = outTaskList.stream().filter(e -> e.getTaskState() <= 1 || e.getStartSlot() == 0).collect(Collectors.toList());
@@ -705,7 +734,7 @@
taskMap.forEach((e1, v) -> {
if (e1 == 2) {
//杩涚墖瀹屾垚
- log.info("3銆佽幏鍙栬繘鐗囧凡瀹屾垚鐨勭幓鐠冧俊鎭痠d:{}", v);
+ log.info("3銆佽幏鍙栧嚭鐗囧凡瀹屾垚鐨勭幓鐠冧俊鎭痠d:{}", v);
List<Integer> outSuccessGlassSlot = new ArrayList<>();
if (finalTaskType.equals(Const.BIG_STORAGE_AFTER_OUT)) {
outSuccessGlassSlot = v.stream().map(BigStorageCageTask::getStartSlot).collect(Collectors.toList());
@@ -733,7 +762,7 @@
List<Integer> slotList = storageCageDTOList.stream().map(UpdateHollowBigStorageCageDTO::getTargetSlot).distinct().collect(Collectors.toList());
hollowBigStorageCageDetailsService.updateDeviceIdBySlot(slotList);
}
- log.info("4銆佸ぇ鐞嗙墖绗艰繘鐗囩姸鎬佸凡瀹屾垚宸插畬鎴愮殑鐜荤拑淇℃伅id:{}", v);
+ log.info("4銆佸ぇ鐞嗙墖绗煎嚭鐗囩姸鎬佸凡瀹屾垚宸插畬鎴愮殑鐜荤拑淇℃伅id:{}", v);
updateSlotRemainBySlots(outSuccessGlassSlot);
} else if (e1 == 3) {
//鐮存崯澶勭悊
@@ -800,8 +829,8 @@
}
// 閲嶇疆浠诲姟琛ㄦ暟鎹�
- bigStorageCageTaskService.updateOutTaskMessage(BIG_STORAGE_CAGE_OUT_TWO_TASK);
-
+// bigStorageCageTaskService.updateOutTaskMessage(BIG_STORAGE_CAGE_OUT_TWO_TASK);
+ resetOutTask();
//娓呯┖鍚姩鐘舵��
//鍚憃pc鍙戦�佸惎鍔ㄤ俊鍙�
// miloService.writeToOpcWord(generateReadWriteEntity("DLP2B.DLP2B.MesReply", 0));
@@ -1019,15 +1048,57 @@
int glassCount = baseInfoList.size();
List<BigStorageCageTask> bigStorageCageTaskList = new ArrayList<>();
//鐢熸垚鍑虹墖浠诲姟鏉℃暟涓嶈冻6琛ュ叏
- for (T t : baseInfoList) {
- bigStorageCageTaskList.add(new BigStorageCageTask(t.getGlassId(), t.getSlot(), targetSlot, 0));
- }
- while (bigStorageCageTaskList.size() < 6) {
- bigStorageCageTaskList.add(new BigStorageCageTask("", 0, 0, 0));
- }
+// for (T t : baseInfoList) {
+// bigStorageCageTaskList.add(new BigStorageCageTask(t.getGlassId(), t.getSlot(), targetSlot, 0));
+// }
+// while (bigStorageCageTaskList.size() < 6) {
+// bigStorageCageTaskList.add(new BigStorageCageTask("", 0, 0, 0));
+// }
//娓呯┖浠诲姟琛ㄦ暟鎹�
- bigStorageCageTaskService.removeAll(tableName);
- bigStorageCageTaskService.saveTaskMessage(tableName, bigStorageCageTaskList);
+ resetOutTask();
+// bigStorageCageTaskService.removeAll(tableName);
+// bigStorageCageTaskService.saveTaskMessage(tableName, bigStorageCageTaskList);
+ S7DataZKDLPTwo s7DataZKDLPTwo = new S7DataZKDLPTwo();
+ for (int i = 0; i < bigStorageCageTaskList.size() && i < 6; i++) {
+ String glassId = bigStorageCageTaskList.get(i).getGlassId();
+ Integer startSlot = bigStorageCageTaskList.get(i).getStartSlot();
+ Integer target = bigStorageCageTaskList.get(i).getTargetSlot();
+ if (startSlot > 0) {
+ switch (i) {
+ case 0:
+ s7DataZKDLPTwo.setId1(glassId);
+ s7DataZKDLPTwo.setFrom1(startSlot);
+ s7DataZKDLPTwo.setTo1(target);
+ break;
+ case 1:
+ s7DataZKDLPTwo.setId2(glassId);
+ s7DataZKDLPTwo.setFrom2(startSlot);
+ s7DataZKDLPTwo.setTo2(target);
+ break;
+ case 2:
+ s7DataZKDLPTwo.setId3(glassId);
+ s7DataZKDLPTwo.setFrom3(startSlot);
+ s7DataZKDLPTwo.setTo3(target);
+ break;
+ case 3:
+ s7DataZKDLPTwo.setId4(glassId);
+ s7DataZKDLPTwo.setFrom4(startSlot);
+ s7DataZKDLPTwo.setTo4(target);
+ break;
+ case 4:
+ s7DataZKDLPTwo.setId5(glassId);
+ s7DataZKDLPTwo.setFrom5(startSlot);
+ s7DataZKDLPTwo.setTo5(target);
+ break;
+ case 5:
+ s7DataZKDLPTwo.setId6(glassId);
+ s7DataZKDLPTwo.setFrom6(startSlot);
+ s7DataZKDLPTwo.setTo6(target);
+ break;
+ }
+ }
+ }
+ s7SerializerZKDLPTwo.write(s7DataZKDLPTwo);
List<HollowBigStorageCageHistoryTask> historyList = bigStorageCageTaskList.stream().filter(e -> StringUtils.isNotBlank(e.getGlassId())).map(e -> {
HollowBigStorageCageHistoryTask history = new HollowBigStorageCageHistoryTask();
BeanUtils.copyProperties(e, history);
@@ -1043,8 +1114,9 @@
.ne(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_OUT)
.in(HollowBigStorageCageDetails::getGlassId, glassIds));
try {
+
// miloService.writeToOpcWord(generateReadWriteEntity("DLP2B.DLP2B.MesReply", 1));
- S7DataZKDLPTwo s7DataZKDLPTwo = new S7DataZKDLPTwo();
+ s7DataZKDLPTwo = new S7DataZKDLPTwo();
s7DataZKDLPTwo.setMesReply(1);
s7SerializerZKDLPTwo.write(s7DataZKDLPTwo);
} catch (Exception e) {
@@ -1090,4 +1162,54 @@
.value(value)
.build();
}
+
+ //璇诲彇鍑虹墖鍦板潃
+ private List<BigStorageCageTask> getOutTaskList(S7DataZKDLPTwo s7DataZKDLPTwo) {
+ List<BigStorageCageTask> outTaskList = new ArrayList<>();
+ List<String> glassIds = s7DataZKDLPTwo.getIds();
+ List<Integer> startSlots = s7DataZKDLPTwo.getFroms();
+ List<Integer> endSlots = s7DataZKDLPTwo.getTos();
+ List<Integer> states = s7DataZKDLPTwo.getStates();
+ for (int i = 0; i < 6; i++) {
+ if (glassIds.get(i) != null && !glassIds.get(i).isEmpty()) {
+ BigStorageCageTask bigStorageCageTask = new BigStorageCageTask();
+ bigStorageCageTask.setGlassId(glassIds.get(i));
+ bigStorageCageTask.setStartSlot(startSlots.get(i));
+ bigStorageCageTask.setTargetSlot(endSlots.get(i));
+ bigStorageCageTask.setTaskState(states.get(i));
+ outTaskList.add(bigStorageCageTask);
+ }
+ }
+ return outTaskList;
+ }
+
+ //閲嶇疆浠诲姟琛�
+ private void resetOutTask() {
+ S7DataZKDLPTwo s7DataZKDLPTwo = new S7DataZKDLPTwo();
+ s7DataZKDLPTwo.setId1("");
+ s7DataZKDLPTwo.setId2("");
+ s7DataZKDLPTwo.setId3("");
+ s7DataZKDLPTwo.setId4("");
+ s7DataZKDLPTwo.setId5("");
+ s7DataZKDLPTwo.setId6("");
+ s7DataZKDLPTwo.setFrom1(0);
+ s7DataZKDLPTwo.setFrom2(0);
+ s7DataZKDLPTwo.setFrom3(0);
+ s7DataZKDLPTwo.setFrom4(0);
+ s7DataZKDLPTwo.setFrom5(0);
+ s7DataZKDLPTwo.setFrom6(0);
+ s7DataZKDLPTwo.setTo1(0);
+ s7DataZKDLPTwo.setTo2(0);
+ s7DataZKDLPTwo.setTo3(0);
+ s7DataZKDLPTwo.setTo4(0);
+ s7DataZKDLPTwo.setTo5(0);
+ s7DataZKDLPTwo.setTo6(0);
+ s7DataZKDLPTwo.setState1(0);
+ s7DataZKDLPTwo.setState2(0);
+ s7DataZKDLPTwo.setState3(0);
+ s7DataZKDLPTwo.setState4(0);
+ s7DataZKDLPTwo.setState5(0);
+ s7DataZKDLPTwo.setState6(0);
+ s7SerializerZKDLPTwo.write(s7DataZKDLPTwo);
+ }
}
\ No newline at end of file
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 8bccc41..6c960fb 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
@@ -3,6 +3,7 @@
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.json.JSONObject;
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;
@@ -25,6 +26,7 @@
import com.mes.largenscreen.entity.RunTime;
import com.mes.s7.entity.S7DataZKDLPOne;
import com.mes.s7.entity.S7DataZKDLPTwo;
+import com.mes.s7.entity.S7DataZKExtra;
import com.mes.tools.WebSocketServer;
import com.mes.utils.RedisUtil;
import lombok.extern.slf4j.Slf4j;
@@ -74,23 +76,39 @@
@Qualifier("s7SerializerZKDLPTwo")
private S7Serializer s7SerializerZKDLPTwo;
+ @Autowired
+ @Qualifier("s7SerializerZKQ2")
+ private S7Serializer s7SerializerZKQ2;
+
+ @Autowired
+ @Qualifier("CMJ1ModbusTcp")
+ ModbusTcp CMJ1ModbusTcp;
+
+ @Autowired
+ @Qualifier("CMJ2ModbusTcp")
+ ModbusTcp CMJ2ModbusTcp;
+
+ private Integer offset = 40001;
+
@Resource
RedisUtil redisUtil;
@Scheduled(fixedDelay = 5000)
public void hollowGlassTaskOne() {
- hollowGlassTaskChild(930, "CMJ1.CMJ1.isFree", "HollowGlassOne");
+ hollowGlassTaskChild(930, CMJ1ModbusTcp.readUInt16(42027 - offset) + "", "HollowGlassOne");
}
@Scheduled(fixedDelay = 5000)
public void hollowGlassTaskTwo() {
- hollowGlassTaskChild(931, "ZKQ2.ZKQ2.isFree", "HollowGlassTwo");
+ S7DataZKExtra s7DataZKExtra = s7SerializerZKQ2.read(S7DataZKExtra.class);
+ hollowGlassTaskChild(931, (s7DataZKExtra.getIsFree() ? 1 : 0) + "", "HollowGlassTwo");
}
@Scheduled(fixedDelay = 5000)
public void hollowGlassTaskThree() {
+ S7DataZKExtra s7DataZKExtra = s7SerializerZKQ2.read(S7DataZKExtra.class);
//todo:鏆傛棤涓夌嚎鐨勭┖闂茬姸鎬佷俊鍙凤紝涓存椂鏍囩绌洪棽鐘舵��
- hollowGlassTaskChild(932, "ZKQ3.ZKQ3.isFree", "HollowGlassThree");
+ hollowGlassTaskChild(932, (s7DataZKExtra.getIsFree03() ? 1 : 0) + "", "HollowGlassThree");
}
public void hollowGlassTaskChild(int cell, String isFreeTag, String websocketName) {
@@ -102,10 +120,10 @@
List<HollowGlassQueueInfo> list = hollowGlassQueueInfoService.list(new LambdaQueryWrapper<HollowGlassQueueInfo>().in(HollowGlassQueueInfo::getRelationId, taskIdList));
jsonObject.append("queueInfo", list);
}
+
try {
- //930绌洪棽淇″彿
ReadWriteEntity freeOneRequestEntity = miloService.readFromOpcUa(isFreeTag);
- jsonObject.append("freeRequest", freeOneRequestEntity.getValue());
+ jsonObject.append("freeRequest", isFreeTag);
} catch (Exception e) {
log.error("opc瀛樺湪寮傚父", e);
}
@@ -151,6 +169,7 @@
public void queryDataSource1(JSONObject jsonObject) throws Exception {
S7DataZKDLPOne s7DataZKDLPOne = s7SerializerZKDLPOne.read(S7DataZKDLPOne.class);
S7DataZKDLPTwo s7DataZKDLPTwo = s7SerializerZKDLPTwo.read(S7DataZKDLPTwo.class);
+ S7DataZKExtra s7DataZKExtra = s7SerializerZKQ2.read(S7DataZKExtra.class);
List<Double> carPostion = new ArrayList<>();
carPostion.add(0.25);
carPostion.add(0.5);
@@ -163,7 +182,7 @@
List<BigStorageTaskVO> inTaskList = new ArrayList();
// ReadWriteEntity fromOpcUa = miloService.readFromOpcUa("DLP2A.DLP2A.FROM1");
String fromOpcUa = s7DataZKDLPOne.getFrom1().toString();
- for (int i = 1; i <= 6; i++) {
+ for (int i = 0; i < 6; i++) {
// ReadWriteEntity requestWord = miloService.readFromOpcUa("DLP2A.DLP2A.DI" + i);
// ReadWriteEntity targetSlotWord = miloService.readFromOpcUa("DLP2A.DLP2A.TO" + i);
// ReadWriteEntity stateWord = miloService.readFromOpcUa("DLP2A.DLP2A.STATE" + i);
@@ -172,32 +191,32 @@
String targetSlotWord = "";
switch (i) {
case 0:
- requestWord = s7DataZKDLPOne.getId1().toString();
+ requestWord = s7DataZKDLPOne.getId1();
stateWord = s7DataZKDLPOne.getState1().toString();
targetSlotWord = s7DataZKDLPOne.getTo1().toString();
break;
case 1:
- requestWord = s7DataZKDLPOne.getId2().toString();
+ requestWord = s7DataZKDLPOne.getId2();
stateWord = s7DataZKDLPOne.getState2().toString();
targetSlotWord = s7DataZKDLPOne.getTo2().toString();
break;
case 2:
- requestWord = s7DataZKDLPOne.getId3().toString();
+ requestWord = s7DataZKDLPOne.getId3();
stateWord = s7DataZKDLPOne.getState3().toString();
targetSlotWord = s7DataZKDLPOne.getTo3().toString();
break;
case 3:
- requestWord = s7DataZKDLPOne.getId4().toString();
+ requestWord = s7DataZKDLPOne.getId4();
stateWord = s7DataZKDLPOne.getState4().toString();
targetSlotWord = s7DataZKDLPOne.getTo4().toString();
break;
case 4:
- requestWord = s7DataZKDLPOne.getId5().toString();
+ requestWord = s7DataZKDLPOne.getId5();
stateWord = s7DataZKDLPOne.getState5().toString();
targetSlotWord = s7DataZKDLPOne.getTo5().toString();
break;
case 5:
- requestWord = s7DataZKDLPOne.getId6().toString();
+ requestWord = s7DataZKDLPOne.getId6();
stateWord = s7DataZKDLPOne.getState6().toString();
targetSlotWord = s7DataZKDLPOne.getTo6().toString();
break;
@@ -255,20 +274,77 @@
String outRequestEntity = s7DataZKDLPTwo.getRequestMes().toString();
jsonObject.append("outInkageEntity", outInkageEntity);
//930绌洪棽淇″彿
- ReadWriteEntity freeOneRequestEntity = miloService.readFromOpcUa("CMJ1.CMJ1.isFree");
- jsonObject.append("freeOneRequestEntity", freeOneRequestEntity.getValue());
+// ReadWriteEntity freeOneRequestEntity = miloService.readFromOpcUa("CMJ1.CMJ1.isFree");
+// jsonObject.append("freeOneRequestEntity", freeOneRequestEntity.getValue());
+ jsonObject.append("freeOneRequestEntity", CMJ1ModbusTcp.readUInt16(42027 - offset));
//931绌洪棽淇″彿
- ReadWriteEntity freeTwoRequestEntity = miloService.readFromOpcUa("ZKQ2.ZKQ2.isFree");
- jsonObject.append("freeTwoRequestEntity", freeTwoRequestEntity.getValue());
+// ReadWriteEntity freeTwoRequestEntity = miloService.readFromOpcUa("ZKQ2.ZKQ2.isFree");
+// jsonObject.append("freeTwoRequestEntity", freeTwoRequestEntity.getValue());
+ jsonObject.append("freeTwoRequestEntity", s7DataZKExtra.getIsFree());
//932绌洪棽淇″彿
- ReadWriteEntity freeThreeRequestEntity = miloService.readFromOpcUa("ZKQ3.ZKQ3.isFree");
- jsonObject.append("freeThreeRequestEntity", freeThreeRequestEntity.getValue());
+// ReadWriteEntity freeThreeRequestEntity = miloService.readFromOpcUa("ZKQ3.ZKQ3.isFree");
+// jsonObject.append("freeThreeRequestEntity", freeThreeRequestEntity.getValue());
+ jsonObject.append("freeThreeRequestEntity", s7DataZKExtra.getIsFree());
} catch (Exception e) {
//todo:涓嶅仛浠诲姟澶勭悊
}
//鍑虹墖浠诲姟鏁版嵁
- List<BigStorageCageTask> outTaskList = bigStorageCageTaskService.queryTaskMessage("big_storage_cage_out_two_task");
+// List<BigStorageCageTask> outTaskList = bigStorageCageTaskService.queryTaskMessage("big_storage_cage_out_two_task");
+// jsonObject.append("bigStorageCageDetailsOutTask", outTaskList);
+ List<BigStorageCageTask> outTaskList = new ArrayList<>();
+ for (int i = 0; i < 6; i++) {
+
+ BigStorageCageTask bigStorageCageTask = new BigStorageCageTask();
+ String glassId = "";
+ Integer startSlot = 0;
+ Integer targetSlot = 0;
+ Integer taskState = 0;
+ switch (i) {
+ case 0:
+ glassId = s7DataZKDLPTwo.getId1();
+ startSlot = s7DataZKDLPTwo.getFrom1();
+ targetSlot = s7DataZKDLPTwo.getTo1();
+ taskState = s7DataZKDLPTwo.getState1();
+ ;
+ break;
+ case 1:
+ glassId = s7DataZKDLPTwo.getId2();
+ startSlot = s7DataZKDLPTwo.getFrom2();
+ targetSlot = s7DataZKDLPTwo.getTo2();
+ taskState = s7DataZKDLPTwo.getState2();
+ break;
+ case 2:
+ glassId = s7DataZKDLPTwo.getId3();
+ startSlot = s7DataZKDLPTwo.getFrom3();
+ targetSlot = s7DataZKDLPTwo.getTo3();
+ taskState = s7DataZKDLPTwo.getState3();
+ break;
+ case 3:
+ glassId = s7DataZKDLPTwo.getId4();
+ startSlot = s7DataZKDLPTwo.getFrom4();
+ targetSlot = s7DataZKDLPTwo.getTo4();
+ taskState = s7DataZKDLPTwo.getState4();
+ break;
+ case 4:
+ glassId = s7DataZKDLPTwo.getId5();
+ startSlot = s7DataZKDLPTwo.getFrom5();
+ targetSlot = s7DataZKDLPTwo.getTo5();
+ taskState = s7DataZKDLPTwo.getState5();
+ break;
+ case 5:
+ glassId = s7DataZKDLPTwo.getId6();
+ startSlot = s7DataZKDLPTwo.getFrom6();
+ targetSlot = s7DataZKDLPTwo.getTo6();
+ taskState = s7DataZKDLPTwo.getState6();
+ break;
+ }
+ bigStorageCageTask.setGlassId(glassId);
+ bigStorageCageTask.setStartSlot(startSlot);
+ bigStorageCageTask.setTargetSlot(targetSlot);
+ bigStorageCageTask.setTaskState(taskState);
+ outTaskList.add(bigStorageCageTask);
+ }
jsonObject.append("bigStorageCageDetailsOutTask", outTaskList);
//璋冨害寮�鍏�
diff --git a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/s7/entity/S7DataZKDLPOne.java b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/s7/entity/S7DataZKDLPOne.java
index ade57a7..acea6fd 100644
--- a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/s7/entity/S7DataZKDLPOne.java
+++ b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/s7/entity/S7DataZKDLPOne.java
@@ -1,6 +1,6 @@
package com.mes.s7.entity;
-import com.github.xingshuangs.iot.protocol.common.enums.EDataType;
+import com.github.xingshuangs.iot.common.enums.EDataType;
import com.github.xingshuangs.iot.protocol.s7.serializer.S7Variable;
import lombok.Data;
@@ -16,88 +16,85 @@
public class S7DataZKDLPOne {
- @S7Variable(address = "DB3.8", type = EDataType.BOOL)
+ @S7Variable(address = "DB3.2992.0", type = EDataType.BOOL)
private Boolean mesControl;
- @S7Variable(address = "DB19.0", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.0", type = EDataType.UINT16)
private Integer requestMes;
- @S7Variable(address = "DB19.2", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.2", type = EDataType.UINT16)
private Integer mesReply;
- @S7Variable(address = "DB19.140", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.140", type = EDataType.UINT16)
private Integer from1;
- @S7Variable(address = "DB19.142", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.142", type = EDataType.UINT16)
private Integer from2;
- @S7Variable(address = "DB19.144", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.144", type = EDataType.UINT16)
private Integer from3;
- @S7Variable(address = "DB19.146", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.146", type = EDataType.UINT16)
private Integer from4;
- @S7Variable(address = "DB19.148", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.148", type = EDataType.UINT16)
private Integer from5;
- @S7Variable(address = "DB19.150", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.150", type = EDataType.UINT16)
private Integer from6;
- @S7Variable(address = "DB19.152", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.152", type = EDataType.UINT16)
private Integer to1;
- @S7Variable(address = "DB19.154", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.154", type = EDataType.UINT16)
private Integer to2;
- @S7Variable(address = "DB19.156", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.156", type = EDataType.UINT16)
private Integer to3;
- @S7Variable(address = "DB19.158", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.158", type = EDataType.UINT16)
private Integer to4;
- @S7Variable(address = "DB19.160", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.160", type = EDataType.UINT16)
private Integer to5;
- @S7Variable(address = "DB19.162", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.162", type = EDataType.UINT16)
private Integer to6;
- @S7Variable(address = "DB19.164", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.164", type = EDataType.UINT16)
private Integer state1;
- @S7Variable(address = "DB19.166", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.166", type = EDataType.UINT16)
private Integer state2;
- @S7Variable(address = "DB19.168", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.168", type = EDataType.UINT16)
private Integer state3;
- @S7Variable(address = "DB19.170", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.170", type = EDataType.UINT16)
private Integer state4;
- @S7Variable(address = "DB19.172", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.172", type = EDataType.UINT16)
private Integer state5;
- @S7Variable(address = "DB19.174", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.174", type = EDataType.UINT16)
private Integer state6;
- @S7Variable(address = "DB19.1246", type = EDataType.UINT16)
- private Integer glassCount;
-
- @S7Variable(address = "DB19.8", type = EDataType.STRING, count = 20)
+ @S7Variable(address = "DB7.8", type = EDataType.STRING, count = 14)
private String id1;
- @S7Variable(address = "DB19.30", type = EDataType.STRING, count = 20)
+ @S7Variable(address = "DB7.30", type = EDataType.STRING, count = 14)
private String id2;
- @S7Variable(address = "DB19.52", type = EDataType.STRING, count = 20)
+ @S7Variable(address = "DB7.52", type = EDataType.STRING, count = 14)
private String id3;
- @S7Variable(address = "DB19.74", type = EDataType.STRING, count = 20)
+ @S7Variable(address = "DB7.74", type = EDataType.STRING, count = 14)
private String id4;
- @S7Variable(address = "DB19.96", type = EDataType.STRING, count = 20)
+ @S7Variable(address = "DB7.96", type = EDataType.STRING, count = 14)
private String id5;
- @S7Variable(address = "DB19.118", type = EDataType.STRING, count = 20)
+ @S7Variable(address = "DB7.118", type = EDataType.STRING, count = 14)
private String id6;
@S7Variable(address = "MW1002", type = EDataType.UINT16)
diff --git a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/s7/entity/S7DataZKDLPTwo.java b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/s7/entity/S7DataZKDLPTwo.java
index b796381..48c501e 100644
--- a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/s7/entity/S7DataZKDLPTwo.java
+++ b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/s7/entity/S7DataZKDLPTwo.java
@@ -1,8 +1,11 @@
package com.mes.s7.entity;
-import com.github.xingshuangs.iot.protocol.common.enums.EDataType;
+import com.github.xingshuangs.iot.common.enums.EDataType;
import com.github.xingshuangs.iot.protocol.s7.serializer.S7Variable;
import lombok.Data;
+
+import java.util.Arrays;
+import java.util.List;
/**
* @Author : zhoush
@@ -13,86 +16,101 @@
public class S7DataZKDLPTwo {
- @S7Variable(address = "DB3.8", type = EDataType.BOOL)
+ @S7Variable(address = "DB3.2992.0", type = EDataType.BOOL)
private Boolean mesControl;
- @S7Variable(address = "DB19.4", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.4", type = EDataType.UINT16)
private Integer requestMes;
- @S7Variable(address = "DB19.6", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.6", type = EDataType.UINT16)
private Integer mesReply;
- @S7Variable(address = "DB19.308", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.308", type = EDataType.UINT16)
private Integer from1;
- @S7Variable(address = "DB19.310", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.310", type = EDataType.UINT16)
private Integer from2;
- @S7Variable(address = "DB19.312", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.312", type = EDataType.UINT16)
private Integer from3;
- @S7Variable(address = "DB19.314", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.314", type = EDataType.UINT16)
private Integer from4;
- @S7Variable(address = "DB19.316", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.316", type = EDataType.UINT16)
private Integer from5;
- @S7Variable(address = "DB19.318", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.318", type = EDataType.UINT16)
private Integer from6;
- @S7Variable(address = "DB19.320", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.320", type = EDataType.UINT16)
private Integer to1;
- @S7Variable(address = "DB19.322", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.322", type = EDataType.UINT16)
private Integer to2;
- @S7Variable(address = "DB19.324", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.324", type = EDataType.UINT16)
private Integer to3;
- @S7Variable(address = "DB19.326", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.326", type = EDataType.UINT16)
private Integer to4;
- @S7Variable(address = "DB19.328", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.328", type = EDataType.UINT16)
private Integer to5;
- @S7Variable(address = "DB19.330", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.330", type = EDataType.UINT16)
private Integer to6;
- @S7Variable(address = "DB19.332", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.332", type = EDataType.UINT16)
private Integer state1;
- @S7Variable(address = "DB19.334", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.334", type = EDataType.UINT16)
private Integer state2;
- @S7Variable(address = "DB19.336", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.336", type = EDataType.UINT16)
private Integer state3;
- @S7Variable(address = "DB19.338", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.338", type = EDataType.UINT16)
private Integer state4;
- @S7Variable(address = "DB19.340", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.340", type = EDataType.UINT16)
private Integer state5;
- @S7Variable(address = "DB19.342", type = EDataType.UINT16)
+ @S7Variable(address = "DB7.342", type = EDataType.UINT16)
private Integer state6;
- @S7Variable(address = "DB19.176", type = EDataType.STRING, count = 20)
+ @S7Variable(address = "DB7.176", type = EDataType.STRING, count = 14)
private String id1;
- @S7Variable(address = "DB19.198", type = EDataType.STRING, count = 20)
+ @S7Variable(address = "DB7.198", type = EDataType.STRING, count = 14)
private String id2;
- @S7Variable(address = "DB19.220", type = EDataType.STRING, count = 20)
+ @S7Variable(address = "DB7.220", type = EDataType.STRING, count = 14)
private String id3;
- @S7Variable(address = "DB19.242", type = EDataType.STRING, count = 20)
+ @S7Variable(address = "DB7.242", type = EDataType.STRING, count = 14)
private String id4;
- @S7Variable(address = "DB19.264", type = EDataType.STRING, count = 20)
+ @S7Variable(address = "DB7.264", type = EDataType.STRING, count = 14)
private String id5;
- @S7Variable(address = "DB19.286", type = EDataType.STRING, count = 20)
+ @S7Variable(address = "DB7.286", type = EDataType.STRING, count = 14)
private String id6;
+ public List<Integer> getStates() {
+ return Arrays.asList(state1, state2, state3, state4, state5, state6);
+ }
+
+ public List<String> getIds() {
+ return Arrays.asList(id1, id2, id3, id4, id5, id6);
+ }
+
+ public List<Integer> getTos() {
+ return Arrays.asList(to1, to2, to3, to4, to5, to6);
+ }
+
+ public List<Integer> getFroms() {
+ return Arrays.asList(from1, from2, from3, from4, from5, from6);
+ }
}
diff --git a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/s7/entity/S7DataZKExtra.java b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/s7/entity/S7DataZKExtra.java
new file mode 100644
index 0000000..1472e0b
--- /dev/null
+++ b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/s7/entity/S7DataZKExtra.java
@@ -0,0 +1,24 @@
+package com.mes.s7.entity;
+
+import com.github.xingshuangs.iot.common.enums.EDataType;
+import com.github.xingshuangs.iot.protocol.s7.serializer.S7Variable;
+import lombok.Data;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @Author : zhoush
+ * @Date: 2025/4/30 14:19
+ * @Description:
+ */
+@Data
+public class S7DataZKExtra {
+
+ @S7Variable(address = "DB20.0.0", type = EDataType.BOOL)
+ private Boolean isFree;
+
+ @S7Variable(address = "DB20.0.1", type = EDataType.BOOL)
+ private Boolean isFree03;
+
+}
--
Gitblit v1.8.0