From 204e5bde5f5e0a7846a6ca425ecb914c688b4a0e Mon Sep 17 00:00:00 2001 From: liuxy Date: Wed, 2 Nov 2022 20:19:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mes/service/impl/MesToLmsServiceImpl.java | 8 ++++++ .../mps/service/impl/BakingServiceImpl.java | 18 ++++++------- .../mps/service/impl/RawFoilServiceImpl.java | 26 +++++++++++-------- .../wms/pda/mps/wql/PDA_OVENINANDOUT_01.wql | 2 +- .../java/org/nl/wms/sch/tasks/OutHotTask.java | 2 +- 5 files changed, 34 insertions(+), 22 deletions(-) diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/ext/mes/service/impl/MesToLmsServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/ext/mes/service/impl/MesToLmsServiceImpl.java index 6d99246bd..8a73064f3 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/ext/mes/service/impl/MesToLmsServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/ext/mes/service/impl/MesToLmsServiceImpl.java @@ -215,10 +215,13 @@ public class MesToLmsServiceImpl implements MesToLmsService { JSONObject result = new JSONObject(); WQLObject sbTab = WQLObject.getWQLObject("st_ivt_sbpointivt"); // 生箔点位库存表 + WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表 try { + String containerName = param.getString("ContainerName"); String resourceName = param.getString("ResourceName"); if (ObjectUtil.isEmpty(resourceName)) throw new BadRequestException("机台编码不能为空"); + if (ObjectUtil.isEmpty(containerName)) throw new BadRequestException("母卷号不能为空"); JSONObject jsonSb = sbTab.query("ext_code = '" + resourceName + "' and is_used = '1'").uniqueResult(0); if (ObjectUtil.isEmpty(jsonSb)) throw new BadRequestException("点位设备不存在"); @@ -235,6 +238,11 @@ public class MesToLmsServiceImpl implements MesToLmsService { throw new BadRequestException(resultAcs.getString("message ")); } + // 更新工单状态 + JSONObject jsonRaw = rawTab.query("container_name = '" + containerName + "'").uniqueResult(0); + jsonRaw.put("status", "03"); + rawTab.update(jsonRaw); + result.put("RTYPE", "S"); result.put("RTMSG", "操作成功!"); result.put("RTOAL", 1); 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 a580f6c81..7835186e1 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 @@ -162,7 +162,7 @@ public class BakingServiceImpl implements BakingService { if (ObjectUtil.isEmpty(point_code2)) throw new BadRequestException("没有空暂存位"); // 查询烘箱对应的空位 - JSONObject jsonHotIvt = hosIvtTab.query("product_area = '" + product_area + "' and temperature = '" + temperature + "' and point_location = '" + map.getString("point_location") + "' and is_used = '1' and point_status = '00' order by point_code ASC").uniqueResult(0); + JSONObject jsonHotIvt = hosIvtTab.query("product_area = '" + product_area + "' and temperature = '" + temperature + "' and point_location = '" + map.getString("point_location") + "' and is_used = '1' and point_status = '01' order by point_code ASC").uniqueResult(0); if (ObjectUtil.isEmpty(jsonHotIvt)) throw new BadRequestException("烘烤区没有对应空位"); // 3.创建冷却区 --> 烘烤区任务 @@ -199,8 +199,8 @@ public class BakingServiceImpl implements BakingService { this.createHotDtl(hotParam); // 生成冷却区出入表 - Long currentUserId = SecurityUtils.getCurrentUserId(); - String currentUsername = SecurityUtils.getCurrentUsername(); + Long currentUserId = 2L; + String currentUsername = "mes用户"; JSONObject jsonCool = new JSONObject(); jsonCool.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId()); @@ -353,8 +353,8 @@ public class BakingServiceImpl implements BakingService { this.createHotDtl(hotParam); // 生成冷却区出入表 - Long currentUserId = SecurityUtils.getCurrentUserId(); - String currentUsername = SecurityUtils.getCurrentUsername(); + Long currentUserId = 2L; + String currentUsername = "mes用户"; JSONObject jsonRaw = rawTab.query("container_name = '" + container_name + "' and is_delete = '0'").uniqueResult(0); JSONObject jsonMater = materTab.query("material_code = '" + jsonRaw.getString("product_name") + "'").uniqueResult(0); @@ -406,8 +406,8 @@ public class BakingServiceImpl implements BakingService { jsonHotMst.put("qty_unit_id", param.getString("qty_unit_id")); jsonHotMst.put("create_mode", "03"); jsonHotMst.put("task_id", param.getString("task_id")); - jsonHotMst.put("create_id", SecurityUtils.getCurrentUserId()); - jsonHotMst.put("create_name", SecurityUtils.getCurrentUsername()); + jsonHotMst.put("create_id", 2); + jsonHotMst.put("create_name", "mes用户"); jsonHotMst.put("create_time", DateUtil.now()); hotMstTab.insert(jsonHotMst); @@ -430,8 +430,8 @@ public class BakingServiceImpl implements BakingService { jsonHotDtl.put("oven_time", param.getString("oven_time")); jsonHotDtl.put("task_type", "1"); jsonHotDtl.put("task_id", param.getString("task_id")); - jsonHotDtl.put("create_id", SecurityUtils.getCurrentUserId()); - jsonHotDtl.put("create_name", SecurityUtils.getCurrentUsername()); + jsonHotDtl.put("create_id", 2); + jsonHotDtl.put("create_name", "mes用户"); jsonHotDtl.put("create_time", DateUtil.now()); jsonHotDtl.put("dtl_status", "10"); hotDtlTab.insert(jsonHotDtl); 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 30ad55b2a..b9ebab32e 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 @@ -123,26 +123,30 @@ public class RawFoilServiceImpl implements RawFoilService { @Transactional(rollbackFor = Exception.class) public JSONObject needEmptyAxis(JSONObject whereJson) { - WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); - WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); + WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); // 任务表 + WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表 WQLObject regionTab = WQLObject.getWQLObject("ST_IVT_CoolRegionIO"); // 冷却区出入表 WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase"); // 物料信息表 + WQLObject sbTab = WQLObject.getWQLObject("ST_IVT_SbPointIvt"); // 生箔点位库存表 JSONObject raw_jo = whereJson.getJSONObject("raw_jo"); JSONObject jsonRaw = rawTab.query("workorder_id = '" + raw_jo.getString("workorder_id") + "'").uniqueResult(0); if (!StrUtil.equals(jsonRaw.getString("status"), "01")) throw new BadRequestException("工单状态不为开始"); + JSONObject jsonSb = sbTab.query("ext_code = '" + jsonRaw.getString("resource_name") + "'").uniqueResult(0); + if (ObjectUtil.isEmpty(jsonSb)) throw new BadRequestException("生箔点位不存在"); + String start_pint_code = ""; // 2.根据就近原则查对应空卷抽 JSONObject map = new JSONObject(); map.put("flag", "1"); - map.put("product_area", raw_jo.getString("product_area")); - map.put("point_location", raw_jo.getString("point_location")); + 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 = raw_jo.getString("point_location"); + 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"); JSONObject jsonIvt_tow = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0); @@ -158,12 +162,12 @@ public class RawFoilServiceImpl implements RawFoilService { String point_code4= ""; JSONObject map4 = new JSONObject(); map4.put("flag", "2"); - map4.put("product_area", raw_jo.getString("product_area")); - map4.put("point_location", raw_jo.getString("point_location")); + map4.put("product_area", jsonSb.getString("product_area")); + map4.put("point_location", jsonSb.getString("point_location")); 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"); + String point_location = jsonSb.getString("point_location"); if (StrUtil.equals(point_location, "0")) { map4.put("point_location", "1"); } @@ -182,8 +186,8 @@ public class RawFoilServiceImpl implements RawFoilService { // 起点和终点确定 生成任务 JSONObject param = new JSONObject(); param.put("point_code1", start_pint_code); - param.put("point_code2", jsonRaw.getString("point_code")); - param.put("point_code3", jsonRaw.getString("point_code")); + param.put("point_code2", jsonSb.getString("point_code")); + param.put("point_code3", jsonSb.getString("point_code")); param.put("point_code4", point_code4); param.put("task_type", "010101"); param.put("material_code", jsonRaw.getString("container_name")); @@ -208,7 +212,7 @@ public class RawFoilServiceImpl implements RawFoilService { jsonRegion.put("qty", jsonRaw.getString("productin_qty")); jsonRegion.put("qty_unit_id", jsonMater.get("base_unit_id")); jsonRegion.put("bill_status", "10"); - jsonRegion.put("start_point_code", jsonRaw.getString("point_code")); + jsonRegion.put("start_point_code", jsonSb.getString("point_code")); jsonRegion.put("end_point_code", point_code4); jsonRegion.put("cust_id", ""); jsonRegion.put("create_mode", "03"); 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 60bfba9c8..512407aa5 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 @@ -50,7 +50,7 @@ WHERE is_delete = '0' AND is_used = '1' - AND point_status = '00' + AND point_status = '1' OPTION 输入.reging_id <> "" region_id = 输入.reging_id diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/OutHotTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/OutHotTask.java index 54a49b527..51c1c7f6c 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/OutHotTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/OutHotTask.java @@ -126,7 +126,7 @@ public class OutHotTask extends AbstractAcsTask { pointTab.update(jsonPoint2); // 更新烘箱区库存状态 - jsonHotIvt.put("point_status", "00"); + jsonHotIvt.put("point_status", "01"); jsonHotIvt.put("container_name","" ); jsonHotIvt.put("workorder_id","" ); jsonHotIvt.put("ivt_qty",0 );