diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java index c976366f0..be5611dea 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java @@ -47,6 +47,7 @@ import java.util.Map; public class XianGongAgvServiceImpl implements XianGongAgvService { private final DeviceAppService deviceAppService; private final ISysParamService paramService; + @Autowired private final AcsToWmsService acsToWmsService; @Autowired @@ -115,7 +116,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } - + @Override public HttpResponse markComplete(String code) throws Exception { @@ -141,7 +142,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } - + @Override public HttpResponse queryXZAgvDeviceStatus() { @@ -202,7 +203,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } - + @Override public HttpResponse queryXZAgvInstStatus(String instCode) { @@ -225,7 +226,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } } - + @Override public HttpResponse deleteXZAgvInst(String instCode) { if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), CommonFinalParam.ONE)) { @@ -245,7 +246,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } } - + @Override public HttpResponse sendOrderSequencesToXZ(Instruction inst) throws Exception { com.alibaba.fastjson.JSONObject jo = new com.alibaba.fastjson.JSONObject(); @@ -466,7 +467,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } } - + @Override public HttpResponse addOrderSequences(Instruction inst) throws Exception { JSONObject orderjo = createOrederData(inst, CommonFinalParam.ONE); @@ -493,7 +494,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } } - + @Override public String sendOrderSequencesParam(Instruction inst) throws Exception { JSONObject jo = new JSONObject(); @@ -511,7 +512,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { return jo.toString(); } - + @Override public JSONObject createOrederData(Instruction inst, String inst_type) { String inst_code = inst.getInstruction_code(); @@ -648,7 +649,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { return destinationOrder; } - + @Override public String queryDoorStatus(String device) { log.info("AGV查询自动门状态,参数:{}", device); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java index 608756d70..0f0fb600c 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java @@ -16,6 +16,7 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.map.ListOrderedMap; import org.apache.commons.lang.LocaleUtils; import org.nl.acs.auto.initial.ApplicationAutoInitial; @@ -1228,13 +1229,15 @@ public class DeviceServiceImpl extends CommonServiceImpl i JSONArray w_arry = new JSONArray(); List writeableItemDtos = opcDeviceDriverDefination.getWriteableItemDtos(); List writeableItemJsons = new ArrayList<>(); - for (int i = 0; i < writeableItemDtos.size(); i++) { - ItemDto itemDto = writeableItemDtos.get(i); - JSONObject writeableItemJson = new JSONObject(); - writeableItemJson.put("code", itemDto.getCode()); - writeableItemJson.put("name", itemDto.getName()); - //writeableItemJson.put("db",itemDto.getDb()); - writeableItemJsons.add(writeableItemJson); + if (CollectionUtils.isNotEmpty(writeableItemDtos)) { + for (int i = 0; i < writeableItemDtos.size(); i++) { + ItemDto itemDto = writeableItemDtos.get(i); + JSONObject writeableItemJson = new JSONObject(); + writeableItemJson.put("code", itemDto.getCode()); + writeableItemJson.put("name", itemDto.getName()); + //writeableItemJson.put("db",itemDto.getDb()); + writeableItemJsons.add(writeableItemJson); + } } for (int i = 0; i < ws.size(); i++) { String extra_code = ws.getJSONObject(i).getString("extra_code"); @@ -1260,14 +1263,16 @@ public class DeviceServiceImpl extends CommonServiceImpl i jsonObject.put("name", wJson.getString("name")); warry.add(jsonObject); } - for (int i = 0; i < writeableItemDtos.size(); i++) { - ItemDto itemDto = writeableItemDtos.get(i); - JSONObject writeableItemJson = new JSONObject(); - writeableItemJson.put("code", itemDto.getCode()); - writeableItemJson.put("name", itemDto.getName()); - if (!warry.contains(writeableItemJson)) { - writeableItemJson.put("db", itemDto.getDb()); - w_arry.add(writeableItemJson); + if (CollectionUtils.isNotEmpty(writeableItemDtos)) { + for (int i = 0; i < writeableItemDtos.size(); i++) { + ItemDto itemDto = writeableItemDtos.get(i); + JSONObject writeableItemJson = new JSONObject(); + writeableItemJson.put("code", itemDto.getCode()); + writeableItemJson.put("name", itemDto.getName()); + if (!warry.contains(writeableItemJson)) { + writeableItemJson.put("db", itemDto.getDb()); + w_arry.add(writeableItemJson); + } } } if (!r_arry.isEmpty()) { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/manipulator_cache/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/manipulator_cache/ItemProtocol.java index 9b04b8ba7..bcf594ec4 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/manipulator_cache/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/manipulator_cache/ItemProtocol.java @@ -18,6 +18,8 @@ public class ItemProtocol { //动作信号 public static String item_action = "action"; + public static String item_to_command = "to_command"; + private ManipulatorCacheDeviceDriver driver; public ItemProtocol(ManipulatorCacheDeviceDriver driver) { @@ -49,6 +51,7 @@ public class ItemProtocol { public static List getReadableItemDtos() { ArrayList list = new ArrayList<>(); + list.add(new ItemDto(item_to_command, "作业命令", "DB200.W2", Boolean.valueOf(true))); list.add(new ItemDto(item_mode, "工作模式", "DB1.B1")); list.add(new ItemDto(item_action, "动作信号", "DB1.B3")); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/manipulator_cache/ManipulatorCacheDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/manipulator_cache/ManipulatorCacheDeviceDriver.java index 6219eace3..9fcc854c4 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/manipulator_cache/ManipulatorCacheDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/manipulator_cache/ManipulatorCacheDeviceDriver.java @@ -42,6 +42,8 @@ public class ManipulatorCacheDeviceDriver extends AbstractOpcDeviceDriver implem int action = 0; int last_action = 0; + + @Override public Device getDevice() { return this.device; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java index c7b03641f..8e461e2b3 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java @@ -19,6 +19,7 @@ import org.nl.acs.device_driver.RouteableDeviceDriver; import org.nl.acs.device_driver.conveyor.siemens_conveyor.SiemensConveyorDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; +import org.nl.acs.device_driver.one_conveyor.box_subvolumes_conveyor.BoxSubvolumesConveyorDeviceDriver; import org.nl.acs.device_driver.one_conveyor.manipulator_cache.ManipulatorCacheDeviceDriver; import org.nl.acs.history.ErrorUtil; import org.nl.acs.history.service.DeviceErrorLogService; @@ -78,11 +79,11 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i int task = 0; int last_task = 0; // x坐标 - float x_position = 0; - float last_x_position = 0; + float x = 0.0f; + float last_x = 0.0f; // y坐标 - float y_position = 0; - float last_y_position = 0; + float y = 0.0f; + float last_y = 0.0f; int heartbeat = 0; int last_heartbeat = 0; @@ -169,8 +170,8 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i to_target = this.itemProtocol.getTo_target(); to_task = this.itemProtocol.getTo_task(); to_onset = this.itemProtocol.getTo_onset(); - x_position = this.itemProtocol.getX_position(); - y_position = this.itemProtocol.getY_position(); + x = this.itemProtocol.getX(); + y = this.itemProtocol.getY(); to_seq = this.itemProtocol.getTo_seq(); to_max_no = this.itemProtocol.getTo_max_no(); to_direction = this.itemProtocol.getTo_direction(); @@ -247,8 +248,6 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i last_to_command = to_command; last_to_target = to_target; last_to_onset = to_onset; - last_x_position = x_position; - last_y_position = y_position; last_to_seq = to_seq; last_to_last = to_last; last_to_direction = to_direction; @@ -390,10 +389,10 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); } - SiemensConveyorDeviceDriver siemensConveyorDeviceDriver; - if (nextDevice.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) { - siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) nextDevice.getDeviceDriver(); - if (siemensConveyorDeviceDriver.getMove() != 1) { + BoxSubvolumesConveyorDeviceDriver boxSubvolumesConveyorDeviceDriver; + if (nextDevice.getDeviceDriver() instanceof BoxSubvolumesConveyorDeviceDriver) { + boxSubvolumesConveyorDeviceDriver = (BoxSubvolumesConveyorDeviceDriver) nextDevice.getDeviceDriver(); + if (boxSubvolumesConveyorDeviceDriver.getMove() != 1) { notCreateInstMessage = "universal_notCreateInstMessage2"; return false; } @@ -402,7 +401,7 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i ManipulatorCacheDeviceDriver manipulatorCacheDeviceDriver; if (startDevice.getDeviceDriver() instanceof ManipulatorCacheDeviceDriver) { manipulatorCacheDeviceDriver = (ManipulatorCacheDeviceDriver) startDevice.getDeviceDriver(); - if (manipulatorCacheDeviceDriver.getMode() != 2 && manipulatorCacheDeviceDriver.getMode() !=1) { + if (manipulatorCacheDeviceDriver.getMode() != 2 && manipulatorCacheDeviceDriver.getAction() !=1) { notCreateInstMessage = "universal_notCreateInstMessage3"; return false; } @@ -493,8 +492,8 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } if (ObjectUtil.isNotEmpty(interactionJsonDTO.getBarcode())) { - map8.put("code", "to_barcode"); - map8.put("value", interactionJsonDTO.getBarcode()); + map9.put("code", "to_barcode"); + map9.put("value", interactionJsonDTO.getBarcode()); list.add(map9); } } @@ -613,8 +612,8 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i jo.put("feedMessage", LangProcess.msg(feedMessage)); jo.put("driver_type", "siemens_conveyor"); jo.put("is_click", true); - jo.put("x", x_position); - jo.put("y", y_position); + jo.put("x", x); + jo.put("y", y); return jo; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/ItemProtocol.java index 41cfd2387..9f26e9490 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/ItemProtocol.java @@ -43,11 +43,11 @@ public class ItemProtocol { /** * x轴坐标 */ - public static String item_x_position = "x_position"; + public static String item_x = "x"; /** * y轴坐标 */ - public static String item_y_position = "y_position"; + public static String item_y= "y"; /** @@ -96,6 +96,10 @@ public class ItemProtocol { * 下发是否最后子卷 */ public static String item_to_last_one = "to_last_one"; + /** + *下发木箱条码 + */ + public static String item_to_barcode = "to_barcode"; private BoxPackageManipulatorDeviceDriver driver; @@ -148,12 +152,12 @@ public class ItemProtocol { return this.getOpcIntegerValue(item_to_target); } - public float getX_position() { - return this.getOpcFloatValue(item_x_position); + public float getX() { + return this.getOpcFloatValue(item_x); } - public float getY_position() { - return this.getOpcFloatValue(item_y_position); + public float getY() { + return this.getOpcFloatValue(item_y); } public int getTo_seq(){ @@ -186,6 +190,10 @@ public class ItemProtocol { } + public String getTo_barcode() { + return this.getOpcStringValue(item_to_barcode); + } + public String getOpcStringValue(String protocol) { String value = this.driver.getStringValue(protocol); if (StrUtil.isEmpty(value)) { @@ -218,8 +226,8 @@ public class ItemProtocol { list.add(new ItemDto(item_walk_y, "行走列", "DB1.B4")); list.add(new ItemDto(item_error, "报警信号", "DB1.B5")); list.add(new ItemDto(item_task, "任务号", "DB1.D6")); - list.add(new ItemDto(item_x_position, "x坐标", "DB1.REAL10")); - list.add(new ItemDto(item_y_position, "y坐标", "DB1.REAL14")); + list.add(new ItemDto(item_x, "x坐标", "DB1.REAL10")); + list.add(new ItemDto(item_y, "y坐标", "DB1.REAL14")); list.add(new ItemDto(item_position, "木箱位置", "DB1.REAL16")); list.add(new ItemDto(item_number, "木箱数量", "DB1.REAL18")); return list; @@ -235,6 +243,8 @@ public class ItemProtocol { list.add(new ItemDto(item_to_direction, "子卷摆放方向", "DB2.D10")); list.add(new ItemDto(item_to_seq, "下发木箱工位顺序", "DB2.W12")); list.add(new ItemDto(item_to_last_one, "下发是否最后子卷", "DB2.W14")); + list.add(new ItemDto(item_to_barcode, "下发木箱条码", "DB601.STRING1.50")); + return list; } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/VolumeTwoManipulatorManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/VolumeTwoManipulatorManipulatorDeviceDriver.java index 446e0fdd8..d9ea1bc4e 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/VolumeTwoManipulatorManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/VolumeTwoManipulatorManipulatorDeviceDriver.java @@ -16,6 +16,7 @@ import org.nl.acs.device.service.impl.DeviceExtraServiceImpl; import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.FeedLmsRealFailed; import org.nl.acs.device_driver.RouteableDeviceDriver; +import org.nl.acs.device_driver.conveyor.belt_conveyor.BeltConveyorDeviceDriver; import org.nl.acs.device_driver.conveyor.siemens_conveyor.SiemensConveyorDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; @@ -390,10 +391,10 @@ public class VolumeTwoManipulatorManipulatorDeviceDriver extends AbstractOpcDevi notCreateInstMessage = "universal_notCreateInstMessage1"; throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); } - SiemensConveyorDeviceDriver siemensConveyorDeviceDriver; - if (startDevice.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) { - siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) startDevice.getDeviceDriver(); - if (siemensConveyorDeviceDriver.getMove() != 1) { + BeltConveyorDeviceDriver beltConveyorDeviceDriver; + if (startDevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) { + beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) startDevice.getDeviceDriver(); + if (beltConveyorDeviceDriver.getMove() != 1) { notCreateInstMessage = "universal_notCreateInstMessage2"; return false; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/StandardStackerDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/StandardStackerDeviceDriver.java index bdef248cf..b48a92b56 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/StandardStackerDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/StandardStackerDeviceDriver.java @@ -8,7 +8,6 @@ import com.alibaba.fastjson.JSONObject; import lombok.Data; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.checkerframework.common.value.qual.StringVal; import org.nl.acs.common.base.CommonFinalParam; import org.nl.acs.device.domain.Device; import org.nl.acs.device.enums.DeviceType; @@ -33,7 +32,6 @@ import org.nl.acs.opc.DeviceAppServiceImpl; import org.nl.acs.route.service.RouteLineService; import org.nl.acs.route.service.dto.RouteLineDto; import org.nl.acs.route.service.impl.RouteLineServiceImpl; -import org.nl.acs.task.domain.Task; import org.nl.acs.task.service.TaskService; import org.nl.acs.task.service.dto.TaskDto; import org.nl.common.utils.RedisUtils; @@ -481,18 +479,18 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme Instruction inst = checkInst(); try { finish_instruction(inst); -// if (ObjectUtil.isNotEmpty(redisUtils.get(REDIS_MOVE_BOX))){ -// String taskRedis = redisUtils.get(REDIS_MOVE_BOX).toString(); -// task = Integer.valueOf(taskRedis); -// Instruction instOld = checkInst(); -// List list1 = new ArrayList(); -// pakageCommand(list1, taskRedis); -// pakagePlc(instOld, list1); -// if (ObjectUtil.isNotNull(list1)) { -// this.writing(list1); -// } -// } -// list.remove(0); + if (ObjectUtil.isNotEmpty(redisUtils.get(REDIS_MOVE_BOX))){ + String taskRedis = redisUtils.get(REDIS_MOVE_BOX).toString(); + task = Integer.valueOf(taskRedis); + Instruction instOld = checkInst(); + List list1 = new ArrayList(); + pakageCommand(list1, taskRedis); + pakagePlc(instOld, list1); + if (ObjectUtil.isNotNull(list1)) { + this.writing(list1); + } + list.remove(0); + } } catch (Exception e) { e.printStackTrace(); } @@ -605,11 +603,13 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme } if (type.equals(StandarStirageErroEnum.VOIDANCE.getType())) { updateData1(poinCode, instruction, point, split); - pakageData(point, split); + List list = new ArrayList(); + pakageData(list,point, split); } if (type.equals(StandarStirageErroEnum.BLOCK_IN.getType()) || type.equals(StandarStirageErroEnum.FILL.getType())) { updateData2(poinCode, instruction, point, split); - pakageData(point, split); + List list = new ArrayList(); + pakageData(list,point, split); } } if (StrUtil.isNotEmpty(jo.getString("task_id"))) { @@ -618,11 +618,17 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme //存缓存 redisUtils.set(REDIS_MOVE_BOX, task); TaskDto taskId = taskserver.findById(jo.getString("task_id")); + Instruction instructionDDJ = instructionService.creatDDJInstruction(taskId.getTask_id()); + List list = new ArrayList(); if (ObjectUtil.isNotEmpty(taskId)) { + if (StrUtil.isNotEmpty(instructionDDJ.getInstruction_code())) { + task = Integer.valueOf(instructionDDJ.getInstruction_code()); + pakageCommand(list,instructionDDJ.getInstruction_code()); + } String poinCodeMove = taskId.getStart_point_code(); String[] split = poinCodeMove.split("-"); Device point = deviceAppService.findDeviceByCode(split[0]); - pakageData(point, split); + pakageData(list, point, split); } } } @@ -642,8 +648,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme } } - private void pakageData( Device point, String[] split) { - List list = new ArrayList(); + private void pakageData(List list, Device point, String[] split) { String x = point.getExtraValue().get("x").toString(); String y = split[1]; String z = split[2]; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java index a387ec0c4..86568d6c5 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java @@ -587,8 +587,8 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { jo.put("device_code", boxManipulatorDeviceDriver.getDevice().getDevice_code()); jo.put("device_name", boxManipulatorDeviceDriver.getDevice().getDevice_name()); jo.put("status", Math.min(3, boxManipulatorDeviceDriver.getMode())); - jo.put("x", boxManipulatorDeviceDriver.getX_position()); - jo.put("y", boxManipulatorDeviceDriver.getY_position()); + jo.put("x", boxManipulatorDeviceDriver.getX()); + jo.put("y", boxManipulatorDeviceDriver.getY()); jo.put("mode", boxManipulatorDeviceDriver.getMode()); jo.put("move", boxManipulatorDeviceDriver.getMove()); jo.put("action", boxManipulatorDeviceDriver.getAction()); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/InstructionService.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/InstructionService.java index 96384d487..7197f3a23 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/InstructionService.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/InstructionService.java @@ -184,6 +184,9 @@ public interface InstructionService extends CommonService { */ void create(Instruction dto) throws Exception; + + Instruction creatDDJInstruction(String taskId); + /** * 创建2 * diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index 0c4f4a588..4856c9122 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java @@ -1,7 +1,6 @@ package org.nl.acs.instruction.service.impl; import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.ListUtil; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; @@ -12,9 +11,9 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.ObjectUtils; @@ -360,20 +359,15 @@ public class InstructionServiceImpl extends CommonServiceImpl impleme private TaskFeedbackService taskFeedbackService; @Autowired private ISysParamService paramService; + @Lazy @Autowired private XianGongAgvService agvService; @Autowired @@ -1109,7 +1111,8 @@ public class TaskServiceImpl extends CommonServiceImpl impleme CommonFinalParam commonFinalParam = new CommonFinalParam(); if (StrUtil.contains(start_point_code, commonFinalParam.getBARRE()) && StrUtil.count(start_point_code, commonFinalParam.getBARRE()) == 2) { String[] start_point = start_point_code.split(commonFinalParam.getBARRE()); - task.setFrom_x(start_point[0]); + Device starPoint = deviceAppService.findDeviceByCode(start_point[0]); + task.setFrom_x(starPoint.getExtraValue().get("x").toString()); task.setStart_device_code(start_point[0]); if (Integer.parseInt(start_point[1]) < 10 && start_point[1].length() == 1) { from_y = "0" + start_point[1]; @@ -1161,7 +1164,8 @@ public class TaskServiceImpl extends CommonServiceImpl impleme } else { from_z = task.getFrom_z(); } - task.setFrom_x(start_point_code); + Device starPoint = deviceAppService.findDeviceByCode(start_point_code); + task.setFrom_x(starPoint.getExtraValue().get("x").toString()); task.setStart_point_code(start_point_code + commonFinalParam.getBARRE() + from_y + commonFinalParam.getBARRE() + from_z); task.setStart_device_code(start_point_code); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/AutoCreateInst.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/AutoCreateInst.java index 83dbbe6ef..de16dd84a 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/AutoCreateInst.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/AutoCreateInst.java @@ -189,6 +189,7 @@ public class AutoCreateInst { } try { instructionService.create(instdto); + } catch (Exception e) { acsTask.setRemark(e.getMessage()); taskserver.updateByCodeFromCache(acsTask); diff --git a/acs2/nladmin-ui/public/config.js b/acs2/nladmin-ui/public/config.js index ce714251a..4f5976990 100644 --- a/acs2/nladmin-ui/public/config.js +++ b/acs2/nladmin-ui/public/config.js @@ -3,7 +3,7 @@ window.g = { VUE_APP_BASE_API: 'http://127.0.0.1:8011' }, prod: { - VUE_APP_BASE_API: 'http://127.0.0.1:8011' + VUE_APP_BASE_API: 'http://10.1.3.96:8011' } }