From 1451500dbf72e064b5cccb7af62702b8b873acb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=B1=9F=E7=8E=AE?= Date: Wed, 22 Feb 2023 17:30:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../acs/agv/server/impl/AgvServiceImpl.java | 2 +- .../agv/server/impl/MagicAgvServiceImpl.java | 4 +- .../agv/server/impl/NDCAgvServiceImpl.java | 2 +- .../server/impl/XianGongAgvServiceImpl.java | 6 +- .../device/device_driver/DriverTypeEnum.java | 6 +- .../service/impl/DeviceServiceImpl.java | 2 +- .../modbus_autodoor/ItemProtocol.java | 69 +++ .../ModbusAutodoorDefination.java | 71 +++ .../ModbusAutodoorDeviceDriver.java | 163 ++++++ .../standard_autodoor/ItemProtocol.java | 2 +- .../StandardAutodoorDefination.java | 2 +- .../StandardAutodoorDeviceDriver.java | 2 +- .../modbus_inspect_site/ItemProtocol.java | 106 ++++ .../ModbusInspectSiteDefination.java | 74 +++ .../ModbusInspectSiteDeviceDriver.java | 455 ++++++++++++++++ .../standard_inspect_site/ItemProtocol.java | 2 +- .../StandardInspectSiteDefination.java | 2 +- .../StandardInspectSiteDeviceDriver.java | 2 +- .../LampThreecolorDeviceDriver.java | 2 +- .../StandardOrdinarySiteDeviceDriver.java | 2 +- .../wms/service/impl/WmsToAcsServiceImpl.java | 2 +- .../service/impl/InstructionServiceImpl.java | 2 +- .../task/service/impl/TaskServiceImpl.java | 3 +- .../service/impl/StageServiceImpl.java | 4 +- .../modules/quartz/task/AutoCreateInst.java | 2 +- acs/qd/src/views/acs/device/config.vue | 4 +- .../acs/device/driver/modbus_autodoor.vue | 352 +++++++++++++ .../acs/device/driver/modbus_inspect_site.vue | 490 ++++++++++++++++++ .../org/nl/wms/pad/rest/PadController.java | 16 +- .../org/nl/wms/pad/service/PadService.java | 5 +- .../wms/pad/service/impl/PadServiceImpl.java | 13 +- .../src/main/java/org/nl/wms/pad/wql/PAD.wql | 12 +- .../org/nl/wms/sch/rest/PointController.java | 4 +- .../org/nl/wms/sch/service/PointService.java | 11 +- .../org/nl/wms/sch/service/dto/PointDto.java | 5 - .../sch/service/impl/PointServiceImpl.java | 194 ++++--- .../wms/sch/service/wql/QSCH_BASE_POINT.wql | 3 - .../java/org/nl/wms/sch/service/wql/sch.xls | Bin 178176 -> 214528 bytes .../java/org/nl/wms/sch/tasks/CallTask.java | 43 +- .../java/org/nl/wms/sch/tasks/SendTask.java | 32 +- .../java/org/nl/wms/sch/wql/SEND_TASK.wql | 28 +- .../src/test/java/org/nl/PointTest.java | 77 +-- lms/qd/src/views/wms/sch/point/index.vue | 49 +- 43 files changed, 2080 insertions(+), 247 deletions(-) create mode 100644 acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/autodoor/modbus_autodoor/ItemProtocol.java create mode 100644 acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/autodoor/modbus_autodoor/ModbusAutodoorDefination.java create mode 100644 acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/autodoor/modbus_autodoor/ModbusAutodoorDeviceDriver.java rename acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/{ => autodoor}/standard_autodoor/ItemProtocol.java (96%) rename acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/{ => autodoor}/standard_autodoor/StandardAutodoorDefination.java (97%) rename acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/{ => autodoor}/standard_autodoor/StandardAutodoorDeviceDriver.java (98%) create mode 100644 acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/inspect_site/modbus_inspect_site/ItemProtocol.java create mode 100644 acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/inspect_site/modbus_inspect_site/ModbusInspectSiteDefination.java create mode 100644 acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/inspect_site/modbus_inspect_site/ModbusInspectSiteDeviceDriver.java rename acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/{ => inspect_site}/standard_inspect_site/ItemProtocol.java (97%) rename acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/{ => inspect_site}/standard_inspect_site/StandardInspectSiteDefination.java (96%) rename acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/{ => inspect_site}/standard_inspect_site/StandardInspectSiteDeviceDriver.java (99%) create mode 100644 acs/qd/src/views/acs/device/driver/modbus_autodoor.vue create mode 100644 acs/qd/src/views/acs/device/driver/modbus_inspect_site.vue diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java index 03bfc86..281ae20 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java @@ -10,7 +10,7 @@ import org.nl.acs.agv.server.AgvService; import org.nl.acs.agv.server.dto.AgvDto; import org.nl.acs.config.AcsConfig; import org.nl.acs.config.server.AcsConfigService; -import org.nl.acs.device_driver.standard_autodoor.StandardAutodoorDeviceDriver; +import org.nl.acs.device_driver.autodoor.standard_autodoor.StandardAutodoorDeviceDriver; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.log.service.DeviceExecuteLogService; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/MagicAgvServiceImpl.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/MagicAgvServiceImpl.java index 0dc6ee5..6bcf917 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/MagicAgvServiceImpl.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/MagicAgvServiceImpl.java @@ -12,8 +12,8 @@ import org.nl.acs.agv.server.MagicAgvService; import org.nl.acs.agv.server.dto.AgvDto; import org.nl.acs.config.AcsConfig; import org.nl.acs.config.server.AcsConfigService; -import org.nl.acs.device_driver.standard_autodoor.StandardAutodoorDeviceDriver; -import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver; +import org.nl.acs.device_driver.autodoor.standard_autodoor.StandardAutodoorDeviceDriver; +import org.nl.acs.device_driver.inspect_site.standard_inspect_site.StandardInspectSiteDeviceDriver; import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.device_driver.standard_storage.StandardStorageDeviceDriver; import org.nl.acs.ext.wms.service.AcsToWmsService; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java index 73860fa..a53f2e9 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java @@ -12,7 +12,7 @@ import org.nl.acs.config.AcsConfig; import org.nl.acs.config.server.AcsConfigService; import org.nl.acs.device.service.DeviceService; import org.nl.acs.device.service.impl.DeviceServiceImpl; -import org.nl.acs.device_driver.standard_autodoor.StandardAutodoorDeviceDriver; +import org.nl.acs.device_driver.autodoor.standard_autodoor.StandardAutodoorDeviceDriver; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.dto.Instruction; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java index 5e45841..138c649 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java @@ -12,17 +12,15 @@ import org.nl.acs.agv.server.XianGongAgvService; import org.nl.acs.agv.server.dto.AgvDto; import org.nl.acs.config.AcsConfig; import org.nl.acs.config.server.AcsConfigService; -import org.nl.acs.device_driver.standard_autodoor.StandardAutodoorDeviceDriver; -import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver; +import org.nl.acs.device_driver.autodoor.standard_autodoor.StandardAutodoorDeviceDriver; +import org.nl.acs.device_driver.inspect_site.standard_inspect_site.StandardInspectSiteDeviceDriver; import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.ext.wms.service.AcsToWmsService; -import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.log.service.DeviceExecuteLogService; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceAppService; import org.nl.acs.opc.DeviceType; -import org.nl.acs.task.service.TaskService; import org.nl.exception.BadRequestException; import org.slf4j.MDC; import org.springframework.stereotype.Service; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java index 2c10437..c84b7b1 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java @@ -41,7 +41,11 @@ public enum DriverTypeEnum { TRAFFIC_LIGHT(34, "traffic_light", "标准版-交通灯-欧姆龙plc", "alarmLamp"), - STANDARD_RGV(35, "standard_rgv", "标准版-RGV", "rgv"); + STANDARD_RGV(35, "standard_rgv", "标准版-RGV", "rgv"), + + MODBUS_AUTODOOR(36, "modbus_autodoor", "modbus-自动门", "autodoor"), + + MODBUS_INSPECT_SITE(37, "modbus_inspect_site", "modbus-检测站点", "station"); //驱动索引 private int index; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java index 5c7a4fe..7c56df5 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java @@ -22,7 +22,7 @@ import org.nl.acs.device_driver.ScannerDeviceDriver; import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; import org.nl.acs.device_driver.standard_conveyor_control_with_scanner.StandardCoveyorControlWithScannerDeviceDriver; import org.nl.acs.device_driver.standard_emptypallet_site.StandardEmptyPalletSiteDeviceDriver; -import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver; +import org.nl.acs.device_driver.inspect_site.standard_inspect_site.StandardInspectSiteDeviceDriver; import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.device_driver.standard_scanner.StandardScannerDeviceDriver; import org.nl.acs.opc.Device; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/autodoor/modbus_autodoor/ItemProtocol.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/autodoor/modbus_autodoor/ItemProtocol.java new file mode 100644 index 0000000..57852ee --- /dev/null +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/autodoor/modbus_autodoor/ItemProtocol.java @@ -0,0 +1,69 @@ +package org.nl.acs.device_driver.autodoor.modbus_autodoor; + +import lombok.extern.slf4j.Slf4j; +import org.nl.acs.device.device_driver.standard_inspect.ItemDto; + +import java.util.ArrayList; +import java.util.List; + +@Slf4j +public class ItemProtocol { + public static String item_heartbeat = "heartbeat"; + public static String item_mode = "mode"; + public static String item_action = "action"; + public static String item_error = "error"; + public static String item_to_command = "to_command"; + + + private final ModbusAutodoorDeviceDriver driver; + + public ItemProtocol(ModbusAutodoorDeviceDriver driver) { + this.driver = driver; + } + + public int getHeartbeat() { + return this.getOpcIntegerValue(item_heartbeat); + } + + public int getMode() { + return this.getOpcIntegerValue(item_mode); + } + + public int getAction() { + return this.getOpcIntegerValue(item_action); + } + + public int getError() { + return this.getOpcIntegerValue(item_error); + } + + public int getToCommand() { + return this.getOpcIntegerValue(item_to_command); + } + + + public int getOpcIntegerValue(String protocol) { + Integer value = this.driver.getIntegeregerValue(protocol); + if (value != null) { + return value; + } + return 0; + } + + public static List getReadableItemDtos() { + ArrayList list = new ArrayList<>(); + list.add(new ItemDto(item_heartbeat, "心跳", "30002")); + list.add(new ItemDto(item_mode, "工作状态", "30004", Boolean.TRUE)); + list.add(new ItemDto(item_action, "动作信号", "30006")); + list.add(new ItemDto(item_error, "报警信号", "30008")); + return list; + } + + public static List getWriteableItemDtos() { + ArrayList list = new ArrayList<>(); + list.add(new ItemDto(item_to_command, "作业命令", "40002", Boolean.TRUE)); + return list; + } + +} + diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/autodoor/modbus_autodoor/ModbusAutodoorDefination.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/autodoor/modbus_autodoor/ModbusAutodoorDefination.java new file mode 100644 index 0000000..a7c5255 --- /dev/null +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/autodoor/modbus_autodoor/ModbusAutodoorDefination.java @@ -0,0 +1,71 @@ +package org.nl.acs.device_driver.autodoor.modbus_autodoor; + +import org.nl.acs.device.device_driver.standard_inspect.ItemDto; +import org.nl.acs.device_driver.DeviceDriver; +import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; +import org.nl.acs.opc.Device; +import org.nl.acs.opc.DeviceType; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; + +/** + * 自动门驱动定义 + */ +@Service +public class ModbusAutodoorDefination implements OpcDeviceDriverDefination { + @Override + public String getDriverCode() { + return "modbus_autodoor"; + } + + @Override + public String getDriverName() { + return "modbus-自动门"; + } + + @Override + public String getDriverDescription() { + return "modbus-自动门"; + } + + @Override + public DeviceDriver getDriverInstance(Device device) { + return (new ModbusAutodoorDeviceDriver()).setDevice(device).setDriverDefination(this); + + } + + @Override + public Class getDeviceDriverType() { + return ModbusAutodoorDeviceDriver.class; + } + + @Override + public List getFitDeviceTypes() { + List types = new LinkedList<>(); + types.add(DeviceType.conveyor); + return types; + } + + @Override + public List getReadableItemDtos() { + return getReadableItemDtos2(); + } + + public static List getReadableItemDtos2() { + ArrayList list = new ArrayList<>(); + list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "30002")); + list.add(new ItemDto(ItemProtocol.item_mode, "工作状态", "30004", Boolean.TRUE)); + list.add(new ItemDto(ItemProtocol.item_action, "动作信号", "30006")); + list.add(new ItemDto(ItemProtocol.item_error, "报警信号", "30008")); + return list; + } + + @Override + public List getWriteableItemDtos() { + return ItemProtocol.getWriteableItemDtos(); + } + +} diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/autodoor/modbus_autodoor/ModbusAutodoorDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/autodoor/modbus_autodoor/ModbusAutodoorDeviceDriver.java new file mode 100644 index 0000000..66f708f --- /dev/null +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/autodoor/modbus_autodoor/ModbusAutodoorDeviceDriver.java @@ -0,0 +1,163 @@ +package org.nl.acs.device_driver.autodoor.modbus_autodoor; + +import com.alibaba.fastjson.JSONObject; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; +import org.nl.acs.device.service.DeviceService; +import org.nl.acs.device_driver.DeviceDriver; +import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; +import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; +import org.nl.acs.instruction.service.InstructionService; +import org.nl.acs.opc.Device; +import org.nl.acs.route.service.RouteLineService; +import org.nl.acs.task.service.TaskService; +import org.nl.utils.SpringContextHolder; +import org.openscada.opc.lib.da.Server; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * 自动门驱动 + */ +@EqualsAndHashCode(callSuper = true) +@Slf4j +@Data +@RequiredArgsConstructor +public class ModbusAutodoorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver { + protected ItemProtocol itemProtocol = new ItemProtocol(this); + @Autowired + InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); + @Autowired + DeviceService deviceservice = SpringContextHolder.getBean("deviceServiceImpl"); + @Autowired + RouteLineService routelineserver = SpringContextHolder.getBean("routeLineServiceImpl"); + @Autowired + TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl"); + String container; + String container_type_desc; + String last_container_type_desc; + String last_container; + //放货准备锁 + String putReadyLock = null; + //有货标记 + protected boolean has_goods_tag = false; + String devicecode; + int mode = 0; + int action = 0; + int error = 0; + Boolean iserror = false; + + int move = 0; + int task = 0; + int last_action = 0; + int last_mode = 0; + int last_error = 0; + int last_move = 0; + int last_task = 0; + + boolean hasVehicle = false; + boolean isReady = false; + protected int instruction_num = 0; + protected int instruction_num_truth = 0; + protected boolean hasGoods = false; + boolean isFold = false; + private String assemble_check_tag; + private Boolean sampleMode0; + private Boolean sampleMode3; + private Integer sampleError; + private Boolean sampleOnline; + protected String displayMessage = null; + public int display_message_time_out = 30000; + public Date display_message_time; + protected String current_stage_instruction_message; + protected String last_stage_instruction_message; + Integer heartbeat_tag; + private Date instruction_require_time = new Date(); + private Date instruction_finished_time = new Date(); + + private int instruction_require_time_out; + boolean requireSucess = false; + + private int instruction_finished_time_out; + + int branchProtocol = 0; + + @Override + public Device getDevice() { + return this.device; + } + + + @Override + public void execute() { + + mode = this.itemProtocol.getMode(); + action = this.itemProtocol.getAction(); + error = this.itemProtocol.getError(); + if (mode != last_mode) { + } + if (action != last_action) { + } + if (error != last_error) { + //this.execute_log.setContainer(""); + } + last_action = action; + last_mode = mode; + last_error = error; + //message = StringFormatUtl.format("设备报警:{}", new Object[]{}); + +// String manual_create_task = this.getDevice().getExtraValue().get("manual_create_task").toString(); + + } + + public synchronized String getStatus() { + JSONObject jo = new JSONObject(); + + if (action == 1) { + jo.put("name", this.getDevice().getDevice_code()); + jo.put("status", "OPEN"); + + } else if (action == 2) { + jo.put("name", this.getDevice().getDevice_code()); + jo.put("status", "CLOSE"); + + } else { + jo.put("name", this.getDevice().getDevice_code()); + jo.put("status", "ERROR"); + } + return jo.toString(); + } + + + public void writeing(int command) { + String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + + "." + ItemProtocol.item_to_command; + + String opcservcerid = this.getDevice().getOpc_server_id(); + Server server = ReadUtil.getServer(opcservcerid); + Map itemMap = new HashMap(); + itemMap.put(to_command, command); + ReadUtil.write(itemMap, server); + log.info("下发PLC信号:{},{}", to_command, command); + System.out.println("设备:" + devicecode + ",下发PLC信号:" + to_command + ",value:" + command); + + } + + public synchronized void OpenOrClose(String type) { + + //开门 + if ("1".equals(type)) { + writeing(1); + } else { + writeing(2); + } + + } + +} diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_autodoor/ItemProtocol.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/autodoor/standard_autodoor/ItemProtocol.java similarity index 96% rename from acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_autodoor/ItemProtocol.java rename to acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/autodoor/standard_autodoor/ItemProtocol.java index bd81d1b..80e96ef 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_autodoor/ItemProtocol.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/autodoor/standard_autodoor/ItemProtocol.java @@ -1,4 +1,4 @@ -package org.nl.acs.device_driver.standard_autodoor; +package org.nl.acs.device_driver.autodoor.standard_autodoor; import lombok.extern.slf4j.Slf4j; import org.nl.acs.device.device_driver.standard_inspect.ItemDto; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_autodoor/StandardAutodoorDefination.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/autodoor/standard_autodoor/StandardAutodoorDefination.java similarity index 97% rename from acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_autodoor/StandardAutodoorDefination.java rename to acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/autodoor/standard_autodoor/StandardAutodoorDefination.java index 5b6b3fd..c1749b8 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_autodoor/StandardAutodoorDefination.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/autodoor/standard_autodoor/StandardAutodoorDefination.java @@ -1,4 +1,4 @@ -package org.nl.acs.device_driver.standard_autodoor; +package org.nl.acs.device_driver.autodoor.standard_autodoor; import org.nl.acs.device.device_driver.standard_inspect.ItemDto; import org.nl.acs.device_driver.DeviceDriver; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_autodoor/StandardAutodoorDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/autodoor/standard_autodoor/StandardAutodoorDeviceDriver.java similarity index 98% rename from acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_autodoor/StandardAutodoorDeviceDriver.java rename to acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/autodoor/standard_autodoor/StandardAutodoorDeviceDriver.java index 4f1c09f..441f808 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_autodoor/StandardAutodoorDeviceDriver.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/autodoor/standard_autodoor/StandardAutodoorDeviceDriver.java @@ -1,4 +1,4 @@ -package org.nl.acs.device_driver.standard_autodoor; +package org.nl.acs.device_driver.autodoor.standard_autodoor; import com.alibaba.fastjson.JSONObject; import lombok.Data; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/inspect_site/modbus_inspect_site/ItemProtocol.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/inspect_site/modbus_inspect_site/ItemProtocol.java new file mode 100644 index 0000000..c572e27 --- /dev/null +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/inspect_site/modbus_inspect_site/ItemProtocol.java @@ -0,0 +1,106 @@ +package org.nl.acs.device_driver.inspect_site.modbus_inspect_site; + +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import org.nl.acs.device.device_driver.standard_inspect.ItemDto; + +import java.util.ArrayList; +import java.util.List; + +@Slf4j +@Data +public class ItemProtocol { + + public static String item_heartbeat = "heartbeat"; + public static String item_mode = "mode"; + public static String item_move = "move"; + public static String item_action = "action"; + public static String item_error = "error"; + public static String item_task = "task"; + public static String item_to_command = "to_command"; + public static String item_to_target = "to_target"; + public static String item_to_task = "to_task"; + + private ModbusInspectSiteDeviceDriver driver; + + public ItemProtocol(ModbusInspectSiteDeviceDriver driver) { + this.driver = driver; + } + + public int getHeartbeat() { + return this.getOpcIntegerValue(item_heartbeat); + } + + public int getMode() { + return this.getOpcIntegerValue(item_mode); + } + + public int getMove() { + return this.getOpcIntegerValue(item_move); + } + + public int getAction() { + return this.getOpcIntegerValue(item_action); + } + + public int getError() { + return this.getOpcIntegerValue(item_error); + } + + public int getTask() { + return this.getOpcIntegerValue(item_task); + } + + public int getToCommand() { + return this.getOpcIntegerValue(item_to_command); + } + + public int getToTarget() { + return this.getOpcIntegerValue(item_to_target); + } + + public int getToTask() { + return this.getOpcIntegerValue(item_to_task); + } + + //是否有货 + public int hasGoods(int move) { + return move; + } + + Boolean isonline; + + public int getOpcIntegerValue(String protocol) { + Integer value = this.driver.getIntegeregerValue(protocol); + if (value == null) { + log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!"); + setIsonline(false); + } else { + setIsonline(true); + return value; + } + return 0; + + } + + public static List getReadableItemDtos() { + ArrayList list = new ArrayList<>(); + list.add(new ItemDto(item_heartbeat, "心跳", "30002")); + list.add(new ItemDto(item_mode, "工作状态", "30004", Boolean.TRUE)); + list.add(new ItemDto(item_move, "光电开关信号", "30006")); + list.add(new ItemDto(item_action, "取放信号", "30008")); + list.add(new ItemDto(item_error, "报警信号", "30010")); + list.add(new ItemDto(item_task, "任务号", "30012")); + return list; + } + + public static List getWriteableItemDtos() { + ArrayList list = new ArrayList<>(); + list.add(new ItemDto(item_to_command, "作业命令", "40002", Boolean.TRUE)); + list.add(new ItemDto(item_to_target, "目标站", "40004")); + list.add(new ItemDto(item_to_task, "任务号", "40008")); + return list; + } + +} + diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/inspect_site/modbus_inspect_site/ModbusInspectSiteDefination.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/inspect_site/modbus_inspect_site/ModbusInspectSiteDefination.java new file mode 100644 index 0000000..f4f67bf --- /dev/null +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/inspect_site/modbus_inspect_site/ModbusInspectSiteDefination.java @@ -0,0 +1,74 @@ +package org.nl.acs.device_driver.inspect_site.modbus_inspect_site; + +import org.nl.acs.device.device_driver.standard_inspect.ItemDto; +import org.nl.acs.device_driver.DeviceDriver; +import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; +import org.nl.acs.opc.Device; +import org.nl.acs.opc.DeviceType; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; + +/** + * 检测站点驱动定义 + * 说明:该站点为普通带光电检测站点 + */ +@Service +public class ModbusInspectSiteDefination implements OpcDeviceDriverDefination { + @Override + public String getDriverCode() { + return "modbus_inspect_site"; + } + + @Override + public String getDriverName() { + return "modbus-检测站点"; + } + + @Override + public String getDriverDescription() { + return "modbus-检测站点"; + } + + @Override + public DeviceDriver getDriverInstance(Device device) { + return (new ModbusInspectSiteDeviceDriver()).setDevice(device).setDriverDefination(this); + + } + + @Override + public Class getDeviceDriverType() { + return ModbusInspectSiteDeviceDriver.class; + } + + @Override + public List getFitDeviceTypes() { + List types = new LinkedList<>(); + types.add(DeviceType.conveyor); + return types; + } + + @Override + public List getReadableItemDtos() { + return getReadableItemDtos2(); + } + + public static List getReadableItemDtos2() { + ArrayList list = new ArrayList<>(); + list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "30002")); + list.add(new ItemDto(ItemProtocol.item_mode, "工作状态", "30004", Boolean.TRUE)); + list.add(new ItemDto(ItemProtocol.item_move, "光电开关信号", "30006")); + list.add(new ItemDto(ItemProtocol.item_action, "取放信号", "30008")); + list.add(new ItemDto(ItemProtocol.item_error, "报警信号", "30010")); + list.add(new ItemDto(ItemProtocol.item_task, "任务号", "30014")); + return list; + } + + @Override + public List getWriteableItemDtos() { + return ItemProtocol.getWriteableItemDtos(); + } + +} diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/inspect_site/modbus_inspect_site/ModbusInspectSiteDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/inspect_site/modbus_inspect_site/ModbusInspectSiteDeviceDriver.java new file mode 100644 index 0000000..d2109e8 --- /dev/null +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/inspect_site/modbus_inspect_site/ModbusInspectSiteDeviceDriver.java @@ -0,0 +1,455 @@ +package org.nl.acs.device_driver.inspect_site.modbus_inspect_site; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import lombok.Data; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; +import org.nl.acs.device.service.DeviceService; +import org.nl.acs.device_driver.DeviceDriver; +import org.nl.acs.device_driver.RouteableDeviceDriver; +import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; +import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; +import org.nl.acs.instruction.service.InstructionService; +import org.nl.acs.instruction.service.dto.Instruction; +import org.nl.acs.log.service.DeviceExecuteLogService; +import org.nl.acs.opc.Device; +import org.nl.acs.opc.DeviceAppService; +import org.nl.acs.opc.DeviceAppServiceImpl; +import org.nl.acs.opc.WcsConfig; +import org.nl.acs.route.service.RouteLineService; +import org.nl.acs.route.service.dto.RouteLineDto; +import org.nl.acs.task.service.TaskService; +import org.nl.acs.task.service.dto.TaskDto; +import org.nl.modules.system.util.CodeUtil; +import org.nl.utils.SpringContextHolder; +import org.nl.wql.core.bean.WQLObject; +import org.openscada.opc.lib.da.Server; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 检测站点驱动 + */ +@Slf4j +@Data +@RequiredArgsConstructor +public class ModbusInspectSiteDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { + protected ItemProtocol itemProtocol = new ItemProtocol(this); + @Autowired + InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); + @Autowired + DeviceService deviceservice = SpringContextHolder.getBean("deviceServiceImpl"); + @Autowired + RouteLineService routelineserver = SpringContextHolder.getBean("routeLineServiceImpl"); + @Autowired + TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl"); + @Autowired + DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl"); + + String container; + String container_type_desc; + String last_container_type_desc; + String last_container; + //放货准备锁 + String putReadyLock = null; + //有货标记 + protected boolean has_goods_tag = false; + + int mode = 0; + int error = 0; + int move = 0; + int task = 0; + int last_mode = 0; + int last_error = 0; + int last_move = 0; + int last_task = 0; + Boolean isonline = true; + int hasGoods = 0; + String message = null; + Boolean iserror = false; + + + boolean hasVehicle = false; + boolean isReady = false; + protected int instruction_num = 0; + protected int instruction_num_truth = 0; + boolean isFold = false; + private String assemble_check_tag; + + protected String current_stage_instruction_message; + protected String last_stage_instruction_message; + Integer heartbeat_tag; + private Date instruction_require_time = new Date(); + private Date instruction_finished_time = new Date(); + + private int instruction_require_time_out; + boolean requireSucess = false; + + private int instruction_finished_time_out; + + int branchProtocol = 0; + //备注 + String remark; + //数量 + String qty; + //物料 + String material; + //批次 + String batch; + //当前指令 + Instruction inst = null; + //上次指令 + Instruction last_inst = null; + + //触摸屏手动触发任务 + private Boolean is_has_task = false; + + //申请搬运任务 + private Boolean apply_handling = false; + //申请物料 + private Boolean apply_material = false; + + //暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域 + int flag; + + String device_code; + + @Override + public Device getDevice() { + return this.device; + } + + + @Override + public void execute() { + String message = null; + try { + device_code = this.getDeviceCode(); + mode = this.itemProtocol.getMode(); + error = this.itemProtocol.getError(); + move = this.itemProtocol.getMove(); + task = this.itemProtocol.getTask(); + hasGoods = this.itemProtocol.getMove(); + + if (mode != last_mode) { + this.setRequireSucess(false); + logServer.deviceItemValue(this.device_code,"mode" ,String.valueOf(mode)); + logServer.deviceExecuteLog(this.device_code,"","","信号mode:" + last_mode + "->" + mode); + } + if (move != last_move) { + logServer.deviceItemValue(this.device_code,"move" ,String.valueOf(move)); + logServer.deviceExecuteLog(this.device_code,"","","信号move:" + last_move + "->" + move); + } + if (error != last_error) { + logServer.deviceItemValue(this.device_code,"error" ,String.valueOf(error)); + logServer.deviceExecuteLog(this.device_code,"","","信号error:" + last_error + "->" + error); + } + if (task != last_task) { + logServer.deviceItemValue(this.device_code,"task",String.valueOf(task)); + logServer.deviceExecuteLog(this.device_code,"","","信号task:" + last_task + "->" + task); + } + + if (this.getApply_handling()) { + String link_device_code = this.getDevice().getExtraValue().get("link_device_code").toString(); + DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); + Device link_device = appService.findDeviceByCode(link_device_code); + ModbusInspectSiteDeviceDriver standardInspectSiteDevicedriver; + if (link_device.getDeviceDriver() instanceof ModbusInspectSiteDeviceDriver) { + standardInspectSiteDevicedriver = (ModbusInspectSiteDeviceDriver) link_device.getDeviceDriver(); +// if(standardInspectSiteDevicedriver.getMode() != 2){ +// log.debug("设备未待机"); +// return; +// } +// if(standardInspectSiteDevicedriver.getMove() != 0){ +// log.debug("设备不满足放货条件"); +// return; +// } + + //如果目标设备申请叫料 则允许生成任务 + if (standardInspectSiteDevicedriver.getApply_material()) { + TaskDto dto = new TaskDto(); + String now = DateUtil.now(); + dto.setTask_id(IdUtil.simpleUUID()); + dto.setCreate_by(this.getDevice().getDevice_code()); + dto.setUpdate_by(this.getDevice().getDevice_code()); + dto.setStart_point_code(this.getDevice().getDevice_code()); + + String taskcode = CodeUtil.getNewCode("TASK_NO"); + dto.setTask_code("-" + taskcode); + dto.setTask_status("0"); + dto.setPriority("101"); +// RouteLineDto jo = routelineserver.findByCode(this.getDevice().getDevice_code()); +// String next_device_codecode = jo.getNext_device_code(); +// if(StrUtil.isEmpty(next_device_codecode)){ +// throw new RuntimeException("该设备未找到对应路由"); +// } + dto.setNext_point_code(this.getDeviceCode()); + dto.setUpdate_time(now); + dto.setCreate_time(now); + + WQLObject wo = WQLObject.getWQLObject("acs_task"); + JSONObject json = (JSONObject) JSONObject.toJSON(dto); + + wo.insert(json); + standardInspectSiteDevicedriver.setApply_material(false); + } + } + this.setApply_handling(false); + } + + } catch (Exception var17) { + return; + } + + if (!this.itemProtocol.getIsonline()) { + this.setIsonline(false); + this.setIserror(true); + message = "信号量同步异常"; + //未联机 + } else if (mode == 0) { + this.setIsonline(false); + this.setIserror(true); + message = "未联机"; + //有报警 + } else if (error != 0) { + this.setIsonline(false); + this.setIserror(true); + message = "有报警"; + //无报警 + } else { + this.setIsonline(true); + this.setIserror(false); + message = ""; + Instruction instruction = null; + List toInstructions; + switch (mode) { + case 1: + log.debug("设备运转模式:等待工作"); + return; + case 2: + //申请任务 +// if (this.getApply_handling()) { +// String link_device_code = this.getDevice().getExtraValue().get("link_device_code").toString(); +// DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); +// Device link_device = appService.findDeviceByCode(link_device_code); +// StandardInspectSiteDeviceDriver standardInspectSiteDevicedriver; +// if(link_device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { +// standardInspectSiteDevicedriver = (StandardInspectSiteDeviceDriver) link_device.getDeviceDriver(); +// if(standardInspectSiteDevicedriver.getMode() != 2){ +// log.debug("设备未待机"); +// return; +// } +// if(standardInspectSiteDevicedriver.getMove() != 0){ +// log.debug("设备不满足放货条件"); +// return; +// } +// +// //如果目标设备申请叫料 则允许生成任务 +// if(standardInspectSiteDevicedriver.getApply_material()){ +// TaskDto dto = new TaskDto(); +// String now = DateUtil.now(); +// dto.setTask_id(IdUtil.simpleUUID()); +// dto.setCreate_by(this.getDevice().getDevice_code()); +// dto.setUpdate_by(this.getDevice().getDevice_code()); +// dto.setStart_point_code(this.getDevice().getDevice_code()); +// +// String taskcode = CodeGenerateUtil.getNewCode("TASK_NO"); +// dto.setTask_code("-"+taskcode); +// dto.setTask_status("0"); +// dto.setPriority("101"); +// RouteLineDto jo = routelineserver.findByCode(this.getDevice().getDevice_code()); +// String next_device_codecode = jo.getNext_device_code(); +// if(StrUtil.isEmpty(next_device_codecode)){ +// throw new RuntimeException("该设备未找到对应路由"); +// } +// dto.setNext_point_code(next_device_codecode); +// dto.setUpdate_time(now); +// dto.setCreate_time(now); +// +// WQLObject wo = WQLObject.getWQLObject("acs_task"); +// JSONObject json = (JSONObject) JSONObject.toJSON(dto); + +// wo.insert(json); +// standardInspectSiteDevicedriver.setApply_material(false); +// } +// } +// this.setApply_handling(false); +// } + + if (material.length() > 0 && qty.length() > 0 && !requireSucess) { + this.instruction_require(container); + } + } + + switch (flag) { + //取货完成 + case 1: + writing(2); + return; + //放货完成 + case 2: + writing(3); + return; + + } + + } + last_mode = mode; + last_error = error; + last_move = move; + last_task = task; + + } + + + public boolean exe_error() { + if (this.error == 0) { + return true; + } else { + log.debug("设备报警"); + return false; + } + } + + protected void thingToNothing() { + log.debug("从有货到无货 清理数据"); + this.set_last_container(container, container_type_desc); + } + + public void set_last_container(String barcode, String type_desc) { + this.set_last_container(barcode); + this.set_last_container_type_desc(type_desc); + } + + public void set_last_container(String barcode) { + } + + public void set_last_container_type_desc(String type) { + } + + public boolean exe_business() { + return true; + } + + protected void executing(Instruction instruction) { + this.executing(1, instruction, ""); + } + + public void executing(int command, Instruction instruction, String appendMessage) { + String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + + "." + ItemProtocol.item_to_command; + String to_target = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + + "." + ItemProtocol.item_to_target; + String to_task = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + + "." + ItemProtocol.item_to_task; + if (appendMessage == null) { + appendMessage = ""; + } + if (instruction != null) { + instruction_num = Integer.parseInt(instruction.getInstruction_code()); + } + String opcservcerid = this.getDevice().getOpc_server_id(); + Server server = ReadUtil.getServer(opcservcerid); + Map itemMap = new HashMap(); + itemMap.put(to_command, 1); + itemMap.put(to_task, instruction_num); + ReadUtil.write(itemMap, server); + + } + + public void executing(Server server, Map itemMap) { + ReadUtil.write(itemMap, server); + } + + public void writing(int command) { + String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + + "." + ItemProtocol.item_to_command; + + String opcservcerid = this.getDevice().getOpc_server_id(); + Server server = ReadUtil.getServer(opcservcerid); + Map itemMap = new HashMap(); + itemMap.put(to_command, command); + ReadUtil.write(itemMap, server); + + } + + public void writing(int type, int command) { + String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + + "." + ItemProtocol.item_to_command; + String to_target = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + + "." + ItemProtocol.item_to_target; + String to_task = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + + "." + ItemProtocol.item_to_task; + String opcservcerid = this.getDevice().getOpc_server_id(); + Server server = ReadUtil.getServer(opcservcerid); + Map itemMap = new HashMap(); + if (type == 1) { + itemMap.put(to_command, command); + } else if (type == 2) { + itemMap.put(to_target, command); + + } else if (type == 3) { + itemMap.put(to_task, command); + } + ReadUtil.write(itemMap, server); + + } + + public boolean instruction_require(String container_code) { + return instruction_require(container_code, WcsConfig.task_container_type_default_desc); + } + + /** + * 请求指令 + * + * @param container_code + * @param container_type + */ + public synchronized boolean instruction_require(String container_code, String container_type) { + Date date = new Date(); + if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) { + log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); + return false; + } else { + this.instruction_require_time = date; + TaskDto dto = new TaskDto(); + String now = DateUtil.now(); + dto.setTask_id(IdUtil.simpleUUID()); + dto.setCreate_by(this.getDevice().getDevice_code()); + dto.setUpdate_by(this.getDevice().getDevice_code()); + dto.setStart_point_code(this.getDevice().getDevice_code()); + dto.setVehicle_code(container_code); + dto.setVehicle_type(container_type); + + String taskcode = CodeUtil.getNewCode("TASK_NO"); + dto.setTask_code("-" + taskcode); + dto.setTask_status("0"); + dto.setPriority("101"); + RouteLineDto jo = routelineserver.findByCode(this.getDevice().getDevice_code()); + String next_device_codecode = jo.getNext_device_code(); + if (StrUtil.isEmpty(next_device_codecode)) { + throw new RuntimeException("该设备未找到对应路由"); + } + dto.setNext_point_code(next_device_codecode); + dto.setUpdate_time(now); + dto.setCreate_time(now); + + WQLObject wo = WQLObject.getWQLObject("acs_task"); + JSONObject json = (JSONObject) JSONObject.toJSON(dto); + + wo.insert(json); + requireSucess = false; + return true; + } + } + + +} diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/ItemProtocol.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/inspect_site/standard_inspect_site/ItemProtocol.java similarity index 97% rename from acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/ItemProtocol.java rename to acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/inspect_site/standard_inspect_site/ItemProtocol.java index c280d3d..824568d 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/ItemProtocol.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/inspect_site/standard_inspect_site/ItemProtocol.java @@ -1,4 +1,4 @@ -package org.nl.acs.device_driver.standard_inspect_site; +package org.nl.acs.device_driver.inspect_site.standard_inspect_site; import lombok.Data; import lombok.extern.slf4j.Slf4j; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDefination.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/inspect_site/standard_inspect_site/StandardInspectSiteDefination.java similarity index 96% rename from acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDefination.java rename to acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/inspect_site/standard_inspect_site/StandardInspectSiteDefination.java index 2b81d41..19816ee 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDefination.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/inspect_site/standard_inspect_site/StandardInspectSiteDefination.java @@ -1,4 +1,4 @@ -package org.nl.acs.device_driver.standard_inspect_site; +package org.nl.acs.device_driver.inspect_site.standard_inspect_site; import org.nl.acs.device.device_driver.standard_inspect.ItemDto; import org.nl.acs.device_driver.DeviceDriver; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/inspect_site/standard_inspect_site/StandardInspectSiteDeviceDriver.java similarity index 99% rename from acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDeviceDriver.java rename to acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/inspect_site/standard_inspect_site/StandardInspectSiteDeviceDriver.java index 6bfa198..70e2703 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDeviceDriver.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/inspect_site/standard_inspect_site/StandardInspectSiteDeviceDriver.java @@ -1,4 +1,4 @@ -package org.nl.acs.device_driver.standard_inspect_site; +package org.nl.acs.device_driver.inspect_site.standard_inspect_site; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lamp_three_color/LampThreecolorDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lamp_three_color/LampThreecolorDeviceDriver.java index 8b2e6a7..c37bd96 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lamp_three_color/LampThreecolorDeviceDriver.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lamp_three_color/LampThreecolorDeviceDriver.java @@ -135,7 +135,7 @@ public class LampThreecolorDeviceDriver extends AbstractOpcDeviceDriver implemen public void writing(int command) { String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + org.nl.acs.device_driver.standard_inspect_site.ItemProtocol.item_to_command; + + "." + org.nl.acs.device_driver.inspect_site.standard_inspect_site.ItemProtocol.item_to_command; String opcservcerid = this.getDevice().getOpc_server_id(); Server server = ReadUtil.getServer(opcservcerid); diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java index 526dbe7..64ae5af 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java @@ -12,7 +12,7 @@ import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.RouteableDeviceDriver; import org.nl.acs.device_driver.driver.AbstractDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; -import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver; +import org.nl.acs.device_driver.inspect_site.standard_inspect_site.StandardInspectSiteDeviceDriver; import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceAppService; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java index 86ea295..91ff84e 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java @@ -9,7 +9,7 @@ import lombok.extern.slf4j.Slf4j; import org.nl.acs.config.AcsConfig; import org.nl.acs.config.server.AcsConfigService; import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device_driver.standard_autodoor.StandardAutodoorDeviceDriver; +import org.nl.acs.device_driver.autodoor.standard_autodoor.StandardAutodoorDeviceDriver; import org.nl.acs.device_driver.standard_conveyor_monitor.StandardCoveyorMonitorDeviceDriver; import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.device_driver.standard_scanner.StandardScannerDeviceDriver; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index d76a648..66b48bd 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java @@ -21,7 +21,7 @@ import org.nl.acs.device.service.DeviceService; import org.nl.acs.device.service.impl.DeviceServiceImpl; import org.nl.acs.device_driver.lamp_three_color.LampThreecolorDeviceDriver; import org.nl.acs.device_driver.standard_conveyor_control_with_scanner.StandardCoveyorControlWithScannerDeviceDriver; -import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver; +import org.nl.acs.device_driver.inspect_site.standard_inspect_site.StandardInspectSiteDeviceDriver; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.opc.Device; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java index 12f3429..453a2d7 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java @@ -20,7 +20,7 @@ import org.nl.acs.device.service.DeviceService; import org.nl.acs.device.service.StorageCellService; import org.nl.acs.device.service.dto.DeviceAssignedDto; import org.nl.acs.device.service.impl.DeviceServiceImpl; -import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver; +import org.nl.acs.device_driver.inspect_site.standard_inspect_site.StandardInspectSiteDeviceDriver; import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.instruction.service.InstructionService; @@ -29,7 +29,6 @@ import org.nl.acs.instruction.service.dto.InstructionDto; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceAppService; import org.nl.acs.opc.DeviceAppServiceImpl; -import org.nl.acs.opc.DeviceType; import org.nl.acs.route.service.RouteLineService; import org.nl.acs.route.service.dto.RouteLineDto; import org.nl.acs.task.service.TaskFeedbackService; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/logicflow/service/impl/StageServiceImpl.java b/acs/hd/nladmin-system/src/main/java/org/nl/logicflow/service/impl/StageServiceImpl.java index e53e4ca..02a46b5 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/logicflow/service/impl/StageServiceImpl.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/logicflow/service/impl/StageServiceImpl.java @@ -8,13 +8,13 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device_driver.standard_autodoor.StandardAutodoorDeviceDriver; +import org.nl.acs.device_driver.autodoor.standard_autodoor.StandardAutodoorDeviceDriver; import org.nl.acs.device_driver.standard_conveyor_control.StandardCoveyorControlDeviceDriver; import org.nl.acs.device_driver.standard_conveyor_control_with_plcscanner.StandardCoveyorControlWithPlcScannerDeviceDriver; import org.nl.acs.device_driver.standard_conveyor_control_with_scanner.StandardCoveyorControlWithScannerDeviceDriver; import org.nl.acs.device_driver.standard_conveyor_monitor.StandardCoveyorMonitorDeviceDriver; import org.nl.acs.device_driver.standard_emptypallet_site.StandardEmptyPalletSiteDeviceDriver; -import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver; +import org.nl.acs.device_driver.inspect_site.standard_inspect_site.StandardInspectSiteDeviceDriver; import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.device_driver.standard_rgv.StandardRGVDeviceDriver; import org.nl.acs.device_driver.standard_scanner.StandardScannerDeviceDriver; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java b/acs/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java index 70e69ed..f29f787 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java @@ -9,7 +9,7 @@ import org.nl.acs.config.AcsConfig; import org.nl.acs.config.server.AcsConfigService; import org.nl.acs.device_driver.lamp_three_color.LampThreecolorDeviceDriver; import org.nl.acs.device_driver.standard_emptypallet_site.StandardEmptyPalletSiteDeviceDriver; -import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver; +import org.nl.acs.device_driver.inspect_site.standard_inspect_site.StandardInspectSiteDeviceDriver; import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.dto.Instruction; diff --git a/acs/qd/src/views/acs/device/config.vue b/acs/qd/src/views/acs/device/config.vue index 22358a9..9fa0526 100644 --- a/acs/qd/src/views/acs/device/config.vue +++ b/acs/qd/src/views/acs/device/config.vue @@ -95,6 +95,8 @@ import manipulator_inspect_site_NDC from '@/views/acs/device/driver/manipulator_ import standard_manipulator_stacking_site from '@/views/acs/device/driver/standard_manipulator_stacking_site' import standard_photoelectric_inspect_site from '@/views/acs/device/driver/standard_photoelectric_inspect_site' import electric_fence from '@/views/acs/device/driver/electric_fence' +import modbus_autodoor from '@/views/acs/device/driver/modbus_autodoor' +import modbus_inspect_site from '@/views/acs/device/driver/modbus_inspect_site' export default { name: 'DeviceConfig', @@ -103,7 +105,7 @@ export default { lamp_three_color, standard_storage, special_ordinary_site, standard_scanner, standard_conveyor_control_with_scanner, standard_conveyor_control_with_plcscanner, standard_conveyor_control, standard_conveyor_monitor, weighing_site, machines_site, non_line_manipulator_inspect_site, non_line_inspect_site, manipulator_inspect_site_NDC, standard_manipulator_stacking_site, - standard_photoelectric_inspect_site, electric_fence }, + standard_photoelectric_inspect_site, electric_fence, modbus_autodoor, modbus_inspect_site }, dicts: ['device_type'], mixins: [crud], data() { diff --git a/acs/qd/src/views/acs/device/driver/modbus_autodoor.vue b/acs/qd/src/views/acs/device/driver/modbus_autodoor.vue new file mode 100644 index 0000000..41e2f46 --- /dev/null +++ b/acs/qd/src/views/acs/device/driver/modbus_autodoor.vue @@ -0,0 +1,352 @@ + + + + + diff --git a/acs/qd/src/views/acs/device/driver/modbus_inspect_site.vue b/acs/qd/src/views/acs/device/driver/modbus_inspect_site.vue new file mode 100644 index 0000000..a6ab788 --- /dev/null +++ b/acs/qd/src/views/acs/device/driver/modbus_inspect_site.vue @@ -0,0 +1,490 @@ + + + + + diff --git a/lms/hd/nladmin-system/src/main/java/org/nl/wms/pad/rest/PadController.java b/lms/hd/nladmin-system/src/main/java/org/nl/wms/pad/rest/PadController.java index b9d24dd..c56db9d 100644 --- a/lms/hd/nladmin-system/src/main/java/org/nl/wms/pad/rest/PadController.java +++ b/lms/hd/nladmin-system/src/main/java/org/nl/wms/pad/rest/PadController.java @@ -103,13 +103,23 @@ public class PadController { /** * 查询物料 * - * @return 所有物料 + * @param param String device_id 点位标识 + * @return 点位可以选择的物料 */ @PostMapping("/matrial") @Log("查询物料") @ApiOperation("查询物料") - public ResponseEntity material() { - return new ResponseEntity<>(padService.material(), HttpStatus.OK); + public ResponseEntity material(@RequestBody JSONObject param) { + // 参数校验 + String point_id = param.getString("device_id"); + if (StrUtil.isEmpty(point_id)) { + JSONObject resultJSON = new JSONObject(); + resultJSON.put("code", "0"); + resultJSON.put("desc", "点位不能为空"); + return new ResponseEntity<>(resultJSON, HttpStatus.OK); + } + + return new ResponseEntity<>(padService.material(point_id), HttpStatus.OK); } /** diff --git a/lms/hd/nladmin-system/src/main/java/org/nl/wms/pad/service/PadService.java b/lms/hd/nladmin-system/src/main/java/org/nl/wms/pad/service/PadService.java index 98e80a3..03187e8 100644 --- a/lms/hd/nladmin-system/src/main/java/org/nl/wms/pad/service/PadService.java +++ b/lms/hd/nladmin-system/src/main/java/org/nl/wms/pad/service/PadService.java @@ -41,9 +41,10 @@ public interface PadService { /** * 查询物料 * - * @return 所有物料 + * @param point_id 点位标识 + * @return 点位可以选择的物料 */ - JSONObject material(); + JSONObject material(String point_id); /** * 点位状态绑定 diff --git a/lms/hd/nladmin-system/src/main/java/org/nl/wms/pad/service/impl/PadServiceImpl.java b/lms/hd/nladmin-system/src/main/java/org/nl/wms/pad/service/impl/PadServiceImpl.java index 508d682..ddb53f1 100644 --- a/lms/hd/nladmin-system/src/main/java/org/nl/wms/pad/service/impl/PadServiceImpl.java +++ b/lms/hd/nladmin-system/src/main/java/org/nl/wms/pad/service/impl/PadServiceImpl.java @@ -179,15 +179,22 @@ public class PadServiceImpl implements PadService { /** * 查询物料 * - * @return 所有物料 + * @param point_id 点位标识 + * @return 点位可以选择的物料 */ @Override - public JSONObject material() { + public JSONObject material(String point_id) { // 返回值 JSONObject resultJSON = new JSONObject(); // 查询物料 - resultJSON.put("result", WQL.getWO("PAD").addParam("flag", "3").process().getResultJSONArray(0)); + resultJSON.put("result", + WQL + .getWO("PAD") + .addParam("flag", "3") + .addParam("point_id", point_id) + .process() + .getResultJSONArray(0)); // 返回 resultJSON.put("code", "1"); diff --git a/lms/hd/nladmin-system/src/main/java/org/nl/wms/pad/wql/PAD.wql b/lms/hd/nladmin-system/src/main/java/org/nl/wms/pad/wql/PAD.wql index fadeca2..e6b5d19 100644 --- a/lms/hd/nladmin-system/src/main/java/org/nl/wms/pad/wql/PAD.wql +++ b/lms/hd/nladmin-system/src/main/java/org/nl/wms/pad/wql/PAD.wql @@ -15,6 +15,7 @@ ################################################# 输入.flag TYPEAS s_string 输入.region_id TYPEAS s_string + 输入.point_id TYPEAS s_string 输入.lock_type TYPEAS s_string 输入.col TYPEAS s_string @@ -86,12 +87,15 @@ IF 输入.flag = "3" QUERY SELECT - `value`, - label + dd.label, + dd.`value` FROM - sys_dict_detail + sch_base_point point + LEFT JOIN sch_base_point_material pm ON point.point_id = pm.point_id + LEFT JOIN sys_dict_detail dd ON pm.material = dd.`value` + AND dd.`name` = 'material_type' WHERE - `name` = 'current_material_type' + point.point_id = 输入.point_id ENDSELECT ENDQUERY ENDIF diff --git a/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/rest/PointController.java b/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/rest/PointController.java index b6b9284..95f2068 100644 --- a/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/rest/PointController.java +++ b/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/rest/PointController.java @@ -43,7 +43,7 @@ public class PointController { @Log("新增点位") @ApiOperation("新增点位") //@PreAuthorize("@el.check('point:add')") - public ResponseEntity create(@Validated @RequestBody PointDto dto) { + public ResponseEntity create(@Validated @RequestBody JSONObject dto) { pointService.create(dto); return new ResponseEntity<>(HttpStatus.CREATED); } @@ -52,7 +52,7 @@ public class PointController { @Log("修改点位") @ApiOperation("修改点位") //@PreAuthorize("@el.check('point:edit')") - public ResponseEntity update(@Validated @RequestBody PointDto dto) { + public ResponseEntity updatePoint(@Validated @RequestBody JSONObject dto) { pointService.update(dto); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } diff --git a/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/service/PointService.java b/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/service/PointService.java index eb9280f..d5d321c 100644 --- a/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/service/PointService.java +++ b/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/service/PointService.java @@ -6,7 +6,6 @@ import com.alibaba.fastjson.JSONObject; import org.nl.wms.sch.service.dto.PointDto; import org.springframework.data.domain.Pageable; -import java.util.List; import java.util.Map; /** @@ -22,21 +21,21 @@ public interface PointService { * @param page 分页参数 * @return Map */ - Map queryAll(Map whereJson, Pageable page); + Map queryAll(Map whereJson, Pageable page); /** * 查询所有数据不分页 * @param whereJson 条件参数 * @return List */ - List queryAll(Map whereJson); + JSONArray queryAll(Map whereJson); /** * 根据ID查询 * @param point_id ID * @return Point */ - PointDto findById(Long point_id); + JSONObject findById(Long point_id); /** * 根据编码查询 @@ -50,13 +49,13 @@ public interface PointService { * 创建 * @param dto / */ - void create(PointDto dto); + void create(JSONObject dto); /** * 编辑 * @param dto / */ - void update(PointDto dto); + void update(JSONObject dto); /** * 多选删除 diff --git a/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/service/dto/PointDto.java b/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/service/dto/PointDto.java index d41c0af..7c83b5a 100644 --- a/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/service/dto/PointDto.java +++ b/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/service/dto/PointDto.java @@ -131,11 +131,6 @@ public class PointDto implements Serializable { */ private String material_code; - /** - * 物料类型 - */ - private String material_type; - /** * 上一区域id */ diff --git a/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/service/impl/PointServiceImpl.java b/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/service/impl/PointServiceImpl.java index 9666b16..8b77991 100644 --- a/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/service/impl/PointServiceImpl.java +++ b/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/service/impl/PointServiceImpl.java @@ -8,7 +8,6 @@ import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; -import com.mchange.lang.DoubleUtils; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.nl.exception.BadRequestException; @@ -25,6 +24,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * @author ldjun @@ -36,8 +36,8 @@ import java.util.Map; @Slf4j public class PointServiceImpl implements PointService { @Override - public Map queryAll(Map whereJson, Pageable page) { - HashMap map = new HashMap(); + public Map queryAll(Map whereJson, Pageable page) { + HashMap map = new HashMap<>(); map.put("flag", "1"); map.put("region_id", whereJson.get("region_id")); map.put("ids", whereJson.get("ids")); @@ -46,27 +46,34 @@ public class PointServiceImpl implements PointService { map.put("is_used", whereJson.get("is_used")); map.put("point_type", whereJson.get("point_type")); map.put("name", whereJson.get("name")); - JSONObject json = WQL.getWO("QSCH_BASE_POINT").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "point_code asc"); - return json; + JSONObject result = WQL.getWO("QSCH_BASE_POINT").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "point_code asc"); + + JSONArray content = result.getJSONArray("content"); + WQLObject pm_table = WQLObject.getWQLObject("sch_base_point_material"); + for (Object o : content) { + JSONObject point = (JSONObject) o; + List material_type = pm_table + .query("point_id = " + point.getString("point_id")) + .getResultJSONArray(0) + .stream() + .map(pm -> ((JSONObject) pm).getString("material")) + .collect(Collectors.toList()); + point.put("material_type", material_type); + } + + return result; } @Override - public List queryAll(Map whereJson) { + public JSONArray queryAll(Map whereJson) { WQLObject wo = WQLObject.getWQLObject("sch_base_point"); - JSONArray arr = wo.query().getResultJSONArray(0); - List list = arr.toJavaList(PointDto.class); - return list; + return wo.query().getResultJSONArray(0); } @Override - public PointDto findById(Long point_id) { + public JSONObject findById(Long point_id) { WQLObject wo = WQLObject.getWQLObject("sch_base_point"); - JSONObject json = wo.query("point_id =" + point_id + "").uniqueResult(0); - if (ObjectUtil.isNotEmpty(json)) { - return json.toJavaObject(PointDto.class); - } - final PointDto obj = json.toJavaObject(PointDto.class); - return obj; + return wo.query("point_id =" + point_id + "").uniqueResult(0); } @@ -82,103 +89,134 @@ public class PointServiceImpl implements PointService { @Override @Transactional(rollbackFor = Exception.class) - public void create(PointDto dto) { + public void create(JSONObject dto) { // 参数校验 - PointDto byCode = this.findByCode(dto.getPoint_code()); + PointDto byCode = this.findByCode(dto.getString("point_code")); if (ObjectUtil.isNotEmpty(byCode)) { throw new BadRequestException("存在相同的点位编码"); } - if (!StrUtil.equals(dto.getMaterial_type(), "14")) { - int count = WQLObject.getWQLObject("sch_base_point") - .query("is_delete = '0' AND seq = " + dto.getSeq() + " AND region_id = " + dto.getRegion_id() + "'") - .getResultJSONArray(0) - .size(); - if (count > 0) { - throw new BadRequestException("该区域存在相同的出入库顺序"); - } + int count = WQLObject.getWQLObject("sch_base_point") + .query("is_delete = '0' AND seq = " + dto.getLong("seq") + " AND region_id = '" + dto.getString("region_id") + "'") + .getResultJSONArray(0) + .size(); + if (count > 0) { + throw new BadRequestException("该区域存在相同的出入库顺序"); } - if (StrUtil.equals(dto.getPoint_status(), "00") && !StrUtil.equals(dto.getCurrent_material_type(), "14")) { + String current_material_type = dto.getString("current_material_type"); + if (StrUtil.equals(dto.getString("point_status"), "00") && StrUtil.isNotBlank(current_material_type)) { throw new BadRequestException("当前为空位但是存放物料类型不为空"); } - if (StrUtil.equals(dto.getPoint_status(), "01") && StrUtil.equals(dto.getCurrent_material_type(), "14")) { + if (StrUtil.equals(dto.getString("point_status"), "01") && StrUtil.isBlank(current_material_type)) { throw new BadRequestException("当前为有货但是存放物料类型为空"); } - if (dto.getSeq() < 0L) { + if (dto.getLongValue("seq") < 0L) { throw new BadRequestException("出入库顺序号不能小于0"); } - if (dto.getCol() < 0L) { + if (dto.getLongValue("col") < 0L) { throw new BadRequestException("排号不能小于0"); } - JSONObject colPoint = WQLObject.getWQLObject("sch_base_point").query("region_id = '" + dto.getRegion_id() + "' AND col = " + dto.getCol()).uniqueResult(0); - if (ObjectUtil.isNotEmpty(colPoint) && !StrUtil.equals(colPoint.getString("material_type"), dto.getMaterial_type())) { - throw new BadRequestException("当前排不能限定这种物料"); - } - if (!StrUtil.equals(dto.getCurrent_material_type(), "14") - && !StrUtil.equals(dto.getMaterial_type(), "14") - && !StrUtil.equals(dto.getMaterial_type(), dto.getCurrent_material_type())) { - throw new BadRequestException("当前存放物料与限定物料不一致"); + List material_types = dto.getJSONArray("material_type").stream().map(Object::toString).collect(Collectors.toList()); + if (StrUtil.isNotBlank(current_material_type) && !material_types.contains(current_material_type)) { + throw new BadRequestException("该点位不能存放这种物料"); } - Long currentUserId = SecurityUtils.getCurrentUserId(); - String nickName = SecurityUtils.getNickName(); - String now = DateUtil.now(); - dto.setPoint_id(IdUtil.getSnowflake(1, 1).nextId()); - dto.setCreate_id(currentUserId); - dto.setCreate_name(nickName); - dto.setUpdate_optid(currentUserId); - dto.setUpdate_optname(nickName); - dto.setUpdate_time(now); - dto.setCreate_time(now); + WQLObject pm_table = WQLObject.getWQLObject("sch_base_point_material"); + long point_id = IdUtil.createSnowflake(1L, 1L).nextId(); + JSONObject pm = new JSONObject(); + pm.put("point_id", point_id); + for (String material_type : material_types) { + pm.put("pm_id", IdUtil.getSnowflake(1L, 1L).nextId()); + pm.put("material", material_type); + pm_table.insert(pm); + } - WQLObject wo = WQLObject.getWQLObject("sch_base_point"); - JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto)); - wo.insert(json); + JSONObject point = new JSONObject(); + point.put("point_id", point_id); + point.put("point_code", dto.getString("point_code")); + point.put("point_name", dto.getString("point_name")); + point.put("point_status", dto.getString("point_status")); + point.put("lock_type", dto.getString("lock_type")); + point.put("current_material_type", dto.getString("current_material_type")); + point.put("col", dto.getString("col")); + point.put("region_id", dto.getString("region_id")); + point.put("prev_region_id", dto.getString("prev_region_id")); + point.put("next_region_id", dto.getString("next_region_id")); + point.put("seq", dto.getString("seq")); + point.put("remark", dto.getString("remark")); + point.put("create_id", SecurityUtils.getCurrentUserId()); + point.put("create_name", SecurityUtils.getNickName()); + point.put("create_time", DateUtil.now()); + WQLObject.getWQLObject("sch_base_point").insert(point); } @Override @Transactional(rollbackFor = Exception.class) - public void update(PointDto dto) { - Long pointId = dto.getPoint_id(); - PointDto entity = this.findById(pointId); + public void update(JSONObject dto) { + Long point_id = dto.getLong("point_id"); + JSONObject entity = this.findById(point_id); if (entity == null) { throw new BadRequestException("被删除或无权限,操作失败!"); } // 参数校验 - PointDto byCode = this.findByCode(dto.getPoint_code()); - if (!byCode.getPoint_id().equals(pointId)) { + PointDto byCode = this.findByCode(dto.getString("point_code")); + if (!byCode.getPoint_id().equals(point_id)) { throw new BadRequestException("该点位编码已被其他点位占用"); } - if (!StrUtil.equals(dto.getMaterial_type(), "14")) { - int count = WQLObject.getWQLObject("sch_base_point") - .query("is_delete = '0' AND seq = " + dto.getSeq() + " AND region_id = " + dto.getRegion_id() + " AND point_id <> " + pointId) - .getResultJSONArray(0) - .size(); - if (count > 0) { - throw new BadRequestException("该区域的其他点位中存在相同的出入库顺序"); - } + int count = WQLObject.getWQLObject("sch_base_point") + .query("is_delete = '0' AND seq = " + dto.getString("seq") + " AND region_id = " + dto.getLongValue("region_id") + " AND point_id <> " + point_id) + .getResultJSONArray(0) + .size(); + if (count > 0) { + throw new BadRequestException("该区域的其他点位中存在相同的出入库顺序"); } - if (StrUtil.equals(dto.getPoint_status(), "00") && !StrUtil.equals(dto.getCurrent_material_type(), "14")) { + + String current_material_type = dto.getString("current_material_type"); + if (StrUtil.equals(dto.getString("point_status"), "00") && StrUtil.isNotBlank(current_material_type)) { throw new BadRequestException("当前为空位但是存放物料类型不为空"); } - if (StrUtil.equals(dto.getPoint_status(), "01") && StrUtil.equals(dto.getCurrent_material_type(), "14")) { + if (StrUtil.equals(dto.getString("point_status"), "01") && StrUtil.isBlank(current_material_type)) { throw new BadRequestException("当前为有货但是存放物料类型为空"); } - if (!StrUtil.equals(dto.getMaterial_type(), "14") && StrUtil.equals(dto.getCurrent_material_type(), dto.getMaterial_type())) { - throw new BadRequestException("当前存放物料类型与限定物料类型不一致"); + if (dto.getLongValue("seq") < 0L) { + throw new BadRequestException("出入库顺序号不能小于0"); + } + if (dto.getLongValue("col") < 0L) { + throw new BadRequestException("排号不能小于0"); + } + List material_types = dto.getJSONArray("material_type").stream().map(Object::toString).collect(Collectors.toList()); + if (StrUtil.isNotBlank(current_material_type) && !material_types.contains(current_material_type)) { + throw new BadRequestException("该点位不能存放这种物料"); + } + WQLObject pm_table = WQLObject.getWQLObject("sch_base_point_material"); + pm_table.delete("point_id = " + point_id); + JSONObject pm = new JSONObject(); + pm.put("point_id", point_id); + for (String material_type : material_types) { + pm.put("pm_id", IdUtil.getSnowflake(1L, 1L).nextId()); + pm.put("material", material_type); + pm_table.insert(pm); } - Long currentUserId = SecurityUtils.getCurrentUserId(); - String nickName = SecurityUtils.getNickName(); - - String now = DateUtil.now(); - dto.setUpdate_time(now); - dto.setUpdate_optid(currentUserId); - dto.setUpdate_optname(nickName); + JSONObject point = new JSONObject(); + point.put("point_code", dto.getString("point_code")); + point.put("point_name", dto.getString("point_name")); + point.put("point_status", dto.getString("point_status")); + point.put("lock_type", dto.getString("lock_type")); + point.put("current_material_type", dto.getString("current_material_type")); + point.put("col", dto.getString("col")); + point.put("region_id", dto.getString("region_id")); + point.put("prev_region_id", dto.getString("prev_region_id")); + point.put("next_region_id", dto.getString("next_region_id")); + point.put("seq", dto.getString("seq")); + point.put("remark", dto.getString("remark")); + point.put("update_optid", SecurityUtils.getCurrentUserId()); + point.put("update_optname", SecurityUtils.getNickName()); + point.put("update_time", DateUtil.now()); - WQLObject wo = WQLObject.getWQLObject("sch_base_point"); - JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto)); - wo.update(json); + WQLObject + .getWQLObject("sch_base_point") + .update(point, "point_id = " + point_id); } diff --git a/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/service/wql/QSCH_BASE_POINT.wql b/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/service/wql/QSCH_BASE_POINT.wql index 8d18d4d..5e5c9a0 100644 --- a/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/service/wql/QSCH_BASE_POINT.wql +++ b/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/service/wql/QSCH_BASE_POINT.wql @@ -82,10 +82,8 @@ point.next_region_id, prev_region.region_name AS prev_region_name, next_region.region_name AS next_region_name, - d5.label AS material_type_name, point.seq, d6.label AS current_material_type_name, - point.material_type, point.current_material_type, point.col FROM @@ -96,7 +94,6 @@ LEFT JOIN sys_dict_detail d4 ON point.point_status = d4.value and d4.name='sch_point_status' LEFT JOIN SCH_BASE_Region prev_region ON point.prev_region_id = prev_region.region_id LEFT JOIN SCH_BASE_Region next_region ON point.next_region_id = next_region.region_id - LEFT JOIN sys_dict_detail d5 ON point.material_type = d5.`value` AND d5.`name` = 'material_type' LEFT JOIN sys_dict_detail d6 ON point.current_material_type = d6.`value` AND d6.`name` = 'current_material_type' WHERE point.is_delete = '0' diff --git a/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/service/wql/sch.xls b/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/service/wql/sch.xls index c1221c64d7c22e7ff6e9da357780831ff22c0832..f2678ce024e9433491b7d84af099683db283ce03 100644 GIT binary patch delta 47470 zcmcJ22VfON{{PIrk^~Y+AVBCZfb_siCG?j{=%I+9Cr&KgdCnzMpuLC=#Q7F1MFJP`~3&v(kceJK>Z|0MHf_B-GCw&}C8yQRk)m9CE} z>)pr67~}B5MKhL(hy(ujGiT07AY=0pISGFaH_LA~y6!3|O2;Vjk?`+ky zro2etDg3|^*Tp>Ej9Jc`o6*a;b9aqvhAYsxQSZRQ#!;LHRy1zanj8F<%O;FXWU=fc z(1~SbLW{LLFf^=AYD_ToKeh96mcpJjK!PD}RAjBZ25S|}JGgc#LtcyT{MxCU4GmJh zJF*od|1Bc;yDdz_1$@4M%iqhR0N;I8)Uvq1I@*@5pyxC5W(4&eU{6b>88 ze*(R>fky^M2RtL)fd__lp)dbSinCxnx7Ww+kDad7lHq4AbzC4=fCM#AbOND zaNn@F0AaNYl#L$B+l${0;U8r4SRm{Px_0s#i)Iv`yrs!3 zf{mdn3|L9gf*IFdcgrONd**b)8nUm_}GfjlhMmQ7=Waw|Y3434HeZGXB`bB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zaVc9=m{mEmctL{KAd6$Bk}#;aa+Xiktj@{xp$_)-pe%3p;MuOe_YP8uEE|S<9^(JZ zh#phCdv?~WxfSZ%G4&#BHp{9%I@fkAnweHOI=q<|6%%WXKUXz$)Di2TIZ+u$^0zJ;4@*lk2*MX9zL#beC$e}*kwNS_g=dXv)_h~0go*6QG5@&;W{W% ztO`>n@Q1}`VQMeq$i(6xchMA~roGsxEHviCV)RC1Ovm8TDIKqN(?wTMgk__YZmiPe z$fj$mSl~1x5|I+*U#cHld-%F?mH+>mKO%vv0e%TEjIQD=i0#u6*k_1oTn(o4I_)hQ z4Prf4L;dJNuPs*{R|lale&lMPAKkvSE$ytRq5Y!~2%DN{hL%8ZF_w=g9IEIG(T(gy z?X$;8_Sl=)p9MQ~pHS59esMRI{;8;8{i(;>>W-DdC^EG*b+{^pEmGBB@rOb65~@KB z;}+p-RLeFkD(Xy^=M;750$z(g2vTB{LG39XHK=A0XjDr!EgEJo^*=Nz`>U*+8sqS! zs?Uq#i5H6sJMQ;vzdxLZMr`c3Zs%#Q1B;vK&+qK{-r-+|4Bfqd#C3i6*QVkJtk*dG4>EYU8k!lY`>AFfRu&SH4 z_E-BU58ziC{nbGj4YiZ{tBIUjg>!(~Pc5soilYP6`ynuQpgKTB%n(Zls#C!zJ|3tJ zd@)M3saxaJTmvpRTI}IZh^29`_n^26pwuvNN4z@5KnEk2&0en{cNU2rVT)Dwjn0hA zjKQWf5h*<;J}$d;3ibBL9F?9N8XF%Q8xx(C5EGk~kP)Ais3nxey;iE0j9eW>fDr9)}fkaaEEp-d%>@ fMBiP^P4qF^j9tO38%ewIpKG>Mwf@C)wEq79qv|c^ diff --git a/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/tasks/CallTask.java b/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/tasks/CallTask.java index 2bbef30..630590b 100644 --- a/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/tasks/CallTask.java +++ b/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/tasks/CallTask.java @@ -8,12 +8,16 @@ import lombok.NoArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.nl.exception.BadRequestException; import org.nl.modules.system.util.CodeUtil; +import org.nl.utils.SpringContextHolder; import org.nl.wms.sch.manage.AbstractAcsTask; import org.nl.wql.WQL; import org.nl.wql.core.bean.WQLObject; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.List; +import java.util.stream.Collectors; + /** * 徐工叫料任务类 * @@ -25,8 +29,6 @@ import org.springframework.transaction.annotation.Transactional; @Slf4j public class CallTask extends AbstractAcsTask { - private final SendTask sendTask = new SendTask(); - /** * 更新任务状态 * @@ -36,7 +38,7 @@ public class CallTask extends AbstractAcsTask { @Transactional(rollbackFor = Exception.class) @Override public void updateTaskStatus(JSONObject taskJSON, String status) { - sendTask.updateTaskStatus(taskJSON, status); + SpringContextHolder.getBean(SendTask.class).updateTaskStatus(taskJSON, status); } @Override @@ -60,12 +62,7 @@ public class CallTask extends AbstractAcsTask { @Override public String createTask(JSONObject param) { String nextPointCode = param.getString("next_point_code"); - String materialType = param.getString("material_type"); - - // 判断呼叫的物料类型 - if (StrUtil.equals(materialType, "14")) { - throw new BadRequestException("不能呼叫空物料"); - } + String materialType = param.getString("call_material_type"); // 判断点位是否存在 JSONObject nextPoint = WQLObject @@ -83,8 +80,14 @@ public class CallTask extends AbstractAcsTask { } // 判断叫的物料是否为点位的限定物料 - String nextPointMaterialType = nextPoint.getString("material_type"); - if (!StrUtil.equals(nextPointMaterialType, "14") && !StrUtil.equals(nextPointMaterialType, materialType)) { + List materialTypes = WQLObject + .getWQLObject("sch_base_point_material") + .query("point_id = " + nextPoint.getLong("point_id")) + .getResultJSONArray(0) + .stream() + .map(o -> ((JSONObject) o).getString("material")) + .collect(Collectors.toList()); + if (!materialTypes.contains(materialType)) { throw new BadRequestException("该点位不能呼叫这种物料"); } @@ -98,10 +101,7 @@ public class CallTask extends AbstractAcsTask { throw new BadRequestException("该点位不是空位"); } - // 起点 - JSONObject startPoint = null; - - // 查询该区域存放此物料的排 + // 查询叫料区域存放此物料的排 JSONArray colArray = WQL .getWO("SEND_TASK") .addParam("flag", "2") @@ -111,9 +111,10 @@ public class CallTask extends AbstractAcsTask { .getResultJSONArray(0); // 遍历该区域存放此物料的排寻找合适的点位 + JSONObject startPoint = null; for (Object o : colArray) { // 查找该排有货 或 已锁定的点位(出入库顺序降序) - startPoint = WQL + JSONObject tempPoint = WQL .getWO("SEND_TASK") .addParam("flag", "3") .addParam("region_id", startRegionId) @@ -122,19 +123,17 @@ public class CallTask extends AbstractAcsTask { .uniqueResult(0); // 点位不为空 且 点位未锁定,则为合适的叫料点位 - if (ObjectUtil.isNotEmpty(startPoint) && StrUtil.equals(startPoint.getString("lock_type"), "00")) { + if (ObjectUtil.isNotEmpty(tempPoint) && StrUtil.equals(tempPoint.getString("lock_type"), "00")) { + startPoint = tempPoint; break; } - - // 如果不合适重置为null - startPoint = null; } if (ObjectUtil.isEmpty(startPoint)) { throw new BadRequestException("未找到合适的叫料点位"); } assert startPoint != null; - return sendTask.createTaskRelated( + return SpringContextHolder.getBean(SendTask.class).createTaskRelated( startPoint, nextPoint, param, @@ -151,7 +150,7 @@ public class CallTask extends AbstractAcsTask { */ @Override public void forceFinish(String task_id) { - sendTask.forceFinish(task_id); + SpringContextHolder.getBean(SendTask.class).forceFinish(task_id); } @Override diff --git a/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/tasks/SendTask.java b/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/tasks/SendTask.java index d67878d..831359e 100644 --- a/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/tasks/SendTask.java +++ b/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/tasks/SendTask.java @@ -194,32 +194,16 @@ public class SendTask extends AbstractAcsTask { throw new BadRequestException("该点位是空位"); } - // 如果起点是大吨位装配线下线区这根据物料类型给终点 + // 查送料点位(出入库顺序升序) JSONObject nextPoint; - String startRegionId = startPoint.getString("region_id"); String currentMaterialType = startPoint.getString("current_material_type"); - if (StrUtil.equals(startRegionId, "1578917189698850816") || StrUtil.equals(startRegionId, "1578917627470942208")) { - String nextPointCode = null; - if (StrUtil.equals(currentMaterialType, "08")) { - nextPointCode = "TZSXDCP1"; - } - if (StrUtil.equals(currentMaterialType, "09")) { - nextPointCode = "TZSXDCP2"; - } - nextPoint = WQLObject - .getWQLObject("sch_base_point") - .query("is_delete = '0' AND is_used = '1' AND point_code = '" + nextPointCode + "'") - .uniqueResult(0); - } else { - // 查送料点位(出入库顺序升序) - nextPoint = WQL - .getWO("SEND_TASK") - .addParam("flag", "1") - .addParam("region_id", nextRegionId) - .addParam("material_type", currentMaterialType) - .process() - .uniqueResult(0); - } + nextPoint = WQL + .getWO("SEND_TASK") + .addParam("flag", "1") + .addParam("region_id", nextRegionId) + .addParam("material_type", currentMaterialType) + .process() + .uniqueResult(0); if (ObjectUtil.isEmpty(nextPoint)) { throw new BadRequestException("未找到合适的送料点位"); } diff --git a/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/wql/SEND_TASK.wql b/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/wql/SEND_TASK.wql index b825593..886f1d0 100644 --- a/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/wql/SEND_TASK.wql +++ b/lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/wql/SEND_TASK.wql @@ -45,17 +45,18 @@ SELECT * FROM - sch_base_point + sch_base_point point + LEFT JOIN sch_base_point_material pm ON point.point_id = pm.point_id WHERE - point_status = '00' - AND lock_type = '00' - AND is_delete = '0' - AND is_used = '1' + point.point_status = '00' + AND point.lock_type = '00' + AND point.is_delete = '0' + AND point.is_used = '1' OPTION 输入.region_id <> "" - region_id = 输入.region_id + point.region_id = 输入.region_id ENDOPTION OPTION 输入.material_type <> "" - material_type = 输入.material_type + pm.material = 输入.material_type ENDOPTION ORDER BY seq ASC @@ -66,17 +67,18 @@ IF 输入.flag = "2" QUERY SELECT DISTINCT - col + point.col FROM - `sch_base_point` + `sch_base_point` point + LEFT JOIN sch_base_point_material pm ON point.point_id = pm.point_id WHERE - is_delete = '0' - AND is_used = '1' + point.is_delete = '0' + AND point.is_used = '1' OPTION 输入.region_id <> "" - region_id = 输入.region_id + point.region_id = 输入.region_id ENDOPTION OPTION 输入.material_type <> "" - material_type = 输入.material_type + pm.material = 输入.material_type ENDOPTION ORDER BY col diff --git a/lms/hd/nladmin-system/src/test/java/org/nl/PointTest.java b/lms/hd/nladmin-system/src/test/java/org/nl/PointTest.java index 10d9dfe..8626ea5 100644 --- a/lms/hd/nladmin-system/src/test/java/org/nl/PointTest.java +++ b/lms/hd/nladmin-system/src/test/java/org/nl/PointTest.java @@ -3,13 +3,16 @@ package org.nl; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import org.junit.Test; import org.junit.runner.RunWith; +import org.nl.utils.SecurityUtils; import org.nl.wms.sch.service.dto.PointDto; import org.nl.wql.core.bean.WQLObject; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.transaction.annotation.Transactional; @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @RunWith(SpringRunner.class) @@ -17,40 +20,48 @@ public class PointTest { @Test public void test01() { - for (int i = 0; i < 21; i++) { - int nameSeq = i + 1; - PointDto point = new PointDto(); - - point.setMaterial_type("10"); - if (nameSeq < 10) { - point.setPoint_code("XCPM0" + nameSeq); - } else { - point.setPoint_code("XCPM" + nameSeq); + WQLObject point_table = WQLObject.getWQLObject("sch_base_point"); +// JSONObject point = new JSONObject(); +// point.put("region_id", "1628275194667864064"); +// point.put("point_type", "00"); +// point.put("point_status", "00"); +// point.put("lock_type", "00"); +// point.put("is_used", "1"); +// point.put("is_delete", "0"); +// String now = DateUtil.now(); +// point.put("create_id", 1); +// point.put("create_name", "管理员"); +// point.put("create_time", now); +// point.put("update_optid", 1); +// point.put("update_optname", "管理员"); +// point.put("update_time", now); +// point.put("current_material_type", "14"); +// +// int seq = 0; +// for (int i = 1; i < 6; i++) { +// for (int j = 1; j < 6; j++) { +// point.put("point_id", IdUtil.createSnowflake(1L, 1L).nextId()); +// point.put("point_code", "HC" + i + "-0" + j + "-01"); +// point.put("point_name", "缓存周转区" + i + "排" + j + "列"); +// point.put("seq", ++seq); +// point.put("col", i); +// point.put("seq_num", ((i - 1) * 10) + j); +// point_table.insert(point); +// } +// } + JSONArray points = point_table + .query("region_id = 1628275194667864064") + .getResultJSONArray(0); + WQLObject pm_table = WQLObject.getWQLObject("sch_base_point_material"); + JSONObject pm = new JSONObject(); + String[] materials = new String[]{"08", "09", "10", "11", "12", "13"}; + for (Object o : points) { + pm.put("point_id", ((JSONObject) o).getLongValue("point_id")); + for (String material : materials) { + pm.put("pm_id", IdUtil.getSnowflake(1L, 1L).nextId()); + pm.put("material", material); + pm_table.insert(pm); } - point.setPoint_name("小吨位成品满框" + nameSeq + "号位"); - -//--------------------------------------------------------------------------------------------------------- - point.setRegion_id(1578915492142387200L); - -//--------------------------------------------------------------------------------------------------------- - point.setSeq((long) i); - point.setPoint_status("00"); - point.setPoint_type("00"); - point.setLock_type("00"); - Long currentUserId = 1L; - String nickName = "管理员"; - String now = DateUtil.now(); - point.setPoint_id(IdUtil.getSnowflake(1, 1).nextId()); - point.setCreate_id(currentUserId); - point.setCreate_name(nickName); - point.setUpdate_optid(currentUserId); - point.setUpdate_optname(nickName); - point.setUpdate_time(now); - point.setCreate_time(now); - - WQLObject wo = WQLObject.getWQLObject("sch_base_point"); - JSONObject json = JSONObject.parseObject(JSON.toJSONString(point)); - wo.insert(json); } } } diff --git a/lms/qd/src/views/wms/sch/point/index.vue b/lms/qd/src/views/wms/sch/point/index.vue index f3fb313..e6ce5de 100644 --- a/lms/qd/src/views/wms/sch/point/index.vue +++ b/lms/qd/src/views/wms/sch/point/index.vue @@ -117,6 +117,7 @@ - + - - - - - - - - - - - - + + + + + + + + + + + +