任务修改
This commit is contained in:
Binary file not shown.
@@ -486,6 +486,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
jo.put("point_code1", cool_ivt.getString("full_point_code"));
|
jo.put("point_code1", cool_ivt.getString("full_point_code"));
|
||||||
jo.put("point_code2", cut_jo.getString("full_point_code"));
|
jo.put("point_code2", cut_jo.getString("full_point_code"));
|
||||||
jo.put("vehicle_code", parent_container_name);
|
jo.put("vehicle_code", parent_container_name);
|
||||||
|
jo.put("product_area", cool_ivt.getString("product_area"));
|
||||||
jo.put("task_type", "010302");
|
jo.put("task_type", "010302");
|
||||||
} else {
|
} else {
|
||||||
jo.put("point_code1", cool_ivt.getString("full_point_code"));
|
jo.put("point_code1", cool_ivt.getString("full_point_code"));
|
||||||
@@ -494,6 +495,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
jo.put("point_code4", cool_ivt.getString("full_point_code"));
|
jo.put("point_code4", cool_ivt.getString("full_point_code"));
|
||||||
jo.put("vehicle_code", parent_container_name);
|
jo.put("vehicle_code", parent_container_name);
|
||||||
jo.put("vehicle_code2", cut_jo.getString("empty_vehicle_code"));
|
jo.put("vehicle_code2", cut_jo.getString("empty_vehicle_code"));
|
||||||
|
jo.put("product_area", cool_ivt.getString("product_area"));
|
||||||
jo.put("task_type", "010301");
|
jo.put("task_type", "010301");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -117,12 +117,9 @@ public class OutServiceImpl implements OutService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
JSONObject jo = new JSONObject();
|
JSONObject jo = new JSONObject();
|
||||||
jo.put("point_code1","");
|
jo.put("point_code1",point_code);
|
||||||
jo.put("point_code2","");
|
jo.put("point_code2",empty_vehicle.getString("point_code"));
|
||||||
jo.put("point_code3",point_code);
|
jo.put("vehicle_code",cut_qzzno);
|
||||||
jo.put("point_code4",empty_vehicle.getString("point_code"));
|
|
||||||
jo.put("vehicle_code","");
|
|
||||||
jo.put("vehicle_code2",cut_qzzno);
|
|
||||||
jo.put("task_type","010404");
|
jo.put("task_type","010404");
|
||||||
cutTrussTask.createTask(jo);
|
cutTrussTask.createTask(jo);
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,14 @@ public class CoolCutTask extends AbstractAcsTask {
|
|||||||
for (int i = 0; i < arr.size(); i++) {
|
for (int i = 0; i < arr.size(); i++) {
|
||||||
JSONObject json = arr.getJSONObject(i);
|
JSONObject json = arr.getJSONObject(i);
|
||||||
|
|
||||||
|
String product_area = json.getString("product_area");
|
||||||
|
String agv_system_type = "";
|
||||||
|
if (product_area.equals("A")||product_area.equals("B")){
|
||||||
|
agv_system_type = "2";
|
||||||
|
}
|
||||||
|
if (product_area.equals("C")||product_area.equals("D")){
|
||||||
|
agv_system_type = "3";
|
||||||
|
}
|
||||||
AcsTaskDto dto = AcsTaskDto.builder()
|
AcsTaskDto dto = AcsTaskDto.builder()
|
||||||
.ext_task_id(json.getString("task_id"))
|
.ext_task_id(json.getString("task_id"))
|
||||||
.task_code(json.getString("task_code"))
|
.task_code(json.getString("task_code"))
|
||||||
@@ -51,6 +59,7 @@ public class CoolCutTask extends AbstractAcsTask {
|
|||||||
.next_device_code(json.getString("point_code2"))
|
.next_device_code(json.getString("point_code2"))
|
||||||
.vehicle_code(json.getString("vehicle_code"))
|
.vehicle_code(json.getString("vehicle_code"))
|
||||||
.priority(json.getString("priority"))
|
.priority(json.getString("priority"))
|
||||||
|
.agv_system_type(agv_system_type)
|
||||||
.remark(json.getString("remark"))
|
.remark(json.getString("remark"))
|
||||||
.build();
|
.build();
|
||||||
resultList.add(dto);
|
resultList.add(dto);
|
||||||
@@ -256,7 +265,12 @@ public class CoolCutTask extends AbstractAcsTask {
|
|||||||
json.put("create_name", currentUsername);
|
json.put("create_name", currentUsername);
|
||||||
json.put("create_time", DateUtil.now());
|
json.put("create_time", DateUtil.now());
|
||||||
json.put("priority", "1");
|
json.put("priority", "1");
|
||||||
json.put("acs_task_type", "5");
|
if (form.getString("task_type").equals("010301")){
|
||||||
|
json.put("acs_task_type", "2");
|
||||||
|
}else {
|
||||||
|
json.put("acs_task_type", "3");
|
||||||
|
}
|
||||||
|
|
||||||
tab.insert(json);
|
tab.insert(json);
|
||||||
|
|
||||||
return json.getString("task_id");
|
return json.getString("task_id");
|
||||||
|
|||||||
@@ -148,22 +148,24 @@ public class CutTrussTask extends AbstractAcsTask {
|
|||||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||||
|
|
||||||
|
CutConveyorTask cutConveyorTask = new CutConveyorTask();
|
||||||
|
|
||||||
String point_code1 = form.getString("point_code1");
|
String point_code1 = form.getString("point_code1");
|
||||||
String point_code2 = form.getString("point_code2");
|
String point_code2 = form.getString("point_code2");
|
||||||
String point_code3 = form.getString("point_code3");
|
String point_code3 = form.getString("point_code3");
|
||||||
String point_code4 = form.getString("point_code4");
|
String point_code4 = form.getString("point_code4");
|
||||||
/*if (conveyorTask.isSingleTask(point_code1)){
|
if (cutConveyorTask.isSingleTask(point_code1)) {
|
||||||
throw new BadRequestException("点位:" + point_code1 + "存在未完成的任务!");
|
throw new BadRequestException("点位:" + point_code1 + "存在未完成的任务!");
|
||||||
}
|
}
|
||||||
if (conveyorTask.isSingleTask(point_code2)){
|
if (cutConveyorTask.isSingleTask(point_code2)) {
|
||||||
throw new BadRequestException("点位:" + point_code2 + "存在未完成的任务!");
|
throw new BadRequestException("点位:" + point_code2 + "存在未完成的任务!");
|
||||||
}
|
}
|
||||||
if (conveyorTask.isSingleTask(point_code3)){
|
if (cutConveyorTask.isSingleTask(point_code3)) {
|
||||||
throw new BadRequestException("点位:" + point_code3 + "存在未完成的任务!");
|
throw new BadRequestException("点位:" + point_code3 + "存在未完成的任务!");
|
||||||
}
|
}
|
||||||
if (conveyorTask.isSingleTask(point_code4)){
|
if (cutConveyorTask.isSingleTask(point_code4)) {
|
||||||
throw new BadRequestException("点位:" + point_code4 + "存在未完成的任务!");
|
throw new BadRequestException("点位:" + point_code4 + "存在未完成的任务!");
|
||||||
}*/
|
}
|
||||||
JSONObject json = new JSONObject();
|
JSONObject json = new JSONObject();
|
||||||
json.put("task_id", IdUtil.getSnowflake(1, 1).nextId());
|
json.put("task_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||||
json.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
|
json.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
|
||||||
@@ -180,7 +182,7 @@ public class CutTrussTask extends AbstractAcsTask {
|
|||||||
json.put("create_name", currentUsername);
|
json.put("create_name", currentUsername);
|
||||||
json.put("create_time", DateUtil.now());
|
json.put("create_time", DateUtil.now());
|
||||||
json.put("priority", "1");
|
json.put("priority", "1");
|
||||||
json.put("acs_task_type","5" );
|
json.put("acs_task_type", "6");
|
||||||
tab.insert(json);
|
tab.insert(json);
|
||||||
|
|
||||||
if (form.getString("task_type").equals("010403")) {
|
if (form.getString("task_type").equals("010403")) {
|
||||||
@@ -211,9 +213,9 @@ public class CutTrussTask extends AbstractAcsTask {
|
|||||||
|
|
||||||
if (form.getString("task_type").equals("010404")) {
|
if (form.getString("task_type").equals("010404")) {
|
||||||
//更新出站气涨轴的分切计划状态
|
//更新出站气涨轴的分切计划状态
|
||||||
JSONArray plan_jo2 = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("qzzno = '"+json.getString("vehicle_code2")+"' AND is_child_tz_ok = '1' AND is_child_ps_ok = '1' AND is_delete = '0' AND status = '05'").getResultJSONArray(0);
|
JSONArray plan_jo2 = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("qzzno = '" + json.getString("vehicle_code") + "' AND is_child_tz_ok = '1' AND is_child_ps_ok = '1' AND is_delete = '0' AND status = '05'").getResultJSONArray(0);
|
||||||
if (ObjectUtil.isEmpty(plan_jo2)) {
|
if (ObjectUtil.isEmpty(plan_jo2)) {
|
||||||
throw new BadRequestException("未查询到气涨轴:"+json.getString("vehicle_code2")+"对应的分切计划!");
|
throw new BadRequestException("未查询到气涨轴:" + json.getString("vehicle_code") + "对应的分切计划!");
|
||||||
}
|
}
|
||||||
for (int i = 0; i < plan_jo2.size(); i++) {
|
for (int i = 0; i < plan_jo2.size(); i++) {
|
||||||
JSONObject plan_row = plan_jo2.getJSONObject(i);
|
JSONObject plan_row = plan_jo2.getJSONObject(i);
|
||||||
@@ -224,10 +226,18 @@ public class CutTrussTask extends AbstractAcsTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (form.getString("task_type").equals("010405")) {
|
if (form.getString("task_type").equals("010405")) {
|
||||||
|
//更新入站气涨轴的分切计划状态
|
||||||
|
JSONArray plan_jo = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("qzzno = '" + json.getString("vehicle_code") + "' AND is_child_tz_ok = '1' AND is_child_ps_ok = '1' AND is_delete = '0' AND status = '03'").getResultJSONArray(0);
|
||||||
|
if (ObjectUtil.isEmpty(plan_jo)) {
|
||||||
|
throw new BadRequestException("未查询到气涨轴:" + json.getString("vehicle_code") + "对应的分切计划!");
|
||||||
|
}
|
||||||
|
for (int i = 0; i < plan_jo.size(); i++) {
|
||||||
|
JSONObject plan_row = plan_jo.getJSONObject(i);
|
||||||
|
plan_row.put("status", "04");
|
||||||
|
plan_row.put("end_time", DateUtil.now());
|
||||||
|
WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").update(plan_row);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return json.getString("task_id");
|
return json.getString("task_id");
|
||||||
@@ -241,7 +251,6 @@ public class CutTrussTask extends AbstractAcsTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void cancel(String task_id) {
|
public void cancel(String task_id) {
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package org.nl.wms.sch.tasks;
|
|||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
@@ -40,6 +41,15 @@ public class InTask extends AbstractAcsTask {
|
|||||||
for (int i = 0; i < arr.size(); i++) {
|
for (int i = 0; i < arr.size(); i++) {
|
||||||
JSONObject json = arr.getJSONObject(i);
|
JSONObject json = arr.getJSONObject(i);
|
||||||
|
|
||||||
|
//判断该任务所在的块、排存在其他任务
|
||||||
|
String point_code2 = json.getString("point_code2");
|
||||||
|
JSONObject struct_jo = WQLObject.getWQLObject("ST_IVT_StructAttr").query("struct_code = '"+point_code2+"'").uniqueResult(0);
|
||||||
|
String row_num = struct_jo.getString("row_num");
|
||||||
|
String block_num = struct_jo.getString("block_num");
|
||||||
|
JSONObject task_jo = WQLObject.getWQLObject("ST_IVT_StructAttr").query("block_num = '"+block_num+"' AND row_num = '"+row_num+"' AND lock_type in ('3','6')").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isNotEmpty(task_jo)){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
AcsTaskDto dto = AcsTaskDto.builder()
|
AcsTaskDto dto = AcsTaskDto.builder()
|
||||||
.ext_task_id(json.getString("task_id"))
|
.ext_task_id(json.getString("task_id"))
|
||||||
.task_code(json.getString("task_code"))
|
.task_code(json.getString("task_code"))
|
||||||
@@ -124,29 +134,6 @@ public class InTask extends AbstractAcsTask {
|
|||||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||||
|
|
||||||
|
|
||||||
/*JSONObject jo = new JSONObject();
|
|
||||||
jo.put("end_point",next_device_code);
|
|
||||||
jo.put("vehicle_code",vehicle_code);
|
|
||||||
jo.put("storagevehicle_type",form.getString("storagevehicle_type"));
|
|
||||||
jo.put("storagevehicle_id",form.getString("storagevehicle_id"));
|
|
||||||
String task_code = CodeUtil.getNewCode("TASK_CODE");
|
|
||||||
String priority = "0";*/
|
|
||||||
/*TaskDto taskDto = new TaskDto();
|
|
||||||
taskDto.setTask_code(task_code);
|
|
||||||
taskDto.setTask_type(task_type);
|
|
||||||
taskDto.setTaskdtl_type(task_type);
|
|
||||||
taskDto.setStart_point_code(start_device_code);
|
|
||||||
taskDto.setNext_point_code(next_device_code);
|
|
||||||
taskDto.setVehicle_code(vehicle_code);
|
|
||||||
taskDto.setTaskdtl_type(taskdtl_type);
|
|
||||||
taskDto.setHandle_class(this.getClass().getName());
|
|
||||||
taskDto.setFinished_type("00");
|
|
||||||
taskDto.setTask_status("01");
|
|
||||||
taskService.create(taskDto);
|
|
||||||
TaskDto taskDto1 = taskService.findByCode(task_code);*/
|
|
||||||
|
|
||||||
|
|
||||||
JSONObject json = new JSONObject();
|
JSONObject json = new JSONObject();
|
||||||
json.put("task_id", IdUtil.getSnowflake(1, 1).nextId());
|
json.put("task_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||||
json.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
|
json.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
|
||||||
@@ -160,7 +147,7 @@ public class InTask extends AbstractAcsTask {
|
|||||||
json.put("create_name", currentUsername);
|
json.put("create_name", currentUsername);
|
||||||
json.put("create_time", DateUtil.now());
|
json.put("create_time", DateUtil.now());
|
||||||
json.put("priority", "1");
|
json.put("priority", "1");
|
||||||
json.put("acs_task_type", "5");
|
json.put("acs_task_type", "7");
|
||||||
WQLObject.getWQLObject("SCH_BASE_Task").insert(json);
|
WQLObject.getWQLObject("SCH_BASE_Task").insert(json);
|
||||||
|
|
||||||
return json.getString("task_id");
|
return json.getString("task_id");
|
||||||
|
|||||||
@@ -489,6 +489,9 @@
|
|||||||
b.placement_type = a.placement_type
|
b.placement_type = a.placement_type
|
||||||
)
|
)
|
||||||
输入.sql_str
|
输入.sql_str
|
||||||
|
ENDSELECT
|
||||||
|
ENDQUERY
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user