rev: 修改任务类型

This commit is contained in:
2023-04-04 10:36:58 +08:00
parent a657c83600
commit 70a26fc2c5
9 changed files with 31 additions and 23 deletions

View File

@@ -43,6 +43,13 @@ public enum AcsTaskEnum {
//
AGV_SYSTEM_NB("1","诺宝机器人任务"),
AGV_SYSTEM_XC("1","叉车任务"),
TASK_TYPE_AGV_DOUBLE_STATION("0101","AGV双工位"),
TASK_TYPE_CLEANING_TASK("0102","清洗任务"),
TASK_TYPE_PLOTTER_FULL_OF_MATERIAL("010301","刻字满料"),
TASK_TYPE_PLOTTER_FILL_THE_BLANK_BOX("010302","刻字补空框"),
TASK_TYPE_WARP_CALL_MATERIAL("010401","包装叫料"),
TASK_TYPE_WARP_SEND_BLANK_BOX("010402","包装送空框"),
;
private String code;
private String desc;

View File

@@ -167,14 +167,14 @@ public class PointServiceImpl implements PointService {
dto.setUpdate_name(nickName);
String pointStatus = dto.getPoint_status();
if (ObjectUtil.isNotEmpty(pointStatus) && pointStatus.equals("1")) { // 空位
if (ObjectUtil.isNotEmpty(pointStatus) && pointStatus.equals(StatusEnum.POINT_STATUS_EMPTY.getCode())) { // 空位
dto.setMaterial_id("");
dto.setVehicle_type("");
dto.setVehicle_code("");
dto.setVehicle_qty(0);
} else if (pointStatus.equals("3")) { // 空载具
} else if (pointStatus.equals(StatusEnum.POINT_STATUS_EMPTY_VEHICLE.getCode())) { // 空载具
dto.setMaterial_id(null);
} else if (pointStatus.equals("2")) { // 有料
} else if (pointStatus.equals(StatusEnum.POINT_STATUS_FULL.getCode())) { // 有料
if (ObjectUtil.isEmpty(dto.getMaterial_id())) throw new BadRequestException("物料不能为空");
JSONObject materialObj = materialBaseTab.query("material_id = '" + dto.getMaterial_id() + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(materialObj)) throw new BadRequestException("未找到该物料");

View File

@@ -98,7 +98,9 @@ public class PlotterCallEmptyTask extends AbstractAcsTask {
throw new BadRequestException("终点不能为空!");
}
// 判断当前点是否有未完成的任务
JSONObject taskObj = taskTab.query("is_delete='0' and point_code2 = '" + end_point_code + "' and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
JSONObject taskObj = taskTab.query("is_delete='0' and point_code2 = '" + end_point_code + "' " +
"and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "' " +
"and task_status <> '" + TaskStatusEnum.CANCEL.getCode() + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(taskObj)) {
throw new BadRequestException("当前点位" + end_point_code + "存在未完成的任务");
}
@@ -108,13 +110,12 @@ public class PlotterCallEmptyTask extends AbstractAcsTask {
throw new BadRequestException("下发工单不存在未完成工单:"+workorder);
}
// 查找任务状态
// JSONObject classObj = classTab.query("class_code = '010301'").uniqueResult(0);
String taskdtl_id = IdUtil.getSnowflake(1, 1).nextIdStr();
JSONObject task = new JSONObject();
task.put("task_id", taskdtl_id);
task.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
task.put("task_name", "刻字机呼叫空框");
// task.put("task_type", classObj.getString("class_id")); // todo: 未知
task.put("task_type", AcsTaskEnum.TASK_TYPE_PLOTTER_FILL_THE_BLANK_BOX.getCode()); // todo: 未知
task.put("task_status", StatusEnum.TASK_CREATE.getCode());
task.put("material_id", workOrderObj.getString("material_id"));
task.put("point_code2", end_point_code);

View File

@@ -107,13 +107,12 @@ public class WrapCallMaterialTask extends AbstractAcsTask {
throw new BadRequestException("下发工单不存在未完成工单:"+workorder);
}
// 查找任务状态
// JSONObject classObj = classTab.query("class_code = '010301'").uniqueResult(0);
String taskdtl_id = IdUtil.getSnowflake(1, 1).nextIdStr();
JSONObject task = new JSONObject();
task.put("task_id", taskdtl_id);
task.put("task_name", "包装叫料");
task.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
// task.put("task_type", classObj.getString("class_id")); // todo: 未知
task.put("task_type", AcsTaskEnum.TASK_TYPE_WARP_CALL_MATERIAL.getCode()); // todo: 未知
task.put("task_status", StatusEnum.TASK_CREATE.getCode());
task.put("point_code2", end_point_code);
task.put("handle_class", this.getClass().getName());

View File

@@ -96,7 +96,9 @@ public class WrapSendEmptyTask extends AbstractAcsTask {
throw new BadRequestException("起点不能为空!");
}
// 判断当前点是否有未完成的任务
JSONObject taskObj = taskTab.query("is_delete='0' and point_code1 = '" + start_point_code + "' and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
JSONObject taskObj = taskTab.query("is_delete='0' and point_code1 = '" + start_point_code + "' " +
"and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "' " +
"and task_status <> '" + TaskStatusEnum.CANCEL.getCode() + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(taskObj)) {
throw new BadRequestException("当前点位" + start_point_code + "存在未完成的任务");
}
@@ -106,14 +108,12 @@ public class WrapSendEmptyTask extends AbstractAcsTask {
// if (ObjectUtil.isEmpty(workOrderObj)){
// throw new BadRequestException("下发工单不存在未完成工单:"+workorder);
// }
// 查找任务状态
// JSONObject classObj = classTab.query("class_code = '010301'").uniqueResult(0);
String taskdtl_id = IdUtil.getSnowflake(1, 1).nextId() + "";
JSONObject task = new JSONObject();
task.put("task_id", taskdtl_id);
task.put("task_name", "包装送空框");
task.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
// task.put("task_type", classObj.getString("class_id")); // todo: 未知
task.put("task_type", AcsTaskEnum.TASK_TYPE_WARP_SEND_BLANK_BOX.getCode()); // todo: 未知
task.put("task_status", StatusEnum.TASK_CREATE.getCode());
task.put("point_code1", start_point_code);
task.put("handle_class", this.getClass().getName());

View File

@@ -111,13 +111,12 @@ public class PlotterSendMaterialTask extends AbstractAcsTask {
throw new BadRequestException("下发工单不存在未完成工单:"+workorder);
}
// 查找任务状态
JSONObject classObj = classTab.query("class_code = '010301'").uniqueResult(0);
String taskdtl_id = IdUtil.getSnowflake(1, 1).nextId() + "";
JSONObject task = new JSONObject();
task.put("task_id", taskdtl_id);
task.put("task_name", "刻字机送料");
task.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
task.put("task_type", classObj.getString("class_id")); // todo: 未知
task.put("task_type", AcsTaskEnum.TASK_TYPE_PLOTTER_FULL_OF_MATERIAL.getCode()); // todo: 未知
task.put("material_id", workOrderObj.getString("material_id"));
task.put("task_status", StatusEnum.TASK_CREATE.getCode());
task.put("point_code1", start_point_code);

View File

@@ -57,7 +57,8 @@
reg1.region_name as point1_region_name,
reg2.region_name as point2_region_name,
reg3.region_name as point3_region_name,
reg4.region_name as point4_region_name
reg4.region_name as point4_region_name,
cl.class_name
FROM
sch_base_task task
LEFT JOIN md_pb_classstandard md ON task.task_type = md.class_code
@@ -74,6 +75,7 @@
LEFT JOIN SCH_BASE_Region reg4 ON reg4.region_code = (
SELECT p4.region_code FROM SCH_BASE_Point p4 WHERE p4.point_code = task.point_code4
)
LEFT JOIN MD_PB_ClassStandard cl ON cl.class_code = task.task_type
WHERE
task.is_delete = '0'
OPTION 输入.task_type <> ""

View File

@@ -274,13 +274,13 @@ export default {
},
// 提交前的验证
[CRUD.HOOK.afterValidateCU]() {
if (this.form.parent_class_id !== null && this.form.parent_class_id === this.form.class_id) {
this.$message({
message: '顶级类目不能为空',
type: 'warning'
})
return false
}
// if (this.form.parent_class_id !== null && this.form.parent_class_id === this.form.class_id) {
// this.$message({
// message: '顶级类目不能为空',
// type: 'warning'
// })
// return false
// }
if (this.form.isTop === '1') {
this.form.parent_class_id = 0
}

View File

@@ -133,7 +133,7 @@
<el-table-column v-if="true" prop="task_id" label="任务标识" min-width="150" show-overflow-tooltip />
<el-table-column v-if="true" prop="material_id" label="物料标识" min-width="150" show-overflow-tooltip />
<el-table-column prop="task_code" label="任务编码" min-width="100" show-overflow-tooltip />
<el-table-column v-if="false" prop="task_type" label="任务类型" />
<el-table-column prop="class_name" label="任务类型" min-width="100"/>
<el-table-column prop="acs_task_type" label="acs任务类型" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
{{ dict.label.SCH_TASK_TYPE_DTL[scope.row.acs_task_type] }}