From 2e70333818580f42b16a046f9c68e06c0b7a21b9 Mon Sep 17 00:00:00 2001
From: gengby <858962040@qq.com>
Date: Sat, 18 Feb 2023 16:24:19 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../PaintConveyorDeviceDriver.java | 31 +++++++++++--------
.../driver/ExecutableDeviceDriver.java | 6 ++--
.../src/main/resources/logback-spring.xml | 2 +-
3 files changed, 23 insertions(+), 16 deletions(-)
diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paint_conveyor/PaintConveyorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paint_conveyor/PaintConveyorDeviceDriver.java
index db92bfc..72d4464 100644
--- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paint_conveyor/PaintConveyorDeviceDriver.java
+++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paint_conveyor/PaintConveyorDeviceDriver.java
@@ -134,7 +134,7 @@ public class PaintConveyorDeviceDriver extends AbstractOpcDeviceDriver implement
message = "有报警";
//无报警
} else {
- System.out.println("进入到else。。。。。");
+ System.out.println("进入到else。。。。。设备号:" + device_code + ",mode = " + mode);
this.setIsonline(true);
this.setIserror(false);
JSONObject jo = new JSONObject();
@@ -146,42 +146,46 @@ public class PaintConveyorDeviceDriver extends AbstractOpcDeviceDriver implement
//下料位申请空盘
if (move == 0 && !requireSucess) {
//向LMS发送请求,发送终点和托盘类型
- jo.put("type","3");
- jo.put("point_code",device_code);
- jo.put("vehicle_num","10");
+ jo.put("type", "3");
+ jo.put("point_code", device_code);
+ jo.put("vehicle_num", "10");
String result = acsToWmsService.applyTaskToWms(jo);
JSONObject res_jo = JSONObject.parseObject(result);
- if (res_jo.getString("status").equals("200")){
+ if (res_jo.getString("status").equals("200")) {
requireSucess = true;
}
}
+ break;
case 6:
//下料位满拖申请
logServer.deviceExecuteLog(this.device_code, "", "", "下料位满拖申请,此时:move == " + move + ",请求标记为:" + requireSucess);
if (move == 1 && !requireSucess) {
//向LMS发送请求,发送起点
- jo.put("type","7");
- jo.put("point_code",device_code);
+ jo.put("type", "7");
+ jo.put("point_code", device_code);
String result = acsToWmsService.applyTaskToWms(jo);
JSONObject res_jo = JSONObject.parseObject(result);
- if (res_jo.getString("status").equals("200")){
+ if (res_jo.getString("status").equals("200")) {
requireSucess = true;
}
}
+ break;
case 7:
+ logServer.deviceExecuteLog(this.device_code, "", "", "上料位满拖申请,此时:move == " + move + ",请求标记为:" + requireSucess);
//上料位满拖申请
if (move == 0 && !requireSucess) {
//向LMS发送请求,发送起点
- jo.put("type","4");
- jo.put("point_code",device_code);
+ jo.put("type", "4");
+ jo.put("point_code", device_code);
String result = acsToWmsService.applyTaskToWms(jo);
JSONObject res_jo = JSONObject.parseObject(result);
- if (res_jo.getString("status").equals("200")){
+ if (res_jo.getString("status").equals("200")) {
requireSucess = true;
}
}
break;
case 8:
+ logServer.deviceExecuteLog(this.device_code, "", "", "上料位空托入库,此时:move == " + move + ",请求标记为:" + requireSucess);
if (move == 1 && !requireSucess) {
//上料位空托入库
jo.put("type", "5");
@@ -189,12 +193,13 @@ public class PaintConveyorDeviceDriver extends AbstractOpcDeviceDriver implement
jo.put("vehicle_num", number);
String result = acsToWmsService.applyTaskToWms(jo);
JSONObject res_jo = JSONObject.parseObject(result);
- if (res_jo.getString("status").equals("200")){
+ if (res_jo.getString("status").equals("200")) {
requireSucess = true;
}
break;
}
case 9:
+ logServer.deviceExecuteLog(this.device_code, "", "", "强制满垛入库,此时:move == " + move + ",请求标记为:" + requireSucess);
if (move == 1 && !requireSucess) {
//强制满垛入库
jo.put("type", "5");
@@ -202,7 +207,7 @@ public class PaintConveyorDeviceDriver extends AbstractOpcDeviceDriver implement
jo.put("vehicle_num", number);
String result = acsToWmsService.applyTaskToWms(jo);
JSONObject res_jo = JSONObject.parseObject(result);
- if (res_jo.getString("status").equals("200")){
+ if (res_jo.getString("status").equals("200")) {
requireSucess = true;
}
break;
diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/ExecutableDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/ExecutableDeviceDriver.java
index 0848800..58df056 100644
--- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/ExecutableDeviceDriver.java
+++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/ExecutableDeviceDriver.java
@@ -6,11 +6,13 @@ public interface ExecutableDeviceDriver extends DeviceDriver {
default void executeAuto() {
try {
this.execute();
- } catch (Throwable var6) {
- String message = "线程调用异常:" + var6.getMessage();
+ } catch (Exception e) {
+ String message = "线程调用异常:" + e.getMessage();
+ e.printStackTrace();
} finally {
}
+
}
void execute() throws Exception;
diff --git a/acs/nladmin-system/src/main/resources/logback-spring.xml b/acs/nladmin-system/src/main/resources/logback-spring.xml
index 25a0faf..1c65e53 100644
--- a/acs/nladmin-system/src/main/resources/logback-spring.xml
+++ b/acs/nladmin-system/src/main/resources/logback-spring.xml
@@ -144,7 +144,7 @@ https://juejin.cn/post/6844903775631572999
-
+