惠氏任务生成更新
This commit is contained in:
@@ -1094,10 +1094,54 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
||||
standardEmptyPalletSiteDeviceDriver.setContainer(vehicle_code);
|
||||
} else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
||||
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
|
||||
standardInspectSiteDeviceDriver.setMaterial(material_type);
|
||||
standardInspectSiteDeviceDriver.setBatch(batch);
|
||||
device.setMaterial_type(material_type);
|
||||
device.setBatch(batch);
|
||||
if (StrUtil.isNotEmpty(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);
|
||||
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.setRemark(remark);
|
||||
device.setQuantity(quantity);
|
||||
device.setBatch(batch);
|
||||
device.setIslock(islock);
|
||||
JSONObject updatejson = JSONObject.fromObject(obj);
|
||||
runpointwo.update(updatejson, "device_code = '" + device_code + "'");
|
||||
}
|
||||
} else if (device.getDeviceDriver() instanceof YkbkSpecialDeviceDriver) {
|
||||
ykbkSpecialDeviceDriver = (YkbkSpecialDeviceDriver) device.getDeviceDriver();
|
||||
ykbkSpecialDeviceDriver.setMaterial(material_type);
|
||||
|
||||
@@ -242,59 +242,7 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
return;
|
||||
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:
|
||||
if (!emptyrequireSucess){
|
||||
//mode = 5 并且工位上无货时申请空托盘
|
||||
|
||||
@@ -674,6 +674,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
// throw new RuntimeException("设备:" + device_code + " 已存在该起点的任务");
|
||||
// }
|
||||
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
|
||||
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
|
||||
for (int j = 0; j < list.size(); j++) {
|
||||
RouteLineDto routeLineDto = list.get(j);
|
||||
next_device_code = routeLineDto.getNext_device_code();
|
||||
@@ -688,6 +689,18 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
} else {
|
||||
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 {
|
||||
next_device_code = "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user