diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/OpcDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/OpcDeviceDriver.java index cf07de0..ebc6edf 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/OpcDeviceDriver.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/OpcDeviceDriver.java @@ -64,15 +64,21 @@ public interface OpcDeviceDriver extends DeviceDriver { } default Float getFloatValue(String protocol) { - return (Float) this.getOpcValueAccessor().getValue(this.getItem(protocol)); + RedisUtils redisUtils = SpringContextHolder.getBean(RedisUtils.class); + return (Float)redisUtils.get(this.getItem(protocol)); +// return (Float) this.getOpcValueAccessor().getValue(this.getItem(protocol)); } default int[] getIntegeregerArrayValue(String protocol) { - return (int[]) this.getOpcValueAccessor().getValue(this.getItem(protocol)); +// return (int[]) this.getOpcValueAccessor().getValue(this.getItem(protocol)); + RedisUtils redisUtils = SpringContextHolder.getBean(RedisUtils.class); + return (int[])redisUtils.get(this.getItem(protocol)); } default String getStringValue(String protocol) { - return (String) this.getOpcValueAccessor().getValue(this.getItem(protocol)); +// return (String) this.getOpcValueAccessor().getValue(this.getItem(protocol)); + RedisUtils redisUtils = SpringContextHolder.getBean(RedisUtils.class); + return (String)redisUtils.get(this.getItem(protocol)); } default Object getValue(String protocol) { diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_Laminating_machine/LnshLaminatingMachineDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_Laminating_machine/LnshLaminatingMachineDeviceDriver.java index 30fb0a8..5dc34c3 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_Laminating_machine/LnshLaminatingMachineDeviceDriver.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_Laminating_machine/LnshLaminatingMachineDeviceDriver.java @@ -17,6 +17,7 @@ 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.monitor.DeviceStageMonitor; import org.nl.acs.opc.Device; import org.nl.acs.route.service.RouteLineService; import org.nl.acs.task.service.TaskService; @@ -36,7 +37,7 @@ import java.util.Map; @Slf4j @Data @RequiredArgsConstructor -public class LnshLaminatingMachineDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { +public class LnshLaminatingMachineDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor { protected ItemProtocol itemProtocol = new ItemProtocol(this); @Autowired InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); @@ -403,4 +404,36 @@ public class LnshLaminatingMachineDeviceDriver extends AbstractOpcDeviceDriver i } return flag; } + + @Override + public JSONObject getDeviceStatusName() { + JSONObject jo = new JSONObject(); + String mode = ""; + if (this.getMode() == 0) { + mode = "未联机"; + } else if (this.getMode() == 1) { + mode = "单机"; + } else if (this.getMode() == 2) { + mode = "联机"; + } else if (this.getMode() == 3) { + mode = "运行中"; + } + + jo.put("device_name", this.getDevice().getDevice_name()); + jo.put("mode", mode); + jo.put("move", move); + jo.put("container_type", this.getContainer_type()); + jo.put("barcode", this.getBarcode()); + jo.put("task", this.getTask()); + jo.put("error", this.getError()); + jo.put("isOnline", this.getIsonline()); + jo.put("isError", this.getIserror()); + jo.put("message", this.getMessage()); + return jo; + } + + @Override + public void setDeviceStatus(JSONObject data) { + + } } diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_kiln_lane/LnshKilnLaneDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_kiln_lane/LnshKilnLaneDeviceDriver.java index e81fabb..f0ad993 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_kiln_lane/LnshKilnLaneDeviceDriver.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_kiln_lane/LnshKilnLaneDeviceDriver.java @@ -1,6 +1,7 @@ package org.nl.acs.device_driver.lnsh.lnsh_kiln_lane; import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; import lombok.Data; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -13,6 +14,7 @@ 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.monitor.DeviceStageMonitor; import org.nl.acs.opc.Device; import org.nl.acs.route.service.RouteLineService; import org.nl.acs.task.service.TaskService; @@ -28,7 +30,7 @@ import java.util.*; @Slf4j @Data @RequiredArgsConstructor -public class LnshKilnLaneDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { +public class LnshKilnLaneDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor { protected ItemProtocol itemProtocol = new ItemProtocol(this); @Autowired InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); @@ -357,4 +359,46 @@ public class LnshKilnLaneDeviceDriver extends AbstractOpcDeviceDriver implements } + @Override + public JSONObject getDeviceStatusName() { + JSONObject jo = new JSONObject(); + String mode = ""; + String status = ""; + if (this.getMode() == 0) { + mode = "未联机"; + } else if (this.getMode() == 1) { + mode = "单机"; + } else if (this.getMode() == 2) { + mode = "联机"; + } + + if (this.getStatus() == 1) { + status = "待机"; + } else if (this.getStatus() == 2) { + status = "生产中"; + } else if (this.getStatus() == 3) { + status = "故障"; + } + + jo.put("device_name", this.getDevice().getDevice_name()); + jo.put("mode", mode); + jo.put("status", status); + jo.put("isOnline", this.getIsonline()); + jo.put("error", this.getError()); + jo.put("isError", this.getIserror()); + jo.put("open_time", this.getOpen_time()); + jo.put("standby_time", this.getStandby_time()); + jo.put("production_time", this.getProduction_time()); + jo.put("error_time", this.getError_time()); + jo.put("car_sum", this.getCar_sum()); + jo.put("nullCar_qty", this.getNullCar_qty()); + jo.put("burning_car_qty", this.getBurning_car_qty()); + jo.put("message", this.getMessage()); + return jo; + } + + @Override + public void setDeviceStatus(JSONObject data) { + + } } diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_labeling_machine/LnshLabelingMachineDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_labeling_machine/LnshLabelingMachineDeviceDriver.java index 78ece4b..1dd0b10 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_labeling_machine/LnshLabelingMachineDeviceDriver.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_labeling_machine/LnshLabelingMachineDeviceDriver.java @@ -1,5 +1,6 @@ package org.nl.acs.device_driver.lnsh.lnsh_labeling_machine; +import com.alibaba.fastjson.JSONObject; import lombok.Data; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -13,6 +14,7 @@ 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.monitor.DeviceStageMonitor; import org.nl.acs.opc.Device; import org.nl.acs.route.service.RouteLineService; import org.nl.acs.task.service.TaskService; @@ -28,7 +30,7 @@ import java.util.*; @Slf4j @Data @RequiredArgsConstructor -public class LnshLabelingMachineDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { +public class LnshLabelingMachineDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor { protected ItemProtocol itemProtocol = new ItemProtocol(this); @Autowired InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); @@ -227,4 +229,48 @@ public class LnshLabelingMachineDeviceDriver extends AbstractOpcDeviceDriver imp ReadUtil.write(itemMap, server); } + + @Override + public JSONObject getDeviceStatusName() { + JSONObject jo = new JSONObject(); + String mode = ""; + String status = ""; + if (this.getMode() == 0) { + mode = "未联机"; + } else if (this.getMode() == 1) { + mode = "单机"; + } else if (this.getMode() == 2) { + mode = "联机"; + } else if (this.getMode() == 3) { + mode = "运行中"; + } + + if (this.getStatus() == 1) { + status = "待机"; + } else if (this.getStatus() == 2) { + status = "生产中"; + } else if (this.getStatus() == 3) { + status = "故障"; + } + + jo.put("device_name", this.getDevice().getDevice_name()); + jo.put("mode", mode); + jo.put("status", status); + jo.put("isOnline", this.getIsonline()); + jo.put("open_time", this.getOpen_time()); + jo.put("close_time", this.getClose_time()); + jo.put("standby_time", this.getStandby_time()); + jo.put("production_time", this.getProduction_time()); + jo.put("error_time", this.getError_time()); + jo.put("labeling_qty", this.getLabeling_qty()); + jo.put("isError", this.getIserror()); + jo.put("message", this.getMessage()); + + return jo; + } + + @Override + public void setDeviceStatus(JSONObject data) { + + } } diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_one_rgv/LnshOneRGVDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_one_rgv/LnshOneRGVDeviceDriver.java index 20b7f54..e596796 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_one_rgv/LnshOneRGVDeviceDriver.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_one_rgv/LnshOneRGVDeviceDriver.java @@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; import lombok.Data; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -16,6 +17,7 @@ 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.monitor.DeviceStageMonitor; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceAppService; import org.nl.acs.opc.DeviceAppServiceImpl; @@ -35,7 +37,7 @@ import java.util.*; @Slf4j @Data @RequiredArgsConstructor -public class LnshOneRGVDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { +public class LnshOneRGVDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor { protected ItemProtocol itemProtocol = new ItemProtocol(this); @Autowired InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); @@ -402,4 +404,78 @@ public class LnshOneRGVDeviceDriver extends AbstractOpcDeviceDriver implements D return true; } + @Override + public JSONObject getDeviceStatusName() { + JSONObject jo = new JSONObject(); + String move_1 = ""; + String action_1 = ""; + String walk_y = ""; + String mode = ""; + String status = ""; + + if (this.getMode() == 0) { + mode = "未联机"; + } else if (this.getMode() == 1) { + mode = "单机"; + } else if (this.getMode() == 2) { + mode = "联机"; + } else if (this.getMode() == 3) { + mode = "运行中"; + } + + if (this.getStatus() == 1) { + status = "待机"; + } else if (this.getStatus() == 2) { + status = "生产中"; + } else if (this.getStatus() == 3) { + status = "故障"; + } + + if (this.getMove_1() == 0) { + move_1 = "无货"; + } else if (this.getMove_1() == 1) { + move_1 = "有货"; + } else if (this.getMove_1() == 2) { + move_1 = "有托盘有货"; + } + + if (this.getAction_1() == 1) { + action_1 = "取货中"; + } else if (this.getAction_1() == 2) { + action_1 = "取货完成"; + } else if (this.getAction_1() == 3) { + action_1 = "放货中"; + } else if (this.getAction_1() == 4) { + action_1 = "放货完成"; + } + + if (this.getWalk_y() == 0) { + walk_y = "原位"; + } else if (this.getWalk_y() == 2) { + walk_y = "非原位"; + } + + jo.put("device_name", this.getDevice().getDevice_name()); + jo.put("mode", mode); + jo.put("status", status); + jo.put("move_1", move_1); + jo.put("action_1", action_1); + jo.put("walk_y", walk_y); + jo.put("error", this.getError()); + jo.put("task1", this.getTask1()); + jo.put("isOnline", this.getIsonline()); + jo.put("isError", this.getIserror()); + jo.put("message", this.getMessage()); + jo.put("task_qty", this.getTask_qty()); + jo.put("finishTask_qty", this.getFinishTask_qty()); + jo.put("batch", this.getBatch()); + jo.put("specifications", this.getSpecifications()); + jo.put("qty", this.getQty()); + return jo; + } + + @Override + public void setDeviceStatus(JSONObject data) { + + } } diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_pallet_manipulator/LnshPackagePalletManipulatorDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_pallet_manipulator/LnshPackagePalletManipulatorDeviceDriver.java index ea15531..d541f85 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_pallet_manipulator/LnshPackagePalletManipulatorDeviceDriver.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_pallet_manipulator/LnshPackagePalletManipulatorDeviceDriver.java @@ -17,6 +17,7 @@ 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.monitor.DeviceStageMonitor; import org.nl.acs.opc.Device; import org.nl.acs.order.service.ProduceshiftorderService; import org.nl.acs.order.service.dto.ProduceshiftorderDto; @@ -35,7 +36,7 @@ import java.util.*; @Slf4j @Data @RequiredArgsConstructor -public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { +public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor { protected ItemProtocol itemProtocol = new ItemProtocol(this); @Autowired InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); @@ -1244,4 +1245,71 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD ReadUtil.write(itemMap, server); } + + @Override + public JSONObject getDeviceStatusName() { + JSONObject jo = new JSONObject(); + String mode = ""; + String status = ""; + if (this.getMode() == 0) { + mode = "未联机"; + } else if (this.getMode() == 1) { + mode = "单机"; + } else if (this.getMode() == 2) { + mode = "联机"; + } else if (this.getMode() == 3) { + mode = "运行中"; + } else if (this.getMode() == 4) { + mode = "人工排产确认"; + } else if (this.getMode() == 5) { + mode = "获取托盘信息"; + } else if (this.getMode() == 6) { + mode = "码垛完成"; + } else if (this.getMode() == 7) { + mode = "码垛强制完成"; + } else if (this.getMode() == 8) { + mode = "申请空盘"; + } + + if (this.getStatus() == 1) { + status = "待机"; + } else if (this.getStatus() == 2) { + status = "生产中"; + } else if (this.getStatus() == 3) { + status = "故障"; + } + String onoff_status = ""; + + if (this.getOnoff_status() == 1) { + onoff_status = "关机"; + } else if (this.getOnoff_status() == 2) { + onoff_status = "开机"; + } + + jo.put("device_name", this.getDevice().getDevice_name()); + jo.put("mode", mode); + jo.put("status", status); + jo.put("onoff_status", onoff_status); + jo.put("specifications", this.getSpecifications()); + jo.put("batch", this.getBatch()); + jo.put("isOnline", this.getIsonline()); + jo.put("error", this.getError()); + jo.put("putStation", this.getPut_station()); + jo.put("barcode", this.getBarcode()); + jo.put("material", this.getMaterial()); + jo.put("qty", this.getQty()); + jo.put("open_time", this.getOpen_time()); + jo.put("standby_time", this.getStandby_time()); + jo.put("production_time", this.getProduction_time()); + jo.put("error_time", this.getError_time()); + jo.put("order_No", this.getOrder_No()); + jo.put("isError", this.getIserror()); + jo.put("message", this.getMessage()); + return jo; + } + + @Override + public void setDeviceStatus(JSONObject data) { + + } } diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator/LnshPalletizingManipulatorDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator/LnshPalletizingManipulatorDeviceDriver.java index 7256716..e214e78 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator/LnshPalletizingManipulatorDeviceDriver.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator/LnshPalletizingManipulatorDeviceDriver.java @@ -17,6 +17,7 @@ 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.monitor.DeviceStageMonitor; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceAppService; import org.nl.acs.opc.DeviceAppServiceImpl; @@ -36,7 +37,7 @@ import java.util.*; @Slf4j @Data @RequiredArgsConstructor -public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { +public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor { protected ItemProtocol itemProtocol = new ItemProtocol(this); @Autowired InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); @@ -482,6 +483,69 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri } + @Override + public JSONObject getDeviceStatusName() { + JSONObject jo = new JSONObject(); + String mode = ""; + String status = ""; + String action = ""; + if (this.getMode() == 0) { + mode = "未联机"; + } else if (this.getMode() == 1) { + mode = "单机"; + } else if (this.getMode() == 2) { + mode = "联机"; + } else if (this.getMode() == 3) { + mode = "工作中"; + } else if (this.getMode() == 4) { + mode = "获取托盘信息"; + } else if (this.getMode() == 5) { + mode = "码垛完成"; + } else if (this.getMode() == 6) { + mode = "码垛强制完成"; + } else if (this.getMode() == 7) { + mode = "申请空盘"; + } + + if (this.getStatus() == 1) { + status = "待机"; + } else if (this.getStatus() == 2) { + status = "生产中"; + } else if (this.getStatus() == 3) { + status = "故障"; + } + + if (this.getAction() == 0) { + action = "禁止取放"; + } else if (this.getAction() == 1) { + action = "允许取货"; + } else if (this.getAction() == 2) { + action = "允许放货"; + } else if (this.getAction() == 3) { + action = "允许取放"; + } + + jo.put("device_name", this.getDevice().getDevice_name()); + jo.put("mode", mode); + jo.put("status", status); + jo.put("action", action); + jo.put("isOnline", this.getIsonline()); + jo.put("error", this.getError()); + jo.put("put_station", this.getPut_station()); + jo.put("material", this.getMaterial()); + jo.put("encoder_qty", this.getEncoder_qty()); + jo.put("specifications", this.getSpecifications()); + jo.put("batch", this.getBatch()); + jo.put("isError", this.getIserror()); + jo.put("message", this.getMessage()); + return jo; + } + + @Override + public void setDeviceStatus(JSONObject data) { + + } + // public void writing(int type, int command) { // String to_material_code = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() // + "." + ItemProtocol.item_to_material_code; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/ItemProtocol.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/ItemProtocol.java index 9360938..cec9072 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/ItemProtocol.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/ItemProtocol.java @@ -152,7 +152,7 @@ public class ItemProtocol { } else { return value; } - return "0"; + return ""; } public static List getReadableItemDtos() { diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/LnshPalletizingManipulatorSiteDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/LnshPalletizingManipulatorSiteDeviceDriver.java index 5938cf0..3e66702 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/LnshPalletizingManipulatorSiteDeviceDriver.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/LnshPalletizingManipulatorSiteDeviceDriver.java @@ -17,6 +17,7 @@ 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.monitor.DeviceStageMonitor; import org.nl.acs.opc.Device; import org.nl.acs.route.service.RouteLineService; import org.nl.acs.task.service.TaskService; @@ -35,7 +36,7 @@ import java.util.Map; @Slf4j @Data @RequiredArgsConstructor -public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { +public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor { protected ItemProtocol itemProtocol = new ItemProtocol(this); @Autowired InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); @@ -473,4 +474,78 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic return ""; } + @Override + public JSONObject getDeviceStatusName() { + JSONObject jo = new JSONObject(); + String mode = ""; + String action = ""; + String io_action = ""; + String move = ""; + if (this.getMode() == 0) { + mode = "未联机"; + } else if (this.getMode() == 1) { + mode = "单机"; + } else if (this.getMode() == 2) { + mode = "联机"; + } else if (this.getMode() == 4) { + mode = "叫料"; + } else if (this.getMode() == 5) { + mode = "申请空盘"; + } else if (this.getMode() == 6) { + mode = "申请入库"; + } + + if (this.getAction() == 0) { + action = "禁止取放"; + } else if (this.getAction() == 1) { + action = "允许取货"; + } else if (this.getAction() == 2) { + action = "允许放货"; + } else if (this.getAction() == 3) { + action = "允许取放"; + } + if (this.getIo_action() == 0) { + io_action = "禁止进出"; + } else if (this.getIo_action() == 1) { + io_action = "允许进入"; + } else if (this.getIo_action() == 2) { + io_action = "允许离开"; + } else if (this.getIo_action() == 3) { + io_action = "允许进出"; + } + + if (this.getMove() == 0) { + move = "无货"; + } else if (this.getMove() == 1) { + move = "有货"; + } else if (this.getMove() == 2) { + move = "有托盘有货"; + } + jo.put("device_name", this.getDevice().getDevice_name()); + jo.put("mode", mode); + jo.put("move", move); + jo.put("action", action); + jo.put("io_action", io_action); + jo.put("hasGoods", this.getHasGoods()); + jo.put("isOnline", this.getIsonline()); + jo.put("error", this.getError()); + jo.put("isError", this.getIserror()); + jo.put("message", this.getMessage()); + jo.put("task", this.getTask()); + jo.put("weight", this.getWeight()); + jo.put("material", this.getMaterial()); + jo.put("barcode", this.getBarcode()); + jo.put("specifications", this.getSpecifications()); + jo.put("AlongSide", this.getAlongSide()); + jo.put("BshortSide", this.getBshortSide()); + jo.put("Htrapezoidal", this.getHtrapezoidal()); + jo.put("Wthickness", this.getWthickness()); + jo.put("batch", this.getBatch()); + return jo; + } + + @Override + public void setDeviceStatus(JSONObject data) { + + } } diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_rgv/LnshRGVDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_rgv/LnshRGVDeviceDriver.java index 2f4d7ce..3d05584 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_rgv/LnshRGVDeviceDriver.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_rgv/LnshRGVDeviceDriver.java @@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; import lombok.Data; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -16,6 +17,7 @@ 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.monitor.DeviceStageMonitor; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceAppService; import org.nl.acs.opc.DeviceAppServiceImpl; @@ -38,7 +40,7 @@ import java.util.Map; @Slf4j @Data @RequiredArgsConstructor -public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { +public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor { protected ItemProtocol itemProtocol = new ItemProtocol(this); @Autowired InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); @@ -612,4 +614,106 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi Map itemMap = new HashMap(); ReadUtil.write(itemMap, server); } + + @Override + public JSONObject getDeviceStatusName() { + JSONObject jo = new JSONObject(); + String move_1 = ""; + String move_2 = ""; + String action_1 = ""; + String action_2 = ""; + String walk_y = ""; + String mode = ""; + String status = ""; + + if (this.getMode() == 0) { + mode = "未联机"; + } else if (this.getMode() == 1) { + mode = "单机"; + } else if (this.getMode() == 2) { + mode = "联机"; + } else if (this.getMode() == 3) { + mode = "运行中"; + } + + if (this.getStatus() == 1) { + status = "待机"; + } else if (this.getStatus() == 2) { + status = "生产中"; + } else if (this.getStatus() == 3) { + status = "故障"; + } + + if (this.getMove_1() == 0) { + move_1 = "无货"; + } else if (this.getMove_1() == 1) { + move_1 = "有货"; + } else if (this.getMove_1() == 2) { + move_1 = "有托盘有货"; + } + + if (this.getMove_2() == 0) { + move_2 = "无货"; + } else if (this.getMove_2() == 1) { + move_2 = "有货"; + } else if (this.getMove_2() == 2) { + move_2 = "有托盘有货"; + } + + if (this.getAction_1() == 1) { + action_1 = "取货中"; + } else if (this.getAction_1() == 2) { + action_1 = "取货完成"; + } else if (this.getAction_1() == 3) { + action_1 = "放货中"; + } else if (this.getAction_1() == 4) { + action_1 = "放货完成"; + } + + if (this.getAction_2() == 1) { + action_2 = "取货中"; + } else if (this.getAction_2() == 2) { + action_2 = "取货完成"; + } else if (this.getAction_2() == 3) { + action_2 = "放货中"; + } else if (this.getAction_2() == 4) { + action_2 = "放货完成"; + } + + if (this.getWalk_y() == 0) { + walk_y = "原位"; + } else if (this.getWalk_y() == 2) { + walk_y = "非原位"; + } + + jo.put("device_name", this.getDevice().getDevice_name()); + jo.put("mode", mode); + jo.put("status", status); + jo.put("move_1", move_1); + jo.put("move_2", move_2); + jo.put("action_1", action_1); + jo.put("action_2", action_2); + jo.put("walk_y", walk_y); + jo.put("error", this.getError()); + jo.put("task1", this.getTask1()); + jo.put("task2", this.getTask2()); + jo.put("isOnline", this.getIsonline()); + jo.put("isError", this.getIserror()); + jo.put("message", this.getMessage()); + jo.put("open_time", this.getOpen_time()); + jo.put("standby_time", this.getStandby_time()); + jo.put("production_time", this.getProduction_time()); + jo.put("error_time", this.getError_time()); + jo.put("task_qty", this.getTask_qty()); + jo.put("finishTask_qty", this.getFinishTask_qty()); + jo.put("batch", this.getBatch()); + jo.put("specifications", this.getSpecifications()); + jo.put("qty", this.getQty()); + return jo; + } + + @Override + public void setDeviceStatus(JSONObject data) { + + } } diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_split_manipulator/LnshSplitManipulatorDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_split_manipulator/LnshSplitManipulatorDeviceDriver.java index b32c0f3..08cde86 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_split_manipulator/LnshSplitManipulatorDeviceDriver.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_split_manipulator/LnshSplitManipulatorDeviceDriver.java @@ -17,6 +17,7 @@ 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.monitor.DeviceStageMonitor; import org.nl.acs.opc.Device; import org.nl.acs.order.service.ProduceshiftorderService; import org.nl.acs.order.service.dto.ProduceshiftorderDto; @@ -34,7 +35,7 @@ import java.util.*; @Slf4j @Data @RequiredArgsConstructor -public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { +public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor { protected ItemProtocol itemProtocol = new ItemProtocol(this); @Autowired InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); @@ -1038,4 +1039,57 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im ReadUtil.write(itemMap, server); } + + @Override + public JSONObject getDeviceStatusName() { + JSONObject jo = new JSONObject(); + String mode = ""; + if (this.getMode() == 0) { + mode = "未联机"; + } else if (this.getMode() == 1) { + mode = "单机"; + } else if (this.getMode() == 2) { + mode = "联机"; + } else if (this.getMode() == 3) { + mode = "工作中"; + } else if (this.getMode() == 5) { + mode = "获取托盘信息"; + } else if (this.getMode() == 6) { + mode = "拆垛完成"; + } else if (this.getMode() == 7) { + mode = "申请空盘"; + } + + String onoff_status = ""; + if (this.getOnoff_status() == 0) { + onoff_status = "关机"; + } else if (this.getOnoff_status() == 1) { + onoff_status = "开机"; + } + jo.put("device_name", this.getDevice().getDevice_name()); + jo.put("mode", mode); + jo.put("isOnline", this.getIsonline()); + jo.put("error", this.getError()); + jo.put("getStation", this.getGetStation()); + jo.put("barcode", this.getBarcode()); + jo.put("material", this.getMaterial()); + jo.put("total_split", this.getTotal_split()); + jo.put("open_time", this.getOpen_time()); + jo.put("standby_time", this.getStandby_time()); + jo.put("production_time", this.getProduction_time()); + jo.put("error_time", this.getError_time()); + jo.put("batch", this.getBatch()); + jo.put("specifications", this.getSpecifications()); + jo.put("qty", this.getQty()); + jo.put("onoff_status", onoff_status); + jo.put("isError", this.getIserror()); + jo.put("message", this.getMessage()); + + return jo; + } + + @Override + public void setDeviceStatus(JSONObject data) { + + } } diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java index 7d19a9a..7a816a9 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java @@ -19,6 +19,7 @@ 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.monitor.DeviceStageMonitor; import org.nl.acs.opc.Device; import org.nl.acs.route.service.RouteLineService; import org.nl.acs.task.service.TaskService; @@ -37,7 +38,7 @@ import java.util.*; @Slf4j @Data @RequiredArgsConstructor -public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { +public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor { protected ItemProtocol itemProtocol = new ItemProtocol(this); @Autowired InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); @@ -661,4 +662,74 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements return ""; } + @Override + public JSONObject getDeviceStatusName() { + JSONObject jo = new JSONObject(); + String mode = ""; + String action = ""; + String io_action = ""; + String move = ""; + if (this.getMode() == 0) { + mode = "未联机"; + } else if (this.getMode() == 1) { + mode = "单机"; + } else if (this.getMode() == 2) { + mode = "联机"; + } else if (this.getMode() == 4) { + mode = "叫料"; + } else if (this.getMode() == 5) { + mode = "申请空盘"; + } else if (this.getMode() == 6) { + mode = "申请入库"; + } + + if (this.getAction() == 0) { + action = "禁止取放"; + } else if (this.getAction() == 1) { + action = "允许取货"; + } else if (this.getAction() == 2) { + action = "允许放货"; + } else if (this.getAction() == 3) { + action = "允许取放"; + } + if (this.getIo_action() == 0) { + io_action = "禁止进出"; + } else if (this.getIo_action() == 1) { + io_action = "允许进入"; + } else if (this.getIo_action() == 2) { + io_action = "允许离开"; + } else if (this.getIo_action() == 3) { + io_action = "允许进出"; + } + + if (this.getMove() == 0) { + move = "无货"; + } else if (this.getMove() == 1) { + move = "有货"; + } else if (this.getMove() == 2) { + move = "有托盘有货"; + } + jo.put("device_name", this.getDevice().getDevice_name()); + jo.put("mode", mode); + jo.put("move", move); + jo.put("action", action); + jo.put("io_action", io_action); + jo.put("hasGoods", this.getHasGoods()); + jo.put("isOnline", this.getIsonline()); + jo.put("error", this.getError()); + jo.put("isError", this.getIserror()); + jo.put("message", this.getMessage()); + jo.put("task", this.getTask()); + jo.put("weight", this.getWeight()); + jo.put("material", this.getMaterial()); + jo.put("barcode", this.getBarcode()); + jo.put("specifications", this.getSpecifications()); + jo.put("batch", this.getBatch()); + return jo; + } + + @Override + public void setDeviceStatus(JSONObject data) { + + } } diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/rljn_package_palletSplit_manipulator/ItemProtocol.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/rljn_package_palletSplit_manipulator/ItemProtocol.java index b7f0557..009b60d 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/rljn_package_palletSplit_manipulator/ItemProtocol.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/rljn_package_palletSplit_manipulator/ItemProtocol.java @@ -767,7 +767,7 @@ public class ItemProtocol { } else { return value; } - return "0"; + return ""; } public static List getReadableItemDtos() { diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/rljn_package_palletSplit_manipulator/RljnPackagePalletSplitManipulatorDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/rljn_package_palletSplit_manipulator/RljnPackagePalletSplitManipulatorDeviceDriver.java index c64fda9..7a6234d 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/rljn_package_palletSplit_manipulator/RljnPackagePalletSplitManipulatorDeviceDriver.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/rljn_package_palletSplit_manipulator/RljnPackagePalletSplitManipulatorDeviceDriver.java @@ -17,6 +17,7 @@ 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.monitor.DeviceStageMonitor; import org.nl.acs.opc.Device; import org.nl.acs.order.service.ProduceshiftorderService; import org.nl.acs.order.service.dto.ProduceshiftorderDto; @@ -35,7 +36,7 @@ import java.util.*; @Slf4j @Data @RequiredArgsConstructor -public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { +public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor { protected ItemProtocol itemProtocol = new ItemProtocol(this); @Autowired InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); @@ -689,13 +690,15 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe case 6: //码垛完成 if (!requireSucess) { + applyEmpty(); palletizing(); } break; case 7: - //码垛强制完成 + //码垛强制完成 半托缓存 if (!requireSucess) { - mandatoryPalletizing(); + applyEmpty(); + mandatoryPalletizing("0"); } break; case 8: @@ -716,6 +719,19 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe enterProduction(json); } break; + case 10: + //叫料 + if (!requireSucess && getStation>0 && StrUtil.isNotEmpty(material)) { + callMaterial(); + } + break; + case 11: + //强制去包装 + if (!requireSucess) { + applyEmpty(); + mandatoryPalletizing("1"); + } + break; } switch (flag) { @@ -819,6 +835,43 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe } } + + /** + * 叫料 + * + * @param + */ + public synchronized boolean callMaterial() { + 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; + JSONObject json = new JSONObject(); + String linkobj = (String)this.getDevice().getExtraValue().get("link_device_code"); + String demosub = linkobj.substring(1,linkobj.length()-1); + String demoArray[] = demosub.split(","); + List demoList = Arrays.asList(demoArray); + json.put("device_code",demoList.get(getStation-1).replace("\"","")); + json.put("type","2"); + json.put("material_code",material); + json.put("vehicle_code",barcode); + json.put("is_full","1"); + HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json); + if (ObjectUtil.isNotEmpty(result)) { + JSONObject jsonObject = JSONObject.parseObject(result.body()); + if (result.getStatus() == 200 && StrUtil.equals(jsonObject.getString("status"),"200")) { + this.writing(1); + } + this.setRequireSucess(true); + } + return true; + } + } + + + /** * 排产单确认 * @@ -864,7 +917,11 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe } else { this.instruction_require_time = date; JSONObject json = new JSONObject(); - json.put("device_code",this.device_code); + String linkobj = (String)this.getDevice().getExtraValue().get("link_device_code"); + String demosub = linkobj.substring(1,linkobj.length()-1); + String demoArray[] = demosub.split(","); + List demoList = Arrays.asList(demoArray); + json.put("device_code",demoList.get(put_station-1).replace("\"","")); json.put("vehicle_code",barcode); JSONObject jo = acsToWmsService.getVehicle(json); @@ -1018,7 +1075,8 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe String demosub = linkobj.substring(1,linkobj.length()-1); String demoArray[] = demosub.split(","); List demoList = Arrays.asList(demoArray); - json.put("device_code",demoList.get(put_station-1).replace("\"","")); json.put("qty",qty); + json.put("device_code",demoList.get(put_station-1).replace("\"","")); + json.put("qty",qty); json.put("vehicle_code",barcode); json.put("is_full","1"); json.put("product_code",product_code); @@ -1097,7 +1155,7 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe * * @param */ - public synchronized boolean mandatoryPalletizing() { + public synchronized boolean mandatoryPalletizing(String 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); @@ -1109,9 +1167,11 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe String demosub = linkobj.substring(1,linkobj.length()-1); String demoArray[] = demosub.split(","); List demoList = Arrays.asList(demoArray); - json.put("device_code",demoList.get(put_station-1).replace("\"","")); json.put("qty",qty); + json.put("device_code",demoList.get(put_station-1).replace("\"","")); + json.put("qty",qty); json.put("vehicle_code",barcode); - json.put("is_full","0"); + json.put("material_code",material); + json.put("is_full",type); json.put("product_code",product_code); json.put("AlongSide",AlongSide); json.put("BshortSide",BshortSide); @@ -1176,8 +1236,8 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe JSONObject jsonObject = JSONObject.parseObject(result.body()); if (result.getStatus() == 200 && StrUtil.equals(jsonObject.getString("status"),"200")) { this.writing(this.mode); + this.setRequireSucess(true); } - this.setRequireSucess(true); } return true; } @@ -1262,4 +1322,36 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe ReadUtil.write(itemMap, server); } + + @Override + public JSONObject getDeviceStatusName() { + JSONObject jo = new JSONObject(); + jo.put("device_code", device.getDevice_code()); + jo.put("mode", this.getMode()); + jo.put("status", this.getStatus()); + jo.put("isOnline", this.getIsonline()); + jo.put("error", this.getError()); + jo.put("putStation", this.getPut_station()); + jo.put("barcode", this.getBarcode()); + jo.put("material", this.getMaterial()); + jo.put("qty", this.getQty()); + jo.put("open_time", this.getOpen_time()); + jo.put("standby_time", this.getStandby_time()); + jo.put("production_time", this.getProduction_time()); + jo.put("error_time", this.getError_time()); + jo.put("order_No", this.getOrder_No()); + jo.put("onoff_status", this.getOnoff_status()); + jo.put("getStation", this.getGetStation()); + jo.put("specifications", this.getSpecifications()); + jo.put("batch", this.getBatch()); + jo.put("total_split", this.getTotal_split()); + jo.put("isError", this.getIserror()); + jo.put("message", this.getMessage()); + return jo; + } + + @Override + public void setDeviceStatus(JSONObject data) { + + } } diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/special_ordinary_site/SpecialOrdinarySiteDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/special_ordinary_site/SpecialOrdinarySiteDeviceDriver.java index 4607678..edc0b9b 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/special_ordinary_site/SpecialOrdinarySiteDeviceDriver.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/special_ordinary_site/SpecialOrdinarySiteDeviceDriver.java @@ -15,8 +15,10 @@ 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.instruction.service.InstructionService; import org.nl.acs.instruction.service.dto.Instruction; +import org.nl.acs.monitor.DeviceStageMonitor; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceAppService; import org.nl.acs.opc.DeviceAppServiceImpl; @@ -434,6 +436,5 @@ public class SpecialOrdinarySiteDeviceDriver extends AbstractDeviceDriver implem return true; } } - } 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 3620868..8688d29 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 @@ -25,7 +25,6 @@ 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.RedisUtils; import org.nl.utils.SpringContextHolder; import org.nl.wql.core.bean.WQLObject; import org.springframework.beans.factory.annotation.Autowired; @@ -389,16 +388,29 @@ public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver imple @Override public JSONObject getDeviceStatusName() { - JSONObject data = new JSONObject(); - data.put("device_name", this.getDevice().getDevice_name()); - if (mode == 1) { - - data.put("mode", "单机"); + String move = ""; + JSONObject jo = new JSONObject(); + if (this.getHasGoods() == 0) { + move = "无货"; + } else if (this.getHasGoods() == 1) { + move = "有货"; + } else if (this.getHasGoods() == 2) { + move = "有托盘有货"; } - if (mode == 2) { - data.put("mode", "联机"); - } - return data; + jo.put("device_name", this.getDevice().getDevice_name()); + jo.put("move", move); + jo.put("container", this.getContainer()); + jo.put("hasGoods", this.getHasGoods()); + jo.put("isOnline", true); + //点击弹出 + jo.put("is_click", true); + jo.put("device_type", device.getDevice_type()); + jo.put("error", this.getError()); + jo.put("isError", this.getIserror()); + jo.put("message", this.getMessage()); + jo.put("material", this.getMaterial()); + jo.put("batch", this.getBatch()); + return jo; } @Override diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/ext/xr_lk/rest/AcsToXrlkController.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/ext/xr_lk/rest/AcsToXrlkController.java deleted file mode 100644 index f464d80..0000000 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/ext/xr_lk/rest/AcsToXrlkController.java +++ /dev/null @@ -1,58 +0,0 @@ - -package org.nl.acs.ext.xr_lk.rest; - - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.ext.xr_lk.service.AcsToXrlkService; -import org.nl.annotation.Log; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * @author ludj - * @date 2021-07-21 - **/ -@RestController -@RequiredArgsConstructor -@Api(tags = "新锐立库接口") -@RequestMapping("/api/xrlk") -@Slf4j -public class AcsToXrlkController { - private final AcsToXrlkService acsToXrlkService; - - @PostMapping("/isPutPermission") - @Log("获取对接位是否允许放货") - @ApiOperation("获取对接位是否允许放货") - public ResponseEntity getPutPermission(@RequestBody String device_code) { - return new ResponseEntity<>(acsToXrlkService.isPutPermission(device_code), HttpStatus.OK); - } - - @PostMapping("/isTakePermission") - @Log("获取对接位是否允许取货") - @ApiOperation("获取对接位是否允许取货") - public ResponseEntity getTakePermission(@RequestBody String device_code) { - return new ResponseEntity<>(acsToXrlkService.isTakePermission(device_code), HttpStatus.OK); - } - - @PostMapping("/invokeDoor") - @Log("获取是否允许进入") - @ApiOperation("获取是否允许进入") - public ResponseEntity getInOutMode(@RequestBody String device_code) { - return new ResponseEntity<>(acsToXrlkService.invokeDoor(device_code), HttpStatus.OK); - } - - @PostMapping("/AGVWorkStatus") - @Log("动作完成") - @ApiOperation("动作完成") - public ResponseEntity AGVWorkStatus(@RequestBody String device_code, String type) { - return new ResponseEntity<>(acsToXrlkService.AGVWorkStatus(device_code, type), HttpStatus.OK); - } - -} diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/ext/xr_lk/rest/XrlkToAcsController.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/ext/xr_lk/rest/XrlkToAcsController.java deleted file mode 100644 index 5662aae..0000000 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/ext/xr_lk/rest/XrlkToAcsController.java +++ /dev/null @@ -1,25 +0,0 @@ - -package org.nl.acs.ext.xr_lk.rest; - - -import io.swagger.annotations.Api; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.ext.xr_lk.service.XrlkToAcsService; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * @author wangs - * @date 2021-07-21 - **/ -@RestController -@RequiredArgsConstructor -@Api(tags = "新锐立库接口") -@RequestMapping("/api/xrlk") -@Slf4j -public class XrlkToAcsController { - private final XrlkToAcsService xrlkToAcsService; - - -} diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/ext/xr_lk/service/AcsToXrlkService.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/ext/xr_lk/service/AcsToXrlkService.java deleted file mode 100644 index e6992dc..0000000 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/ext/xr_lk/service/AcsToXrlkService.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.nl.acs.ext.xr_lk.service; - -import cn.hutool.http.HttpResponse; - -public interface AcsToXrlkService { - - /** - * 获取是否允许进入: - * - * @param device_code - * @return - */ - HttpResponse invokeDoor(String device_code); - - /** - * 获取对接位是否允许放货: - * - * @param device_code - * @return - */ - HttpResponse isPutPermission(String device_code); - - /** - * 获取对接位是否允许取货 - * - * @param device_code - * @return - */ - HttpResponse isTakePermission(String device_code); - - - /** - * 动作完成 - * - * @param device_code - * @return - */ - HttpResponse AGVWorkStatus(String device_code, String type); - - -} diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/ext/xr_lk/service/XrlkToAcsService.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/ext/xr_lk/service/XrlkToAcsService.java deleted file mode 100644 index 3def5bf..0000000 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/ext/xr_lk/service/XrlkToAcsService.java +++ /dev/null @@ -1,6 +0,0 @@ -package org.nl.acs.ext.xr_lk.service; - - -public interface XrlkToAcsService { - -} diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/ext/xr_lk/service/impl/AcsToXRlkServiceImpl.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/ext/xr_lk/service/impl/AcsToXRlkServiceImpl.java deleted file mode 100644 index 5386d37..0000000 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/ext/xr_lk/service/impl/AcsToXRlkServiceImpl.java +++ /dev/null @@ -1,105 +0,0 @@ -package org.nl.acs.ext.xr_lk.service.impl; - -import cn.hutool.http.HttpRequest; -import cn.hutool.http.HttpResponse; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.config.AcsConfig; -import org.nl.acs.config.server.AcsConfigService; -import org.nl.acs.device.address.service.AddressService; -import org.nl.acs.device.address.service.dto.AddressDto; -import org.nl.acs.device.service.DeviceService; -import org.nl.acs.ext.xr_lk.service.AcsToXrlkService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -@Service -@RequiredArgsConstructor -@Slf4j -public class AcsToXRlkServiceImpl implements AcsToXrlkService { - - @Autowired - AcsConfigService acsConfigService; - - @Autowired - DeviceService deviceService; - - @Autowired - AddressService addressService; - - @Override - public HttpResponse invokeDoor(String device_code) { - String wcsurl = acsConfigService.findConfigFromCache().get(AcsConfig.ERPURL); - AddressDto addressDto = addressService.findByCode("invokeDoor"); - String url = wcsurl + addressDto.getMethods_url() + device_code; - HttpResponse result = null; - try { - //{"status":400,"timestamp":"2021-10-22 16:32:22","message":"业务类型不正确!"} - result = HttpRequest.get(url) - .execute(); - System.out.println(result); - } catch (Exception e) { - String msg = e.getMessage(); - //网络不通 - System.out.println(msg); - } - return result; - } - - @Override - public HttpResponse isPutPermission(String device_code) { - String wcsurl = acsConfigService.findConfigFromCache().get(AcsConfig.ERPURL); - AddressDto addressDto = addressService.findByCode("isPutPermission"); - String url = wcsurl + addressDto.getMethods_url() + device_code; - HttpResponse result = null; - try { - //{"status":400,"timestamp":"2021-10-22 16:32:22","message":"业务类型不正确!"} - result = HttpRequest.get(url) - .execute(); - System.out.println(result); - } catch (Exception e) { - String msg = e.getMessage(); - //网络不通 - System.out.println(msg); - } - return result; - } - - @Override - public HttpResponse isTakePermission(String device_code) { - String wcsurl = acsConfigService.findConfigFromCache().get(AcsConfig.ERPURL); - AddressDto addressDto = addressService.findByCode("isTakePermission"); - String url = wcsurl + addressDto.getMethods_url() + device_code; - HttpResponse result = null; - try { - //{"status":400,"timestamp":"2021-10-22 16:32:22","message":"业务类型不正确!"} - result = HttpRequest.get(url) - .execute(); - System.out.println(result); - } catch (Exception e) { - String msg = e.getMessage(); - //网络不通 - System.out.println(msg); - } - return result; - } - - @Override - public HttpResponse AGVWorkStatus(String device_code, String type) { - String wcsurl = acsConfigService.findConfigFromCache().get(AcsConfig.ERPURL); - AddressDto addressDto = addressService.findByCode("AGVWorkStatus"); - String url = wcsurl + addressDto.getMethods_url(); - HttpResponse result = null; - try { - //{"status":400,"timestamp":"2021-10-22 16:32:22","message":"业务类型不正确!"} - result = HttpRequest.get(url) - .execute(); - System.out.println(result); - } catch (Exception e) { - String msg = e.getMessage(); - //网络不通 - System.out.println(msg); - } - return result; - } -} diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/ext/xr_lk/service/impl/XrlkToAcsServiceImpl.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/ext/xr_lk/service/impl/XrlkToAcsServiceImpl.java deleted file mode 100644 index 41a50b9..0000000 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/ext/xr_lk/service/impl/XrlkToAcsServiceImpl.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.nl.acs.ext.xr_lk.service.impl; - -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device.service.DeviceService; -import org.nl.acs.ext.xr_lk.service.XrlkToAcsService; -import org.nl.acs.instruction.service.InstructionService; -import org.nl.acs.opc.DeviceAppService; -import org.nl.acs.route.service.RouteLineService; -import org.nl.acs.task.service.TaskService; -import org.springframework.stereotype.Service; - -@Service -@RequiredArgsConstructor -@Slf4j -public class XrlkToAcsServiceImpl implements XrlkToAcsService { - - private final InstructionService InstructionService; - private final TaskService TaskService; - private final DeviceService DeviceService; - private final DeviceAppService DeviceAppService; - private final RouteLineService RouteLineService; - - -} diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/monitor/DeviceStageMonitor.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/monitor/DeviceStageMonitor.java index 23c0357..2cc1e37 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/monitor/DeviceStageMonitor.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/monitor/DeviceStageMonitor.java @@ -3,7 +3,9 @@ package org.nl.acs.monitor; import com.alibaba.fastjson.JSONObject; /** - * 设备监控服务 + * @Author: lyd + * @Description: 设备监控服务 + * @Date: 2022-08-17 */ public interface DeviceStageMonitor { /** diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/monitor/rest/DeviceStageMonitorController.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/monitor/rest/DeviceStageMonitorController.java index b8e2a14..e4eaf06 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/monitor/rest/DeviceStageMonitorController.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/monitor/rest/DeviceStageMonitorController.java @@ -1,4 +1,38 @@ package org.nl.acs.monitor.rest; +import com.alibaba.fastjson.JSONArray; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.nl.acs.monitor.service.DeviceStageMonitorService; +import org.nl.annotation.Log; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @Author: lyd + * @Description: 设备信息 + * @Date: 2022-08-17 + */ +@Slf4j +@RestController +@RequiredArgsConstructor +@Api(tags = "设备信息") +@RequestMapping("/api/deviceInfo") public class DeviceStageMonitorController { + + private final DeviceStageMonitorService deviceStageMonitorService; + + @Log("获取舞台设备信息") + @ApiOperation("获取舞台设备信息") + @PostMapping("/getDeviceByCodes") + public ResponseEntity getDeviceByCodes(@RequestBody String json) { + JSONArray jsonArray = JSONArray.parseArray(json); + return new ResponseEntity<>(deviceStageMonitorService.getData(jsonArray), HttpStatus.OK); + } } diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/monitor/service/DeviceStageMonitorService.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/monitor/service/DeviceStageMonitorService.java index 78ede04..485f6a0 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/monitor/service/DeviceStageMonitorService.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/monitor/service/DeviceStageMonitorService.java @@ -3,7 +3,9 @@ package org.nl.acs.monitor.service; import com.alibaba.fastjson.JSONArray; /** - * 设备舞台监控服务 + * @Author: lyd + * @Description: 取设备舞台监控数据 + * @Date: 2022-08-17 */ public interface DeviceStageMonitorService { /** diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/monitor/service/impl/DeviceStageMonitorServiceImpl.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/monitor/service/impl/DeviceStageMonitorServiceImpl.java index fcea861..333aa2b 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/monitor/service/impl/DeviceStageMonitorServiceImpl.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/monitor/service/impl/DeviceStageMonitorServiceImpl.java @@ -11,6 +11,11 @@ import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceAppService; import org.springframework.stereotype.Service; +/** + * @Author: lyd + * @Description: + * @Date: 2022-08-17 + */ @Slf4j @Service @RequiredArgsConstructor @@ -35,10 +40,11 @@ public class DeviceStageMonitorServiceImpl implements DeviceStageMonitorService JSONObject json = new JSONObject(); if (device.getDeviceDriver() instanceof DeviceStageMonitor) { DeviceStageMonitor monitorService = (DeviceStageMonitor) device.getDeviceDriver(); - json = monitorService.getDeviceStatusName(); + json = monitorService.getDeviceStatusName(); } obj.put("data", json); + obj.put("device_name",json.get("device_name")); obj.put("device_code", js.get("device_code")); obj.put("id", js.getString("id")); // 设备不存在就只保留id,方便前端查看 arr.add(obj); diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/test/rest/TestController.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/test/rest/TestController.java deleted file mode 100644 index 6d65380..0000000 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/test/rest/TestController.java +++ /dev/null @@ -1,104 +0,0 @@ - -package org.nl.acs.test.rest; - - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.test.service.TestService; -import org.nl.annotation.Log; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.io.IOException; -import java.util.Map; - -/** - * @author ldjun - * @date 2021-03-18 - **/ -@RestController -@RequiredArgsConstructor -@Api(tags = "任务管理") -@RequestMapping("/api/test") -@Slf4j -public class TestController { - - private final TestService testService; - - @Log("test1") - @ApiOperation("test1") - @PostMapping("/test1") - //@PreAuthorize("@el.check('task:add')") - public ResponseEntity test1() throws IOException { - testService.test1(); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @Log("test2") - @ApiOperation("test2") - @PostMapping("/test2") - //@PreAuthorize("@el.check('task:add')") - public ResponseEntity test2() throws IOException { - testService.test2(); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @Log("test3") - @ApiOperation("test3") - @PostMapping("/test3") - //@PreAuthorize("@el.check('task:add')") - public ResponseEntity test3() throws IOException { - testService.test3(); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @Log("test4") - @ApiOperation("test4") - @PostMapping("/test4") - //@PreAuthorize("@el.check('task:add')") - public ResponseEntity test4(@RequestBody Map map) throws IOException { - testService.test4(map); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @Log("test5") - @ApiOperation("test5") - @PostMapping("/test5") - //@PreAuthorize("@el.check('task:add')") - public ResponseEntity test5() throws IOException { - testService.test5(); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @Log("test6") - @ApiOperation("test6") - @PostMapping("/test6") - //@PreAuthorize("@el.check('task:add')") - public ResponseEntity test6(@RequestBody Map map) throws IOException { - testService.test6(map); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @Log("test7") - @ApiOperation("test7") - @PostMapping("/test7") - //@PreAuthorize("@el.check('task:add')") - public ResponseEntity test7() throws IOException { - testService.test7(); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @Log("print") - @ApiOperation("print") - @PostMapping("/print") - //@PreAuthorize("@el.check('task:add')") - public ResponseEntity print() throws IOException { - return new ResponseEntity<>(testService.print(), HttpStatus.OK); - } -} diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/test/service/TestService.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/test/service/TestService.java deleted file mode 100644 index ef80fe4..0000000 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/test/service/TestService.java +++ /dev/null @@ -1,72 +0,0 @@ - -package org.nl.acs.test.service; - - - -import com.alibaba.fastjson.JSONObject; - -import java.io.IOException; -import java.util.Map; - -/** - * @author ldjun - * @description 服务接口 - * @date 2021-03-18 - **/ -public interface TestService { - /** - * 初始化 - * - * @throws IOException - */ - void test1() throws IOException; - - /** - * 触发打印 - * - * @throws IOException - */ - void test2() throws IOException; - - /** - * 加载模板 - * - * @throws IOException - */ - void test3() throws IOException; - - /** - * 发送bufferdata缓存数据 - * - * @throws IOException - */ - void test4(Map map) throws IOException; - - /** - * 清空缓存 - * - * @throws IOException - */ - void test5() throws IOException; - - /** - * 发送settext指令 - * - * @throws IOException - */ - void test6(Map map) throws IOException; - - /** - * 事务发送 - * - * @throws IOException - */ - void test7() throws IOException; - - /** - * 发送打印 - * - * @throws IOException - */ - JSONObject print() throws IOException; -} diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/test/service/impl/TestServiceImpl.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/test/service/impl/TestServiceImpl.java deleted file mode 100644 index 8b9fedf..0000000 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/test/service/impl/TestServiceImpl.java +++ /dev/null @@ -1,124 +0,0 @@ - -package org.nl.acs.test.service.impl; - - -import com.alibaba.fastjson.JSONObject; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.test.service.TestService; -import org.nl.start.auto.run.LetteringSocketConnectionAutoRun; -import org.springframework.stereotype.Service; - -import java.io.IOException; -import java.util.Map; - -/** - * @author ldjun - * @description 服务实现 - * @date 2021-03-18 - **/ -@Service -@RequiredArgsConstructor -@Slf4j -public class TestServiceImpl implements TestService { - - @Override - public void test1() throws IOException { - - try { - //返回编译完成信号 - LetteringSocketConnectionAutoRun.write("SETMSG 26 1" + "\r\n"); - //返回打印开始信号 - LetteringSocketConnectionAutoRun.write("SETMSG 2 1" + "\r\n"); - //返回打印完成信号 - LetteringSocketConnectionAutoRun.write("SETMSG 3 1" + "\r\n"); - //返回每次打印的内容 - LetteringSocketConnectionAutoRun.write("SETMSG 24 1" + "\r\n"); - - } catch (Exception e) { - e.printStackTrace(); - } - } - - - @Override - public void test2() throws IOException { - try { - LetteringSocketConnectionAutoRun.write("BUFFERCLEAR" + "\r\n"); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - public void test3() throws IOException { - // LOADPROJECT "ZY.lbm" - //此处为模板名称 D310激光机,加载CS.lbm模版 - String str = "CS.lbm"; - try { - LetteringSocketConnectionAutoRun.write("LOADPROJECT" + " \"" + str + "\"" + "\r\n"); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - public void test4(Map map) throws IOException { - String name = map.get("name").toString(); - String name2 = map.get("name2").toString(); - String name3 = map.get("name3").toString(); - String name4 = map.get("name4").toString(); - String yh = "\""; - try { - //先清空缓存 - LetteringSocketConnectionAutoRun.write("BUFFERCLEAR" + "\r\n"); -// test5(); -// LetteringSocketConnectionAutoRun.write("BUFFERDATA -1 "+ yh + name + yh +" " + yh + name2 + yh +" " -// +yh +name3 +yh + " " + yh + name4 + yh + "\r\n"); - - //两行 -// LetteringSocketConnectionAutoRun.write("BUFFERDATA -1 "+ yh + name + yh +" " + yh + name2 + yh +" " -// + "\r\n"); - - LetteringSocketConnectionAutoRun.write("BUFFERDATA -1 " + yh + name + yh + " " + "\r\n"); - - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - public void test5() throws IOException { - try { - LetteringSocketConnectionAutoRun.write("BUFFERCLEAR" + "\r\n"); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - public void test6(Map map) throws IOException { - String yh = "\""; - String inst = map.get("inst").toString(); - String inst2 = map.get("inst2").toString(); - String strInst = "SETTEXT " + "S1" + " " + yh + inst + yh + "\r\n"; //2个变量 - String strInst2 = "SETTEXT " + "S2" + " " + yh + inst2 + yh + "\r\n"; //2个变量 - - LetteringSocketConnectionAutoRun.write(strInst); - LetteringSocketConnectionAutoRun.write(strInst2); - - } - - @Override - public void test7() throws IOException { - - } - - @Override - public JSONObject print() throws IOException { - JSONObject jo = new JSONObject(); - jo.put("cpbh", "A1111111111"); - jo.put("cpmc", "产品名称:A1111111111"); - return jo; - } -} diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/start/auto/run/LetteringSocketConnectionAutoRun.java b/acs/hd/nladmin-system/src/main/java/org/nl/start/auto/run/LetteringSocketConnectionAutoRun.java deleted file mode 100644 index 33943ab..0000000 --- a/acs/hd/nladmin-system/src/main/java/org/nl/start/auto/run/LetteringSocketConnectionAutoRun.java +++ /dev/null @@ -1,138 +0,0 @@ -package org.nl.start.auto.run; - -import cn.hutool.core.util.StrUtil; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.config.AcsConfig; -import org.nl.acs.config.server.AcsConfigService; -import org.nl.acs.config.server.impl.AcsConfigServiceImpl; -import org.nl.utils.SpringContextHolder; -import org.springframework.stereotype.Component; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.Socket; -import java.util.Date; - -@Slf4j -@Component -public class LetteringSocketConnectionAutoRun extends AbstractAutoRunnable { - - Socket s; - String ip = "127.0.0.1"; - int port = 1234; - static DataOutputStream dos; - static DataInputStream dis; - private int recordTimeOut = 10000; - private Date recordTime; - boolean bConnected = true; - - public LetteringSocketConnectionAutoRun() { - this.recordTime = new Date((new Date()).getTime() - (long) this.recordTimeOut); - } - - public String getCode() { - return LetteringSocketConnectionAutoRun.class.getSimpleName(); - } - - public String getName() { - return "海亮激光刻字在线连接"; - } - - public void autoRun() throws IOException { - AcsConfigService acsConfigService = SpringContextHolder.getBean(AcsConfigServiceImpl.class); - - ip = acsConfigService.findConfigFromCache().get(AcsConfig.LETTERINGURL); - port = Integer.parseInt(acsConfigService.findConfigFromCache().get(AcsConfig.LETTERINGPORT)); - byte[] b = new byte[1028]; - s = new Socket(ip, port); - dos = new DataOutputStream(s.getOutputStream()); - dis = new DataInputStream(s.getInputStream()); - - while (bConnected) { - int count = dis.read(b); - if (count == -1) { - break; - } - int[] arr = new int[count]; - StringBuffer bs = new StringBuffer(); - for (int i = 0; i < count; i++) { - int temp = b[i]; - if (temp < 0) - temp += 256; - arr[i] = temp; - bs.append(asciiToString(String.valueOf(temp))); - } - System.out.println("收到请求参数:" + bs); - //打印完成 - if (StrUtil.equals(bs.toString(), "MSG 3")) { - - } - } - } - - public static void write(String str) throws IOException { - System.out.println(str); - dos.write(hexStringToByte(bytesToHexString(stringToByte(str)))); - } - - public static byte[] stringToByte(String str) { - byte[] bytes = str.getBytes(); - return bytes; - } - - public static String bytesToHexString(byte[] src) { - StringBuilder builder = new StringBuilder(); - for (int i = 0; i < src.length; i++) { - int v = src[i] & 0xff; - String hv = Integer.toHexString(v); - if (hv.length() < 2) { - builder.append(0); - } - builder.append(hv); - } - return builder.toString().toUpperCase(); - } - - - public static byte[] hexStringToByte(String hex) { - byte[] b = new byte[hex.length() / 2]; - int j = 0; - for (int i = 0; i < b.length; i++) { - char c0 = hex.charAt(j++); - char c1 = hex.charAt(j++); - b[i] = (byte) ((parse(c0) << 4) | parse(c1)); - } - return b; - } - - - private static int parse(char c) { - if (c >= 'a') - return (c - 'a' + 10) & 0x0f; - if (c >= 'A') - return (c - 'A' + 10) & 0x0f; - return (c - '0') & 0x0f; - } - - /* - * Ascii转换为字符串 - * - * @param value - * @return - */ - public static String asciiToString(String value) { - StringBuffer sbu = new StringBuffer(); - String[] chars = value.split(","); - for (int i = 0; i < chars.length; i++) { - sbu.append((char) Integer.parseInt(chars[i])); - } - return sbu.toString(); - } - - - public static void main(String[] args) throws UnsupportedEncodingException { - byte[] bytes = "你".getBytes("utf-8"); - } -} diff --git a/acs/qd/src/api/acs/monitor/deviceStageMonitor.js b/acs/qd/src/api/acs/monitor/deviceStageMonitor.js new file mode 100644 index 0000000..00d7228 --- /dev/null +++ b/acs/qd/src/api/acs/monitor/deviceStageMonitor.js @@ -0,0 +1,9 @@ +import request from '@/utils/request' + +export function getDeviceByCodes(data) { // 获取舞台上设备信息 + return request({ + url: 'api/deviceInfo/getDeviceByCodes', + method: 'post', + data: data + }) +} diff --git a/acs/qd/src/assets/icons/svg/clear.svg b/acs/qd/src/assets/icons/svg/clear.svg new file mode 100644 index 0000000..add284f --- /dev/null +++ b/acs/qd/src/assets/icons/svg/clear.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/acs/qd/src/assets/icons/svg/downAlign.svg b/acs/qd/src/assets/icons/svg/downAlign.svg new file mode 100644 index 0000000..d02dce2 --- /dev/null +++ b/acs/qd/src/assets/icons/svg/downAlign.svg @@ -0,0 +1,2 @@ + diff --git a/acs/qd/src/assets/icons/svg/horizontalAlign.svg b/acs/qd/src/assets/icons/svg/horizontalAlign.svg new file mode 100644 index 0000000..ed79e1a --- /dev/null +++ b/acs/qd/src/assets/icons/svg/horizontalAlign.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/acs/qd/src/assets/icons/svg/horizontalDistribution.svg b/acs/qd/src/assets/icons/svg/horizontalDistribution.svg new file mode 100644 index 0000000..b4af40e --- /dev/null +++ b/acs/qd/src/assets/icons/svg/horizontalDistribution.svg @@ -0,0 +1,2 @@ + diff --git a/acs/qd/src/assets/icons/svg/leftAlign.svg b/acs/qd/src/assets/icons/svg/leftAlign.svg new file mode 100644 index 0000000..b373ac3 --- /dev/null +++ b/acs/qd/src/assets/icons/svg/leftAlign.svg @@ -0,0 +1,2 @@ + diff --git a/acs/qd/src/assets/icons/svg/rightAlign.svg b/acs/qd/src/assets/icons/svg/rightAlign.svg new file mode 100644 index 0000000..b0670ba --- /dev/null +++ b/acs/qd/src/assets/icons/svg/rightAlign.svg @@ -0,0 +1,2 @@ + diff --git a/acs/qd/src/assets/icons/svg/save.svg b/acs/qd/src/assets/icons/svg/save.svg new file mode 100644 index 0000000..e9e05e3 --- /dev/null +++ b/acs/qd/src/assets/icons/svg/save.svg @@ -0,0 +1,2 @@ + diff --git a/acs/qd/src/assets/icons/svg/upAlign.svg b/acs/qd/src/assets/icons/svg/upAlign.svg new file mode 100644 index 0000000..29645dd --- /dev/null +++ b/acs/qd/src/assets/icons/svg/upAlign.svg @@ -0,0 +1,2 @@ + diff --git a/acs/qd/src/assets/icons/svg/verticalAlign.svg b/acs/qd/src/assets/icons/svg/verticalAlign.svg new file mode 100644 index 0000000..a3646a0 --- /dev/null +++ b/acs/qd/src/assets/icons/svg/verticalAlign.svg @@ -0,0 +1,2 @@ + diff --git a/acs/qd/src/assets/icons/svg/verticalDistribution.svg b/acs/qd/src/assets/icons/svg/verticalDistribution.svg new file mode 100644 index 0000000..e628a9e --- /dev/null +++ b/acs/qd/src/assets/icons/svg/verticalDistribution.svg @@ -0,0 +1,2 @@ + diff --git a/acs/qd/src/views/acs/device/driver/lnsh/lnsh_rgv.vue b/acs/qd/src/views/acs/device/driver/lnsh/lnsh_rgv.vue index c2ae6c0..5683d2f 100644 --- a/acs/qd/src/views/acs/device/driver/lnsh/lnsh_rgv.vue +++ b/acs/qd/src/views/acs/device/driver/lnsh/lnsh_rgv.vue @@ -61,6 +61,8 @@ @@ -105,6 +108,8 @@ @@ -134,6 +139,7 @@ diff --git a/acs/qd/src/views/acs/device/index.vue b/acs/qd/src/views/acs/device/index.vue index 8595b47..daafed9 100644 --- a/acs/qd/src/views/acs/device/index.vue +++ b/acs/qd/src/views/acs/device/index.vue @@ -139,23 +139,29 @@ - + + + + + + + + + + - - - diff --git a/acs/qd/src/views/acs/produceshiftorder/index.vue b/acs/qd/src/views/acs/produceshiftorder/index.vue index 593aa16..6d84715 100644 --- a/acs/qd/src/views/acs/produceshiftorder/index.vue +++ b/acs/qd/src/views/acs/produceshiftorder/index.vue @@ -59,18 +59,6 @@ - - - @@ -84,12 +72,16 @@ - + @@ -147,13 +139,6 @@ export default { [CRUD.HOOK.beforeRefresh]() { return true }, - beforeHandleCommand(index, row, command) { - return { - 'index': index, - 'row': row, - 'command': command - } - }, finish(index, row) { debugger crudProduceshiftorder.finish(row.order_id).then(res => { @@ -162,13 +147,6 @@ export default { }).catch(err => { console.log(err.response.data.message) }) - }, - handleCommand(command) { - switch (command.command) { - case 'a':// 完成 - this.finish(command.index, command.row) - break - } } } } diff --git a/acs/qd/src/views/monitor/logback/index.vue b/acs/qd/src/views/monitor/logback/index.vue index eaf56f6..2b83e17 100644 --- a/acs/qd/src/views/monitor/logback/index.vue +++ b/acs/qd/src/views/monitor/logback/index.vue @@ -295,7 +295,7 @@ export default { queryParam.end = (new Date(this.timeRange[1]).getTime() * 1000000).toString() } if (this.text !== '') { - queryParam.text = this.text + queryParam.text = this.text.replace(/^\s*|\s*$/g,'') } if (this.limits !== '') { console.log(this.limits) @@ -324,6 +324,12 @@ export default { for (const k in this.logs) { this.logs[k][1] = ansi_up.ansi_to_html(this.logs[k][1]) } + if (this.direction === 'backward') { // 由于使用公共标签会导致时间顺序错乱,因此对二维数组进行排序 + this.logs.sort((a, b) => b[0] - a[0]) + } else { + this.logs.sort((a, b) => a[0] - b[0]) + } + console.log(this.logs) } else { this.showEmpty = true this.emptyText = '暂无日志信息,请选择时间段试试' @@ -351,9 +357,6 @@ export default { const bottomest = Math.round(scrollTop + clientHeight) if (bottomest === scrollHeight) { // 加载新数据 - // console.log(this.logs[this.logs.length - 1][0]) // 最后一个日志的时间 - // console.log(queryParam.end - queryParam.start) // 时差 - // 需要:最后一个日志时间, 时差 ---- 查询的时间范围:最后时间-时 - 差最后时间 queryParam.limits = this.scrollStep queryParam.direction = this.direction if (this.direction === 'backward') { @@ -382,13 +385,21 @@ export default { } } console.log(tempArray) + if (this.direction === 'backward') { // 由于使用公共标签会导致时间顺序错乱,因此对二维数组进行排序 + tempArray.sort((a, b) => b[0] - a[0]) + } else { + tempArray.sort((a, b) => a[0] - b[0]) + } for (const k in tempArray) { tempArray[k][1] = ansi_up.ansi_to_html(tempArray[k][1]) // 数据转换 this.logs.push(tempArray[k]) // 追加数据 } } else { - this.showEmpty = true - this.emptyText = '暂无日志信息,请选择时间段试试' + this.$notify({ + title: '警告', + message: '暂无以往日志数据!', + type: 'warning' + }) } }) } @@ -444,6 +455,11 @@ export default { for (const k in this.logs) { this.logs[k][1] = ansi_up.ansi_to_html(this.logs[k][1]) } + if (this.direction === 'backward') { // 由于使用公共标签会导致时间顺序错乱,因此对二维数组进行排序 + this.logs.sort((a, b) => b[0] - a[0]) + } else { + this.logs.sort((a, b) => a[0] - b[0]) + } } else { this.showEmpty = true this.emptyText = '暂无日志信息,请选择时间段试试' diff --git a/acs/qd/src/views/system/logicflow/editor/components/DiagramToolbar.vue b/acs/qd/src/views/system/logicflow/editor/components/DiagramToolbar.vue index ac24070..fcede31 100644 --- a/acs/qd/src/views/system/logicflow/editor/components/DiagramToolbar.vue +++ b/acs/qd/src/views/system/logicflow/editor/components/DiagramToolbar.vue @@ -24,40 +24,40 @@
- 锁定 +
- 解锁 +
- 垂直居中 +
- 水平居中 +
- 向左对齐 +
- 向右对齐 +
- 向上对齐 +
- 向下对齐 +
- 水平分布 +
- 垂直分布 +
- 清空画布 +
- 保存 +
@@ -71,7 +71,7 @@
舞台: - +
设备绑定 - + + + + {{ item.device_code }} + {{ item.device_name }} + +
旋转角度 @@ -152,6 +168,7 @@
设备选择 _ + i * 0.5), // imageUrl: '', - imageUrlOptions: [] + imageUrlOptions: [], + deviceCodeOptions: [] } }, watch: { @@ -222,6 +241,7 @@ export default { }, created() { this.initStageIconList() + this.initDevicesList() }, methods: { initStageIconList() { // 初始化图标数据 @@ -232,6 +252,12 @@ export default { this.imageUrlOptions = data }) }, + initDevicesList() { + crudDevice.selectDeviceList().then(res => { + console.log('devices:', res) + this.deviceCodeOptions = res + }) + }, setStyle(item) { this.$emit('setStyle', item) }, diff --git a/acs/qd/src/views/system/logicflow/editor/components/node/html/htmlNode.js b/acs/qd/src/views/system/logicflow/editor/components/node/html/htmlNode.js index bbd4d84..4ea3fe1 100644 --- a/acs/qd/src/views/system/logicflow/editor/components/node/html/htmlNode.js +++ b/acs/qd/src/views/system/logicflow/editor/components/node/html/htmlNode.js @@ -64,11 +64,18 @@ class ButtonNode extends HtmlResize.view { const el = document.createElement('div') el.className = 'uml-wrapper' // el.id = 'uml-app' + /** + * 以下分为:状态显示(设备左上的小圆点) + * 托盘图标 + * 故障图标 + * 设备图片 + * @type {string} + */ const html = `
- - + +
` diff --git a/acs/qd/src/views/system/logicflow/monitor/index.vue b/acs/qd/src/views/system/logicflow/monitor/index.vue index 91a504d..cb430d6 100644 --- a/acs/qd/src/views/system/logicflow/monitor/index.vue +++ b/acs/qd/src/views/system/logicflow/monitor/index.vue @@ -9,7 +9,7 @@ title="设备信息" class="newDialog" :visible.sync="dialogDeviceMsgVisible" - width="18%" + width="22%" :top="tops" :show-close="false" :modal="false" @@ -121,6 +121,7 @@ import crudStage from '@/api/logicflow/stage' import paramCrud from '@/api/system/param' import deviceCrud from '@/api/acs/device/device' +import { getDeviceByCodes } from '@/api/acs/monitor/deviceStageMonitor' import '@logicflow/core/dist/style/index.css' import '@logicflow/extension/lib/style/index.css' @@ -185,6 +186,7 @@ export default { backgroundImage: 'url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHBhdHRlcm4gaWQ9ImdyaWQiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTSAwIDEwIEwgNDAgMTAgTSAxMCAwIEwgMTAgNDAgTSAwIDIwIEwgNDAgMjAgTSAyMCAwIEwgMjAgNDAgTSAwIDMwIEwgNDAgMzAgTSAzMCAwIEwgMzAgNDAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2QwZDBkMCIgb3BhY2l0eT0iMC4yIiBzdHJva2Utd2lkdGg9IjEiLz48cGF0aCBkPSJNIDQwIDAgTCAwIDAgMCA0MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZDBkMGQwIiBzdHJva2Utd2lkdGg9IjEiLz48L3BhdHRlcm4+PC9kZWZzPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JpZCkiLz48L3N2Zz4=")', backgroundRepeat: 'repeat' }, + isSilentMode: true, adjustEdge: false, adjustEdgeMiddle: false, adjustEdgeStartAndEnd: false, @@ -211,7 +213,7 @@ export default { // 展开显示设备信息 if (data.data.type !== 'pro-rect' && data.data.type !== 'pro-circle' && data.data.type !== 'triangle' && data.data.type !== 'rect-radius') { if (data.data.properties.device) { - this.moveShow(data) // 传递节点数据,用来获取id做比对 + this.moveShow(data.data) // 传递节点数据,用来获取id做比对 this.dialogDeviceMsgVisible = true this.device_code = data.data.properties.device this.tops = data.e.y + 'px' @@ -250,7 +252,7 @@ export default { this.timer = setInterval(() => { // 定时刷新设备的状态信息 console.log('定时器启动') this.initStatus() - }, 5000) + }, 2000) }, editDevice(id) { let item = '' @@ -293,7 +295,7 @@ export default { moveShow(nodeData) { // 点击之后显示出来的数据----只需要设备信息 let item = '' for (const i in this.allDeviceMsg) { // 查找点击节点的id - if (nodeData.data.id === this.allDeviceMsg[i].id) { + if (nodeData.id === this.allDeviceMsg[i].id) { item = this.allDeviceMsg[i] break // 匹对完退出 } @@ -335,12 +337,6 @@ export default { } else if (val === 'number') { const obj = { name: '托盘数量', value: data[val] } this.arr.push(obj) - } else if (val === 'qty') { - const obj = { name: '数量', value: data[val] } - this.arr.push(obj) - } else if (val === 'weight') { - const obj = { name: '重量', value: data[val] } - this.arr.push(obj) } else if (val === 'instruction_message') { const obj = { name: '指令信息', value: data[val] } this.arr.push(obj) @@ -372,10 +368,7 @@ export default { const obj = { name: '批次', value: data[val] } this.arr.push(obj) } else if (val === 'requestSucess') { - const obj = { name: '缺料请求成功', value: data[val] } - this.arr.push(obj) - } else if (val === 'fullrequestSucess') { - const obj = { name: '空箱请求成功', value: data[val] } + const obj = { name: '是否请求任务', value: data[val] } this.arr.push(obj) } else if (val === 'applySucess') { const obj = { name: '是否申请指令', value: data[val] } @@ -383,71 +376,8 @@ export default { } else if (val === 'message') { const obj = { name: '说明', value: data[val] } this.arr.push(obj) - } else if (val === 'empty_is_lack') { - const obj = { name: '空箱位缺箱', value: data[val] } - this.arr.push(obj) - } else if (val === 'empty_is_finish') { - const obj = { name: '空位完成', value: data[val] } - this.arr.push(obj) - } else if (val === 'full_ready_req_agv') { - const obj = { name: '满箱位就绪,请求AGV', value: data[val] } - this.arr.push(obj) - } else if (val === 'full_out') { - const obj = { name: '满箱已运出满箱位', value: data[val] } - this.arr.push(obj) - } else if (val === 'finish') { - const obj = { name: '订单完成', value: data[val] } - this.arr.push(obj) - } else if (val === 'order_compel_finish') { - const obj = { name: '订单强制完成', value: data[val] } - this.arr.push(obj) - } else if (val === 'now_order_prod_num') { - const obj = { name: '当前生产总量', value: data[val] } - this.arr.push(obj) - } else if (val === 'now_one_prod_num') { - const obj = { name: '当前箱生产量', value: data[val] } - this.arr.push(obj) - } else if (val === 'task') { - const obj = { name: '任务号', value: data[val] } - this.arr.push(obj) - } else if (val === 'full_number') { - const obj = { name: '出料口满框数量', value: data[val] } - this.arr.push(obj) - } else if (val === 'storage_stock_num') { - const obj = { name: '储料仓库存数量', value: data[val] } - this.arr.push(obj) - } else if (val === 'line_stock_num') { - const obj = { name: '线体库存数量', value: data[val] } - this.arr.push(obj) - } else if (val === 'order_prod_allnum') { - const obj = { name: '订单生产总量', value: data[val] } - this.arr.push(obj) - } else if (val === 'order') { - const obj = { name: '工单号', value: data[val] } - this.arr.push(obj) - } else if (val === 'storage_stock_num') { - const obj = { name: '储料仓库存数量', value: data[val] } - this.arr.push(obj) - } else if (val === 'line_stock_num') { - const obj = { name: '线体库存数量', value: data[val] } - this.arr.push(obj) - } else if (val === 'material_type') { - const obj = { name: '产品编号', value: data[val] } - this.arr.push(obj) - } else if (val === 'lack_req') { - const obj = { name: '缺料请求', value: data[val] } - this.arr.push(obj) - } else if (val === 'empty_req') { - const obj = { name: '空箱请求', value: data[val] } - this.arr.push(obj) - } else if (val === 'address') { - const obj = { name: 'agv位置', value: data[val] } - this.arr.push(obj) - } else if (val === 'phaseName') { - const obj = { name: 'phase', value: data[val] } - this.arr.push(obj) - } else if (val === 'full_req') { - const obj = { name: '满箱请求', value: data[val] } + } else if (val === 'status') { + const obj = { name: '设备状态', value: data[val] } this.arr.push(obj) } else if (val === 'open_time') { const obj = { name: '开机时间', value: data[val] } @@ -455,11 +385,125 @@ export default { } else if (val === 'close_time') { const obj = { name: '关机时间', value: data[val] } this.arr.push(obj) - } else if (val === 'feeding_qty') { - const obj = { name: '上料数量', value: data[val] } + } else if (val === 'standby_time') { + const obj = { name: '待机时间', value: data[val] } this.arr.push(obj) - } else if (val === 'error_num') { - const obj = { name: '故障次数', value: data[val] } + } else if (val === 'production_time') { + const obj = { name: '生产时间', value: data[val] } + this.arr.push(obj) + } else if (val === 'error_time') { + const obj = { name: '故障时间', value: data[val] } + this.arr.push(obj) + } else if (val === 'weight') { + const obj = { name: '生产重量', value: data[val] } + this.arr.push(obj) + } else if (val === 'order_No') { + const obj = { name: '工单号', value: data[val] } + this.arr.push(obj) + } else if (val === 'mix_num') { + const obj = { name: '碾次', value: data[val] } + this.arr.push(obj) + } else if (val === 'barcode') { + const obj = { name: '条码', value: data[val] } + this.arr.push(obj) + } else if (val === 'qualified') { + const obj = { name: '合格数量', value: data[val] } + this.arr.push(obj) + } else if (val === 'unqualified') { + const obj = { name: '不合格数量', value: data[val] } + this.arr.push(obj) + } else if (val === 'put_station') { + const obj = { name: '当前码盘工位', value: data[val] } + this.arr.push(obj) + } else if (val === 'encoder_qty') { + const obj = { name: '码盘数量', value: data[val] } + this.arr.push(obj) + } else if (val === 'outKiln_move') { + const obj = { name: '出窑光电', value: data[val] } + this.arr.push(obj) + } else if (val === 'outKiln_barcode') { + const obj = { name: '出窑条码', value: data[val] } + this.arr.push(obj) + } else if (val === 'outKiln_device') { + const obj = { name: '出窑设备', value: data[val] } + this.arr.push(obj) + } else if (val === 'car_sum') { + const obj = { name: '窑车总数', value: data[val] } + this.arr.push(obj) + } else if (val === 'nullCar_qty') { + const obj = { name: '空窑车数', value: data[val] } + this.arr.push(obj) + } else if (val === 'burning_car_qty') { + const obj = { name: '在烧窑车数', value: data[val] } + this.arr.push(obj) + } else if (val === 'container_qty') { + const obj = { name: '托盘数', value: data[val] } + this.arr.push(obj) + } else if (val === 'tray_crib_qty') { + const obj = { name: '托盘垛数', value: data[val] } + this.arr.push(obj) + } else if (val === 'total_container') { + const obj = { name: '托盘总数量', value: data[val] } + this.arr.push(obj) + } else if (val === 'total_split') { + const obj = { name: '累计拆垛数量', value: data[val] } + this.arr.push(obj) + } else if (val === 'getStation') { + const obj = { name: '当前抓取工位', value: data[val] } + this.arr.push(obj) + } else if (val === 'putStation') { + const obj = { name: '当前码盘工位', value: data[val] } + this.arr.push(obj) + } else if (val === 'move_1') { + const obj = { name: '前工位光电信号', value: data[val] } + this.arr.push(obj) + } else if (val === 'move_2') { + const obj = { name: '后工位光电信号', value: data[val] } + this.arr.push(obj) + } else if (val === 'action_1') { + const obj = { name: '前工位动作信号', value: data[val] } + this.arr.push(obj) + } else if (val === 'action_2') { + const obj = { name: '后工位动作信号', value: data[val] } + this.arr.push(obj) + } else if (val === 'walk_y') { + const obj = { name: '行走列', value: data[val] } + this.arr.push(obj) + } else if (val === 'task1') { + const obj = { name: '前工位任务号', value: data[val] } + this.arr.push(obj) + } else if (val === 'task2') { + const obj = { name: '后工位任务号', value: data[val] } + this.arr.push(obj) + } else if (val === 'labeling_qty') { + const obj = { name: '贴标数量', value: data[val] } + this.arr.push(obj) + } else if (val === 'container_type') { + const obj = { name: '托盘类型', value: data[val] } + this.arr.push(obj) + } else if (val === 'specifications') { + const obj = { name: '规格', value: data[val] } + this.arr.push(obj) + } else if (val === 'onoff_status') { + const obj = { name: '开关机状态', value: data[val] } + this.arr.push(obj) + } else if (val === 'task_qty') { + const obj = { name: '当前任务数量', value: data[val] } + this.arr.push(obj) + } else if (val === 'finishTask_qty') { + const obj = { name: '完成任务数量', value: data[val] } + this.arr.push(obj) + } else if (val === 'AlongSide') { + const obj = { name: 'A长边', value: data[val] } + this.arr.push(obj) + } else if (val === 'BshortSide') { + const obj = { name: 'B短边', value: data[val] } + this.arr.push(obj) + } else if (val === 'Htrapezoidal') { + const obj = { name: 'H梯形高', value: data[val] } + this.arr.push(obj) + } else if (val === 'Wthickness') { + const obj = { name: 'W厚度', value: data[val] } this.arr.push(obj) } } @@ -469,9 +513,10 @@ export default { initStatus() { // 初始化所有节点的设备信息,通过节点id对应设备编号 let resion = {} resion = lf.getGraphData().nodes.map(item => ({ id: item.id, device_code: item.properties.device })) - crudStage.getDeviceByCodes(resion).then(res => { + getDeviceByCodes(resion).then(res => { this.allDeviceMsg = res // 拿到所有节点的设备数据 console.log('initStatus-res', res) + // 实时设置状态信息 for (var item of res) { // 循环并且设置属性值 if (item.data !== undefined) { if (item.data.isOnline !== undefined) { @@ -491,11 +536,17 @@ export default { } } } + // 设置动态实时显示设备信息 + const { nodes } = lf.getSelectElements() // 获取选中的节点 + console.log(nodes) + if (nodes.length === 1) { // 因为是定时器,没有选中则不用实时更新显示数据 + this.moveShow(nodes[0]) // 监控模式下不可能托选,因此就只有一个数据 + } }) }, dialogSave() { deviceCrud.changeDeviceStatus(this.form).then(res => { - this.notify('操作成功', 'success') + this.$notify({ title: '操作成功', message: '', type: 'success' }) this.dialogFormVisible = false this.dialogFormVisible3 = false this.dialogFormVisible4 = false diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java index 13f382c..20445e8 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java @@ -118,7 +118,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { if (StrUtil.equals(area_type, AreaEnum.YZQY.getCode()) && stewing_time <= 0) { //1.首先更新所有输送线的点位状态 JSONArray pointarr = WQL.getWO("ACSTOMES_001").addParam("area_type", "07").addParam("flag", "4").process().getResultJSONArray(0); - PointUpdateUtil.updatePoint(pointarr); + PointUpdateUtil.updatePoint(pointarr); //2.找一个合适的输送带 JSONObject pointObj = StructFindUtil.getConveyor(materiralObj); //如果未找到合适的输送带 就去货架 @@ -131,9 +131,16 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { } //假如是分拣机械手的下料位置,并且是满托,则去包装线 if (StrUtil.equals("1", is_full) && StrUtil.equals(area_type, AreaEnum.FJQY.getCode())) { + String vehicle_code = pointTable.query("point_code ='" + device_code + "'").uniqueResult(0).getString("vehicle_code"); + jsonObject.put("vehicle_code", vehicle_code); toPackIngTask.createTask((JSONObject) JSON.toJSON(jsonObject)); break; } + //假如是分拣机械手的下料位置,则需要将点位上的托盘号写入 + if (StrUtil.equals(area_type, AreaEnum.FJQY.getCode())) { + String vehicle_code = pointTable.query("point_code ='" + device_code + "'").uniqueResult(0).getString("vehicle_code"); + jsonObject.put("vehicle_code", vehicle_code); + } sendMaterialTask.createTask((JSONObject) JSON.toJSON(jsonObject)); break; case "2": @@ -162,7 +169,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { if (StrUtil.equals(device_code, "FJJXSXLW201") || StrUtil.equals(device_code, "FJJXSXLW202") || StrUtil.equals(device_code, "FJJXSXLW301") || - StrUtil.equals(device_code, "FJJXSXLW301") + StrUtil.equals(device_code, "FJJXSXLW302") ) { material_id = produceInfoByCode.getString("material_id"); @@ -185,7 +192,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { } //需要更新覆膜机的托盘类型 JSONArray pointarr = WQL.getWO("ACSTOMES_001").addParam("area_type", "05").addParam("flag", "4").process().getResultJSONArray(0); - PointUpdateUtil.updatePoint(pointarr); + PointUpdateUtil.updatePoint(pointarr); } if (ObjectUtil.isEmpty(produceInfoByCode)) { throw new BadRequestException("未找到点位为'" + device_code + "'对应机械手的生产工单!"); @@ -193,7 +200,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { jsonObject.put("vehicle_type", produceInfoByCode.getString("vehicle_type")); //需要更新堆叠位的点位状态 JSONArray pointarr = WQL.getWO("ACSTOMES_001").addParam("point_code", "KTPDDW5").addParam("flag", "4").process().getResultJSONArray(0); - PointUpdateUtil.updatePoint(pointarr); + PointUpdateUtil.updatePoint(pointarr); callEmptyVehicleTask.createTask((JSONObject) JSON.toJSON(jsonObject)); break; //生产rgv搬运任务 @@ -520,15 +527,21 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { @Override @Transactional(rollbackFor = Exception.class) public Map getVehicleInfoBycode(Map jsonObject) { - String vehicle_code = (String) jsonObject.get("vehicle_code"); + String device_code = (String) jsonObject.get("device_code"); + WQLObject point_table = WQLObject.getWQLObject("sch_base_point"); + String vehicle_code = point_table.query("point_code='" + device_code + "'").uniqueResult(0).getString("vehicle_code"); if (StrUtil.isEmpty(vehicle_code)) { - throw new BadRequestException("托盘编码不能为空!"); + throw new BadRequestException("未找到该点位上的托盘信息!"); } JSONObject vehicleObj = WQLObject.getWQLObject("st_buss_vehiclegroup").query("vehicle_code='" + vehicle_code + "' AND is_delete='0'").uniqueResult(0); if (ObjectUtil.isEmpty(vehicleObj)) { throw new BadRequestException("未找到托盘号为'" + vehicle_code + "'的托盘信息!"); } - return vehicleObj; + JSONObject result = new JSONObject(); + result.put("status", HttpStatus.OK.value()); + result.put("message", "任务状态反馈成功!"); + result.put("content", vehicleObj); + return result; } @Override diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallEmptyVehicleTask.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallEmptyVehicleTask.java index 6115039..c3fbc97 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallEmptyVehicleTask.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallEmptyVehicleTask.java @@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import org.nl.exception.BadRequestException; @@ -12,6 +13,7 @@ import org.nl.utils.SecurityUtils; import org.nl.utils.SpringContextHolder; import org.nl.wms.WorkProcedureEnum; import org.nl.wms.common.StructFindUtil; +import org.nl.wms.database.service.dto.VehicleDto; import org.nl.wms.sch.manage.AbstractAcsTask; import org.nl.wms.sch.manage.AreaEnum; import org.nl.wms.sch.manage.TaskStatusEnum; @@ -211,7 +213,7 @@ public class CallEmptyVehicleTask extends AbstractAcsTask { } JSONObject param = new JSONObject(); //如果托盘类型不是02,则需要加上托盘类型 - if (!StrUtil.equals(vehicle_type,"02")){ + if (!StrUtil.equals(vehicle_type, "02")) { param.put("vehicle_type", vehicle_type); } @@ -222,12 +224,28 @@ public class CallEmptyVehicleTask extends AbstractAcsTask { } vehicle_code = outStructObj.getString("vehicle_code"); - if (StrUtil.isEmpty(vehicle_code)){ - vehicle_code="999"; + if (StrUtil.isEmpty(vehicle_code)) { + vehicle_code = "999"; } //如果是托盘区域/生成一个该类型的托盘 - if (StrUtil.equals(workInfo.getString("workprocedure_code"), AreaEnum.MTPQ.getCode())) { + if (StrUtil.equals(workInfo.getString("area_type"), AreaEnum.FJQY.getCode())) { vehicle_code = CodeUtil.getNewCode("VEHICCLE_CODE_MTP"); + //将托盘插入托盘表 + WQLObject wo = WQLObject.getWQLObject("MD_PB_Vehicle"); + JSONObject jo = new JSONObject(); + VehicleDto dto = new VehicleDto(); + dto.setVehicle_id(IdUtil.getSnowflake(1, 1).nextId()); + dto.setVehicle_code(vehicle_code); + dto.setCreate_id(SecurityUtils.getCurrentUserId()); + dto.setVehicle_name(vehicle_code); + dto.setCreate_name(SecurityUtils.getNickName()); + dto.setUpdate_optid(SecurityUtils.getCurrentUserId()); + dto.setUpdate_optname(SecurityUtils.getNickName()); + dto.setUpdate_time(DateUtil.now()); + dto.setCreate_time(DateUtil.now()); + dto.setVehicle_type(vehicle_type); + JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto)); + wo.insert(json); } start_point_code = outStructObj.getString("struct_code"); diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallMaterialTask.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallMaterialTask.java index b92c13d..6cca0a1 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallMaterialTask.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallMaterialTask.java @@ -322,8 +322,8 @@ public class CallMaterialTask extends AbstractAcsTask { iosObj.put("create_mode", create_mode); iosObj.put("task_id", task_id); iosObj.put("pcsn", pcsn); - iosObj.put("create_id","1"); - iosObj.put("create_name", "管理员"); + iosObj.put("create_id",SecurityUtils.getCurrentUserId()); + iosObj.put("create_name", SecurityUtils.getNickName()); iosObj.put("create_time", DateUtil.now()); WQLObject.getWQLObject("ST_IVT_workProcedureIOS").insert(iosObj); //将组盘里面的task_id改为当前的任务 @@ -370,8 +370,8 @@ public class CallMaterialTask extends AbstractAcsTask { taskObj.put("vehicle_code", vehicle_code); taskObj.put("handle_class", THIS_CLASS); taskObj.put("is_auto_issue", "1"); - taskObj.put("create_name", "管理员"); - taskObj.put("create_id", "1"); + taskObj.put("create_name", SecurityUtils.getNickName()); + taskObj.put("create_id", SecurityUtils.getCurrentUserId()); taskObj.put("create_time", DateUtil.now()); taskObj.put("is_delete", "0"); taskTable.insert(taskObj); diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/SendMaterialTask.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/SendMaterialTask.java index eaac571..2505381 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/SendMaterialTask.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/SendMaterialTask.java @@ -272,6 +272,10 @@ public class SendMaterialTask extends AbstractAcsTask { stewing_time = WQLObject.getWQLObject("md_me_material").query("material_id ='" + material_id + "'"). uniqueResult(0).getString("stewing_time"); } + //假如是烧制工序,静置时间都是0 + if (StrUtil.equals(workProcedureEnum.getCode(), WorkProcedureEnum.SZGX.getCode())) { + stewing_time = "0"; + } JSONObject iosObj = new JSONObject(); iosObj.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId()); iosObj.put("bill_code", CodeUtil.getNewCode("IN_STORE_CODE")); @@ -328,10 +332,11 @@ public class SendMaterialTask extends AbstractAcsTask { taskObj.put("is_delete", "0"); taskTable.insert(taskObj); - // 如果是压料制下需要更新组盘信息,将task_id 更新 + // 如果是压料制下,或者是分拣送料需要更新组盘信息,将task_id 更新 JSONObject workInfo = WQL.getWO("QSTRUCT_RULE").addParam("flag", "1").addParam("code", start_point_code) .process().uniqueResult(0); - if (StrUtil.equals(WorkProcedureEnum.YZGX.getCode(), workInfo.getString("workprocedure_code"))) { + if (StrUtil.equals(WorkProcedureEnum.YZGX.getCode(), workInfo.getString("workprocedure_code")) + ||StrUtil.equals(WorkProcedureEnum.FJGX.getCode(), workInfo.getString("workprocedure_code"))) { WQLObject groupTable = WQLObject.getWQLObject("st_buss_vehiclegroup"); JSONObject groupInfo = groupTable.query("group_id='" + group_id + "'").uniqueResult(0); if (ObjectUtil.isNotEmpty(groupInfo)) { diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/ToPackIngTask.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/ToPackIngTask.java index 0225eb4..c8c339c 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/ToPackIngTask.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/ToPackIngTask.java @@ -59,6 +59,20 @@ public class ToPackIngTask extends AbstractAcsTask { jsonTask.put("update_time", DateUtil.now()); jsonTask.put("remark", "任务执行完成"); taskTab.update(jsonTask); + WQLObject pointTab = WQLObject.getWQLObject("sch_base_point"); + //将起点的载具清除 + JSONObject startPointObj = pointTab.query("point_code='" + jsonTask.getString("start_point_code") + "'").uniqueResult(0); + startPointObj.put("lock_type", "00"); + startPointObj.put("point_status", "00"); + startPointObj.put("vehicle_code", ""); + pointTab.update(startPointObj); + //将组盘表删除 + WQLObject group_Table = WQLObject.getWQLObject("st_buss_vehiclegroup"); + JSONObject groupObj = group_Table.query("vehicle_code='" + jsonTask.getString("vehicle_code") + "' and is_delete='0'").uniqueResult(0); + if (ObjectUtil.isNotEmpty(groupObj)) { + groupObj.put("is_delete", "0"); + group_Table.update(groupObj); + } } } diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/wms.xls b/wms/hd/nladmin-system/src/main/java/org/nl/wms/wms.xls index 7e1fd73..dc1a425 100644 Binary files a/wms/hd/nladmin-system/src/main/java/org/nl/wms/wms.xls and b/wms/hd/nladmin-system/src/main/java/org/nl/wms/wms.xls differ