diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java b/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java index 7473b29..75d1a7c 100644 --- a/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java +++ b/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java @@ -1,5 +1,7 @@ package org.nl.acs.device_driver.conveyor.standard_ordinary_site; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONObject; import lombok.Data; import lombok.RequiredArgsConstructor; @@ -8,12 +10,20 @@ 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.ext.enums.ApplyPassEnum; +import org.nl.acs.ext.hk.UnifiedResponse; import org.nl.acs.ext.hk.service.AcsToHkService; +import org.nl.acs.ext.hk.service.data.BoxApplyPassReq; +import org.nl.acs.ext.wms.service.AcsToWmsService; +import org.nl.acs.instruction.domain.Instruction; +import org.nl.acs.instruction.enums.InstTypeEnum; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.monitor.DeviceStageMonitor; import org.nl.acs.task.service.TaskService; import org.nl.config.SpringContextHolder; +import java.util.Optional; + /** * 普通站点 @@ -26,16 +36,85 @@ public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver imple private final InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class); private final TaskService taskService = SpringContextHolder.getBean(TaskService.class); private final AcsToHkService acsToHkService = SpringContextHolder.getBean(AcsToHkService.class); + private final AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsService.class); String device_code = null; String message; + /** + * CTU请求取货标记和任务号 + */ + private volatile String reqTakeInstCode = null; + private volatile Boolean reqTakeRequireSuccess = false; + + /** + * 请求时间 + */ + private long requireTime = System.currentTimeMillis(); + + /** + * 请求间隔时间 + */ + private long requireTimeOut = 5000L; + @Override public void execute() { device_code = this.getDevice().getDevice_code(); + if (this.reqTakeRequireSuccess && ObjectUtil.isNotEmpty(this.reqTakeInstCode)) { + Instruction instruction = instructionService.findByCodeFromCache(this.reqTakeInstCode); + //取货申请 + if (ObjectUtil.isNotEmpty(instruction) && StrUtil.equals(instruction.getStart_device_code(), this.device_code)) { + this.boxApplyPass(ApplyPassEnum.GET_PASS.getCode()); + } + //放货申请 + else if (ObjectUtil.isNotEmpty(instruction) && StrUtil.equals(instruction.getNext_device_code(), this.device_code)) { + boolean putFlag = Optional.ofNullable(this.getDevice().getExtraValue().get("ignore_release_check")).map(Object::toString).map(Boolean::parseBoolean).orElse(false); + if (putFlag) { + this.applyPass(instruction); + } else { + this.boxApplyPass(ApplyPassEnum.PUT_PASS.getCode()); + } + } + } + } + + private boolean isTimeValid(long currentTimeMillis) { + return currentTimeMillis - this.requireTime >= this.requireTimeOut; + } + private void applyPass(Instruction instruction) { + long currentTimeMillis = System.currentTimeMillis(); + if (!isTimeValid(currentTimeMillis)) { + log.trace("触发时间因为小于{}毫秒,而被无视", this.requireTimeOut); + } else { + this.requireTime = currentTimeMillis; + JSONObject reqParam = new JSONObject(); + reqParam.put("task_code", instruction.getTask_code()); + reqParam.put("point_code", instruction.getNext_point_code()); + UnifiedResponse wmsUnifiedResponse = acsToWmsService.applyPass(reqParam, JSONObject.class); + if (wmsUnifiedResponse.isSuccess() && wmsUnifiedResponse.getData() != null) { + JSONObject data = wmsUnifiedResponse.getData(); + if (data != null && "1".equals(data.getString("is_confirm"))) { + this.boxApplyPass(ApplyPassEnum.PUT_PASS.getCode()); +// this.reqTakeRequireSuccess = false; +// this.reqTakeInstCode = null; + } + } + } + } + + private void boxApplyPass(String type) { + BoxApplyPassReq bapReq = BoxApplyPassReq.builder() + .taskCode(this.reqTakeInstCode) + .type(type) + .build(); + UnifiedResponse unifiedResponse = acsToHkService.boxApplyPass(bapReq, String.class); + if (unifiedResponse.isSuccess()) { + this.reqTakeRequireSuccess = false; + this.reqTakeInstCode = null; + } } @Override diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/standard_weight/StandardWeightSiteDeviceDriver.java b/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/standard_weight/StandardWeightSiteDeviceDriver.java index c9c1968..64e524b 100644 --- a/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/standard_weight/StandardWeightSiteDeviceDriver.java +++ b/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/standard_weight/StandardWeightSiteDeviceDriver.java @@ -15,6 +15,7 @@ import org.nl.acs.ext.enums.ApplyPassEnum; import org.nl.acs.ext.hk.UnifiedResponse; import org.nl.acs.ext.hk.service.AcsToHkService; import org.nl.acs.ext.hk.service.data.BoxApplyPassReq; +import org.nl.acs.ext.hk.service.data.ContinueTaskReq; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.instruction.domain.Instruction; import org.nl.acs.instruction.enums.InstTypeEnum; @@ -100,8 +101,10 @@ public class StandardWeightSiteDeviceDriver extends AbstractOpcDeviceDriver impl } else { this.boxApplyPass(ApplyPassEnum.GET_PASS.getCode()); } - } else { - this.boxApplyPass(ApplyPassEnum.GET_PASS.getCode()); + } else if (StrUtil.equals(InstTypeEnum.AGV_THREE_TASK.getCode(), instruction.getInstruction_type()) || + StrUtil.equals(InstTypeEnum.AGV_TWO_TASK.getCode(), instruction.getInstruction_type())) { + //this.boxApplyPass(ApplyPassEnum.GET_PASS.getCode()); + this.continueTask(); } } //放货申请 @@ -110,7 +113,13 @@ public class StandardWeightSiteDeviceDriver extends AbstractOpcDeviceDriver impl if (putFlag) { this.applyPass(instruction); } else { - this.boxApplyPass(ApplyPassEnum.PUT_PASS.getCode()); + // this.boxApplyPass(ApplyPassEnum.PUT_PASS.getCode()); + if (StrUtil.equals(instruction.getInstruction_type(), InstTypeEnum.AGV_TWO3_TASK.getCode()) || + StrUtil.equals(instruction.getInstruction_type(), InstTypeEnum.AGV_THREE_TASK.getCode())) { + this.continueTask(); + } else if (StrUtil.equals(instruction.getInstruction_type(), InstTypeEnum.CTU_OUT_TASK.getCode())) { + this.boxApplyPass(ApplyPassEnum.PUT_PASS.getCode()); + } } } } @@ -159,9 +168,12 @@ public class StandardWeightSiteDeviceDriver extends AbstractOpcDeviceDriver impl if (wmsUnifiedResponse.isSuccess() && wmsUnifiedResponse.getData() != null) { JSONObject data = wmsUnifiedResponse.getData(); if (data != null && "1".equals(data.getString("is_confirm"))) { - this.boxApplyPass(ApplyPassEnum.PUT_PASS.getCode()); - this.reqTakeRequireSuccess = true; - this.reqTakeInstCode = null; + if (StrUtil.equals(instruction.getInstruction_type(), InstTypeEnum.AGV_TWO3_TASK.getCode()) || + StrUtil.equals(instruction.getInstruction_type(), InstTypeEnum.AGV_THREE_TASK.getCode())) { + this.continueTask(); + } else if (StrUtil.equals(instruction.getInstruction_type(), InstTypeEnum.CTU_OUT_TASK.getCode())) { + this.boxApplyPass(ApplyPassEnum.PUT_PASS.getCode()); + } } } } @@ -179,6 +191,17 @@ public class StandardWeightSiteDeviceDriver extends AbstractOpcDeviceDriver impl } } + private void continueTask() { + ContinueTaskReq req = ContinueTaskReq.builder() + .taskCode(this.reqTakeInstCode) + .build(); + UnifiedResponse unifiedResponse = acsToHkService.continueTask(req); + if (unifiedResponse.isSuccess()) { + this.reqTakeRequireSuccess = false; + this.reqTakeInstCode = null; + } + } + @Override public JSONObject getDeviceStatusName() { diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/hk/service/impl/HkToAcsServiceImpl.java b/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/hk/service/impl/HkToAcsServiceImpl.java index d033e7a..efd006b 100644 --- a/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/hk/service/impl/HkToAcsServiceImpl.java +++ b/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/hk/service/impl/HkToAcsServiceImpl.java @@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.nl.acs.device.domain.Device; +import org.nl.acs.device_driver.conveyor.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.device_driver.conveyor.standard_weight.StandardWeightSiteDeviceDriver; import org.nl.acs.ext.hk.service.AcsToHkService; import org.nl.acs.ext.hk.service.HkToAcsService; @@ -55,7 +56,7 @@ public class HkToAcsServiceImpl implements HkToAcsService { public JSONObject agvCallback(JSONObject requestParam) { JSONObject resp = new JSONObject(); String reqCode = requestParam.getString("reqCode"); - String stgBinCode = requestParam.getString("stgBinCode"); + String currentPositionCode = requestParam.getString("currentPositionCode"); String robotCode = requestParam.getString("robotCode"); String taskCode = requestParam.getString("taskCode"); String method = requestParam.getString("method"); @@ -66,10 +67,10 @@ public class HkToAcsServiceImpl implements HkToAcsService { resp.put("reqCode", reqCode); return resp; } - StorageCellDto storageCellDto = storageCellService.getByParentCode(stgBinCode); + StorageCellDto storageCellDto = storageCellService.getByParentCode(currentPositionCode); if (ObjectUtil.isEmpty(storageCellDto)) { resp.put("code", "1"); - resp.put("message", "请求失败,外部系统编码不存在,外部系编码:" + stgBinCode); + resp.put("message", "请求失败,外部系统编码不存在,外部系编码:" + currentPositionCode); resp.put("reqCode", reqCode); return resp; } @@ -113,7 +114,7 @@ public class HkToAcsServiceImpl implements HkToAcsService { instruction.setUpdate_time(now); instructionService.update(instruction); } - //method 回调4、取料箱申请inApply + //method 回调4、取放料箱申请apply else if (StrUtil.equals(method, "inApply")) { Device device = deviceAppService.findDeviceByCode(storageCellDto.getStorage_code()); if (ObjectUtil.isEmpty(device)) { @@ -123,6 +124,7 @@ public class HkToAcsServiceImpl implements HkToAcsService { return resp; } StandardWeightSiteDeviceDriver standardWeightSiteDeviceDriver; + StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; //CTU取货申请 //如果请求位置编号与指令起点一致并且是输送线则是取货申请 if (device.getDeviceDriver() instanceof StandardWeightSiteDeviceDriver) { @@ -130,9 +132,14 @@ public class HkToAcsServiceImpl implements HkToAcsService { standardWeightSiteDeviceDriver.setReqTakeRequireSuccess(true); standardWeightSiteDeviceDriver.setReqTakeInstCode(taskCode); } +// else if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { +// standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); +// standardOrdinarySiteDeviceDriver.setReqTakeInstCode(taskCode); +// standardOrdinarySiteDeviceDriver.setReqTakeRequireSuccess(true); +// } } - //method 回调5、取料箱申请inApply - else if (StrUtil.equals(method, "inApplyOk")) { + //method 回调5、inApplyOk +// else if (StrUtil.equals(method, "inApplyOk")) { // Device device = deviceAppService.findDeviceByCode(storageCellDto.getStorage_code()); // if (ObjectUtil.isEmpty(device)) { // resp.put("code", "1"); @@ -140,7 +147,7 @@ public class HkToAcsServiceImpl implements HkToAcsService { // resp.put("reqCode", reqCode); // return resp; // } - } +// } //method 回调6、放料箱申请outApply else if (StrUtil.equals(method, "outApply")) { Device device = deviceAppService.findDeviceByCode(storageCellDto.getStorage_code()); @@ -151,6 +158,8 @@ public class HkToAcsServiceImpl implements HkToAcsService { return resp; } StandardWeightSiteDeviceDriver standardWeightSiteDeviceDriver; + StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; + //CTU取货申请 //如果请求位置编号与指令起点一致并且是输送线则是取货申请 if (device.getDeviceDriver() instanceof StandardWeightSiteDeviceDriver) { @@ -158,6 +167,11 @@ public class HkToAcsServiceImpl implements HkToAcsService { standardWeightSiteDeviceDriver.setReqTakeRequireSuccess(true); standardWeightSiteDeviceDriver.setReqTakeInstCode(taskCode); } +// else if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { +// standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); +// standardOrdinarySiteDeviceDriver.setReqTakeInstCode(taskCode); +// standardOrdinarySiteDeviceDriver.setReqTakeRequireSuccess(true); +// } } resp.put("code", "0"); resp.put("message", "成功"); diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java b/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java index 836c2c0..eda3a91 100644 --- a/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java +++ b/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java @@ -254,12 +254,12 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { if (ConfirmEnum.GET_CONFIRM.getCode().equals(type)) { Map nextPositionCode = null; if (StrUtil.equals(inst.getInstruction_type(), InstTypeEnum.AGV_THREE_TASK.getCode())) { - MapOf.of("positionCode", inst.getStart_parent_code(), "type", "00"); + nextPositionCode = MapOf.of("positionCode", inst.getStart_parent_code(), "type", "00"); } //调用AGV继续执行任务接口,如果是两点任务不需要下一站点信息,如果是三点任务,需要下一站点信息 ContinueTaskReq req = ContinueTaskReq.builder() - .taskCode(task_code) - .nextPositionCode(nextPositionCode) + .taskCode(inst.getInstruction_code()) + //.nextPositionCode(nextPositionCode) .build(); UnifiedResponse unifiedResponse = acsToHkService.continueTask(req); if (!unifiedResponse.isSuccess()) { @@ -270,8 +270,8 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { else if (ConfirmEnum.PUT_CONFIRM.getCode().equals(type)) { //调用AGV继续执行任务接口,需要下一站点信息 ContinueTaskReq req = ContinueTaskReq.builder() - .taskCode(task_code) - .nextPositionCode(MapOf.of("positionCode", inst.getNext_parent_code(), "type", "00")) + .taskCode(inst.getInstruction_code()) + // .nextPositionCode(MapOf.of("positionCode", inst.getNext_parent_code(), "type", "00")) .build(); UnifiedResponse unifiedResponse = acsToHkService.continueTask(req); if (!unifiedResponse.isSuccess()) { diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/enums/InstTypeEnum.java b/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/enums/InstTypeEnum.java index 9cd1375..2d3d996 100644 --- a/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/enums/InstTypeEnum.java +++ b/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/enums/InstTypeEnum.java @@ -15,9 +15,11 @@ public enum InstTypeEnum { CTU_IN_TASK("1", "1", "CTU入库任务"), CTU_OUT_TASK("2", "2", "CTU出库任务"), CTU_MOVE_TASK("3", "3", "CTU移库任务"), - AGV_TWO_TASK("4", "4", "AGV两点任务"), - AGV_THREE_TASK("5", "5", "AGV三点任务"), - OTHER_TASK("6", "6", "其他任务类型"); + AGV_TWO_TASK("A012", "A012", "AGV两点任务(称重位到库外站点)"), + AGV_TWO2_TASK("A021", "A021", "AGV两点任务(库外站点到库外站点)"), + AGV_TWO3_TASK("A013", "A013", "AGV两点任务(库外站点到称重位)"), + AGV_THREE_TASK("A011", "A011", "AGV三点任务(称重位到库外站点到称重位)"), + OTHER_TASK("8", "9", "其他任务类型"); /** diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java b/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java index 705bb54..07c3b65 100644 --- a/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java +++ b/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java @@ -19,6 +19,8 @@ import org.nl.acs.auto.initial.ApplicationAutoInitial; import org.nl.acs.common.base.CommonFinalParam; import org.nl.acs.device.domain.Device; import org.nl.acs.device_driver.DeviceDriverDefination; +import org.nl.acs.device_driver.conveyor.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; +import org.nl.acs.device_driver.conveyor.standard_weight.StandardWeightSiteDeviceDriver; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.instruction.domain.Instruction; import org.nl.acs.instruction.enums.InstTypeEnum; @@ -472,7 +474,23 @@ public class TaskServiceImpl extends CommonServiceImpl impleme throw new BadRequestException("CTU任务类型与起点终点不匹配"); } } else if (StrUtil.equals(TaskTypeEnum.AGV_TASK.getCode(), task_type)) { - instruction_type = "1".equals(acsTask.getIs_wait()) ? InstTypeEnum.AGV_THREE_TASK.getCode() : InstTypeEnum.AGV_TWO_TASK.getCode(); + Device start_device = deviceAppService.findDeviceByCode(start_device_code); + Device next_device = deviceAppService.findDeviceByCode(next_device_code); + if (start_device != null && next_device != null) { + if ("1".equals(acsTask.getIs_wait())) { + instruction_type = InstTypeEnum.AGV_THREE_TASK.getCode(); + } else if (start_device.getDeviceDriver() instanceof StandardWeightSiteDeviceDriver + && next_device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver){ + instruction_type = InstTypeEnum.AGV_TWO_TASK.getCode(); + } else if (start_device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver + && next_device.getDeviceDriver() instanceof StandardWeightSiteDeviceDriver){ + instruction_type = InstTypeEnum.AGV_TWO3_TASK.getCode(); + } else if (start_device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver + && next_device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver){ + instruction_type = InstTypeEnum.AGV_TWO2_TASK.getCode(); + } + } + // instruction_type = "1".equals(acsTask.getIs_wait()) ? InstTypeEnum.AGV_THREE_TASK.getCode() : InstTypeEnum.AGV_TWO_TASK.getCode(); } if (StrUtil.equals(instruction_type, InstTypeEnum.CTU_OUT_TASK.getCode())) { diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/AutoCreateInst.java b/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/AutoCreateInst.java index 00e1064..ffee17b 100644 --- a/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/AutoCreateInst.java +++ b/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/AutoCreateInst.java @@ -7,6 +7,8 @@ import cn.hutool.core.util.StrUtil; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.ObjectUtils; import org.nl.acs.device.domain.Device; +import org.nl.acs.device_driver.conveyor.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; +import org.nl.acs.device_driver.conveyor.standard_weight.StandardWeightSiteDeviceDriver; import org.nl.acs.instruction.enums.InstTypeEnum; import org.nl.acs.instruction.enums.InstructionStatusEnum; import org.nl.acs.instruction.service.InstructionService; @@ -82,7 +84,7 @@ public class AutoCreateInst { groupByInstTypeTasks.forEach((instType, acsTaskList) -> { if (InstTypeEnum.CTU_OUT_TASK.getCode().equals(instType)) { InstructionDto waitInst = instructionService.findByInstTypeAndIsWait(InstTypeEnum.CTU_OUT_TASK.getCode(), "1"); - if (ObjectUtil.isEmpty(waitInst)){ + if (ObjectUtil.isEmpty(waitInst)) { Map> groupedByWaitStatus = acsTaskList.stream() .collect(Collectors.groupingBy(TaskDto::getIs_wait)); groupedByWaitStatus.forEach((waitStatus, isWaitTaskList) -> { @@ -381,8 +383,28 @@ public class AutoCreateInst { next_point_code = next_device_code; } + Device start_device = deviceAppService.findDeviceByCode(start_device_code); + Device next_device = deviceAppService.findDeviceByCode(next_device_code); + String inst_type = InstTypeEnum.AGV_TWO_TASK.getCode(); + if (start_device != null && next_device != null) { + if ("1".equals(is_wait)) { + inst_type = InstTypeEnum.AGV_THREE_TASK.getCode(); + } else if (start_device.getDeviceDriver() instanceof StandardWeightSiteDeviceDriver + && next_device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver){ + inst_type = InstTypeEnum.AGV_TWO_TASK.getCode(); + } else if (start_device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver + && next_device.getDeviceDriver() instanceof StandardWeightSiteDeviceDriver){ + inst_type = InstTypeEnum.AGV_TWO3_TASK.getCode(); + } else if (start_device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver + && next_device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver){ + inst_type = InstTypeEnum.AGV_TWO2_TASK.getCode(); + } + } else { + return; + } + Instruction instdto = new Instruction(); - instdto.setInstruction_type("1".equals(is_wait) ? InstTypeEnum.AGV_THREE_TASK.getIndex() : InstTypeEnum.AGV_TWO_TASK.getIndex()); + instdto.setInstruction_type(inst_type); instdto.setInstruction_id(IdUtil.simpleUUID()); instdto.setRemark(acsTask.getRemark()); instdto.setTask_id(taskId);