rev:末次下卷、废箔下卷查询空载具逻辑;任务查询新增修改人,创建人

This commit is contained in:
2023-06-08 14:39:30 +08:00
parent 12cee738cf
commit e06f676081
8 changed files with 180 additions and 39 deletions

View File

@@ -872,6 +872,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
tran_jo.put("point_code1", translate_code1);
tran_jo.put("point_code2", translate_code2);
tran_jo.put("vehicle_code", right_point.getString("qzzno"));
if (StrUtil.isEmpty(right_point.getString("vehicle_code"))){
throw new BadRequestException("点位:"+right_point.getString("point_code")+"载具号为空!");
}
tran_jo.put("vehicle_code2", right_point.getString("vehicle_code"));
tran_jo.put("task_type", "010406");
cutConveyorTask.createTask(tran_jo);

View File

@@ -129,7 +129,10 @@ public class InServiceImpl implements InService {
JSONObject ss_jo = WQLObject.getWQLObject("sch_base_point").query("product_area = '" + convey_jo.getString("product_area") + "' AND point_type = '7'").uniqueResult(0);
form.put("point_code2", ss_jo.getString("point_code"));
form.put("task_type", "010401");
form.put("vehicle_code2", ss_jo.getString("vehicle_code"));
if (StrUtil.isEmpty(convey_jo.getString("vehicle_code"))){
throw new BadRequestException("点位:"+convey_jo.getString("point_code")+"载具号为空!");
}
form.put("vehicle_code2", convey_jo.getString("vehicle_code"));
CutConveyorTask cutConveyorTask = new CutConveyorTask();
cutConveyorTask.createTask(form);

View File

@@ -55,7 +55,7 @@ public class OutServiceImpl implements OutService {
String point_code = whereJson.getString("point_code");
String is_last = whereJson.getString("is_last");
if (StrUtil.isEmpty(is_last)){
if (StrUtil.isEmpty(is_last)) {
throw new BadRequestException("是否末次下卷不能为空!");
}
@@ -126,17 +126,34 @@ public class OutServiceImpl implements OutService {
.addParam("product_area", cut_ivt.getString("product_area"))
.addParam("point_location", cut_ivt.getString("point_location"))
.addParam("flag", "3").process().uniqueResult(0);
//查询缓存位的空载具
if (ObjectUtil.isEmpty(empty_vehicle)) {
throw new BadRequestException("未查询到可用的空载具!");
empty_vehicle = WQL.getWO("PDA_02")
.addParam("sort_seq", cut_ivt.getString("sort_seq"))
.addParam("sql_str", " ORDER BY abs(" + cut_ivt.getString("sort_seq") + "-sort_seq),point_code")
.addParam("product_area", cut_ivt.getString("product_area"))
.addParam("point_location", cut_ivt.getString("point_location"))
.addParam("flag", "303").process().uniqueResult(0);
}
JSONObject jo = new JSONObject();
jo.put("point_code1", point_code);
jo.put("point_code2", empty_vehicle.getString("point_code"));
jo.put("vehicle_code", cut_qzzno);
if (StrUtil.isEmpty(empty_vehicle.getString("vehicle_code"))){
throw new BadRequestException("点位:"+empty_vehicle.getString("point_code")+"载具号为空!");
}
jo.put("vehicle_code2", empty_vehicle.getString("vehicle_code"));
jo.put("product_area", cut_ivt.getString("product_area"));
//分切>输送线 子卷出站
jo.put("task_type", "010404");
char dtl_type = empty_vehicle.getString("point_code").charAt(empty_vehicle.getString("point_code").length() - 1);
//判断起点是否远离分切机
if (Integer.valueOf(String.valueOf(dtl_type)) % 2 == 0) {
jo.put("task_status", TaskStatusEnum.SURE_START.getCode());
jo.put("point_code2", "");
}
cutTrussTask.createTask(jo);
} else {
@@ -193,16 +210,35 @@ public class OutServiceImpl implements OutService {
.addParam("point_location", cut_ivt.getString("point_location"))
.addParam("flag", "3").process().uniqueResult(0);
if (ObjectUtil.isEmpty(empty_vehicle)) {
throw new BadRequestException("未查询到可用的空载具!");
empty_vehicle = WQL.getWO("PDA_02")
.addParam("sort_seq", cut_ivt.getString("sort_seq"))
.addParam("sql_str", " ORDER BY abs(" + cut_ivt.getString("sort_seq") + "-sort_seq),point_code")
.addParam("product_area", cut_ivt.getString("product_area"))
.addParam("point_location", cut_ivt.getString("point_location"))
.addParam("flag", "303").process().uniqueResult(0);
if (ObjectUtil.isEmpty(empty_vehicle)) {
throw new BadRequestException("未查询到可用的空载具!");
}
}
JSONObject jo = new JSONObject();
jo.put("point_code1", point_code);
jo.put("point_code2", empty_vehicle.getString("point_code"));
jo.put("vehicle_code2", empty_vehicle.getString("vehicle_code"));
if (StrUtil.isEmpty(empty_vehicle.getString("vehicle_code"))){
throw new BadRequestException("点位:"+empty_vehicle.getString("point_code")+"载具号为空!");
}
jo.put("vehicle_code", "waste foil");
jo.put("product_area", cut_ivt.getString("product_area"));
//分切>输送线 子卷出站
jo.put("task_type", "010404");
char dtl_type = empty_vehicle.getString("point_code").charAt(empty_vehicle.getString("point_code").length() - 1);
//判断起点是否远离分切机
if (Integer.valueOf(String.valueOf(dtl_type)) % 2 == 0) {
jo.put("task_status", TaskStatusEnum.SURE_START.getCode());
jo.put("point_code2", "");
}
cutTrussTask.createTask(jo);
JSONObject result = new JSONObject();

View File

@@ -70,6 +70,9 @@ public class ShippingServiceImpl implements ShippingService {
//查询该区域点位类型为出口的点位
JSONObject ss_jo = WQLObject.getWQLObject("sch_base_point").query("product_area = '" + cut_jo.getString("product_area") + "' AND point_type = '7'").uniqueResult(0);
form.put("point_code2", ss_jo.getString("point_code"));
if (StrUtil.isEmpty(empty_vehicle.getString("vehicle_code"))){
throw new BadRequestException("点位:"+empty_vehicle.getString("point_code")+"载具号为空!");
}
form.put("vehicle_code2", empty_vehicle.getString("vehicle_code"));
form.put("task_type", "010401");
cutConveyorTask.createTask(form);
@@ -259,6 +262,9 @@ public class ShippingServiceImpl implements ShippingService {
JSONObject ss_jo2 = WQLObject.getWQLObject("sch_base_point").query("product_area = '" + cut_jo.getString("product_area") + "' AND point_type = '7'").uniqueResult(0);
form2.put("point_code2", ss_jo2.getString("point_code"));
form2.put("task_type", "010401");
if (StrUtil.isEmpty(left_point.getString("vehicle_code"))){
throw new BadRequestException("点位:"+left_point.getString("point_code")+"载具号为空!");
}
form2.put("vehicle_code2", left_point.getString("vehicle_code"));
cutConveyorTask.createTask(form2);
}
@@ -384,6 +390,9 @@ public class ShippingServiceImpl implements ShippingService {
tran_jo.put("point_code1", translate_code1);
tran_jo.put("point_code2", translate_code2);
tran_jo.put("vehicle_code", del_jo.getString("qzzno"));
if (StrUtil.isEmpty(del_jo.getString("vehicle_code"))){
throw new BadRequestException("点位:"+del_jo.getString("point_code")+"载具号为空!");
}
tran_jo.put("vehicle_code2", del_jo.getString("vehicle_code"));
tran_jo.put("task_type", "010406");
cutConveyorTask.createTask(tran_jo);

View File

@@ -166,8 +166,7 @@
FROM
sch_base_task
WHERE
( point_code1 = ivt.point_code OR point_code2 = ivt.point_code )
AND vehicle_code2 = ivt.vehicle_code
vehicle_code2 = ivt.vehicle_code
AND task_status < '07'
AND is_delete = '0'
)
@@ -183,6 +182,45 @@
ENDQUERY
ENDIF
IF 输入.flag = "303"
QUERY
SELECT
ivt.*
FROM
st_ivt_deliverypointivt ivt
INNER JOIN (
SELECT
*
FROM
( SELECT RIGHT ( point_code, 1 ) AS goal_code, point_code FROM st_ivt_deliverypointivt ) a
WHERE
MOD ( goal_code, 2 ) = 0
) b ON b.point_code = ivt.point_code
WHERE
point_status = '02'
AND ivt.is_used = '1'
AND NOT EXISTS (
SELECT
*
FROM
sch_base_task
WHERE
vehicle_code2 = ivt.vehicle_code
AND task_status < '07'
AND is_delete = '0'
)
OPTION 输入.product_area <> ""
ivt.product_area = 输入.product_area
ENDOPTION
OPTION 输入.product_area <> ""
ivt.point_location = 输入.point_location
ENDOPTION
输入.sql_str
ENDSELECT
ENDQUERY
ENDIF
IF 输入.flag = "4"
QUERY
SELECT

View File

@@ -171,6 +171,9 @@ public class CutConveyorTask extends AbstractAcsTask {
tran_jo.put("point_code1", translate_code1);
tran_jo.put("point_code2", translate_code2);
tran_jo.put("vehicle_code", right_point.getString("qzzno"));
if (StrUtil.isEmpty(right_point.getString("vehicle_code"))) {
throw new BadRequestException("点位:" + right_point.getString("point_code") + "载具号为空!");
}
tran_jo.put("vehicle_code2", right_point.getString("vehicle_code"));
tran_jo.put("task_type", "010406");
this.createTask(tran_jo);
@@ -257,6 +260,9 @@ public class CutConveyorTask extends AbstractAcsTask {
form.put("point_code1", left_point.getString("point_code"));
JSONObject ss_jo = WQLObject.getWQLObject("sch_base_point").query("product_area = '" + left_point.getString("product_area") + "' AND point_type = '7'").uniqueResult(0);
form.put("point_code2", ss_jo.getString("point_code"));
if (StrUtil.isEmpty(left_point.getString("vehicle_code"))) {
throw new BadRequestException("点位:" + left_point.getString("point_code") + "载具号为空!");
}
form.put("vehicle_code2", left_point.getString("vehicle_code"));
//分切输送出
form.put("task_type", "010401");
@@ -280,21 +286,39 @@ public class CutConveyorTask extends AbstractAcsTask {
ivtTab.update(jsonIvt2);
//如果载具横移完成时判断该气涨轴对应的分切机是否存在出站中的且终点为空状态为02的任务,则把该分切机的终点补上状态改为04并下发
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("vehicle_code = '" + jsonTask.getString("vehicle_code") + "' AND is_delete = '0' AND task_status < '07'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(task_jo)) {
if (task_jo.getString("task_type").equals("010405")) {
//入站
task_jo.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
task_jo.put("point_code1", jsonTask.getString("point_code2"));
if (StrUtil.isNotEmpty(jsonTask.getString("vehicle_code"))) {
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("vehicle_code = '" + jsonTask.getString("vehicle_code") + "' AND is_delete = '0' AND task_status < '07'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(task_jo)) {
if (task_jo.getString("task_type").equals("010405")) {
//入站
task_jo.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
task_jo.put("point_code1", jsonTask.getString("point_code2"));
}
if (task_jo.getString("task_type").equals("010403")) {
//出站
task_jo.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
task_jo.put("point_code1", jsonTask.getString("point_code2"));
task_jo.put("point_code4", jsonTask.getString("point_code2"));
}
WQLObject.getWQLObject("sch_base_task").update(task_jo);
new CutTrussTask().immediateNotifyAcs(null);
}
if (task_jo.getString("task_type").equals("010403")) {
//出站
task_jo.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
task_jo.put("point_code1", jsonTask.getString("point_code2"));
task_jo.put("point_code4", jsonTask.getString("point_code2"));
}else{
if (StrUtil.isNotEmpty(jsonTask.getString("vehicle_code2"))) {
//如果载具横移完成时,判断该空载具是否存在对应终点为空的末次下卷或者废箔下卷任务
JSONObject task_jo2 = WQLObject.getWQLObject("sch_base_task").query("vehicle_code2 = '" + jsonTask.getString("vehicle_code2") + "' AND is_delete = '0' AND task_status = '02'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(task_jo2)) {
if (task_jo2.getString("task_type").equals("010404")) {
//出站
task_jo2.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
task_jo2.put("point_code2", jsonTask.getString("point_code2"));
WQLObject.getWQLObject("sch_base_task").update(task_jo2);
new CutTrussTask().immediateNotifyAcs(null);
}
}
}
WQLObject.getWQLObject("sch_base_task").update(task_jo);
new CutTrussTask().immediateNotifyAcs(null);
}
}
}
@@ -338,14 +362,6 @@ public class CutConveyorTask extends AbstractAcsTask {
json.put("point_code2", point_code2);
json.put("vehicle_code", form.getString("vehicle_code"));
json.put("vehicle_code2", form.getString("vehicle_code2"));
String vehicle_code2 = form.getString("vehicle_code2");
if (StrUtil.isNotEmpty(vehicle_code2)) {
//判断该架子是否存在未完成的输送线任务
JSONObject vehicle_task = WQLObject.getWQLObject("sch_base_task").query("vehicle_code2 = '" + vehicle_code2 + "' AND is_delete = '0' AND task_status < '07'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(vehicle_task)) {
throw new BadRequestException("载具码:" + vehicle_code2 + "存在未完成的输送线任务!");
}
}
json.put("handle_class", THIS_CLASS);
json.put("create_id", currentUserId);
json.put("create_name", currentUsername);

View File

@@ -125,16 +125,18 @@ public class CutTrussTask extends AbstractAcsTask {
//分切>输送线 子卷出站
if (jsonTask.getString("task_type").equals("010404")) {
//更新出站气涨轴的分切计划状态
JSONArray plan_jo2 = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("qzzno = '" + jsonTask.getString("vehicle_code") + "' AND is_child_tz_ok = '1' AND is_child_ps_ok = '1' AND is_delete = '0' AND status = '06'").getResultJSONArray(0);
if (ObjectUtil.isEmpty(plan_jo2)) {
throw new BadRequestException("未查询到气涨轴:" + jsonTask.getString("vehicle_code") + "对应的分切计划!");
}
for (int i = 0; i < plan_jo2.size(); i++) {
JSONObject plan_row = plan_jo2.getJSONObject(i);
plan_row.put("status", "05");
plan_row.put("end_time", DateUtil.now());
WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").update(plan_row);
if (!jsonTask.getString("vehicle_code").equals("waste foil")) {
//更新出站气涨轴的分切计划状态
JSONArray plan_jo2 = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("qzzno = '" + jsonTask.getString("vehicle_code") + "' AND is_child_tz_ok = '1' AND is_child_ps_ok = '1' AND is_delete = '0' AND status = '06'").getResultJSONArray(0);
if (ObjectUtil.isEmpty(plan_jo2)) {
throw new BadRequestException("未查询到气涨轴:" + jsonTask.getString("vehicle_code") + "对应的分切计划!");
}
for (int i = 0; i < plan_jo2.size(); i++) {
JSONObject plan_row = plan_jo2.getJSONObject(i);
plan_row.put("status", "05");
plan_row.put("end_time", DateUtil.now());
WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").update(plan_row);
}
}
}
//分切>输送线 子卷入站
@@ -221,6 +223,9 @@ public class CutTrussTask extends AbstractAcsTask {
JSONObject ss_jo = WQLObject.getWQLObject("sch_base_point").query("product_area = '" + delivery_point.getString("product_area") + "' AND point_type = '7'").uniqueResult(0);
form.put("point_code2", ss_jo.getString("point_code"));
form.put("vehicle_code", jsonTask.getString("vehicle_code2"));
if (StrUtil.isEmpty(delivery_point.getString("vehicle_code"))) {
throw new BadRequestException("点位:" + delivery_point.getString("point_code") + "载具号为空!");
}
form.put("vehicle_code2", delivery_point.getString("vehicle_code"));
form.put("task_type", "010401");
cutConveyorTask.createTask(form);
@@ -253,6 +258,9 @@ public class CutTrussTask extends AbstractAcsTask {
form.put("point_code1", jsonTask.getString("point_code2"));
JSONObject ss_jo = WQLObject.getWQLObject("sch_base_point").query("product_area = '" + delivery_point.getString("product_area") + "' AND point_type = '7'").uniqueResult(0);
form.put("point_code2", ss_jo.getString("point_code"));
if (StrUtil.isEmpty(delivery_point.getString("vehicle_code"))) {
throw new BadRequestException("点位:" + delivery_point.getString("point_code") + "载具号为空!");
}
form.put("vehicle_code2", delivery_point.getString("vehicle_code"));
form.put("task_type", "010401");
cutConveyorTask.createTask(form);
@@ -302,10 +310,36 @@ public class CutTrussTask extends AbstractAcsTask {
form.put("point_code1", jsonTask.getString("point_code1"));
JSONObject ss_jo = WQLObject.getWQLObject("sch_base_point").query("product_area = '" + delivery_point.getString("product_area") + "' AND point_type = '7'").uniqueResult(0);
form.put("point_code2", ss_jo.getString("point_code"));
if (StrUtil.isEmpty(delivery_point.getString("vehicle_code"))) {
throw new BadRequestException("点位:" + delivery_point.getString("point_code") + "载具号为空!");
}
form.put("vehicle_code2", delivery_point.getString("vehicle_code"));
//分切输送出
form.put("task_type", "010401");
cutConveyorTask.createTask(form);
} else {
right_point = WQL.getWO("PDA_02")
.addParam("point_location", point_location)
.addParam("point_code", jsonTask.getString("point_code1"))
.addParam("product_area", product_area)
.addParam("sort_seq", sort_seq)
.addParam("find_type", "4")
.addParam("flag", "18").process().uniqueResult(0);
if (ObjectUtil.isNotEmpty(right_point)) {
//判断对应缓存位是否存在需要末次下卷或者废箔下卷的任务
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("vehicle_code2 = '" + right_point.getString("vehicle_code") + "' AND is_delete = '0' AND task_status = '02'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(task_jo)) {
if (task_jo.getString("task_type").equals("010404")) {
//出站
task_jo.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
task_jo.put("point_code2", jsonTask.getString("point_code1"));
task_jo.put("vehicle_code2", delivery_point.getString("vehicle_code"));
WQLObject.getWQLObject("sch_base_task").update(task_jo);
new CutTrussTask().immediateNotifyAcs(null);
}
}
}
}
}
}
@@ -338,12 +372,12 @@ public class CutTrussTask extends AbstractAcsTask {
/*if (cutConveyorTask.isSingleTask(point_code1) && StrUtil.isNotEmpty(point_code1)) {
throw new BadRequestException("点位:" + point_code1 + "存在未完成的任务!");
}*/
if (cutConveyorTask.isSingleTask(point_code2) && StrUtil.isNotEmpty(point_code2)) {
/*if (cutConveyorTask.isSingleTask(point_code2) && StrUtil.isNotEmpty(point_code2)) {
throw new BadRequestException("点位:" + point_code2 + "存在未完成的任务!");
}
if (cutConveyorTask.isSingleTask(point_code3) && StrUtil.isNotEmpty(point_code3)) {
throw new BadRequestException("点位:" + point_code3 + "存在未完成的任务!");
}
}*/
/*if (cutConveyorTask.isSingleTask(point_code4) && StrUtil.isNotEmpty(point_code4)) {
throw new BadRequestException("点位:" + point_code4 + "存在未完成的任务!");
}*/