|
|
@ -631,20 +631,21 @@ public class PdaServiceImpl implements PdaService { |
|
|
|
if (ObjectUtil.isEmpty(taskObject)) { |
|
|
|
throw new BadRequestException("任务「" + taskId + "」不存在!"); |
|
|
|
} |
|
|
|
if (ObjectUtil.isNotEmpty(param.getString("target_point"))) { |
|
|
|
taskObject.put("point_code2", param.getString("target_point")); |
|
|
|
if (ObjectUtil.isNotEmpty(param.getString("end_point"))) { |
|
|
|
taskObject.put("point_code2", param.getString("end_point")); |
|
|
|
} |
|
|
|
taskObject.put("task_status", TaskStatus.FINISHED.value()); |
|
|
|
TaskUtils.addCurrentUpdateColum(taskObject); |
|
|
|
taskTab.update(taskObject); |
|
|
|
log.info("任务「{}」已经更新目的地「{}」并完成", taskId, param.getString("target_point")); |
|
|
|
log.info("任务「{}」已经更新目的地「{}」并完成", taskId, param.getString("end_point")); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public JSONArray manualExceptionHandlingTaskShow() { |
|
|
|
public JSONArray manualExceptionHandlingTaskShow(JSONObject param) { |
|
|
|
return WQL |
|
|
|
.getWO("PDA") |
|
|
|
.addParam("flag", "4") |
|
|
|
.addParam("region_code", param.getString("region_code")) |
|
|
|
.process() |
|
|
|
.getResultJSONArray(0); |
|
|
|
} |
|
|
@ -742,9 +743,13 @@ public class PdaServiceImpl implements PdaService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public JSONArray getMixingTaskList() { |
|
|
|
return getTaskList(TaskType.PDA_HN.value()); |
|
|
|
} |
|
|
|
public JSONArray getTaskList(String task_type) { |
|
|
|
return WQL |
|
|
|
.getWO("PDA") |
|
|
|
.addParam("flag", "6") |
|
|
|
.addParam("task_type", task_type) |
|
|
|
.addParam("handle_class", "org.nl.wms.pda.service.impl.PdaServiceImpl") |
|
|
|
.process() |
|
|
|
.getResultJSONArray(0); |
|
|
@ -767,10 +772,11 @@ public class PdaServiceImpl implements PdaService { |
|
|
|
WQLObject vd_table = WQLObject.getWQLObject("st_ivt_vehicle_detail"); |
|
|
|
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point"); |
|
|
|
WQLObject taskTab = WQLObject.getWQLObject("sch_base_task"); |
|
|
|
// param: start_point, end_point, vehicle_code
|
|
|
|
// param: start_point, end_point, vehicle_code, is_agv
|
|
|
|
String startPoint = param.getString("start_point"); |
|
|
|
String endPoint = param.getString("end_point"); |
|
|
|
String vehicleCode = param.getString("vehicle_code"); |
|
|
|
String isAgv = param.getString("is_agv"); |
|
|
|
JSONObject point1 = pointTab.query("point_code = '" + startPoint + "'").uniqueResult(0); |
|
|
|
JSONObject point2 = pointTab.query("point_code = '" + endPoint + "'").uniqueResult(0); |
|
|
|
// 校验任务
|
|
|
@ -787,12 +793,30 @@ public class PdaServiceImpl implements PdaService { |
|
|
|
JSONObject taskParam = new JSONObject(); |
|
|
|
taskParam.put("point1", point1); |
|
|
|
taskParam.put("point2", point2); |
|
|
|
taskParam.put("vehicle_type", "1"); |
|
|
|
taskParam.put("vehicle_type", VehicleType.CUP.value()); |
|
|
|
taskParam.put("vehicle_code", vehicleCode); |
|
|
|
taskParam.put("create_mode", CreateMode.SCCJ.value()); |
|
|
|
taskParam.put("group_id", groupInfo.getString("vd_id")); |
|
|
|
if ("1".equals(isAgv)) { |
|
|
|
PDATask pdaTask = SpringContextHolder.getBean(PDATask.class); |
|
|
|
pdaTask.createTask(taskParam); |
|
|
|
} else { |
|
|
|
// 不是AGV就是人工搬运。
|
|
|
|
taskParam.put("task_id", IdUtil.getSnowflake().nextId()); |
|
|
|
taskParam.put("task_code", CodeUtil.getNewCode("TASK_CODE")); |
|
|
|
taskParam.put("task_name", "人工泥料转移"); |
|
|
|
taskParam.put("task_type", TaskType.PDA_MATERIAL_TRANSFER.value()); |
|
|
|
taskParam.put("task_status", TaskStatus.FINISHED.value()); |
|
|
|
taskParam.put("material_id", groupInfo.getString("material_id")); |
|
|
|
taskParam.put("priority", "1"); |
|
|
|
taskParam.put("is_auto_issue", "0"); |
|
|
|
taskParam.put("handle_class", this.getClass().getName()); |
|
|
|
taskParam.put("request_param", param); |
|
|
|
taskParam.put("create_id", SecurityUtils.getCurrentUserId()); |
|
|
|
taskParam.put("create_name", SecurityUtils.getCurrentNickName()); |
|
|
|
taskParam.put("create_time", DateUtil.now()); |
|
|
|
taskTab.insert(taskParam); |
|
|
|
} |
|
|
|
log.info("手持任务创建成功"); |
|
|
|
} |
|
|
|
|
|
|
@ -845,7 +869,7 @@ public class PdaServiceImpl implements PdaService { |
|
|
|
task.put("task_id", IdUtil.getSnowflake().nextId()); |
|
|
|
task.put("task_code", CodeUtil.getNewCode("TASK_CODE")); |
|
|
|
task.put("task_name", "人工布料机上料"); |
|
|
|
task.put("task_type", TaskType.SEND_MATERIAL.value()); |
|
|
|
task.put("task_type", TaskType.PDA_PRESS_UP.value()); |
|
|
|
task.put("task_status", TaskStatus.FINISHED.value()); |
|
|
|
task.put("point_code1", startPoint); |
|
|
|
task.put("point_code2", endPoint); |
|
|
@ -943,7 +967,7 @@ public class PdaServiceImpl implements PdaService { |
|
|
|
task.put("task_id", IdUtil.getSnowflake().nextId()); |
|
|
|
task.put("task_code", CodeUtil.getNewCode("TASK_CODE")); |
|
|
|
task.put("task_name", "人工压机下料"); |
|
|
|
task.put("task_type", TaskType.SEND_MATERIAL.value()); |
|
|
|
task.put("task_type", TaskType.PDA_PRESS_DOWN.value()); |
|
|
|
task.put("task_status", TaskStatus.FINISHED.value()); |
|
|
|
task.put("point_code1", startPoint); |
|
|
|
task.put("point_code2", endPoint); |
|
|
@ -978,7 +1002,7 @@ public class PdaServiceImpl implements PdaService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public JSONArray suppressDownShow() { |
|
|
|
return this.getMixingTaskList(); |
|
|
|
return getTaskList(TaskType.PDA_PRESS_DOWN.value()); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -1012,7 +1036,7 @@ public class PdaServiceImpl implements PdaService { |
|
|
|
task.put("task_id", IdUtil.getSnowflake().nextId()); |
|
|
|
task.put("task_code", CodeUtil.getNewCode("TASK_CODE")); |
|
|
|
task.put("task_name", "人工出窑任务"); |
|
|
|
task.put("task_type", TaskType.SEND_MATERIAL.value()); |
|
|
|
task.put("task_type", TaskType.PDA_OUT_KILN.value()); |
|
|
|
task.put("task_status", TaskStatus.FINISHED.value()); |
|
|
|
task.put("point_code1", startPoint); |
|
|
|
task.put("point_code2", endPoint); |
|
|
@ -1060,7 +1084,7 @@ public class PdaServiceImpl implements PdaService { |
|
|
|
task.put("task_id", IdUtil.getSnowflake().nextId()); |
|
|
|
task.put("task_code", CodeUtil.getNewCode("TASK_CODE")); |
|
|
|
task.put("task_name", "人工移库任务"); |
|
|
|
task.put("task_type", TaskType.SEND_MATERIAL.value()); |
|
|
|
task.put("task_type", TaskType.PDA_VEHICLE_TRANSFER.value()); |
|
|
|
task.put("task_status", TaskStatus.FINISHED.value()); |
|
|
|
task.put("point_code1", startPoint); |
|
|
|
task.put("point_code2", endPoint); |
|
|
@ -1107,7 +1131,7 @@ public class PdaServiceImpl implements PdaService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public JSONArray suppressTaskShow() { |
|
|
|
return this.getMixingTaskList(); |
|
|
|
return getTaskList(TaskType.PDA_PRESS_UP.value()); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -1149,4 +1173,19 @@ public class PdaServiceImpl implements PdaService { |
|
|
|
TaskUtils.addCurrentUpdateColum(groupObj); |
|
|
|
vd_table.update(groupObj); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public JSONArray manualExceptionHandlingTaskRegionList() { |
|
|
|
return region("send_material"); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public JSONArray kilnOutCreateTaskShow() { |
|
|
|
return getTaskList(TaskType.PDA_OUT_KILN.value()); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public JSONArray kilnMoveCreateTaskShow() { |
|
|
|
return this.getTaskList(TaskType.PDA_VEHICLE_TRANSFER.value()); |
|
|
|
} |
|
|
|
} |
|
|
|