From 5ca6a0d41856ced8d0086f6f94924a8edb72546d Mon Sep 17 00:00:00 2001
From: "USER-20220102CG\\noblelift" <546428999@qq.com>
Date: Tue, 31 Jan 2023 21:09:42 +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
---
.../SiemensConveyorDeviceDriver.java | 33 +++++-----
.../SiemensConveyorLabelingDeviceDriver.java | 4 ++
...CoveyorControlWithScannerDeviceDriver.java | 61 ++++++++++++++++++-
.../src/views/acs/instruction/index.vue | 3 +-
.../src/views/system/monitor/device/index.vue | 3 +
5 files changed, 86 insertions(+), 18 deletions(-)
diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java
index 55d99582f..3313ddc15 100644
--- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java
+++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java
@@ -177,28 +177,31 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + "->" + task);
}
- if (mode == 2 && move != 0 && task > 0) {
+ if ( move != 0 && task > 0) {
//inst_message
inst = instructionService.findByCodeFromCache(String.valueOf(task));
if (inst != null) {
inst_message = "当前指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code();
- if (StrUtil.equals(inst.getInstruction_status(), "1")) {
- if(StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())){
- vehicle_code = inst.getVehicle_code();
- inst.setExecute_device_code(this.device_code);
- finish_instruction();
- } else {
- if(!StrUtil.equals(inst.getExecute_code(),this.device_code)){
+ if(mode == 2){
+ if (StrUtil.equals(inst.getInstruction_status(), "1")) {
+ if(StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())){
+ vehicle_code = inst.getVehicle_code();
inst.setExecute_device_code(this.device_code);
- instructionService.update(inst);
+ finish_instruction();
+ } else {
+ if(!StrUtil.equals(inst.getExecute_code(),this.device_code)){
+ inst.setExecute_device_code(this.device_code);
+ instructionService.update(inst);
+ }
}
- }
- }
- if (StrUtil.equals(inst.getInstruction_status(), "0") && StrUtil.equals(this.getDeviceCode(), inst.getStart_device_code())) {
- inst.setInstruction_status("1");
- inst.setExecute_device_code(this.device_code);
- instructionService.update(inst);
+ }
+ } else {
+ if (StrUtil.equals(inst.getInstruction_status(), "0") && StrUtil.equals(this.getDeviceCode(), inst.getStart_device_code())) {
+ inst.setInstruction_status("1");
+ inst.setExecute_device_code(this.device_code);
+ instructionService.update(inst);
+ }
}
}
}
diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_labeling/SiemensConveyorLabelingDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_labeling/SiemensConveyorLabelingDeviceDriver.java
index b5d8f2069..1602f5927 100644
--- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_labeling/SiemensConveyorLabelingDeviceDriver.java
+++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_labeling/SiemensConveyorLabelingDeviceDriver.java
@@ -654,7 +654,11 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver
}
if(task >0 ){
Instruction instruction = instructionService.findByCodeFromCache(String.valueOf(task));
+ if (ObjectUtil.isEmpty(instruction)){
+ instruction = instructionService.findByCode(String.valueOf(task));
+ }
vehicle_code = instruction.getVehicle_code();
+
} else {
logServer.deviceExecuteLog(device_code, "", "", "申请贴标电气设备任务号:"+task+"异常");
message = "申请贴标电气设备任务号:"+task+"异常";
diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java
index 34a3910a2..816117424 100644
--- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java
+++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java
@@ -140,6 +140,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
public void clearBarcode() throws Exception {
ScannerDeviceDriver scanner = this.getScanner();
scanner.cleanBarcode();
+ logServer.deviceExecuteLog(this.device_code, "", "", "清理条码");
}
public synchronized boolean finish_instruction() throws Exception {
instructionService.finish(inst);
@@ -197,6 +198,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
if (move == 0 && mode == 2) {
message = null;
inst_message = null;
+ clearBarcode();
thingToNothing();
}
logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + last_move + "->" + move);
@@ -292,7 +294,8 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
last_error = error;
last_move = move;
last_task = task;
-
+ last_plcbarcode_length = plcbarcode_length;
+ last_plcbarcode = plcbarcode;
}
public boolean exe_error() {
@@ -426,6 +429,11 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
TaskDto task = taskserver.findByContainer(container_code);
if (!ObjectUtil.isEmpty(task)) {
Instruction instdto = instructionService.findByTaskcodeAndStatus(task.getTask_code());
+ if(!StrUtil.equals(instdto.getStart_device_code(),this.device_code)){
+ message ="当前载具号"+container_code+"查找对应指令起点与当前设备不符";
+// this.setIserror(true);
+ return false;
+ }
if(ObjectUtil.isNotEmpty(instdto)){
List list = new ArrayList();
Map map = new HashMap();
@@ -484,6 +492,27 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
if (!ObjectUtil.isEmpty(taskdto)) {
if (!ObjectUtils.isEmpty(instructionService.findByTaskcodeAndStatus(taskdto.getTask_code()))) {
Instruction instdto = instructionService.findByTaskcodeAndStatus(taskdto.getTask_code());
+ if(!StrUtil.equals(instdto.getStart_device_code(),this.device_code)){
+ message ="当前载具号"+container_code+"查找对应指令起点与当前设备不符";
+// this.setIserror(true);
+// List list = new ArrayList();
+// Map map = new HashMap();
+// map.put("code","to_target");
+// map.put("value","1011");
+// list.add(map);
+// Map map2 = new HashMap();
+// map2.put("code","to_command");
+// map2.put("value","1");
+// Map map3 = new HashMap();
+// map3.put("code","to_task");
+// map3.put("value","0");
+// list.add(map3);
+// this.writing(list);
+// this.setRequireSucess(true);
+// this.setApplySucess(true);
+ return false;
+ }
+ this.setIserror(false);
if (ObjectUtil.isNotEmpty(instdto)) {
List list = new ArrayList();
Map map = new HashMap();
@@ -522,6 +551,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
}
return true;
}
+
String taskid = taskdto.getTask_id();
String taskcode = taskdto.getTask_code();
String vehiclecode = taskdto.getVehicle_code();
@@ -571,6 +601,26 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
} else {
next_point_code = next_device_code;
}
+
+ if(!StrUtil.equals(taskdto.getStart_device_code(),this.device_code)){
+ message ="当前载具号"+container_code+"查找对应指令起点与当前设备不符";
+// List list = new ArrayList();
+// Map map = new HashMap();
+// map.put("code","to_target");
+// map.put("value","1011");
+// list.add(map);
+// Map map2 = new HashMap();
+// map2.put("code","to_command");
+// map2.put("value","1");
+// Map map3 = new HashMap();
+// map3.put("code","to_task");
+// map3.put("value","0");
+// list.add(map3);
+// this.writing(list);
+// this.setRequireSucess(true);
+// this.setApplySucess(true);
+ return false;
+ }
Instruction instdto = new Instruction();
instdto.setInstruction_id(IdUtil.simpleUUID());
instdto.setRoute_plan_code(route_plan_code);
@@ -646,7 +696,10 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
Map map2 = new HashMap();
map2.put("code","to_command");
map2.put("value","1");
- list.add(map2);
+ Map map3 = new HashMap();
+ map3.put("code","to_task");
+ map3.put("value","0");
+ list.add(map3);
this.writing(list);
message = "申请任务失败接口不通下发退回";
} else {
@@ -666,6 +719,10 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
map2.put("code","to_command");
map2.put("value","1");
list.add(map2);
+ Map map3 = new HashMap();
+ map3.put("code","to_task");
+ map3.put("value","0");
+ list.add(map3);
this.writing(list);
message = "申请任务失败下发退回,"+message;
diff --git a/acs/nladmin-ui/src/views/acs/instruction/index.vue b/acs/nladmin-ui/src/views/acs/instruction/index.vue
index b42b7e7f4..d3af064a9 100644
--- a/acs/nladmin-ui/src/views/acs/instruction/index.vue
+++ b/acs/nladmin-ui/src/views/acs/instruction/index.vue
@@ -144,10 +144,11 @@
-
+
+
diff --git a/acs/nladmin-ui/src/views/system/monitor/device/index.vue b/acs/nladmin-ui/src/views/system/monitor/device/index.vue
index d0055ab22..5816a051e 100644
--- a/acs/nladmin-ui/src/views/system/monitor/device/index.vue
+++ b/acs/nladmin-ui/src/views/system/monitor/device/index.vue
@@ -362,6 +362,9 @@ export default {
} else if (val === 'instruction_message') {
const obj = { name: '指令信息', value: data[val] }
this.arr.push(obj)
+ } else if (val === 'message') {
+ const obj = { name: '备注信息', value: data[val] }
+ this.arr.push(obj)
} else if (val === 'last_instruction_message') {
const obj = { name: '上次指令信息', value: data[val] }
this.arr.push(obj)