From 1bd7049bcdff8c9968095a425b5ea79df114d3b8 Mon Sep 17 00:00:00 2001 From: liyongde <1419499670@qq.com> Date: Tue, 12 Nov 2024 09:34:28 +0800 Subject: [PATCH] =?UTF-8?q?opt:=20=E8=A1=A8=E5=A4=84=E5=8C=BA=E5=9F=9F?= =?UTF-8?q?=E7=9A=84=E5=86=B7=E5=8D=B4=E5=8C=BA=E5=8C=BA=E5=88=86=E9=94=82?= =?UTF-8?q?=E7=94=B5=E9=93=9C=E7=AE=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mps/service/impl/BakingServiceImpl.java | 28 ++++++++++++++++--- .../mps/service/impl/RawFoilServiceImpl.java | 18 +++++++++++- .../wms/pda/mps/wql/PDA_OVENINANDOUT_01.wql | 10 +++++-- .../org/nl/wms/pda/mps/wql/PDA_RAWFOIL_01.wql | 9 ++++-- .../org/nl/wms/sch/tasks/InCoolIvtTask.java | 2 +- 5 files changed, 57 insertions(+), 10 deletions(-) diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/BakingServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/BakingServiceImpl.java index dde4d27b6..961bd0aeb 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/BakingServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/BakingServiceImpl.java @@ -114,7 +114,7 @@ public class BakingServiceImpl implements BakingService { } /* - * 根据点位判断是 冷却区入烘箱还是暂存区入烘箱 + * 根据点位判断是 冷却区入烘箱还是暂存区(对接位)入烘箱 */ JSONObject jsonPointZc = pointTab.query("point_code = '" + point_code1 + "'").uniqueResult(0); @@ -209,9 +209,19 @@ public class BakingServiceImpl implements BakingService { /* * 冷却区入烘箱 */ - + // hint: 两个都找不到点位,可能是使用了满轴位请求,查找冷却区域 // 1.根据冷却区此母卷的点位找到对应的暂存区、找到空位 - JSONObject jsonCoolIvt = coolIvtTab.query("full_point_code = '" + point_code1 + "' and is_used = '1' AND point_type = '1'").uniqueResult(0); + // 根据标箔/锂电判断类型 + String point_type = "1"; + if (raw_jo.getString("product_area").equals("B2")) { + String orderType = raw_jo.getString("order_type"); + // order_type 1-标箔;2-锂电 + if ("2".equals(orderType)) { + point_type = "4"; + } + } + // 冷却点 + JSONObject jsonCoolIvt = coolIvtTab.query("full_point_code = '" + point_code1 + "' and is_used = '1' AND point_type = '" + point_type + "'").uniqueResult(0); if (ObjectUtil.isEmpty(jsonCoolIvt)) { throw new BadRequestException("请扫描正确的冷却区或对接点位!"); } @@ -424,6 +434,7 @@ public class BakingServiceImpl implements BakingService { } this.createHotIoMst(hotParam); } else { + // 出烘箱,创建桁架任务到对接位 if (!in_area_id.contains(product_area)) { throw new BadRequestException("当前登录人员暂无【" + product_area + "】操作权限"); } @@ -548,6 +559,7 @@ public class BakingServiceImpl implements BakingService { @Override @Transactional(rollbackFor = Exception.class) public JSONObject inCoolIvt(JSONObject whereJson) { + // 手持-烘烤-质检合格 WQLObject pointTab = WQLObject.getWQLObject("SCH_BASE_Point"); // 点位点 WQLObject coolTab = WQLObject.getWQLObject("ST_IVT_CoolRegionIO"); // 冷却区出入表 WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表 @@ -605,7 +617,15 @@ public class BakingServiceImpl implements BakingService { if (!jsonPoint.getString("product_area").equals("B2")) { map.put("point_location", jsonPoint.getString("point_location")); } - + map.put("point_type", "1"); + // B2出来要根据锂电或者标箔去不同地方 + if (jsonPoint.getString("product_area").equals("B2")) { + String orderType = raw_jo.getString("order_type"); + // order_type 1-标箔;2-锂电 + if ("2".equals(orderType)) { + map.put("point_type", "4"); + } + } JSONObject jsonCooIvt = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().uniqueResult(0); // 如果为空 if (ObjectUtil.isEmpty(jsonCooIvt) && !jsonPoint.getString("product_area").equals("B2")) { diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/RawFoilServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/RawFoilServiceImpl.java index e3ac65b7c..3d8661810 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/RawFoilServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/RawFoilServiceImpl.java @@ -172,12 +172,14 @@ public class RawFoilServiceImpl implements RawFoilService { map.put("flag", "6"); map.put("product_area", jsonSb.getString("product_area")); map.put("point_location", jsonSb.getString("point_location")); + // 查找冷却区空轴位状态是空轴的点位 JSONObject jsonIvt = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0); // 3.如果没找到则继续找下一节点 if (ObjectUtil.isEmpty(jsonIvt)) { String point_location = jsonSb.getString("point_location"); if (StrUtil.equals(point_location, "0")) map.put("point_location", "1"); if (StrUtil.equals(point_location, "1")) map.put("point_location", "0"); + // 没有找到就往其他位置(上下位置)查找 jsonIvt = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0); if (ObjectUtil.isEmpty(jsonIvt)) { throw new BadRequestException("未查询到有空轴的点位!"); @@ -187,6 +189,7 @@ public class RawFoilServiceImpl implements RawFoilService { //查询可用的对接位 String reging_id = ""; String product_area = jsonSb.getString("product_area"); + // 获取对应的烘箱对接位区域id switch (product_area) { case "A1": reging_id = RegionTypeEnum.A_HKZC.getId(); @@ -213,11 +216,12 @@ public class RawFoilServiceImpl implements RawFoilService { cache_map.put("flag", "4"); cache_map.put("reging_id", reging_id); cache_map.put("point_location", jsonSb.getString("point_location")); - //只找入箱点位 + //只找入箱点位(point_type : 4) cache_map.put("point_type", "4"); JSONObject point_code2_jo = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(cache_map).process().uniqueResult(0); if (ObjectUtil.isEmpty(point_code2_jo)) { + // 找不到就找其他上下位置的 cache_map.put("point_location", jsonSb.getString("point_location").equals("0") ? "1" : "0"); point_code2_jo = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(cache_map).process().uniqueResult(0); } @@ -246,6 +250,18 @@ public class RawFoilServiceImpl implements RawFoilService { map.put("flag", "1"); map.put("product_area", jsonSb.getString("product_area")); map.put("point_location", jsonSb.getString("point_location")); + // 如果是B2, 需要根据标箔或者锂电来判断是哪个位置 + if (jsonSb.getString("product_area").equals("B2")) { + String orderType = jsonRaw.getString("order_type"); + // order_type 1-标箔;2-锂电 + if ("2".equals(orderType)) { + map.put("point_type", "4"); + } else { + map.put("point_type", "1"); + } + } else { + map.put("point_type", "1"); + } JSONObject jsonIvt = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0); // 3.如果没找到则继续找下一节点 if (ObjectUtil.isEmpty(jsonIvt)) { diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/wql/PDA_OVENINANDOUT_01.wql b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/wql/PDA_OVENINANDOUT_01.wql index 423409657..a84b3417b 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/wql/PDA_OVENINANDOUT_01.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/wql/PDA_OVENINANDOUT_01.wql @@ -21,6 +21,7 @@ 输入.cant_location TYPEAS f_string 输入.mater_flag TYPEAS s_string 输入.mater_flag TYPEAS s_string + 输入.point_type TYPEAS s_string [临时表] @@ -164,7 +165,12 @@ AND full_point_status = '01' AND empty_point_status = '01' AND is_used = '1' - AND point_type = '1' + OPTION 输入.point_type <> "" + point_type = 输入.point_type + ENDOPTION + OPTION 输入.point_type = "" + point_type = '1' + ENDOPTION AND NOT EXISTS ( SELECT @@ -313,4 +319,4 @@ ORDER BY in_order_seq desc ENDSELECT ENDQUERY - ENDIF \ No newline at end of file + ENDIF diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/wql/PDA_RAWFOIL_01.wql b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/wql/PDA_RAWFOIL_01.wql index 5e5c24a04..ce479f4c5 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/wql/PDA_RAWFOIL_01.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/wql/PDA_RAWFOIL_01.wql @@ -19,6 +19,7 @@ 输入.point_code TYPEAS s_string 输入.container_name TYPEAS s_string 输入.product_area TYPEAS s_string + 输入.point_type TYPEAS s_string 输入.in_area_id TYPEAS f_string @@ -56,8 +57,12 @@ ivt.full_point_status = '01' AND ivt.is_used = '1' - AND - point_type = '1' + OPTION 输入.point_type <> "" + ivt.point_type = 输入.point_type + ENDOPTION + OPTION 输入.point_type = "" + ivt.point_type = '1' + ENDOPTION AND NOT EXISTS ( SELECT diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/InCoolIvtTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/InCoolIvtTask.java index 5566f45a4..84968319a 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/InCoolIvtTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/InCoolIvtTask.java @@ -215,7 +215,7 @@ public class InCoolIvtTask extends AbstractAcsTask { json.put("acs_task_type", "3"); tab.insert(json); - this.immediateNotifyAcs(null); +// this.immediateNotifyAcs(null); return json.getString("task_id"); }