Browse Source

opt 优化已知的问题

modify-1
李永德 6 months ago
parent
commit
505d0614d2
  1. 33
      lms/nladmin-system/src/main/java/org/nl/wms/pda/rest/PdaController.java
  2. 20
      lms/nladmin-system/src/main/java/org/nl/wms/pda/service/PdaService.java
  3. 63
      lms/nladmin-system/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java
  4. 15
      lms/nladmin-system/src/main/java/org/nl/wms/pda/wql/PDA.wql
  5. 8
      lms/nladmin-system/src/main/java/org/nl/wms/sch/manage/TaskType.java

33
lms/nladmin-system/src/main/java/org/nl/wms/pda/rest/PdaController.java

@ -274,8 +274,8 @@ public class PdaController {
@Log("人工异常处理-任务显示")
@ApiOperation("人工异常处理-任务显示")
@PdaAnnotation
public JSONObject manualExceptionHandlingTaskShow() {
return PdaUtils.buildSuccessResultJSON(pdaService.manualExceptionHandlingTaskShow());
public JSONObject manualExceptionHandlingTaskShow(@RequestBody JSONObject param) {
return PdaUtils.buildSuccessResultJSON(pdaService.manualExceptionHandlingTaskShow(param));
}
@PostMapping("/manual/ExceptionHandlingTask/list")
@Log("人工异常处理-点位下拉框")
@ -284,6 +284,13 @@ public class PdaController {
public JSONObject manualExceptionHandlingTaskList() {
return PdaUtils.buildSuccessResultJSON(pdaService.manualExceptionHandlingTaskList());
}
@PostMapping("/manual/ExceptionHandlingTask/regionList")
@Log("人工异常处理-区域下拉框")
@ApiOperation("人工异常处理-区域下拉框")
@PdaAnnotation
public JSONObject manualExceptionHandlingTaskRegionList() {
return PdaUtils.buildSuccessResultJSON(pdaService.manualExceptionHandlingTaskRegionList());
}
@PostMapping("/manual/ExceptionHandlingTask")
@Log("人工异常处理")
@ -358,8 +365,8 @@ public class PdaController {
}
@PostMapping("/manual/suppress/createTask")
@Log("压制料任务")
@ApiOperation("压制料任务")
@Log("压制料任务")
@ApiOperation("压制料任务")
@PdaAnnotation
public JSONObject suppressCreateTask(@RequestBody JSONObject param) {
pdaService.suppressCreateTask(param);
@ -367,8 +374,8 @@ public class PdaController {
}
@PostMapping("/manual/suppress/taskShow")
@Log("压制料任务显示")
@ApiOperation("压制料任务显示")
@Log("压制料任务显示")
@ApiOperation("压制料任务显示")
@PdaAnnotation
public JSONObject suppressTaskShow() {
return PdaUtils.buildSuccessResultJSON(pdaService.suppressTaskShow());
@ -408,6 +415,13 @@ public class PdaController {
pdaService.kilnOutCreateTask(param);
return PdaUtils.buildSuccessResultJSON(null);
}
@PostMapping("/manual/kiln/out/createTaskShow")
@Log("出窑任务请求显示")
@ApiOperation("出窑任务显示")
@PdaAnnotation
public JSONObject kilnOutCreateTaskShow() {
return PdaUtils.buildSuccessResultJSON(pdaService.kilnOutCreateTaskShow());
}
// ====================================================================
@PostMapping("/manual/kiln/move/createTask")
@ -418,6 +432,13 @@ public class PdaController {
pdaService.kilnMoveCreateTask(param);
return PdaUtils.buildSuccessResultJSON(null);
}
@PostMapping("/manual/kiln/move/createTaskShow")
@Log("窑后移库任务请求")
@ApiOperation("窑后移库任务请求")
@PdaAnnotation
public JSONObject kilnMoveCreateTaskShow() {
return PdaUtils.buildSuccessResultJSON(pdaService.kilnMoveCreateTaskShow());
}
@PostMapping("/manual/kiln/move/pointList")
@Log("窑后移库点位下拉数据")
@ApiOperation("窑后移库点位下拉数据")

20
lms/nladmin-system/src/main/java/org/nl/wms/pda/service/PdaService.java

@ -135,7 +135,7 @@ public interface PdaService {
* 人工异常处理-任务查看
* @return /
*/
JSONArray manualExceptionHandlingTaskShow();
JSONArray manualExceptionHandlingTaskShow(JSONObject param);
/**
* 人工混碾搬运
@ -244,4 +244,22 @@ public interface PdaService {
* @param param /
*/
void samplingCountNum(JSONObject param);
/**
* 区域下拉框
* @return
*/
JSONArray manualExceptionHandlingTaskRegionList();
/**
* 出窑任务
* @return /
*/
JSONArray kilnOutCreateTaskShow();
/**
* 转移
* @return /
*/
JSONArray kilnMoveCreateTaskShow();
}

63
lms/nladmin-system/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java

@ -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());
}
}

15
lms/nladmin-system/src/main/java/org/nl/wms/pda/wql/PDA.wql

@ -17,6 +17,7 @@
输入.where TYPEAS f_string
输入.region_code TYPEAS s_string
输入.handle_class TYPEAS s_string
输入.task_type TYPEAS s_string
输入.point_type TYPEAS f_string
输入.types TYPEAS f_string
@ -112,6 +113,11 @@
LEFT JOIN sch_base_point p ON p.point_code = t.point_code1
LEFT JOIN sch_base_point p1 ON p1.point_code = t.point_code2
WHERE t.task_status < '7' AND t.task_status > '3'
OPTION 输入.region_code <> ""
(p.region_code = 输入.region_code
OR
p1.region_code = 输入.region_code)
ENDOPTION
ENDSELECT
ENDQUERY
ENDIF
@ -143,7 +149,7 @@
`sch_base_task` t
LEFT JOIN sch_base_point p ON p.point_code = t.point_code1
LEFT JOIN sch_base_point p1 ON p1.point_code = t.point_code2
WHERE t.task_status = '7'
WHERE t.task_status = '7' AND t.task_type = 输入.task_type
AND t.handle_class = 输入.handle_class
AND TIMESTAMPDIFF(HOUR, t.create_time, NOW()) < 1;
ENDSELECT
@ -165,8 +171,11 @@
`sch_base_task` t
LEFT JOIN sch_base_point p ON p.point_code = t.point_code1
LEFT JOIN sch_base_point p1 ON p1.point_code = t.point_code2
WHERE t.task_status < '7'
AND t.task_type = '6'
WHERE (t.task_status < '7'
AND t.task_type = '6') OR (
t.task_status = '7' AND t.task_type = '8'
AND t.handle_class = 'org.nl.wms.pda.service.impl.PdaServiceImpl'
AND TIMESTAMPDIFF(HOUR, t.create_time, NOW()) < 1)
ENDSELECT
ENDQUERY
ENDIF

8
lms/nladmin-system/src/main/java/org/nl/wms/sch/manage/TaskType.java

@ -17,7 +17,13 @@ public enum TaskType {
SEND_EMPTY("送空", "3"),
CALL_EMPTY("叫空", "4"),
TO_PACKAGE("去包装", "5"),
PDA_TASK("PDA任务", "6");
PDA_TASK("PDA任务", "6"),
PDA_HN("人工混碾", "7"),
PDA_MATERIAL_TRANSFER("泥料转移", "8"),
PDA_PRESS_UP("压制上料", "9"),
PDA_PRESS_DOWN("压制下料", "10"),
PDA_OUT_KILN("人工出窑", "11"),
PDA_VEHICLE_TRANSFER("载具转移", "12");
private final String label;
private final String value;

Loading…
Cancel
Save