From 3963696f8565d1e0a88c00b360fc38afa466e28f Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期三, 02 八月 2023 09:31:18 +0800
Subject: [PATCH] 异常信息记录
---
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 110 +++++++++++++++++++++++++++---------------------------
src/main/java/com/zy/core/MainProcess.java | 4 +-
2 files changed, 57 insertions(+), 57 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 7ebe117..f6980fd 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -1208,27 +1208,27 @@
private void recShuttleErr() {
Date now = new Date();
for (ShuttleSlave shuttleSlave : slaveProperties.getShuttle()) {
- // 鑾峰彇鍫嗗灈鏈轰俊鎭�
- ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, shuttleSlave.getId());
+ // 鑾峰彇鍥涘悜绌挎杞︿俊鎭�
+ NyShuttleThread shuttleThread = (NyShuttleThread) SlaveConnection.get(SlaveType.Shuttle, shuttleSlave.getId());
if (shuttleThread == null) {
continue;
}
- ShuttleProtocol shuttleProtocol = shuttleThread.getShuttleProtocol();
+ NyShuttleProtocol shuttleProtocol = shuttleThread.getShuttleProtocol();
if (shuttleProtocol == null) {
continue;
}
if (shuttleProtocol.getTaskNo() != 0) {
//鏈変换鍔�
- BasShuttleErrLog latest = basShuttleErrLogService.findLatestByTaskNo(shuttleSlave.getId(), shuttleProtocol.getTaskNo().intValue());
+ BasShuttleErrLog latest = basShuttleErrLogService.findLatestByTaskNo(shuttleSlave.getId(), shuttleProtocol.getTaskNo());
// 鏈夊紓甯�
if (latest == null) {
- if (shuttleProtocol.getStatusErrorCode() != null && shuttleProtocol.getStatusErrorCode() > 0) {
+ if (shuttleProtocol.getErrState() != null && shuttleProtocol.getErrState() == 1) {
WrkMast wrkMast = wrkMastMapper.selectById(shuttleProtocol.getTaskNo());
if (wrkMast == null) {
continue;
}
- BasShuttleErr basShuttleErr = basShuttleErrService.queryByCode(shuttleProtocol.getStatusErrorCode().intValue());
+ BasShuttleErr basShuttleErr = basShuttleErrService.queryByCode(shuttleProtocol.getErrCode().get(0));
String errName = basShuttleErr==null? "鏈煡寮傚父":basShuttleErr.getErrName();
BasShuttleErrLog basShuttleErrLog = new BasShuttleErrLog(
null, // 缂栧彿
@@ -1244,7 +1244,7 @@
wrkMast.getSourceStaNo(), // 婧愮珯
wrkMast.getSourceLocNo(), // 婧愬簱浣�
wrkMast.getBarcode(), // 鏉$爜
- (int) shuttleProtocol.getStatusErrorCode(), // 寮傚父鐮�
+ shuttleProtocol.getErrCode().get(0), // 寮傚父鐮�
errName, // 寮傚父
1, // 寮傚父鎯呭喌
now, // 娣诲姞鏃堕棿
@@ -1259,7 +1259,7 @@
}
} else {
// 寮傚父淇
- if (shuttleProtocol.getStatusErrorCode() == null || shuttleProtocol.getStatusErrorCode() == 0) {
+ if (shuttleProtocol.getErrState() == null || shuttleProtocol.getErrState() == 0) {
latest.setEndTime(now);
latest.setUpdateTime(now);
latest.setStatus(2);
@@ -1269,53 +1269,53 @@
}
}
}else {
- //鏃犱换鍔�
- BasShuttleErrLog latest = basShuttleErrLogService.findLatest(shuttleSlave.getId());
- // 鏈夊紓甯�
- if (shuttleProtocol.getStatusErrorCode() != null && shuttleProtocol.getStatusErrorCode() > 0) {
- // 璁板綍鏂板紓甯�
- if (latest == null || (latest.getErrCode() != shuttleProtocol.getStatusErrorCode().intValue())) {
- BasShuttleErr basShuttleErr = basShuttleErrService.queryByCode(shuttleProtocol.getStatusErrorCode().intValue());
- String errName = basShuttleErr==null? "鏈煡寮傚父":basShuttleErr.getErrName();
- BasShuttleErrLog basShuttleErrLog = new BasShuttleErrLog(
- null, // 缂栧彿
- null, // 宸ヤ綔鍙�
- now, // 鍙戠敓鏃堕棿
- null, // 缁撴潫鏃堕棿
- null, // 宸ヤ綔鐘舵��
- null, // 鍏ュ嚭搴撶被鍨�
- shuttleSlave.getId(), // 鍥涘悜绌挎杞�
- null, // plc
- null, // 鐩爣搴撲綅
- null, // 鐩爣绔�
- null, // 婧愮珯
- null, // 婧愬簱浣�
- null, // 鏉$爜
- (int)shuttleProtocol.getStatusErrorCode(), // 寮傚父鐮�
- errName, // 寮傚父
- 1, // 寮傚父鎯呭喌
- now, // 娣诲姞鏃堕棿
- null, // 娣诲姞浜哄憳
- now, // 淇敼鏃堕棿
- null, // 淇敼浜哄憳
- "鏃犱换鍔″紓甯�" // 澶囨敞
- );
- if (!basShuttleErrLogService.insert(basShuttleErrLog)) {
- News.error("鍥涘悜绌挎杞lc寮傚父璁板綍澶辫触 ===>> [id:{}] [error:{}]", shuttleSlave.getId(), errName);
- }
- }
- // 鏃犲紓甯�
- } else {
- // 寮傚父淇
- if (latest != null && latest.getStatus() == 1) {
- latest.setEndTime(now);
- latest.setUpdateTime(now);
- latest.setStatus(2);
- if (!basShuttleErrLogService.updateById(latest)) {
- News.error("鍥涘悜绌挎杞lc寮傚父璁板綍淇澶辫触 ===>> [id:{}] [errLogId:{}]", shuttleSlave.getId(), latest.getId());
- }
- }
- }
+// //鏃犱换鍔�
+// BasShuttleErrLog latest = basShuttleErrLogService.findLatest(shuttleSlave.getId());
+// // 鏈夊紓甯�
+// if (shuttleProtocol.getStatusErrorCode() != null && shuttleProtocol.getStatusErrorCode() > 0) {
+// // 璁板綍鏂板紓甯�
+// if (latest == null || (latest.getErrCode() != shuttleProtocol.getStatusErrorCode().intValue())) {
+// BasShuttleErr basShuttleErr = basShuttleErrService.queryByCode(shuttleProtocol.getStatusErrorCode().intValue());
+// String errName = basShuttleErr==null? "鏈煡寮傚父":basShuttleErr.getErrName();
+// BasShuttleErrLog basShuttleErrLog = new BasShuttleErrLog(
+// null, // 缂栧彿
+// null, // 宸ヤ綔鍙�
+// now, // 鍙戠敓鏃堕棿
+// null, // 缁撴潫鏃堕棿
+// null, // 宸ヤ綔鐘舵��
+// null, // 鍏ュ嚭搴撶被鍨�
+// shuttleSlave.getId(), // 鍥涘悜绌挎杞�
+// null, // plc
+// null, // 鐩爣搴撲綅
+// null, // 鐩爣绔�
+// null, // 婧愮珯
+// null, // 婧愬簱浣�
+// null, // 鏉$爜
+// (int)shuttleProtocol.getStatusErrorCode(), // 寮傚父鐮�
+// errName, // 寮傚父
+// 1, // 寮傚父鎯呭喌
+// now, // 娣诲姞鏃堕棿
+// null, // 娣诲姞浜哄憳
+// now, // 淇敼鏃堕棿
+// null, // 淇敼浜哄憳
+// "鏃犱换鍔″紓甯�" // 澶囨敞
+// );
+// if (!basShuttleErrLogService.insert(basShuttleErrLog)) {
+// News.error("鍥涘悜绌挎杞lc寮傚父璁板綍澶辫触 ===>> [id:{}] [error:{}]", shuttleSlave.getId(), errName);
+// }
+// }
+// // 鏃犲紓甯�
+// } else {
+// // 寮傚父淇
+// if (latest != null && latest.getStatus() == 1) {
+// latest.setEndTime(now);
+// latest.setUpdateTime(now);
+// latest.setStatus(2);
+// if (!basShuttleErrLogService.updateById(latest)) {
+// News.error("鍥涘悜绌挎杞lc寮傚父璁板綍淇澶辫触 ===>> [id:{}] [errLogId:{}]", shuttleSlave.getId(), latest.getId());
+// }
+// }
+// }
}
}
}
diff --git a/src/main/java/com/zy/core/MainProcess.java b/src/main/java/com/zy/core/MainProcess.java
index f94f7d4..9555160 100644
--- a/src/main/java/com/zy/core/MainProcess.java
+++ b/src/main/java/com/zy/core/MainProcess.java
@@ -66,8 +66,8 @@
mainService.locToLocExecute();
//鎵ц灏忚溅绉诲簱浠诲姟
mainService.shuttleMoveExecute();
-// // 寮傚父淇℃伅璁板綍
-// mainService.recErr();
+ // 寮傚父淇℃伅璁板綍
+ mainService.recErr();
// 鍏ュ簱 ===>> 绌烘爤鏉垮垵濮嬪寲鍏ュ簱,鍙夎溅鍏ュ簱绔欐斁璐�
mainService.storeEmptyPlt();
// 鍑哄簱 ===>> 宸ヤ綔妗d俊鎭啓鍏ed鏄剧ず鍣�
--
Gitblit v1.9.1