From a72caf0a317a4dac0138b0215f3baeadee1330a3 Mon Sep 17 00:00:00 2001
From: gengby <858962040@qq.com>
Date: Wed, 17 May 2023 17:26:50 +0800
Subject: [PATCH 1/2] =?UTF-8?q?rev=20=E4=BF=AE=E5=A4=8D=E5=88=A0=E9=99=A4?=
=?UTF-8?q?=E8=AE=BE=E5=A4=87=E6=8A=A5=E9=94=99=20=E5=88=86=E9=A1=B5?=
=?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../device/device_driver/DriverTypeEnum.java | 18 +++++++++---------
.../device/service/impl/DeviceServiceImpl.java | 13 ++++++++-----
.../service/impl/StorageCellServiceImpl.java | 1 -
.../service/impl/InstructionServiceImpl.java | 13 +++++++------
.../impl/ProduceshiftorderServiceImpl.java | 2 +-
.../acs/task/service/impl/TaskServiceImpl.java | 2 +-
.../src/views/acs/instruction/index.vue | 6 +++---
wcs/nladmin-ui/src/views/acs/order/index.vue | 8 ++++----
wcs/nladmin-ui/src/views/acs/task/index.vue | 4 ++--
.../src/views/system/monitor/device/index.vue | 2 +-
10 files changed, 36 insertions(+), 33 deletions(-)
diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java
index c0abb625..7e14c5bb 100644
--- a/wcs/nladmin-system/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java
+++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java
@@ -27,11 +27,11 @@ public enum DriverTypeEnum {
INSPECT_CONVEYOR_MONITOR(9, "standard_conveyor_monitor", "标准版-输送机-监控点", "conveyor"),
- HAILIANG_PACKING(10, "hailiang_packing", "海亮包装项目-包装机", "conveyor"),
+ //HAILIANG_PACKING(10, "hailiang_packing", "海亮包装项目-包装机", "conveyor"),
- HAILIANG_LABELING(11, "hailiang_labeling", "海亮包装项目-贴标机", "conveyor"),
+ //HAILIANG_LABELING(11, "hailiang_labeling", "海亮包装项目-贴标机", "conveyor"),
- HAILIANG_COATING(12, "hailiang_coating", "海亮包装项目-裹膜机", "conveyor"),
+ //HAILIANG_COATING(12, "hailiang_coating", "海亮包装项目-裹膜机", "conveyor"),
HAILIANG_SPECIAL_EMPTY_STATION(13, "hailiang_special_empty_station", "海亮专机空料点", "conveyor"),
@@ -61,17 +61,17 @@ public enum DriverTypeEnum {
HAILIANG_PACKER_STATION(26, "hailiang_packer_station", "海亮-包装机工位", "conveyor"),
- HAILIANG_XJ_PLC_TEST(27, "hailiang_xj_plc_test", "海亮-信捷PLC", "conveyor"),
+ //HAILIANG_XJ_PLC_TEST(27, "hailiang_xj_plc_test", "海亮-信捷PLC", "conveyor"),
- HAILIANG_SMART_PLC_TEST(28, "hailiang_smart_plc_test", "海亮-西门子SMART200PLC", "conveyor"),
+ //HAILIANG_SMART_PLC_TEST(28, "hailiang_smart_plc_test", "海亮-西门子SMART200PLC", "conveyor"),
- HAILIANG_THREESTATION_SMART(29, "hailiang_threestation_smart", "海亮-三工位Smart200", "conveyor"),
+ //HAILIANG_THREESTATION_SMART(29, "hailiang_threestation_smart", "海亮-三工位Smart200", "conveyor"),
- HAILIANG_FOLDINGDISC_SMART(30, "hailiang_foldingDisc_smart", "海亮-叠盘位Smart200", "conveyor"),
+ //HAILIANG_FOLDINGDISC_SMART(30, "hailiang_foldingDisc_smart", "海亮-叠盘位Smart200", "conveyor"),
- HAILIANG_ELEVATOR_WIRING(31, "hailiang_elevator_wiring", "海亮-货梯对接线", "conveyor"),
+ //HAILIANG_ELEVATOR_WIRING(31, "hailiang_elevator_wiring", "海亮-货梯对接线", "conveyor"),
- HAILIANG_PAINT_LINE(32, "hailiang_paint_line", "海亮-油漆线", "conveyor"),
+ //HAILIANG_PAINT_LINE(32, "hailiang_paint_line", "海亮-油漆线", "conveyor"),
HAILIANG_STACKING_STATION(33, "hailiang_stacking_station", "海亮-包装线体", "conveyor"),
diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java
index 51b9310e..c99c16d4 100644
--- a/wcs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java
+++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java
@@ -247,6 +247,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
Device device = iterator.next();
if (StrUtil.equals(device.getDevice_code(), device_code)) {
iterator.remove();
+ break;
}
}
@@ -255,7 +256,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
log.info("设备删除成功!");
if (deviceByCode != null) {
- if (StrUtil.equals("storage", deviceByCode.getDeviceDriverDefination().getFitDeviceTypes().get(0).name())) {
+ if (ObjectUtil.isNotEmpty(deviceByCode.getDeviceDriverDefination()) && StrUtil.equals("storage", deviceByCode.getDeviceDriverDefination().getFitDeviceTypes().get(0).name())) {
storageTab.delete("substring_index( storage_code,'-',1)= '" + device_code + "'");
} else {
@@ -1332,6 +1333,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
if (StrUtil.equals(storageCellDto.getStorage_code(), dto.getStorage_code())) {
storageCells.remove(storageCellDto);
storageCells.add(dto);
+ break;
}
}
}
@@ -1592,11 +1594,12 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
String datatype = jo.getString("extra_name");
//西门子200
if (!datatype.contains(".")) {
- String[] split = datatype.split("");
- if (split[1].equals("W")) {
- datatype = "Word";
- } else if (split[1].equals("D")) {
+ if (datatype.startsWith("VD")) {
datatype = "DWord";
+ } else if (datatype.startsWith("VW")) {
+ datatype = "Word";
+ } else if (datatype.startsWith("V")) {
+ datatype = "Boolean";
}
} else {
datatype = "Boolean";
diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/StorageCellServiceImpl.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/StorageCellServiceImpl.java
index 86b6c944..cd4ba444 100644
--- a/wcs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/StorageCellServiceImpl.java
+++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/StorageCellServiceImpl.java
@@ -140,7 +140,6 @@ public class StorageCellServiceImpl implements StorageCellService {
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
wo.update(json);
deviceService.updateDeviceCodeByAddress(dto);
-
}
@Override
diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/wcs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java
index 8c4dec32..79aad848 100644
--- a/wcs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java
+++ b/wcs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java
@@ -131,7 +131,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
.collect(Collectors.toList());
JSONObject jo = new JSONObject();
jo.put("content", instructionList);
- jo.put("totalElements", instructionList.size());
+ jo.put("totalElements", this.instructions.size());
return jo;
}
@@ -1092,6 +1092,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
.orElse(new CopyOnWriteArrayList<>())
.stream()
.filter(i -> i.getLink_num().equals(link_no))
+ .sorted((inst1, inst2) -> inst1.getInstruction_code().compareTo(inst2.getInstruction_code()))
.collect(Collectors.toList());
}
@@ -1326,9 +1327,9 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
if (putDevice != null) {
if (startDevice.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) startDevice.getDeviceDriver();
- if (hailiangAutoCacheLineDeviceDriver.getTask() != 0) {
+ if (hailiangAutoCacheLineDeviceDriver.getItemProtocol().getOpcIntegerValue("task") != 0) {
throw new BadRequestException("缓存线已存在任务,稍后下发!");
- } else if (tasksByLinNum.size() == 1 && hailiangAutoCacheLineDeviceDriver.getTask() == 0) {
+ } else if (hailiangAutoCacheLineDeviceDriver.getItemProtocol().getOpcIntegerValue("task") == 0) {
//下发电气单出
to_task_type = "4";
}
@@ -1341,12 +1342,12 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
}
if (putDevice.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) putDevice.getDeviceDriver();
- if (hailiangAutoCacheLineDeviceDriver.getTask() != 0) {
+ if (hailiangAutoCacheLineDeviceDriver.getItemProtocol().getOpcIntegerValue("task") != 0) {
throw new BadRequestException("缓存线已存在任务,稍后下发!");
- } else if (tasksByLinNum.size() == 1 && hailiangAutoCacheLineDeviceDriver.getTask() == 0) {
+ } else if (tasksByLinNum.size() == 1 && hailiangAutoCacheLineDeviceDriver.getItemProtocol().getOpcIntegerValue("task") == 0) {
//下发电气单入
to_task_type = "2";
- } else if (tasksByLinNum.size() == 2 && hailiangAutoCacheLineDeviceDriver.getTask() == 0) {
+ } else if (tasksByLinNum.size() == 2 && hailiangAutoCacheLineDeviceDriver.getItemProtocol().getOpcIntegerValue("task") == 0) {
//下发电气双入
to_task_type = "3";
}
diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderServiceImpl.java b/wcs/nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderServiceImpl.java
index 95e77367..c21b1461 100644
--- a/wcs/nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderServiceImpl.java
+++ b/wcs/nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderServiceImpl.java
@@ -118,7 +118,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
.collect(Collectors.toList());
JSONObject jo = new JSONObject();
jo.put("content", orderList);
- jo.put("totalElements", orderList.size());
+ jo.put("totalElements", this.order.size());
return jo;
}
diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java b/wcs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java
index cd1da4c3..0ff9dab5 100644
--- a/wcs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java
+++ b/wcs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java
@@ -176,7 +176,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
.collect(Collectors.toList());
JSONObject jo = new JSONObject();
jo.put("content", taskList);
- jo.put("totalElements", taskList.size());
+ jo.put("totalElements", this.tasks.size());
return jo;
}
diff --git a/wcs/nladmin-ui/src/views/acs/instruction/index.vue b/wcs/nladmin-ui/src/views/acs/instruction/index.vue
index b8dcac61..6b5060f0 100644
--- a/wcs/nladmin-ui/src/views/acs/instruction/index.vue
+++ b/wcs/nladmin-ui/src/views/acs/instruction/index.vue
@@ -127,9 +127,9 @@
{{ dict.label.send_status[scope.row.send_status] }}
-
-
-
+
+
+
{{ dict.label.execute_status[scope.row.execute_status] }}
diff --git a/wcs/nladmin-ui/src/views/acs/order/index.vue b/wcs/nladmin-ui/src/views/acs/order/index.vue
index 41ad559e..047f7d4a 100644
--- a/wcs/nladmin-ui/src/views/acs/order/index.vue
+++ b/wcs/nladmin-ui/src/views/acs/order/index.vue
@@ -158,10 +158,10 @@
-
-
-
-
+
+
+
+
diff --git a/wcs/nladmin-ui/src/views/acs/task/index.vue b/wcs/nladmin-ui/src/views/acs/task/index.vue
index c9493ace..fd810fd1 100644
--- a/wcs/nladmin-ui/src/views/acs/task/index.vue
+++ b/wcs/nladmin-ui/src/views/acs/task/index.vue
@@ -350,9 +350,9 @@
-
+
-
+
diff --git a/wcs/nladmin-ui/src/views/system/monitor/device/index.vue b/wcs/nladmin-ui/src/views/system/monitor/device/index.vue
index dea4d74d..fbc1e428 100644
--- a/wcs/nladmin-ui/src/views/system/monitor/device/index.vue
+++ b/wcs/nladmin-ui/src/views/system/monitor/device/index.vue
@@ -660,7 +660,7 @@ export default {
} else if (val === 'storage_stock_num') {
const obj = { name: '倒料位数量', value: data[val] }
this.arr.push(obj)
- } else if (val === 'now_order_prod_num') {
+ } else if (val === 'now_one_box_num') {
const obj = { name: '当前箱数量(每框实时)', value: data[val] }
this.arr.push(obj)
} else if (val === 'order_prod_allnum') {
From f6abc2cd3e35e08ace6b2a6b6c65f7e2862365cf Mon Sep 17 00:00:00 2001
From: gengby <858962040@qq.com>
Date: Wed, 17 May 2023 17:27:57 +0800
Subject: [PATCH 2/2] =?UTF-8?q?rev=20=E8=AF=B7=E6=B1=82=E6=A0=87=E8=AE=B0?=
=?UTF-8?q?=E5=A4=8D=E4=BD=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../agv/ndctwo/AgvNdcTwoDeviceDriver.java | 45 ++-
.../HailiangAutoCacheLineDeviceDriver.java | 95 +++---
.../HailiangCleaningFeedingLineDriver.java | 2 +-
...ningMachineStorageStationDeviceDriver.java | 4 +-
.../HailiangEngravingCacheDeviceDriver.java | 2 +-
.../HailiangEngravingMachineDeviceDriver.java | 15 +-
.../HailiangOldSpecialDeviceDriver.java | 6 +-
...angOldSpecialEmptyStationDeviceDriver.java | 2 +-
...iangOldSpecialFullStationDeviceDriver.java | 9 +-
.../ItemProtocol.java | 4 +-
...iangOldSpecialPickStationDeviceDriver.java | 5 -
...iangOldSpecialPourStationDeviceDriver.java | 15 +-
.../HailiangPackerStationDeviceDriver.java | 11 +-
.../hailiang_packer_station/ItemProtocol.java | 2 +-
.../HailiangSpecialDeviceDriver.java | 4 +-
...iliangSpecialEmptyStationDeviceDriver.java | 7 +-
...ailiangSpecialFullStationDeviceDriver.java | 15 +-
...ailiangSpecialPickStationDeviceDriver.java | 20 +-
.../ItemProtocol.java | 2 +-
...ailiangSpecialPourStationDeviceDriver.java | 17 +-
.../HailiangStackingStationDriver.java | 283 ++++++++++--------
.../ItemProtocol.java | 239 +++++++++------
.../UnboxingMachineDeviceDriver.java | 16 +
23 files changed, 507 insertions(+), 313 deletions(-)
diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndctwo/AgvNdcTwoDeviceDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndctwo/AgvNdcTwoDeviceDriver.java
index 71bc8db5..55f11721 100644
--- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndctwo/AgvNdcTwoDeviceDriver.java
+++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndctwo/AgvNdcTwoDeviceDriver.java
@@ -29,6 +29,7 @@ import org.nl.acs.task.service.dto.TaskDto;
import org.nl.acs.task.service.impl.TaskServiceImpl;
import org.nl.modules.wql.util.SpringContextHolder;
+import java.util.Collections;
import java.util.List;
/**
@@ -278,6 +279,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver();
hailiangAutoCacheLineDeviceDriver.set(phase, index, inst);
+ break;
}
}
}
@@ -311,10 +313,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if (device.getDeviceDriver() instanceof HailiangSpecialPourStationDeviceDriver) {
hailiangSpecialPourStationDeviceDriver = (HailiangSpecialPourStationDeviceDriver) device.getDeviceDriver();
hailiangSpecialPourStationDeviceDriver.set(phase, index, inst);
+ break;
}
if (device.getDeviceDriver() instanceof HailiangCleaningMachineStorageStationDeviceDriver) {
hailiangCleaningMachineStorageStationDeviceDriver = (HailiangCleaningMachineStorageStationDeviceDriver) device.getDeviceDriver();
hailiangCleaningMachineStorageStationDeviceDriver.set(phase, index, inst);
+ break;
}
}
@@ -346,6 +350,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver();
hailiangAutoCacheLineDeviceDriver.set(phase, index, inst);
+ break;
}
}
}
@@ -377,10 +382,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if (device.getDeviceDriver() instanceof HailiangSpecialPourStationDeviceDriver) {
hailiangSpecialPourStationDeviceDriver = (HailiangSpecialPourStationDeviceDriver) device.getDeviceDriver();
hailiangSpecialPourStationDeviceDriver.set(phase, index, inst);
+ break;
}
if (device.getDeviceDriver() instanceof HailiangCleaningMachineStorageStationDeviceDriver) {
hailiangCleaningMachineStorageStationDeviceDriver = (HailiangCleaningMachineStorageStationDeviceDriver) device.getDeviceDriver();
hailiangCleaningMachineStorageStationDeviceDriver.set(phase, index, inst);
+ break;
}
}
}
@@ -395,6 +402,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
return;
}
device_code = deviceService.queryDeviceCodeByAddress(agvaddr);
+ device = deviceAppService.findDeviceByCode(device_code);
if (ObjectUtil.isEmpty(device_code)) {
log.info(agvaddr + "对应设备号为空!");
return;
@@ -410,6 +418,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver();
hailiangAutoCacheLineDeviceDriver.set(phase, index, inst);
+ break;
}
}
}
@@ -440,10 +449,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if (device.getDeviceDriver() instanceof HailiangSpecialPourStationDeviceDriver) {
hailiangSpecialPourStationDeviceDriver = (HailiangSpecialPourStationDeviceDriver) device.getDeviceDriver();
hailiangSpecialPourStationDeviceDriver.set(phase, index, inst);
+ break;
}
if (device.getDeviceDriver() instanceof HailiangCleaningMachineStorageStationDeviceDriver) {
hailiangCleaningMachineStorageStationDeviceDriver = (HailiangCleaningMachineStorageStationDeviceDriver) device.getDeviceDriver();
hailiangCleaningMachineStorageStationDeviceDriver.set(phase, index, inst);
+ break;
}
}
}
@@ -458,6 +469,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
return;
}
device_code = deviceService.queryDeviceCodeByAddress(agvaddr);
+ device = deviceAppService.findDeviceByCode(device_code);
if (ObjectUtil.isEmpty(device_code)) {
log.info(agvaddr + "对应设备号为空!");
return;
@@ -473,6 +485,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver();
hailiangAutoCacheLineDeviceDriver.set(phase, index, inst);
+ break;
}
}
}
@@ -486,10 +499,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
return;
}
device_code = deviceService.queryDeviceCodeByAddress(agvaddr);
+ device = deviceAppService.findDeviceByCode(device_code);
if (ObjectUtil.isEmpty(device_code)) {
log.info(agvaddr + "对应设备号为空!");
return;
}
+ Collections.reverse(insts);
for (Instruction inst : insts) {
//校验agv上报站点编号与指令起始点相同
if (ObjectUtil.isEmpty(inst)) {
@@ -501,7 +516,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver();
hailiangAutoCacheLineDeviceDriver.set(phase, index, inst);
-
+ break;
}
}
}
@@ -515,10 +530,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
return;
}
device_code = deviceService.queryDeviceCodeByAddress(agvaddr);
+ device = deviceAppService.findDeviceByCode(device_code);
if (ObjectUtil.isEmpty(device_code)) {
log.info(agvaddr + "对应设备号为空!");
return;
}
+ Collections.reverse(insts);
for (Instruction inst : insts) {
//校验agv上报站点编号与指令起始点相同
if (ObjectUtil.isEmpty(inst)) {
@@ -530,6 +547,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver();
hailiangAutoCacheLineDeviceDriver.set(phase, index, inst);
+ break;
}
}
}
@@ -543,21 +561,25 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
return;
}
device_code = deviceService.queryDeviceCodeByAddress(agvaddr);
+ device = deviceAppService.findDeviceByCode(device_code);
if (ObjectUtil.isEmpty(device_code)) {
log.info(agvaddr + "对应设备号为空!");
return;
}
+ Collections.reverse(insts);
for (Instruction inst : insts) {
//校验agv上报站点编号与指令起始点相同
if (ObjectUtil.isEmpty(inst)) {
log.info("未找到关联编号{}对应的指令", ikey);
break;
}
+ Collections.reverse(insts);
//只有满料位到缓存线才有到达取空框2
if (StrUtil.equals(inst.getPut_device_code(), device_code)) {
if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver();
hailiangAutoCacheLineDeviceDriver.set(phase, index, inst);
+ break;
}
}
}
@@ -571,10 +593,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
return;
}
device_code = deviceService.queryDeviceCodeByAddress(agvaddr);
+ device = deviceAppService.findDeviceByCode(device_code);
if (ObjectUtil.isEmpty(device_code)) {
log.info(agvaddr + "对应设备号为空!");
return;
}
+ Collections.reverse(insts);
for (Instruction inst : insts) {
//校验agv上报站点编号与指令起始点相同
if (ObjectUtil.isEmpty(inst)) {
@@ -586,6 +610,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver();
hailiangAutoCacheLineDeviceDriver.set(phase, index, inst);
+ break;
}
}
}
@@ -605,6 +630,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
log.info(agvaddr + "对应设备号为空!");
return;
}
+ Collections.reverse(insts);
for (Instruction inst : insts) {
//校验agv上报站点编号与指令起始点相同
if (ObjectUtil.isEmpty(inst)) {
@@ -616,10 +642,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if (device.getDeviceDriver() instanceof HailiangSpecialPourStationDeviceDriver) {
hailiangSpecialPourStationDeviceDriver = (HailiangSpecialPourStationDeviceDriver) device.getDeviceDriver();
hailiangSpecialPourStationDeviceDriver.set(phase, index, inst);
+ break;
}
if (device.getDeviceDriver() instanceof HailiangCleaningMachineStorageStationDeviceDriver) {
hailiangCleaningMachineStorageStationDeviceDriver = (HailiangCleaningMachineStorageStationDeviceDriver) device.getDeviceDriver();
hailiangCleaningMachineStorageStationDeviceDriver.set(phase, index, inst);
+ break;
}
}
}
@@ -712,6 +740,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
log.info(agvaddr + "对应设备号为空!");
return;
}
+ Collections.reverse(insts);
for (Instruction inst : insts) {
//校验agv上报站点编号与指令起始点相同
if (ObjectUtil.isEmpty(inst)) {
@@ -747,6 +776,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
log.info(agvaddr + "对应设备号为空!");
return;
}
+ Collections.reverse(insts);
for (Instruction inst : insts) {
//校验agv上报站点编号与指令起始点相同
if (ObjectUtil.isEmpty(inst)) {
@@ -775,6 +805,19 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data);
} else if (phase == 0x65) {//param,重量待定
+// if (agvaddr == 0) {
+// agvaddr = agvaddr_copy;
+// }
+ if (agvaddr < 1) {
+ log.info("phase:" + phase + "--agv地址参数有误agvaddr=" + agvaddr);
+ return;
+ }
+ agvaddr = agvaddr_copy;
+ device_code = deviceService.queryDeviceCodeByAddress(agvaddr);
+ if (ObjectUtil.isEmpty(device_code)) {
+ log.info(agvaddr + "对应设备号为空!");
+ return;
+ }
//1、得到重量信息
int weight = (arr[18] * 256 + arr[19]) * 10;
for (Instruction inst : insts) {
diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_auto_cache_line/HailiangAutoCacheLineDeviceDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_auto_cache_line/HailiangAutoCacheLineDeviceDriver.java
index 1447d02e..592a44c9 100644
--- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_auto_cache_line/HailiangAutoCacheLineDeviceDriver.java
+++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_auto_cache_line/HailiangAutoCacheLineDeviceDriver.java
@@ -92,8 +92,10 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
//准备位条码
int prepare_barcode = 0;
+ int last_prepare_barcode = 0;
//对接位条码
int docking_barcode = 0;
+ int last_docking_barcode = 0;
//提升机条码
int hoist_barcode = 0;
@@ -247,7 +249,7 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
+ "," + two_barcode6 + "," + two_barcode7 + "," + two_barcode8 + "," + two_barcode9 + "," + two_barcode10
+ "," + three_barcode1 + "," + three_barcode2 + "," + three_barcode3 + "," + three_barcode4 + "," + three_barcode5
+ "," + three_barcode6 + "," + three_barcode7 + "," + three_barcode8 + "," + three_barcode9 + "," + three_barcode10
- + "," + prepare_barcode + "," + docking_barcode;
+ + "," + prepare_barcode + "," + prepare_barcode;
if (!StrUtil.equals(material_spec, last_material_spec)) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号material_spec:" + last_material_spec + "->" + material_spec);
@@ -327,6 +329,12 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
if (task_type != last_task_type) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号task_type:" + last_task_type + "->" + task_type);
}
+ if (prepare_barcode != last_prepare_barcode) {
+ logServer.deviceExecuteLog(this.device_code, "", "", "信号prepare_barcode:" + last_prepare_barcode + "->" + prepare_barcode);
+ }
+ if (docking_barcode != last_docking_barcode) {
+ logServer.deviceExecuteLog(this.device_code, "", "", "信号docking_barcode:" + last_docking_barcode + "->" + docking_barcode);
+ }
if (isonline != last_isonline) {
feedDeviceStatusFlag = false;
logServer.deviceExecuteLog(this.device_code, "", "", "信号isonline:" + last_isonline + "->" + isonline);
@@ -383,10 +391,27 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
if (mode == 1 && prepare_ready == 1 && move == 0 && in_ready == 0 && task != 0 && prepare_barcode != 99999 && (agvphase == 0x0A || agvphase == 0x21)) {
this.writing("to_agv_put_ready", "1");
+ this.writing("to_agv_put_finish", "0");
}
if (mode == 1 && prepare_ready == 1 && move == 0 && task != 0 && prepare_barcode != 99999 && (agvphase == 0x0E || agvphase == 0x25 || agvphase == 0x03)) {
+ if (inst != null) {
+ TaskDto taskDto = taskserver.findByCodeFromCache(inst.getTask_code());
+ if (taskDto != null) {
+ taskDto.setVehicle_code(String.valueOf(prepare_barcode));
+ taskserver.update(taskDto);
+ }
+ }
this.writing("to_prepare_docking", "1");
}
+
+ if (mode == 1 && move == 0 && in_ready == 0 && (agvphase == 0x13 || agvphase == 0x17)) {
+ //送回空箱时到达点位判断缓存线是否有其他任务,有其他任务就让缓存线停止转洞
+ if (task > 0 && task != Integer.parseInt(inst.getInstruction_code())) {
+ this.writing("to_pause_out_check", "1");
+ }
+ this.writing("to_agv_put_ready", "1");
+ }
+
} catch (Exception var17) {
var17.printStackTrace();
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17 + ",inst == null :" + ObjectUtil.isEmpty(inst));
@@ -416,10 +441,10 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
instructionService.update(inst);
byte[] data = agvService.sendAgvTwoModeInst(agvphase, index, 0);
NDCSocketConnectionAutoRun.write(data);
- this.set(0, 0, null);
noFeedAgvMessage = null;
message = this.messageInfo(agvphase);
logServer.deviceExecuteLog(device_code, "", "", this.messageInfo(agvphase));
+ this.set(0, 0, null);
} else {
//如果上述条件不满足 先判断当前缓存线任务号是否为0
//如果为0 且agv上报的指令信息存在,需要下发缓存线对应的任务信息
@@ -452,16 +477,16 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
} else if (agvphase == 0x0C || agvphase == 0x23) {
//agv送满框1完毕或送满框2完毕
//需要判断缓存线工作模式联机,对接位有货,任务号不为0,对接位条码正常才反馈agv以及电气放货完成
- if (mode == 1 && move == 1 && task != 0 && docking_barcode != 99999 && ObjectUtil.isNotEmpty(inst) && Integer.parseInt(inst.getInstruction_code()) == task) {
+ if (mode == 1 && move == 1 && task != 0 && prepare_barcode != 99999 && ObjectUtil.isNotEmpty(inst) && Integer.parseInt(inst.getInstruction_code()) == task) {
this.writing("to_agv_put_finish", "1");
inst.setExecute_status(InstActionEnum.EXECUTE_PUT_FALL_SEND_FULL_FINISH.getCode());
instructionService.update(inst);
byte[] data = agvService.sendAgvTwoModeInst(agvphase, index, 0);
NDCSocketConnectionAutoRun.write(data);
- this.set(0, 0, null);
noFeedAgvMessage = null;
message = this.messageInfo(agvphase);
logServer.deviceExecuteLog(device_code, "", "", this.messageInfo(agvphase));
+ this.set(0, 0, null);
} else {
String noFeedMessage = this.noFeedMessage();
if (move != 1) {
@@ -480,21 +505,16 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
}
} else if (agvphase == 0x0E || agvphase == 0x25) {
//agv到达取空框1或取空框2
- if (mode == 1 && move == 1 && prepare_ready == 1 && task != 0 && ObjectUtil.isNotEmpty(inst) && Integer.parseInt(inst.getInstruction_code()) == task && docking_barcode != 99999) {
+ if (mode == 1 && move == 1 && out_ready == 1 && task != 0 && ObjectUtil.isNotEmpty(inst) && Integer.parseInt(inst.getInstruction_code()) == task && prepare_barcode != 99999) {
this.writing("to_agv_get_ready", "1");
inst.setExecute_status(InstActionEnum.EXECUTE_TO_GET_EMPTY.getCode());
instructionService.update(inst);
byte[] data = agvService.sendAgvTwoModeInst(agvphase, index, 0);
NDCSocketConnectionAutoRun.write(data);
- TaskDto taskDto = taskserver.findByCodeFromCache(inst.getTask_code());
- if (taskDto != null) {
- taskDto.setVehicle_code(String.valueOf(docking_barcode));
- taskserver.update(taskDto);
- }
- this.set(0, 0, null);
noFeedAgvMessage = null;
message = this.messageInfo(agvphase);
logServer.deviceExecuteLog(device_code, "", "", this.messageInfo(agvphase));
+ this.set(0, 0, null);
} else {
String noFeedMessage = this.noFeedMessage();
if (move != 1) {
@@ -503,23 +523,23 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
if (prepare_ready != 1) {
noFeedMessage += "准备位未就绪,";
}
- if (docking_barcode == 99999) {
+ if (prepare_barcode == 99999) {
noFeedMessage += "对接位条码异常,";
}
this.noFeedAgvMessage = this.replace(noFeedMessage);
}
} else if (agvphase == 0x10 || agvphase == 0x27) {
//agv取空框1完毕或取空框2完毕
- if (mode == 1 && move == 0 && task != 0 && ObjectUtil.isNotEmpty(inst) && Integer.parseInt(inst.getInstruction_code()) == task) {
- //this.writing("to_agv_get_finish", "1");
+ if (mode == 1 && move == 0 && ObjectUtil.isNotEmpty(inst)) {
Map map = new HashMap<>();
map.put("to_agv_get_finish", "1");
- map.put("to_task_finish", "1");
+ map.put("to_agv_put_finish", "0");
this.writing(map);
inst.setExecute_status(InstActionEnum.EXECUTE_GET_EMPTY_FINISH.getCode());
instructionService.update(inst);
byte[] data = agvService.sendAgvTwoModeInst(agvphase, index, 0);
NDCSocketConnectionAutoRun.write(data);
+ this.writing("to_task_finish", "1");
//如果送满框1任务完成 判断是否有下一条任务 有的话立即下发缓存线
if (agvphase == 0x10) {
List linkNum = instructionService.findByLinkNum(inst.getLink_num());
@@ -537,10 +557,10 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
}
}
}
- this.set(0, 0, null);
noFeedAgvMessage = null;
message = this.messageInfo(agvphase);
logServer.deviceExecuteLog(device_code, "", "", this.messageInfo(agvphase));
+ this.set(0, 0, null);
} else {
String noFeedMessage = this.noFeedMessage();
if (move != 0) {
@@ -557,21 +577,17 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
*/
if (agvphase == 0x03) {
//缓存线出满框 到达取货点
- if (mode == 1 && move == 0 && prepare_ready == 1 && out_ready == 1 && task != 0 && prepare_barcode != 99999 && ObjectUtil.isNotEmpty(inst) && Integer.parseInt(inst.getInstruction_code()) == task) {
+ if (mode == 1 && move == 1 && out_ready == 1 && task != 0 && docking_barcode != 99999 && ObjectUtil.isNotEmpty(inst) && Integer.parseInt(inst.getInstruction_code()) == task) {
this.writing("to_agv_get_ready", "1");
+ this.writing("to_agv_put_finish", "0");
inst.setExecute_status(InstActionEnum.EXECUTE_TO_GET.getCode());
instructionService.update(inst);
byte[] data = agvService.sendAgvTwoModeInst(agvphase, index, 0);
NDCSocketConnectionAutoRun.write(data);
- TaskDto taskDto = taskserver.findByCodeFromCache(inst.getTask_code());
- if (taskDto != null) {
- taskDto.setVehicle_code(String.valueOf(docking_barcode));
- taskserver.update(taskDto);
- }
- this.set(0, 0, null);
this.noFeedAgvMessage = null;
message = this.messageInfo(agvphase);
logServer.deviceExecuteLog(device_code, "", "", this.messageInfo(agvphase));
+ this.set(0, 0, null);
} else {
if (task == 0 && ObjectUtil.isNotEmpty(inst)) {
TaskDto taskDto = taskserver.findByCodeFromCache(inst.getTask_code());
@@ -605,45 +621,42 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
}
} else if (agvphase == 0x05) {
//缓存线出满框 取货完毕
- if (mode == 1 && move == 0 && docking_barcode != 99999 && ObjectUtil.isNotEmpty(inst) && Integer.parseInt(inst.getInstruction_code()) == task) {
+ if (mode == 1 && move == 0 && prepare_barcode != 99999 && ObjectUtil.isNotEmpty(inst)) {
inst.setExecute_status(InstActionEnum.EXECUTE_GET_FINISH.getCode());
instructionService.update(inst);
byte[] data = agvService.sendAgvTwoModeInst(agvphase, index, 0);
NDCSocketConnectionAutoRun.write(data);
Map map = new HashMap<>();
map.put("to_agv_get_finish", "1");
- map.put("to_task_finish", "1");
+ if (task == 0 || Integer.parseInt(inst.getTask_code()) == task) {
+ map.put("to_task_finish", "1");
+ }
this.writing(map);
- this.set(0, 0, null);
noFeedAgvMessage = null;
message = this.messageInfo(agvphase);
logServer.deviceExecuteLog(device_code, "", "", this.messageInfo(agvphase));
+ this.set(0, 0, null);
} else {
String noFeedMessage = this.noFeedMessage();
if (move != 0) {
noFeedMessage += "对接位光电有货,";
}
- if (docking_barcode == 99999) {
+ if (prepare_barcode == 99999) {
noFeedMessage += "对接位条码异常,";
}
this.noFeedAgvMessage = this.replace(noFeedMessage);
}
} else if (agvphase == 0x13 || agvphase == 0x17) {
//缓存线出满框送回空框
- if (mode == 1 && move == 0 && ObjectUtil.isNotEmpty(inst) /*&& Integer.parseInt(inst.getInstruction_code()) == task*/) {
- //送回空箱时到达点位判断缓存线是否有其他任务,有其他任务就让缓存线停止转洞
- if (task > 0 && task != Integer.parseInt(inst.getInstruction_code())) {
- this.writing("to_pause", "1");
- }
- this.writing("to_agv_put_ready", "1");
+ if (mode == 1 && move == 0 && in_ready == 1 && ObjectUtil.isNotEmpty(inst)) {
inst.setExecute_status(InstActionEnum.EXECUTE_TO_PUT_EMPTY.getCode());
instructionService.update(inst);
byte[] data = agvService.sendAgvTwoModeInst(agvphase, index, 0);
NDCSocketConnectionAutoRun.write(data);
- this.set(0, 0, null);
noFeedAgvMessage = null;
message = this.messageInfo(agvphase);
logServer.deviceExecuteLog(device_code, "", "", this.messageInfo(agvphase));
+ this.set(0, 0, null);
} else {
String notFeedAgvMessage = "到达缓存线送空框点未反馈AGV原因:";
if (mode != 1) {
@@ -659,23 +672,23 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
}
} else if (agvphase == 0x15 || agvphase == 0x19) {
//缓存线出满框送回空框完毕
- if (mode == 1 && move == 1 && ObjectUtil.isNotEmpty(inst) /*&& Integer.parseInt(inst.getInstruction_code()) == task*/) {
+ if (mode == 1 && in_finish == 1 && ObjectUtil.isNotEmpty(inst)) {
this.writing("to_agv_put_finish", "1");
inst.setExecute_status(InstActionEnum.EXECUTE_PUT_EMPTY_FINISH.getCode());
instructionService.update(inst);
byte[] data = agvService.sendAgvTwoModeInst(agvphase, index, 0);
NDCSocketConnectionAutoRun.write(data);
if (task > 0 && task != Integer.parseInt(inst.getInstruction_code())) {
- this.writing("to_pause", "0");
+ this.writing("to_pause_out_check", "0");
}
- this.set(0, 0, null);
noFeedAgvMessage = null;
message = this.messageInfo(agvphase);
logServer.deviceExecuteLog(device_code, "", "", this.messageInfo(agvphase));
+ this.set(0, 0, null);
} else {
String noFeedMessage = this.noFeedMessage();
- if (move != 1) {
- noFeedMessage += "对接位光电无货,";
+ if (in_finish != 1) {
+ noFeedMessage += "电气未上报对接位入箱完成,";
}
this.noFeedAgvMessage = this.replace(noFeedMessage);
}
@@ -701,6 +714,8 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
last_hoist_target_layer = hoist_target_layer;
last_task_type = task_type;
last_barcodes = barcodes;
+ last_docking_barcode = docking_barcode;
+ last_prepare_barcode = prepare_barcode;
last_isonline = isonline;
}
@@ -946,7 +961,7 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
jo.put("hoist_target_layer", hoist_target_layer);
jo.put("task", task);
jo.put("prepare_barcode", prepare_barcode);
- jo.put("docking_barcode", docking_barcode);
+ jo.put("prepare_barcode", prepare_barcode);
jo.put("isOnline", this.itemProtocol.getIsonline());
jo.put("error", ErrorUtil.getDictDetail("cache_line_error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror());
diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_feeding_line/HailiangCleaningFeedingLineDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_feeding_line/HailiangCleaningFeedingLineDriver.java
index c5f12f07..e798b457 100644
--- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_feeding_line/HailiangCleaningFeedingLineDriver.java
+++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_feeding_line/HailiangCleaningFeedingLineDriver.java
@@ -167,7 +167,7 @@ public class HailiangCleaningFeedingLineDriver extends AbstractOpcDeviceDriver i
message = "未联机";
//有报警
} else {
- this.setIsonline(true);
+ // this.setIsonline(true);
this.setIserror(false);
//申请清洗上料
diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_machine_storage_station/HailiangCleaningMachineStorageStationDeviceDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_machine_storage_station/HailiangCleaningMachineStorageStationDeviceDriver.java
index b05f9ce3..d07b2aec 100644
--- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_machine_storage_station/HailiangCleaningMachineStorageStationDeviceDriver.java
+++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_machine_storage_station/HailiangCleaningMachineStorageStationDeviceDriver.java
@@ -153,9 +153,9 @@ public class HailiangCleaningMachineStorageStationDeviceDriver extends AbstractO
//this.setIserror(true);
message = "信号量同步异常";
//未联机
- } else if (mode == 0) {
+ } /*else if (mode == 0) {
message = "未联机";
- } else {
+ } */ else {
this.setIsonline(true);
this.setIserror(false);
message = null;
diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_cache/HailiangEngravingCacheDeviceDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_cache/HailiangEngravingCacheDeviceDriver.java
index 23a77192..29d2260c 100644
--- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_cache/HailiangEngravingCacheDeviceDriver.java
+++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_cache/HailiangEngravingCacheDeviceDriver.java
@@ -95,7 +95,7 @@ public class HailiangEngravingCacheDeviceDriver extends AbstractOpcDeviceDriver
message = "信号量同步异常";
//未联机
} else {
- this.setIsonline(true);
+ //this.setIsonline(true);
this.setIserror(false);
message = "";
//到达AGV取货点
diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_machine/HailiangEngravingMachineDeviceDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_machine/HailiangEngravingMachineDeviceDriver.java
index 1a2ad181..8b82c052 100644
--- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_machine/HailiangEngravingMachineDeviceDriver.java
+++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_machine/HailiangEngravingMachineDeviceDriver.java
@@ -370,7 +370,7 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
message = "未联机";
//有报警
} else {
- this.setIsonline(true);
+ //this.setIsonline(true);
this.setIserror(false);
message = "";
//有货、联机、满料请求申请AGV搬运任务
@@ -585,8 +585,11 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
reqParam.put("workorder_code", this.getOrder());
HttpResponse httpResponse = acsToWmsService.applyTaskToWms(reqParam);
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
- requireSucess = true;
- return true;
+ JSONObject resp = JSONObject.parseObject(httpResponse.body());
+ if (resp.getInteger("status") == 200) {
+ requireSucess = true;
+ return true;
+ }
}
}
return false;
@@ -618,13 +621,13 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
@Override
public void issuedOrderFinish(String autoFinish) {
Map map = new HashMap<>();
- if (StrUtil.equals(autoFinish, WorkerOrderEnum.FORCEFINISH.getCode())){
+ if (StrUtil.equals(autoFinish, WorkerOrderEnum.FORCEFINISH.getCode())) {
map.put("to_order_compel_finished", "1");
} else {
map.put("to_confirm_finished", "1");
}
- map.put("to_order", "0");
- map.put("to_clear", "1");
+ //map.put("to_order", "0");
+ //map.put("to_clear", "1");
this.writing(map);
}
diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_device/HailiangOldSpecialDeviceDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_device/HailiangOldSpecialDeviceDriver.java
index 7e36d48e..efde2892 100644
--- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_device/HailiangOldSpecialDeviceDriver.java
+++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_device/HailiangOldSpecialDeviceDriver.java
@@ -245,7 +245,7 @@ public class HailiangOldSpecialDeviceDriver extends AbstractOpcDeviceDriver impl
message = "未联机";
//有报警
} else {
- this.setIsonline(true);
+ // this.setIsonline(true);
this.setIserror(false);
message = "";
}
@@ -327,8 +327,8 @@ public class HailiangOldSpecialDeviceDriver extends AbstractOpcDeviceDriver impl
} else {
map.put("to_confirm_finished", "1");
}
- map.put("to_order", "0");
- map.put("to_clear", "1");
+ //map.put("to_order", "0");
+ //map.put("to_clear", "1");
this.writing(map);
}
diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_empty_station/HailiangOldSpecialEmptyStationDeviceDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_empty_station/HailiangOldSpecialEmptyStationDeviceDriver.java
index 28b42830..9c4360fd 100644
--- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_empty_station/HailiangOldSpecialEmptyStationDeviceDriver.java
+++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_empty_station/HailiangOldSpecialEmptyStationDeviceDriver.java
@@ -145,7 +145,7 @@ public class HailiangOldSpecialEmptyStationDeviceDriver extends AbstractOpcDevic
message = "未联机";
//有报警
} else {
- this.setIsonline(true);
+ //this.setIsonline(true);
this.setIserror(false);
message = "";
//请求放空箱
diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_full_station/HailiangOldSpecialFullStationDeviceDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_full_station/HailiangOldSpecialFullStationDeviceDriver.java
index 8b4c40d5..fd5be23a 100644
--- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_full_station/HailiangOldSpecialFullStationDeviceDriver.java
+++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_full_station/HailiangOldSpecialFullStationDeviceDriver.java
@@ -166,7 +166,7 @@ public class HailiangOldSpecialFullStationDeviceDriver extends AbstractOpcDevice
message = "未联机";
//有报警
} else {
- this.setIsonline(true);
+ // this.setIsonline(true);
this.setIserror(false);
message = "";
@@ -282,8 +282,11 @@ public class HailiangOldSpecialFullStationDeviceDriver extends AbstractOpcDevice
reqParam.put("workorder_code", this.getOrder());
HttpResponse httpResponse = acsToWmsService.applyTaskToWms(reqParam);
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
- requireSucess = true;
- return true;
+ JSONObject resp = JSONObject.parseObject(httpResponse.body());
+ if (resp.getInteger("status") == 200) {
+ requireSucess = true;
+ return true;
+ }
}
}
return false;
diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_full_station/ItemProtocol.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_full_station/ItemProtocol.java
index c93b7da1..32a8f726 100644
--- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_full_station/ItemProtocol.java
+++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_full_station/ItemProtocol.java
@@ -94,8 +94,8 @@ public class ItemProtocol {
public static List getWriteableItemDtos() {
ArrayList list = new ArrayList();
- list.add(new ItemDto(item_to_agv_ready, "AGV取货就绪", "W112", Boolean.valueOf(true)));
- list.add(new ItemDto(item_to_agv_finish, "AGV取货完成", "W114", Boolean.valueOf(true)));
+ list.add(new ItemDto(item_to_agv_ready, "AGV取货就绪", "VW112", Boolean.valueOf(true)));
+ list.add(new ItemDto(item_to_agv_finish, "AGV取货完成", "VW114", Boolean.valueOf(true)));
return list;
}
diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_pick_station/HailiangOldSpecialPickStationDeviceDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_pick_station/HailiangOldSpecialPickStationDeviceDriver.java
index d462fe1a..f52d79b7 100644
--- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_pick_station/HailiangOldSpecialPickStationDeviceDriver.java
+++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_pick_station/HailiangOldSpecialPickStationDeviceDriver.java
@@ -102,11 +102,6 @@ public class HailiangOldSpecialPickStationDeviceDriver extends AbstractOpcDevice
//this.setIserror(true);
message = "未联机";
//有报警
- } else if (error != 0) {
- //this.setIsonline(false);
- //this.setIserror(true);
- message = "有报警";
- //无报警
} else {
this.setIsonline(true);
this.setIserror(false);
diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_pour_station/HailiangOldSpecialPourStationDeviceDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_pour_station/HailiangOldSpecialPourStationDeviceDriver.java
index f51c611d..b6b7dd6f 100644
--- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_pour_station/HailiangOldSpecialPourStationDeviceDriver.java
+++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_old_special_pour_station/HailiangOldSpecialPourStationDeviceDriver.java
@@ -133,7 +133,7 @@ public class HailiangOldSpecialPourStationDeviceDriver extends AbstractOpcDevice
if (order > 0 && this.itemProtocol.getIsonline() && ObjectUtil.isNotEmpty(this.getDevice().getExtraValue().get("link_device_code"))) {
MonitoringLargeScreenData.deviceNumData.put(this.getDevice().getExtraValue().get("link_device_code").toString(), this.getStorage_stock_num());
}
- if (storage_stock_num == Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num")))) {
+ if (ObjectUtil.isNotEmpty(this.getDevice().getExtraValue().get("min_num")) && storage_stock_num == Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num"))) && Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num"))) != -1) {
requireSucess = false;
}
logServer.deviceExecuteLog(this.device_code, "", "", "信号storage_stock_num:" + last_storage_stock_num + "->" + storage_stock_num);
@@ -156,17 +156,17 @@ public class HailiangOldSpecialPourStationDeviceDriver extends AbstractOpcDevice
message = "未联机";
//有报警
} else {
- this.setIsonline(true);
+ //this.setIsonline(true);
this.setIserror(false);
- if (mode == 1 && !requireSucess && Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num"))) >= this.storage_stock_num) {
+ if (mode == 1 && !requireSucess && ObjectUtil.isNotEmpty(this.getDevice().getExtraValue().get("min_num")) && Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num"))) >= this.storage_stock_num && Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num"))) != -1) {
boolean flag = applyOutCacheLineTask();
this.noApplyTaskMessage = null;
if (flag) {
this.message = "申请缓存线任务成功";
}
} else {
- if (Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num"))) >= storage_stock_num) {
+ if (ObjectUtil.isNotEmpty(this.getDevice().getExtraValue().get("min_num")) && Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num"))) >= storage_stock_num) {
String notApplyTaskMessage = "";
if (mode != 1) {
notApplyTaskMessage += "设备未联机,";
@@ -252,8 +252,11 @@ public class HailiangOldSpecialPourStationDeviceDriver extends AbstractOpcDevice
reqParam.put("workorder_code", this.getOrder());
HttpResponse httpResponse = acsToWmsService.applyTaskToWms(reqParam);
if (httpResponse != null && httpResponse.getStatus() == 200) {
- requireSucess = true;
- return true;
+ JSONObject resp = JSONObject.parseObject(httpResponse.body());
+ if (resp.getInteger("status") == 200) {
+ requireSucess = true;
+ return true;
+ }
}
}
return false;
diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_packer_station/HailiangPackerStationDeviceDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_packer_station/HailiangPackerStationDeviceDriver.java
index 19fe3ac3..605f5eb4 100644
--- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_packer_station/HailiangPackerStationDeviceDriver.java
+++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_packer_station/HailiangPackerStationDeviceDriver.java
@@ -554,8 +554,11 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
reqParam.put("workorder_code", this.getOrder());
HttpResponse httpResponse = acsToWmsService.applyTaskToWms(reqParam);
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
- requireSucess = true;
- return true;
+ JSONObject resp = JSONObject.parseObject(httpResponse.body());
+ if (resp.getInteger("status") == 200) {
+ requireSucess = true;
+ return true;
+ }
}
}
return false;
@@ -596,8 +599,8 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
} else {
map.put("to_confirm_finished", "1");
}
- map.put("to_order", "0");
- map.put("to_clear", "1");
+ //map.put("to_order", "0");
+ //map.put("to_clear", "1");
this.writing(map);
}
diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_packer_station/ItemProtocol.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_packer_station/ItemProtocol.java
index 1ce6e654..be5d5cdd 100644
--- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_packer_station/ItemProtocol.java
+++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_packer_station/ItemProtocol.java
@@ -241,7 +241,7 @@ public class ItemProtocol {
list.add(new ItemDto(item_tap_close_pos, "阀门关定位", "DB1.B1.2"));
list.add(new ItemDto(item_agv_abutment_error, "AGV对接故障", "DB1.B1.3"));
list.add(new ItemDto(item_order_finish, "订单完成", "DB1.B1.5"));
- list.add(new ItemDto(item_mode, "工作模式", "DB1.B1.7"));
+ list.add(new ItemDto(item_mode, "工作模式", "DB1.B0.6"));
list.add(new ItemDto(item_lack_req, "请求料", "DB1.B2.0"));
list.add(new ItemDto(item_hopper_already, "料斗已经到位", "DB1.B2.1"));
list.add(new ItemDto(item_req_task_empty, "请求取空料斗", "DB1.B2.6"));
diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_device/HailiangSpecialDeviceDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_device/HailiangSpecialDeviceDriver.java
index 118384b7..3cf26c5e 100644
--- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_device/HailiangSpecialDeviceDriver.java
+++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_device/HailiangSpecialDeviceDriver.java
@@ -294,8 +294,8 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
} else {
map.put("to_confirm_finished", "1");
}
- map.put("to_order", "0");
- map.put("to_clear", "1");
+ //map.put("to_order", "0");
+ //map.put("to_clear", "1");
this.writing(map);
}
diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_empty_station/HailiangSpecialEmptyStationDeviceDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_empty_station/HailiangSpecialEmptyStationDeviceDriver.java
index 012dbbbf..c58ba371 100644
--- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_empty_station/HailiangSpecialEmptyStationDeviceDriver.java
+++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_empty_station/HailiangSpecialEmptyStationDeviceDriver.java
@@ -146,12 +146,12 @@ public class HailiangSpecialEmptyStationDeviceDriver extends AbstractOpcDeviceDr
message = "未联机";
//有报警
} else {
- this.setIsonline(true);
+ //this.setIsonline(true);
this.setIserror(false);
message = "";
//请求放空箱
if (agvphase == 0x13 || agvphase == 0x17) {
- if (mode == 1 /*&& move == 1*/ && ObjectUtil.isNotEmpty(inst)) {
+ if (mode == 1 && move == 1 && ObjectUtil.isNotEmpty(inst)) {
writing("to_agv_ready", "1");
inst.setExecute_status(InstActionEnum.EXECUTE_TO_PUT_EMPTY.getCode());
instructionService.update(inst);
@@ -177,8 +177,7 @@ public class HailiangSpecialEmptyStationDeviceDriver extends AbstractOpcDeviceDr
}
//放空箱完成
if (agvphase == 0x15 || agvphase == 0x19) {
- if (mode == 1 /*&& move == 0*/ && ObjectUtil.isNotEmpty(inst)) {
-// writing("to_agv_finish", "1");
+ if (mode == 1 && move == 0 && ObjectUtil.isNotEmpty(inst)) {
inst.setExecute_status(InstActionEnum.EXECUTE_PUT_EMPTY_FINISH.getCode());
instructionService.update(inst);
byte[] data = agvService.sendAgvTwoModeInst(agvphase, index, 0);
diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_full_station/HailiangSpecialFullStationDeviceDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_full_station/HailiangSpecialFullStationDeviceDriver.java
index dcaa3141..961b4625 100644
--- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_full_station/HailiangSpecialFullStationDeviceDriver.java
+++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_full_station/HailiangSpecialFullStationDeviceDriver.java
@@ -169,7 +169,7 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri
message = "未联机";
//有报警
} else {
- this.setIsonline(true);
+ //this.setIsonline(true);
this.setIserror(false);
message = "";
@@ -198,7 +198,7 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri
//agv到达取货点
if (agvphase == 0x03 || agvphase == 0x07) {
- if (mode == 1/* && move == 1 && full_number > 0*/ && ObjectUtil.isNotEmpty(inst)) {
+ if (mode == 1 && move == 1 && full_number > 0 && ObjectUtil.isNotEmpty(inst)) {
//下发取货位agv取货就绪
this.writing("to_agv_ready", "1");
inst.setExecute_status(InstActionEnum.EXECUTE_TO_GET.getCode());
@@ -229,7 +229,7 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri
//agv取货完成
if (agvphase == 0x05 || agvphase == 0x09) {
- if (mode == 1 /*&& move == 0 */ && ObjectUtil.isNotEmpty(inst)) {
+ if (mode == 1 && move == 0 && ObjectUtil.isNotEmpty(inst)) {
this.writing("to_agv_finish", "1");
inst.setExecute_status(InstActionEnum.EXECUTE_GET_FINISH.getCode());
instructionService.update(inst);
@@ -286,8 +286,11 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri
reqParam.put("workorder_code", this.getOrder());
HttpResponse httpResponse = acsToWmsService.applyTaskToWms(reqParam);
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
- requireSucess = true;
- return true;
+ JSONObject resp = JSONObject.parseObject(httpResponse.body());
+ if (resp.getInteger("status") == 200) {
+ requireSucess = true;
+ return true;
+ }
}
}
return false;
@@ -330,6 +333,6 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri
public void setDeviceStatus(JSONObject data) {
Boolean requireSucess = data.getBoolean("requireSucess");
if (ObjectUtil.isNotEmpty(requireSucess))
- this.requireSucess = requireSucess;
+ this.requireSucess = requireSucess;
}
}
diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pick_station/HailiangSpecialPickStationDeviceDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pick_station/HailiangSpecialPickStationDeviceDriver.java
index 9ce06a55..d0d09503 100644
--- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pick_station/HailiangSpecialPickStationDeviceDriver.java
+++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pick_station/HailiangSpecialPickStationDeviceDriver.java
@@ -37,12 +37,12 @@ public class HailiangSpecialPickStationDeviceDriver extends AbstractOpcDeviceDri
int mode = 0;
int error = 0;
int order = 0;
- int now_one_prod_num = 0;
+ int now_one_box_num = 0;
int last_mode = 0;
int last_error = 0;
int last_order = 0;
- int last_now_one_prod_num = 0;
+ int last_now_one_box_num = 0;
Boolean isonline = true;
Boolean last_isonline = true;
@@ -71,7 +71,7 @@ public class HailiangSpecialPickStationDeviceDriver extends AbstractOpcDeviceDri
device_code = this.getDeviceCode();
error = this.itemProtocol.getError();
mode = this.itemProtocol.getMode();
- now_one_prod_num = this.itemProtocol.getItem_now_one_box_num();
+ now_one_box_num = this.itemProtocol.getItem_now_one_box_num();
order = this.itemProtocol.getOrder();
isonline = this.itemProtocol.getIsonline();
@@ -81,8 +81,8 @@ public class HailiangSpecialPickStationDeviceDriver extends AbstractOpcDeviceDri
if (order != last_order) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号order:" + last_order + "->" + order);
}
- if (now_one_prod_num != last_now_one_prod_num) {
- logServer.deviceExecuteLog(this.device_code, "", "", "信号now_one_prod_num:" + last_now_one_prod_num + "->" + now_one_prod_num);
+ if (now_one_box_num != now_one_box_num) {
+ logServer.deviceExecuteLog(this.device_code, "", "", "信号now_one_box_num:" + last_now_one_box_num + "->" + now_one_box_num);
}
if (error != last_error) {
if (error != 0) {
@@ -110,13 +110,8 @@ public class HailiangSpecialPickStationDeviceDriver extends AbstractOpcDeviceDri
//this.setIserror(true);
message = "未联机";
//有报警
- } else if (error != 0) {
- //this.setIsonline(false);
- //this.setIserror(true);
- message = "有报警";
- //无报警
} else {
- this.setIsonline(true);
+ // this.setIsonline(true);
this.setIserror(false);
message = "";
@@ -124,7 +119,7 @@ public class HailiangSpecialPickStationDeviceDriver extends AbstractOpcDeviceDri
last_mode = mode;
last_error = error;
last_order = order;
- last_now_one_prod_num = now_one_prod_num;
+ last_now_one_box_num = now_one_box_num;
}
@@ -132,6 +127,7 @@ public class HailiangSpecialPickStationDeviceDriver extends AbstractOpcDeviceDri
public JSONObject getDeviceStatusName() throws Exception {
JSONObject jo = new JSONObject();
jo.put("device_name", this.getDevice().getDevice_name());
+ jo.put("now_one_box_num", now_one_box_num);
jo.put("isOnline", this.itemProtocol.getIsonline());
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("driver_type", "hailiang_special_pick_station");
diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pick_station/ItemProtocol.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pick_station/ItemProtocol.java
index 43256fb6..37e937ae 100644
--- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pick_station/ItemProtocol.java
+++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pick_station/ItemProtocol.java
@@ -14,7 +14,7 @@ public class ItemProtocol {
public static String item_heartbeat = "heartbeat";
public static String item_mode = "mode";
public static String item_error = "error";
- public static String item_now_one_box_num = "now_one_prod_num";
+ public static String item_now_one_box_num = "now_one_box_num";
public static String item_order = "order";
diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pour_station/HailiangSpecialPourStationDeviceDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pour_station/HailiangSpecialPourStationDeviceDriver.java
index 475f94d3..1e932a86 100644
--- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pour_station/HailiangSpecialPourStationDeviceDriver.java
+++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pour_station/HailiangSpecialPourStationDeviceDriver.java
@@ -135,7 +135,7 @@ public class HailiangSpecialPourStationDeviceDriver extends AbstractOpcDeviceDri
if (order > 0 && this.itemProtocol.getIsonline() && ObjectUtil.isNotEmpty(this.getDevice().getExtraValue().get("link_device_code"))) {
MonitoringLargeScreenData.deviceNumData.put(this.getDevice().getExtraValue().get("link_device_code").toString(), this.getStorage_stock_num());
}
- if (storage_stock_num == Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num"))) && Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num"))) != -1) {
+ if (ObjectUtil.isNotEmpty(this.getDevice().getExtraValue().get("min_num")) && storage_stock_num == Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num"))) && Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num"))) != -1) {
requireSucess = false;
}
logServer.deviceExecuteLog(this.device_code, "", "", "信号storage_stock_num:" + last_storage_stock_num + "->" + storage_stock_num);
@@ -162,14 +162,14 @@ public class HailiangSpecialPourStationDeviceDriver extends AbstractOpcDeviceDri
message = "";
//倒料位满足联机,剩余数量小于最小数量申请缓存线出库任务
- if (mode == 1 && !requireSucess && Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num"))) >= storage_stock_num && Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num"))) != 0) {
+ if (mode == 1 && !requireSucess && ObjectUtil.isNotEmpty(this.getDevice().getExtraValue().get("min_num")) && Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num"))) >= storage_stock_num && Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num"))) != -1) {
boolean flag = applyOutCacheLineTask();
this.noApplyTaskMessage = null;
if (flag) {
this.message = "申请缓存线任务成功";
}
} else {
- if (Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num"))) >= storage_stock_num) {
+ if (ObjectUtil.isNotEmpty(this.getDevice().getExtraValue().get("min_num")) && Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num"))) >= storage_stock_num) {
String notApplyTaskMessage = "";
if (mode != 1) {
notApplyTaskMessage += "设备未联机,";
@@ -256,8 +256,15 @@ public class HailiangSpecialPourStationDeviceDriver extends AbstractOpcDeviceDri
reqParam.put("workorder_code", this.getOrder());
HttpResponse httpResponse = acsToWmsService.applyTaskToWms(reqParam);
if (httpResponse != null && httpResponse.getStatus() == 200) {
- requireSucess = true;
- return true;
+ JSONObject resp = JSONObject.parseObject(httpResponse.body());
+ if (resp.getInteger("status") == 200) {
+ requireSucess = true;
+ return true;
+ } else {
+ message = "申请任务失败,原因:" + resp.getString("message");
+ }
+ } else {
+ message = "申请任务失败,原因:接口不通!";
}
}
return false;
diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_stacking_station/HailiangStackingStationDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_stacking_station/HailiangStackingStationDriver.java
index 4b2f864e..958d63a1 100644
--- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_stacking_station/HailiangStackingStationDriver.java
+++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_stacking_station/HailiangStackingStationDriver.java
@@ -50,62 +50,62 @@ public class HailiangStackingStationDriver extends AbstractOpcDeviceDriver imple
@Autowired
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
- //线体状态
+ int heartbeat = 0;
int mode = 0;
- int last_mode = 0;
- //线体开机状态
int line_power_status = 0;
- int last_line_power_status = 0;
- //线体就绪
+ int move = 0;
int line_ready = 0;
- int last_line_ready = 0;
- //所有设备就绪
int all_ready = 0;
- int last_all_ready = 0;
- //线体故障
- int line_error = 0;
- int last_line_error = 0;
- //巷道有货请求
- int lane_stock_req = 0;
- int last_lane_stock_req = 0;
- //订单完成
int finish = 0;
- int last_finish = 0;
- //巷道1托盘满托
- int lane1_tray_full = 0;
- int last_lane1_tray_full = 0;
- //巷道2托盘满托
- int lane2_tray_full = 0;
- int last_lane2_tray_full = 0;
- //巷道1托盘位允许放货
- int lane1_allow_put = 0;
- int last_lane1_allow_put = 0;
- //巷道2托盘位允许放货
- int lane2_allow_put = 0;
- int last_lane2_allow_put = 0;
- //巷道故障
+ int is_full_1 = 0;
+ int is_full_2 = 0;
+ int is_full_3 = 0;
+ int is_full_4 = 0;
+ int move_1 = 0;
+ int move_2 = 0;
+ int move_3 = 0;
+ int move_4 = 0;
+ int error = 0;
int lane_error = 0;
- int last_lane_error = 0;
- //巷道1号托盘当前码垛箱数
- int lane1_tray_current_num = 0;
- int last_lane1_tray_current_num = 0;
- //巷道2号托盘当前码垛箱数
- int lane2_tray_current_num = 0;
- int last_lane2_tray_current_num = 0;
- //巷道1号托盘模板
- int lane1_tray_template = 0;
- int last_lane1_tray_template = 0;
- //巷道2号托盘模板
- int lane2_tray_template = 0;
- int last_lane2_tray_template = 0;
- //订单实时
+ int pallet_num_1 = 0;
+ int pallet_num_2 = 0;
+ int pallet_num_3 = 0;
+ int pallet_num_4 = 0;
+ int material_1 = 0;
+ int material_2 = 0;
+ int material_3 = 0;
+ int material_4 = 0;
int order_now = 0;
- int last_order_now = 0;
- //托盘实时
int tray_now = 0;
- int last_tray_now = 0;
- //码盘巷道工单号
int order = 0;
+
+ int last_heartbeat = 0;
+ int last_mode = 0;
+ int last_line_power_status = 0;
+ int last_move = 0;
+ int last_line_ready = 0;
+ int last_all_ready = 0;
+ int last_finish = 0;
+ int last_is_full_1 = 0;
+ int last_is_full_2 = 0;
+ int last_is_full_3 = 0;
+ int last_is_full_4 = 0;
+ int last_move_1 = 0;
+ int last_move_2 = 0;
+ int last_move_3 = 0;
+ int last_move_4 = 0;
+ int last_error = 0;
+ int last_lane_error = 0;
+ int last_pallet_num_1 = 0;
+ int last_pallet_num_2 = 0;
+ int last_pallet_num_3 = 0;
+ int last_pallet_num_4 = 0;
+ int last_material_1 = 0;
+ int last_material_2 = 0;
+ int last_material_3 = 0;
+ int last_material_4 = 0;
+ int last_order_now = 0;
+ int last_tray_now = 0;
int last_order = 0;
@@ -133,25 +133,33 @@ public class HailiangStackingStationDriver extends AbstractOpcDeviceDriver imple
public void execute() {
try {
device_code = this.getDeviceCode();
- mode = this.itemProtocol.getMode();
- line_power_status = this.itemProtocol.getLine_power_status();
- line_ready = this.itemProtocol.getLine_ready();
- all_ready = this.itemProtocol.getAll_ready();
- line_error = this.itemProtocol.getLine_error();
- lane_stock_req = this.itemProtocol.getLane_stock_req();
- finish = this.itemProtocol.getFinish();
- lane1_tray_full = this.itemProtocol.getLane1_tray_full();
- lane2_tray_full = this.itemProtocol.getLane2_tray_full();
- lane1_allow_put = this.itemProtocol.getLane1_allow_put();
- lane2_allow_put = this.itemProtocol.getLane2_allow_put();
- lane_error = this.itemProtocol.getLane_error();
- lane1_tray_current_num = this.itemProtocol.getLane1_tray_current_num();
- lane2_tray_current_num = this.itemProtocol.getLane2_tray_current_num();
- lane1_tray_template = this.itemProtocol.getLane1_tray_template();
- lane2_tray_template = this.itemProtocol.getLane2_tray_template();
- order_now = this.itemProtocol.getOrder_now();
- tray_now = this.itemProtocol.getTray_now();
- order = this.itemProtocol.getOrder();
+ mode = this.itemProtocol.getItem_mode();
+ line_power_status = this.itemProtocol.getItem_line_power_status();
+ move = this.itemProtocol.getItem_move();
+ line_ready = this.itemProtocol.getItem_line_ready();
+ all_ready = this.itemProtocol.getItem_all_ready();
+ finish = this.itemProtocol.getItem_finish();
+ is_full_1 = this.itemProtocol.getItem_is_full_1();
+ is_full_2 = this.itemProtocol.getItem_is_full_2();
+ is_full_3 = this.itemProtocol.getItem_is_full_3();
+ is_full_4 = this.itemProtocol.getItem_is_full_4();
+ move_1 = this.itemProtocol.getItem_move_1();
+ move_2 = this.itemProtocol.getItem_move_2();
+ move_3 = this.itemProtocol.getItem_move_3();
+ move_4 = this.itemProtocol.getItem_move_4();
+ error = this.itemProtocol.getItem_error();
+ lane_error = this.itemProtocol.getItem_lane_error();
+ pallet_num_1 = this.itemProtocol.getItem_pallet_num_1();
+ pallet_num_2 = this.itemProtocol.getItem_pallet_num_2();
+ pallet_num_3 = this.itemProtocol.getItem_pallet_num_3();
+ pallet_num_4 = this.itemProtocol.getItem_pallet_num_4();
+ material_1 = this.itemProtocol.getItem_material_1();
+ material_2 = this.itemProtocol.getItem_material_2();
+ material_3 = this.itemProtocol.getItem_material_3();
+ material_4 = this.itemProtocol.getItem_material_4();
+ order_now = this.itemProtocol.getItem_order_now();
+ tray_now = this.itemProtocol.getItem_tray_now();
+ order = this.itemProtocol.getItem_order();
isonline = this.itemProtocol.getIsonline();
@@ -168,21 +176,19 @@ public class HailiangStackingStationDriver extends AbstractOpcDeviceDriver imple
if (all_ready != last_all_ready) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号all_ready:" + last_all_ready + "->" + all_ready);
}
- if (line_error != last_line_error) {
- if (line_error != 0) {
+ if (error != last_error) {
+ if (error != 0) {
DeviceErrorLogDto dto = new DeviceErrorLogDto();
dto.setDevice_code(device_code);
- dto.setError_code(String.valueOf(line_error));
- dto.setError_info(ErrorUtil.getDictDetail("stack_error_type", String.valueOf(line_error)));
+ dto.setError_code(String.valueOf(error));
+ dto.setError_info(ErrorUtil.getDictDetail("stack_error_type", String.valueOf(error)));
deviceErrorLogService.create(dto);
}
- if (line_error == 1 || line_error == 51) {
- feedDeviceStatusFlag = false;
- }
- logServer.deviceExecuteLog(this.device_code, "", "", "信号line_error:" + last_line_error + "->" + line_error);
+ feedDeviceStatusFlag = false;
+ logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error);
}
- if (lane_stock_req != last_lane_stock_req) {
- logServer.deviceExecuteLog(this.device_code, "", "", "信号lane_stock_req:" + last_lane_stock_req + "->" + lane_stock_req);
+ if (move != last_move) {
+ logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + last_move + "->" + move);
}
if (finish != last_finish) {
if (finish == 1) {
@@ -190,32 +196,56 @@ public class HailiangStackingStationDriver extends AbstractOpcDeviceDriver imple
}
logServer.deviceExecuteLog(this.device_code, "", "", "信号finish:" + last_finish + "->" + finish);
}
- if (lane1_tray_full != last_lane1_tray_full) {
- logServer.deviceExecuteLog(this.device_code, "", "", "信号lane1_tray_full:" + last_lane1_tray_full + "->" + lane1_tray_full);
+ if (is_full_1 != last_is_full_1) {
+ logServer.deviceExecuteLog(this.device_code, "", "", "信号is_full_1:" + last_is_full_1 + "->" + is_full_1);
}
- if (lane2_tray_full != last_lane2_tray_full) {
- logServer.deviceExecuteLog(this.device_code, "", "", "信号lane2_tray_full:" + last_lane2_tray_full + "->" + lane2_tray_full);
+ if (is_full_2 != last_is_full_2) {
+ logServer.deviceExecuteLog(this.device_code, "", "", "信号is_full_2:" + last_is_full_2 + "->" + is_full_2);
}
- if (lane1_allow_put != last_lane1_allow_put) {
- logServer.deviceExecuteLog(this.device_code, "", "", "信号lane1_allow_put:" + last_lane1_allow_put + "->" + lane1_allow_put);
+ if (is_full_3 != last_is_full_3) {
+ logServer.deviceExecuteLog(this.device_code, "", "", "信号is_full_3:" + last_is_full_3 + "->" + is_full_3);
}
- if (lane2_allow_put != last_lane2_allow_put) {
- logServer.deviceExecuteLog(this.device_code, "", "", "信号lane2_allow_put:" + last_lane2_allow_put + "->" + lane2_allow_put);
+ if (is_full_4 != last_is_full_4) {
+ logServer.deviceExecuteLog(this.device_code, "", "", "信号is_full_4:" + last_is_full_4 + "->" + is_full_4);
+ }
+ if (move_1 != last_move_1) {
+ logServer.deviceExecuteLog(this.device_code, "", "", "信号move_1:" + last_move_1 + "->" + move_1);
+ }
+ if (move_2 != last_move_2) {
+ logServer.deviceExecuteLog(this.device_code, "", "", "信号move_2:" + last_move_2 + "->" + move_2);
+ }
+ if (move_3 != last_move_3) {
+ logServer.deviceExecuteLog(this.device_code, "", "", "信号move_3:" + last_move_3 + "->" + move_3);
+ }
+ if (move_4 != last_move_4) {
+ logServer.deviceExecuteLog(this.device_code, "", "", "信号move_4:" + last_move_4 + "->" + move_4);
}
if (lane_error != last_lane_error) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号lane_error:" + last_lane_error + "->" + lane_error);
}
- if (lane1_tray_current_num != last_lane1_tray_current_num) {
- logServer.deviceExecuteLog(this.device_code, "", "", "信号lane1_tray_current_num:" + last_lane1_tray_current_num + "->" + lane1_tray_current_num);
+ if (pallet_num_1 != last_pallet_num_1) {
+ logServer.deviceExecuteLog(this.device_code, "", "", "信号pallet_num_1:" + last_pallet_num_1 + "->" + pallet_num_1);
}
- if (lane2_tray_current_num != last_lane2_tray_current_num) {
- logServer.deviceExecuteLog(this.device_code, "", "", "信号lane2_tray_current_num:" + last_lane2_tray_current_num + "->" + lane2_tray_current_num);
+ if (pallet_num_2 != last_pallet_num_2) {
+ logServer.deviceExecuteLog(this.device_code, "", "", "信号pallet_num_2:" + last_pallet_num_2 + "->" + pallet_num_2);
}
- if (lane1_tray_template != last_lane1_tray_template) {
- logServer.deviceExecuteLog(this.device_code, "", "", "信号lane1_tray_template:" + last_lane1_tray_template + "->" + lane1_tray_template);
+ if (pallet_num_3 != last_pallet_num_3) {
+ logServer.deviceExecuteLog(this.device_code, "", "", "信号pallet_num_3:" + last_pallet_num_3 + "->" + pallet_num_3);
}
- if (lane2_tray_template != last_lane2_tray_template) {
- logServer.deviceExecuteLog(this.device_code, "", "", "信号lane2_tray_template:" + last_lane2_tray_template + "->" + lane2_tray_template);
+ if (pallet_num_4 != last_pallet_num_4) {
+ logServer.deviceExecuteLog(this.device_code, "", "", "信号pallet_num_4:" + last_pallet_num_4 + "->" + pallet_num_4);
+ }
+ if (material_1 != last_material_1) {
+ logServer.deviceExecuteLog(this.device_code, "", "", "信号material_1:" + last_material_1 + "->" + material_1);
+ }
+ if (material_2 != last_material_2) {
+ logServer.deviceExecuteLog(this.device_code, "", "", "信号material_2:" + last_material_2 + "->" + material_2);
+ }
+ if (material_3 != last_material_3) {
+ logServer.deviceExecuteLog(this.device_code, "", "", "信号material_3:" + last_material_3 + "->" + material_3);
+ }
+ if (material_4 != last_material_4) {
+ logServer.deviceExecuteLog(this.device_code, "", "", "信号material_4:" + last_material_4 + "->" + material_4);
}
if (order_now != last_order_now) {
if (order > 0) {
@@ -244,13 +274,13 @@ public class HailiangStackingStationDriver extends AbstractOpcDeviceDriver imple
chm.put("error_code", "0");
acsToWmsService.feedDeviceStatusType(chm);
feedDeviceStatusFlag = true;
- } else if (this.itemProtocol.getIsonline() && (line_error == 1 || line_error == 51) && !feedDeviceStatusFlag) {
+ } else if (this.itemProtocol.getIsonline() && error != 0 && !feedDeviceStatusFlag) {
JSONObject chm = new JSONObject();
chm.put("device_code", this.getDevice_code());
//设备报警
chm.put("status_type", StatusEnum.DEVICE_STATUS_ERROR.getCode());
chm.put("start_time", DateUtil.now());
- chm.put("error_code", String.valueOf(line_error));
+ chm.put("error_code", String.valueOf(error));
acsToWmsService.feedDeviceStatusType(chm);
feedDeviceStatusFlag = true;
} else if (this.itemProtocol.getIsonline() && mode == 1 && order > 0 && !feedDeviceStatusFlag) {
@@ -325,24 +355,32 @@ public class HailiangStackingStationDriver extends AbstractOpcDeviceDriver imple
last_mode = mode;
last_line_power_status = line_power_status;
+ last_move = move;
last_line_ready = line_ready;
last_all_ready = all_ready;
- last_line_error = line_error;
- last_lane_stock_req = lane_stock_req;
last_finish = finish;
- last_lane1_tray_full = lane1_tray_full;
- last_lane2_tray_full = lane2_tray_full;
- last_lane1_allow_put = lane1_allow_put;
- last_lane2_allow_put = lane2_allow_put;
+ last_is_full_1 = is_full_1;
+ last_is_full_2 = is_full_2;
+ last_is_full_3 = is_full_3;
+ last_is_full_4 = is_full_4;
+ last_move_1 = move_1;
+ last_move_2 = move_2;
+ last_move_3 = move_3;
+ last_move_4 = move_4;
+ last_error = error;
last_lane_error = lane_error;
- last_lane1_tray_current_num = lane1_tray_current_num;
- last_lane2_tray_current_num = lane2_tray_current_num;
- last_lane1_tray_template = lane1_tray_template;
- last_lane2_tray_template = lane2_tray_template;
+ last_pallet_num_1 = pallet_num_1;
+ last_pallet_num_2 = pallet_num_2;
+ last_pallet_num_3 = pallet_num_3;
+ last_pallet_num_4 = pallet_num_4;
+ last_material_1 = material_1;
+ last_material_2 = material_2;
+ last_material_3 = material_3;
+ last_material_4 = material_4;
last_order_now = order_now;
last_tray_now = tray_now;
last_order = order;
- last_isonline = isonline;
+
}
@@ -382,7 +420,7 @@ public class HailiangStackingStationDriver extends AbstractOpcDeviceDriver imple
} else {
map.put("to_confirm_finished", "1");
}
- map.put("to_order", "0");
+ //map.put("to_order", "0");
this.writing(map);
}
@@ -401,23 +439,30 @@ public class HailiangStackingStationDriver extends AbstractOpcDeviceDriver imple
JSONObject jo = new JSONObject();
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode == 1 ? "联机" : "单机");
- jo.put("lane_stock_req", lane_stock_req == 1 ? "是" : "否");
- jo.put("finish", finish == 1 ? "是" : "否");
- jo.put("lane1_tray_full", lane1_tray_full == 1 ? "是" : "否");
- jo.put("lane2_tray_full", lane2_tray_full == 1 ? "是" : "否");
- jo.put("lane1_allow_put", lane1_allow_put == 1 ? "是" : "否");
- jo.put("lane2_allow_put", lane2_allow_put == 1 ? "是" : "否");
- jo.put("lane1_tray_current_num", lane1_tray_current_num);
- jo.put("lane2_tray_current_num", lane2_tray_current_num);
- jo.put("lane1_tray_template", lane1_tray_template);
- jo.put("lane2_tray_template", lane2_tray_template);
+ jo.put("move", move == 1 ? "是" : "否");
+ jo.put("order_finish", finish == 1 ? "是" : "否");
+ jo.put("is_full_1", is_full_1 == 1 ? "是" : "否");
+ jo.put("is_full_2", is_full_2 == 1 ? "是" : "否");
+ jo.put("is_full_3", is_full_3 == 1 ? "是" : "否");
+ jo.put("is_full_4", is_full_4 == 1 ? "是" : "否");
+ jo.put("move_1", move_1 == 1 ? "是" : "否");
+ jo.put("move_2", move_2 == 1 ? "是" : "否");
+ jo.put("move_3", move_3 == 1 ? "是" : "否");
+ jo.put("move_4", move_4 == 1 ? "是" : "否");
+ jo.put("pallet_num_1", pallet_num_1);
+ jo.put("pallet_num_2", pallet_num_2);
+ jo.put("pallet_num_3", pallet_num_3);
+ jo.put("pallet_num_4", pallet_num_4);
+ jo.put("material_1", material_1);
+ jo.put("material_2", material_2);
+ jo.put("material_3", material_3);
+ jo.put("material_4", material_4);
jo.put("order_now", order_now);
jo.put("tray_now", tray_now);
jo.put("order", order);
- jo.put("error", ErrorUtil.getDictDetail("stack_error_type", String.valueOf(line_error)));
- jo.put("lane_error", ErrorUtil.getDictDetail("stack_error_type", String.valueOf(lane_error)));
+ jo.put("error", ErrorUtil.getDictDetail("stack_error_type", String.valueOf(error)));
jo.put("isOnline", this.itemProtocol.getIsonline());
- jo.put("isError", (this.getLane_error() != 0 || this.getLine_error() != 0) ? true : false);
+ jo.put("isError", error != 0 ? true : false);
jo.put("message", this.getMessage());
jo.put("driver_type", "hailiang_stacking_station");
return jo;
diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_stacking_station/ItemProtocol.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_stacking_station/ItemProtocol.java
index faed7940..50c55829 100644
--- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_stacking_station/ItemProtocol.java
+++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_stacking_station/ItemProtocol.java
@@ -11,74 +11,97 @@ import java.util.List;
@Data
public class ItemProtocol {
- //线体状态
+ //心跳
+ public static String item_heartbeat = "heartbeat";
+ //线体手自动||工作模式
public static String item_mode = "mode";
//线体开机状态
public static String item_line_power_status = "line_power_status";
+ //1、2#线有箱就绪,请求机械手
+ public static String item_move = "move";
//线体就绪
public static String item_line_ready = "line_ready";
//所有设备就绪
public static String item_all_ready = "all_ready";
- //线体故障
- public static String item_line_error = "line_error";
- //巷道有货请求
- public static String item_lane_stock_req = "lane_stock_req";
- //订单完成
+ //1、2#订单完成
public static String item_finish = "finish";
- //巷道1托盘满托
- public static String item_lane1_tray_full = "lane1_tray_full";
- //巷道2托盘满托
- public static String item_lane2_tray_full = "lane2_tray_full";
- //巷道1托盘位允许放货
- public static String item_lane1_allow_put = "lane1_allow_put";
- //巷道2托盘位允许放货
- public static String item_lane2_allow_put = "lane2_allow_put";
- //巷道故障
+ //1托盘是否满托
+ public static String item_is_full_1 = "is_full_1";
+ //2托盘是否满托
+ public static String item_is_full_2 = "is_full_2";
+ //3托盘是否满托
+ public static String item_is_full_3 = "is_full_3";
+ //4托盘是否满托
+ public static String item_is_full_4 = "is_full_4";
+ //1#托盘位置是否有托盘
+ public static String item_move_1 = "move_1";
+ //2#托盘位置是否有托盘
+ public static String item_move_2 = "move_2";
+ //3#托盘位置是否有托盘
+ public static String item_move_3 = "move_3";
+ //4#托盘位置是否有托盘
+ public static String item_move_4 = "move_4";
+ //线体故障信息
+ public static String item_error = "error";
+ //1、2#巷道故障信息
public static String item_lane_error = "lane_error";
- //巷道1号托盘当前码垛箱数
- public static String item_lane1_tray_current_num = "lane1_tray_current_num";
- //巷道2号托盘当前码垛箱数
- public static String item_lane2_tray_current_num = "lane2_tray_current_num";
- //巷道1号托盘模板
- public static String item_lane1_tray_template = "lane1_tray_template";
- //巷道2号托盘模板
- public static String item_lane2_tray_template = "lane2_tray_template";
- //订单实时
+ //1#托盘当前码垛箱数
+ public static String item_pallet_num_1 = "pallet_num_1";
+ //2#托盘当前码垛箱数
+ public static String item_pallet_num_2 = "pallet_num_2";
+ //3#托盘当前码垛箱数
+ public static String item_pallet_num_3 = "pallet_num_3";
+ //4#托盘当前码垛箱数
+ public static String item_pallet_num_4 = "pallet_num_4";
+ //1#托盘物料信息
+ public static String item_material_1 = "material_1";
+ //2#托盘物料信息
+ public static String item_material_2 = "material_2";
+ //3#托盘物料信息
+ public static String item_material_3 = "material_3";
+ //4#托盘物料信息
+ public static String item_material_4 = "material_4";
+ //1、2#当前生产总量(订单实时)
public static String item_order_now = "order_now";
- //托盘实时
+ //1、2#当前托盘总数(实时)
public static String item_tray_now = "tray_now";
- //码盘巷道工单号
+ //1、2#工单号
public static String item_order = "order";
-
//设备开关
public static String item_to_open = "to_open";
- //码盘信息
+ //机械手启动开关
+ public static String item_to_open_pulator = "to_open_pulator";
+ //1、2 码盘信息模板号
public static String item_to_tray_info = "to_tray_info";
- //当前产量清零
+ //1、2当前产量清零
public static String item_to_clear = "to_clear";
- //确认完成(订单完成状态置零)
+ //1、2确认完成(订单完成状态置零)
public static String item_to_confirm_finished = "to_confirm_finished";
- //巷道箱子长
+ //1、2巷道箱子长
public static String item_to_lane_box_l = "to_lane_box_l";
- //巷道箱子宽
+ //1、2巷道箱子宽
public static String item_to_lane_box_w = "to_lane_box_w";
- //巷道箱子高
+ //1、2巷道道箱子高
public static String item_to_lane_box_h = "to_lane_box_h";
//巷道1号托盘强制满托
public static String item_to_lane1_tray_compel_full = "to_lane1_tray_compel_full";
//巷道2号托盘强制满托
public static String item_to_lane2_tray_compel_full = "to_lane2_tray_compel_full";
- //巷道禁用
+ //巷道3号托盘强制满托
+ public static String item_to_lane3_tray_compel_full = "to_lane3_tray_compel_full";
+ //巷道4号托盘强制满托
+ public static String item_to_lane4_tray_compel_full = "to_lane4_tray_compel_full";
+ //1、2巷道禁用
public static String item_to_lane_off = "to_lane_off";
- //工单强制完成
+ //1、2工单强制完成
public static String item_to_compel_finish = "to_compel_finish";
- //订单生产总量
+ //1、2订单生产总量
public static String item_to_order_prod_num = "to_order_prod_num";
- //托盘总量
+ //1、2订单需托盘总数
public static String item_to_tray_num = "to_tray_num";
- //工单号
+ //1、2工单号
public static String item_to_order = "to_order";
@@ -88,61 +111,89 @@ public class ItemProtocol {
this.driver = driver;
}
- public int getMode() {
+
+ public int getItem_heartbeat() {
+ return this.getOpcIntegerValue(item_heartbeat);
+ }
+ public int getItem_mode() {
return this.getOpcIntegerValue(item_mode);
}
- public int getLine_power_status() {
+ public int getItem_line_power_status() {
return this.getOpcIntegerValue(item_line_power_status);
}
- public int getLine_ready () {
+ public int getItem_move() {
+ return this.getOpcIntegerValue(item_move);
+ }
+ public int getItem_line_ready() {
return this.getOpcIntegerValue(item_line_ready);
}
- public int getAll_ready() {
+ public int getItem_all_ready() {
return this.getOpcIntegerValue(item_all_ready);
}
- public int getLine_error() {
- return this.getOpcIntegerValue(item_line_error);
- }
- public int getLane_stock_req() {
- return this.getOpcIntegerValue(item_lane_stock_req);
- }
- public int getFinish() {
+ public int getItem_finish() {
return this.getOpcIntegerValue(item_finish);
}
- public int getLane1_tray_full () {
- return this.getOpcIntegerValue(item_lane1_tray_full);
+ public int getItem_is_full_1() {
+ return this.getOpcIntegerValue(item_is_full_1);
}
- public int getLane2_tray_full () {
- return this.getOpcIntegerValue(item_lane2_tray_full);
+ public int getItem_is_full_2() {
+ return this.getOpcIntegerValue(item_is_full_2);
}
- public int getLane1_allow_put() {
- return this.getOpcIntegerValue(item_lane1_allow_put);
+ public int getItem_is_full_3() {
+ return this.getOpcIntegerValue(item_is_full_3);
}
- public int getLane2_allow_put() {
- return this.getOpcIntegerValue(item_lane2_allow_put);
+ public int getItem_is_full_4() {
+ return this.getOpcIntegerValue(item_is_full_4);
}
- public int getLane_error() {
+ public int getItem_move_1() {
+ return this.getOpcIntegerValue(item_move_1);
+ }
+ public int getItem_move_2() {
+ return this.getOpcIntegerValue(item_move_2);
+ }
+ public int getItem_move_3() {
+ return this.getOpcIntegerValue(item_move_3);
+ }
+ public int getItem_move_4() {
+ return this.getOpcIntegerValue(item_move_4);
+ }
+ public int getItem_error() {
+ return this.getOpcIntegerValue(item_error);
+ }
+ public int getItem_lane_error() {
return this.getOpcIntegerValue(item_lane_error);
}
- public int getLane1_tray_current_num() {
- return this.getOpcIntegerValue(item_lane1_tray_current_num);
+ public int getItem_pallet_num_1() {
+ return this.getOpcIntegerValue(item_pallet_num_1);
}
- public int getLane2_tray_current_num () {
- return this.getOpcIntegerValue(item_lane2_tray_current_num);
+ public int getItem_pallet_num_2() {
+ return this.getOpcIntegerValue(item_pallet_num_2);
}
- public int getLane1_tray_template() {
- return this.getOpcIntegerValue(item_lane1_tray_template);
+ public int getItem_pallet_num_3() {
+ return this.getOpcIntegerValue(item_pallet_num_3);
}
- public int getLane2_tray_template() {
- return this.getOpcIntegerValue(item_lane2_tray_template);
+ public int getItem_pallet_num_4() {
+ return this.getOpcIntegerValue(item_pallet_num_4);
}
- public int getOrder_now() {
+ public int getItem_material_1() {
+ return this.getOpcIntegerValue(item_material_1);
+ }
+ public int getItem_material_2() {
+ return this.getOpcIntegerValue(item_material_2);
+ }
+ public int getItem_material_3() {
+ return this.getOpcIntegerValue(item_material_3);
+ }
+ public int getItem_material_4() {
+ return this.getOpcIntegerValue(item_material_4);
+ }
+ public int getItem_order_now() {
return this.getOpcIntegerValue(item_order_now);
}
- public int getTray_now() {
+ public int getItem_tray_now() {
return this.getOpcIntegerValue(item_tray_now);
}
- public int getOrder() {
+ public int getItem_order() {
return this.getOpcIntegerValue(item_order);
}
@@ -183,24 +234,33 @@ public class ItemProtocol {
public static List getReadableItemDtos() {
ArrayList list = new ArrayList();
- list.add(new ItemDto(item_mode, "线体状态", "DB1.B0.0"));
+ list.add(new ItemDto(item_heartbeat, "心跳", "DB1.W82"));
+ list.add(new ItemDto(item_mode, "工作模式", "DB1.B0.0"));
list.add(new ItemDto(item_line_power_status, "线体开机状态", "DB1.B0.1"));
+ list.add(new ItemDto(item_move, "光电信号", "DB1.B1.1"));
list.add(new ItemDto(item_line_ready, "线体就绪", "DB1.B2.1"));
list.add(new ItemDto(item_all_ready, "所有设备就绪", "DB1.B2.2"));
- list.add(new ItemDto(item_line_error, "线体故障", "DB1.W4"));
- list.add(new ItemDto(item_lane_stock_req, "巷道有货请求", "DB1.B1.1"));
- list.add(new ItemDto(item_finish, "订单完成", "DB1.B2.3"));
- list.add(new ItemDto(item_lane1_tray_full, "巷道1号托盘满托", "DB1.B2.5"));
- list.add(new ItemDto(item_lane2_tray_full, "巷道2号托盘满托", "DB1.B2.6"));
- list.add(new ItemDto(item_lane1_allow_put, "巷道1号托盘位允许放货", "DB1.B3.1"));
- list.add(new ItemDto(item_lane2_allow_put, "巷道2号托盘位允许放货", "DB1.B3.2"));
- list.add(new ItemDto(item_lane_error, "巷道error", "DB1.W10"));
- list.add(new ItemDto(item_lane1_tray_current_num, "巷道1号托盘当前码垛箱数", "DB1.W64"));
- list.add(new ItemDto(item_lane2_tray_current_num, "巷道2号托盘当前码垛箱数", "DB1.W66"));
- list.add(new ItemDto(item_lane1_tray_template, "巷道1号托盘模板", "DB1.W72"));
- list.add(new ItemDto(item_lane2_tray_template, "巷道2号托盘模板", "DB1.D74"));
- list.add(new ItemDto(item_order_now, "订单实时", "DB1.D84"));
- list.add(new ItemDto(item_tray_now, "托盘实时", "DB1.D88"));
+ list.add(new ItemDto(item_finish, "工单完成", "DB1.B2.3"));
+ list.add(new ItemDto(item_is_full_1, "托盘1是否满托", "DB1.B2.5"));
+ list.add(new ItemDto(item_is_full_2, "托盘2是否满托", "DB1.B2.6"));
+ list.add(new ItemDto(item_is_full_3, "托盘3是否满托", "DB1.B2.7"));
+ list.add(new ItemDto(item_is_full_4, "托盘4是否满托", "DB1.B3.0"));
+ list.add(new ItemDto(item_move_1, "托盘1光电信号", "DB1.B3.1"));
+ list.add(new ItemDto(item_move_2, "托盘2光电信号", "DB1.B3.2"));
+ list.add(new ItemDto(item_move_3, "托盘3光电信号", "DB1.B3.3"));
+ list.add(new ItemDto(item_move_4, "托盘4光电信号", "DB1.B3.4"));
+ list.add(new ItemDto(item_error, "故障信息", "DB1.W4"));
+ list.add(new ItemDto(item_lane_error, "巷道故障", "DB1.W10"));
+ list.add(new ItemDto(item_pallet_num_1, "托盘1当前码垛箱数", "DB1.W64"));
+ list.add(new ItemDto(item_pallet_num_2, "托盘2当前码垛箱数", "DB1.W66"));
+ list.add(new ItemDto(item_pallet_num_3, "托盘3当前码垛箱数", "DB1.W68"));
+ list.add(new ItemDto(item_pallet_num_4, "托盘4当前码垛箱数", "DB1.W70"));
+ list.add(new ItemDto(item_material_1, "托盘1物料信息", "DB1.W72"));
+ list.add(new ItemDto(item_material_2, "托盘2物料信息", "DB1.W74"));
+ list.add(new ItemDto(item_material_3, "托盘3物料信息", "DB1.W76"));
+ list.add(new ItemDto(item_material_4, "托盘4物料信息", "DB1.W78"));
+ list.add(new ItemDto(item_order_now, "当前生产总量(订单实时)", "DB1.D84"));
+ list.add(new ItemDto(item_tray_now, "当前托盘总数(实时)", "DB1.D88"));
list.add(new ItemDto(item_order, "工单号", "DB1.D156"));
return list;
}
@@ -208,15 +268,18 @@ public class ItemProtocol {
public static List getWriteableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_to_open, "设备开关", "DB2.W4"));
- list.add(new ItemDto(item_to_tray_info, "码盘信息", "DB2.W12"));
+ list.add(new ItemDto(item_to_open_pulator, "机械手开关", "DB2.W10"));
+ list.add(new ItemDto(item_to_tray_info, "码盘信息(模板号)", "DB2.W12"));
list.add(new ItemDto(item_to_clear, "当前产量清零", "DB2.W16"));
list.add(new ItemDto(item_to_confirm_finished, "订单确认完成", "DB2.W20"));
list.add(new ItemDto(item_to_lane_box_l, "巷道箱子长", "DB2.W28"));
list.add(new ItemDto(item_to_lane_box_w, "巷道箱子宽", "DB2.W30"));
list.add(new ItemDto(item_to_lane_box_h, "巷道箱子高", "DB2.W32"));
- list.add(new ItemDto(item_to_lane1_tray_compel_full, "巷道1号托盘强制满托", "DB2.W40"));
- list.add(new ItemDto(item_to_lane2_tray_compel_full, "巷道2号托盘强制满托", "DB2.W42"));
- list.add(new ItemDto(item_to_lane_off, "巷道禁用", "DB2.W48"));
+ list.add(new ItemDto(item_to_lane1_tray_compel_full, "托盘1强制满托", "DB2.W40"));
+ list.add(new ItemDto(item_to_lane2_tray_compel_full, "托盘2强制满托", "DB2.W42"));
+ list.add(new ItemDto(item_to_lane3_tray_compel_full, "托盘3强制满托", "DB2.W44"));
+ list.add(new ItemDto(item_to_lane4_tray_compel_full, "托盘4强制满托", "DB2.W46"));
+ list.add(new ItemDto(item_to_lane_off, "巷道暂停", "DB2.W48"));
list.add(new ItemDto(item_to_compel_finish, "工单强制完成", "DB2.W80"));
list.add(new ItemDto(item_to_order_prod_num, "订单生产总量", "DB2.D84"));
list.add(new ItemDto(item_to_tray_num, "托盘总量", "DB2.D88"));
diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_unboxing_machine/UnboxingMachineDeviceDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_unboxing_machine/UnboxingMachineDeviceDriver.java
index 2f7753b8..12ec8c05 100644
--- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_unboxing_machine/UnboxingMachineDeviceDriver.java
+++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_unboxing_machine/UnboxingMachineDeviceDriver.java
@@ -11,7 +11,9 @@ import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.basedriver.hailiang_one.IssuedDeviceOrderInfo;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
+import org.nl.acs.history.ErrorUtil;
import org.nl.acs.history.service.DeviceErrorLogService;
+import org.nl.acs.history.service.dto.DeviceErrorLogDto;
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.log.service.DeviceExecuteLogService;
@@ -121,6 +123,13 @@ public class UnboxingMachineDeviceDriver extends AbstractOpcDeviceDriver impleme
logServer.deviceExecuteLog(this.device_code, "", "", "信号order_compel_finish:" + last_order_compel_finish + "->" + order_compel_finish + "复位请求标记");
}
if (error != last_error) {
+ if (error != 0) {
+ DeviceErrorLogDto dto = new DeviceErrorLogDto();
+ dto.setDevice_code(device_code);
+ dto.setError_code(String.valueOf(error));
+ dto.setError_info(ErrorUtil.getDictDetail("unbox_error_type", String.valueOf(error)));
+ deviceErrorLogService.create(dto);
+ }
logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error + "复位请求标记");
}
if (now_order_num != last_now_order_num) {
@@ -166,6 +175,13 @@ public class UnboxingMachineDeviceDriver extends AbstractOpcDeviceDriver impleme
public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject();
jo.put("device_name", this.getDevice().getDevice_name());
+ jo.put("mode", mode == 1 ? "联机" : "未联机");
+ jo.put("order_finish", order_finish == 1 ? "是" : "否");
+ jo.put("order_compel_finish", order_compel_finish == 1 ? "是" : "否");
+ jo.put("error", ErrorUtil.getDictDetail("unbox_error_type", String.valueOf(error)));
+ jo.put("now_order_num", now_order_num);
+ jo.put("task", task);
+ jo.put("order", order);
jo.put("isOnline", this.itemProtocol.getIsonline());
return jo;
}