opt: B2烘烤质检优先送到中专架

This commit is contained in:
2025-01-07 09:02:02 +08:00
parent f184e184f5
commit 4be3280f46
3 changed files with 70 additions and 27 deletions

View File

@@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.b_lms.sch.point.service.IschBasePointService;
import org.nl.common.utils.SecurityUtils; import org.nl.common.utils.SecurityUtils;
import org.nl.modules.common.exception.BadRequestException; import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.common.utils.RedisUtils; import org.nl.modules.common.utils.RedisUtils;
@@ -619,13 +620,21 @@ public class BakingServiceImpl implements BakingService {
} }
map.put("point_type", "1"); map.put("point_type", "1");
// B2出来要根据锂电或者标箔去不同地方状态5 // B2出来要根据锂电或者标箔去不同地方状态5
if (jsonPoint.getString("product_area").equals("B2")) {
String orderType = raw_jo.getString("order_type"); String orderType = raw_jo.getString("order_type");
JSONObject lithiumPoint = null;
String endPointCode = null;
if (jsonPoint.getString("product_area").equals("B2")) {
// order_type 1-标箔2-锂电 // order_type 1-标箔2-锂电
if ("2".equals(orderType)) { if ("2".equals(orderType)) {
map.put("point_type", "5"); map.put("point_type", "5");
// 如果是B2锂电就优先去表处中转区
lithiumPoint = WQL.getWO("PDA_OVENINANDOUT_01").addParam("flag", "5").process().uniqueResult(0);
if (ObjectUtil.isNotEmpty(lithiumPoint)) {
endPointCode = lithiumPoint.getString("point_code");
} }
} }
}
if (ObjectUtil.isEmpty(lithiumPoint)) {
JSONObject jsonCooIvt = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().uniqueResult(0); JSONObject jsonCooIvt = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().uniqueResult(0);
// 如果为空 // 如果为空
if (ObjectUtil.isEmpty(jsonCooIvt) && !jsonPoint.getString("product_area").equals("B2")) { if (ObjectUtil.isEmpty(jsonCooIvt) && !jsonPoint.getString("product_area").equals("B2")) {
@@ -640,11 +649,13 @@ public class BakingServiceImpl implements BakingService {
if (ObjectUtil.isEmpty(jsonCooIvt)) { if (ObjectUtil.isEmpty(jsonCooIvt)) {
throw new BadRequestException("冷却区空位不足"); throw new BadRequestException("冷却区空位不足");
} }
endPointCode = jsonCooIvt.getString("full_point_code");
}
// 3.创建任务 // 3.创建任务
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
param.put("point_code1", point_code1); param.put("point_code1", point_code1);
param.put("point_code2", jsonCooIvt.getString("full_point_code")); param.put("point_code2", endPointCode);
param.put("container_name", container_name); param.put("container_name", container_name);
param.put("product_area", jsonPoint.getString("product_area")); param.put("product_area", jsonPoint.getString("product_area"));
@@ -673,7 +684,7 @@ public class BakingServiceImpl implements BakingService {
jsonCool.put("qty_unit_id", jsonMater.get("base_unit_id")); jsonCool.put("qty_unit_id", jsonMater.get("base_unit_id"));
jsonCool.put("task_id", task_id); jsonCool.put("task_id", task_id);
jsonCool.put("start_point_code", point_code1); jsonCool.put("start_point_code", point_code1);
jsonCool.put("end_point_code", jsonCooIvt.getString("full_point_code")); jsonCool.put("end_point_code", endPointCode);
jsonCool.put("create_mode", "03"); jsonCool.put("create_mode", "03");
jsonCool.put("create_id", currentUserId); jsonCool.put("create_id", currentUserId);
jsonCool.put("create_name", currentUsername); jsonCool.put("create_name", currentUsername);

View File

@@ -341,3 +341,25 @@
ENDSELECT ENDSELECT
ENDQUERY ENDQUERY
ENDIF ENDIF
IF 输入.flag = "5"
QUERY
SELECT
*
FROM
`sch_base_point` p
WHERE
p.region_code = 'B2-BCZZ'
AND p.point_type = '8'
AND p.point_status = '1'
AND 0 = (
SELECT
COUNT(*)
FROM
sch_base_task t
WHERE
t.task_status < '07'
AND t.is_delete = '0'
AND (t.point_code1 = p.point_code OR t.point_code2 = p.point_code OR t.point_code3 = p.point_code OR t.point_code4 = p.point_code))
ENDSELECT
ENDQUERY
ENDIF

View File

@@ -114,15 +114,19 @@ public class InCoolIvtTask extends AbstractAcsTask {
// 校验终点是否存在 // 校验终点是否存在
JSONObject jsonIvt = ivtTab.query("full_point_code ='" + point_code2 + "'").uniqueResult(0); JSONObject jsonIvt = ivtTab.query("full_point_code ='" + point_code2 + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonIvt)) { if (ObjectUtil.isEmpty(jsonIvt)) {
// 判断是不是暂存位
JSONObject zzPoint = pointTab.query("point_code ='" + point_code2 + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(zzPoint)) {
throw new BadRequestException("终点未找到可用点位:" + point_code2); throw new BadRequestException("终点未找到可用点位:" + point_code2);
} }
zzPoint.put("material_code", jsonTask.getString("material_code"));
// 更新暂存位状态为空位 // 有料
JSONObject jsonPoint = pointTab.query("point_code = '" + point_code1 + "'").uniqueResult(0); zzPoint.put("point_status", "2");
jsonPoint.put("point_status", "1"); zzPoint.put("update_optid", SecurityUtils.getCurrentUserId());
jsonPoint.put("material_code", ""); zzPoint.put("update_optname", SecurityUtils.getCurrentNickName());
pointTab.update(jsonPoint); zzPoint.put("update_time", DateUtil.now());
pointTab.update(zzPoint);
} else {
// 更新冷却库存状态 // 更新冷却库存状态
JSONObject raw_jo = WQLObject.getWQLObject("pdm_bi_rawfoilworkorder").query("container_name = '" + jsonTask.getString("material_code") + "'").uniqueResult(0); JSONObject raw_jo = WQLObject.getWQLObject("pdm_bi_rawfoilworkorder").query("container_name = '" + jsonTask.getString("material_code") + "'").uniqueResult(0);
@@ -133,7 +137,13 @@ public class InCoolIvtTask extends AbstractAcsTask {
jsonIvt.put("workorder_id", raw_jo.getString("workorder_id")); jsonIvt.put("workorder_id", raw_jo.getString("workorder_id"));
jsonIvt.put("ivt_qty", raw_jo.getString("qty")); jsonIvt.put("ivt_qty", raw_jo.getString("qty"));
ivtTab.update(jsonIvt); ivtTab.update(jsonIvt);
}
// 更新暂存位状态为空位
JSONObject jsonPoint = pointTab.query("point_code = '" + point_code1 + "'").uniqueResult(0);
jsonPoint.put("point_status", "1");
jsonPoint.put("material_code", "");
pointTab.update(jsonPoint);
// 将入冷却信息发送给mes // 将入冷却信息发送给mes
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();