diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/device/service/dto/DeviceRunpointDto.java b/hd/nladmin-system/src/main/java/org/nl/acs/device/service/dto/DeviceRunpointDto.java index 2d0d090..a2cbc91 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/device/service/dto/DeviceRunpointDto.java +++ b/hd/nladmin-system/src/main/java/org/nl/acs/device/service/dto/DeviceRunpointDto.java @@ -81,4 +81,22 @@ public class DeviceRunpointDto implements Serializable { * 锁定 */ private String islock; + + // 手持设备信息 + private String model; + + // 工序 + private String process; + + // 重量 + private String weight; + + // 质量状态 + private String qc_status; + + // 日期 + private String date; + + // 操作员 + private String operation_by; } diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java b/hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java index 730d58a..829b4ae 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java +++ b/hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java @@ -24,6 +24,7 @@ import org.nl.acs.device_driver.ssj_cache_site.SsjCacheSiteDeviceDriver; import org.nl.acs.device_driver.standard_conveyor_control_with_scanner.StandardCoveyorControlWithScannerDeviceDriver; import org.nl.acs.device_driver.standard_emptypallet_site.StandardEmptyPalletSiteDeviceDriver; import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver; +import org.nl.acs.device_driver.standard_inspect_site_smart200.StandardInspectSiteSmartDeviceDriver; import org.nl.acs.device_driver.standard_manipulator_inspect_site.StandardManipulatorInspectSiteDeviceDriver; import org.nl.acs.device_driver.standard_manipulator_stacking_site.StandardManipulatorStackingSiteDeviceDriver; import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; @@ -822,6 +823,12 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial String remark = form.optString("remark"); String vehicle_code = form.optString("vehicle_code"); String islock = form.optString("islock"); + String model = form.optString("model"); + String process = form.optString("process"); + String weight = form.optString("weight"); + String qc_status = form.optString("qc_status"); + String date = form.optString("date"); + String operation_by = form.optString("operation_by"); //是否需要人工确认 String is_unlock = form.optString("is_unlock"); @@ -851,6 +858,8 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial StandardManipulatorInspectSiteDeviceDriver standardManipulatorInspectSiteDeviceDriver; //扬州晶澳 YzjaSpecialDeviceDriver yzjaSpecialDeviceDriver; + // 检测站点_smaet200 + StandardInspectSiteSmartDeviceDriver standardInspectSiteSmartDeviceDriver; if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); @@ -890,6 +899,48 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial standardOrdinarySiteDeviceDriver.setIslock(Boolean.valueOf(islock)); device.setIslock(islock); } + if (StrUtil.isNotEmpty(model)) { + standardOrdinarySiteDeviceDriver.setModel(model); + device.setModel(model); + } else { + standardOrdinarySiteDeviceDriver.setModel(""); + device.setModel(""); + } + if (StrUtil.isNotEmpty(process)) { + standardOrdinarySiteDeviceDriver.setProcess(process); + device.setProcess(process); + } else { + standardOrdinarySiteDeviceDriver.setProcess(""); + device.setProcess(""); + } + if (StrUtil.isNotEmpty(weight)) { + standardOrdinarySiteDeviceDriver.setWeight(weight); + device.setWeight(weight); + } else { + standardOrdinarySiteDeviceDriver.setWeight(""); + device.setWeight(""); + } + if (StrUtil.isNotEmpty(qc_status)) { + standardOrdinarySiteDeviceDriver.setQc_status(qc_status); + device.setQc_status(qc_status); + } else { + standardOrdinarySiteDeviceDriver.setQc_status(""); + device.setQc_status(""); + } + if (StrUtil.isNotEmpty(date)) { + standardOrdinarySiteDeviceDriver.setDate(date); + device.setDate(date); + } else { + standardOrdinarySiteDeviceDriver.setDate(""); + device.setDate(""); + } + if (StrUtil.isNotEmpty(operation_by)) { + standardOrdinarySiteDeviceDriver.setOperation_by(operation_by); + device.setOperation_by(operation_by); + } else { + standardOrdinarySiteDeviceDriver.setOperation_by(""); + device.setOperation_by(""); + } WQLObject runpointwo = WQLObject.getWQLObject("acs_device_runpoint"); JSONObject json = runpointwo.query("device_code ='" + device_code + "'").uniqueResult(0); if (!ObjectUtil.isEmpty(json)) { @@ -897,12 +948,24 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial obj.setHasgoods(hasGoodStatus); obj.setMaterial_type(material_type); obj.setBatch(batch); + obj.setModel(model); + obj.setProcess(process); + obj.setWeight(weight); + obj.setQc_status(qc_status); + obj.setDate(date); + obj.setOperation_by(operation_by); device.setHas_goods(Integer.parseInt(hasGoodStatus)); device.setMaterial_type(material_type); device.setRemark(remark); device.setQuantity(quantity); device.setBatch(batch); device.setIslock(islock); + device.setModel(model); + device.setProcess(process); + device.setWeight(weight); + device.setQc_status(qc_status); + device.setDate(date); + device.setOperation_by(operation_by); JSONObject updatejson = JSONObject.fromObject(obj); runpointwo.update(updatejson, "device_code = '" + device_code + "'"); } @@ -1007,6 +1070,48 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial ssjCacheSiteDeviceDriver.setIslock(Boolean.valueOf(islock)); device.setIslock(islock); } + if (StrUtil.isNotEmpty(model)) { + ssjCacheSiteDeviceDriver.setModel(model); + device.setModel(model); + } else { + ssjCacheSiteDeviceDriver.setModel(""); + device.setModel(""); + } + if (StrUtil.isNotEmpty(process)) { + ssjCacheSiteDeviceDriver.setProcess(process); + device.setProcess(process); + } else { + ssjCacheSiteDeviceDriver.setProcess(""); + device.setProcess(""); + } + if (StrUtil.isNotEmpty(weight)) { + ssjCacheSiteDeviceDriver.setWeight(weight); + device.setWeight(weight); + } else { + ssjCacheSiteDeviceDriver.setWeight(""); + device.setWeight(""); + } + if (StrUtil.isNotEmpty(qc_status)) { + ssjCacheSiteDeviceDriver.setQc_status(qc_status); + device.setQc_status(qc_status); + } else { + ssjCacheSiteDeviceDriver.setQc_status(""); + device.setQc_status(""); + } + if (StrUtil.isNotEmpty(date)) { + ssjCacheSiteDeviceDriver.setDate(date); + device.setDate(date); + } else { + ssjCacheSiteDeviceDriver.setDate(""); + device.setDate(""); + } + if (StrUtil.isNotEmpty(operation_by)) { + ssjCacheSiteDeviceDriver.setOperation_by(operation_by); + device.setOperation_by(operation_by); + } else { + ssjCacheSiteDeviceDriver.setOperation_by(""); + device.setOperation_by(""); + } WQLObject runpointwo = WQLObject.getWQLObject("acs_device_runpoint"); JSONObject json = runpointwo.query("device_code ='" + device_code + "'").uniqueResult(0); if (!ObjectUtil.isEmpty(json)) { @@ -1014,12 +1119,24 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial obj.setHasgoods(hasGoodStatus); obj.setMaterial_type(material_type); obj.setBatch(batch); + obj.setModel(model); + obj.setProcess(process); + obj.setWeight(weight); + obj.setQc_status(qc_status); + obj.setDate(date); + obj.setOperation_by(operation_by); device.setHas_goods(Integer.parseInt(hasGoodStatus)); device.setMaterial_type(material_type); device.setRemark(remark); device.setQuantity(quantity); device.setBatch(batch); device.setIslock(islock); + device.setModel(model); + device.setProcess(process); + device.setWeight(weight); + device.setQc_status(qc_status); + device.setDate(date); + device.setOperation_by(operation_by); JSONObject updatejson = JSONObject.fromObject(obj); runpointwo.update(updatejson, "device_code = '" + device_code + "'"); } @@ -1061,6 +1178,109 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial device.setBatch(batch); device.setIslock(islock); } + // 检测站点_smaet200 + else if (device.getDeviceDriver() instanceof StandardInspectSiteSmartDeviceDriver) { + standardInspectSiteSmartDeviceDriver = (StandardInspectSiteSmartDeviceDriver) device.getDeviceDriver(); + if (!StrUtil.isEmpty(hasGoodStatus)) { + standardInspectSiteSmartDeviceDriver.setHasGoods(Integer.parseInt(hasGoodStatus)); + device.setHas_goods(Integer.parseInt(hasGoodStatus)); + } + if (StrUtil.isNotEmpty(material_type)) { + standardInspectSiteSmartDeviceDriver.setMaterial(material_type); + device.setMaterial_type(material_type); + } else { + standardInspectSiteSmartDeviceDriver.setMaterial(""); + device.setMaterial_type(""); + } + if (StrUtil.isNotEmpty(batch)) { + standardInspectSiteSmartDeviceDriver.setBatch(batch); + device.setBatch(batch); + } else { + standardInspectSiteSmartDeviceDriver.setBatch(""); + device.setBatch(""); + } + if (!StrUtil.isEmpty(put_goods_time)) { + standardInspectSiteSmartDeviceDriver.setPut_goods_time(put_goods_time); + device.setPut_goods_time(put_goods_time); + } else { + standardInspectSiteSmartDeviceDriver.setPut_goods_time(""); + device.setPut_goods_time(""); + } + if (StrUtil.isNotEmpty(islock)) { + standardInspectSiteSmartDeviceDriver.setIslock(Boolean.valueOf(islock)); + device.setIslock(islock); + } + if (StrUtil.isNotEmpty(model)) { + standardInspectSiteSmartDeviceDriver.setModel(model); + device.setModel(model); + } else { + standardInspectSiteSmartDeviceDriver.setModel(""); + device.setModel(""); + } + if (StrUtil.isNotEmpty(process)) { + standardInspectSiteSmartDeviceDriver.setProcess(process); + device.setProcess(process); + } else { + standardInspectSiteSmartDeviceDriver.setProcess(""); + device.setProcess(""); + } + if (StrUtil.isNotEmpty(weight)) { + standardInspectSiteSmartDeviceDriver.setWeight(weight); + device.setWeight(weight); + } else { + standardInspectSiteSmartDeviceDriver.setWeight(""); + device.setWeight(""); + } + if (StrUtil.isNotEmpty(qc_status)) { + standardInspectSiteSmartDeviceDriver.setQc_status(qc_status); + device.setQc_status(qc_status); + } else { + standardInspectSiteSmartDeviceDriver.setQc_status(""); + device.setQc_status(""); + } + if (StrUtil.isNotEmpty(date)) { + standardInspectSiteSmartDeviceDriver.setDate(date); + device.setDate(date); + } else { + standardInspectSiteSmartDeviceDriver.setDate(""); + device.setDate(""); + } + if (StrUtil.isNotEmpty(operation_by)) { + standardInspectSiteSmartDeviceDriver.setOperation_by(operation_by); + device.setOperation_by(operation_by); + } else { + standardInspectSiteSmartDeviceDriver.setOperation_by(""); + device.setOperation_by(""); + } + WQLObject runpointwo = WQLObject.getWQLObject("acs_device_runpoint"); + JSONObject json = runpointwo.query("device_code ='" + device_code + "'").uniqueResult(0); + if (!ObjectUtil.isEmpty(json)) { + DeviceRunpointDto obj = (DeviceRunpointDto) JSONObject.toBean(json, DeviceRunpointDto.class); + obj.setHasgoods(hasGoodStatus); + obj.setMaterial_type(material_type); + obj.setBatch(batch); + obj.setModel(model); + obj.setProcess(process); + obj.setWeight(weight); + obj.setQc_status(qc_status); + obj.setDate(date); + obj.setOperation_by(operation_by); + device.setHas_goods(Integer.parseInt(hasGoodStatus)); + device.setMaterial_type(material_type); + device.setRemark(remark); + device.setQuantity(quantity); + device.setBatch(batch); + device.setIslock(islock); + device.setModel(model); + device.setProcess(process); + device.setWeight(weight); + device.setQc_status(qc_status); + device.setDate(date); + device.setOperation_by(operation_by); + JSONObject updatejson = JSONObject.fromObject(obj); + runpointwo.update(updatejson, "device_code = '" + device_code + "'"); + } + } } @Override diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/device/wql/device.xls b/hd/nladmin-system/src/main/java/org/nl/acs/device/wql/device.xls index a228f66..fc134d7 100644 Binary files a/hd/nladmin-system/src/main/java/org/nl/acs/device/wql/device.xls and b/hd/nladmin-system/src/main/java/org/nl/acs/device/wql/device.xls differ diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/ssj_cache_site/SsjCacheSiteDeviceDriver.java b/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/ssj_cache_site/SsjCacheSiteDeviceDriver.java index 33f8f18..2ab61b3 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/ssj_cache_site/SsjCacheSiteDeviceDriver.java +++ b/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/ssj_cache_site/SsjCacheSiteDeviceDriver.java @@ -4,7 +4,9 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.StrUtil; import lombok.Data; +import lombok.Getter; import lombok.RequiredArgsConstructor; +import lombok.Setter; import lombok.extern.slf4j.Slf4j; import net.sf.json.JSONArray; import net.sf.json.JSONObject; @@ -101,6 +103,24 @@ public class SsjCacheSiteDeviceDriver extends AbstractDeviceDriver implements De int move; + // 手持设备信息 + private String model; + + // 工序 + private String process; + + // 重量 + private String weight; + + // 质量状态 + private String qc_status; + + // 日期 + private String date; + + // 操作员 + private String operation_by; + @Override public void execute() { hasGoods = this.getDevice().getHas_goods(); diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site_smart200/StandardInspectSiteSmartDeviceDriver.java b/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site_smart200/StandardInspectSiteSmartDeviceDriver.java index 76bff1d..c465ca4 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site_smart200/StandardInspectSiteSmartDeviceDriver.java +++ b/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site_smart200/StandardInspectSiteSmartDeviceDriver.java @@ -53,6 +53,8 @@ public class StandardInspectSiteSmartDeviceDriver extends AbstractOpcDeviceDrive TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl"); @Autowired DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class); + @Autowired + DeviceService deviceService; String container; String container_type_desc; String last_container_type_desc; @@ -124,6 +126,28 @@ public class StandardInspectSiteSmartDeviceDriver extends AbstractOpcDeviceDrive String devicecode; + // 手持设备信息 + private String model; + + // 工序 + private String process; + + // 重量 + private String weight; + + // 质量状态 + private String qc_status; + + // 日期 + private String date; + + // 操作员 + private String operation_by; + + String put_goods_time = ""; + + Boolean islock = false; + @Override public Device getDevice() { return this.device; @@ -142,16 +166,35 @@ public class StandardInspectSiteSmartDeviceDriver extends AbstractOpcDeviceDrive hasGoods = this.itemProtocol.getMove(); if (mode != last_mode) { - if (mode == 5){ + if (mode == 5) { this.setEmptyrequireSucess(false); } - if (mode == 6){ + if (mode == 6) { this.setInrequireSucess(false); } this.execute_log.setResource(this.devicecode, this.device.getDevice_name()); this.execute_log.log("设备:" + device_code + ",last_mode -> mode:" + last_mode + "->" + mode); } if (move != last_move) { + if (move == 0) { + this.setHasGoods(0); + device.setHas_goods(0); + JSONObject jo = new JSONObject(); + jo.put("device_code", device_code); + jo.put("hasGoodStatus", "0"); + jo.put("batch", ""); + jo.put("material_type", ""); + jo.put("put_goods_time", ""); + jo.put("model", ""); + jo.put("process", ""); + jo.put("weight", ""); + jo.put("qc_status", ""); + jo.put("date", ""); + jo.put("operation_by", ""); + deviceService.changeDeviceStatus(jo); + this.setMaterial(""); + this.setBatch(""); + } this.execute_log.setResource(this.devicecode, this.device.getDevice_name()); this.execute_log.log("设备:" + device_code + ",last_move -> move:" + last_mode + "->" + move); } @@ -293,17 +336,17 @@ public class StandardInspectSiteSmartDeviceDriver extends AbstractOpcDeviceDrive } case 5: - if (!emptyrequireSucess){ + if (!emptyrequireSucess) { //mode = 5 并且工位上无货时申请空托盘 - if (move == 0){ + if (move == 0) { this.execute_log.log("设备:" + devicecode + ",move:" + move); this.apply_empty_require(container); } } break; case 6: - if (!inrequireSucess){ - if (move == 1){ + if (!inrequireSucess) { + if (move == 1) { this.execute_log.log("设备:" + devicecode + ",move:" + move); this.apply_in_require(container); } @@ -428,10 +471,12 @@ public class StandardInspectSiteSmartDeviceDriver extends AbstractOpcDeviceDrive public boolean instruction_require(String container_code) { return instruction_require(container_code, WcsConfig.task_container_type_default_desc); } - public synchronized boolean apply_empty_require(String container_code) { + + public synchronized boolean apply_empty_require(String container_code) { return apply_empty_require(container_code, WcsConfig.task_container_type_default_desc); } - public synchronized boolean apply_in_require(String container_code) { + + public synchronized boolean apply_in_require(String container_code) { return apply_in_require(container_code, WcsConfig.task_container_type_default_desc); } @@ -463,7 +508,7 @@ public class StandardInspectSiteSmartDeviceDriver extends AbstractOpcDeviceDrive //获取该路由终点设备信息 Device route_link_device = deviceAppservice.findDeviceByCode(next_device_code); //判断终点设备驱动是否为检测站点驱动 - if (route_link_device.getDeviceDriver() instanceof StandardInspectSiteSmartDeviceDriver){ + if (route_link_device.getDeviceDriver() instanceof StandardInspectSiteSmartDeviceDriver) { standardInspectSiteDeviceDriver = (StandardInspectSiteSmartDeviceDriver) route_link_device.getDeviceDriver(); //判断该终点设备是否有货,有货就结束循环 if (standardInspectSiteDeviceDriver.getMove() != 0 || standardInspectSiteDeviceDriver.getMode() != 2) { @@ -526,7 +571,7 @@ public class StandardInspectSiteSmartDeviceDriver extends AbstractOpcDeviceDrive flag = true; break; } catch (Exception e) { - this.execute_log.log("设备:" + devicecode+ "", "", "创建任务失败"); + this.execute_log.log("设备:" + devicecode + "", "", "创建任务失败"); } } } @@ -535,7 +580,7 @@ public class StandardInspectSiteSmartDeviceDriver extends AbstractOpcDeviceDrive if (flag) { inrequireSucess = true; - this.execute_log.log("设备:" + devicecode+ "", "", "对应路由设备,生成任务成功已锁定"); + this.execute_log.log("设备:" + devicecode + "", "", "对应路由设备,生成任务成功已锁定"); } return true; } @@ -569,7 +614,7 @@ public class StandardInspectSiteSmartDeviceDriver extends AbstractOpcDeviceDrive //获取起点设备的信息 Device route_link_device = deviceAppservice.findDeviceByCode(start_device_code); //判断起点设备驱动是否为堆叠位驱动 - if (route_link_device.getDeviceDriver() instanceof StandardEmptyPalletSiteDeviceDriver){ + if (route_link_device.getDeviceDriver() instanceof StandardEmptyPalletSiteDeviceDriver) { standardEmptyPalletSiteDeviceDriver = (StandardEmptyPalletSiteDeviceDriver) route_link_device.getDeviceDriver(); // TODO 判断堆叠位是否有货,没货就结束本次循环 //判断堆叠位的数量是否大于0,如果=0就结束本次循环 @@ -632,7 +677,7 @@ public class StandardInspectSiteSmartDeviceDriver extends AbstractOpcDeviceDrive flag = true; break; } catch (Exception e) { - this.execute_log.log("设备:" + devicecode+ "", "", "创建任务失败"); + this.execute_log.log("设备:" + devicecode + "", "", "创建任务失败"); } } } @@ -640,7 +685,7 @@ public class StandardInspectSiteSmartDeviceDriver extends AbstractOpcDeviceDrive //生成任务成功 if (flag) { emptyrequireSucess = true; - this.execute_log.log("设备:" + devicecode+ "", "", "对应路由设备,生成任务成功已锁定"); + this.execute_log.log("设备:" + devicecode + "", "", "对应路由设备,生成任务成功已锁定"); } return true; } diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java b/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java index 7c2248f..d211c40 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java +++ b/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java @@ -102,6 +102,24 @@ public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver imple int move; + // 手持设备信息 + private String model; + + // 工序 + private String process; + + // 重量 + private String weight; + + // 质量状态 + private String qc_status; + + // 日期 + private String date; + + // 操作员 + private String operation_by; + @Override public void execute() { hasGoods = this.getDevice().getHas_goods(); diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/opc/DeviceManageDto.java b/hd/nladmin-system/src/main/java/org/nl/acs/opc/DeviceManageDto.java index afb9539..795c3ef 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/opc/DeviceManageDto.java +++ b/hd/nladmin-system/src/main/java/org/nl/acs/opc/DeviceManageDto.java @@ -59,6 +59,24 @@ public class DeviceManageDto { //人工确认信号 默认0 agv到达后请求置1 等人工确认后变为2 反馈agv后继续为0 private int manua_confirm = 0; + // 手持设备信息 + private String model; + + // 工序 + private String process; + + // 重量 + private String weight; + + // 质量状态 + private String qc_status; + + // 日期 + private String date; + + // 操作员 + private String operation_by; + private List extra = new LinkedList(); private String perfix; private Map extra_map = new LinkedHashMap(); diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/opc/DeviceManageServiceImpl.java b/hd/nladmin-system/src/main/java/org/nl/acs/opc/DeviceManageServiceImpl.java index ed9d76d..2c87306 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/opc/DeviceManageServiceImpl.java +++ b/hd/nladmin-system/src/main/java/org/nl/acs/opc/DeviceManageServiceImpl.java @@ -55,10 +55,22 @@ public class DeviceManageServiceImpl implements DeviceManageService { String material_type = runpointTab.query("is_delete= '0' AND is_active= '1' AND device_id = '" + extra.getDevice_id() + "'").uniqueResult(0).optString("material_type"); String batch = runpointTab.query("is_delete= '0' AND is_active= '1' AND device_id = '" + extra.getDevice_id() + "'").uniqueResult(0).optString("batch"); String islock = runpointTab.query("is_delete= '0' AND is_active= '1' AND device_id = '" + extra.getDevice_id() + "'").uniqueResult(0).optString("islock"); + String model = runpointTab.query("is_delete= '0' AND is_active= '1' AND device_id = '" + extra.getDevice_id() + "'").uniqueResult(0).optString("model"); + String process = runpointTab.query("is_delete= '0' AND is_active= '1' AND device_id = '" + extra.getDevice_id() + "'").uniqueResult(0).optString("process"); + String weight = runpointTab.query("is_delete= '0' AND is_active= '1' AND device_id = '" + extra.getDevice_id() + "'").uniqueResult(0).optString("weight"); + String qc_status = runpointTab.query("is_delete= '0' AND is_active= '1' AND device_id = '" + extra.getDevice_id() + "'").uniqueResult(0).optString("qc_status"); + String date = runpointTab.query("is_delete= '0' AND is_active= '1' AND device_id = '" + extra.getDevice_id() + "'").uniqueResult(0).optString("date"); + String operation_by = runpointTab.query("is_delete= '0' AND is_active= '1' AND device_id = '" + extra.getDevice_id() + "'").uniqueResult(0).optString("operation_by"); device.setMaterial_type(material_type); device.setHas_goods(Integer.parseInt(has_goods)); device.setBatch(batch); device.setIslock(islock); + device.setModel(model); + device.setProcess(process); + device.setWeight(weight); + device.setQc_status(qc_status); + device.setDate(date); + device.setOperation_by(operation_by); } } } diff --git a/hd/nladmin-system/src/main/java/org/nl/hand/assj/rest/SSJHandController.java b/hd/nladmin-system/src/main/java/org/nl/hand/assj/rest/SSJHandController.java index c8bd9ee..e13c3a8 100644 --- a/hd/nladmin-system/src/main/java/org/nl/hand/assj/rest/SSJHandController.java +++ b/hd/nladmin-system/src/main/java/org/nl/hand/assj/rest/SSJHandController.java @@ -48,8 +48,8 @@ public class SSJHandController { //@PreAuthorize("@el.check('sect:list')") //@RequestBody JSONObject json public ResponseEntity queryPoint(@RequestBody Map whereJson) { - String region = (String) whereJson.get("region"); - return new ResponseEntity<>(HandService.queryPointByArea(region), HttpStatus.OK); +// String region = (String) whereJson.get("region"); + return new ResponseEntity<>(HandService.queryPointByArea(whereJson), HttpStatus.OK); } @PostMapping("/point/storage") diff --git a/hd/nladmin-system/src/main/java/org/nl/hand/assj/service/SSJHandService.java b/hd/nladmin-system/src/main/java/org/nl/hand/assj/service/SSJHandService.java index 8d1357e..3e00e14 100644 --- a/hd/nladmin-system/src/main/java/org/nl/hand/assj/service/SSJHandService.java +++ b/hd/nladmin-system/src/main/java/org/nl/hand/assj/service/SSJHandService.java @@ -24,7 +24,7 @@ public interface SSJHandService { * * @return Map */ - Map queryPointByArea(String dict_id); + Map queryPointByArea(Map whereJson); /** * 查询设备扩展性 diff --git a/hd/nladmin-system/src/main/java/org/nl/hand/assj/service/impl/SSJHandServiceImpl.java b/hd/nladmin-system/src/main/java/org/nl/hand/assj/service/impl/SSJHandServiceImpl.java index 1445586..0d15548 100644 --- a/hd/nladmin-system/src/main/java/org/nl/hand/assj/service/impl/SSJHandServiceImpl.java +++ b/hd/nladmin-system/src/main/java/org/nl/hand/assj/service/impl/SSJHandServiceImpl.java @@ -18,7 +18,9 @@ import org.nl.acs.device.service.dto.DeviceDto; import org.nl.acs.device.service.impl.DeviceServiceImpl; import org.nl.acs.device_driver.ssj_cache_site.SsjCacheSiteDeviceDriver; import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver; +import org.nl.acs.device_driver.standard_inspect_site_smart200.StandardInspectSiteSmartDeviceDriver; import org.nl.acs.device_driver.standard_manipulator_inspect_site.StandardManipulatorInspectSiteDeviceDriver; +import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.instruction.service.dto.InstructionDto; @@ -79,11 +81,12 @@ public class SSJHandServiceImpl implements SSJHandService { } @Override - public Map queryPointByArea(String dict_id) { + public Map queryPointByArea(Map whereJson) { JSONArray resultArr = new JSONArray(); JSONObject resultJson = new JSONObject(); JSONObject jo = new JSONObject(); + String dict_id = whereJson.get("region"); if (StrUtil.isEmpty(dict_id)) { throw new BadRequestException("区域id不能为空!"); } @@ -95,6 +98,18 @@ public class SSJHandServiceImpl implements SSJHandService { String material = ""; String batch = ""; + // 判断有没有物料类型和批次条件 + String material_type = whereJson.get("material_type"); + String where_batch = whereJson.get("batch"); + boolean have_material_type = false; + if (StrUtil.isNotEmpty(material_type)) { + have_material_type = true; + } + boolean have_where_batch = false; + if (StrUtil.isNotEmpty(where_batch)) { + have_where_batch = true; + } + //再字典中查询出value //JSONObject valuejo = WQLObject.getWQLObject("sys_dict_detail").query("detail_id='" + dict_id + "'").uniqueResult(0); JSONObject valuejo = WQL.getWO("QSSJ_QUERY001").addParam("flag", "3").addParam("detail_id", dict_id).process().uniqueResult(0); @@ -114,9 +129,23 @@ public class SSJHandServiceImpl implements SSJHandService { StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; //区域管制设备交互站点 StandardManipulatorInspectSiteDeviceDriver standardManipulatorInspectSiteDeviceDriver; + // 检测站点_smaet200 + StandardInspectSiteSmartDeviceDriver standardInspectSiteSmartDeviceDriver; + // 普通站点 + StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; if (device.getDeviceDriver() instanceof SsjCacheSiteDeviceDriver) { ssjCacheSiteDeviceDriver = (SsjCacheSiteDeviceDriver) device.getDeviceDriver(); + + // 如果有物料类型条件且物料类型对不上,进入下一轮循环 + if (have_material_type && !StrUtil.equals(device.getMaterial_type(), material_type)) { + continue; + } + // 如果有批次条件且批次对不上,进入下一轮循环 + if (have_where_batch && !StrUtil.equals(device.getBatch(), where_batch)) { + continue; + } + if (StrUtil.equals(device.getIslock(), "true")) { status = "3"; move = "有任务"; @@ -161,6 +190,12 @@ public class SSJHandServiceImpl implements SSJHandService { jo.put("device_name", devicejo.optString("device_name")); jo.put("allow_update", "1"); jo.put("input_material", input_material); + jo.put("model", device.getModel()); + jo.put("process", device.getProcess()); + jo.put("weight", device.getWeight()); + jo.put("qc_status", device.getQc_status()); + jo.put("date", device.getDate()); + jo.put("operation_by", device.getOperation_by()); // 特殊驱动 } //检测站点 @@ -222,6 +257,133 @@ public class SSJHandServiceImpl implements SSJHandService { jo.put("batch", standardManipulatorInspectSiteDeviceDriver.getBatch()); jo.put("input_material", input_material); } + // 检测站点_smaet200 + else if (device.getDeviceDriver() instanceof StandardInspectSiteSmartDeviceDriver) { + standardInspectSiteSmartDeviceDriver = (StandardInspectSiteSmartDeviceDriver) device.getDeviceDriver(); + + // 如果有物料类型条件且物料类型对不上,进入下一轮循环 + if (have_material_type && !StrUtil.equals(device.getMaterial_type(), material_type)) { + continue; + } + // 如果有批次条件且批次对不上,进入下一轮循环 + if (have_where_batch && !StrUtil.equals(device.getBatch(), where_batch)) { + continue; + } + + if (StrUtil.equals(device.getIslock(), "true")) { + status = "3"; + move = "有任务"; + } else { + if (standardInspectSiteSmartDeviceDriver.getHasGoods() == 0) { + status = "0"; + move = "无货"; + } else if (standardInspectSiteSmartDeviceDriver.getHasGoods() == 1) { + status = "1"; + move = "有托盘"; + } else if (standardInspectSiteSmartDeviceDriver.getHasGoods() == 2) { + status = "2"; + move = "有托盘有货"; + } + } + + material = device.getMaterial_type(); + if (StrUtil.isNullOrUndefined(material)) { + material = ""; + } + batch = device.getBatch(); + if (StrUtil.isNullOrUndefined(batch)) { + batch = ""; + } + String input_materialflag = (String) device.getExtraValue().get("input_material"); + if (!StrUtil.isEmpty(input_materialflag) && input_materialflag.equals("false")) { + input_material = "0"; + } + if (!StrUtil.isEmpty(input_materialflag) && input_materialflag.equals("true")) { + input_material = "1"; + } + jo.put("material_type", material); + jo.put("batch", batch); + jo.put("put_goods_time", device.getPut_goods_time()); + jo.put("islock", device.getIslock()); + jo.put("status_name", move); + jo.put("status", status); + jo.put("device_id", devicejo.optString("device_id")); + jo.put("device_code", devicejo.optString("device_code")); + jo.put("device_name", devicejo.optString("device_name")); + jo.put("allow_update", "1"); + jo.put("input_material", input_material); + jo.put("model", device.getModel()); + jo.put("process", device.getProcess()); + jo.put("weight", device.getWeight()); + jo.put("qc_status", device.getQc_status()); + jo.put("date", device.getDate()); + jo.put("operation_by", device.getOperation_by()); + } + // 普通站点 + else if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { + standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); + + // 如果有物料类型条件且物料类型对不上,进入下一轮循环 + if (have_material_type && !StrUtil.equals(device.getMaterial_type(), material_type)) { + continue; + } + // 如果有批次条件且批次对不上,进入下一轮循环 + if (have_where_batch && !StrUtil.equals(device.getBatch(), where_batch)) { + continue; + } + + if (StrUtil.equals(device.getIslock(), "true")) { + status = "3"; + move = "有任务"; + } else { + if (standardOrdinarySiteDeviceDriver.getHasGoods() == 0) { + status = "0"; + move = "无货"; + } else if (standardOrdinarySiteDeviceDriver.getHasGoods() == 1) { + status = "1"; + move = "有托盘"; + } else if (standardOrdinarySiteDeviceDriver.getHasGoods() == 2) { + status = "2"; + move = "有托盘有货"; + } + } + + material = device.getMaterial_type(); + //material = standardOrdinarySiteDeviceDriver.getMaterial(); + if (StrUtil.isNullOrUndefined(material)) { + material = ""; + } + batch = device.getBatch(); + //batch = standardOrdinarySiteDeviceDriver.getBatch(); + if (StrUtil.isNullOrUndefined(batch)) { + batch = ""; + } + String input_materialflag = (String) device.getExtraValue().get("input_material"); + if (!StrUtil.isEmpty(input_materialflag) && input_materialflag.equals("false")) { + input_material = "0"; + } + if (!StrUtil.isEmpty(input_materialflag) && input_materialflag.equals("true")) { + input_material = "1"; + } + jo.put("material_type", material); + jo.put("batch", batch); + jo.put("put_goods_time", device.getPut_goods_time()); + jo.put("islock", device.getIslock()); + jo.put("status_name", move); + jo.put("status", status); + jo.put("device_id", devicejo.optString("device_id")); + jo.put("device_code", devicejo.optString("device_code")); + jo.put("device_name", devicejo.optString("device_name")); + jo.put("allow_update", "1"); + jo.put("input_material", input_material); + jo.put("model", device.getModel()); + jo.put("process", device.getProcess()); + jo.put("weight", device.getWeight()); + jo.put("qc_status", device.getQc_status()); + jo.put("date", device.getDate()); + jo.put("operation_by", device.getOperation_by()); + // 特殊驱动 + } resultArr.add(jo); } resultJson.put("code", "1"); @@ -463,6 +625,12 @@ public class SSJHandServiceImpl implements SSJHandService { String status = jsonObject.get("status"); String material_type = jsonObject.get("material_type"); String batch = jsonObject.get("batch"); + String model = jsonObject.get("model"); + String process = jsonObject.get("process"); + String weight = jsonObject.get("weight"); + String qc_status = jsonObject.get("qc_status"); + String date = jsonObject.get("date"); + String operation_by = jsonObject.get("operation_by"); JSONObject resultJson = new JSONObject(); DeviceService deviceService = SpringContextHolder.getBean(DeviceServiceImpl.class); @@ -474,6 +642,10 @@ public class SSJHandServiceImpl implements SSJHandService { StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; //区域管制设备站点 StandardManipulatorInspectSiteDeviceDriver standardManipulatorInspectSiteDeviceDriver; + // 检测站点_smaet200 + StandardInspectSiteSmartDeviceDriver standardInspectSiteSmartDeviceDriver; + // 普通站点 + StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; DeviceDto dto = deviceService.findByCode(device_code); @@ -504,6 +676,12 @@ public class SSJHandServiceImpl implements SSJHandService { jo.put("hasGoodStatus", status); jo.put("batch", batch); jo.put("material_type", material_type); + jo.put("model", model); + jo.put("process", process); + jo.put("weight", weight); + jo.put("qc_status", qc_status); + jo.put("date", date); + jo.put("operation_by", operation_by); deviceService.changeDeviceStatus(jo); if (!StrUtil.isEmpty(material_type)) { ssjCacheSiteDeviceDriver.setMaterial(material_type); @@ -512,6 +690,39 @@ public class SSJHandServiceImpl implements SSJHandService { ssjCacheSiteDeviceDriver.setBatch(batch); } } + if (device.getDeviceDriver() instanceof StandardInspectSiteSmartDeviceDriver) { + standardInspectSiteSmartDeviceDriver = (StandardInspectSiteSmartDeviceDriver) device.getDeviceDriver(); + + if (StrUtil.equals("0", material_type)) { + status = "0"; + } + if (StrUtil.equals("1", material_type)) { + status = "1"; + } + if ("2,3,4,5".contains(material_type)) { + status = "2"; + } + standardInspectSiteSmartDeviceDriver.setHasGoods(Integer.parseInt(status)); + device.setHas_goods(Integer.parseInt(status)); + JSONObject jo = new JSONObject(); + jo.put("device_code", device_code); + jo.put("hasGoodStatus", status); + jo.put("batch", batch); + jo.put("material_type", material_type); + jo.put("model", model); + jo.put("process", process); + jo.put("weight", weight); + jo.put("qc_status", qc_status); + jo.put("date", date); + jo.put("operation_by", operation_by); + deviceService.changeDeviceStatus(jo); + if (!StrUtil.isEmpty(material_type)) { + standardInspectSiteSmartDeviceDriver.setMaterial(material_type); + } + if (!StrUtil.isEmpty(batch)) { + standardInspectSiteSmartDeviceDriver.setBatch(batch); + } + } if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); standardInspectSiteDeviceDriver.setMaterial(material_type); @@ -526,6 +737,39 @@ public class SSJHandServiceImpl implements SSJHandService { standardManipulatorInspectSiteDeviceDriver.setBatch(batch); device.setBatch(batch); } + if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { + standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); + + if (StrUtil.equals("0", material_type)) { + status = "0"; + } + if (StrUtil.equals("1", material_type)) { + status = "1"; + } + if ("2,3,4,5".contains(material_type)) { + status = "2"; + } + standardOrdinarySiteDeviceDriver.setHasGoods(Integer.parseInt(status)); + device.setHas_goods(Integer.parseInt(status)); + JSONObject jo = new JSONObject(); + jo.put("device_code", device_code); + jo.put("hasGoodStatus", status); + jo.put("batch", batch); + jo.put("material_type", material_type); + jo.put("model", model); + jo.put("process", process); + jo.put("weight", weight); + jo.put("qc_status", qc_status); + jo.put("date", date); + jo.put("operation_by", operation_by); + deviceService.changeDeviceStatus(jo); + if (!StrUtil.isEmpty(material_type)) { + standardOrdinarySiteDeviceDriver.setMaterial(material_type); + } + if (!StrUtil.isEmpty(batch)) { + standardOrdinarySiteDeviceDriver.setBatch(batch); + } + } } //清空 if (type.equals("2")) { @@ -539,10 +783,36 @@ public class SSJHandServiceImpl implements SSJHandService { jo.put("batch", ""); jo.put("material_type", ""); jo.put("put_goods_time", ""); + jo.put("model", ""); + jo.put("process", ""); + jo.put("weight", ""); + jo.put("qc_status", ""); + jo.put("date", ""); + jo.put("operation_by", ""); deviceService.changeDeviceStatus(jo); ssjCacheSiteDeviceDriver.setMaterial(""); ssjCacheSiteDeviceDriver.setBatch(""); } + if (device.getDeviceDriver() instanceof StandardInspectSiteSmartDeviceDriver) { + standardInspectSiteSmartDeviceDriver = (StandardInspectSiteSmartDeviceDriver) device.getDeviceDriver(); + standardInspectSiteSmartDeviceDriver.setHasGoods(0); + device.setHas_goods(0); + JSONObject jo = new JSONObject(); + jo.put("device_code", device_code); + jo.put("hasGoodStatus", "0"); + jo.put("batch", ""); + jo.put("material_type", ""); + jo.put("put_goods_time", ""); + jo.put("model", ""); + jo.put("process", ""); + jo.put("weight", ""); + jo.put("qc_status", ""); + jo.put("date", ""); + jo.put("operation_by", ""); + deviceService.changeDeviceStatus(jo); + standardInspectSiteSmartDeviceDriver.setMaterial(""); + standardInspectSiteSmartDeviceDriver.setBatch(""); + } if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); standardInspectSiteDeviceDriver.setMaterial(""); @@ -557,6 +827,26 @@ public class SSJHandServiceImpl implements SSJHandService { standardManipulatorInspectSiteDeviceDriver.setBatch(""); device.setBatch(""); } + if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { + standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); + standardOrdinarySiteDeviceDriver.setHasGoods(0); + device.setHas_goods(0); + JSONObject jo = new JSONObject(); + jo.put("device_code", device_code); + jo.put("hasGoodStatus", "0"); + jo.put("batch", ""); + jo.put("material_type", ""); + jo.put("put_goods_time", ""); + jo.put("model", ""); + jo.put("process", ""); + jo.put("weight", ""); + jo.put("qc_status", ""); + jo.put("date", ""); + jo.put("operation_by", ""); + deviceService.changeDeviceStatus(jo); + standardOrdinarySiteDeviceDriver.setMaterial(""); + standardOrdinarySiteDeviceDriver.setBatch(""); + } } resultJson.put("code", "1"); resultJson.put("desc", "更新成功"); diff --git a/qd/src/views/acs/device/driver/standard_inspect_site_smart.vue b/qd/src/views/acs/device/driver/standard_inspect_site_smart.vue index 9c55606..39f2c9a 100644 --- a/qd/src/views/acs/device/driver/standard_inspect_site_smart.vue +++ b/qd/src/views/acs/device/driver/standard_inspect_site_smart.vue @@ -92,6 +92,11 @@ + + + + + @@ -129,11 +134,11 @@ - - - + + + - +