更新
This commit is contained in:
@@ -209,10 +209,10 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
finish_instruction();
|
||||
logServer.deviceExecuteLog(device_code, "", "", "入库输送线任务开始反馈完成状态,反馈成功,指令号:" + task);
|
||||
} else {
|
||||
if (!StrUtil.equals(inst.getExecute_code(), this.device_code)) {
|
||||
inst.setExecute_device_code(this.device_code);
|
||||
instructionService.update(inst);
|
||||
}
|
||||
// if (!StrUtil.equals(inst.getExecute_code(), this.device_code)) {
|
||||
// inst.setExecute_device_code(this.device_code);
|
||||
// instructionService.update(inst);
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -777,41 +777,80 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
} else {
|
||||
this.require_apply_strangulation_time = date;
|
||||
String vehicle_code = "";
|
||||
if (task > 0) {
|
||||
Instruction instruction = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||
if(ObjectUtil.isEmpty(instruction)){
|
||||
message = "申请捆扎电气设备任务号:" + task + "未找到对应指令";
|
||||
throw new RuntimeException("该电气任务号未找到对应指令!");
|
||||
}
|
||||
vehicle_code = instruction.getVehicle_code();
|
||||
} else {
|
||||
logServer.deviceExecuteLog(device_code, "", "", "申请捆扎电气设备任务号:" + task + "异常");
|
||||
message = "申请捆扎电气设备任务号:" + task + "异常";
|
||||
throw new RuntimeException("任务号为空!");
|
||||
}
|
||||
if (StrUtil.isEmpty(vehicle_code)) {
|
||||
logServer.deviceExecuteLog(device_code, "", "", "申请捆扎电气设备任务号:" + task + "未找到载具号");
|
||||
message = "申请捆扎电气设备任务号:" + task + "未找到载具号";
|
||||
throw new RuntimeException("载具号为空!");
|
||||
}
|
||||
ApplyLabelingAndBindingRequest applyLabelingAndBindingRequest =
|
||||
new ApplyLabelingAndBindingRequest();
|
||||
JSONObject device_json = WQLObject.getWQLObject("acs_storage_cell").query("storage_code ='" + this.device_code + "'").uniqueResult(0);
|
||||
String start_point_code = null;
|
||||
if (!ObjectUtil.isEmpty(device_json)) {
|
||||
start_point_code = (String) device_json.get("parent_storage_code") == null ? this.device_code : (String) device_json.get("parent_storage_code");
|
||||
}
|
||||
applyLabelingAndBindingRequest.setDevice_code(start_point_code);
|
||||
applyLabelingAndBindingRequest.setType("2");
|
||||
applyLabelingAndBindingRequest.setVehicle_code(vehicle_code);
|
||||
ApplyLabelingAndBindingResponse applyLabelingAndBindingResponse = acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest);
|
||||
if (applyLabelingAndBindingResponse.getstatus() == 200) {
|
||||
if (ObjectUtil.isNotEmpty(applyLabelingAndBindingResponse.getData())) {
|
||||
Map datas = applyLabelingAndBindingResponse.getData();
|
||||
String length = datas.get("box_length").toString();
|
||||
String width = datas.get("box_width").toString();
|
||||
String box_high = datas.get("box_high").toString();
|
||||
String bundle_times = datas.get("bundle_times").toString();
|
||||
// if (task > 0) {
|
||||
// Instruction instruction = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||
// if(ObjectUtil.isEmpty(instruction)){
|
||||
// message = "申请捆扎电气设备任务号:" + task + "未找到对应指令";
|
||||
// throw new RuntimeException("该电气任务号未找到对应指令!");
|
||||
// }
|
||||
// vehicle_code = instruction.getVehicle_code();
|
||||
// } else {
|
||||
// logServer.deviceExecuteLog(device_code, "", "", "申请捆扎电气设备任务号:" + task + "异常");
|
||||
// message = "申请捆扎电气设备任务号:" + task + "异常";
|
||||
// throw new RuntimeException("任务号为空!");
|
||||
// }
|
||||
// if (StrUtil.isEmpty(vehicle_code)) {
|
||||
// logServer.deviceExecuteLog(device_code, "", "", "申请捆扎电气设备任务号:" + task + "未找到载具号");
|
||||
// message = "申请捆扎电气设备任务号:" + task + "未找到载具号";
|
||||
// throw new RuntimeException("载具号为空!");
|
||||
// }
|
||||
// ApplyLabelingAndBindingRequest applyLabelingAndBindingRequest =
|
||||
// new ApplyLabelingAndBindingRequest();
|
||||
// JSONObject device_json = WQLObject.getWQLObject("acs_storage_cell").query("storage_code ='" + this.device_code + "'").uniqueResult(0);
|
||||
// String start_point_code = null;
|
||||
// if (!ObjectUtil.isEmpty(device_json)) {
|
||||
// start_point_code = (String) device_json.get("parent_storage_code") == null ? this.device_code : (String) device_json.get("parent_storage_code");
|
||||
// }
|
||||
// applyLabelingAndBindingRequest.setDevice_code(start_point_code);
|
||||
// applyLabelingAndBindingRequest.setType("2");
|
||||
// applyLabelingAndBindingRequest.setVehicle_code(vehicle_code);
|
||||
// ApplyLabelingAndBindingResponse applyLabelingAndBindingResponse = acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest);
|
||||
// if (applyLabelingAndBindingResponse.getstatus() == 200) {
|
||||
// if (ObjectUtil.isNotEmpty(applyLabelingAndBindingResponse.getData())) {
|
||||
// Map datas = applyLabelingAndBindingResponse.getData();
|
||||
// String length = datas.get("box_length").toString();
|
||||
// String width = datas.get("box_width").toString();
|
||||
// String box_high = datas.get("box_high").toString();
|
||||
// String bundle_times = datas.get("bundle_times").toString();
|
||||
//
|
||||
// List list = new ArrayList();
|
||||
// Map map = new HashMap();
|
||||
// map.put("code", "to_length");
|
||||
// map.put("value", length);
|
||||
// list.add(map);
|
||||
// Map map2 = new HashMap();
|
||||
// map2.put("code", "to_weight");
|
||||
// map2.put("value", width);
|
||||
// list.add(map2);
|
||||
// Map map3 = new HashMap();
|
||||
// map3.put("code", "to_height");
|
||||
// map3.put("value", box_high);
|
||||
// list.add(map3);
|
||||
// Map map4 = new HashMap();
|
||||
// map4.put("code", "to_strap_times");
|
||||
// map4.put("value", bundle_times);
|
||||
// list.add(map4);
|
||||
// Map map5 = new HashMap();
|
||||
// map5.put("code", "to_command");
|
||||
// map5.put("value", "4");
|
||||
// list.add(map5);
|
||||
// this.writing(list);
|
||||
//// this.writing(list);
|
||||
//
|
||||
// message = "申请捆扎成功";
|
||||
// requireSucess = true;
|
||||
// } else {
|
||||
// message = "未返回尺寸信息";
|
||||
// }
|
||||
//
|
||||
// } else {
|
||||
// message = applyLabelingAndBindingResponse.getMessage();
|
||||
// }
|
||||
Thread.sleep(10000);
|
||||
String length = "1280";
|
||||
String width = "800";
|
||||
String box_high = "400";
|
||||
String bundle_times = "2";
|
||||
|
||||
List list = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
@@ -838,14 +877,6 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
// this.writing(list);
|
||||
|
||||
message = "申请捆扎成功";
|
||||
requireSucess = true;
|
||||
} else {
|
||||
message = "未返回尺寸信息";
|
||||
}
|
||||
|
||||
} else {
|
||||
message = applyLabelingAndBindingResponse.getMessage();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -860,6 +891,12 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||
message = "申请空盘入库任务中...";
|
||||
|
||||
if(taskserver.querySameOriginTask(this.device_code) > 0 ){
|
||||
message = "已存在空盘出库任务不再请求";
|
||||
return;
|
||||
}
|
||||
|
||||
JSONObject apply = new JSONObject();
|
||||
apply.put("device_code", device_code);
|
||||
apply.put("type", "2");
|
||||
@@ -927,6 +964,10 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
} else {
|
||||
this.require_empty_out_time = date;
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||
if(taskserver.querySameDestinationTask(this.device_code) > 0 ){
|
||||
message = "已存在空盘出库任务不再请求";
|
||||
return;
|
||||
}
|
||||
message = "申请空盘出库任务中...";
|
||||
JSONObject apply = new JSONObject();
|
||||
apply.put("device_code", device_code);
|
||||
|
||||
@@ -298,7 +298,7 @@ public interface TaskService {
|
||||
Integer querySameOriginTask(String code);
|
||||
|
||||
/**
|
||||
* 查询相同起终任务的数量
|
||||
* 查询相同终点任务的数量
|
||||
*
|
||||
* @param code
|
||||
* @return
|
||||
|
||||
@@ -1567,11 +1567,29 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
|
||||
@Override
|
||||
public Integer querySameOriginTask(String code) {
|
||||
return null;
|
||||
int num = 0;
|
||||
Iterator<TaskDto> iterator = tasks.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
TaskDto task = iterator.next();
|
||||
if (StrUtil.equals(task.getStart_device_code(),code)) {
|
||||
num++;
|
||||
}
|
||||
}
|
||||
|
||||
return num;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer querySameDestinationTask(String code) {
|
||||
return null;
|
||||
int num = 0;
|
||||
Iterator<TaskDto> iterator = tasks.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
TaskDto task = iterator.next();
|
||||
if (StrUtil.equals(task.getNext_device_code(),code)) {
|
||||
num++;
|
||||
}
|
||||
}
|
||||
|
||||
return num;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user