diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java index e6ef10bbd..eee7ab0a3 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java @@ -22,6 +22,7 @@ import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.RouteableDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; +import org.nl.acs.device_driver.one_conveyor.fold_disc_site.FoldDiscSiteDeviceDriver; import org.nl.acs.device_driver.one_manipulator.box_package_manipulator.InteractionJsonDTO; import org.nl.acs.enums.AcsToLmsApplyTaskTypeEnum; import org.nl.acs.ext.wms.service.AcsToWmsService; @@ -647,6 +648,8 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements } //判断下一个输送线点位是否有货 BeltConveyorDeviceDriver beltConveyorDeviceDriver; + //异常位到叠盘位 + FoldDiscSiteDeviceDriver foldDiscSiteDeviceDriver; if (nextdevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) { beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) nextdevice.getDeviceDriver(); if (beltConveyorDeviceDriver.getMode() != 2 || beltConveyorDeviceDriver.getMove() == 1) { @@ -654,7 +657,14 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements this.setNotCreateInstMessage("universal_notCreateInstMessage4"); return false; } - }else { + }else if (nextdevice.getDeviceDriver() instanceof FoldDiscSiteDeviceDriver){ + foldDiscSiteDeviceDriver = (FoldDiscSiteDeviceDriver) nextdevice.getDeviceDriver(); + if (foldDiscSiteDeviceDriver.getMode() != 2 || foldDiscSiteDeviceDriver.getMove() == 1) { + log.error("输送机,{}未联机或执行中", next_device_code); + this.setNotCreateInstMessage("universal_notCreateInstMessage4"); + return false; + } + } else { //下一个设备不是输送线指令 this.setNotCreateInstMessage("universal_notCreateInstMessage6"); return false; @@ -813,6 +823,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements public JSONObject getDeviceStatusName() { JSONObject jo = new JSONObject(); String mode = ""; + String move = ""; String requireSucess = "0"; if (this.requireSucess) { requireSucess = "1"; @@ -832,18 +843,22 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements jo.put("device_name", this.getDevice().getDevice_name()); jo.put("mode", mode); jo.put("message", LangProcess.msg(message)); - jo.put("error", this.getError()); - String move = "无货"; - jo.put("hasGoods", false); - if (this.move == 1) { - move = "有货"; + jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); + if (this.getMove() == 0) { + move = LangProcess.msg("universal_no"); + jo.put("hasGoods", false); + } else if (this.getMove() == 1) { + move = LangProcess.msg("universal_yes"); + jo.put("hasGoods", true); + } else if (this.getMove() == 2) { + move = LangProcess.msg("universal_two_yes"); jo.put("hasGoods", true); } String container_type = ""; if (this.container_type == 1) { - container_type = "小托盘"; + container_type = LangProcess.msg("universal_small_pallets"); } else if (this.container_type == 2) { - container_type = "大托盘"; + container_type = LangProcess.msg("universal_large_pallets"); } jo.put("move", move); jo.put("task", task); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/standard_inspect_site/StandardInspectSiteDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/standard_inspect_site/StandardInspectSiteDeviceDriver.java index f86337142..a94354146 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/standard_inspect_site/StandardInspectSiteDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/standard_inspect_site/StandardInspectSiteDeviceDriver.java @@ -14,6 +14,7 @@ import org.nl.acs.device_driver.RouteableDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.ext.wms.service.AcsToWmsService; +import org.nl.acs.history.ErrorUtil; import org.nl.acs.instruction.domain.Instruction; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.monitor.DeviceStageMonitor; @@ -28,6 +29,7 @@ import org.nl.acs.task.service.mapper.TaskMapper; import org.nl.acs.utils.ConvertUtil; import org.nl.common.utils.CodeUtil; import org.nl.config.SpringContextHolder; +import org.nl.config.language.LangProcess; import org.openscada.opc.lib.da.Server; import java.util.Date; @@ -195,7 +197,6 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp //未联机 } else if (mode == 0) { this.setIsonline(false); - this.setIserror(true); message = "未联机"; //有报警 } else if (error != 0) { @@ -418,31 +419,34 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp String action = ""; String move = ""; if (this.getMode() == 0) { - mode = "未联机"; + mode = LangProcess.msg("universal_off-line"); } else if (this.getMode() == 1) { - mode = "单机"; + mode = LangProcess.msg("universal_stand-alone"); } else if (this.getMode() == 2) { - mode = "联机"; + mode = LangProcess.msg("universal_standby"); } else if (this.getMode() == 3) { - mode = "运行中"; + mode = LangProcess.msg("universal_operation"); } - if (this.getMove() == 0) { - move = "无货"; + move = LangProcess.msg("universal_no"); jo.put("hasGoods", false); } else if (this.getMove() == 1) { - move = "有货"; + move = LangProcess.msg("universal_yes"); jo.put("hasGoods", true); } else if (this.getMove() == 2) { - move = "有托盘有货"; + move = LangProcess.msg("universal_two_yes"); jo.put("hasGoods", true); } + action = LangProcess.msg("universal_actionMessage1"); + if(this.action == 1){ + action = LangProcess.msg("universal_actionMessage2"); + } jo.put("device_name", this.getDevice().getDevice_name()); jo.put("mode", mode); jo.put("move", move); jo.put("action", action); jo.put("isOnline", this.getIsonline()); - jo.put("error", this.getError()); + jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); jo.put("isError", this.getIserror()); jo.put("task", this.getTask()); return jo; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java index 1e438a7fd..8a30e9cc5 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java @@ -10,12 +10,14 @@ import org.nl.acs.agv.server.NDCAgvService; import org.nl.acs.common.base.CommonFinalParam; import org.nl.acs.device.domain.Device; import org.nl.acs.device.service.DeviceService; +import org.nl.acs.device.service.dto.DeviceDto; 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.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; +import org.nl.acs.history.ErrorUtil; import org.nl.acs.instruction.domain.Instruction; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.log.service.DeviceExecuteLogService; @@ -228,12 +230,12 @@ public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver imple String action = ""; String move = ""; String option = ""; - if(this.getOption() == 0){ - option ="禁止进出"; - } else if(this.getOption() == 1){ - option ="允许进入"; - } else if(this.getOption() == 2){ - option ="允许离开"; + if (this.getOption() == 0) { + action = LangProcess.msg("universal_actionMessage1"); + } else if (this.getOption() == 1) { + action = LangProcess.msg("universal_actionMessage2"); + } else if (this.getOption() == 2) { + action = LangProcess.msg("universal_actionMessage3"); } if (this.getMode() == 0) { mode = LangProcess.msg("universal_off-line"); @@ -256,13 +258,15 @@ public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver imple move = LangProcess.msg("universal_two_yes"); jo.put("hasGoods", true); } - - jo.put("device_name", this.getDevice().getDevice_name()); + DeviceDto dto = deviceservice.findByCode(this.getDevice().getDevice_code()); + jo.put("zh_device_name",dto.getZh_device_name()); + jo.put("en_device_name",dto.getEn_device_name()); + jo.put("in_device_name",dto.getIn_device_name()); jo.put("mode", mode); jo.put("move", move); jo.put("action", action); jo.put("isOnline", true); - jo.put("error", this.getError()); + jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); jo.put("isError", this.getIserror()); jo.put("option", option); jo.put("is_click", true); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/BoxStorageOutConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/BoxStorageOutConveyorDeviceDriver.java index cbc742666..9774bbaf5 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/BoxStorageOutConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/BoxStorageOutConveyorDeviceDriver.java @@ -593,7 +593,8 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i @Override public JSONObject getDeviceStatusName() { - JSONObject jo = new JSONObject(); + Map map = new LinkedHashMap<>(); + String mode = ""; String move = ""; String carrier_direction = ""; @@ -609,43 +610,44 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i if (this.getMove() == 0) { move = LangProcess.msg("universal_no"); - jo.put("hasGoods", false); + map.put("hasGoods", false); } else if (this.getMove() == 1) { move = LangProcess.msg("universal_yes"); - jo.put("hasGoods", true); + map.put("hasGoods", true); } else if (this.getMove() == 2) { move = LangProcess.msg("universal_two_yes"); - jo.put("hasGoods", true); + map.put("hasGoods", true); } if (this.carrier_direction == 1) { - carrier_direction = "正转"; + carrier_direction = LangProcess.msg("universal_forward_rotation"); } else if (this.carrier_direction == 2) { - carrier_direction = "反转"; + carrier_direction = LangProcess.msg("universal_rollback"); } - String requireSucess = "0"; + String requireSucess = LangProcess.msg("universal_actionMessage4"); if (this.requireSucess) { - requireSucess = "1"; + requireSucess = LangProcess.msg("universal_actionMessage5"); } - jo.put("device_name", this.getDevice().getDevice_name()); - jo.put("mode", mode); - jo.put("move", move); - jo.put("carrier_direction", carrier_direction); - jo.put("task", task); - jo.put("last_task", last_task); - jo.put("task_code", task_code); - jo.put("inst_message", this.inst_message); - jo.put("last_inst_message", this.last_inst_message); - jo.put("isOnline", this.getIsonline()); - jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError()))); - jo.put("isError", this.getIserror()); - jo.put("message", LangProcess.msg(message)); - jo.put("hand_barcode", hand_barcode); - jo.put("barcode", this.getMove() == 0 ? null : checkInst() == null ? vehicle_code : checkInst().getVehicle_code()); - jo.put("is_click", true); - jo.put("requireSucess", requireSucess); - jo.put("driver_type", "siemens_conveyor"); - jo.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage)); + map.put("device_name", this.getDevice().getDevice_name()); + map.put("mode", mode); + map.put("move", move); + map.put("carrier_direction", carrier_direction); + map.put("task", task); + map.put("last_task", last_task); + /*map.put("task_code", task_code);*/ + map.put("isOnline", this.getIsonline()); + map.put("isError", this.getIserror()); + map.put("hand_barcode", hand_barcode); + map.put("barcode", this.getMove() == 0 ? null : checkInst() == null ? vehicle_code : checkInst().getVehicle_code()); + map.put("is_click", true); + map.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); + map.put("requireSucess", requireSucess); + map.put("driver_type", "siemens_conveyor"); + map.put("message", LangProcess.msg(message)); + map.put("inst_message", this.inst_message); + map.put("last_inst_message", this.last_inst_message); + map.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage)); + JSONObject jo = new JSONObject(map); return jo; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_subvolumes_conveyor/BoxSubvolumesConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_subvolumes_conveyor/BoxSubvolumesConveyorDeviceDriver.java index 51faeb6f0..3e11b6c61 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_subvolumes_conveyor/BoxSubvolumesConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_subvolumes_conveyor/BoxSubvolumesConveyorDeviceDriver.java @@ -333,7 +333,7 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i jo.put("inst_message", this.inst_message); jo.put("last_inst_message", this.last_inst_message); jo.put("isOnline", this.getIsonline()); - jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError()))); + jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); jo.put("isError", this.getIserror()); jo.put("message", LangProcess.msg(message)); jo.put("hand_barcode", hand_barcode); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/FinishedProductOutBindLableDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/FinishedProductOutBindLableDeviceDriver.java index eaaf07258..f407a5dd1 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/FinishedProductOutBindLableDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/FinishedProductOutBindLableDeviceDriver.java @@ -321,10 +321,8 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr return; } else { this.require_apply_strangulation_time = date; -// String vehicle_code = ""; -// Instruction inst = instructionService.findByCodeFromCache(String.valueOf(task)); - if (StrUtil.isEmpty(inst.getVehicle_code())) { + if (ObjectUtil.isEmpty(inst) && StrUtil.isEmpty(inst.getVehicle_code())) { message = LangProcess.msg("one_message8") + ": " + task + LangProcess.msg("one_message11"); return; } @@ -413,7 +411,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr JSONObject jo = JSON.parseObject(datas); String length = jo.get("length").toString(); - String weight = jo.get("weight").toString(); + String width = jo.get("width").toString(); String height = jo.get("height").toString(); String isBinding = jo.get("isBinding").toString(); String isLabeling = jo.get("isLabeling").toString(); @@ -433,7 +431,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr list.add(map); Map map2 = new HashMap(); map2.put("code", "to_weight"); - map2.put("value", weight); + map2.put("value", width); list.add(map2); Map map3 = new HashMap(); map3.put("code", "to_height"); @@ -483,7 +481,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr list.add(map); Map map2 = new HashMap(); map2.put("code", "to_weight"); - map2.put("value", weight); + map2.put("value", width); list.add(map2); Map map3 = new HashMap(); map3.put("code", "to_height"); @@ -530,7 +528,19 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr Map map12 = new HashMap(); map12.put("code", "to_labeling_template"); map12.put("value", labelingTemplate); - list.add(map12); + + Map map13 = new HashMap(); + map13.put("code", "to_length"); + map13.put("value", length); + list.add(map13); + Map map14 = new HashMap(); + map14.put("code", "to_width"); + map14.put("value", width); + list.add(map14); + Map map15 = new HashMap(); + map15.put("code", "to_height"); + map15.put("value", height); + list.add(map15); } if(mode == 17){ @@ -540,7 +550,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr list.add(map); Map map2 = new HashMap(); map2.put("code", "to_weight"); - map2.put("value", weight); + map2.put("value", width); list.add(map2); Map map3 = new HashMap(); map3.put("code", "to_height"); @@ -640,9 +650,9 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr if (this.carrier_direction == 1) { - carrier_direction = "正转"; + carrier_direction = LangProcess.msg("universal_forward_rotation"); } else if (this.carrier_direction == 2) { - carrier_direction = "反转"; + carrier_direction = LangProcess.msg("universal_rollback"); } String requireSucess = "0"; if (this.requireSucess) { @@ -658,7 +668,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr jo.put("inst_message", this.inst_message); jo.put("last_inst_message", this.last_inst_message); jo.put("isOnline", this.getIsonline()); - jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError()))); + jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); jo.put("isError", this.getIserror()); jo.put("message", LangProcess.msg(message)); jo.put("hand_barcode", hand_barcode); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/fold_disc_site/FoldDiscSiteDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/fold_disc_site/FoldDiscSiteDeviceDriver.java index 2b8be67a5..30262c27e 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/fold_disc_site/FoldDiscSiteDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/fold_disc_site/FoldDiscSiteDeviceDriver.java @@ -71,7 +71,7 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsService.class); @Autowired - LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean("luceneExecuteLogServiceImpl"); + LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean("luceneExecuteLogServiceImpl"); DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class); @@ -210,7 +210,7 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements } //托盘去扫码位 - if (mode == 4){ + if (mode == 4) { List list1 = new ArrayList(); Map map = new HashMap(); map.put("code", "to_command"); @@ -236,22 +236,22 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements List toInstructions; //申请空托盘入库 - if (mode == 9 && move == 1 && !requireSucess){ + if (mode == 9 && move == 1 && !requireSucess) { applyEmptyTask(StorageTypeEnum.DISKS_IN.getType(), mode); } //申请空托盘出库 - if (mode == 8 && move == 1 && !requireSucess){ - applyEmptyTask(StorageTypeEnum.DISKS_OUT.getType(),mode); + if (mode == 8 && !requireSucess) { + applyEmptyTask(StorageTypeEnum.DISKS_OUT.getType(), mode); } //碟盘位申请任务 - if (mode == 2 && move == 1 && !requireSucess) { + if (mode == 2 && move == 1 && !requireSucess) { boolean res = instruction_require(); if (res) { notCreateInstMessage = ""; @@ -261,7 +261,8 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements } else { if (mode == 2) { //if (!requireSucess) { - String remark = "";; + String remark = ""; + ; if (mode != 2) { remark = "universal_remark2"; } @@ -269,13 +270,13 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements remark = "universal_remark3"; } if (task != 0) { - remark = LangProcess.msg("universal_remark4"); + remark = LangProcess.msg("universal_remark4"); if (ObjectUtil.isNotEmpty(this.inst)) { this.inst = null; } } if (requireSucess) { - remark = LangProcess.msg("universal_remark5"); + remark = LangProcess.msg("universal_remark5"); } this.setNotCreateTaskMessage(remark); //} @@ -298,7 +299,6 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements } - /** * 请求指令 */ @@ -557,12 +557,12 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements luceneExecuteLogService.deviceExecuteLog(logDto); String response = acsToWmsService.applyTwo(param); JSONObject jo = JSON.parseObject(response); - if (response == null || jo.getInteger("status") == 200) { + if (jo.getInteger("status") == 200) { LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(device_code) .content("申请空托盘出入库,参数,接口返回:" + jo) .build(); - logDto.setLog_level(4); + logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); List list1 = new ArrayList(); Map map = new HashMap(); @@ -571,12 +571,12 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements list1.add(map); this.writing(list1); this.requireSucess = true; - }else { + } else { LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(device_code) .content("申请空托盘出入库,返回参数:" + jo.getString("body")) .build(); - logDto.setLog_level(4); + logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); } } catch (Exception e) { @@ -586,8 +586,6 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements } - - @Override public JSONObject getDeviceStatusName() { JSONObject jo = new JSONObject(); @@ -603,9 +601,9 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements mode = LangProcess.msg("universal_standby"); } else if (this.getMode() == 3) { mode = LangProcess.msg("universal_operation"); - }else if (this.getMode() == 9) { + } else if (this.getMode() == 9) { mode = LangProcess.msg("one_mode2"); - }else if (this.getMode() == 8) { + } else if (this.getMode() == 8) { mode = LangProcess.msg("one_mode4"); } @@ -633,11 +631,11 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements jo.put("action", action); jo.put("task", task); jo.put("isOnline", this.getIsonline()); - jo.put("error", this.getError()); + jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); jo.put("isError", this.getIserror()); jo.put("message", LangProcess.msg(message)); jo.put("notCreateTaskMessage", notCreateTaskMessage); - jo.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage)); + jo.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage)); jo.put("feedMessage", LangProcess.msg(feedMessage)); jo.put("driver_type", "siemens_conveyor"); jo.put("is_click", true); @@ -655,7 +653,6 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements } - /** * 更新指令状态 */ @@ -680,9 +677,7 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements if (StrUtil.equals(inst.getInstruction_status(), InstructionStatusEnum.BUSY.getIndex()) || StrUtil.equals(inst.getInstruction_status(), InstructionStatusEnum.READY.getIndex())) { if (StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())) { inst.setExecute_device_code(this.device_code); - if (mode == 2) { - finish_instruction(); - } + finish_instruction(); logServer.deviceExecuteLog(device_code, "", "", "纸箱入库输送线任务开始反馈完成状态,反馈成功,指令号:" + task + ",载具号:" + inst.getVehicle_code()); } else { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java index 84c087f05..cac9dadcd 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java @@ -220,8 +220,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv to_task = this.itemProtocol.getTo_task(); to_container_type = this.itemProtocol.getTo_container_type(); container_type = this.itemProtocol.getContainer_type(); - carrier_direction = this.itemProtocol.getCarrier_direction(); - height = this.itemProtocol.getHeight(); + carrier_direction = this.itemProtocol.getContainer_direction(); weight = this.itemProtocol.getWeight(); barcode = this.itemProtocol.getBarcode(); material_barcode = this.itemProtocol.getMaterialBarcode(); @@ -236,6 +235,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记:" + requireSucess); logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode); } + if(move !=last_move){ if (ObjectUtil.isNotEmpty(inst)){ if (move==0){ @@ -260,7 +260,6 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv requireSucess = false; } if (move != 0 && task > 0) { - update_instruction_status(); } @@ -302,6 +301,12 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv } + //申请退货入库 + if (mode == 18 && move == 1 && !requireSucess){ + applyBoxReturnTask(StorageTypeEnum.BOX_RETURN.getType(), mode); + + } + //申请入库指令、异常位指令 if (mode == 2 && move == 1 && !requireSucess) { boolean res = instruction_require(); @@ -350,6 +355,55 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv last_barcode = barcode; } + private void applyBoxReturnTask(String type, int mode) { + Date date = new Date(); + if (date.getTime() - this.require_apply_strangulation_time.getTime() + < (long) this.instruction_require_time_out) { + log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); + return; + } else { + try { + JSONObject param = new JSONObject(); + param.put("device_code", device_code); + param.put("vehicle_code", barcode); + param.put("material_barcode", material_barcode); + param.put("type", type); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("申请退货入库,参数:" + param) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + String response = acsToWmsService.applyTwo(param); + JSONObject jo = JSON.parseObject(response); + if (jo.getInteger("status") == 200) { + LuceneLogDto logDto2 = LuceneLogDto.builder() + .device_code(device_code) + .content("申请退货入库,参数,接口返回:" + jo) + .build(); + logDto2.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto2); + List list1 = new ArrayList(); + Map map = new HashMap(); + map.put("code", "to_command"); + map.put("value", mode); + list1.add(map); + this.writing(list1); + this.requireSucess = true; + }else { + LuceneLogDto logDto2 = LuceneLogDto.builder() + .device_code(device_code) + .content("申请退货入库,返回参数:" + jo.getString("body")) + .build(); + logDto2.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto2); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + private void applyErrorTask() { Date date = new Date(); if (date.getTime() - this.require_apply_strangulation_time.getTime() @@ -393,6 +447,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv JSONObject param = new JSONObject(); param.put("device_code", device_code); param.put("container_type", container_type); + param.put("vehicle_code", barcode); param.put("type", type); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) @@ -402,12 +457,12 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv luceneExecuteLogService.deviceExecuteLog(logDto); String response = acsToWmsService.applyTwo(param); JSONObject jo = JSON.parseObject(response); - if (response == null || jo.getInteger("status") == 200) { + if (jo.getInteger("status") == 200) { LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(device_code) .content("申请空托盘出入库,参数,接口返回:" + jo) .build(); - logDto.setLog_level(4); + logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); List list1 = new ArrayList(); Map map = new HashMap(); @@ -421,7 +476,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv .device_code(device_code) .content("申请空托盘出入库,返回参数:" + jo.getString("body")) .build(); - logDto.setLog_level(4); + logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); } } catch (Exception e) { @@ -447,14 +502,16 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv .device_code(device_code) .content("木箱、子卷入库申请入库任务,参数:" + param) .build(); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); String response = acsToWmsService.applyTwo(param); JSONObject jo = JSON.parseObject(response); - if (response == null || jo.getInteger("status") == 200) { + if (jo.getInteger("status") == 200) { LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(device_code) .content("木箱、子卷入库申请入库任务,参数,接口返回:" + jo) .build(); + logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); List list1 = new ArrayList(); Map map = new HashMap(); @@ -468,6 +525,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv .device_code(device_code) .content("木箱、子卷入库申请入库任务,返回参数:" + jo.getString("body")) .build(); + logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); } } @@ -799,7 +857,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv jo.put("action", action); jo.put("task", task); jo.put("isOnline", this.getIsonline()); - jo.put("error", this.getError()); + jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); jo.put("isError", this.getIserror()); jo.put("message", LangProcess.msg(message)); jo.put("notCreateTaskMessage", notCreateTaskMessage); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ItemProtocol.java index 9295ff0e3..0659db260 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ItemProtocol.java @@ -31,10 +31,7 @@ public class ItemProtocol { * 报警 */ public static String item_error = "error"; - /** - * 高度 - */ - public static String item_height = "height"; + /** * 任务号 */ @@ -47,7 +44,7 @@ public class ItemProtocol { /** * 托盘方向 */ - public static String item_carrier_direction="carrier_direction"; + public static String item_container_direction="container_direction"; /** @@ -112,12 +109,10 @@ public class ItemProtocol { return this.getOpcIntegerValue(item_task); } - public int getHeight(){ - return this.getOpcIntegerValue(item_height); - } - public int getCarrier_direction(){ - return this.getOpcIntegerValue(item_carrier_direction); + + public int getContainer_direction(){ + return this.getOpcIntegerValue(item_container_direction); } @@ -202,8 +197,7 @@ public class ItemProtocol { list.add(new ItemDto(item_error, "报警信号", "DB1.B5")); list.add(new ItemDto(item_task, "任务号", "DB1.D6")); list.add(new ItemDto(item_container_type, "托盘类型", "DB1.B7")); - list.add(new ItemDto(item_carrier_direction, "托盘方向", "DB1.B8")); - list.add(new ItemDto(item_height, "高度", "DB1.B9")); + list.add(new ItemDto(item_container_direction, "托盘方向", "DB1.B8")); list.add(new ItemDto(item_weight, "重量", "DB1.B10")); list.add(new ItemDto(item_barcode, "托盘条码", "DB602.STRING1.50")); list.add(new ItemDto(item_material_barcode, "子卷条码", "DB601.STRING1.50")); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/un_box_lable_conveyor/UnBoxLableConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/un_box_lable_conveyor/UnBoxLableConveyorDeviceDriver.java index fc7b9ce1c..33928539e 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/un_box_lable_conveyor/UnBoxLableConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/un_box_lable_conveyor/UnBoxLableConveyorDeviceDriver.java @@ -257,9 +257,20 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl JSONObject param = new JSONObject(); param.put("device_code", device_code); param.put("task", task); - logServer.deviceExecuteLog(this.device_code, "", "", "木箱申请开盖任务,参数:" + param); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("木箱、子卷入库申请入库任务,参数:" + param) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); ApplyLabelingAndBindingResponse response = acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest); if (response == null || response.getstatus() == 200) { + LuceneLogDto logDto2 = LuceneLogDto.builder() + .device_code(device_code) + .content("木箱、子卷入库申请入库任务,参数,接口返回:" + response) + .build(); + logDto2.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto2); Map datas = response.getData(); packagePLCData(datas,instruction); this.setRequireSucess(true); @@ -396,9 +407,9 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl if (this.carrier_direction == 1) { - carrier_direction = "正转"; + carrier_direction = LangProcess.msg("universal_forward_rotation"); } else if (this.carrier_direction == 2) { - carrier_direction = "反转"; + carrier_direction = LangProcess.msg("universal_rollback"); } String requireSucess = "0"; if (this.requireSucess) { @@ -414,7 +425,7 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl jo.put("inst_message", this.inst_message); jo.put("last_inst_message", this.last_inst_message); jo.put("isOnline", this.getIsonline()); - jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError()))); + jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); jo.put("isError", this.getIserror()); jo.put("message", LangProcess.msg(message)); jo.put("hand_barcode", hand_barcode); 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 8a55936ac..4dee22a8a 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 @@ -631,7 +631,7 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i jo.put("task", task); jo.put("walk_y", walk_y); jo.put("isOnline", this.getIsonline()); - jo.put("error", this.getError()); + jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); jo.put("isError", this.getIserror()); jo.put("message", LangProcess.msg(message)); jo.put("notCreateTaskMessage", notCreateTaskMessage); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java index b1be9a5ea..6d1193161 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java @@ -583,7 +583,7 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i jo.put("action", action); jo.put("task", task); jo.put("isOnline", this.getIsonline()); - jo.put("error", this.getError()); + jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); jo.put("isError", this.getIserror()); jo.put("message", LangProcess.msg(message)); jo.put("notCreateTaskMessage", notCreateTaskMessage); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/return_good_manipulator/ReturnGoodManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/return_good_manipulator/ReturnGoodManipulatorDeviceDriver.java index 7d60f656f..3ace89feb 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/return_good_manipulator/ReturnGoodManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/return_good_manipulator/ReturnGoodManipulatorDeviceDriver.java @@ -597,7 +597,7 @@ public class ReturnGoodManipulatorDeviceDriver extends AbstractOpcDeviceDriver i jo.put("action", action); jo.put("task", task); jo.put("isOnline", this.getIsonline()); - jo.put("error", this.getError()); + jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); jo.put("isError", this.getIserror()); jo.put("message", LangProcess.msg(message)); jo.put("notCreateTaskMessage", notCreateTaskMessage); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/trapped_manipulator/TrappedManipulatorManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/trapped_manipulator/TrappedManipulatorManipulatorDeviceDriver.java index 76794eee8..e8f84b53e 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/trapped_manipulator/TrappedManipulatorManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/trapped_manipulator/TrappedManipulatorManipulatorDeviceDriver.java @@ -616,7 +616,7 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice jo.put("action", action); jo.put("task", task); jo.put("isOnline", this.getIsonline()); - jo.put("error", this.getError()); + jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); jo.put("isError", this.getIserror()); jo.put("message", LangProcess.msg(message)); jo.put("notCreateTaskMessage", notCreateTaskMessage); 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 ef6677728..6626f9ee0 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 @@ -635,7 +635,7 @@ public class VolumeTwoManipulatorManipulatorDeviceDriver extends AbstractOpcDevi jo.put("action", action); jo.put("task", task); jo.put("isOnline", this.getIsonline()); - jo.put("error", this.getError()); + jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); jo.put("isError", this.getIserror()); jo.put("message", LangProcess.msg(message)); jo.put("notCreateTaskMessage", notCreateTaskMessage); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/paper_tube_device2/PaperTubeConveyor2DeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/paper_tube_device2/PaperTubeConveyor2DeviceDriver.java index e2a9e3a68..9b790950c 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/paper_tube_device2/PaperTubeConveyor2DeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/paper_tube_device2/PaperTubeConveyor2DeviceDriver.java @@ -686,7 +686,7 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl map.put("device_name", this.getDevice().getDevice_name()); map.put("is_click", true); map.put("mode", mode); - map.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError()))); + map.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); map.put("move", move); map.put("isOnline", this.getIsonline()); map.put("out_seq_arr", this.getItem_out_seq_arr()); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/paper_tube_pick_site/PaperTubePickSiteDefination.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/paper_tube_pick_site/PaperTubePickSiteDefination.java index 7908f8c29..7450a3eed 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/paper_tube_pick_site/PaperTubePickSiteDefination.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/paper_tube_pick_site/PaperTubePickSiteDefination.java @@ -5,7 +5,6 @@ import org.nl.acs.device.domain.Device; import org.nl.acs.device.enums.DeviceType; import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; -import org.nl.acs.device_driver.two_conveyor.pull_head_manipulator.ItemProtocol; import org.springframework.stereotype.Service; import java.util.LinkedList; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/paper_tube_pick_site/PaperTubePickSiteDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/paper_tube_pick_site/PaperTubePickSiteDeviceDriver.java index 485f9f684..06df4f541 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/paper_tube_pick_site/PaperTubePickSiteDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/paper_tube_pick_site/PaperTubePickSiteDeviceDriver.java @@ -11,6 +11,7 @@ import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.RouteableDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; +import org.nl.acs.history.ErrorUtil; import org.nl.acs.history.service.DeviceErrorLogService; import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl; import org.nl.acs.instruction.domain.Instruction; @@ -23,6 +24,7 @@ import org.nl.acs.route.service.RouteLineService; import org.nl.acs.route.service.impl.RouteLineServiceImpl; import org.nl.acs.task.service.TaskService; import org.nl.config.SpringContextHolder; +import org.nl.config.language.LangProcess; import org.springframework.beans.factory.annotation.Autowired; import java.util.Date; @@ -214,13 +216,32 @@ public class PaperTubePickSiteDeviceDriver extends AbstractOpcDeviceDriver imple public JSONObject getDeviceStatusName() { JSONObject jo = new JSONObject(); String mode = ""; - String action = ""; String move = ""; + if (this.getMode() == 0) { + mode = LangProcess.msg("universal_off-line"); + } else if (this.getMode() == 1) { + mode = LangProcess.msg("universal_stand-alone"); + } else if (this.getMode() == 2) { + mode = LangProcess.msg("universal_standby"); + } else if (this.getMode() == 3) { + mode = LangProcess.msg("universal_operation"); + } + if (this.getMove() == 0) { + move = LangProcess.msg("universal_no"); + jo.put("hasGoods", false); + } else if (this.getMove() == 1) { + move = LangProcess.msg("universal_yes"); + jo.put("hasGoods", true); + } else if (this.getMove() == 2) { + move = LangProcess.msg("universal_two_yes"); + jo.put("hasGoods", true); + } + String action = ""; jo.put("device_name", this.getDevice().getDevice_name()); - jo.put("mode", "联机"); - jo.put("action", action); + jo.put("mode", mode); + jo.put("move", move);jo.put("action", action); jo.put("isOnline", true); - jo.put("error", this.getError()); + jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); jo.put("isError", this.getIserror()); return jo; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/RgvDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/RgvDeviceDriver.java index 23b4fee90..c7f5fc870 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/RgvDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/RgvDeviceDriver.java @@ -311,57 +311,64 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr @Override public JSONObject getDeviceStatusName() { - JSONObject jo = new JSONObject(); + Map map = new LinkedHashMap<>(); + String mode = ""; String move = ""; String action = ""; String walk_y = ""; if (this.getMode() == 0) { - mode = "脱机"; + mode = LangProcess.msg("universal_off-line"); } else if (this.getMode() == 1) { - mode = "单机"; + mode = LangProcess.msg("universal_stand-alone"); } else if (this.getMode() == 2) { - mode = "待机"; + mode = LangProcess.msg("universal_standby"); } else if (this.getMode() == 3) { - mode = "运行中"; + mode = LangProcess.msg("universal_operation"); } if (this.getMove() == 0) { - move = "无货"; + move = LangProcess.msg("universal_no"); + map.put("hasGoods", false); } else if (this.getMove() == 1) { - move = "有货"; + move = LangProcess.msg("universal_yes"); + map.put("hasGoods", true); + } else if (this.getMove() == 2) { + move = LangProcess.msg("universal_two_yes"); + map.put("hasGoods", true); } - String requireSucess = "0"; + String requireSucess = LangProcess.msg("universal_actionMessage4"); if (this.requireSucess) { - requireSucess = "1"; + requireSucess = LangProcess.msg("universal_actionMessage5"); } - jo.put("requireSucess", requireSucess); + map.put("requireSucess", requireSucess); if (this.getAction() == 1) { - action = "取货中"; + action = LangProcess.msg("universal_delivery"); } else if (this.getAction() == 2) { - action = "取货完成"; + action = LangProcess.msg("universal_completed"); } else if (this.getAction() == 3) { - action = "放货中"; + action = LangProcess.msg("universal_releasing"); } else if (this.getAction() == 4) { - action = "放货完成"; + action = LangProcess.msg("universal_releasing_completed"); } - jo.put("device_name", this.getDevice().getDevice_name()); - jo.put("mode", mode); - jo.put("move", move); - jo.put("action", action); - jo.put("task", task); - jo.put("walk_y", walk_y); - jo.put("isOnline", this.getIsonline()); - jo.put("error", this.getError()); - jo.put("isError", this.getIserror()); - jo.put("message", message); - jo.put("notCreateTaskMessage", notCreateTaskMessage); - jo.put("notCreateInstMessage",notCreateInstMessage); - jo.put("feedMessage", feedMessage); - jo.put("driver_type", "siemens_conveyor"); - jo.put("is_click", true); + map.put("device_name", this.getDevice().getDevice_name()); + map.put("mode", mode); + map.put("move", move); + /*jo.put("action", action);*/ + /*jo.put("task", task);*/ + /*jo.put("walk_y", this.walk_y);*/ + map.put("isOnline", this.getIsonline()); + map.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); + map.put("isError", this.getIserror()); + map.put("message", message); + /*jo.put("notCreateTaskMessage", notCreateTaskMessage); + jo.put("notCreateInstMessage",notCreateInstMessage);*/ + map.put("feedMessage", feedMessage); + map.put("driver_type", "siemens_conveyor"); + map.put("is_click", true); + JSONObject jo = new JSONObject(map); return jo; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/ItemProtocol.java index 6ff248ff1..2a8699e3d 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/ItemProtocol.java @@ -56,10 +56,7 @@ public class ItemProtocol { */ public static String item_y = "y"; - /** - * 行走开关信号 - */ - public static String item_move = "move"; + /** * 载货台开关信号 @@ -96,10 +93,7 @@ public class ItemProtocol { */ public static String item_forkLocation = "forkLocation"; - /** - * 货叉动作信号 - */ - public static String item_forkAction = "forkAction"; + /** * 特殊开关量1 */ @@ -129,43 +123,10 @@ public class ItemProtocol { * 轴运行次数 */ public static String item_stacker_runing_time = "stacker_runing time"; - /** - * 轴工作时间(小时) - */ - public static String item_stacker_workingHours = "stacker_workingHours"; - /** - * 载货台速度(转/分钟) - */ - public static String item_cargo_rpm = "cargo_rpm"; - /** - * 载货台电流 - */ - public static String item_cargo_electric_Current = "cargo_electric Current"; - /** - * 载货台轴工作小时数 - */ - public static String item_cargo_workingHours = "cargo_workingHours"; - /** - * 载货台轴运行次数 - */ - public static String item_cargo_runingTimes = "cargo_runingTimes"; - /** - * 货叉速度(转/分钟 - */ - public static String item_fork_rpm = "fork_rpm"; - /** - * 货叉电流 - */ - public static String item_fork_electric_Current = "fork_electric Current"; - /** - * 货叉轴工作时间(小时 - */ - public static String item_fork_workingHours = "fork_workingHours"; - /** - * 货叉轴运行次数 - */ - public static String item_fork_runingTimes = "fork_runingTimes"; + + + /** * 心跳 @@ -200,10 +161,7 @@ public class ItemProtocol { * 作业层 */ public static String item_to_y = "to_y"; - /** - * 托盘号 - */ - public static String item_to_trayCode = "to_trayCode"; + Boolean isonline; @@ -252,9 +210,6 @@ public class ItemProtocol { return this.getOpcIntegerValue(item_y); } - public float getItem_move() { - return this.getOpcFloatValue(item_move); - } public float getItem_cargoMove() { return this.getOpcFloatValue(item_cargoMove); @@ -284,9 +239,7 @@ public class ItemProtocol { return this.getOpcFloatValue(item_forkLocation); } - public float getItem_forkAction() { - return this.getOpcFloatValue(item_forkAction); - } + public float getItem_special1() { return this.getOpcFloatValue(item_special1); @@ -312,45 +265,16 @@ public class ItemProtocol { return this.getOpcIntegerValue(item_stacker_electricCurrent); } - public Integer getItem_stacker_workingHours() { - return this.getOpcIntegerValue(item_stacker_workingHours); - } + public Integer getItem_stacker_runing_time() { return this.getOpcIntegerValue(item_stacker_runing_time); } - public Integer getItem_cargo_rpm() { - return this.getOpcIntegerValue(item_cargo_rpm); - } - public Integer getItem_cargo_electric_Current() { - return this.getOpcIntegerValue(item_cargo_electric_Current); - } - public Integer getItem_cargo_workingHours() { - return this.getOpcIntegerValue(item_cargo_workingHours); - } - public Integer getItem_cargo_runingTimes() { - return this.getOpcIntegerValue(item_cargo_runingTimes); - } - public Integer getItem_fork_rpm() { - return this.getOpcIntegerValue(item_fork_rpm); - } - - public Integer getItem_fork_electric_Current() { - return this.getOpcIntegerValue(item_fork_electric_Current); - } - - public Integer getItem_fork_workingHours() { - return this.getOpcIntegerValue(item_fork_workingHours); - } - - public Integer getItem_fork_runingTimes() { - return this.getOpcIntegerValue(item_fork_runingTimes); - } public int getOpcIntegerValue(String protocol) { @@ -420,7 +344,6 @@ public class ItemProtocol { list.add(new ItemDto(item_z, "行走排号", "DB101.B38")); list.add(new ItemDto(item_x, "行走列号", "DB101.B39")); list.add(new ItemDto(item_y, "行走层号", "DB101.B40")); - list.add(new ItemDto(item_move, "行走开关信号", "DB101.B4")); list.add(new ItemDto(item_cargoMove, "载货台开关信号", "DB101.B41")); list.add(new ItemDto(item_action, "行走动作信号", "DB101.B5")); list.add(new ItemDto(item_distancex, "行走激光数值", "DB101.D16")); @@ -428,23 +351,13 @@ public class ItemProtocol { list.add(new ItemDto(item_cargoError, "载货台超限信号", "DB101.B43")); list.add(new ItemDto(item_forkCargo, "货叉探货信号", "DB101.B48")); list.add(new ItemDto(item_forkLocation, "货叉位置信号", "DB101.B49")); - list.add(new ItemDto(item_forkAction, "货叉动作信号", "DB101.B50")); list.add(new ItemDto(item_special1, "特殊开关量1", "DB101.B10")); list.add(new ItemDto(item_special2, "特殊开关量2", "DB101.B11")); list.add(new ItemDto(item_trayCode, "托盘条码", "DB101.B30.20")); list.add(new ItemDto(item_storage_cache, "水箱和消防缓存位有无货", "DB101.B50")); list.add(new ItemDto(item_stacker_rpm, "速度(转/分钟)", "DB101.W52")); list.add(new ItemDto(item_stacker_electricCurrent, "电流", "DB101.W54")); - list.add(new ItemDto(item_stacker_workingHours, "轴工作时间(小时)", "DB101.D56")); list.add(new ItemDto(item_stacker_runing_time, "轴运行次数", "DB101.D60")); - list.add(new ItemDto(item_cargo_rpm, "载货台速度(转/分钟)", "DB101.W64")); - list.add(new ItemDto(item_cargo_electric_Current, "载货台电流", "DB101.W66")); - list.add(new ItemDto(item_cargo_workingHours, "载货台轴工作小时数", "DB101.D68")); - list.add(new ItemDto(item_cargo_runingTimes, "载货台轴运行次数", "DB101.D72")); - list.add(new ItemDto(item_fork_rpm, "货叉速度(转/分钟)", "DB101.W76")); - list.add(new ItemDto(item_fork_electric_Current, "货叉电流", "DB101.W78")); - list.add(new ItemDto(item_fork_workingHours, "货叉轴工作时间(小时)", "DB101.D80")); - list.add(new ItemDto(item_fork_runingTimes, "货叉轴运行次数", "DB101.D84")); return list; } @@ -458,7 +371,6 @@ public class ItemProtocol { list.add(new ItemDto(item_to_z, "作业排", "DB100.B6")); list.add(new ItemDto(item_to_x, "作业列", "DB100.B7")); list.add(new ItemDto(item_to_y, "作业层", "DB100.B8")); - list.add(new ItemDto(item_to_trayCode, "托盘号", "DB100.B11.20")); return list; } 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 408dcf376..dd97f0171 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 @@ -19,6 +19,7 @@ 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; +import org.nl.acs.device_driver.storage.standard_storage.StandardStorageDeviceDriver; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; import org.nl.acs.history.ErrorUtil; @@ -311,7 +312,6 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme z = this.itemProtocol.getItem_z(); x = this.itemProtocol.getItem_x(); y = this.itemProtocol.getItem_y(); - move = this.itemProtocol.getItem_move(); cargoMove = this.itemProtocol.getItem_cargoMove(); action = this.itemProtocol.getItem_action(); distancex = this.itemProtocol.getItem_distancex(); @@ -319,15 +319,14 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme cargoError = this.itemProtocol.getItem_cargoError(); forkCargo = this.itemProtocol.getItem_forkCargo(); forkLocation = this.itemProtocol.getItem_forkLocation(); - forkAction = this.itemProtocol.getItem_forkAction(); special1 = this.itemProtocol.getItem_special1(); special2 = this.itemProtocol.getItem_special2(); trayCode = this.itemProtocol.getItem_trayCode(); storage_cache = this.itemProtocol.getItem_storage_cache(); - if (!command.equals(last_command)){ - requireSucess=false; - if (command==0){ + if (!command.equals(last_command)) { + requireSucess = false; + if (command == 0) { clearWrite(); } } @@ -361,7 +360,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme } //不同任务限制清零 - if (!Objects.equals(task, last_task)){ + if (!Objects.equals(task, last_task)) { count = 0; } @@ -396,24 +395,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme String next_device_code = instruction2.getNext_device_code(); Device nextDevice = deviceAppService.findDeviceByCode(next_device_code); if (StrUtil.equals(nextDevice.getDevice_type(), DeviceType.conveyor.name())) { - if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("z"))) { - Map map = new HashMap(); - map.put("code", "to_x"); - map.put("value", nextDevice.getExtraValue().get("z")); - list.add(map); - } - if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("x"))) { - Map map = new HashMap<>(); - map.put("code", "to_z"); - map.put("value", nextDevice.getExtraValue().get("x")); - list.add(map); - } - if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("y"))) { - Map map = new HashMap<>(); - map.put("code", "to_y"); - map.put("value", nextDevice.getExtraValue().get("y")); - list.add(map); - } + packageDevicePoint(nextDevice, list); } if (StrUtil.equals(nextDevice.getDevice_type(), DeviceType.storage.name())) { String pattern = "\\d+"; @@ -558,6 +540,27 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme last_fork_runingTimes = fork_runingTimes;*/ } + private static void packageDevicePoint(Device nextDevice, List list) { + if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("z"))) { + Map map = new HashMap(); + map.put("code", "to_x"); + map.put("value", nextDevice.getExtraValue().get("z")); + list.add(map); + } + if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("x"))) { + Map map = new HashMap<>(); + map.put("code", "to_z"); + map.put("value", nextDevice.getExtraValue().get("x")); + list.add(map); + } + if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("y"))) { + Map map = new HashMap<>(); + map.put("code", "to_y"); + map.put("value", nextDevice.getExtraValue().get("y")); + list.add(map); + } + } + private boolean updateCommand(String toCommand) { Instruction instruction0 = checkInst(); if (ObjectUtil.isEmpty(instruction0)) { @@ -574,22 +577,22 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme message = "universal_message3"; //指定库位满入 - if (error == 5 && count< WcsConfig.stacker_error_in_count) { + if (error == 5 && count < WcsConfig.stacker_error_in_count) { //清警 cleanErro(); //相同任务时限制加一 - if (Objects.equals(task, last_task)){ + if (Objects.equals(task, last_task)) { count++; } applyUpdatePointCode(StandarStirageErroEnum.FILL.getType()); } //空出直接完结指令 if (error == 6) { - //清警 - cleanErro(); Instruction instruction = checkInst(); try { finish_instruction(instruction); + //清警 + cleanErro(); } catch (Exception e) { throw new RuntimeException(e); } @@ -600,9 +603,9 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme //清警 cleanErro(); //放货 - if (cargoMove == 1 && count< WcsConfig.stacker_error_in_count) { + if (cargoMove == 1 && count < WcsConfig.stacker_error_in_count) { //相同任务时限制加一 - if (Objects.equals(task, last_task)){ + if (Objects.equals(task, last_task)) { count++; } applyUpdatePointCode(StandarStirageErroEnum.BLOCK_OUT.getType()); @@ -617,8 +620,8 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme List list = new ArrayList(); HashMap map = new HashMap(); - map.put("code","to_command"); - map.put("value","5"); + map.put("code", "to_command"); + map.put("value", "5"); list.add(map); writing(list); } @@ -662,13 +665,13 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme } if (type.equals(StandarStirageErroEnum.BLOCK_IN.getType()) || type.equals(StandarStirageErroEnum.FILL.getType())) { - task = task*1000; - updateData2(poinCode, instruction, point, split,task); + task = task * 1000; + updateData2(poinCode, instruction, point, split, task); List list = new ArrayList(); String x = point.getExtraValue().get("x").toString(); String y = split[1]; String z = split[2]; - pakagePLCData(list, x,y,z,"2",task); + pakagePLCData(list, x, y, z, "2", task.toString()); } } //取货潜货位阻挡做完移库任务 @@ -697,7 +700,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme } } - private void pakagePLCData(List list, String x, String y, String z, String toCommand, Integer task) { + private void pakagePLCData(List list, String x, String y, String z, String toCommand, String task) { HashMap map1 = new HashMap(); map1.put("code", "to_x"); map1.put("value", y); @@ -727,28 +730,28 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme public void clearWrite() { List list = new ArrayList<>(); Map map = new HashMap<>(); - map.put("code","to_x"); - map.put("value","0"); + map.put("code", "to_x"); + map.put("value", "0"); list.add(map); Map map2 = new HashMap<>(); - map2.put("code","to_y"); - map2.put("value","0"); + map2.put("code", "to_y"); + map2.put("value", "0"); list.add(map2); Map map3 = new HashMap<>(); - map3.put("code","to_z"); - map3.put("value","0"); + map3.put("code", "to_z"); + map3.put("value", "0"); list.add(map3); Map map4 = new HashMap<>(); - map4.put("code","to_command"); - map4.put("value","0"); + map4.put("code", "to_command"); + map4.put("value", "0"); list.add(map4); Map map5 = new HashMap<>(); - map4.put("code","to_task"); - map4.put("value","0"); + map4.put("code", "to_task"); + map4.put("value", "0"); list.add(map4); this.writing(list); - message=null; + message = null; } private void updateData2(String poinCode, Instruction instruction, Device point, String[] split, Integer task) { @@ -766,20 +769,6 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme } - - private void pakageData1(Instruction instruction, Instruction instructionUpdate, Device starPoint, String[] split, TaskDto taskUpdate) { - instructionUpdate.setFrom_x(starPoint.getExtraValue().get("x").toString()); - instructionUpdate.setFrom_y(split[1]); - instructionUpdate.setFrom_z(split[2]); - instructionUpdate.setInstruction_code(String.valueOf(task)); - taskUpdate.setFrom_x(starPoint.getExtraValue().get("x").toString()); - taskUpdate.setFrom_y(split[1]); - taskUpdate.setFrom_z(split[2]); - taskUpdate.setTask_code(instruction.getTask_code()); - - } - - private void pakageData2(Instruction instruction, Instruction instructionUpdate, Device starPoint, String[] split, TaskDto taskUpdate) { instructionUpdate.setTo_x(starPoint.getExtraValue().get("x").toString()); instructionUpdate.setTo_y(split[1]); @@ -805,16 +794,63 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme } else { //维修解警后重新向堆垛机下发指令 Instruction instructionErro = checkInst(); - if (ObjectUtil.isNotEmpty(instructionErro)&&InstructionStatusEnum.BUSY.getIndex().equals(instructionErro.getInstruction_status())&& StrUtil.isNotEmpty(instructionErro.getExecute_code())){ - List list = new ArrayList(); - pakagePLCData(list, String.valueOf(z),String.valueOf(x),String.valueOf(y),instructionErro.getExecute_code(),task); - requireSucess = true; - return true; + if (ObjectUtil.isNotEmpty(instructionErro) && InstructionStatusEnum.BUSY.getIndex().equals(instructionErro.getInstruction_status()) && StrUtil.isNotEmpty(instructionErro.getExecute_code())) { + String start_device_code = instructionErro.getStart_device_code(); + Device startDevice = deviceAppService.findDeviceByCode(start_device_code); + if (startDevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) { + //放货完成 + if (forkCargo==0) { + //取货中或者取货完成(分入库出库) + if ("1".equals(instructionErro.getExecute_code())||"2".equals(instructionErro.getExecute_code())) { + List list = new ArrayList(); + String startDeviceCode = instructionErro.getStart_device_code(); + Device startDeviceError = deviceAppService.findDeviceByCode(startDeviceCode); + if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.conveyor.name())) { + pakagePLCData(list, startDeviceError.getExtraValue().get("x").toString(), startDeviceError.getExtraValue().get("z").toString(), startDeviceError.getExtraValue().get("y").toString(), instructionErro.getExecute_code(), instructionErro.getInstruction_code()); + requireSucess = true; + return true; + } + } + } + //放货中报警 + if ("3".equals(instructionErro.getExecute_code())&&forkCargo==2) { + List list = new ArrayList(); + if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.conveyor.name())) { + pakagePLCData(list, instructionErro.getTo_x(), instructionErro.getTo_y(), instructionErro.getTo_z(), instructionErro.getExecute_code(), instructionErro.getInstruction_code()); + requireSucess = true; + return true; + } + } + } + //出库报警 + if (startDevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) { + //取货报警 + if ("1".equals(instructionErro.getExecute_code())||"2".equals(instructionErro.getExecute_code())) { + List list = new ArrayList(); + if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.storage.name())) { + pakagePLCData(list, instructionErro.getFrom_x(), instructionErro.getFrom_y(), instructionErro.getFrom_z(), instructionErro.getExecute_code(), instructionErro.getInstruction_code()); + requireSucess = true; + return true; + } + } + //放货中报警 + if ("3".equals(instructionErro.getExecute_code())&&forkCargo==2) { + String next_device_code = instructionErro.getNext_device_code(); + Device nextDevice = deviceAppService.findDeviceByCode(next_device_code); + List list = new ArrayList(); + if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.conveyor.name())) { + pakagePLCData(list, nextDevice.getExtraValue().get("x").toString(), nextDevice.getExtraValue().get("z").toString(), nextDevice.getExtraValue().get("y").toString(), instructionErro.getExecute_code(), instructionErro.getInstruction_code()); + requireSucess = true; + return true; + } + } + } + } this.instruction_require_time = date; //暂停任务 - if (stopReceiveTask){ + if (stopReceiveTask) { this.notCreateInstMessage = "任务暂停"; return false; } @@ -872,7 +908,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme } List list = new ArrayList(); - pakageCommand(list,"1", inst.getInstruction_code()); + pakageCommand(list, "1", inst.getInstruction_code()); if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.conveyor.name()) && !prohibitInWarehouse) { if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("z"))) { HashMap map4 = new HashMap(); @@ -928,7 +964,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme list.add(map7); } - private void pakageCommand(List list, String toCommand,String inst) { + private void pakageCommand(List list, String toCommand, String inst) { HashMap map1 = new HashMap(); map1.put("code", "to_device_code"); map1.put("value", this.getDevice().getAddress()); @@ -1069,26 +1105,26 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme requireSucess = "1"; } String command = ""; - if(this.command == 0){ - command = "待机"; - }else if(this.command == 1){ - command = "取货中"; - }else if(this.command == 2){ - command = "取货完成"; - }else if(this.command == 3){ - command = "放货中"; - }else if(this.command == 4){ - command = "请求卸货(申请卸货)"; - }else if(this.command == 5){ - command = "放货完成"; - }else if(this.command == 6){ - command = "取货准备(回库台)"; - }else if(this.command == 7){ - command = "召回"; - }else if(this.command == 8){ - command = "急停"; - }else if(this.command == 9){ - command = "未知"; + if (this.command == 0) { + command = LangProcess.msg("universal_standby"); + } else if (this.command == 1) { + command = LangProcess.msg("universal_delivery"); + } else if (this.command == 2) { + command = LangProcess.msg("universal_completed"); + } else if (this.command == 3) { + command = LangProcess.msg("universal_releasing"); + } else if (this.command == 4) { + command = LangProcess.msg("one_message1"); + } else if (this.command == 5) { + command = LangProcess.msg("universal_releasing_completed"); + } else if (this.command == 6) { + command = LangProcess.msg("one_message2"); + } else if (this.command == 7) { + command = LangProcess.msg("one_message3"); + } else if (this.command == 8) { + command = LangProcess.msg("one_message4"); + } else if (this.command == 9) { + command = LangProcess.msg("one_message5"); } jo.put("mode", mode); jo.put("move", move); @@ -1102,7 +1138,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme jo.put("stopReceiveTask", this.stopReceiveTask); jo.put("requireSucess", requireSucess); jo.put("driver_type", "standard_stacker"); - jo.put("notCreateInstMessage", notCreateInstMessage); + jo.put("notCreateInstMessage", notCreateInstMessage); return jo; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blank_manipulator/BlankManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blank_manipulator/BlankManipulatorDeviceDriver.java index ab4623e6c..c638e5707 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blank_manipulator/BlankManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blank_manipulator/BlankManipulatorDeviceDriver.java @@ -699,7 +699,7 @@ public class BlankManipulatorDeviceDriver extends AbstractOpcDeviceDriver implem jo.put("task", task); jo.put("walk_y", walk_y); jo.put("isOnline", this.getIsonline()); - jo.put("error", ErrorUtil.getDictDetail("hxhj_error_type", String.valueOf(this.getError()))); + jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); jo.put("isError", this.getIserror()); jo.put("message", LangProcess.msg(message)); jo.put("notCreateTaskMessage", notCreateTaskMessage); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blanking_button/BlankingButtonDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blanking_button/BlankingButtonDriver.java index d69c17f02..05726a8a0 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blanking_button/BlankingButtonDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blanking_button/BlankingButtonDriver.java @@ -18,6 +18,7 @@ import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.ext.wms.data.BlankingButtonRequest; import org.nl.acs.ext.wms.data.BlankingButtonResponse; import org.nl.acs.ext.wms.service.AcsToWmsService; +import org.nl.acs.history.ErrorUtil; import org.nl.acs.history.service.DeviceErrorLogService; import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl; import org.nl.acs.instruction.domain.Instruction; @@ -320,19 +321,19 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev String action = ""; String walk_y = ""; if (this.getMode() == 0) { - mode = "脱机"; + mode = LangProcess.msg("universal_off-line"); } else if (this.getMode() == 1) { - mode = "单机"; + mode = LangProcess.msg("universal_stand-alone"); } else if (this.getMode() == 2) { - mode = "待机"; + mode = LangProcess.msg("universal_standby"); } else if (this.getMode() == 3) { - mode = "运行中"; + mode = LangProcess.msg("universal_operation"); } if (this.getMove() == 0) { - move = "无货"; + move = LangProcess.msg("universal_no"); } else if (this.getMove() == 1) { - move = "有货"; + move = LangProcess.msg("universal_yes"); } String requireSucess = "0"; @@ -341,13 +342,13 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev } jo.put("requireSucess", requireSucess); if (this.getAction() == 1) { - action = "取货中"; + action = LangProcess.msg("universal_delivery"); } else if (this.getAction() == 2) { - action = "取货完成"; + action = LangProcess.msg("universal_completed"); } else if (this.getAction() == 3) { - action = "放货中"; + action = LangProcess.msg("universal_releasing"); } else if (this.getAction() == 4) { - action = "放货完成"; + action = LangProcess.msg("universal_releasing_completed"); } jo.put("device_name", this.getDevice().getDevice_name()); @@ -356,7 +357,7 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev jo.put("action", action); jo.put("walk_y", walk_y); jo.put("isOnline", this.getIsonline()); - jo.put("error", this.getError()); + jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); jo.put("isError", this.getIserror()); jo.put("message", LangProcess.msg(message)); jo.put("driver_type", "siemens_conveyor"); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/green_foil_machine_button/GreenFoilMachineButtonDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/green_foil_machine_button/GreenFoilMachineButtonDriver.java index 7e8081ce0..dfc03da4a 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/green_foil_machine_button/GreenFoilMachineButtonDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/green_foil_machine_button/GreenFoilMachineButtonDriver.java @@ -18,6 +18,7 @@ import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.ext.wms.data.ApplyGreenFoilButtonRequest; import org.nl.acs.ext.wms.data.ApplyGreenFoilButtonResponse; import org.nl.acs.ext.wms.service.AcsToWmsService; +import org.nl.acs.history.ErrorUtil; import org.nl.acs.history.service.DeviceErrorLogService; import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl; import org.nl.acs.instruction.domain.Instruction; @@ -263,19 +264,19 @@ public class GreenFoilMachineButtonDriver extends AbstractOpcDeviceDriver implem String action = ""; String walk_y = ""; if (this.getMode() == 0) { - mode = "脱机"; + mode = LangProcess.msg("universal_off-line"); } else if (this.getMode() == 1) { - mode = "单机"; + mode = LangProcess.msg("universal_stand-alone"); } else if (this.getMode() == 2) { - mode = "待机"; + mode = LangProcess.msg("universal_standby"); } else if (this.getMode() == 3) { - mode = "运行中"; + mode = LangProcess.msg("universal_operation"); } if (this.getMove() == 0) { - move = "无货"; + move = LangProcess.msg("universal_no"); } else if (this.getMove() == 1) { - move = "有货"; + move = LangProcess.msg("universal_yes"); } String requireSucess = "0"; @@ -284,11 +285,11 @@ public class GreenFoilMachineButtonDriver extends AbstractOpcDeviceDriver implem } jo.put("requireSucess", requireSucess); if (this.getAction() == 0) { - action = "不允许取放"; + action = LangProcess.msg("universal_actionMessage1"); } else if (this.getAction() == 1) { - action = "允许取放"; + action = LangProcess.msg("universal_actionMessage2"); } else if (this.getAction() == 2) { - action = "允许离开"; + action = LangProcess.msg("universal_actionMessage3"); } jo.put("device_name", this.getDevice().getDevice_name()); @@ -297,7 +298,7 @@ public class GreenFoilMachineButtonDriver extends AbstractOpcDeviceDriver implem jo.put("action", action); jo.put("walk_y", walk_y); jo.put("isOnline", this.getIsonline()); - jo.put("error", this.getError()); + jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); jo.put("isError", this.getIserror()); jo.put("message", LangProcess.msg(message)); jo.put("driver_type", "siemens_conveyor"); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_conveyor/HongXiangStationDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_conveyor/HongXiangStationDeviceDriver.java index d9d5a3515..442bff12d 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_conveyor/HongXiangStationDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_conveyor/HongXiangStationDeviceDriver.java @@ -14,12 +14,14 @@ import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; +import org.nl.acs.history.ErrorUtil; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.log.service.DeviceExecuteLogService; import org.nl.acs.monitor.DeviceStageMonitor; import org.nl.acs.opc.DeviceAppService; import org.nl.acs.route.service.RouteLineService; import org.nl.acs.task.service.TaskService; +import org.nl.config.language.LangProcess; import org.nl.config.lucene.service.LuceneExecuteLogService; import org.nl.config.lucene.service.dto.LuceneLogDto; import org.nl.system.service.param.ISysParamService; @@ -181,11 +183,30 @@ public class HongXiangStationDeviceDriver extends AbstractOpcDeviceDriver implem if(error == 0 && iserror){ message = "universal_message11"; } + String mode = ""; + String action = ""; + if (this.getMode() == 0) { + mode = LangProcess.msg("universal_off-line"); + } else if (this.getMode() == 1) { + mode = LangProcess.msg("universal_stand-alone"); + } else if (this.getMode() == 2) { + mode = LangProcess.msg("universal_standby"); + } else if (this.getMode() == 3) { + mode = LangProcess.msg("universal_operation"); + } + if (this.getAction() == 0) { + action = LangProcess.msg("universal_actionMessage1"); + } else if (this.getAction() == 1) { + action = LangProcess.msg("universal_actionMessage2"); + } else if (this.getAction() == 2) { + action = LangProcess.msg("universal_actionMessage3"); + } + jo.put("device_name", this.getDevice().getDevice_name()); - jo.put("mode", mode ==2 ? "待机": "脱机"); - jo.put("action", action == 1 ? "允许取放": "不允许取放"); + jo.put("mode", mode); + jo.put("action", action); jo.put("isOnline", true); - jo.put("error", this.getError()); + jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); jo.put("task", this.getTask()); return jo; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/HongXiangConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/HongXiangConveyorDeviceDriver.java index 8830c9a19..f7590d4e4 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/HongXiangConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/HongXiangConveyorDeviceDriver.java @@ -27,6 +27,7 @@ import org.nl.acs.opc.DeviceAppService; import org.nl.acs.route.service.RouteLineService; import org.nl.acs.task.service.TaskService; import org.nl.config.SpringContextHolder; +import org.nl.config.language.LangProcess; import org.nl.config.lucene.service.LuceneExecuteLogService; import org.nl.config.lucene.service.dto.LuceneLogDto; import org.springframework.beans.factory.annotation.Autowired; @@ -195,7 +196,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple this.setIsonline(false); message = "有报警"; //无报警 - } else if (error != 0) { + } else if (error != 0 && error1 != 1) { this.setIserror(true); message = "有报警"; //无报警 @@ -359,51 +360,65 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple @Override public JSONObject getDeviceStatusName() { - JSONObject jo = new JSONObject(); + Map map = new LinkedHashMap<>(); + String mode = ""; String action = ""; String move = ""; if (this.getMode() == 0) { - mode = "未联机"; - } else if (this.getMode() == 1) { - mode = "联机"; - } else if (this.getMode() == 2) { - mode = "联机"; - } - String requireSucess = "0"; + mode = LangProcess.msg("universal_off-line"); + }/* else if (this.getMode() == 1) { + mode = LangProcess.msg("universal_stand-alone"); + } */else if (this.getMode() == 1) { + mode = LangProcess.msg("universal_standby"); + }/* else if (this.getMode() == 3) { + mode = LangProcess.msg("universal_operation"); + }*/ + String requireSucess = LangProcess.msg("universal_actionMessage4"); if (this.requireSucess) { - requireSucess = "1"; + requireSucess = LangProcess.msg("universal_actionMessage5"); } - jo.put("requireSucess", requireSucess); + map.put("requireSucess", requireSucess); if (this.getMove() == 0) { - move = "无货"; - jo.put("hasGoods", false); + move = LangProcess.msg("universal_no"); + map.put("hasGoods", false); } else if (this.getMove() == 1) { - move = "有货"; - jo.put("hasGoods", true); + move = LangProcess.msg("universal_yes"); + map.put("hasGoods", true); } else if (this.getMove() == 2) { - move = "有托盘有货"; - jo.put("hasGoods", true); + move = LangProcess.msg("universal_two_yes"); + map.put("hasGoods", true); } if(error == 0 && iserror){ - message = "universal_message11"; + message = LangProcess.msg("universal_message11"); } - jo.put("device_name", this.getDevice().getDevice_name()); - jo.put("temperature", temperature); - jo.put("finish", finish); - jo.put("isOnline", this.getIsonline()); - jo.put("error", ErrorUtil.getDictDetail("hx_error_type", String.valueOf(this.getError()))); - jo.put("isError", this.getIserror()); - jo.put("countdown_house", countdown_house); - jo.put("countdown_min", countdown_min); - jo.put("countdown_sec", countdown_sec); - jo.put("door", door); - jo.put("mode", mode); - jo.put("move", move); - jo.put("action", action); - jo.put("message", message); - jo.put("task", this.getTask()); + String door = "关门状态"; + if(this.door == 1){ + door = "开门状态"; + }else if(this.door == 0){ + door = "门执行中"; + } + String finish = "未完成"; + if(this.finish == 1){ + finish = "已完成"; + } + map.put("device_name", this.getDevice().getDevice_name()); + map.put("finish", finish); + map.put("isOnline", this.getIsonline()); + map.put("isError", this.getIserror()); + map.put("door", door); + map.put("mode", mode); + map.put("move", move); + /*map.put("action", action); + map.put("message", message);*/ + /*map.put("task", this.getTask());*/ + map.put("error", ErrorUtil.getDictDetail("hx_error_type", String.valueOf(this.getError()))); + map.put("temperature", temperature); + map.put("countdown_house", countdown_house); + map.put("countdown_min", countdown_min); + map.put("countdown_sec", countdown_sec); + JSONObject jo = new JSONObject(map); return jo; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/ItemProtocol.java index 0daa2b19b..f75e44103 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/ItemProtocol.java @@ -124,7 +124,7 @@ public class ItemProtocol { } ; Boolean isonline; - Boolean isError; + Boolean isError = false; public int getOpcIntegerValue(String protocol) { Integer value = this.driver.getIntegeregerValue(protocol); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/inflatable_shaft_library/InflatableShaftLibraryDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/inflatable_shaft_library/InflatableShaftLibraryDeviceDriver.java index 75d8cbe0f..7de801752 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/inflatable_shaft_library/InflatableShaftLibraryDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/inflatable_shaft_library/InflatableShaftLibraryDeviceDriver.java @@ -12,6 +12,7 @@ import org.nl.acs.device_driver.FeedLmsRealFailed; import org.nl.acs.device_driver.RouteableDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; +import org.nl.acs.history.ErrorUtil; import org.nl.acs.history.service.DeviceErrorLogService; import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl; import org.nl.acs.instruction.service.InstructionService; @@ -154,19 +155,19 @@ public class InflatableShaftLibraryDeviceDriver extends AbstractOpcDeviceDriver String action = ""; String walk_y = ""; if (this.getMode() == 0) { - mode = "脱机"; + mode = LangProcess.msg("universal_off-line"); } else if (this.getMode() == 1) { - mode = "单机"; + mode = LangProcess.msg("universal_stand-alone"); } else if (this.getMode() == 2) { - mode = "待机"; + mode = LangProcess.msg("universal_standby"); } else if (this.getMode() == 3) { - mode = "运行中"; + mode = LangProcess.msg("universal_operation"); } if (this.getMove() == 0) { - move = "无货"; + move = LangProcess.msg("universal_no"); } else if (this.getMove() == 1) { - move = "有货"; + move = LangProcess.msg("universal_yes"); } String requireSucess = "0"; @@ -175,13 +176,13 @@ public class InflatableShaftLibraryDeviceDriver extends AbstractOpcDeviceDriver } jo.put("requireSucess", requireSucess); if (this.getAction() == 1) { - action = "取货中"; + action = LangProcess.msg("universal_delivery"); } else if (this.getAction() == 2) { - action = "取货完成"; + action = LangProcess.msg("universal_completed"); } else if (this.getAction() == 3) { - action = "放货中"; + action = LangProcess.msg("universal_releasing"); } else if (this.getAction() == 4) { - action = "放货完成"; + action = LangProcess.msg("universal_releasing_completed"); } jo.put("device_name", this.getDevice().getDevice_name()); @@ -190,7 +191,7 @@ public class InflatableShaftLibraryDeviceDriver extends AbstractOpcDeviceDriver jo.put("action", action); jo.put("walk_y", walk_y); jo.put("isOnline", this.getIsonline()); - jo.put("error", this.getError()); + jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); jo.put("isError", this.getIserror()); jo.put("message", LangProcess.msg(message)); jo.put("driver_type", "siemens_conveyor"); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ManipulatorAgvStationDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ManipulatorAgvStationDeviceDriver.java index 06ac5eaa4..bd883b46c 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ManipulatorAgvStationDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ManipulatorAgvStationDeviceDriver.java @@ -24,6 +24,7 @@ import org.nl.acs.route.service.RouteLineService; import org.nl.acs.route.service.impl.RouteLineServiceImpl; import org.nl.acs.task.service.TaskService; import org.nl.config.SpringContextHolder; +import org.nl.config.language.LangProcess; import org.springframework.beans.factory.annotation.Autowired; import java.util.Date; @@ -189,8 +190,26 @@ public class ManipulatorAgvStationDeviceDriver extends AbstractOpcDeviceDriver i if(iserror){ message = "universal_message11"; } + if (this.getMode() == 0) { + mode = LangProcess.msg("universal_off-line"); + } else if (this.getMode() == 1) { + mode = LangProcess.msg("universal_stand-alone"); + } else if (this.getMode() == 2) { + mode = LangProcess.msg("universal_standby"); + } else if (this.getMode() == 3) { + mode = LangProcess.msg("universal_operation"); + } + if (this.getAction() == 1) { + action = LangProcess.msg("universal_delivery"); + } else if (this.getAction() == 2) { + action = LangProcess.msg("universal_completed"); + } else if (this.getAction() == 3) { + action = LangProcess.msg("universal_releasing"); + } else if (this.getAction() == 4) { + action = LangProcess.msg("universal_releasing_completed"); + } jo.put("device_name", this.getDevice().getDevice_name()); - jo.put("mode", "联机"); + jo.put("mode", mode); jo.put("action", action); jo.put("isOnline", true); jo.put("isError", this.getIserror()); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java index 34283cd88..2e8810a36 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java @@ -192,7 +192,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i requireActionSucess = false; } - if (!requireActionSucess) { + if (mode == 3 && !requireActionSucess) { update_instruction_status(); } @@ -200,7 +200,6 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i var17.printStackTrace(); feedMessage = var17.getMessage(); logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol)); - } if (mode == 0) { @@ -237,7 +236,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i remark = remark + "光电信号(move)为有货状态,"; } if (task != 0) { - remark = "universal_remark4"; + remark = "任务不等于0"; if (ObjectUtil.isNotEmpty(this.inst)) { this.inst = null; } @@ -1082,7 +1081,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i @Override public JSONObject getDeviceStatusName() { - JSONObject jo = new JSONObject(); + Map map = new LinkedHashMap<>(); String mode = ""; String move = ""; String action = ""; @@ -1103,45 +1102,46 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i move = LangProcess.msg("universal_yes"); } - String requireSucess = "0"; + String requireSucess = LangProcess.msg("universal_actionMessage4"); if (this.requireSucess) { - requireSucess = "1"; + requireSucess = LangProcess.msg("universal_actionMessage5"); } - jo.put("requireSucess", requireSucess); + map.put("requireSucess", requireSucess); if (this.getAction() == 1) { - action = "取货中"; + action = LangProcess.msg("universal_delivery"); } else if (this.getAction() == 2) { - action = "取货完成"; + action = LangProcess.msg("universal_completed"); } else if (this.getAction() == 3) { - action = "放货中"; + action = LangProcess.msg("universal_releasing"); } else if (this.getAction() == 4) { - action = "放货完成"; + action = LangProcess.msg("universal_releasing_completed"); } if (error == 0 && iserror) { - this.setMessage(LangProcess.msg("universal_message4")); + this.setMessage(LangProcess.msg("universal_message11")); } - String requireActionSucess = "请求动作已复位"; + String requireActionSucess = "指令" + LangProcess.msg("universal_actionMessage4"); if(this.requireActionSucess){ - requireActionSucess = "请求动作未复位"; + requireActionSucess = "指令" + LangProcess.msg("universal_actionMessage5"); } - jo.put("device_name", this.getDevice().getDevice_name()); - jo.put("mode", mode); - jo.put("move", move); - jo.put("action", action); - jo.put("task", task); - jo.put("walk_y", walk_y); - jo.put("isOnline", this.getIsonline()); - jo.put("error", ErrorUtil.getDictDetail("hxhj_error_type", String.valueOf(this.getError()))); - jo.put("isError", this.getIserror()); - jo.put("message", message); - jo.put("notCreateTaskMessage", notCreateTaskMessage); - jo.put("notCreateInstMessage", notCreateInstMessage); - jo.put("feedMessage", feedMessage); - jo.put("requireActionSucess", requireActionSucess); - jo.put("driver_type", "siemens_conveyor"); - jo.put("is_click", true); - jo.put("x", x_position); - jo.put("y", y_position); + map.put("device_name", this.getDevice().getDevice_name()); + map.put("mode", mode); + map.put("move", move); + map.put("action", action); + map.put("task", task); + map.put("walk_y", this.walk_y); + map.put("isOnline", this.getIsonline()); + map.put("requireActionSucess", requireActionSucess); + map.put("error", ErrorUtil.getDictDetail("hxhj_error_type", String.valueOf(this.getError()))); + map.put("isError", this.getIserror()); + map.put("message", message); + map.put("feedMessage", feedMessage); + map.put("notCreateTaskMessage", notCreateTaskMessage); + map.put("notCreateInstMessage", notCreateInstMessage); + map.put("driver_type", "siemens_conveyor"); + map.put("is_click", true); + JSONObject jo = new JSONObject(map); + /*jo.put("x", x_position); + jo.put("y", y_position);*/ return jo; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java index f36ba36a6..68b186ad4 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java @@ -20,6 +20,7 @@ import org.nl.acs.ext.wms.data.ApplyPlugPullSitResponse; import org.nl.acs.ext.wms.data.ApplyPlugPullSiteRequest; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; +import org.nl.acs.history.ErrorUtil; import org.nl.acs.instruction.domain.Instruction; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.log.service.DeviceExecuteLogService; @@ -210,16 +211,19 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl if (mode == 0) { this.setIsonline(false); - message = "universal_off-line"; + message = LangProcess.msg("universal_off-line"); //有报警 } else if (error != 0) { this.setIserror(true); - message = "universal_message3"; + message = LangProcess.msg("universal_message3"); //无报警 } else { this.setIsonline(true); this.setIserror(false); message = ""; + if(requireSucess){ + message = LangProcess.msg("universal_actionMessage5"); + } //插拔轴机工位申请任务 switch (mode) { case 1: @@ -587,8 +591,19 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl mode = LangProcess.msg("universal_standby"); } else if (this.getMode() == 3) { mode = LangProcess.msg("universal_operation"); + } else if(this.mode == 4) { + mode = "请求套轴轴"; + } else if(this.mode == 5){ + mode = "套轴完成反馈"; + } else if(this.mode == 6){ + mode = "请求拔轴"; + } else if(this.mode == 7){ + mode = "拔轴完成反馈"; + } else if(this.mode == 8){ + mode = "缓存库已满,申请行架任务"; } + if (this.getMove() == 0) { move = LangProcess.msg("universal_no"); jo.put("hasGoods", false); @@ -599,6 +614,10 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl move = LangProcess.msg("universal_two_yes"); jo.put("hasGoods", true); } + String requireSucess = LangProcess.msg("universal_actionMessage4"); + if (this.requireSucess) { + requireSucess = LangProcess.msg("universal_actionMessage5"); + } jo.put("requireSucess", requireSucess); if (this.getAction() == 1) { action = LangProcess.msg("universal_delivery"); @@ -612,10 +631,11 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl jo.put("device_name", this.getDevice().getDevice_name()); jo.put("mode", mode); jo.put("move", move); - jo.put("action", action); + /*jo.put("action", action);*/ + jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); jo.put("isOnline", this.getIsonline()); jo.put("isError", this.getIserror()); - jo.put("message", LangProcess.msg(message)); + jo.put("message", message); return jo; } @@ -624,6 +644,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl } + public void writing(String param, String value) { String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/ItemProtocol.java index 41e61bbcc..91b029f4d 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/ItemProtocol.java @@ -127,7 +127,7 @@ public class ItemProtocol { Boolean isonline; - Boolean isError; + Boolean isError = false; public int getOpcIntegerValue(String protocol) { Integer value = this.driver.getIntegeregerValue(protocol); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java index 3dc846cc0..91fe480fe 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java @@ -256,11 +256,11 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp if (mode == 0) { this.setIsonline(false); - message = "universal_off-line"; + message = LangProcess.msg("universal_off-line"); //有报警 } else if (error != 0) { this.setIserror(true); - message = "universal_message3"; + message = LangProcess.msg("universal_message3"); //无报警 } else { this.setIsonline(true); @@ -617,11 +617,10 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp @Override public JSONObject getDeviceStatusName() { - JSONObject jo = new JSONObject(); + Map map = new LinkedHashMap<>(); String mode = ""; String move = ""; String action = ""; - String walkY = ""; if (this.getMode() == 0) { mode = LangProcess.msg("universal_off-line"); } else if (this.getMode() == 1) { @@ -638,11 +637,11 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp move = LangProcess.msg("universal_yes"); } - String requireSucess = "0"; + String requireSucess = LangProcess.msg("universal_actionMessage4"); if (this.requireSucess) { - requireSucess = "1"; + requireSucess = LangProcess.msg("universal_actionMessage5"); } - jo.put("requireSucess", requireSucess); + map.put("requireSucess", requireSucess); if (this.getAction() == 1) { action = LangProcess.msg("universal_delivery"); } else if (this.getAction() == 2) { @@ -651,29 +650,32 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp action = LangProcess.msg("universal_releasing"); } else if (this.getAction() == 4) { action = LangProcess.msg("universal_releasing_completed"); + }else { + action = "无动作"; } if(error == 0 && this.itemProtocol.isError){ iserror = true; }else if(error == 0 && !this.itemProtocol.isError){ iserror = false; } - jo.put("device_name", this.getDevice().getDevice_name()); - jo.put("mode", mode); - jo.put("move", move); - jo.put("action", action); - jo.put("task", task); - jo.put("walk_y", walkY); - jo.put("isOnline", this.getIsonline()); - jo.put("error", this.getError()); - jo.put("isError", this.getIserror()); - jo.put("message", message); - jo.put("notCreateTaskMessage", notCreateTaskMessage); - jo.put("notCreateInstMessage", notCreateInstMessage); - jo.put("feedMessage", feedMessage); - jo.put("driver_type", "siemens_conveyor"); - jo.put("is_click", true); - jo.put("x", xPosition); - jo.put("y", yPosition); + map.put("device_name", this.getDevice().getDevice_name()); + map.put("mode", mode); + map.put("move", move); + map.put("action", action); + map.put("task", task); + map.put("walk_y", walkY); + map.put("isOnline", this.getIsonline()); + map.put("isError", this.getIserror()); + map.put("feedMessage", feedMessage); + map.put("driver_type", "siemens_conveyor"); + map.put("is_click", true); + map.put("message", message); + map.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); + map.put("notCreateTaskMessage", notCreateTaskMessage); + map.put("notCreateInstMessage", notCreateInstMessage); + /*jo.put("x", xPosition); + jo.put("y", yPosition);*/ + JSONObject jo = new JSONObject(map); return jo; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_tail_manipulator/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_tail_manipulator/ItemProtocol.java index 020d30dbe..270aa9b02 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_tail_manipulator/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_tail_manipulator/ItemProtocol.java @@ -113,7 +113,7 @@ public class ItemProtocol { } Boolean isonline; - Boolean isError; + Boolean isError = false; public int getOpcIntegerValue(String protocol) { Integer value = this.driver.getIntegeregerValue(protocol); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_tail_manipulator/PullTailManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_tail_manipulator/PullTailManipulatorDeviceDriver.java index 88bdcd7fa..d68e74c0b 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_tail_manipulator/PullTailManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_tail_manipulator/PullTailManipulatorDeviceDriver.java @@ -232,21 +232,25 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp .content("反馈LMS子卷重量失败:"+ applyPlugPullSitResponse.getMessage()) .build(); logDto.setLog_level(4); + message = "反馈LMS子卷重量失败:"+ applyPlugPullSitResponse.getMessage(); luceneExecuteLogService.deviceExecuteLog(logDto); } - } else { + } else if(mode == 3){ feedMessage = "行架机械手:"; - if (mode != 3) { + /*if (mode != 3) { feedMessage = feedMessage + "mode不为运行中状态,"; - } + }*/ if (action != 5) { feedMessage = feedMessage + "action不为反馈重量状态,"; } if (move != 1) { feedMessage = feedMessage + "move不为有货状态,"; } - if (task == 0) { - feedMessage = feedMessage + "task为0。"; + if(StrUtil.isEmpty(sub_volume_no)){ + feedMessage = feedMessage + "子卷号为空,"; + } + if(requireSucess){ + feedMessage = feedMessage + "请求动作未复位!"; } } @@ -573,64 +577,63 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp @Override public JSONObject getDeviceStatusName() { - JSONObject jo = new JSONObject(); + Map map = new LinkedHashMap<>(); String mode = ""; String move = ""; String action = ""; String walk_y = ""; if (this.getMode() == 0) { - mode = "脱机"; + mode = LangProcess.msg("universal_off-line"); } else if (this.getMode() == 1) { - mode = "单机"; + mode = LangProcess.msg("universal_stand-alone"); } else if (this.getMode() == 2) { - mode = "待机"; + mode = LangProcess.msg("universal_standby"); } else if (this.getMode() == 3) { - mode = "运行中"; + mode = LangProcess.msg("universal_operation"); } if (this.getMove() == 0) { - move = "无货"; + move = LangProcess.msg("universal_no"); } else if (this.getMove() == 1) { - move = "有货"; + move = LangProcess.msg("universal_yes"); } - String requireSucess = "0"; + + String requireSucess = LangProcess.msg("universal_actionMessage4"); if (this.requireSucess) { - requireSucess = "1"; + requireSucess = LangProcess.msg("universal_actionMessage5"); } - jo.put("requireSucess", requireSucess); + map.put("requireSucess", requireSucess); if (this.getAction() == 1) { - action = "取货中"; + action = LangProcess.msg("universal_delivery"); } else if (this.getAction() == 2) { - action = "取货完成"; + action = LangProcess.msg("universal_completed"); } else if (this.getAction() == 3) { - action = "放货中"; + action = LangProcess.msg("universal_releasing"); } else if (this.getAction() == 4) { - action = "放货完成"; + action = LangProcess.msg("universal_releasing_completed"); + }else if (this.getAction() == 5){ + action = "反馈子卷重量"; + }else if (this.getAction() == 0){ + action = "无动作"; } if(error == 0 && this.itemProtocol.isError){ - message = "信号连接异常!"; iserror = true; - }else if(error == 0 && !this.itemProtocol.isError){ + }else if(error == 0 && !(this.itemProtocol.isError)){ iserror = false; } - jo.put("device_name", this.getDevice().getDevice_name()); - jo.put("mode", mode); - jo.put("move", move); - jo.put("action", action); - jo.put("task", task); - jo.put("walk_y", walk_y); - jo.put("isOnline", this.getIsonline()); - jo.put("error", this.getError()); - jo.put("isError", this.getIserror()); - jo.put("message", LangProcess.msg(message)); - jo.put("notCreateTaskMessage", notCreateTaskMessage); - jo.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage)); - jo.put("feedMessage",feedMessage); - jo.put("driver_type", "siemens_conveyor"); - jo.put("is_click", true); - jo.put("x", x_position); - jo.put("y", y_position); + map.put("device_name", this.getDevice().getDevice_name()); + map.put("mode", mode); + map.put("move", move); + map.put("action", action); + map.put("isOnline", this.getIsonline()); + map.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); + map.put("isError", this.getIserror()); + map.put("message", message); + map.put("feedMessage", feedMessage); + map.put("driver_type", "siemens_conveyor"); + map.put("is_click", true); + JSONObject jo = new JSONObject(map); return jo; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java index 18560b69c..87f776a76 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java @@ -16,6 +16,7 @@ import org.nl.acs.device_driver.RouteableDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.ext.wms.service.AcsToWmsService; +import org.nl.acs.history.ErrorUtil; import org.nl.acs.instruction.domain.Instruction; import org.nl.acs.instruction.enums.InstructionStatusEnum; import org.nl.acs.instruction.service.InstructionService; @@ -30,6 +31,7 @@ import org.nl.acs.task.service.dto.TaskDto; import org.nl.common.exception.BadRequestException; import org.nl.common.utils.SecurityUtils; import org.nl.config.SpringContextHolder; +import org.nl.config.language.InitLocaleResolver; import org.nl.config.language.LangProcess; import org.nl.config.lucene.service.LuceneExecuteLogService; import org.nl.config.lucene.service.dto.LuceneLogDto; @@ -731,9 +733,9 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl if (this.getIs_disable() == 0) { - is_disable = "正常"; + is_disable = LangProcess.msg("universal_normal"); } else if (this.getIs_disable() == 1) { - is_disable = "禁用"; + is_disable = LangProcess.msg("universal_disable"); } String requireSucess = "0"; @@ -755,7 +757,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl jo.put("move_2", move_2); jo.put("action", action); jo.put("walk_y", walk_y); - jo.put("error", this.getError()); + jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); jo.put("task", this.getTask()); jo.put("isOnline", this.getIsonline()); jo.put("isError", this.getIserror()); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/waste_foil_weighing_station/WasteFoilWeighingStationDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/waste_foil_weighing_station/WasteFoilWeighingStationDriver.java index eb7893aa0..790ae0dc1 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/waste_foil_weighing_station/WasteFoilWeighingStationDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/waste_foil_weighing_station/WasteFoilWeighingStationDriver.java @@ -14,6 +14,7 @@ import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.ext.wms.data.GetWasteFoilWeightRequest; import org.nl.acs.ext.wms.data.GetWasteFoilWeightResponse; import org.nl.acs.ext.wms.service.AcsToWmsService; +import org.nl.acs.history.ErrorUtil; import org.nl.acs.history.service.DeviceErrorLogService; import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl; import org.nl.acs.instruction.domain.Instruction; @@ -351,7 +352,7 @@ public class WasteFoilWeighingStationDriver extends AbstractOpcDeviceDriver impl jo.put("mode", mode); jo.put("move", move); jo.put("isOnline", this.getIsonline()); - jo.put("error", this.getError()); + jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); jo.put("isError", this.getIserror()); jo.put("weight", this.getWeight()); jo.put("old_weight", this.getOld_weight()); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/enums/StorageTypeEnum.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/enums/StorageTypeEnum.java index dcb1cf2dc..0dd843f64 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/enums/StorageTypeEnum.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/enums/StorageTypeEnum.java @@ -16,7 +16,9 @@ public enum StorageTypeEnum { ERROR("4", "异常处理位"), - BOX_IN("5", "木箱入库"); + BOX_IN("5", "木箱入库"), + + BOX_RETURN("6", "退货入库"); /** * 索引 */ diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/history/ErrorUtil.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/history/ErrorUtil.java index 83be744c2..07a323bd0 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/history/ErrorUtil.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/history/ErrorUtil.java @@ -3,6 +3,7 @@ package org.nl.acs.history; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import org.nl.config.SpringContextHolder; +import org.nl.config.language.InitLocaleResolver; import org.nl.config.language.LangProcess; import org.nl.system.service.dict.ISysDictService; import org.nl.system.service.dict.dao.Dict; @@ -27,6 +28,8 @@ public class ErrorUtil { public static String getDictDetail(String type, String error_code) { + InitLocaleResolver initLocaleResolver = new InitLocaleResolver(); + String language = initLocaleResolver.getLanguage(); getDict(); List dictDetailDtos = dictMap.get(type); String detail = null; @@ -34,10 +37,24 @@ public class ErrorUtil { for (int i = 0; i < dictDetailDtos.size(); i++) { Dict dictDetailDto = dictDetailDtos.get(i); String value = dictDetailDto.getValue(); - String label = dictDetailDto.getLabel(); +// String label = dictDetailDto.getLabel(); + String en_label = dictDetailDto.getEn_label(); + String in_label = dictDetailDto.getIn_label(); + String zh_label = dictDetailDto.getZh_label(); if (StrUtil.equals(value, error_code)) { - detail = label; - break; + if (language.contains("zh")){ + detail = zh_label; + break; + } + if (language.contains("in")){ + detail = in_label; + break; + } + if (language.contains("en")){ + detail = en_label; + break; + } + } } } 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 9d60e98e9..e441959ea 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 @@ -235,6 +235,7 @@ public class InstructionServiceImpl extends CommonServiceImpl queryPage = PageUtil.toMybatisPage(page); @@ -252,6 +253,9 @@ public class InstructionServiceImpl extends CommonServiceImpl instructionMybatis.like(InstructionMybatis::getStart_point_code, point_code).or().like(InstructionMybatis::getNext_point_code, point_code)); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java index 5de8c9107..353237096 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java @@ -189,6 +189,8 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC Object value = OpcUtl.getValue(item, itemState); if (value != null) { valueAllNotNull = true; + } else { + log.info("item:{},velue为空,value:{}", item.getId(), value); } String itemId = item.getId(); @@ -225,13 +227,10 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC } if (!valueAllNotNull) { - int random = (new Random()).nextInt(10) + 1; - random *= 1000; if (this.all_null < 3) { if (log.isWarnEnabled()) { - log.warn("{} 所有内容都为空, all_null:{} ,暂定{}s", tag, all_null,3); + log.warn("OPC数据源: {} 所有内容都为空,检查网络, all_null:{} ,暂定{}s", tag, all_null,3); } - ThreadUtl.sleep( 3000); break start; } else if (this.all_null < 6) { @@ -253,9 +252,10 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC log.warn("{} 所有内容都为空, all_null:{} ,暂定{}ms", tag, all_null, 5000); } ThreadUtl.sleep((long) (5000)); + break start; } - ++this.all_null; +// ++this.all_null; } else { this.all_null = 0; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/opc/OpcEntity.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/opc/OpcEntity.java new file mode 100644 index 000000000..f88549001 --- /dev/null +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/opc/OpcEntity.java @@ -0,0 +1,182 @@ +/* +package org.nl.acs.opc; + +import org.nl.acs.opc.DeviceOpcSynchronizeAutoRun; +import org.nl.acs.opc.OpcConfig; +import org.nl.acs.opc.OpcItemDto; +import org.nl.acs.opc.OpcServerService; +import org.nl.acs.udw.UnifiedDataAccessor; +import org.nl.acs.udw.UnifiedDataAccessorFactory; +import org.openscada.opc.lib.da.Group; +import org.openscada.opc.lib.da.Item; +import org.openscada.opc.lib.da.ItemState; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.*; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Collectors; + +public class OpcEntity { + @Autowired + OpcServerService opcServerService; + private final UnifiedDataAccessor udw; + private Map> items; + private Map> someFailDevices; + private String opcCode; + + public OpcEntity(String opcCode) { + this.udw = UnifiedDataAccessorFactory.getAccessor(OpcConfig.udw_opc_value_key); + this.items = new ConcurrentHashMap(); + this.someFailDevices = new ConcurrentHashMap(); + this.opcCode = opcCode; + } + + public void reload(List> opcItemDtos) { + Map> itemCodes = new ConcurrentHashMap(); + (opcItemDtos.stream().flatMap(Collection::stream).collect(Collectors.groupingBy(OpcItemDto::getDevice_code))).forEach((deviceCodes, opcItemDtoList) -> { + itemCodes.put(deviceCodes, opcItemDtoList.stream().map(OpcItemDto::getItem_code).collect(Collectors.toList())); + }); + DeviceOpcSynchronizeAutoRun.itemCodeOpcItemDtoMapping.putAll((Map)opcItemDtos.stream().flatMap(Collection::stream).collect(Collectors.toMap(OpcItemDto::getItem_code, (obj) -> { + return obj; + },(k, v) -> k))); + if (this.items.size() == 0) { + itemCodes.values().stream().flatMap(Collection::stream).forEach((key) -> { + this.udw.setValue(key, (Object)null); + }); + this.addItemsIntoGroup(itemCodes); + } else { + if (this.someFailDevices.size() > 0) { + this.reAddDevices(); + } + + } + } + + private void reAddDevices() { + Map> addItems = new ConcurrentHashMap(); + StringBuilder err_message = new StringBuilder(); + this.someFailDevices.forEach((deviceCode, itemCodesList) -> { + itemCodesList.forEach((itemCode) -> { + try { + Group group = DeviceOpcSynchronizeAutoRun.getGroup(this.opcCode); + ((List)addItems.computeIfAbsent(deviceCode, (key) -> { + return new ArrayList(); + })).add(group.addItem(itemCode)); + } catch (Exception var6) { + err_message.append(itemCode).append(" 添加失败; "); + } + + }); + List deviceItems = (List)addItems.get(deviceCode); + if (deviceItems != null && deviceItems.size() == itemCodesList.size()) { + this.someFailDevices.remove(deviceCode); + } else if (itemCodesList.size() == 0) { + addItems.remove(deviceCode); + } else { + assert deviceItems != null; + + ((List)this.someFailDevices.get(deviceCode)).removeAll(deviceItems); + } + + synchronized(this.opcCode.intern()) { + this.items.putAll(addItems); + } + + if (err_message.length() > 0) { + String errMsg = err_message.toString(); + //this.log.warn("{}:{}", com.wxzd.wcs.opc.OpcConfig.resource_code, errMsg); + } + + }); + } + + private void addItemsIntoGroup(Map> itemCodes) { + try { + Group group = DeviceOpcSynchronizeAutoRun.getGroup(this.opcCode); + StringBuilder err_message = new StringBuilder(); + Map> items = new ConcurrentHashMap(); + itemCodes.forEach((deviceCode, itemCodesList) -> { + itemCodesList.forEach((itemCode) -> { + try { + ((List)items.computeIfAbsent(deviceCode, (key) -> { + return new ArrayList(); + })).add(group.addItem(itemCode)); + } catch (Exception var7) { + ((List)this.someFailDevices.computeIfAbsent(deviceCode, (key) -> { + return new ArrayList(); + })).add(itemCode); + this.udw.setValue(itemCode, (Object)null); + err_message.append(itemCode).append(" 添加失败; "); + } + + }); + List deviceItems = (List)items.get(deviceCode); + if (deviceItems != null && deviceItems.size() != itemCodesList.size()) { + items.remove(deviceCode); + this.someFailDevices.put(deviceCode, itemCodesList); + } + + }); + synchronized(this.opcCode.intern()) { + this.items = items; + } + + if (err_message.length() > 0) { + String errMsg = err_message.toString(); +// this.log.warn("{}:{}", OpcConfig.resource_code, errMsg); + } + } catch (Exception var8) { + var8.printStackTrace(); + } + + } + + public void cleanUdwCache() { + this.items.values().stream().flatMap(Collection::stream).map(Item::getId).forEach((key) -> { + this.udw.setValue(key, (Object)null); + }); + } + + public Map readAll() throws Exception { + return opcServerService.getServer(this.opcCode).read(true, (Item[])this.items.values().stream().flatMap(Collection::stream).toArray((x$0) -> { + return new Item[x$0]; + })); + } + + public Map readDividually() { + Map result = new HashMap(); + CompletableFuture[] futures = (CompletableFuture[])this.items.entrySet().stream().map((entry) -> { + return CompletableFuture.runAsync(() -> { + try { + Group group = DeviceOpcSynchronizeAutoRun.getGroup(this.opcCode); + result.putAll(group.read(true, (Item[])((List)entry.getValue()).toArray(new Item[0]))); + } catch (Exception var5) { + String deviceCode = (String)entry.getKey(); + // to do +// this.someFailDevices.put(deviceCode, ((List)entry.getValue()).stream().map(Item::getId).collect(Collectors.toList())); + this.items.remove(deviceCode); + } + + }, DeviceOpcSynchronizeAutoRun.executorService); + }).toArray((x$0) -> { + return new CompletableFuture[x$0]; + }); + CompletableFuture.allOf(futures).join(); + return result; + } + + + public UnifiedDataAccessor getUdw() { + return this.udw; + } + + public Map> getItems() { + return this.items; + } + + public String getOpcCode() { + return this.opcCode; + } +} +*/ diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/opc/OpcServerService.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/opc/OpcServerService.java index 54ab3df4d..862068013 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/opc/OpcServerService.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/opc/OpcServerService.java @@ -49,4 +49,7 @@ public interface OpcServerService { * @param var1 */ void clearServer(String var1); + + void cleanGroups(String var1); + } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/opc/OpcServerServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/opc/OpcServerServiceImpl.java index 0629b1ecb..72275e2cc 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/opc/OpcServerServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/opc/OpcServerServiceImpl.java @@ -206,6 +206,24 @@ public class OpcServerServiceImpl implements OpcServerService, ApplicationAutoIn this.groups.remove(code); } + public void cleanGroups(String opcCode) { + Group group = (Group)this.groups.get(opcCode); + if (group != null) { + Server server = group.getServer(); + + try { + group.remove(); + } catch (JIException var5) { + var5.printStackTrace(); + } + + this.groups.remove(opcCode); + server.disconnect(); + this.servers.remove(opcCode); + } + + } + @Override public void writeInteger(String code, ItemValue... values) { try { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/config/language/InitLocaleResolver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/config/language/InitLocaleResolver.java index be92de0d7..5d16d842e 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/config/language/InitLocaleResolver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/config/language/InitLocaleResolver.java @@ -12,11 +12,14 @@ import java.util.Map; public class InitLocaleResolver implements LocaleResolver { public static Map Language_Country = MapOf.of("id","in-ID","in","in-ID","en-US,en;q=0.9","en-US","en","en-US","zh","zh-CN"); + public static String language = ""; @Override public Locale resolveLocale(HttpServletRequest request) { String header = request.getHeader("Accept-Language"); if (StringUtils.isNotEmpty(header)){ String lang = Language_Country.get(header); + language = lang; + System.out.println("lang的值为:"+lang); if (StringUtils.isNotEmpty(lang)){ String[] l = lang.split("-"); //印尼的ISO标准国家代码为id-ID @@ -29,4 +32,7 @@ public class InitLocaleResolver implements LocaleResolver { @Override public void setLocale(HttpServletRequest request, HttpServletResponse response, Locale locale) { } + public String getLanguage(){ + return language; + } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/dict/dao/Dict.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/dict/dao/Dict.java index 2010f30e8..cb1cc49de 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/dict/dao/Dict.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/dict/dao/Dict.java @@ -104,4 +104,19 @@ public class Dict implements Serializable { */ private String update_time; + /** + * 中文字典标签 + */ + private String zh_label; + + /** + * 英文字典标签 + */ + private String en_label; + + /** + * 印尼字典标签 + */ + private String in_label; + } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/logicflow/dao/Stage.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/logicflow/dao/Stage.java index 33f9a3e25..a46d4af5e 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/logicflow/dao/Stage.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/logicflow/dao/Stage.java @@ -74,5 +74,20 @@ public class Stage implements Serializable { */ private String update_time; + /** + * 舞台中文名称 + */ + private String zh_stage_name; + + /** + * 舞台英文名称 + */ + private String en_stage_name; + + /** + * 舞台印尼名称 + */ + private String in_stage_name; + } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/CreateDDJInst.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/CreateDDJInst.java index f36bb192b..e868fabbd 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/CreateDDJInst.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/CreateDDJInst.java @@ -69,7 +69,6 @@ public class CreateDDJInst { if (CollUtil.isNotEmpty(taskDtoList)) { taskDtoList = sortInst(taskDtoList); for (TaskDto taskDto : taskDtoList) { - String next_device_code = ""; Device nextDevice = null; List pathlist; Device deviceByCode = null; @@ -85,7 +84,8 @@ public class CreateDDJInst { String put_device_code = taskDto.getPut_device_code(); String put_point_code = taskDto.getPut_point_code(); - + String next_device_code = taskDto.getNext_device_code(); + nextDevice = appService.findDeviceByCode(next_device_code); String next_point_code = taskDto.getNext_point_code(); String start_point_code2 = taskDto.getStart_point_code2(); @@ -155,16 +155,17 @@ public class CreateDDJInst { } next_device_code = taskDto.getNext_device_code(); - nextDevice = appService.findDeviceByCode(next_device_code); - BeltConveyorDeviceDriver beltConveyorDeviceDriver; - if (nextDevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) { - beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) nextDevice.getDeviceDriver(); - if (beltConveyorDeviceDriver.getMode() != 2 || beltConveyorDeviceDriver.getMove() == 1) { - log.error("输送机,{}未联机或执行中", next_device_code); - ((BeltConveyorDeviceDriver) nextDevice.getDeviceDriver()).setNotCreateInstMessage("one_message7"); - return; - } - } + +// nextDevice = appService.findDeviceByCode(next_device_code); +// BeltConveyorDeviceDriver beltConveyorDeviceDriver; +// if (nextDevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) { +// beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) nextDevice.getDeviceDriver(); +// if (beltConveyorDeviceDriver.getMode() != 2 || beltConveyorDeviceDriver.getMove() == 1) { +// log.error("输送机,{}未联机或执行中", next_device_code); +// ((BeltConveyorDeviceDriver) nextDevice.getDeviceDriver()).setNotCreateInstMessage("one_message7"); +// return; +// } +// } /** * 开始平均分配 */ @@ -243,12 +244,12 @@ public class CreateDDJInst { instdto.setAgv_system_type(agv_system_type); instdto.setStart_height(start_height); instdto.setNext_height(next_height); - if (startDevice.getDevice_type().equals(DeviceType.storage.name())) { + if (ObjectUtil.isNotNull(startDevice) && startDevice.getDevice_type().equals(DeviceType.storage.name())) { instdto.setFrom_x(taskDto.getFrom_x()); instdto.setFrom_z(taskDto.getFrom_z()); instdto.setFrom_y(taskDto.getFrom_y()); } - if (nextDevice.getDevice_type().equals(DeviceType.storage.name())) { + if (ObjectUtil.isNotNull(nextDevice) && nextDevice.getDevice_type().equals(DeviceType.storage.name())) { instdto.setTo_x(taskDto.getTo_x()); instdto.setTo_z(taskDto.getTo_z()); instdto.setTo_y(taskDto.getTo_y()); @@ -364,12 +365,12 @@ public class CreateDDJInst { instdto.setAgv_system_type(agv_system_type); instdto.setStart_height(start_height); instdto.setNext_height(next_height); - if (startDevice.getDevice_type().equals(DeviceType.storage.name())) { + if (ObjectUtil.isNotNull(startDevice) && startDevice.getDevice_type().equals(DeviceType.storage.name())) { instdto.setFrom_x(taskDto.getFrom_x()); instdto.setFrom_z(taskDto.getFrom_z()); instdto.setFrom_y(taskDto.getFrom_y()); } - if (nextDevice.getDevice_type().equals(DeviceType.storage.name())) { + if (ObjectUtil.isNotNull(nextDevice) && nextDevice.getDevice_type().equals(DeviceType.storage.name())) { instdto.setTo_x(taskDto.getTo_x()); instdto.setTo_z(taskDto.getTo_z()); instdto.setTo_y(taskDto.getTo_y()); diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal.properties b/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal.properties index 5dd2b8e3c..c727facc2 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal.properties +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal.properties @@ -5,6 +5,12 @@ universal_standby=\u5F85\u673A universal_operation=\u8FD0\u884C\u4E2D universal_no=\u65E0\u8D27 universal_yes=\u6709\u8D27 +universal_normal=\u6B63\u5E38 +universal_disable=\u7981\u7528 +universal_large_pallets=\u5927\u6258\u76D8 +universal_small_pallets=\u5C0F\u6258\u76D8 +universal_forward_rotation=\u6B63\u8F6C +universal_rollback=\u53CD\u8F6C universal_two_yes=\u6709\u6258\u76D8\u6709\u8D27 universal_delivery=\u53D6\u8D27\u4E2D universal_completed=\u53D6\u8D27\u5B8C\u6210 @@ -47,6 +53,11 @@ universal_notCreateInstMessage3=\u8BBE\u5907\u5F85\u673A\u6216\u4E0D\u5141\u8BB8 universal_notCreateInstMessage4=ddj\u5BF9\u63A5\u4F4D\u6709\u8D27,\u65E0\u6CD5\u751F\u6210\u6307\u4EE4! universal_notCreateInstMessage5=\u5B58\u5728\u76F8\u540C\u8DEF\u7EBF\u7684\u6307\u4EE4! universal_notCreateInstMessage6=\u4E0B\u4E00\u4E2A\u8BBE\u5907\u4E0D\u662F\u8F93\u9001\u7EBF\u6307\u4EE4! +universal_actionMessage1=\u4E0D\u5141\u8BB8\u53D6\u653E +universal_actionMessage2=\u5141\u8BB8\u53D6\u653E +universal_actionMessage3=\u5141\u8BB8\u79BB\u5F00 +universal_actionMessage4=\u8BF7\u6C42\u52A8\u4F5C\u5DF2\u590D\u4F4D +universal_actionMessage5=\u8BF7\u6C42\u52A8\u4F5C\u672A\u590D\u4F4D diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal_en_US.properties b/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal_en_US.properties index 786aa8688..5e900dad7 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal_en_US.properties +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal_en_US.properties @@ -4,6 +4,12 @@ universal_standby=standby universal_operation=operation universal_no=Out of stock universal_yes=In stock +universal_normal=normal +universal_disable=disable +universal_large_pallets=large pallets +universal_small_pallets=small pallets +universal_forward_rotation=forward rotation +universal_rollback=rollback universal_two_yes=There are pallets and goods universal_delivery=Taking delivery universal_completed=Pick-up completed @@ -46,3 +52,8 @@ universal_notCreateInstMessage3=The device is in standby mode or is not allowed universal_notCreateInstMessage4=ddj interface bit is in stock, cannot generate command! universal_notCreateInstMessage5=Instructions with the same route exist! universal_notCreateInstMessage6=The next device is not a conveyor line directive! +universal_actionMessage1=Pick-and-place is not permitted +universal_actionMessage2=Pick-and-place is allowed +universal_actionMessage3=Permission to leave +universal_actionMessage4=The request action has been reset +universal_actionMessage5=The request action is not reset diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal_in_ID.properties b/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal_in_ID.properties index cc6ee070b..94a1ed003 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal_in_ID.properties +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal_in_ID.properties @@ -4,6 +4,12 @@ universal_standby=siaga universal_operation=operasi universal_no=bayar universal_yes=Yang aku mau +universal_normal=biasa +universal_disable=menonaktifkan +universal_large_pallets=Palet besar +universal_small_pallets=Nampan kecil +universal_forward_rotation=Rotasi ke depan +universal_rollback=Rollback universal_two_yes=Ada nampan dengan barang universal_delivery=Mengambil barang universal_completed=Pengambilan barang selesai @@ -46,3 +52,8 @@ universal_notCreateInstMessage3=Siaga perangkat atau tidak diizinkan masuk universal_notCreateInstMessage4=DDJ mendarat di dok, tidak ada perintah yang diberikan! universal_notCreateInstMessage5=Ada instruksi tentang rute yang sama! universal_notCreateInstMessage6=Perangkat berikutnya bukan arahan jalur konveyor! +universal_actionMessage1=Pick-and-place tidak diizinkan +universal_actionMessage2=Pick-and-place diperbolehkan +universal_actionMessage3=Izin untuk pergi +universal_actionMessage4=Tindakan permintaan telah disetel ulang +universal_actionMessage5=Tindakan permintaan tidak disetel ulang diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal_zh_CN.properties b/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal_zh_CN.properties index ee062b42c..0e45f7682 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal_zh_CN.properties +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal_zh_CN.properties @@ -4,7 +4,13 @@ universal_standby=\u5F85\u673A universal_operation=\u8FD0\u884C\u4E2D universal_no=\u65E0\u8D27 universal_yes=\u6709\u8D27 +universal_normal=\u6B63\u5E38 +universal_disable=\u7981\u7528 universal_two_yes=\u6709\u6258\u76D8\u6709\u8D27 +universal_large_pallets=\u5927\u6258\u76D8 +universal_small_pallets=\u5C0F\u6258\u76D8 +universal_forward_rotation=\u6B63\u8F6C +universal_rollback=\u53CD\u8F6C universal_delivery=\u53D6\u8D27\u4E2D universal_completed=\u53D6\u8D27\u5B8C\u6210 universal_releasing=\u653E\u8D27\u4E2D @@ -33,6 +39,11 @@ universal_feedMessage3=\u5149\u7535\u4FE1\u53F7(move)\u4E0D\u4E3A\u65E0\u8D27\u7 universal_feedMessage4=\u5F53\u524D\u4E0A\u62A5\u4EFB\u52A1\u53F7(task)\u4E0D\u5E94\u8BE5\u4E3A0 universal_feedMessage5=\u884C\u67B6\u673A\u68B0\u624B universal_feedMessage6=\u4EFB\u52A1\u5B8C\u6210 +universal_actionMessage1=\u4E0D\u5141\u8BB8\u53D6\u653E +universal_actionMessage2=\u5141\u8BB8\u53D6\u653E +universal_actionMessage3=\u5141\u8BB8\u79BB\u5F00 +universal_actionMessage4=\u8BF7\u6C42\u52A8\u4F5C\u5DF2\u590D\u4F4D +universal_actionMessage5=\u8BF7\u6C42\u52A8\u4F5C\u672A\u590D\u4F4D universal_feedMessage7=move\u4E0D\u4E3A\u6709\u8D27\u72B6\u6001 universal_feedMessage8=\u4EFB\u52A1\u53F7\u4E3A0 universal_feedMessage9=\u52A8\u4F5C\u4FE1\u53F7\u4E0D\u662F\u4EFB\u52A1\u5B8C\u6210 diff --git a/acs2/nladmin-ui/src/i18n/langs/chinese.js b/acs2/nladmin-ui/src/i18n/langs/chinese.js index 82faadfc1..1a29c69f1 100644 --- a/acs2/nladmin-ui/src/i18n/langs/chinese.js +++ b/acs2/nladmin-ui/src/i18n/langs/chinese.js @@ -23,6 +23,7 @@ import department from './department/zh' import dict from './dict/zh' import angle from './angle/zh' import regional from './regional/zh' +import stage from './stage/zh' export default { ...zhLocale, @@ -49,6 +50,7 @@ export default { ...department, ...dict, ...angle, - ...regional + ...regional, + ...stage } diff --git a/acs2/nladmin-ui/src/i18n/langs/dict/en.js b/acs2/nladmin-ui/src/i18n/langs/dict/en.js index 21b21370c..633d7fb0d 100644 --- a/acs2/nladmin-ui/src/i18n/langs/dict/en.js +++ b/acs2/nladmin-ui/src/i18n/langs/dict/en.js @@ -13,6 +13,9 @@ export default { 'other': { 'Dict_detail': 'Dict Detail', 'Department_label': 'Department Label', + 'Department_label_zh': 'Chinese dictionary tags', + 'Department_label_en': 'English dictionary tags', + 'Department_label_in': 'Indonesian dictionary labels', 'Dictionary_value': 'Dictionary Value', 'Sort': 'Sort', 'Parameter1': 'Parameter1', diff --git a/acs2/nladmin-ui/src/i18n/langs/dict/in.js b/acs2/nladmin-ui/src/i18n/langs/dict/in.js index f63d7a54a..ce70cd683 100644 --- a/acs2/nladmin-ui/src/i18n/langs/dict/in.js +++ b/acs2/nladmin-ui/src/i18n/langs/dict/in.js @@ -13,6 +13,9 @@ export default { 'other': { 'Dict_detail': 'Detail Kamus', 'Department_label': 'Tag Kamus', + 'Department_label_zh': 'Kamus Cina tags', + 'Department_label_en': 'Kamus bahasa Inggris tags', + 'Department_label_in': 'Label kamus bahasa Indonesia', 'Dictionary_value': 'Nilai Kamus', 'Sort': 'Jenis', 'Parameter1': 'Parameter 1', diff --git a/acs2/nladmin-ui/src/i18n/langs/dict/zh.js b/acs2/nladmin-ui/src/i18n/langs/dict/zh.js index e8f48a75b..9c9108fd5 100644 --- a/acs2/nladmin-ui/src/i18n/langs/dict/zh.js +++ b/acs2/nladmin-ui/src/i18n/langs/dict/zh.js @@ -13,6 +13,9 @@ export default { 'other': { 'Dict_detail': '字典详情', 'Department_label': '字典标签', + 'Department_label_zh': '中文字典标签', + 'Department_label_en': '英文字典标签', + 'Department_label_in': '印尼字典标签', 'Dictionary_value': '字典值', 'Sort': '排序', 'Parameter1': '参数1', diff --git a/acs2/nladmin-ui/src/i18n/langs/english.js b/acs2/nladmin-ui/src/i18n/langs/english.js index 71cf71401..fbf45031e 100644 --- a/acs2/nladmin-ui/src/i18n/langs/english.js +++ b/acs2/nladmin-ui/src/i18n/langs/english.js @@ -23,6 +23,7 @@ import department from './department/en' import dict from './dict/en' import angle from './angle/en' import regional from './regional/en' +import stage from './stage/en' export default { ...enLocale, @@ -49,6 +50,7 @@ export default { ...department, ...dict, ...angle, - ...regional + ...regional, + ...stage } diff --git a/acs2/nladmin-ui/src/i18n/langs/indonesian.js b/acs2/nladmin-ui/src/i18n/langs/indonesian.js index 1b00062df..e2e3e4c46 100644 --- a/acs2/nladmin-ui/src/i18n/langs/indonesian.js +++ b/acs2/nladmin-ui/src/i18n/langs/indonesian.js @@ -23,6 +23,7 @@ import department from './department/in' import dict from './dict/in' import angle from './angle/in' import regional from './regional/in' +import stage from './stage/in' export default { ...idLocale, @@ -50,5 +51,6 @@ export default { ...department, ...dict, ...angle, - ...regional + ...regional, + ...stage } diff --git a/acs2/nladmin-ui/src/i18n/langs/stage/en.js b/acs2/nladmin-ui/src/i18n/langs/stage/en.js new file mode 100644 index 000000000..e04d797fb --- /dev/null +++ b/acs2/nladmin-ui/src/i18n/langs/stage/en.js @@ -0,0 +1,22 @@ +export default { + 'stage': { + 'title': 'Stage', + 'stage_table_title': { + 'stage_uuid': 'Stage Signage', + 'stage_code': 'Stage Coding', + 'stage_name': 'Stage Name', + 'in_stage_name': 'Indonesian Stage Name', + 'en_stage_name': 'English Stage Name', + 'zh_stage_name': 'Chinese Stage Name', + 'stage_data': 'Stage Data', + 'message1': 'Stage encoding cannot be empty', + 'message2': 'The stage name cannot be empty' + }, + 'driver_configuration': { + 'basic_information': 'Basic Information' + }, + 'msg': { + 'delete_msg': 'Are You Sure To Delete It? If There Are Subordinate Nodes, they Will Be Deleted Together. This Operation Cannot Be Undone!' + } + } +} diff --git a/acs2/nladmin-ui/src/i18n/langs/stage/in.js b/acs2/nladmin-ui/src/i18n/langs/stage/in.js new file mode 100644 index 000000000..adf1917d8 --- /dev/null +++ b/acs2/nladmin-ui/src/i18n/langs/stage/in.js @@ -0,0 +1,23 @@ +export default { + 'stage': { + 'title': 'Panggung', + 'stage_table_title': { + 'stage_uuid': 'Papan Nama Panggung', + 'stage_code': 'Tahap Pengkodean', + 'stage_name': 'Nama Panggung', + 'in_stage_name': 'Nama Panggung Indonesia', + 'en_stage_name': 'Nama Panggung Bahasa Inggris', + 'zh_stage_name': 'Nama Panggung Cina', + 'stage_data': 'Data Tahapan', + 'message1': 'Pengkodean Tahap Tidak Boleh Kosong', + 'message2': 'Nama Panggung Tidak Boleh Kosong' + }, + 'driver_configuration': { + 'basic_information': 'Informasi Dasar' + }, + 'msg': { + 'delete_msg': 'Apakah Anda Yakin Untuk Menghapusnya? Jika Ada Nod Subordinat, Mereka Akan Dihapus Bersama. Operasi Ini Tidak Dapat Dibatalkan!' + } + } +} + diff --git a/acs2/nladmin-ui/src/i18n/langs/stage/zh.js b/acs2/nladmin-ui/src/i18n/langs/stage/zh.js new file mode 100644 index 000000000..40ba64f6a --- /dev/null +++ b/acs2/nladmin-ui/src/i18n/langs/stage/zh.js @@ -0,0 +1,23 @@ +export default { + 'stage': { + 'title': '舞台', + 'stage_table_title': { + 'stage_uuid': '舞台标识', + 'stage_code': '舞台编码', + 'stage_name': '舞台名字', + 'in_stage_name': '印尼舞台名字', + 'en_stage_name': '英文舞台名称', + 'zh_stage_name': '中文舞台名称', + 'stage_data': '舞台数据', + 'message1': '舞台编码不能为空', + 'message2': '舞台名字不能为空' + }, + 'driver_configuration': { + 'basic_information': '基本信息' + }, + 'msg': { + 'delete_msg': '确定删除吗,如果存在下级节点则一并删除,此操作不能撤销!' + } + } +} + diff --git a/acs2/nladmin-ui/src/views/acs/device/config.vue b/acs2/nladmin-ui/src/views/acs/device/config.vue index 9119a1ef8..52d5f3b8e 100644 --- a/acs2/nladmin-ui/src/views/acs/device/config.vue +++ b/acs2/nladmin-ui/src/views/acs/device/config.vue @@ -116,6 +116,7 @@ import pull_tail_manipulator from '@/views/acs/device/driver/pull_tail_manipulat import green_foil_machine_button from '@/views/acs/device/driver/green_foil_machine_button.vue' import inflatable_shaft_library from '@/views/acs/device/driver/inflatable_shaft_library.vue' import manipulator_agv_station from '@/views/acs/device/driver/manipulator_agv_station.vue' +import paper_tube_pick_size from '@/views/acs/device/driver/paper_tube_pick_size.vue' import subvolume_weighing_station from '@/views/acs/device/driver/subvolume_weighing_station.vue' import waste_foil_weighing_station from '@/views/acs/device/driver/waste_foil_weighing_station.vue' import blank_manipulator from '@/views/acs/device/driver/blank_manipulator.vue' @@ -192,7 +193,8 @@ export default { oven_inspect_site, manipulator_agv_station, volume_two_manipulator, - manipulator_cache + manipulator_cache, + paper_tube_pick_size }, dicts: ['device_type'], mixins: [crud], diff --git a/acs2/nladmin-ui/src/views/acs/device/driver/paper_tube_pick_size.vue b/acs2/nladmin-ui/src/views/acs/device/driver/paper_tube_pick_size.vue new file mode 100644 index 000000000..9bf9558a8 --- /dev/null +++ b/acs2/nladmin-ui/src/views/acs/device/driver/paper_tube_pick_size.vue @@ -0,0 +1,507 @@ + + + + + diff --git a/acs2/nladmin-ui/src/views/acs/history/instRecord/index.vue b/acs2/nladmin-ui/src/views/acs/history/instRecord/index.vue index 18c5fdcfd..dcedbedd2 100644 --- a/acs2/nladmin-ui/src/views/acs/history/instRecord/index.vue +++ b/acs2/nladmin-ui/src/views/acs/history/instRecord/index.vue @@ -60,6 +60,20 @@ + + + + + + + diff --git a/acs2/nladmin-ui/src/views/system/dict/dictDetail.vue b/acs2/nladmin-ui/src/views/system/dict/dictDetail.vue index 1c2ce04ab..6f35aa83d 100644 --- a/acs2/nladmin-ui/src/views/system/dict/dictDetail.vue +++ b/acs2/nladmin-ui/src/views/system/dict/dictDetail.vue @@ -30,9 +30,18 @@ width="600px" > - + + + + + + + + + + diff --git a/acs2/nladmin-ui/src/views/system/logicflow/index.vue b/acs2/nladmin-ui/src/views/system/logicflow/index.vue index 91d84556d..e4e933fd9 100644 --- a/acs2/nladmin-ui/src/views/system/logicflow/index.vue +++ b/acs2/nladmin-ui/src/views/system/logicflow/index.vue @@ -12,20 +12,29 @@ :title="crud.status.title" width="500px" > - - + + - + - + + + + + + + + + + @@ -38,15 +47,15 @@ @selection-change="crud.selectionChangeHandler" > - - - - - - + + + + + + - +