diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/deviceDriver/service/defination/agvDefination/ndc/AgvNdcOneDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/deviceDriver/service/defination/agvDefination/ndc/AgvNdcOneDeviceDriver.java index d231ad2..d81f519 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/deviceDriver/service/defination/agvDefination/ndc/AgvNdcOneDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/deviceDriver/service/defination/agvDefination/ndc/AgvNdcOneDeviceDriver.java @@ -13,6 +13,7 @@ import org.nl.acs.device.device.service.DeviceService; import org.nl.acs.device.device.service.entity.Device; import org.nl.acs.device.deviceDriver.service.defination.ordinaryDefination.AbstractStandardDeviceDriver; import org.nl.acs.device.deviceDriver.service.defination.ordinaryDefination.standardOrdinarySite.StandardOrdinarySiteDeviceDriver; +import org.nl.acs.device.deviceDriver.service.defination.ordinaryDefination.standardStorage.StandardStorageDeviceDriver; import org.nl.acs.log.LokiLog; import org.nl.acs.log.LokiLogType; import org.nl.acs.log.service.DeviceExecuteLogService; @@ -140,11 +141,31 @@ public class AgvNdcOneDeviceDriver extends AbstractStandardDeviceDriver { // 二次分配处理 data = ndcAgvService.sendAgvOneModeInst(phase, index, 0); // 判断是否需要二次分配 - if ("".equals(inst.getStart_device_code())) { + if ("A".equals(inst.getStart_device_code())) { // 向WMS申请新点位 JSONObject response = acsToWmsService.taskRedirection(task.getTask_code(), inst.getStart_device_code()); if (response != null && response.getInteger("responseCode") == 0 && ObjectUtil.isNotEmpty(response.getString("locationNew"))) { + // 更新任务/指令起点位置 + old_device_code = response.getString("locationNew"); + if (StrUtil.contains(old_device_code, "-")) { + String[] point = old_device_code.split("-"); + device_code = point[0]; + } else if (StrUtil.contains(old_device_code, ".")) { + String[] point = old_device_code.split("\\."); + device_code = point[0]; + emptyNum = point[1]; + } else { + device_code = old_device_code; + } + device = deviceAppService.findDeviceByCode(device_code); + task.setStart_device_code(device.getDevice_code()); + task.setStart_point_code(response.getString("locationNew")); + taskserver.update(task); + inst.setStart_device_code(device.getDevice_code()); + inst.setStart_point_code(response.getString("locationNew")); + instructionService.update(inst); + // 返回NDC更换新位置 data = ndcAgvService.sendAgvOneModeInstDis(phase, index, response.getString("locationNew")); } @@ -188,8 +209,8 @@ public class AgvNdcOneDeviceDriver extends AbstractStandardDeviceDriver { } // "========================================================================请求取货=================================================================================" agv_status = 1; - //到达普通站点 - if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { + //到达普通站点或者货架 + if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver || device.getDeviceDriver() instanceof StandardStorageDeviceDriver) { boolean canTake = StrUtil.startWith(task.getTask_code(), CommonFinalParam.HYPHEN_) || acsToWmsService.feedbackTask(inst, WmsFeedbackStatusEnum.APPLY_TAKE.getValue()); @@ -244,7 +265,7 @@ public class AgvNdcOneDeviceDriver extends AbstractStandardDeviceDriver { //反馈车辆动作 agv_status = 2; //到达普通站点取货完成 - if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { + if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver || device.getDeviceDriver() instanceof StandardStorageDeviceDriver) { boolean canTake = StrUtil.startWith(task.getTask_code(), CommonFinalParam.HYPHEN_) || acsToWmsService.feedbackTask(inst, WmsFeedbackStatusEnum.TAKE_FINISH.getValue()); @@ -259,11 +280,30 @@ public class AgvNdcOneDeviceDriver extends AbstractStandardDeviceDriver { // 二次分配处理 data = ndcAgvService.sendAgvOneModeInst(phase, index, 0); // 判断是否需要二次分配 - if ("".equals(inst.getStart_device_code())) { + if ("A".equals(inst.getNext_device_code())) { // 向WMS申请新点位 - JSONObject response = acsToWmsService.taskRedirection(task.getTask_code(), inst.getStart_device_code()); + JSONObject response = acsToWmsService.taskRedirection(task.getTask_code(), inst.getNext_device_code()); if (response != null && response.getInteger("responseCode") == 0 && ObjectUtil.isNotEmpty(response.getString("locationNew"))) { + // 更新任务/指令起点位置 + old_device_code = response.getString("locationNew"); + if (StrUtil.contains(old_device_code, "-")) { + String[] point = old_device_code.split("-"); + device_code = point[0]; + } else if (StrUtil.contains(old_device_code, ".")) { + String[] point = old_device_code.split("\\."); + device_code = point[0]; + emptyNum = point[1]; + } else { + device_code = old_device_code; + } + device = deviceAppService.findDeviceByCode(device_code); + task.setNext_device_code(device.getDevice_code()); + task.setNext_point_code(response.getString("locationNew")); + taskserver.update(task); + inst.setNext_device_code(device.getDevice_code()); + inst.setNext_point_code(response.getString("locationNew")); + instructionService.update(inst); // 返回NDC更换新位置 data = ndcAgvService.sendAgvOneModeInstDis(phase, index, response.getString("locationNew")); } @@ -302,8 +342,8 @@ public class AgvNdcOneDeviceDriver extends AbstractStandardDeviceDriver { } // "========================================================================请求放货=================================================================================" agv_status = 3; - //普通站点 - if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { + //到达普通站点或者货架 + if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver || device.getDeviceDriver() instanceof StandardStorageDeviceDriver) { boolean canTake = StrUtil.startWith(task.getTask_code(), CommonFinalParam.HYPHEN_) || acsToWmsService.feedbackTask(inst, WmsFeedbackStatusEnum.APPLY_PUT.getValue()); @@ -353,7 +393,7 @@ public class AgvNdcOneDeviceDriver extends AbstractStandardDeviceDriver { // "========================================================================放货完成=================================================================================" agv_status = 4; //agv普通站点放货完成 - if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { + if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver || device.getDeviceDriver() instanceof StandardStorageDeviceDriver) { boolean canTake = StrUtil.startWith(task.getTask_code(), CommonFinalParam.HYPHEN_) || acsToWmsService.feedbackTask(inst, WmsFeedbackStatusEnum.PUT_FINISH.getValue()); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/deviceDriver/service/defination/ordinaryDefination/standardStorage/StandardStorageDefination.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/deviceDriver/service/defination/ordinaryDefination/standardStorage/StandardStorageDefination.java new file mode 100644 index 0000000..7d712a2 --- /dev/null +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/deviceDriver/service/defination/ordinaryDefination/standardStorage/StandardStorageDefination.java @@ -0,0 +1,48 @@ +package org.nl.acs.device.deviceDriver.service.defination.ordinaryDefination.standardStorage; + +import org.nl.acs.device.device.service.entity.Device; +import org.nl.acs.device.device.service.enums.DeviceType; +import org.nl.acs.device.deviceDriver.service.defination.DeviceDriverDefination; +import org.nl.acs.device.deviceDriver.service.driver.DeviceDriver; +import org.springframework.stereotype.Service; + +import java.util.LinkedList; +import java.util.List; + +/** + * 货架 + */ +@Service +public class StandardStorageDefination implements DeviceDriverDefination { + @Override + public String getDriverCode() { + return "standard_storage"; + } + + @Override + public String getDriverName() { + return "标准版-货架"; + } + + @Override + public String getDriverDescription() { + return "标准版-货架"; + } + + @Override + public DeviceDriver getDriverInstance(Device device) { + return (new StandardStorageDeviceDriver()).init(device, this); + } + + @Override + public Class getDeviceDriverType() { + return StandardStorageDeviceDriver.class; + } + + @Override + public List getFitDeviceTypes() { + List types = new LinkedList(); + types.add(DeviceType.storage); + return types; + } +} diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/deviceDriver/service/defination/ordinaryDefination/standardStorage/StandardStorageDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/deviceDriver/service/defination/ordinaryDefination/standardStorage/StandardStorageDeviceDriver.java new file mode 100644 index 0000000..53a0306 --- /dev/null +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/deviceDriver/service/defination/ordinaryDefination/standardStorage/StandardStorageDeviceDriver.java @@ -0,0 +1,34 @@ +package org.nl.acs.device.deviceDriver.service.defination.ordinaryDefination.standardStorage; + +import com.alibaba.fastjson.JSONObject; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import org.nl.acs.device.deviceDriver.service.defination.ordinaryDefination.AbstractStandardDeviceDriver; + +import java.util.Map; + +/** + * 标准版货架 + */ +@Slf4j +@Data +public class StandardStorageDeviceDriver extends AbstractStandardDeviceDriver { + + + @Override + public JSONObject getDeviceStatusName() throws Exception { + JSONObject jo = new JSONObject(); + return jo; + } + + @Override + public void setDeviceStatus(JSONObject data) { + + } + + @Override + public void execute() throws Exception { + + } +} + diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/instruction/service/impl/InstructionServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/instruction/service/impl/InstructionServiceImpl.java index 2c05c38..8f5a18a 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/instruction/service/impl/InstructionServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/instruction/service/impl/InstructionServiceImpl.java @@ -101,6 +101,8 @@ public class InstructionServiceImpl extends CommonServiceImpl + +
+ +
+ 指令相关: +
+ + + + + + + + + +
+ +
+ 设备协议: +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + 保存 + +
+
+
+ + + + + diff --git a/acs2/nladmin-ui/src/views/acs/device/index.vue b/acs2/nladmin-ui/src/views/acs/device/index.vue index 97b98dd..4e00ebd 100644 --- a/acs2/nladmin-ui/src/views/acs/device/index.vue +++ b/acs2/nladmin-ui/src/views/acs/device/index.vue @@ -186,7 +186,8 @@ - + +