diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java index 9c9b1ce2d..ad89dd0c2 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java @@ -251,6 +251,10 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple inst = null; message = null; } + if(mode == 2 && requireSucess){ + this.setRequireSucess(false); + logServer.deviceExecuteLog(this.device_code, "", "", "再次信号复位requireSuccess:" + requireSucess); + } logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode)); logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/AcsConfig.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/AcsConfig.java index 536cdf88e..0f64f17f5 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/AcsConfig.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/AcsConfig.java @@ -53,6 +53,10 @@ public interface AcsConfig { * 二楼2区AGV系统端口 */ String AGVPORT22 = "agvport22"; + /** + * acsIP地址 + */ + String ACSIP = "acsIP"; /** * 指定AGV系统 */ diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java index c976366f0..be5611dea 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java @@ -47,6 +47,7 @@ import java.util.Map; public class XianGongAgvServiceImpl implements XianGongAgvService { private final DeviceAppService deviceAppService; private final ISysParamService paramService; + @Autowired private final AcsToWmsService acsToWmsService; @Autowired @@ -115,7 +116,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } - + @Override public HttpResponse markComplete(String code) throws Exception { @@ -141,7 +142,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } - + @Override public HttpResponse queryXZAgvDeviceStatus() { @@ -202,7 +203,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } - + @Override public HttpResponse queryXZAgvInstStatus(String instCode) { @@ -225,7 +226,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } } - + @Override public HttpResponse deleteXZAgvInst(String instCode) { if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), CommonFinalParam.ONE)) { @@ -245,7 +246,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } } - + @Override public HttpResponse sendOrderSequencesToXZ(Instruction inst) throws Exception { com.alibaba.fastjson.JSONObject jo = new com.alibaba.fastjson.JSONObject(); @@ -466,7 +467,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } } - + @Override public HttpResponse addOrderSequences(Instruction inst) throws Exception { JSONObject orderjo = createOrederData(inst, CommonFinalParam.ONE); @@ -493,7 +494,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } } - + @Override public String sendOrderSequencesParam(Instruction inst) throws Exception { JSONObject jo = new JSONObject(); @@ -511,7 +512,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { return jo.toString(); } - + @Override public JSONObject createOrederData(Instruction inst, String inst_type) { String inst_code = inst.getInstruction_code(); @@ -648,7 +649,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { return destinationOrder; } - + @Override public String queryDoorStatus(String device) { log.info("AGV查询自动门状态,参数:{}", device); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java index f4c18fdda..17c83cd98 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java @@ -256,7 +256,8 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver(); try { - standardAutodoorDeviceDriver.writing("to_command", 2); + standardAutodoorDeviceDriver.writing("to_close", "1"); + standardAutodoorDeviceDriver.writing("to_open", "0"); } catch (Exception e) { log.info("下发电气信号失败:" + e.getMessage()); e.printStackTrace(); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java index 608756d70..2a705dfa9 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java @@ -16,6 +16,7 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.map.ListOrderedMap; import org.apache.commons.lang.LocaleUtils; import org.nl.acs.auto.initial.ApplicationAutoInitial; @@ -28,6 +29,10 @@ import org.nl.acs.device.domain.DeviceRunpoint; import org.nl.acs.device.service.mapper.DeviceRunpointMapper; import org.nl.acs.device_driver.conveyor.belt_conveyor.BeltConveyorDeviceDriver; import org.nl.acs.device_driver.one_conveyor.scanner_weight_conveyor.ConveyorWithScannerWeightDeviceDriver; +import org.nl.acs.device_driver.one_manipulator.box_package_manipulator.BoxPackageManipulatorDeviceDriver; +import org.nl.acs.device_driver.one_manipulator.box_storage_manipulator.BoxStorageManipulatorDeviceDriver; +import org.nl.acs.device_driver.one_manipulator.return_good_manipulator.ReturnGoodManipulatorDeviceDriver; +import org.nl.acs.device_driver.one_manipulator.trapped_manipulator.TrappedManipulatorManipulatorDeviceDriver; import org.nl.acs.device_driver.one_manipulator.volume_two_manipulator.VolumeTwoManipulatorManipulatorDeviceDriver; import org.nl.acs.device_driver.stacker.standard_stacker.StandardStackerDeviceDriver; import org.nl.acs.device_driver.two_conveyor.oven_manipulator.OvenGantryManipulatorDeviceDriver; @@ -1030,6 +1035,18 @@ public class DeviceServiceImpl extends CommonServiceImpl i }else if (device.getDeviceDriver() instanceof BeltConveyorDeviceDriver) { BeltConveyorDeviceDriver beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) device.getDeviceDriver(); beltConveyorDeviceDriver.setDeviceStatus(form); + }else if (device.getDeviceDriver() instanceof BoxPackageManipulatorDeviceDriver) { + BoxPackageManipulatorDeviceDriver boxPackageManipulatorDeviceDriver = (BoxPackageManipulatorDeviceDriver) device.getDeviceDriver(); + boxPackageManipulatorDeviceDriver.setDeviceStatus(form); + }else if (device.getDeviceDriver() instanceof BoxStorageManipulatorDeviceDriver) { + BoxStorageManipulatorDeviceDriver boxStorageManipulatorDeviceDriver = (BoxStorageManipulatorDeviceDriver) device.getDeviceDriver(); + boxStorageManipulatorDeviceDriver.setDeviceStatus(form); + }else if (device.getDeviceDriver() instanceof ReturnGoodManipulatorDeviceDriver) { + ReturnGoodManipulatorDeviceDriver returnGoodManipulatorDeviceDriver = (ReturnGoodManipulatorDeviceDriver) device.getDeviceDriver(); + returnGoodManipulatorDeviceDriver.setDeviceStatus(form); + }else if (device.getDeviceDriver() instanceof TrappedManipulatorManipulatorDeviceDriver) { + TrappedManipulatorManipulatorDeviceDriver trappedManipulatorManipulatorDeviceDriver = (TrappedManipulatorManipulatorDeviceDriver) device.getDeviceDriver(); + trappedManipulatorManipulatorDeviceDriver.setDeviceStatus(form); } } @@ -1228,13 +1245,15 @@ public class DeviceServiceImpl extends CommonServiceImpl i JSONArray w_arry = new JSONArray(); List writeableItemDtos = opcDeviceDriverDefination.getWriteableItemDtos(); List writeableItemJsons = new ArrayList<>(); - for (int i = 0; i < writeableItemDtos.size(); i++) { - ItemDto itemDto = writeableItemDtos.get(i); - JSONObject writeableItemJson = new JSONObject(); - writeableItemJson.put("code", itemDto.getCode()); - writeableItemJson.put("name", itemDto.getName()); - //writeableItemJson.put("db",itemDto.getDb()); - writeableItemJsons.add(writeableItemJson); + if (CollectionUtils.isNotEmpty(writeableItemDtos)) { + for (int i = 0; i < writeableItemDtos.size(); i++) { + ItemDto itemDto = writeableItemDtos.get(i); + JSONObject writeableItemJson = new JSONObject(); + writeableItemJson.put("code", itemDto.getCode()); + writeableItemJson.put("name", itemDto.getName()); + //writeableItemJson.put("db",itemDto.getDb()); + writeableItemJsons.add(writeableItemJson); + } } for (int i = 0; i < ws.size(); i++) { String extra_code = ws.getJSONObject(i).getString("extra_code"); @@ -1260,14 +1279,16 @@ public class DeviceServiceImpl extends CommonServiceImpl i jsonObject.put("name", wJson.getString("name")); warry.add(jsonObject); } - for (int i = 0; i < writeableItemDtos.size(); i++) { - ItemDto itemDto = writeableItemDtos.get(i); - JSONObject writeableItemJson = new JSONObject(); - writeableItemJson.put("code", itemDto.getCode()); - writeableItemJson.put("name", itemDto.getName()); - if (!warry.contains(writeableItemJson)) { - writeableItemJson.put("db", itemDto.getDb()); - w_arry.add(writeableItemJson); + if (CollectionUtils.isNotEmpty(writeableItemDtos)) { + for (int i = 0; i < writeableItemDtos.size(); i++) { + ItemDto itemDto = writeableItemDtos.get(i); + JSONObject writeableItemJson = new JSONObject(); + writeableItemJson.put("code", itemDto.getCode()); + writeableItemJson.put("name", itemDto.getName()); + if (!warry.contains(writeableItemJson)) { + writeableItemJson.put("db", itemDto.getDb()); + w_arry.add(writeableItemJson); + } } } if (!r_arry.isEmpty()) { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/box_manipulator_site/BoxManipulatorSiteDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/box_manipulator_site/BoxManipulatorSiteDeviceDriver.java index aa355dcb8..a2e21c0bf 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/box_manipulator_site/BoxManipulatorSiteDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/box_manipulator_site/BoxManipulatorSiteDeviceDriver.java @@ -274,19 +274,19 @@ public class BoxManipulatorSiteDeviceDriver extends AbstractOpcDeviceDriver impl //if (!requireSucess) { String remark = "";; if (mode != 2) { - remark = remark + "universal_remark2"; + remark = "universal_remark2"; } if (move != 0) { - remark = remark + "universal_remark3"; + remark = "universal_remark3"; } if (task != 0) { - remark = remark + "universal_remark4"; + remark = "universal_remark4"; if (ObjectUtil.isNotEmpty(this.inst)) { this.inst = null; } } if (requireSucess) { - remark = remark + "universal_remark5"; + remark = "universal_remark5"; } this.setNotCreateTaskMessage(remark); //} 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 2e4f0e196..30d9cd5d6 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 @@ -272,7 +272,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements break; case 2: //申请任务 - if (move == 1 && !requireSucess) { + if (move == 1 && !requireSucess && task==0) { instruction_require(); } break; @@ -490,7 +490,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements } List list = new ArrayList(); writeData(next_addr, list, inst); - led_message = getLedMessage(inst); +// led_message = getLedMessage(inst); requireSucess = true; return true; } else { @@ -499,7 +499,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements if (ObjectUtil.isNull(taskdto)) { return false; } - if (ObjectUtil.isNotNull(taskdto) && TaskTypeEnum.Conveyor_Task.getIndex().equals(taskdto.getTask_type())) { + if (ObjectUtil.isNotNull(taskdto)) { //判断指令的起点和当前的设备号相同 if (!taskdto.getStart_device_code().equals(device_code)) { return false; @@ -565,7 +565,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements String next_addr = nextdevice.getExtraValue().get("address").toString(); List list = new ArrayList(); writeData(next_addr, list, instdto); - led_message = getLedMessage(instdto); +// led_message = getLedMessage(instdto); requireSucess = true; return true; } @@ -589,7 +589,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements list.add(map2); Map map3 = new HashMap(); map3.put("code", "to_container_type"); - map3.put("value", "1"); + map3.put("value", inst.getVehicle_type()); list.add(map3); Map map4 = new HashMap(); map4.put("code", "to_container_no"); @@ -703,23 +703,24 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements return jo; } - /** - * 获取任务信息 - */ - public JSONObject getLedMessage(Instruction instdto) { - JSONObject json = new JSONObject(); - json.put("task_code", instdto.getTask_code()); - json.put("inst_code", instdto.getInstruction_code()); - json.put("start_device_code", instdto.getStart_device_code()); - json.put("next_device_code", instdto.getNext_device_code()); - json.put("material_type", instdto.getMaterial()); - json.put("quantity", instdto.getQuantity()); - json.put("vehicle_code", instdto.getVehicle_code()); - json.put("instruction_status", instdto.getInstruction_status()); - json.put("entry_time", instdto.getCreate_time()); - json.put("ip", localhost); - return json; - } +// /** +// * 获取任务信息 +// */ +// public JSONObject getLedMessage(Instruction instdto) { +// JSONObject json = new JSONObject(); +// json.put("task_code", instdto.getTask_code()); +// json.put("inst_code", instdto.getInstruction_code()); +// json.put("start_device_code", instdto.getStart_device_code()); +// json.put("next_device_code", instdto.getNext_device_code()); +// json.put("material_type", instdto.getMaterial()); +// json.put("quantity", instdto.getQuantity()); +// json.put("vehicle_code", instdto.getVehicle_code()); +// json.put("instruction_status", instdto.getInstruction_status()); +// json.put("entry_time", instdto.getCreate_time()); +// String acsIp = paramService.findByCode(AcsConfig.ACSIP).getValue(); +// json.put("ip", acsIp); +// return json; +// } /** diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/ItemProtocol.java index 29b39a622..9077fd383 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/ItemProtocol.java @@ -11,7 +11,7 @@ import java.util.List; @Slf4j @Data -public class ItemProtocol { +public class ItemProtocol { /** * 心跳 diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/led/led_screen/LedScreenDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/led/led_screen/LedScreenDeviceDriver.java index be389c2bd..6f9df8f70 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/led/led_screen/LedScreenDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/led/led_screen/LedScreenDeviceDriver.java @@ -20,6 +20,7 @@ import org.nl.acs.monitor.DeviceStageMonitor; public class LedScreenDeviceDriver extends AbstractDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor { @Override public void execute() { + //todo:判断当前对接位有货变没货后十五秒清屏 } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/manipulator/standard_manipulator/BlankManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/manipulator/standard_manipulator/BlankManipulatorDeviceDriver.java index 07dee0f30..f3b26ae2b 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/manipulator/standard_manipulator/BlankManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/manipulator/standard_manipulator/BlankManipulatorDeviceDriver.java @@ -268,13 +268,13 @@ // remark = remark + "光电信号(move)为有货状态,"; // } // if (task != 0) { -// remark = remark + "universal_remark4"; +// remark = "universal_remark4"; // if (ObjectUtil.isNotEmpty(this.inst)) { // this.inst = null; // } // } // if (requireSucess) { -// remark = remark + "universal_remark5"; +// remark = "universal_remark5"; // } // this.setNotCreateTaskMessage(remark); // //} diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/manipulator/standard_manipulator/DryManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/manipulator/standard_manipulator/DryManipulatorDeviceDriver.java index 011d11919..d18463010 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/manipulator/standard_manipulator/DryManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/manipulator/standard_manipulator/DryManipulatorDeviceDriver.java @@ -267,13 +267,13 @@ // remark = remark + "光电信号(move)为有货状态,"; // } // if (task != 0) { -// remark = remark + "universal_remark4"; +// remark = "universal_remark4"; // if (ObjectUtil.isNotEmpty(this.inst)) { // this.inst = null; // } // } // if (requireSucess) { -// remark = remark + "universal_remark5"; +// remark = "universal_remark5"; // } // this.setNotCreateTaskMessage(remark); // //} diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/manipulator/standard_manipulator/OvenGantryManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/manipulator/standard_manipulator/OvenGantryManipulatorDeviceDriver.java index 4443518e9..1adf84f54 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/manipulator/standard_manipulator/OvenGantryManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/manipulator/standard_manipulator/OvenGantryManipulatorDeviceDriver.java @@ -273,13 +273,13 @@ // remark = remark + "光电信号(move)为有货状态,"; // } // if (task != 0) { -// remark = remark + "universal_remark4"; +// remark = "universal_remark4"; // if (ObjectUtil.isNotEmpty(this.inst)) { // this.inst = null; // } // } // if (requireSucess) { -// remark = remark + "universal_remark5"; +// remark = "universal_remark5"; // } // this.setNotCreateTaskMessage(remark); // //} 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 6b9d6f562..49de8247c 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 @@ -242,10 +242,10 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements //if (!requireSucess) { String remark = "";; if (mode != 2) { - remark = remark + "universal_remark2"; + remark = "universal_remark2"; } if (move != 0) { - remark = remark + "universal_remark3"; + remark = "universal_remark3"; } if (task != 0) { remark = remark + LangProcess.msg("universal_remark4"); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/manipulator_cache/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/manipulator_cache/ItemProtocol.java index 9b04b8ba7..bcf594ec4 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/manipulator_cache/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/manipulator_cache/ItemProtocol.java @@ -18,6 +18,8 @@ public class ItemProtocol { //动作信号 public static String item_action = "action"; + public static String item_to_command = "to_command"; + private ManipulatorCacheDeviceDriver driver; public ItemProtocol(ManipulatorCacheDeviceDriver driver) { @@ -49,6 +51,7 @@ public class ItemProtocol { public static List getReadableItemDtos() { ArrayList list = new ArrayList<>(); + list.add(new ItemDto(item_to_command, "作业命令", "DB200.W2", Boolean.valueOf(true))); list.add(new ItemDto(item_mode, "工作模式", "DB1.B1")); list.add(new ItemDto(item_action, "动作信号", "DB1.B3")); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/manipulator_cache/ManipulatorCacheDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/manipulator_cache/ManipulatorCacheDeviceDriver.java index 6219eace3..9fcc854c4 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/manipulator_cache/ManipulatorCacheDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/manipulator_cache/ManipulatorCacheDeviceDriver.java @@ -42,6 +42,8 @@ public class ManipulatorCacheDeviceDriver extends AbstractOpcDeviceDriver implem int action = 0; int last_action = 0; + + @Override public Device getDevice() { return this.device; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_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 aced999f3..969fb3a22 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 @@ -12,6 +12,7 @@ import lombok.Data; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.ObjectUtils; +import org.nl.acs.AcsConfig; import org.nl.acs.common.base.CommonFinalParam; import org.nl.acs.device.domain.Device; import org.nl.acs.device.service.DeviceExtraService; @@ -45,6 +46,7 @@ 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.nl.system.service.param.ISysParamService; import org.springframework.beans.factory.annotation.Autowired; import java.util.*; @@ -76,6 +78,8 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class); LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class); + + ISysParamService paramService = SpringContextHolder.getBean(ISysParamService.class); //工作模式 int mode = 0; int last_mode = 0; @@ -165,6 +169,10 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv //当前指令 Instruction inst = null; + /** + * led点阵屏信息 + */ + JSONObject led_message = null; //0 无任务执行 1更新指令状态 2下发电气信号 3允许取货 允许放货 5放货完成 int now_steps_type = 0; @@ -217,6 +225,13 @@ 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)){ + Thread.sleep(10000); + led_message = clearMessage(); + } + requireSucess = false; + } if (move != 0 && task > 0) { update_instruction_status(); @@ -264,10 +279,10 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv //if (!requireSucess) { String remark = "";; if (mode != 2) { - remark = remark + "universal_remark2"; + remark = "universal_remark2"; } if (move != 0) { - remark = remark + "universal_remark3"; + remark = "universal_remark3"; } if (task != 0) { remark = remark + LangProcess.msg("universal_remark4"); @@ -483,6 +498,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv map3.put("value", "1"); list.add(map3); this.writing(list); + led_message = getLedMessage(instdto); requireSucess = true; while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString() , instdto.getInstruction_code())) { @@ -503,6 +519,43 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv } } + /** + * 获取任务信息 + */ + public JSONObject getLedMessage(Instruction instdto) { + JSONObject json = new JSONObject(); + json.put("task_code", instdto.getTask_code()); + json.put("inst_code", instdto.getInstruction_code()); + json.put("start_device_code", instdto.getStart_device_code()); + json.put("next_device_code", instdto.getNext_device_code()); + json.put("material_type", instdto.getMaterial()); + json.put("quantity", instdto.getQuantity()); + json.put("vehicle_code", instdto.getVehicle_code()); + json.put("instruction_status", instdto.getInstruction_status()); + json.put("entry_time", instdto.getCreate_time()); + String acsIp = paramService.findByCode(AcsConfig.ACSIP).getValue(); + json.put("ip", acsIp); + return json; + } + + /** + * 清空任务信息任务信息 + */ + public JSONObject clearMessage() { + JSONObject json = new JSONObject(); + json.put("task_code", ""); + json.put("inst_code", ""); + json.put("start_device_code", ""); + json.put("next_device_code", ""); + json.put("material_type", ""); + json.put("quantity", ""); + json.put("vehicle_code", ""); + json.put("instruction_status", ""); + json.put("entry_time", ""); + json.put("ip", ""); + return json; + } + private void packageInstrcutData(Instruction instdto, TaskDto taskdto, String taskid, String taskcode, String vehiclecode, String priority,String startCode, String endCode) { instdto.setInstruction_id(IdUtil.simpleUUID()); instdto.setRoute_plan_code(taskdto.getRoute_plan_code()); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java index c7b03641f..5506b97d4 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java @@ -19,6 +19,7 @@ import org.nl.acs.device_driver.RouteableDeviceDriver; import org.nl.acs.device_driver.conveyor.siemens_conveyor.SiemensConveyorDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; +import org.nl.acs.device_driver.one_conveyor.box_subvolumes_conveyor.BoxSubvolumesConveyorDeviceDriver; import org.nl.acs.device_driver.one_conveyor.manipulator_cache.ManipulatorCacheDeviceDriver; import org.nl.acs.history.ErrorUtil; import org.nl.acs.history.service.DeviceErrorLogService; @@ -78,11 +79,11 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i int task = 0; int last_task = 0; // x坐标 - float x_position = 0; - float last_x_position = 0; + float x = 0.0f; + float last_x = 0.0f; // y坐标 - float y_position = 0; - float last_y_position = 0; + float y = 0.0f; + float last_y = 0.0f; int heartbeat = 0; int last_heartbeat = 0; @@ -112,7 +113,7 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i Boolean isonline = true; int hasGoods = 0; - String message = null; + String message = ""; Boolean iserror = false; private Date instruction_update_time = new Date(); private int instruction_update_time_out = 1000; @@ -169,8 +170,8 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i to_target = this.itemProtocol.getTo_target(); to_task = this.itemProtocol.getTo_task(); to_onset = this.itemProtocol.getTo_onset(); - x_position = this.itemProtocol.getX_position(); - y_position = this.itemProtocol.getY_position(); + x = this.itemProtocol.getX(); + y = this.itemProtocol.getY(); to_seq = this.itemProtocol.getTo_seq(); to_max_no = this.itemProtocol.getTo_max_no(); to_direction = this.itemProtocol.getTo_direction(); @@ -218,19 +219,19 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } else { String remark = "";; if (mode != 2) { - remark = remark + "universal_remark2"; + remark = "universal_remark2"; } if (move != 0) { - remark = remark + "universal_remark3"; + remark = "universal_remark3"; } if (task != 0) { - remark = remark + "universal_remark4"; + remark = "universal_remark4"; if (ObjectUtil.isNotEmpty(this.inst)) { this.inst = null; } } if (requireSucess) { - remark = remark + "universal_remark5"; + remark = "universal_remark5"; } this.setNotCreateTaskMessage(remark); } @@ -247,8 +248,6 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i last_to_command = to_command; last_to_target = to_target; last_to_onset = to_onset; - last_x_position = x_position; - last_y_position = y_position; last_to_seq = to_seq; last_to_last = to_last; last_to_direction = to_direction; @@ -294,16 +293,16 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i }else { feedMessage = "universal_feedMessage5"; if (mode != 3) { - feedMessage = feedMessage + "universal_feedMessage1"; + feedMessage = "universal_feedMessage1"; } if (action != 8) { - feedMessage = feedMessage + "universal_feedMessage2"; + feedMessage = "universal_feedMessage2"; } if (move != 0) { - feedMessage = feedMessage + "universal_feedMessage3"; + feedMessage = "universal_feedMessage3"; } if (task == 0) { - feedMessage = feedMessage + "universal_feedMessage4"; + feedMessage = "universal_feedMessage4"; } } } @@ -390,10 +389,10 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); } - SiemensConveyorDeviceDriver siemensConveyorDeviceDriver; - if (nextDevice.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) { - siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) nextDevice.getDeviceDriver(); - if (siemensConveyorDeviceDriver.getMove() != 1) { + BoxSubvolumesConveyorDeviceDriver boxSubvolumesConveyorDeviceDriver; + if (nextDevice.getDeviceDriver() instanceof BoxSubvolumesConveyorDeviceDriver) { + boxSubvolumesConveyorDeviceDriver = (BoxSubvolumesConveyorDeviceDriver) nextDevice.getDeviceDriver(); + if (boxSubvolumesConveyorDeviceDriver.getMove() != 1) { notCreateInstMessage = "universal_notCreateInstMessage2"; return false; } @@ -402,7 +401,7 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i ManipulatorCacheDeviceDriver manipulatorCacheDeviceDriver; if (startDevice.getDeviceDriver() instanceof ManipulatorCacheDeviceDriver) { manipulatorCacheDeviceDriver = (ManipulatorCacheDeviceDriver) startDevice.getDeviceDriver(); - if (manipulatorCacheDeviceDriver.getMode() != 2 && manipulatorCacheDeviceDriver.getMode() !=1) { + if (manipulatorCacheDeviceDriver.getMode() != 2 && manipulatorCacheDeviceDriver.getAction() !=1) { notCreateInstMessage = "universal_notCreateInstMessage3"; return false; } @@ -471,19 +470,14 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i map4.put("value", task); list.add(map4); if (ObjectUtil.isNotEmpty(interactionJsonDTO)) { - if (ObjectUtil.isNotEmpty(interactionJsonDTO.getSeq())) { - map5.put("code", "to_seq"); - map5.put("value", interactionJsonDTO.getSeq()); - list.add(map5); - } if (ObjectUtil.isNotEmpty(interactionJsonDTO.getLastOne())) { map6.put("code", "to_last_one"); map6.put("value", interactionJsonDTO.getLastOne()); list.add(map6); } - if (ObjectUtil.isNotEmpty(interactionJsonDTO.getDirection())) { - map7.put("code", "to_direction"); - map7.put("value", interactionJsonDTO.getDirection()); + if (ObjectUtil.isNotEmpty(interactionJsonDTO.getBoxNo())) { + map7.put("code", "to_box_no"); + map7.put("value", interactionJsonDTO.getBoxNo()); list.add(map7); } if (ObjectUtil.isNotEmpty(interactionJsonDTO.getMaxNo())) { @@ -493,8 +487,8 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } if (ObjectUtil.isNotEmpty(interactionJsonDTO.getBarcode())) { - map8.put("code", "to_barcode"); - map8.put("value", interactionJsonDTO.getBarcode()); + map9.put("code", "to_barcode"); + map9.put("value", interactionJsonDTO.getBarcode()); list.add(map9); } } @@ -613,8 +607,8 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i jo.put("feedMessage", LangProcess.msg(feedMessage)); jo.put("driver_type", "siemens_conveyor"); jo.put("is_click", true); - jo.put("x", x_position); - jo.put("y", y_position); + jo.put("x", x); + jo.put("y", y); return jo; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/InteractionJsonDTO.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/InteractionJsonDTO.java index a7695163f..2e45f015c 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/InteractionJsonDTO.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/InteractionJsonDTO.java @@ -9,14 +9,12 @@ public class InteractionJsonDTO { *木箱最大数量 */ private String maxNo; + /** - *子卷摆放方向 + *木箱最大数量 */ - private String direction; - /** - *下发木箱工位顺序 - */ - private String seq; + private String boxNo; + /** *是否最后子卷 diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/ItemProtocol.java index 41cfd2387..9f26e9490 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/ItemProtocol.java @@ -43,11 +43,11 @@ public class ItemProtocol { /** * x轴坐标 */ - public static String item_x_position = "x_position"; + public static String item_x = "x"; /** * y轴坐标 */ - public static String item_y_position = "y_position"; + public static String item_y= "y"; /** @@ -96,6 +96,10 @@ public class ItemProtocol { * 下发是否最后子卷 */ public static String item_to_last_one = "to_last_one"; + /** + *下发木箱条码 + */ + public static String item_to_barcode = "to_barcode"; private BoxPackageManipulatorDeviceDriver driver; @@ -148,12 +152,12 @@ public class ItemProtocol { return this.getOpcIntegerValue(item_to_target); } - public float getX_position() { - return this.getOpcFloatValue(item_x_position); + public float getX() { + return this.getOpcFloatValue(item_x); } - public float getY_position() { - return this.getOpcFloatValue(item_y_position); + public float getY() { + return this.getOpcFloatValue(item_y); } public int getTo_seq(){ @@ -186,6 +190,10 @@ public class ItemProtocol { } + public String getTo_barcode() { + return this.getOpcStringValue(item_to_barcode); + } + public String getOpcStringValue(String protocol) { String value = this.driver.getStringValue(protocol); if (StrUtil.isEmpty(value)) { @@ -218,8 +226,8 @@ public class ItemProtocol { list.add(new ItemDto(item_walk_y, "行走列", "DB1.B4")); list.add(new ItemDto(item_error, "报警信号", "DB1.B5")); list.add(new ItemDto(item_task, "任务号", "DB1.D6")); - list.add(new ItemDto(item_x_position, "x坐标", "DB1.REAL10")); - list.add(new ItemDto(item_y_position, "y坐标", "DB1.REAL14")); + list.add(new ItemDto(item_x, "x坐标", "DB1.REAL10")); + list.add(new ItemDto(item_y, "y坐标", "DB1.REAL14")); list.add(new ItemDto(item_position, "木箱位置", "DB1.REAL16")); list.add(new ItemDto(item_number, "木箱数量", "DB1.REAL18")); return list; @@ -235,6 +243,8 @@ public class ItemProtocol { list.add(new ItemDto(item_to_direction, "子卷摆放方向", "DB2.D10")); list.add(new ItemDto(item_to_seq, "下发木箱工位顺序", "DB2.W12")); list.add(new ItemDto(item_to_last_one, "下发是否最后子卷", "DB2.W14")); + list.add(new ItemDto(item_to_barcode, "下发木箱条码", "DB601.STRING1.50")); + return list; } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/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 1ee2a9e81..3aa349481 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 @@ -17,6 +17,7 @@ import org.nl.acs.device.service.impl.DeviceExtraServiceImpl; import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.FeedLmsRealFailed; import org.nl.acs.device_driver.RouteableDeviceDriver; +import org.nl.acs.device_driver.conveyor.belt_conveyor.BeltConveyorDeviceDriver; import org.nl.acs.device_driver.conveyor.siemens_conveyor.SiemensConveyorDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; @@ -192,19 +193,19 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } else { String remark = "";; if (mode != 2) { - remark = remark + "universal_remark2"; + remark = "universal_remark2"; } if (move != 0) { - remark = remark + "universal_remark3"; + remark = "universal_remark3"; } if (task != 0) { - remark = remark + "universal_remark4"; + remark = "universal_remark4"; if (ObjectUtil.isNotEmpty(this.inst)) { this.inst = null; } } if (requireSucess) { - remark = remark + "universal_remark5"; + remark = "universal_remark5"; } this.setNotCreateTaskMessage(remark); } @@ -253,16 +254,16 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } else { feedMessage = "universal_feedMessage5"; if (mode != 3) { - feedMessage = feedMessage + "universal_feedMessage1"; + feedMessage = "universal_feedMessage1"; } if (action != 8) { - feedMessage = feedMessage + "universal_feedMessage2"; + feedMessage = "universal_feedMessage2"; } if (move != 0) { - feedMessage = feedMessage + "universal_feedMessage3"; + feedMessage = "universal_feedMessage3"; } if (task == 0) { - feedMessage = feedMessage + "universal_feedMessage4"; + feedMessage = "universal_feedMessage4"; } } } @@ -350,10 +351,11 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i notCreateInstMessage = "universal_notCreateInstMessage1"; throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); } - SiemensConveyorDeviceDriver siemensConveyorDeviceDriver; - if (nextDevice.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) { - siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) nextDevice.getDeviceDriver(); - if (siemensConveyorDeviceDriver.getMove() != 1) { + //存在托盘才可以申请任务 + BeltConveyorDeviceDriver beltConveyorDeviceDriver; + if (nextDevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) { + beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) nextDevice.getDeviceDriver(); + if (beltConveyorDeviceDriver.getMove() != 1) { notCreateInstMessage = "universal_notCreateInstMessage2"; return false; } @@ -425,7 +427,7 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i list.add(map4); if (ObjectUtil.isNotEmpty(interactionJsonDTO)) { if (ObjectUtil.isNotEmpty(interactionJsonDTO.getWeight())) { - map5.put("code", "to_weight"); + map5.put("code", "to_width"); map5.put("value", interactionJsonDTO.getWeight()); list.add(map5); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/ItemProtocol.java index 796dee308..8f3d8a53b 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/ItemProtocol.java @@ -42,6 +42,18 @@ public class ItemProtocol { public static String item_walk_y = "walk_y"; + + /** + * 行走列 + */ + public static String item_x = "x"; + + /** + * 行走层号 + */ + public static String item_y = "y"; + + /** * 下发命令 */ @@ -68,7 +80,7 @@ public class ItemProtocol { /** *木箱宽度 */ - public static String item_to_weight = "to_weight"; + public static String item_to_width = "to_width"; /** *木箱高度 */ @@ -86,6 +98,16 @@ public class ItemProtocol { private BoxStorageManipulatorDeviceDriver driver; + + + public float getX() { + return this.getOpcFloatValue(item_x); + } + + public float getY() { + return this.getOpcFloatValue(item_y); + } + public ItemProtocol(BoxStorageManipulatorDeviceDriver driver){ this.driver=driver; } @@ -161,6 +183,18 @@ public class ItemProtocol { return 0; } + public float getOpcFloatValue(String protocol) { + Float value = this.driver.getDoubleValue(protocol); + if (value == null) { + // log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!"); + setIsonline(false); + } else { + setIsonline(true); + return value; + } + return 0; + + } public String getOpcStringValue(String protocol) { String value = this.driver.getStringValue(protocol); if (StrUtil.isBlank(value)) { @@ -180,6 +214,8 @@ public class ItemProtocol { list.add(new ItemDto(item_error, "报警信号", "DB1.B5")); list.add(new ItemDto(item_task, "任务号", "DB1.D6")); list.add(new ItemDto(item_walk_y, "行走列", "DB1.B4")); + list.add(new ItemDto(item_x, "行走列号", "DB101.B10")); + list.add(new ItemDto(item_y, "行走层号", "DB101.B11")); return list; } @@ -190,7 +226,7 @@ public class ItemProtocol { list.add(new ItemDto(item_to_task, "下发任务号", "DB2.D6")); list.add(new ItemDto(item_to_onset, "下发起始站", "DB2.W2")); list.add(new ItemDto(item_to_length, "木箱长度", "DB601.W14")); - list.add(new ItemDto(item_to_weight, "木箱宽度", "DB601.W16")); + list.add(new ItemDto(item_to_width, "木箱宽度", "DB601.W16")); list.add(new ItemDto(item_to_height, "木箱高度", "DB601.W18")); list.add(new ItemDto(item_to_barcode, "下发木箱条码", "DB601.STRING1.50")); list.add(new ItemDto(item_to_layer, "下发木箱层数", "DB601.W22")); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/return_good_manipulator/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/return_good_manipulator/ItemProtocol.java index fd72628f2..9ee088013 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/return_good_manipulator/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/return_good_manipulator/ItemProtocol.java @@ -85,6 +85,26 @@ public class ItemProtocol { private ReturnGoodManipulatorDeviceDriver driver; + + /** + * 行走列 + */ + public static String item_x = "x"; + + /** + * 行走层号 + */ + public static String item_y = "y"; + + + public float getX() { + return this.getOpcFloatValue(item_x); + } + + public float getY() { + return this.getOpcFloatValue(item_y); + } + public ItemProtocol(ReturnGoodManipulatorDeviceDriver driver){ this.driver=driver; } @@ -143,6 +163,19 @@ public class ItemProtocol { Boolean isonline; + + public float getOpcFloatValue(String protocol) { + Float value = this.driver.getDoubleValue(protocol); + if (value == null) { + // log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!"); + setIsonline(false); + } else { + setIsonline(true); + return value; + } + return 0; + + } public int getOpcIntegerValue(String protocol) { Integer value = this.driver.getIntegeregerValue(protocol); if (value == null) { @@ -163,6 +196,8 @@ public class ItemProtocol { list.add(new ItemDto(item_error, "报警信号", "DB1.B5")); list.add(new ItemDto(item_task, "任务号", "DB1.D6")); list.add(new ItemDto(item_walk_y, "行走列", "DB1.B4")); + list.add(new ItemDto(item_x, "行走列号", "DB101.B10")); + list.add(new ItemDto(item_y, "行走层号", "DB101.B11")); return list; } 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 3cfcb0df2..5c413a60e 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 @@ -18,6 +18,7 @@ import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.FeedLmsRealFailed; import org.nl.acs.device_driver.RouteableDeviceDriver; import org.nl.acs.device_driver.box_manipulator_site.BoxManipulatorSiteDeviceDriver; +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; @@ -202,19 +203,19 @@ public class ReturnGoodManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } else { String remark = "";; if (mode != 2) { - remark = remark + "universal_remark2"; + remark = "universal_remark2"; } if (move != 0) { - remark = remark + "universal_remark3"; + remark = "universal_remark3"; } if (task != 0) { - remark = remark + "universal_remark4"; + remark = "universal_remark4"; if (ObjectUtil.isNotEmpty(this.inst)) { this.inst = null; } } if (requireSucess) { - remark = remark + "universal_remark5"; + remark = "universal_remark5"; } this.setNotCreateTaskMessage(remark); } @@ -273,16 +274,16 @@ public class ReturnGoodManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } else { feedMessage = "universal_feedMessage5"; if (mode != 3) { - feedMessage = feedMessage + "universal_feedMessage1"; + feedMessage = "universal_feedMessage1"; } if (action != 8) { - feedMessage = feedMessage + "universal_feedMessage2"; + feedMessage = "universal_feedMessage2"; } if (move != 0) { - feedMessage = feedMessage + "universal_feedMessage3"; + feedMessage = "universal_feedMessage3"; } if (task == 0) { - feedMessage = feedMessage + "universal_feedMessage4"; + feedMessage = "universal_feedMessage4"; } } } @@ -373,15 +374,15 @@ public class ReturnGoodManipulatorDeviceDriver extends AbstractOpcDeviceDriver i throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); } - SiemensConveyorDeviceDriver siemensConveyorDeviceDriver; - if (nextDevice.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) { - siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) nextDevice.getDeviceDriver(); - if (siemensConveyorDeviceDriver.getMove() != 1) { + //存在托盘才可以申请任务 + BeltConveyorDeviceDriver beltConveyorDeviceDriver; + if (nextDevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) { + beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) nextDevice.getDeviceDriver(); + if (beltConveyorDeviceDriver.getMove() != 1) { notCreateInstMessage = "universal_notCreateInstMessage2"; return false; } } - String taskid = taskDto.getTask_id(); String taskcode = taskDto.getTask_code(); String start_point_code = taskDto.getStart_point_code(); @@ -450,7 +451,7 @@ public class ReturnGoodManipulatorDeviceDriver extends AbstractOpcDeviceDriver i list.add(map5); } if (ObjectUtil.isNotEmpty(interactionJsonDTO.getLength())) { - map6.put("code", "to_length"); + map6.put("code", "to_lenght"); map6.put("value", interactionJsonDTO.getLength()); list.add(map6); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/trapped_manipulator/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/trapped_manipulator/ItemProtocol.java index 63e94d08f..a128f1334 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/trapped_manipulator/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/trapped_manipulator/ItemProtocol.java @@ -36,6 +36,21 @@ public class ItemProtocol { */ public static String item_error = "error"; + /** + * 行走列 + */ + public static String item_walk_y = "walk_y"; + + /** + * 行走列 + */ + public static String item_x = "x"; + + /** + * 行走层号 + */ + public static String item_y = "y"; + /** * 下发托盘类型 @@ -69,7 +84,7 @@ public class ItemProtocol { /** *木箱宽度 */ - public static String item_to_weight = "to_weight"; + public static String item_to_width = "to_width"; /** *木箱高度 */ @@ -92,6 +107,18 @@ public class ItemProtocol { private TrappedManipulatorManipulatorDeviceDriver driver; + public float getX() { + return this.getOpcFloatValue(item_x); + } + + public float getY() { + return this.getOpcFloatValue(item_y); + } + public int getWalk_y() { + return this.getOpcIntegerValue(item_walk_y); + } + + public ItemProtocol(TrappedManipulatorManipulatorDeviceDriver driver){ this.driver=driver; } @@ -158,6 +185,19 @@ public class ItemProtocol { return 0; } + public float getOpcFloatValue(String protocol) { + Float value = this.driver.getDoubleValue(protocol); + if (value == null) { + // log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!"); + setIsonline(false); + } else { + setIsonline(true); + return value; + } + return 0; + + } + public static List getReadableItemDtos() { ArrayList list = new ArrayList<>(); list.add(new ItemDto(item_heartbeat, "心跳", "DB1.B0")); @@ -166,6 +206,8 @@ public class ItemProtocol { list.add(new ItemDto(item_action, "动作信号", "DB1.B3")); list.add(new ItemDto(item_error, "报警信号", "DB1.B5")); list.add(new ItemDto(item_task, "任务号", "DB1.D6")); + list.add(new ItemDto(item_x, "行走列号", "DB101.B10")); + list.add(new ItemDto(item_y, "行走层号", "DB101.B11")); return list; } @@ -177,7 +219,7 @@ public class ItemProtocol { list.add(new ItemDto(item_to_onset, "下发起始站", "DB2.W2")); list.add(new ItemDto(item_to_container_type, "下发托盘类型", "DB102.B8")); list.add(new ItemDto(item_to_length, "木箱长度", "DB601.W10")); - list.add(new ItemDto(item_to_weight, "木箱宽度", "DB601.W12")); + list.add(new ItemDto(item_to_width, "木箱宽度", "DB601.W12")); list.add(new ItemDto(item_to_height, "木箱高度", "DB601.W14")); list.add(new ItemDto(item_to_template, "堆叠模板", "DB601.W16")); list.add(new ItemDto(item_to_is_binding, "下发是否捆轧", "DB601.D10")); 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 a555ccbd6..ce6240336 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 @@ -18,6 +18,7 @@ import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.FeedLmsRealFailed; import org.nl.acs.device_driver.RouteableDeviceDriver; import org.nl.acs.device_driver.box_manipulator_site.BoxManipulatorSiteDeviceDriver; +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; @@ -206,13 +207,13 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice remark = remark + "光电信号(move)为有货状态,"; } if (task != 0) { - remark = remark + "universal_remark4"; + remark = "universal_remark4"; if (ObjectUtil.isNotEmpty(this.inst)) { this.inst = null; } } if (requireSucess) { - remark = remark + "universal_remark5"; + remark = "universal_remark5"; } this.setNotCreateTaskMessage(remark); } @@ -272,16 +273,16 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice }else { feedMessage = "universal_feedMessage5"; if (mode != 3) { - feedMessage = feedMessage + "universal_feedMessage1"; + feedMessage = "universal_feedMessage1"; } if (action != 8) { - feedMessage = feedMessage + "universal_feedMessage2"; + feedMessage = "universal_feedMessage2"; } if (move != 0) { - feedMessage = feedMessage + "universal_feedMessage3"; + feedMessage = "universal_feedMessage3"; } if (task == 0) { - feedMessage = feedMessage + "universal_feedMessage4"; + feedMessage = "universal_feedMessage4"; } } } @@ -369,10 +370,10 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice } - SiemensConveyorDeviceDriver siemensConveyorDeviceDriver; - if (startDevice.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) { - siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) startDevice.getDeviceDriver(); - if (siemensConveyorDeviceDriver.getMove() != 1) { + BeltConveyorDeviceDriver beltConveyorDeviceDriver; + if (startDevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) { + beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) startDevice.getDeviceDriver(); + if (beltConveyorDeviceDriver.getMove() != 1) { notCreateInstMessage = "universal_notCreateInstMessage2"; return false; } @@ -445,7 +446,7 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice list.add(map4); if (ObjectUtil.isNotEmpty(interactionJsonDTO)) { if (ObjectUtil.isNotEmpty(interactionJsonDTO.getWeight())) { - map5.put("code", "to_weight"); + map5.put("code", "to_width"); map5.put("value", interactionJsonDTO.getWeight()); list.add(map5); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/ItemProtocol.java index cf261edcf..ba1bafc0b 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/ItemProtocol.java @@ -138,12 +138,12 @@ public class ItemProtocol { public int getWalk_y() { return this.getOpcIntegerValue(item_walk_y); } - public Integer getItem_x() { - return this.getOpcIntegerValue(item_x); + public float getX() { + return this.getOpcFloatValue(item_x); } - public Integer getItem_y() { - return this.getOpcIntegerValue(item_y); + public float getY() { + return this.getOpcFloatValue(item_y); } @@ -180,6 +180,19 @@ public class ItemProtocol { return 0; } + public float getOpcFloatValue(String protocol) { + Float value = this.driver.getDoubleValue(protocol); + if (value == null) { + // log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!"); + setIsonline(false); + } else { + setIsonline(true); + return value; + } + return 0; + + } + public static List getReadableItemDtos() { ArrayList list = new ArrayList<>(); list.add(new ItemDto(item_heartbeat, "心跳", "DB1.B0")); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/VolumeTwoManipulatorManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/VolumeTwoManipulatorManipulatorDeviceDriver.java index 446e0fdd8..db731e7fa 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/VolumeTwoManipulatorManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/VolumeTwoManipulatorManipulatorDeviceDriver.java @@ -16,6 +16,7 @@ import org.nl.acs.device.service.impl.DeviceExtraServiceImpl; import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.FeedLmsRealFailed; import org.nl.acs.device_driver.RouteableDeviceDriver; +import org.nl.acs.device_driver.conveyor.belt_conveyor.BeltConveyorDeviceDriver; import org.nl.acs.device_driver.conveyor.siemens_conveyor.SiemensConveyorDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; @@ -100,16 +101,12 @@ public class VolumeTwoManipulatorManipulatorDeviceDriver extends AbstractOpcDevi int last_to_onset2 = 0; int to_type = 0; int last_to_type = 0; - /** - * 行走列 - */ - Integer x = null; - Integer last_x = null; - /** - * 行走层号 - */ - Integer y = 0; - Integer last_y = 0; + // x坐标 + float x = 0.0f; + float last_x = 0.0f; + // y坐标 + float y = 0.0f; + float last_y = 0.0f; int to_task = 0; int last_to_task = 0; @@ -168,8 +165,8 @@ public class VolumeTwoManipulatorManipulatorDeviceDriver extends AbstractOpcDevi error = this.itemProtocol.getError(); task = this.itemProtocol.getTask(); heartbeat = this.itemProtocol.getHeartbeat(); - x = this.itemProtocol.getItem_x(); - y = this.itemProtocol.getItem_y(); + x = this.itemProtocol.getX(); + y = this.itemProtocol.getY(); to_command = this.itemProtocol.getTo_command(); to_target1 = this.itemProtocol.getTo_target1(); to_onset1 = this.itemProtocol.getTo_onset1(); @@ -221,19 +218,19 @@ public class VolumeTwoManipulatorManipulatorDeviceDriver extends AbstractOpcDevi } else { String remark = ""; if (mode != 2) { - remark = remark + "universal_remark2"; + remark = "universal_remark2"; } if (move != 0) { - remark = remark + "universal_remark3"; + remark = "universal_remark3"; } if (task != 0) { - remark = remark + "universal_remark4"; + remark = "universal_remark4"; if (ObjectUtil.isNotEmpty(this.inst)) { this.inst = null; } } if (requireSucess) { - remark = remark + "universal_remark5"; + remark = "universal_remark5"; } this.setNotCreateTaskMessage(remark); } @@ -297,16 +294,16 @@ public class VolumeTwoManipulatorManipulatorDeviceDriver extends AbstractOpcDevi } else { feedMessage = "universal_feedMessage5"; if (mode != 3) { - feedMessage = feedMessage + "universal_feedMessage1"; + feedMessage = "universal_feedMessage1"; } if (action != 8) { - feedMessage = feedMessage + "universal_feedMessage2"; + feedMessage = "universal_feedMessage2"; } if (move != 0) { - feedMessage = feedMessage + "universal_feedMessage3"; + feedMessage = "universal_feedMessage3"; } if (task == 0) { - feedMessage = feedMessage + "universal_feedMessage4"; + feedMessage = "universal_feedMessage4"; } } } @@ -390,10 +387,10 @@ public class VolumeTwoManipulatorManipulatorDeviceDriver extends AbstractOpcDevi notCreateInstMessage = "universal_notCreateInstMessage1"; throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); } - SiemensConveyorDeviceDriver siemensConveyorDeviceDriver; - if (startDevice.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) { - siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) startDevice.getDeviceDriver(); - if (siemensConveyorDeviceDriver.getMove() != 1) { + BeltConveyorDeviceDriver beltConveyorDeviceDriver; + if (startDevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) { + beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) startDevice.getDeviceDriver(); + if (beltConveyorDeviceDriver.getMove() != 1) { notCreateInstMessage = "universal_notCreateInstMessage2"; return false; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/RgvDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/RgvDeviceDriver.java index d2804ec71..131e769ad 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 @@ -172,43 +172,8 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr to_task = this.itemProtocol.getTo_task(); to_sub_volume_no = this.itemProtocol.getTo_sub_volume_no(); - if (to_sub_volume_no != last_to_sub_volume_no) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_sub_volume_no:" + last_to_sub_volume_no + "->" + to_sub_volume_no); - } - - if (to_command != last_to_command) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_command:" + last_to_command + "->" + to_command); - } - if (to_target != last_to_target) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_target:" + last_to_target + "->" + to_target); - } - if (to_task != last_to_task) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_task:" + last_to_task + "->" + to_task); - } if (mode != last_mode) { requireSucess = false; - logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode); - } - if (move != last_move) { - logServer.deviceItemValue(this.device_code, "move", String.valueOf(move)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + last_move + "->" + move); - } - if (action != last_action) { - logServer.deviceItemValue(this.device_code, "action", String.valueOf(action)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号action:" + last_action + "->" + action); - } - if (error != last_error) { - logServer.deviceItemValue(this.device_code, "error", String.valueOf(error)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error); - } - if (walk_y != last_walk_y) { - logServer.deviceItemValue(this.device_code, "walk_y", String.valueOf(walk_y)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号walk_y:" + last_walk_y + "->" + walk_y); - } - if (task != last_task) { - logServer.deviceItemValue(this.device_code, "task", String.valueOf(task)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + "->" + task); } @@ -243,10 +208,10 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr String remark = ""; ; if (mode != 2) { - remark = remark + "universal_remark2"; + remark = "universal_remark2"; } if (move != 0) { - remark = remark + "universal_remark3"; + remark = "universal_remark3"; } if (task != 0) { remark = remark + LangProcess.msg("universal_remark4"); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/StandardStackerDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/StandardStackerDeviceDriver.java index bdef248cf..644c049b1 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/StandardStackerDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/StandardStackerDeviceDriver.java @@ -8,7 +8,6 @@ import com.alibaba.fastjson.JSONObject; import lombok.Data; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.checkerframework.common.value.qual.StringVal; import org.nl.acs.common.base.CommonFinalParam; import org.nl.acs.device.domain.Device; import org.nl.acs.device.enums.DeviceType; @@ -33,7 +32,6 @@ import org.nl.acs.opc.DeviceAppServiceImpl; import org.nl.acs.route.service.RouteLineService; import org.nl.acs.route.service.dto.RouteLineDto; import org.nl.acs.route.service.impl.RouteLineServiceImpl; -import org.nl.acs.task.domain.Task; import org.nl.acs.task.service.TaskService; import org.nl.acs.task.service.dto.TaskDto; import org.nl.common.utils.RedisUtils; @@ -71,7 +69,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class); - LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean("luceneExecuteLogServiceImpl"); + LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean("luceneExecuteLogServiceImpl"); public static final String REDIS_MOVE_BOX = "MOVE:MOVE_TASK"; @@ -286,8 +284,6 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme Instruction inst = null; - - @Override public Device getDevice() { return this.device; @@ -321,7 +317,6 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme storage_cache = this.itemProtocol.getItem_storage_cache(); - // 更新指令状态 if (mode == 3 && task > 0) { Date date = new Date(); @@ -390,7 +385,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme case 2: message = "universal_completed"; Instruction instruction = checkInst(); - if (ObjectUtil.isEmpty(instruction)){ + if (ObjectUtil.isEmpty(instruction)) { message = "universal_message4"; break; } @@ -481,18 +476,6 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme Instruction inst = checkInst(); try { finish_instruction(inst); -// if (ObjectUtil.isNotEmpty(redisUtils.get(REDIS_MOVE_BOX))){ -// String taskRedis = redisUtils.get(REDIS_MOVE_BOX).toString(); -// task = Integer.valueOf(taskRedis); -// Instruction instOld = checkInst(); -// List list1 = new ArrayList(); -// pakageCommand(list1, taskRedis); -// pakagePlc(instOld, list1); -// if (ObjectUtil.isNotNull(list1)) { -// this.writing(list1); -// } -// } -// list.remove(0); } catch (Exception e) { e.printStackTrace(); } @@ -570,6 +553,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme /** * 申请更新点位 + * * @param type */ private void applyUpdatePointCode(String type) { @@ -579,7 +563,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme return; } else { Instruction instruction = instructionService.findByCode(String.valueOf(task)); - if (ObjectUtil.isEmpty(instruction)){ + if (ObjectUtil.isEmpty(instruction)) { message = "one_message9"; return; } @@ -605,28 +589,25 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme } if (type.equals(StandarStirageErroEnum.VOIDANCE.getType())) { updateData1(poinCode, instruction, point, split); - pakageData(point, split); + List list = new ArrayList(); + pakageData(list, point, split); } if (type.equals(StandarStirageErroEnum.BLOCK_IN.getType()) || type.equals(StandarStirageErroEnum.FILL.getType())) { updateData2(poinCode, instruction, point, split); - pakageData(point, split); + List list = new ArrayList(); + pakageData(list, point, split); } } - if (StrUtil.isNotEmpty(jo.getString("task_id"))) { - //取货潜货位阻挡做完移库任务 - if (type.equals(StandarStirageErroEnum.BLOCK_OUT.getType())) { - //存缓存 - redisUtils.set(REDIS_MOVE_BOX, task); - TaskDto taskId = taskserver.findById(jo.getString("task_id")); - if (ObjectUtil.isNotEmpty(taskId)) { - String poinCodeMove = taskId.getStart_point_code(); - String[] split = poinCodeMove.split("-"); - Device point = deviceAppService.findDeviceByCode(split[0]); - pakageData(point, split); - } - } + //取货潜货位阻挡做完移库任务 + if (type.equals(StandarStirageErroEnum.BLOCK_OUT.getType())) { + //获取出库指令更新其优先级和状态 + Instruction instruction1 = checkInst(); + instruction1.setPriority("2"); + instruction1.setInstruction_status("0"); + instructionService.update(instruction1); + } - }catch (Exception e){ + } catch (Exception e) { this.requireSucess = true; e.printStackTrace(); } @@ -642,8 +623,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme } } - private void pakageData( Device point, String[] split) { - List list = new ArrayList(); + private void pakageData(List list, Device point, String[] split) { String x = point.getExtraValue().get("x").toString(); String y = split[1]; String z = split[2]; @@ -716,7 +696,6 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme } - /** * 申请任务 * @@ -838,7 +817,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme list.add(map7); } - private void pakageCommand( List list, String inst) { + private void pakageCommand(List list, String inst) { HashMap map1 = new HashMap(); map1.put("code", "to_device_code"); map1.put("value", this.getDevice().getAddress()); 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 51b2e20cf..3808bf0be 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 @@ -204,32 +204,6 @@ public class BlankManipulatorDeviceDriver extends AbstractOpcDeviceDriver implem if (mode != last_mode) { requireSucess = false; - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("信号mode:" + last_mode + "->" + mode) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - if (move != last_move) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("信号move:" + last_move + "->" + move) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - if (action != last_action) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("信号action:" + last_action + "->" + action) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - if (error != last_error) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("信号error:" + last_error + "->" + error) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); } @@ -306,7 +280,7 @@ public class BlankManipulatorDeviceDriver extends AbstractOpcDeviceDriver implem } else { feedMessage = "universal_feedMessage5"; if (mode != 3) { - feedMessage = feedMessage + "universal_feedMessage1"; + feedMessage = "universal_feedMessage1"; } if (action != 5) { feedMessage = feedMessage + "two_message4"; 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 9836d3f23..bd16c2c02 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 @@ -126,34 +126,7 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev if (mode != lastMode) { requireSucess = false; - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(deviceCode) - .content("信号mode:" + lastMode + "->" + mode) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); } - if (move != lastMove) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(deviceCode) - .content("信号move:" + lastMove + "->" + move) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - if (action != lastAction) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(deviceCode) - .content("信号action:" + lastAction + "->" + action) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - if (error != lastError) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(deviceCode) - .content("信号error:" + lastError + "->" + error) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - if (mode == 0) { this.setIsonline(false); 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 c7820ea7e..9483af3e0 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 @@ -120,32 +120,6 @@ public class GreenFoilMachineButtonDriver extends AbstractOpcDeviceDriver implem if (mode != lastMode) { requireSucess = false; - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(deviceCode) - .content("信号mode:" + lastMode + "->" + mode) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - if (move != lastMove) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(deviceCode) - .content("信号move:" + lastMove + "->" + move) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - if (action != lastAction) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(deviceCode) - .content("信号action:" + lastAction + "->" + action) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - if (error != lastError) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(deviceCode) - .content("信号error:" + lastError + "->" + error) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); } if (mode == 0) { 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 31f7ead21..d06d18d70 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 @@ -107,28 +107,6 @@ public class InflatableShaftLibraryDeviceDriver extends AbstractOpcDeviceDriver if (mode != lastMode) { requireSucess = false; - logServer.deviceItemValue(this.deviceCode, "mode", String.valueOf(mode)); - logServer.deviceExecuteLog(this.deviceCode, "", "", "信号mode:" + lastMode + "->" + mode); - } - if (move != lastMove) { - logServer.deviceItemValue(this.deviceCode, "move", String.valueOf(move)); - logServer.deviceExecuteLog(this.deviceCode, "", "", "信号move:" + lastMove + "->" + move); - } - if (action != lastAction) { - logServer.deviceItemValue(this.deviceCode, "action", String.valueOf(action)); - logServer.deviceExecuteLog(this.deviceCode, "", "", "信号action:" + lastAction + "->" + action); - } - if (error != lastError) { - logServer.deviceItemValue(this.deviceCode, "error", String.valueOf(error)); - logServer.deviceExecuteLog(this.deviceCode, "", "", "信号error:" + lastError + "->" + error); - } - if (qty != lastQty) { - logServer.deviceItemValue(this.deviceCode, "weight", String.valueOf(qty)); - logServer.deviceExecuteLog(this.deviceCode, "", "", "信号qty:" + lastQty + "->" + qty); - } - if (type != lastType) { - logServer.deviceItemValue(this.deviceCode, "weight", String.valueOf(type)); - logServer.deviceExecuteLog(this.deviceCode, "", "", "信号type:" + lastType + "->" + type); } lastMode = mode; 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 7a7e821fc..8e979d905 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 @@ -226,13 +226,13 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i remark = remark + "光电信号(move)为有货状态,"; } if (task != 0) { - remark = remark + "universal_remark4"; + remark = "universal_remark4"; if (ObjectUtil.isNotEmpty(this.inst)) { this.inst = null; } } if (requireSucess) { - remark = remark + "universal_remark5"; + remark = "universal_remark5"; } this.setNotCreateTaskMessage(remark); //} @@ -1072,9 +1072,9 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i move = LangProcess.msg("universal_yes"); } - String requireSucess = LangProcess.msg("mark"); + String requireSucess = "0"; if (this.requireSucess) { - requireSucess = LangProcess.msg("no_mark"); + requireSucess = "1"; } jo.put("requireSucess", requireSucess); if (this.getAction() == 1) { @@ -1098,7 +1098,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i 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", LangProcess.msg(message)); + jo.put("message", message); jo.put("notCreateTaskMessage", notCreateTaskMessage); jo.put("notCreateInstMessage", notCreateInstMessage); jo.put("feedMessage", LangProcess.msg(feedMessage)); 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 12428df94..56086f209 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 @@ -192,144 +192,6 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl if (mode != lastMode) { requireSucess = false; - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(deviceCode) - .content("信号mode:" + lastMode + "->" + mode) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - if (move != lastMove) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(deviceCode) - .content("信号move:" + lastMove + "->" + move) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - if (action != lastAction) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(deviceCode) - .content("信号action:" + lastAction + "->" + action) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - if (error != lastError) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(deviceCode) - .content("信号error:" + lastError + "->" + error) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - if (barcode != lastBarcode) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(deviceCode) - .content("信号barcode:" + lastBarcode + "->" + barcode) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - if (weight1 != lastWeight1) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(deviceCode) - .content("信号weight1:" + lastWeight1 + "->" + weight1) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - if (material1 != lastMaterial1) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(deviceCode) - .content("信号material1:" + lastMaterial1 + "->" + material1) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - if (weight2 != lastWeight2) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(deviceCode) - .content("信号weight2:" + lastWeight2 + "->" + weight2) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - if (material2 != lastMaterial2) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(deviceCode) - .content("信号material2:" + lastMaterial2 + "->" + material2) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - if (task != lastTask) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(deviceCode) - .content("信号task:" + lastTask + "->" + task) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - if (size != lastSize) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(deviceCode) - .content("信号size:" + lastSize + "->" + size) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - if (toCommand != lastToCommand) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(deviceCode) - .content("信号to_command:" + lastToCommand + "->" + toCommand) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - if (toMaterial1 != lastToMaterial1) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(deviceCode) - .content("信号to_material1:" + lastToMaterial1 + "->" + toMaterial1) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - if (toMaterial2 != lastToMaterial2) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(deviceCode) - .content("信号to_material2:" + lastToMaterial2 + "->" + toMaterial2) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - if (toQty != lastToQty) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(deviceCode) - .content("信号to_qty:" + lastToQty + "->" + toQty) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - if (toQzzType != lastToQzzType) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(deviceCode) - .content("信号to_qzz_type:" + lastToQzzType + "->" + toQzzType) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - if (toVolumn1 != lastToVolumn1) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(deviceCode) - .content("信号to_volumn1:" + lastToVolumn1 + "->" + toVolumn1) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - if (toVolumn2 != lastToVolumn2) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(deviceCode) - .content("信号to_volumn1:" + lastToVolumn2 + "->" + toVolumn2) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - if (toSize1 != lastToSize1) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(deviceCode) - .content("信号to_size1:" + lastToSize1 + "->" + toSize1) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - if (toSize2 != lastToSize2) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(deviceCode) - .content("信号to_size2:" + lastToSize2 + "->" + toSize2) - .build(); - luceneExecuteLogService.deviceExecuteLog(logDto); } 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 1dfafe494..1ff2f8de5 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 @@ -183,61 +183,11 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp xPosition = this.itemProtocol.getX_position(); yPosition = this.itemProtocol.getY_position(); - if (toOnset != lastToOnset) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_onset:" + lastToOnset + "->" + toOnset); - } - if (toCommand != lastToCommand) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_command:" + lastToCommand + "->" + toCommand); - } - if (toTarget != lastToTarget) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_target:" + lastToTarget + "->" + toTarget); - } - if (toTask != lastToTask) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_task:" + lastToTask + "->" + toTask); - } - if (toPull != lastToPull) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_pull:" + lastToPull + "->" + toPull); - } - if (toSleeve != lastToSleeve) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_sleeve:" + lastToSleeve + "->" + toSleeve); - } - if (toSize != lastToSize) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_size:" + lastToSize + "->" + toSize); - } if (mode != lastMode) { requireSucess = false; - logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + lastMode + "->" + mode); - } - if (move != lastMove) { - logServer.deviceItemValue(this.device_code, "move", String.valueOf(move)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + lastMove + "->" + move); - } - if (action != lastAction) { - logServer.deviceItemValue(this.device_code, "action", String.valueOf(action)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号action:" + lastAction + "->" + action); - } - if (error != lastError) { - logServer.deviceItemValue(this.device_code, "error", String.valueOf(error)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + lastError + "->" + error); - } - if (walkY != lastWalkY) { - logServer.deviceItemValue(this.device_code, "walkY", String.valueOf(walkY)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号walk_y:" + lastWalkY + "->" + walkY); - } - if (task != lastTask) { - logServer.deviceItemValue(this.device_code, "task", String.valueOf(task)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + lastTask + "->" + task); - } - if (xPosition != lastXPosition) { - logServer.deviceItemValue(this.device_code, "x_position", String.valueOf(xPosition)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号x_position:" + lastXPosition + "->" + xPosition); - } - if (yPosition != lastYPosition) { - logServer.deviceItemValue(this.device_code, "y_position", String.valueOf(yPosition)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号y_position:" + lastYPosition + "->" + yPosition); } + // 更新指令状态 if (mode == 3 && task > 0) { Date date = new Date(); @@ -271,12 +221,13 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp Map map = new LinkedHashMap<>(); if (ObjectUtil.isNotEmpty(dto)){ String interaction_json = dto.getInteraction_json(); - JSONObject jsonObject = (JSONObject) JSONObject.toJSON(interaction_json); - map.put("to_pull", jsonObject.getString("is_pulling")); - map.put("is_bushing", jsonObject.getString("is_bushing")); - map.put("to_size", jsonObject.getString("size")); - map.put("to_barcode", jsonObject.getString("")); - map.put("to_command", "5"); + if (ObjectUtil.isNotEmpty(interaction_json)){ + JSONObject jsonObject = (JSONObject) JSONObject.toJSON(interaction_json); + map.put("to_pull", jsonObject.getString("is_pulling")); + map.put("is_bushing", jsonObject.getString("is_bushing")); + map.put("to_size", jsonObject.getString("qzz_size")); + map.put("to_barcode", jsonObject.getString("qzz_no")); + } } map.put("to_command", "5"); this.writing(map); @@ -325,19 +276,19 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp //if (!requireSucess) { String remark = ""; if (mode != 2) { - remark = remark + "universal_remark2"; + remark = "universal_remark2"; } if (move != 0) { - remark = remark + "universal_remark3"; + remark = "universal_remark3"; } if (task != 0) { - remark = remark + "universal_remark4"; + remark = "universal_remark4"; if (ObjectUtil.isNotEmpty(this.inst)) { this.inst = null; } } if (requireSucess) { - remark = remark + "universal_remark5"; + remark = "universal_remark5"; } this.setNotCreateTaskMessage(remark); //} @@ -404,11 +355,21 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp } String startAddr = startDevice.getExtraValue().get("address").toString(); String nextAddr = nextDevice.getExtraValue().get("address").toString(); + String interaction_json = taskDto.getInteraction_json(); + JSONObject jsonObject = JSONObject.parseObject(interaction_json); +// Object isBushing = jsonObject.get("is_bushing"); +// Object isPulling = jsonObject.get("is_pulling"); +// Object qzzNo = jsonObject.get("qzz_no"); +// Object qzzSize = jsonObject.get("qzz_size"); Map map = new LinkedHashMap<>(); map.put("to_command", CommonFinalParam.ONE); map.put("to_onset", startAddr); - map.put("to_task", instruction.getInstruction_code()); map.put("to_target", nextAddr); + map.put("to_task", instruction.getInstruction_code()); +// map.put("to_pull", isPulling); +// map.put("to_bushing", isBushing); +// map.put("to_size", qzzSize); +// map.put("to_barcode", qzzNo); this.writing(map); this.setRequireSucess(true); return true; @@ -482,11 +443,21 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp } String startAddr = startDevice.getExtraValue().get("address").toString(); String nextAddr = nextDevice.getExtraValue().get("address").toString(); +// String interactionJson = task.getInteraction_json(); +// JSONObject jsonObject = JSONObject.parseObject(interactionJson); +// Object isBushing = jsonObject.get("is_bushing"); +// Object isPulling = jsonObject.get("is_pulling"); +// Object qzzNo = jsonObject.get("qzz_no"); +// Object qzzSize = jsonObject.get("qzz_size"); Map map = new LinkedHashMap<>(); map.put("to_command", CommonFinalParam.ONE); map.put("to_onset", startAddr); map.put("to_task", instdto.getInstruction_code()); map.put("to_target", nextAddr); +// map.put("to_pull", isPulling); +// map.put("to_bushing", isBushing); +// map.put("to_size", qzzSize); +// map.put("to_barcode", qzzNo); this.writing(map); this.setRequireSucess(true); notCreateInstMessage = ""; 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 28d3d20b9..950a0d941 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 @@ -170,54 +170,8 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp x_position = this.itemProtocol.getX_position(); y_position = this.itemProtocol.getY_position(); - if (to_onset != last_to_onset) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_onset:" + last_to_onset + "->" + to_onset); - } - if (to_command != last_to_command) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_command:" + last_to_command + "->" + to_command); - } - if (to_target != last_to_target) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_target:" + last_to_target + "->" + to_target); - } - if (to_task != last_to_task) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_task:" + last_to_task + "->" + to_task); - } if (mode != last_mode) { requireSucess = false; - logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode); - } - if (move != last_move) { - logServer.deviceItemValue(this.device_code, "move", String.valueOf(move)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + last_move + "->" + move); - } - if (action != last_action) { - logServer.deviceItemValue(this.device_code, "action", String.valueOf(action)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号action:" + last_action + "->" + action); - } - if (error != last_error) { - logServer.deviceItemValue(this.device_code, "error", String.valueOf(error)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error); - } - if (walk_y != last_walk_y) { - logServer.deviceItemValue(this.device_code, "walk_y", String.valueOf(walk_y)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号walk_y:" + last_walk_y + "->" + walk_y); - } - if (task != last_task) { - logServer.deviceItemValue(this.device_code, "task", String.valueOf(task)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + "->" + task); - } - if (x_position != last_x_position) { - logServer.deviceItemValue(this.device_code, "x_position", String.valueOf(x_position)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号x_position:" + last_x_position + "->" + x_position); - } - if (y_position != last_y_position) { - logServer.deviceItemValue(this.device_code, "y_position", String.valueOf(y_position)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号y_position:" + last_y_position + "->" + y_position); - } - if (weight != last_weight) { - logServer.deviceItemValue(this.device_code, "weight", String.valueOf(weight)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号weight:" + last_weight + "->" + weight); } // 更新指令状态 @@ -329,13 +283,13 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp remark = remark + "光电信号(move)为有货状态,"; } if (task != 0) { - remark = remark + "universal_remark4"; + remark = "universal_remark4"; if (ObjectUtil.isNotEmpty(this.inst)) { this.inst = null; } } if (requireSucess) { - remark = remark + "universal_remark5"; + remark = "universal_remark5"; } this.setNotCreateTaskMessage(remark); //} 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 6f13ce098..4c1504068 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 @@ -163,8 +163,6 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl heartbeat = this.itemProtocol.getHeartbeat(); if (mode != last_mode) { requireSucess = false; - logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode); } if (mode == 3 && task > 0 && !requireSucess) { @@ -218,7 +216,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl if (!requireSucess) { String remark = ""; if (mode != 2) { - remark = remark + "universal_remark2"; + remark = "universal_remark2"; } if (move1 != 0) { remark = remark + "universal_remark6"; @@ -227,7 +225,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl remark = remark + "universal_remark7"; } if (task != 0) { - remark = remark + "universal_remark4"; + remark = "universal_remark4"; } this.setNotCreateTaskMessage(remark); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/subvolume_weighing_station/SubvolumeWeighingStationDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/subvolume_weighing_station/SubvolumeWeighingStationDriver.java index 6c7cf3a2d..61448083c 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/subvolume_weighing_station/SubvolumeWeighingStationDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/subvolume_weighing_station/SubvolumeWeighingStationDriver.java @@ -86,24 +86,6 @@ public class SubvolumeWeighingStationDriver extends AbstractOpcDeviceDriver impl weight = this.itemProtocol.getItem_weight(); if (mode != last_mode) { requireSucess = false; - logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode); - } - if (move != last_move) { - logServer.deviceItemValue(this.device_code, "move", String.valueOf(move)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + last_move + "->" + move); - } - if (action != last_action) { - logServer.deviceItemValue(this.device_code, "action", String.valueOf(action)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号action:" + last_action + "->" + action); - } - if (error != last_error) { - logServer.deviceItemValue(this.device_code, "error", String.valueOf(error)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error); - } - if (weight != last_weight) { - logServer.deviceItemValue(this.device_code, "weight", String.valueOf(weight)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号weight:" + last_weight + "->" + weight); } 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 1275fbbe1..e07dbb7bf 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 @@ -101,28 +101,6 @@ public class WasteFoilWeighingStationDriver extends AbstractOpcDeviceDriver impl if (mode != last_mode) { requireSucess = false; this.setFeedbackSucess(false); - logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode); - } - if (move != last_move) { - logServer.deviceItemValue(this.device_code, "move", String.valueOf(move)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + last_move + "->" + move); - } - if (action != last_action) { - logServer.deviceItemValue(this.device_code, "action", String.valueOf(action)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号action:" + last_action + "->" + action); - } - if (error != last_error) { - logServer.deviceItemValue(this.device_code, "error", String.valueOf(error)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error); - } - if (weight != last_weight) { - logServer.deviceItemValue(this.device_code, "weight", String.valueOf(weight)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号weight:" + last_weight + "->" + weight); - } - if (old_weight != last_old_weight) { - logServer.deviceItemValue(this.device_code, "old_weight", String.valueOf(old_weight)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号old_weight:" + last_old_weight + "->" + old_weight); } if (mode == 0) { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java index a387ec0c4..f158dceb0 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java @@ -341,8 +341,6 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { jo.put("size", JSONUtil.toJsonStr(size)); jo.put("version", JSONUtil.toJsonStr(version)); jo.put("bushing_num", JSONUtil.toJsonStr(bushing_num)); - - if (!StrUtil.isEmpty(ext_task_id)) { jo.put("ext_task_id", ext_task_id); } @@ -587,8 +585,8 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { jo.put("device_code", boxManipulatorDeviceDriver.getDevice().getDevice_code()); jo.put("device_name", boxManipulatorDeviceDriver.getDevice().getDevice_name()); jo.put("status", Math.min(3, boxManipulatorDeviceDriver.getMode())); - jo.put("x", boxManipulatorDeviceDriver.getX_position()); - jo.put("y", boxManipulatorDeviceDriver.getY_position()); + jo.put("x", boxManipulatorDeviceDriver.getX()); + jo.put("y", boxManipulatorDeviceDriver.getY()); jo.put("mode", boxManipulatorDeviceDriver.getMode()); jo.put("move", boxManipulatorDeviceDriver.getMove()); jo.put("action", boxManipulatorDeviceDriver.getAction()); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/InstructionService.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/InstructionService.java index 96384d487..39346beda 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/InstructionService.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/InstructionService.java @@ -184,6 +184,9 @@ public interface InstructionService extends CommonService { */ void create(Instruction dto) throws Exception; + + + /** * 创建2 * diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index 0c4f4a588..7f712bc79 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java @@ -1,6 +1,7 @@ package org.nl.acs.instruction.service.impl; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.ListUtil; import cn.hutool.core.date.DateUtil; @@ -12,9 +13,9 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.ObjectUtils; @@ -360,17 +361,21 @@ public class InstructionServiceImpl extends CommonServiceImpl instructionMybatis = instructionMapper.selectList(Wrappers.lambdaQuery(InstructionMybatis.class) + .eq(InstructionMybatis::getTask_code, dto.getTask_code())); + if(CollUtil.isNotEmpty(instructionMybatis) && instructionMybatis.stream().anyMatch(inst -> inst.getStart_device_code() + .equals(start_device_code))){ return; } } @@ -436,7 +441,7 @@ public class InstructionServiceImpl extends CommonServiceImpl shortPathsList = @@ -460,19 +465,19 @@ public class InstructionServiceImpl extends CommonServiceImpl{};信号快照:{}", new Object[]{itemDto.getDevice_code(), itemId, his, value, sb}); if (!itemDto.getItem_code().endsWith("heartbeat") && !itemDto.getItem_code().endsWith("time")) { // 存在上次点位值为null情况 则不记录日志 LuceneLogDto luceneLogDto = new LuceneLogDto(itemDto.getOpc_server_code(), itemDto.getOpc_plc_code(), itemDto.getDevice_code(), itemDto.getItem_code().substring(itemDto.getItem_code().lastIndexOf(".") + 1), - String.valueOf(itemDto.getHis_item_value()), String.valueOf(itemDto.getItem_value())); + String.valueOf(his), String.valueOf(value)); luceneLogDto.setLogType(LogTypeEnum.DEVICE_LOG.getDesc()); log.info("{}", JSON.toJSONString(luceneLogDto)); } -// this.businessLogger.setResource(itemDto.getDevice_code(), itemDto.getDevice_name()).log("信号{}变更从{}->{};信号快照:{}", new Object[]{itemId, his, value, sb}); } else { // if(his instanceof int[]){ // if(!Arrays.equals((long[]) his, (long[]) value)){ @@ -450,11 +434,10 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC // log.warn("设备:{}信号{}变更从{}->{};信号快照:{}", new Object[]{itemDto.getDevice_code(), itemId, his, value}); if (!itemDto.getItem_code().endsWith("heartbeat") && !itemDto.getItem_code().endsWith("time")) { LuceneLogDto luceneLogDto = new LuceneLogDto(itemDto.getOpc_server_code(), itemDto.getOpc_plc_code(), itemDto.getDevice_code(), itemDto.getItem_code().substring(itemDto.getItem_code().lastIndexOf(".") + 1), - String.valueOf(itemDto.getHis_item_value()), String.valueOf(itemDto.getItem_value())); + String.valueOf(his), String.valueOf(value)); luceneLogDto.setLogType(LogTypeEnum.DEVICE_LOG.getDesc()); log.info("{}", JSON.toJSONString(luceneLogDto)); } -// this.businessLogger.setResource(itemDto.getDevice_code(), itemDto.getDevice_name()).log("信号{}变更从{}->{}", new Object[]{itemId, his, value}); } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/opc/OpcUtl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/opc/OpcUtl.java index c8248c93e..87646a162 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/opc/OpcUtl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/opc/OpcUtl.java @@ -161,6 +161,8 @@ public class OpcUtl { return jiVariant.getObject(); } else if (e instanceof Float) { return jiVariant.getObject(); + } else if (e instanceof Double) { + return jiVariant.getObject(); } else { System.err.println(id + "不明类型" + e.getClass()); if (jiVariant.getType() == 0) { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java index 79097032c..586a00b55 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java @@ -16,6 +16,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; +import groovy.lang.Lazy; import lombok.extern.slf4j.Slf4j; import org.jetbrains.annotations.NotNull; import org.nl.acs.AcsConfig; @@ -97,6 +98,7 @@ public class TaskServiceImpl extends CommonServiceImpl impleme private TaskFeedbackService taskFeedbackService; @Autowired private ISysParamService paramService; + @Lazy @Autowired private XianGongAgvService agvService; @Autowired @@ -148,7 +150,7 @@ public class TaskServiceImpl extends CommonServiceImpl impleme list.add(task); } } else { - if (StrUtil.equals(task.getTask_type(), TaskTypeEnum.Inner_Truss_Task.getIndex()) && StrUtil.isNotEmpty(task.getPut_device_code())) { + if (StrUtil.equals(task.getTask_type(), TaskTypeEnum.Truss_Task.getIndex()) && StrUtil.isNotEmpty(task.getPut_device_code())) { Instruction instruction = instructionService.findByDeviceCodeFromCache(task.getNext_device_code()); if (ObjectUtil.isNotEmpty(instruction)) { if (StrUtil.equals(instruction.getStart_device_code(), device_code)) { @@ -1109,7 +1111,8 @@ public class TaskServiceImpl extends CommonServiceImpl impleme CommonFinalParam commonFinalParam = new CommonFinalParam(); if (StrUtil.contains(start_point_code, commonFinalParam.getBARRE()) && StrUtil.count(start_point_code, commonFinalParam.getBARRE()) == 2) { String[] start_point = start_point_code.split(commonFinalParam.getBARRE()); - task.setFrom_x(start_point[0]); + Device starPoint = deviceAppService.findDeviceByCode(start_point[0]); + task.setFrom_x(starPoint.getExtraValue().get("x").toString()); task.setStart_device_code(start_point[0]); if (Integer.parseInt(start_point[1]) < 10 && start_point[1].length() == 1) { from_y = "0" + start_point[1]; @@ -1161,7 +1164,8 @@ public class TaskServiceImpl extends CommonServiceImpl impleme } else { from_z = task.getFrom_z(); } - task.setFrom_x(start_point_code); + Device starPoint = deviceAppService.findDeviceByCode(start_point_code); + task.setFrom_x(starPoint.getExtraValue().get("x").toString()); task.setStart_point_code(start_point_code + commonFinalParam.getBARRE() + from_y + commonFinalParam.getBARRE() + from_z); task.setStart_device_code(start_point_code); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/taskscreen/rest/TaskScreenController.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/taskscreen/rest/TaskScreenController.java index 57eb3b726..42244bd43 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/taskscreen/rest/TaskScreenController.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/taskscreen/rest/TaskScreenController.java @@ -23,14 +23,12 @@ public class TaskScreenController { @GetMapping @Log("下拉选设备") - public ResponseEntity selectLedList() { return new ResponseEntity<>(taskScreenService.selectLedList(), HttpStatus.OK); } @GetMapping("/getLedMessage/{device}") @Log("根据关联设备获取任务信息") - public ResponseEntity getLedMessage(@PathVariable String device) { return new ResponseEntity<>(taskScreenService.getLedMessage(device), HttpStatus.OK); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/taskscreen/service/impl/TaskScreenServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/taskscreen/service/impl/TaskScreenServiceImpl.java index 87b71c161..95b6d0f4c 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/taskscreen/service/impl/TaskScreenServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/taskscreen/service/impl/TaskScreenServiceImpl.java @@ -18,6 +18,7 @@ import org.nl.acs.device.service.dto.DeviceDto; import org.nl.acs.device.service.mapper.DeviceExtraMapper; import org.nl.acs.device.service.mapper.DeviceMapper; import org.nl.acs.device_driver.conveyor.belt_conveyor.BeltConveyorDeviceDriver; +import org.nl.acs.device_driver.one_conveyor.scanner_weight_conveyor.ConveyorWithScannerWeightDeviceDriver; import org.nl.acs.opc.DeviceAppService; import org.nl.acs.taskscreen.mapper.TaskScreenMapper; import org.nl.acs.taskscreen.service.TaskScreenService; @@ -30,7 +31,7 @@ import java.util.List; /** * @author tuqiang - * @date 2023-05-09 + * @date 2023-12-09 */ @Service @AllArgsConstructor @@ -85,11 +86,11 @@ public class TaskScreenServiceImpl extends CommonServiceImpl - + ${LOG_HOME}/一楼NDC系统/%d{yyyy-MM-dd}.%i.log @@ -28,6 +28,6 @@ - + diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/log/TwoNDCSocketConnectionAutoRun.xml b/acs2/nladmin-system/nlsso-server/src/main/resources/log/TwoNDCSocketConnectionAutoRun.xml new file mode 100644 index 000000000..63517b12f --- /dev/null +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/log/TwoNDCSocketConnectionAutoRun.xml @@ -0,0 +1,33 @@ + + + + + + + + + ${LOG_HOME}/二楼NDC系统/%d{yyyy-MM-dd}.%i.log + + 15 + + 200MB + + 2GB + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + ${log.charset} + + + + + + + + + + + diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml b/acs2/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml index 5e8238e7f..f53004205 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml @@ -20,6 +20,7 @@ https://juejin.cn/post/6844903775631572999 + diff --git a/acs2/nladmin-ui/public/config.js b/acs2/nladmin-ui/public/config.js index ce714251a..4f5976990 100644 --- a/acs2/nladmin-ui/public/config.js +++ b/acs2/nladmin-ui/public/config.js @@ -3,7 +3,7 @@ window.g = { VUE_APP_BASE_API: 'http://127.0.0.1:8011' }, prod: { - VUE_APP_BASE_API: 'http://127.0.0.1:8011' + VUE_APP_BASE_API: 'http://10.1.3.96:8011' } } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/st/rest/StructivtController.java b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/st/rest/StructivtController.java index bd0b2b469..c5b40bc46 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/st/rest/StructivtController.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/st/rest/StructivtController.java @@ -39,6 +39,7 @@ public class StructivtController { //@PreAuthorize("@el.check('structivt:list')") public ResponseEntity query(@RequestParam Map whereJson, Pageable page, String[] product_area, String[] ivt_flag) { return new ResponseEntity<>(structivtService.queryAll(whereJson, page, product_area, ivt_flag), HttpStatus.OK); + } @PostMapping diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/st/service/impl/StructattrServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/st/service/impl/StructattrServiceImpl.java index e7bd880af..3fe0b3eef 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/st/service/impl/StructattrServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/st/service/impl/StructattrServiceImpl.java @@ -28,10 +28,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.function.BiConsumer; import java.util.stream.Collectors; @@ -541,8 +538,9 @@ public class StructattrServiceImpl implements StructattrService { int createNum = whereJson.getIntValue("num"); // 开始生成数 int createNum_start = 1; + // 前缀 - String prefix = whereJson.getString("prefix"); + String prefix = ""; if (ObjectUtil.isNotEmpty(jsonAttr)) { String struct_code = jsonAttr.getString("struct_code"); @@ -559,6 +557,21 @@ public class StructattrServiceImpl implements StructattrService { createNum_start += Integer.parseInt(result); prefix = struct_code.substring(0, firstIndex); + } else { + // 截取第一个 - 之前的数据集合 + + List attrList = WQL.getWO("QST_STRUCT_ATTR").addParam("flag", "2").process() + .getResultJSONArray(0).toJavaList(JSONObject.class); + + List subStringList = attrList.stream() + .filter(row -> row.getString("struct_code").contains("-")) + .map(row -> row.getString("struct_code").substring(0, row.getString("struct_code").indexOf("-"))) + .distinct() + .sorted() + .filter(row -> row.matches("-?\\d+(\\.\\d+)?")) + .collect(Collectors.toList()); + + prefix = String.valueOf(Integer.parseInt(subStringList.get(subStringList.size() - 1)) + 1); } /* @@ -651,13 +664,16 @@ public class StructattrServiceImpl implements StructattrService { /* * 判断前缀是否存在 */ - List attrList = attrTab.query("1 = 1").getResultJSONArray(0).toJavaList(JSONObject.class); + List attrList = WQL.getWO("QST_STRUCT_ATTR").addParam("flag", "2").process() + .getResultJSONArray(0).toJavaList(JSONObject.class); // 截取第一个 - 之前的数据集合 List subStringList = attrList.stream() .filter(row -> row.getString("struct_code").contains("-")) .map(row -> row.getString("struct_code").substring(0, row.getString("struct_code").indexOf("-"))) .distinct() + .sorted() + .filter(row -> row.matches("-?\\d+(\\.\\d+)?")) .collect(Collectors.toList()); // 判断是否有相同的前缀 diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/st/wql/QST_STRUCT_ATTR.wql b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/st/wql/QST_STRUCT_ATTR.wql index a90e95868..29a15aa70 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/st/wql/QST_STRUCT_ATTR.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/st/wql/QST_STRUCT_ATTR.wql @@ -86,5 +86,19 @@ ENDPAGEQUERY ENDIF + IF 输入.flag = "2" + QUERY + SELECT + struct.* + FROM + st_ivt_structattr struct + LEFT JOIN st_ivt_sectattr sect ON sect.sect_id = struct.sect_id + WHERE + sect.sect_type_attr = '09' + + ENDSELECT + ENDQUERY + ENDIF + diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/st/wql/stivt.xls b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/st/wql/stivt.xls index 2a54c742c..706870f48 100644 Binary files a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/st/wql/stivt.xls and b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/st/wql/stivt.xls differ diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/CheckOutBillService.java b/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/CheckOutBillService.java index 20f1c8e0e..f1cf33c5a 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/CheckOutBillService.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/CheckOutBillService.java @@ -295,4 +295,12 @@ public interface CheckOutBillService { * @throws IOException / */ void download(Map map, HttpServletResponse response, String[] stor_id, String[] bill_status, String[] bill_type) throws IOException; + + /** + * 更新是否超期 + * @param whereJson { + * 主表数据 + * } + */ + JSONObject updataIsOverdue(JSONObject whereJson); } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/instor/service/impl/ProductScrapServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/st/instor/service/impl/ProductScrapServiceImpl.java index 9d1f70e4a..3d19d9243 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/instor/service/impl/ProductScrapServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/instor/service/impl/ProductScrapServiceImpl.java @@ -479,6 +479,10 @@ public class ProductScrapServiceImpl implements ProductScrapService { .addParam("flag", "3").addParam("stor_id", stor_id).addParam("in_stor_id",in_stor_id) .process().getResultJSONArray(0).toJavaList(JSONObject.class); + // 查询不合格品来源字典 + List dictList = WQL.getWO("QST_IVT_PRODUCTSCRAP").addParam("flag", "3") + .process().getResultJSONArray(0).toJavaList(JSONObject.class); + // 循环获取的数据 ArrayList resultList = new ArrayList<>(); for (int i = 0; i < read.size(); i++) { @@ -488,10 +492,14 @@ public class ProductScrapServiceImpl implements ProductScrapService { String pcsn = list.get(0).toString(); // sap批次号 String sap_pcsn = list.get(1).toString(); - // 木箱号 +/* // 木箱号 String box_no = list.get(2).toString(); // 重量 - String qty = list.get(3).toString(); + String qty = list.get(3).toString();*/ + // 不合格品来源 + String fail_source = list.get(4).toString(); + // 不合格描述 + String remark = list.get(5).toString(); // 子卷号和批次号必须有一个不为空 if (ObjectUtil.isEmpty(pcsn) && ObjectUtil.isEmpty(sap_pcsn)) { @@ -513,6 +521,22 @@ public class ProductScrapServiceImpl implements ProductScrapService { .filter(row -> row.getString("storagevehicle_code").equals(json.getString("storagevehicle_code"))) .collect(Collectors.toList()); + // 匹配不合格品来源 + String value = ""; + List label = dictList.stream() + .filter(row -> row.getString("label").equals(fail_source)) + .collect(Collectors.toList()); + + if (ObjectUtil.isNotEmpty(label)) { + value = label.get(0).getString("value"); + } + // 插入不合格品来源、不合格品描述 + String finalValue = value; + boxList.forEach(row -> { + row.put("fail_source", finalValue); + row.put("remark",remark); + }); + resultList.addAll(boxList); } } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/instor/wql/QST_IVT_PRODUCTSCRAP.wql b/lms/nladmin-system/src/main/java/org/nl/wms/st/instor/wql/QST_IVT_PRODUCTSCRAP.wql index d3dcb1ca1..cae98e5cd 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/instor/wql/QST_IVT_PRODUCTSCRAP.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/instor/wql/QST_IVT_PRODUCTSCRAP.wql @@ -109,4 +109,16 @@ order by dtl.seq_no ENDSELECT ENDQUERY + ENDIF + + IF 输入.flag = "3" + QUERY + SELECT + * + FROM + sys_dict + WHERE + code = 'FAIL_SOURCE' + ENDSELECT + ENDQUERY ENDIF \ No newline at end of file diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/rest/CheckOutBillController.java b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/rest/CheckOutBillController.java index 800368551..67455fed7 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/rest/CheckOutBillController.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/rest/CheckOutBillController.java @@ -312,4 +312,11 @@ public class CheckOutBillController { public void download(@RequestParam Map map, HttpServletResponse response, String[] stor_id, String[] bill_status, String[] bill_type) throws IOException { checkOutBillService.download(map, response, stor_id, bill_status, bill_type); } + + + @PostMapping("/updataIsOverdue") + @Log("更新是否超期") + public ResponseEntity updataIsOverdue(@RequestBody JSONObject whereJson) { + return new ResponseEntity<>(checkOutBillService.updataIsOverdue(whereJson),HttpStatus.OK); + } } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java index 35440c6c6..185fbcb52 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java @@ -1022,6 +1022,32 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { FileUtil.downloadExcel(list, response); } + @Override + public JSONObject updataIsOverdue(JSONObject whereJson) { + // 出入库主表 + WQLObject mstTab = WQLObject.getWQLObject("st_ivt_iostorinv"); + // 出入库分配明细表 + WQLObject disTab = WQLObject.getWQLObject("st_ivt_iostorinvdis"); + + // 更新主表 + JSONObject jsonMst = mstTab.query("iostorinv_id = '" + whereJson.getString("iostorinv_id") + "'").uniqueResult(0); + jsonMst.put("is_overdue", whereJson.getString("is_overdue")); + mstTab.update(jsonMst); + + // 计算超期数量 + List disList = disTab.query("iostorinvdtl_id = '" + whereJson.getString("iostorinvdtl_id") + "' AND is_overdue = '1'") + .getResultJSONArray(0).toJavaList(JSONObject.class); + + double overdue_qyt = disList.stream() + .map(row -> row.getDoubleValue("plan_qty")) + .reduce(Double::sum).orElse(0.00); + + JSONObject result = new JSONObject(); + result.put("overdue_qyt",overdue_qyt); + result.put("mst", jsonMst); + return result; + } + @Override @Transactional(rollbackFor = Exception.class) public void update(JSONObject whereJson) { @@ -1290,11 +1316,12 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { dtl.put("work_status", "00"); } - // 判断是否超期 - if (ivt2.getString("is_overdue").equals("1")) { - dtl.put("work_status", "01"); + if (jo_mst.getString("is_overdue").equals("1")) { + // 判断是否超期 + if (ivt2.getString("is_overdue").equals("1")) { + dtl.put("work_status", "01"); + } } - wo_dis.insert(dtl); } //记录需锁定的仓位 @@ -1358,9 +1385,12 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { } // 判断是否超期 - if (jsonIvt.getString("is_overdue").equals("1")) { - dtl.put("work_status", "01"); + if (jo_mst.getString("is_overdue").equals("1")) { + if (jsonIvt.getString("is_overdue").equals("1")) { + dtl.put("work_status", "01"); + } } + wo_dis.insert(dtl); //记录需锁定的仓位 (如果此明细有相同物料的且子卷号不能为空的则在最后一个明细分配完成后锁定仓位) @@ -1534,6 +1564,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { dtl.put("is_issued", "0"); dtl.put("plan_qty", ivt2.getDoubleValue("change_qty")); dtl.put("real_qty", ivt2.getDoubleValue("change_qty")); + dtl.put("is_overdue", ivt2.getString("is_overdue")); dtl.put("instorage_time", ivt2.getString("instorage_time")); // 如果所属仓位是虚拟区 则将分配明细状态变为生成 JSONObject jsonSect = wo_sect.query("sect_id = '" + ivt2.getString("sect_id") + "'").uniqueResult(0); @@ -1542,6 +1573,14 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { } else { dtl.put("work_status", "00"); } + + if (jo_mst.getString("is_overdue").equals("1")) { + // 判断是否超期 + if (ivt2.getString("is_overdue").equals("1")) { + dtl.put("work_status", "01"); + } + } + wo_dis.insert(dtl); } //记录需锁定的仓位 @@ -1594,6 +1633,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { dtl.put("is_issued", "0"); dtl.put("plan_qty", jsonIvt.getDoubleValue("change_qty")); dtl.put("real_qty", jsonIvt.getDoubleValue("change_qty")); + dtl.put("is_overdue", jsonIvt.getString("is_overdue")); dtl.put("instorage_time", jsonIvt.getString("instorage_time")); // 如果所属仓位是虚拟区 则将分配明细状态变为生成 JSONObject jsonSect = wo_sect.query("sect_id = '" + jsonIvt.getString("sect_id") + "'").uniqueResult(0); @@ -1602,6 +1642,14 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { } else { dtl.put("work_status", "00"); } + + if (jo_mst.getString("is_overdue").equals("1")) { + // 判断是否超期 + if (jsonIvt.getString("is_overdue").equals("1")) { + dtl.put("work_status", "01"); + } + } + wo_dis.insert(dtl); //记录需锁定的仓位 Struct_map.put(jsonIvt.getString("struct_id"), jsonIvt); @@ -1658,6 +1706,8 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { json.put("is_issued", "0"); json.put("plan_qty", ivt.getDoubleValue("change_qty")); json.put("real_qty", ivt.getDoubleValue("change_qty")); + json.put("is_overdue", ivt.getString("is_overdue")); + json.put("instorage_time", ivt.getString("instorage_time")); // 如果所属仓位是虚拟区 则将分配明细状态变为生成 JSONObject jsonSect = wo_sect.query("sect_id = '" + ivt.getString("sect_id") + "'").uniqueResult(0); if (StrUtil.equals(jsonSect.getString("sect_type_attr"), "09")) { @@ -1665,6 +1715,14 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { } else { json.put("work_status", "00"); } + + // 判断是否超期 + if (jo_mst.getString("is_overdue").equals("1")) { + if (ivt.getString("is_overdue").equals("1")) { + json.put("work_status", "01"); + } + } + wo_dis.insert(json); // 更新明细 @@ -4384,6 +4442,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { dtl.put("is_issued", "0"); dtl.put("plan_qty", ivt.getDoubleValue("change_qty")); dtl.put("real_qty", ivt.getDoubleValue("change_qty")); + dtl.put("is_overdue", ivt.getString("is_overdue")); dtl.put("instorage_time", ivt.getString("instorage_time")); // 如果所属仓位是虚拟区 则将分配明细状态变为生成 JSONObject jsonSect = wo_sect.query("sect_id = '" + ivt.getString("sect_id") + "'").uniqueResult(0); @@ -4392,6 +4451,14 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { } else { dtl.put("work_status", "00"); } + + // 判断是否超期 + if (jo_mst.getString("is_overdue").equals("1")) { + if (ivt.getString("is_overdue").equals("1")) { + dtl.put("work_status", "01"); + } + } + wo_dis.insert(dtl); //记录需锁定的仓位 Struct_map.put(ivt.getString("struct_id"), ivt); @@ -4453,6 +4520,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { json.put("is_issued", "0"); json.put("plan_qty", ivt.getDoubleValue("change_qty")); json.put("real_qty", ivt.getDoubleValue("change_qty")); + json.put("is_overdue", ivt.getString("is_overdue")); json.put("instorage_time", ivt.getString("instorage_time")); // 如果所属仓位是虚拟区 则将分配明细状态变为生成 JSONObject jsonSect = wo_sect.query("sect_id = '" + ivt.getString("sect_id") + "'").uniqueResult(0); @@ -4461,6 +4529,14 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { } else { json.put("work_status", "00"); } + + // 判断是否超期 + if (jo_mst.getString("is_overdue").equals("1")) { + if (ivt.getString("is_overdue").equals("1")) { + json.put("work_status", "01"); + } + } + wo_dis.insert(json); // 更新明细 @@ -4585,8 +4661,12 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { dis.put("bill_code", jo_mst.getString("bill_code")); dis.put("bill_table", "ST_IVT_IOStorInv"); - if (dis.getString("is_overdue").equals("1")) { - storPublicService.IOStor(dis, "12"); + if (jo_mst.getString("is_overdue").equals("1")) { + if (dis.getString("is_overdue").equals("1")) { + storPublicService.IOStor(dis, "12"); + } else { + storPublicService.IOStor(dis, "21"); + } } else { storPublicService.IOStor(dis, "21"); } @@ -4596,15 +4676,23 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { from_start.put("struct_id", dis.getString("struct_id")); from_start.put("lock_type", "1"); from_start.put("is_overdue", dis.getString("is_overdue")); - if (dis.getString("is_overdue").equals("1")) { - from_start.put("storagevehicle_code", dis.getString("box_no")); + + if (jo_mst.getString("is_overdue").equals("1")) { + if (dis.getString("is_overdue").equals("1")) { + from_start.put("storagevehicle_code", dis.getString("box_no")); + } else { + from_start.put("storagevehicle_code", ""); + } } else { from_start.put("storagevehicle_code", ""); } + storPublicService.updateStructAndPoint(from_start); - if (dis.getString("is_overdue").equals("1")) { - continue; + if (jo_mst.getString("is_overdue").equals("1")) { + if (dis.getString("is_overdue").equals("1")) { + continue; + } } //查询对应明细 @@ -4664,7 +4752,14 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { } JSONObject mst_row = mst_wql.query("iostorinv_id = '" + iostorinv_id + "'").uniqueResult(0); - JSONArray dis_rows = dis_wql.query("iostorinv_id = '" + iostorinv_id + "' and is_overdue = '0'").getResultJSONArray(0); + + JSONArray dis_rows = new JSONArray(); + + if (jo_mst.getString("is_overdue").equals("1")) { + dis_rows = dis_wql.query("iostorinv_id = '" + iostorinv_id + "' and is_overdue = '0'").getResultJSONArray(0); + } else { + dis_rows = dis_wql.query("iostorinv_id = '" + iostorinv_id + "'").getResultJSONArray(0); + } //生成手工入库单 String new_iostorinv_id = IdUtil.getSnowflake(1, 1).nextId() + ""; @@ -4767,7 +4862,13 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { if ("1003".equals(out_jo.getString("bill_type")) || "1006".equals(out_jo.getString("bill_type"))) { //如果为返检出库或者改切出库删除对应的包装关系 - JSONArray dis_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinv_id = '" + iostorinv_id + "' and is_overdue = '0'").getResultJSONArray(0); + JSONArray dis_rows = new JSONArray(); + if (jo_mst.getString("is_overdue").equals("1")) { + dis_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinv_id = '" + iostorinv_id + "' and is_overdue = '0'").getResultJSONArray(0); + } else { + dis_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinv_id = '" + iostorinv_id + "'").getResultJSONArray(0); + } + for (int i = 0; i < dis_rows.size(); i++) { JSONObject dis_row = dis_rows.getJSONObject(i); String sect_code = dis_row.getString("sect_code"); @@ -5329,12 +5430,15 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { // 回传sap JSONObject jsonMst = mstTab.query("iostorinv_id = '" + whereJson.getString("iostorinv_id") + "'").uniqueResult(0); - JSONArray jsonArr = new JSONArray(); - jsonArr.add(jsonMst); + // 判断单据是否是完成状态:只回传完成状态的单据 + if (jsonMst.getString("bill_status").equals("99")) { + JSONArray jsonArr = new JSONArray(); + jsonArr.add(jsonMst); - JSONObject param = new JSONObject(); - param.put("rows", jsonArr); - inAndOutReturnService.uploadSAP(param); + JSONObject param = new JSONObject(); + param.put("rows", jsonArr); + inAndOutReturnService.uploadSAP(param); + } } @Override diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/QST_IVT_CHECKOUTBILL.wql b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/QST_IVT_CHECKOUTBILL.wql index 9f3c310f5..7a3c9cb0f 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/QST_IVT_CHECKOUTBILL.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/QST_IVT_CHECKOUTBILL.wql @@ -97,6 +97,7 @@ cu.cust_simple_name, a.plan_qty, attr.stor_name AS out_stor_name + FROM ST_IVT_IOStorInv ios LEFT JOIN md_cs_customerbase cu ON ios.cust_code = cu.cust_code @@ -106,15 +107,32 @@ LEFT JOIN pdm_bi_subpackagerelationrecord sub ON sub.container_name = dis.pcsn AND dis.box_no = sub.package_box_sn AND sub.bill_code = ios.bill_code LEFT JOIN ( SELECT - SUM(a.assign_qty) AS plan_qty, + SUM(a.plan_qty) AS plan_qty, a.iostorinv_id FROM - st_ivt_iostorinvdtl a + st_ivt_iostorinvdis a LEFT JOIN ST_IVT_IOStorInv b ON a.iostorinv_id = b.iostorinv_id WHERE b.io_type = '1' and b.is_delete='0' + and a.is_overdue = '0' + and b.is_overdue = '1' GROUP BY a.iostorinv_id + + UNION + + SELECT + SUM(a.plan_qty) AS plan_qty, + a.iostorinv_id + FROM + st_ivt_iostorinvdis a + LEFT JOIN ST_IVT_IOStorInv b ON a.iostorinv_id = b.iostorinv_id + WHERE + b.io_type = '1' + and b.is_delete='0' + and b.is_overdue = '0' + GROUP BY a.iostorinv_id + ) a ON a.iostorinv_id = ios.iostorinv_id WHERE ios.io_type = '1' @@ -369,7 +387,14 @@ struct.storagevehicle_id, struct.storagevehicle_code, point.point_id, - sub.sap_pcsn + sub.sap_pcsn, + CASE + WHEN SUBSTRING(sub.container_name,1,1) = 'B' AND DATEDIFF( NOW(), sub.date_of_production ) > '180' + THEN '1' + WHEN SUBSTRING(sub.container_name,1,1) != 'B' AND DATEDIFF( NOW(), sub.date_of_production ) > '90' + THEN '1' + ELSE '0' + END AS is_overdue FROM ST_IVT_StructIvt ivt LEFT JOIN st_ivt_structattr struct ON struct.struct_id = ivt.struct_id @@ -437,7 +462,14 @@ struct.storagevehicle_id, struct.storagevehicle_code, point.point_id, - sub.sap_pcsn + sub.sap_pcsn, + CASE + WHEN SUBSTRING(sub.container_name,1,1) = 'B' AND DATEDIFF( NOW(), sub.date_of_production ) > '180' + THEN '1' + WHEN SUBSTRING(sub.container_name,1,1) != 'B' AND DATEDIFF( NOW(), sub.date_of_production ) > '90' + THEN '1' + ELSE '0' + END AS is_overdue FROM ST_IVT_StructIvt ivt2 LEFT JOIN st_ivt_structattr struct ON struct.struct_id = ivt2.struct_id diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/ST_OUTIVT01.wql b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/ST_OUTIVT01.wql index ebd2006ad..189f4aaed 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/ST_OUTIVT01.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/ST_OUTIVT01.wql @@ -62,7 +62,11 @@ attr.struct_name, attr.struct_code, CASE - WHEN DATEDIFF( NOW(), sub.date_of_production ) > '90' THEN '1' ELSE '0' + WHEN SUBSTRING(sub.container_name,1,1) = 'B' AND DATEDIFF( NOW(), sub.date_of_production ) > '180' + THEN '1' + WHEN SUBSTRING(sub.container_name,1,1) != 'B' AND DATEDIFF( NOW(), sub.date_of_production ) > '90' + THEN '1' + ELSE '0' END AS is_overdue FROM ST_IVT_StructIvt ivt @@ -164,7 +168,11 @@ attr.struct_name, attr.struct_code, CASE - WHEN DATEDIFF( NOW(), sub.date_of_production ) > '90' THEN '1' ELSE '0' + WHEN SUBSTRING(sub.container_name,1,1) = 'B' AND DATEDIFF( NOW(), sub.date_of_production ) > '180' + THEN '1' + WHEN SUBSTRING(sub.container_name,1,1) != 'B' AND DATEDIFF( NOW(), sub.date_of_production ) > '90' + THEN '1' + ELSE '0' END AS is_overdue FROM ST_IVT_StructIvt ivt diff --git a/lms/nladmin-ui/src/views/wms/basedata/st/ivt/index.vue b/lms/nladmin-ui/src/views/wms/basedata/st/ivt/index.vue index 5c7ff08f1..329ee1879 100644 --- a/lms/nladmin-ui/src/views/wms/basedata/st/ivt/index.vue +++ b/lms/nladmin-ui/src/views/wms/basedata/st/ivt/index.vue @@ -241,7 +241,7 @@ - + diff --git a/lms/nladmin-ui/src/views/wms/basedata/st/struct/OneCreateDialog.vue b/lms/nladmin-ui/src/views/wms/basedata/st/struct/OneCreateDialog.vue index 5d77938be..f4b5ff0a7 100644 --- a/lms/nladmin-ui/src/views/wms/basedata/st/struct/OneCreateDialog.vue +++ b/lms/nladmin-ui/src/views/wms/basedata/st/struct/OneCreateDialog.vue @@ -25,11 +25,11 @@ - + @@ -126,10 +126,6 @@ export default { return this.crud.notify('库区不能为空', CRUD.NOTIFICATION_TYPE.INFO) } - if (this.formMst.prefix === '') { - return this.crud.notify('前缀不能为空', CRUD.NOTIFICATION_TYPE.INFO) - } - if (this.formMst.num === '') { return this.crud.notify('数量不能为空', CRUD.NOTIFICATION_TYPE.INFO) } diff --git a/lms/nladmin-ui/src/views/wms/st/outbill/DivDialog.vue b/lms/nladmin-ui/src/views/wms/st/outbill/DivDialog.vue index 722081122..5f3cdc1c9 100644 --- a/lms/nladmin-ui/src/views/wms/st/outbill/DivDialog.vue +++ b/lms/nladmin-ui/src/views/wms/st/outbill/DivDialog.vue @@ -143,6 +143,7 @@ 是否异常出库 + + + + + @@ -227,6 +243,7 @@ style="width: 100%;" max-height="400" size="mini" + :row-style="rowStyle" border :highlight-current-row="true" :header-cell-style="{background:'#f5f7fa',color:'#606266'}" @@ -256,7 +273,7 @@ - + @@ -268,7 +285,7 @@ - + @@ -338,7 +355,8 @@ export default { invtypelist: [], pointList: [], rules: { - } + }, + overdue_qyt: 0 } }, watch: { @@ -459,6 +477,7 @@ export default { deleteRow(row) { checkoutbill.oneCancel(row).then(res => { this.queryTableDtl() + this.updataIsOverdue() }) }, handleDtlCurrentChange(current) { @@ -517,6 +536,7 @@ export default { checkoutbill.allDiv(this.mstrow).then(res => { this.crud.notify('分配成功!', CRUD.NOTIFICATION_TYPE.INFO) this.queryTableDtl() + this.updataIsOverdue() this.loadingAlldiv = false }).catch(() => { this.loadingAlldiv = false @@ -532,6 +552,7 @@ export default { this.mstrow.iostorinvdtl_id = this.currentRow.iostorinvdtl_id checkoutbill.allDivOne(this.mstrow).then(res => { this.queryTableDtl() + this.updataIsOverdue() this.loadingAutodiv = false }).catch(() => { this.loadingAutodiv = false @@ -542,6 +563,7 @@ export default { this.loadingAlldiv = true checkoutbill.allCancel(this.mstrow).then(res => { this.queryTableDtl() + this.updataIsOverdue() this.loadingAlldiv = false }).catch(() => { this.loadingAlldiv = false @@ -553,6 +575,7 @@ export default { checkoutbill.allCancel(this.currentRow).then(res => { this.queryTableDtl() this.loadingAlldiv = false + this.updataIsOverdue() }).catch(() => { this.loadingAlldiv = false }) @@ -673,6 +696,10 @@ export default { this.tableDtl = res }) }, + queryTableDtl2() { + this.queryTableDtl() + this.updataIsOverdue() + }, queryTableDdis(iostorinvdtl_id) { checkoutbill.getOutBillDis2({ 'iostorinvdtl_id': iostorinvdtl_id, 'bill_status': '01' }).then(res => { this.tabledis = res @@ -689,6 +716,23 @@ export default { return 'background: yellow' } } + }, + rowStyle({ row, rowIndex }) { + const stylejson = {} + + if (this.rowmst.is_overdue === '1') { + if (row.is_overdue === '1') { + stylejson.background = '#f3f071' + return stylejson + } + } + }, + updataIsOverdue() { + this.rowmst.iostorinvdtl_id = this.currentRow.iostorinvdtl_id + checkoutbill.updataIsOverdue(this.rowmst).then(res => { + this.overdue_qyt = res.overdue_qyt + this.rowmst = res.mst + }) } } } diff --git a/lms/nladmin-ui/src/views/wms/st/outbill/checkoutbill.js b/lms/nladmin-ui/src/views/wms/st/outbill/checkoutbill.js index f63c48161..289a2d586 100644 --- a/lms/nladmin-ui/src/views/wms/st/outbill/checkoutbill.js +++ b/lms/nladmin-ui/src/views/wms/st/outbill/checkoutbill.js @@ -241,4 +241,11 @@ export function outReturn(data) { data }) } -export default { add, edit, del, allDiv, allCancel, getOutBillDtl, getOutBillDis, getOutBillDis2, setPoint, oneSetPoint, getOutBillTask, getStructIvt, manualDiv, confirm, issueTask, finishTask, cancleTaskfinish, getInvTypes, paramByCodeType, schAreaType, backConfirm, getOutBillDisDtl, getType, allDivOne, moneySubmit, getDisNum, queryBox, getOutBillTask2, oneCancel, cancelTask, allSetPoint, oneSetPoint2, outReturn } +export function updataIsOverdue(data) { + return request({ + url: '/api/checkoutbill/updataIsOverdue', + method: 'post', + data + }) +} +export default { add, edit, del, allDiv, allCancel, getOutBillDtl, getOutBillDis, getOutBillDis2, setPoint, oneSetPoint, getOutBillTask, getStructIvt, manualDiv, confirm, issueTask, finishTask, cancleTaskfinish, getInvTypes, paramByCodeType, schAreaType, backConfirm, getOutBillDisDtl, getType, allDivOne, moneySubmit, getDisNum, queryBox, getOutBillTask2, oneCancel, cancelTask, allSetPoint, oneSetPoint2, outReturn, updataIsOverdue } diff --git a/lms/nladmin-ui/src/views/wms/st/outbill/index.vue b/lms/nladmin-ui/src/views/wms/st/outbill/index.vue index 8362bc70a..812698c2c 100644 --- a/lms/nladmin-ui/src/views/wms/st/outbill/index.vue +++ b/lms/nladmin-ui/src/views/wms/st/outbill/index.vue @@ -319,6 +319,7 @@ + @@ -375,7 +376,7 @@ export default { }, mixins: [presenter(), header(), crud()], // 数据字典 - dicts: ['io_bill_status', 'ST_CREATE_MODE', 'ST_INV_OUT_TYPE', 'is_upload'], + dicts: ['io_bill_status', 'ST_CREATE_MODE', 'ST_INV_OUT_TYPE', 'is_upload', 'IS_OR_NOT'], data() { return { height: document.documentElement.clientHeight - 180 + 'px;', @@ -510,6 +511,9 @@ export default { create_modeFormat(row) { return this.dict.label.ST_CREATE_MODE[row.create_mode] }, + isOverdue(row) { + return this.dict.label.IS_OR_NOT[row.is_overdue] + }, handleCurrentChange(current) { if (current === null) { this.dis_flag = true