代码更新

This commit is contained in:
2022-10-19 09:02:04 +08:00
parent 3b0edf8b37
commit da4099bce3
4 changed files with 48 additions and 38 deletions

View File

@@ -158,24 +158,24 @@ public class RawFoilServiceImpl implements RawFoilService {
map4.put("flag", "2");
map4.put("product_area", raw_jo.getString("product_area"));
map4.put("point_location", raw_jo.getString("point_location"));
JSONObject jsonIvt4 = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0);
JSONObject jsonIvt4 = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map4).process().uniqueResult(0);
// 3.如果没找到则继续找下一节点
if (ObjectUtil.isEmpty(jsonIvt4)) {
String point_location = raw_jo.getString("point_location");
if (StrUtil.equals(point_location, "0")) {
map.put("point_location", "1");
map4.put("point_location", "1");
}
if (StrUtil.equals(point_location, "1")) {
map.put("point_location", "0");
map4.put("point_location", "0");
}
JSONObject jsonIvt_tow = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0);
JSONObject jsonIvt_tow = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map4).process().uniqueResult(0);
if (ObjectUtil.isEmpty(jsonIvt_tow)) {
throw new BadRequestException("没有空位");
}
point_code4 = jsonIvt_tow.getString("full_point_code");
} else {
point_code4 = jsonIvt.getString("full_point_code");
point_code4 = jsonIvt4.getString("full_point_code");
}
// 起点和终点确定 生成任务
JSONObject param = new JSONObject();
@@ -184,9 +184,9 @@ public class RawFoilServiceImpl implements RawFoilService {
param.put("point_code3", raw_jo.getString("point_code"));
param.put("point_code4", point_code4);
param.put("task_type", "010101");
param.put("material_code", whereJson.getString("container_name"));
param.put("material_code", raw_jo.getString("container_name"));
CallEmpReelTask callEmpReelTask = new CallEmpReelTask(null);
CallEmpReelTask callEmpReelTask = new CallEmpReelTask();
String task_id = callEmpReelTask.createTask(param);
// 更新工单状态
@@ -242,13 +242,6 @@ public class RawFoilServiceImpl implements RawFoilService {
JSONObject jsonRaw = rawTab.query("mfg_order_name = '" + raw_jo.getString("mfg_order_name") + "'").uniqueResult(0);
if (!StrUtil.equals(jsonRaw.getString("status"), "03")) throw new BadRequestException("工单不为确认下卷");
if (ObjectUtil.isEmpty(start_pint_code)) throw new BadRequestException("起点不能为空");
String end_point_code = "";
// 1.查询此点位是否存在
PointDto jsonPoint = pointService.findByCode(start_pint_code);
if (ObjectUtil.isEmpty(jsonPoint)) throw new BadRequestException("起点点位不存在");
/*// 2.根据就近原则查对应空卷抽
JSONObject map = new JSONObject();
map.put("flag", "2");
@@ -274,24 +267,26 @@ public class RawFoilServiceImpl implements RawFoilService {
param.put("end_pint_code", end_point_code);
String task_id = bookTwoConfirmTask.createTask(param);*/
// 5.插入入库单
// 插入入库单
Long currentUserId = SecurityUtils.getCurrentUserId();
String currentUsername = SecurityUtils.getCurrentUsername();
JSONObject jsonMater = materTab.query("material_code = '" + jsonRaw.getString("product_name") + "'").uniqueResult(0);
// 测试暂时注释
// JSONObject jsonMater = materTab.query("material_code = '" + jsonRaw.getString("product_name") + "'").uniqueResult(0);
JSONObject jsonRegion = new JSONObject();
jsonRegion.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId());
jsonRegion.put("bill_code", CodeUtil.getNewCode("COOLREGION_BILL_CODE"));
jsonRegion.put("io_type", "1");
jsonRegion.put("material_id", jsonMater.getString("material_id"));
// 测试暂时注释
// jsonRegion.put("material_id", jsonMater.getString("material_id"));
jsonRegion.put("pcsn", "");
jsonRegion.put("vehicle_code", "");
jsonRegion.put("qty", jsonRaw.getString("productin_qty"));
jsonRegion.put("qty_unit_id", "");
jsonRegion.put("qty_unit_id", "1");
jsonRegion.put("bill_status", "10");
jsonRegion.put("start_point_code", start_pint_code);
jsonRegion.put("end_point_code", end_point_code);
jsonRegion.put("start_point_code", task_jo.getString("point_code2"));
jsonRegion.put("end_point_code", task_jo.getString("point_code4"));
jsonRegion.put("cust_id", "");
jsonRegion.put("create_mode", "03");
jsonRegion.put("task_id", task_jo.getString("task_id"));
@@ -304,9 +299,9 @@ public class RawFoilServiceImpl implements RawFoilService {
jsonRaw.put("status", "04");
rawTab.update(jsonRaw);
// 6.下发任务入库任务
BookTwoConfirmTask bookTwoConfirmTask = new BookTwoConfirmTask(null);
JSONObject jsonObject = bookTwoConfirmTask.renotifyAcs(task_jo.getString("task_id"));
// 下发任务入库任务
CallEmpReelTask callEmpReelTask = new CallEmpReelTask();
JSONObject jsonObject = callEmpReelTask.renotifyAcs(task_jo.getString("task_id"));
if (StrUtil.equals(jsonObject.getString("status"), "200")) {
// 成功返回 更新任务状态
JSONObject jsonTask = taskTab.query("task_id ='" + task_jo.getString("task_id") + "'").uniqueResult(0);

View File

@@ -132,7 +132,16 @@
IF 输入.flag = "5"
QUERY
SELECT
( CASE der.STATUS WHEN '1' THEN '开始' WHEN '2' THEN '结束' END ) AS status_name,
(
CASE
der.STATUS
WHEN '01' THEN '开始'
WHEN '02' THEN '空轴搬出'
WHEN '03' THEN '确认下卷'
WHEN '04' THEN '下卷完成'
WHEN '09' THEN '结束'
END
) AS status_name,
der.mfg_order_name AS mfg_order_name,
der.container_name AS container_name,
ivt.point_code,
@@ -151,8 +160,7 @@
PDM_BI_RawFoilWorkOrder der
LEFT JOIN st_ivt_sbpointivt ivt ON ivt.ext_code = der.resource_name
WHERE
der.status = '1'
AND der.is_delete = '0'
der.is_delete = '0'
OPTION 输入.point_code <> ""
der.resource_name = 输入.point_code

View File

@@ -34,7 +34,6 @@ import java.util.HashMap;
@Slf4j
public class CallEmpReelTask extends AbstractAcsTask {
private final String THIS_CLASS = CallEmpReelTask.class.getName();
private final CutConveyorTask conveyorTask;
@Override
@Transactional
@@ -55,6 +54,11 @@ public class CallEmpReelTask extends AbstractAcsTask {
}
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
// 更新冷却区出入表 状态为执行中
JSONObject jsonCool = coolTab.query("task_id = '" + task_id + "'").uniqueResult(0);
jsonCool.put("bill_status", "40");
coolTab.update(jsonCool);
// 更新任务状态为执行中
jsonTask.put("task_status", TaskStatusEnum.EXECUTING.getCode());
jsonTask.put("update_time", DateUtil.now());
@@ -91,7 +95,7 @@ public class CallEmpReelTask extends AbstractAcsTask {
if (ObjectUtil.isEmpty(jsonIvt)) throw new BadRequestException("终点未找到可用点位:" + point_code2);
// 更新冷却库存状态
JSONObject jsonRaw = rawTab.query("point_code ='" + point_code2 + "' AND status < 2 AND is_delete = '0'").uniqueResult(0);
JSONObject jsonRaw = rawTab.query("point_code ='" + point_code2 + "' AND status < 4 AND is_delete = '0'").uniqueResult(0);
jsonIvt2.put("full_point_status", "02");
jsonIvt2.put("instorage_time", DateUtil.now());
@@ -99,14 +103,14 @@ public class CallEmpReelTask extends AbstractAcsTask {
jsonIvt2.put("workorder_id", jsonRaw.getString("workorder_id"));
jsonIvt2.put("ivt_qty", jsonRaw.getString("productin_qty"));
ivtTab.update(jsonIvt2);
/*
// 更新冷却区出入表
JSONObject jsonCool = coolTab.query("task_id = '" + task_id + "'").uniqueResult(0);
jsonCool.put("bill_status","50");
jsonCool.put("confirm_optid", SecurityUtils.getCurrentUserId());
jsonCool.put("confirm_optname", SecurityUtils.getCurrentUsername());
jsonCool.put("confirm_time", DateUtil.now());
coolTab.update(jsonCool);*/
coolTab.update(jsonCool);
}
}
@@ -127,20 +131,22 @@ public class CallEmpReelTask extends AbstractAcsTask {
Long currentUserId = SecurityUtils.getCurrentUserId();
String currentUsername = SecurityUtils.getCurrentUsername();
CutConveyorTask cutConveyorTask = new CutConveyorTask();
String point_code1 = form.getString("point_code1");
String point_code2 = form.getString("point_code2");
String point_code3 = form.getString("point_code3");
String point_code4 = form.getString("point_code4");
if (conveyorTask.isSingleTask(point_code1)){
if (cutConveyorTask.isSingleTask(point_code1)){
throw new BadRequestException("点位:"+point_code1+"存在未完成的任务!");
}
if (conveyorTask.isSingleTask(point_code2)){
if (cutConveyorTask.isSingleTask(point_code2)){
throw new BadRequestException("点位:"+point_code2+"存在未完成的任务!");
}
if (conveyorTask.isSingleTask(point_code3)){
if (cutConveyorTask.isSingleTask(point_code3)){
throw new BadRequestException("点位:"+point_code3+"存在未完成的任务!");
}
if (conveyorTask.isSingleTask(point_code4)){
if (cutConveyorTask.isSingleTask(point_code4)){
throw new BadRequestException("点位:"+point_code4+"存在未完成的任务!");
}
@@ -148,6 +154,7 @@ public class CallEmpReelTask extends AbstractAcsTask {
json.put("task_id",IdUtil.getSnowflake(1,1).nextId());
json.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
json.put("task_status", "01");
json.put("material_code", form.getString("material_code"));
json.put("point_code1", form.getString("point_code1"));
json.put("point_code2", form.getString("point_code2"));
json.put("point_code3", form.getString("point_code3"));

View File

@@ -154,10 +154,10 @@ public class CutConveyorTask extends AbstractAcsTask {
//判断该点位是否存在未完成的任务
public boolean isSingleTask(String point_code){
JSONObject task1 = WQLObject.getWQLObject("SCH_BASE_Point").query("point_code1 = '"+point_code+"' AND task_status < '99' AND is_delete = '0'").uniqueResult(0);
JSONObject task2 = WQLObject.getWQLObject("SCH_BASE_Point").query("point_code2 = '"+point_code+"' AND task_status < '99' AND is_delete = '0'").uniqueResult(0);
JSONObject task3 = WQLObject.getWQLObject("SCH_BASE_Point").query("point_code3 = '"+point_code+"' AND task_status < '99' AND is_delete = '0'").uniqueResult(0);
JSONObject task4 = WQLObject.getWQLObject("SCH_BASE_Point").query("point_code4 = '"+point_code+"' AND task_status < '99' AND is_delete = '0'").uniqueResult(0);
JSONObject task1 = WQLObject.getWQLObject("SCH_BASE_Task").query("point_code1 = '"+point_code+"' AND task_status < '99' AND is_delete = '0'").uniqueResult(0);
JSONObject task2 = WQLObject.getWQLObject("SCH_BASE_Task").query("point_code2 = '"+point_code+"' AND task_status < '99' AND is_delete = '0'").uniqueResult(0);
JSONObject task3 = WQLObject.getWQLObject("SCH_BASE_Task").query("point_code3 = '"+point_code+"' AND task_status < '99' AND is_delete = '0'").uniqueResult(0);
JSONObject task4 = WQLObject.getWQLObject("SCH_BASE_Task").query("point_code4 = '"+point_code+"' AND task_status < '99' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(task1) || ObjectUtil.isNotEmpty(task2) || ObjectUtil.isNotEmpty(task3) || ObjectUtil.isNotEmpty(task4)){
return true;