From 524ed21b54b25493bdda51207b04ce3b44d4bca5 Mon Sep 17 00:00:00 2001
From: L <L@132>
Date: 星期一, 25 八月 2025 18:14:08 +0800
Subject: [PATCH] *
---
src/main/java/com/zy/core/thread/SiemensCrnThread.java | 21 +++++++++++++++++++--
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 2 +-
2 files changed, 20 insertions(+), 3 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 6ca5ebb..4b0d7d3 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -761,7 +761,7 @@
if (!taskWrks.isEmpty()) {
continue;
}
- List<TaskWrkLog> taskWrkLogs = taskWrkLogService.selectList(new EntityWrapper<TaskWrkLog>().eq("CRN_NO",crnProtocol.getLaneNo()).orderBy("COMPLETE_TIME",true));
+ List<TaskWrkLog> taskWrkLogs = taskWrkLogService.selectList(new EntityWrapper<TaskWrkLog>().eq("CRN_NO",crnProtocol.getLaneNo()).orderBy("COMPLETE_TIME",false));
if (!taskWrkLogs.isEmpty()) {
TaskWrkLog taskWrkLog = taskWrkLogs.get(0);
Date completeTime = taskWrkLog.getCompleteTime();
diff --git a/src/main/java/com/zy/core/thread/SiemensCrnThread.java b/src/main/java/com/zy/core/thread/SiemensCrnThread.java
index 7a69cef..4a12228 100644
--- a/src/main/java/com/zy/core/thread/SiemensCrnThread.java
+++ b/src/main/java/com/zy/core/thread/SiemensCrnThread.java
@@ -308,9 +308,13 @@
array[8] = command.getDestinationPosZ();
// array[9] = command.getCommand();
array[9] = (short)0;
+
+
+ log.info("鍫嗗灈鏈轰换鍔″啓100.18锛氬�硷細0 crnWrite-313琛�");
OperateResult result18 = siemensNet.Write("DB100.18", (short)0);
if (command.getAckFinish() == 0) {
+ log.info("鍫嗗灈鏈轰换鍔″啓100.0锛氬�硷細0 crnWrite-317琛�");
OperateResult result100 = siemensNet.Write("DB100.0", (short)0);
}
@@ -318,14 +322,18 @@
Thread.sleep(50L);
} catch (Exception e){}
+ log.info("鍫嗗灈鏈轰换鍔″啓100.0锛氬�硷細array crnWrite-317琛�;array:"+JSON.toJSONString(array));
OperateResult result = siemensNet.Write("DB100.0", array);
int i=0;
do{
+ i++;
//鍫嗗灈鏈轰换鍔″啓鍏ュ悗锛屽洖璇讳竴娆★紝鐪嬫槸鍚︽垚鍔�
try{
Thread.sleep(100L);
} catch (Exception e){}
+
+ log.info("鍫嗗灈鏈轰换鍔¤100.0锛氬�硷細20 crnWrite-317琛�;");
OperateResultExOne<byte[]> resultRead = siemensNet.Read("DB100.0", (short) 20);
if (resultRead.IsSuccess) {
CrnCommand one = new CrnCommand();
@@ -346,7 +354,6 @@
|| !command.getDestinationPosY().equals(one.getDestinationPosY())
|| !command.getDestinationPosZ().equals(one.getDestinationPosZ())
){
- i++;
CrnErrCache.updateCrnErr(slave.getId(), "鍫嗗灈鏈哄懡浠ゅ湴鍧�鍐欏叆鍚庡洖璇诲け璐�");
log.error("鍫嗗灈鏈哄懡浠ゅ湴鍧�鍐欏叆鍚庡洖璇诲け璐id:{}]>>>>閲嶅啓[{}] >>>>> 鍐欏叆[{}],===>>鍥炶[{}]", slave.getId(), i,JSON.toJSON(command),JSON.toJSON(one));
@@ -373,6 +380,16 @@
}
break;
}
+ } else {
+ CrnErrCache.updateCrnErr(slave.getId(), "鍫嗗灈鏈哄懡浠よ鍙栧け璐�");
+
+ log.error("鍫嗗灈鏈哄懡浠よ鍙栧け璐id:{}]>>>>閲嶅啓[{}] >>>>> 鍐欏叆[{}],===>>鍥炶[{}]", slave.getId(), i,JSON.toJSON(command),"");
+
+ try{
+ DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);
+ deviceErrorService.addDeviceError("CrnErr", slave.getId(), "宸烽亾鍙�"+command.getLaneNo()+";鍐欏叆娆℃暟"+i+";鍫嗗灈鏈哄懡浠よ鍙栧け璐�:"+JSON.toJSONString(command.getNowTask()));
+ } catch (Exception e2){
+ }
}
}while(i<5);
@@ -384,6 +401,7 @@
result = siemensNet.Write("DB100.18", commandFinish);
int signFinish = 1;
while (signFinish<5){
+ signFinish++;
OperateResultExOne<byte[]> result10018 = siemensNet.Read("DB100.18", (short) 2);
short transInt16 = siemensNet.getByteTransform().TransInt16(result10018.Content, 0);
if (transInt16 != commandFinish){
@@ -404,7 +422,6 @@
} catch (Exception e3){
}
result = siemensNet.Write("DB100.18", commandFinish);
- signFinish++;
}else {
log.info("涓嬪彂DB100.18" + "commandFinish:"+commandFinish);
log.info("涓嬪彂DB100.18" + "array:"+ JSON.toJSONString(array));
--
Gitblit v1.9.1