Browse Source

惠氏任务生成更新

master
loujf 2 years ago
parent
commit
52a2d283bd
  1. 44
      hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java
  2. 52
      hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDeviceDriver.java
  3. 13
      hd/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java

44
hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java

@ -1094,10 +1094,54 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
standardEmptyPalletSiteDeviceDriver.setContainer(vehicle_code); standardEmptyPalletSiteDeviceDriver.setContainer(vehicle_code);
} else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
if (StrUtil.isNotEmpty(material_type)) {
standardInspectSiteDeviceDriver.setMaterial(material_type); standardInspectSiteDeviceDriver.setMaterial(material_type);
device.setMaterial_type(material_type);
} else {
standardInspectSiteDeviceDriver.setMaterial("");
device.setMaterial_type("");
}
if (StrUtil.isNotEmpty(quantity)) {
standardInspectSiteDeviceDriver.setQty(quantity);
device.setQuantity(quantity);
} else {
standardInspectSiteDeviceDriver.setQty("");
device.setQuantity("");
}
if (StrUtil.isNotEmpty(remark)) {
standardInspectSiteDeviceDriver.setRemark(remark);
device.setRemark(remark);
} else {
standardInspectSiteDeviceDriver.setRemark("");
device.setRemark("");
}
if (StrUtil.isNotEmpty(batch)) {
standardInspectSiteDeviceDriver.setBatch(batch); standardInspectSiteDeviceDriver.setBatch(batch);
device.setBatch(batch);
} else {
standardInspectSiteDeviceDriver.setBatch("");
device.setBatch("");
}
if (StrUtil.isNotEmpty(islock)) {
standardInspectSiteDeviceDriver.setIslock(Boolean.valueOf(islock));
device.setIslock(islock);
}
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);
device.setHas_goods(Integer.parseInt(hasGoodStatus));
device.setMaterial_type(material_type); device.setMaterial_type(material_type);
device.setRemark(remark);
device.setQuantity(quantity);
device.setBatch(batch); device.setBatch(batch);
device.setIslock(islock);
JSONObject updatejson = JSONObject.fromObject(obj);
runpointwo.update(updatejson, "device_code = '" + device_code + "'");
}
} else if (device.getDeviceDriver() instanceof YkbkSpecialDeviceDriver) { } else if (device.getDeviceDriver() instanceof YkbkSpecialDeviceDriver) {
ykbkSpecialDeviceDriver = (YkbkSpecialDeviceDriver) device.getDeviceDriver(); ykbkSpecialDeviceDriver = (YkbkSpecialDeviceDriver) device.getDeviceDriver();
ykbkSpecialDeviceDriver.setMaterial(material_type); ykbkSpecialDeviceDriver.setMaterial(material_type);

52
hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDeviceDriver.java

@ -242,59 +242,7 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
return; return;
case 2: case 2:
//申请任务 //申请任务
// if (this.getApply_handling()) {
// String link_device_code = this.getDevice().getExtraValue().get("link_device_code").toString();
// DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
// Device link_device = appService.findDeviceByCode(link_device_code);
// StandardInspectSiteDeviceDriver standardInspectSiteDevicedriver;
// if(link_device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
// standardInspectSiteDevicedriver = (StandardInspectSiteDeviceDriver) link_device.getDeviceDriver();
// if(standardInspectSiteDevicedriver.getMode() != 2){
// log.debug("设备未待机");
// return;
// }
// if(standardInspectSiteDevicedriver.getMove() != 0){
// log.debug("设备不满足放货条件");
// return;
// }
//
// //如果目标设备申请叫料 则允许生成任务
// if(standardInspectSiteDevicedriver.getApply_material()){
// TaskDto dto = new TaskDto();
// String now = DateUtil.now();
// dto.setTask_id(IdUtil.simpleUUID());
// dto.setCreate_by(this.getDevice().getDevice_code());
// dto.setUpdate_by(this.getDevice().getDevice_code());
// dto.setStart_point_code(this.getDevice().getDevice_code());
//
// String taskcode = CodeGenerateUtil.getNewCode("TASK_NO");
// dto.setTask_code("-"+taskcode);
// dto.setTask_status("0");
// dto.setPriority("101");
// RouteLineDto jo = routelineserver.findByCode(this.getDevice().getDevice_code());
// String next_device_codecode = jo.getNext_device_code();
// if(StrUtil.isEmpty(next_device_codecode)){
// throw new RuntimeException("该设备未找到对应路由");
// }
// dto.setNext_point_code(next_device_codecode);
// dto.setUpdate_time(now);
// dto.setCreate_time(now);
//
// WQLObject wo = WQLObject.getWQLObject("acs_task");
// JSONObject json = JSONObject.fromObject(dto);
// wo.insert(json);
// standardInspectSiteDevicedriver.setApply_material(false);
// }
// }
// this.setApply_handling(false);
// }
if (material.length() > 0 && qty.length() > 0 && !requireSucess) {
this.execute_log.log("设备:" + devicecode + ",material:" + material + ",qty:" + qty);
this.instruction_require(container);
}
case 5: case 5:
if (!emptyrequireSucess){ if (!emptyrequireSucess){
//mode = 5 并且工位上无货时申请空托盘 //mode = 5 并且工位上无货时申请空托盘

13
hd/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java

@ -674,6 +674,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
// throw new RuntimeException("设备:" + device_code + " 已存在该起点的任务"); // throw new RuntimeException("设备:" + device_code + " 已存在该起点的任务");
// } // }
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
for (int j = 0; j < list.size(); j++) { for (int j = 0; j < list.size(); j++) {
RouteLineDto routeLineDto = list.get(j); RouteLineDto routeLineDto = list.get(j);
next_device_code = routeLineDto.getNext_device_code(); next_device_code = routeLineDto.getNext_device_code();
@ -688,6 +689,18 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
} else { } else {
next_device_code = ""; next_device_code = "";
} }
}
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
if (standardInspectSiteDeviceDriver.getMode() != 0
&& standardInspectSiteDeviceDriver.getHasGoods() == 0
&& !standardInspectSiteDeviceDriver.getIslock()
&& ObjectUtil.isEmpty(this.findByNextCode(next_device_code))
&& ObjectUtil.isEmpty(this.findByStartCode(device_code))) {
break;
} else {
next_device_code = "";
}
} else { } else {
next_device_code = ""; next_device_code = "";
} }

Loading…
Cancel
Save