From ce661a942baee9b9ab947c0add45509f81ed0ce1 Mon Sep 17 00:00:00 2001 From: liuxy Date: Tue, 18 Oct 2022 11:04:03 +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 --- .../mps/service/impl/RawFoilServiceImpl.java | 43 +++++++++++++++---- 1 file changed, 34 insertions(+), 9 deletions(-) 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 1ef328258..69e09bd2c 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 @@ -125,8 +125,11 @@ public class RawFoilServiceImpl implements RawFoilService { public JSONObject needEmptyAxis(JSONObject whereJson) { WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); + WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); 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("工单状态不为开始"); String start_pint_code = ""; // 2.根据就近原则查对应空卷抽 @@ -157,7 +160,7 @@ public class RawFoilServiceImpl implements RawFoilService { map4.put("point_location", raw_jo.getString("point_location")); JSONObject jsonIvt4 = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0); // 3.如果没找到则继续找下一节点 - if (ObjectUtil.isEmpty(jsonIvt)) { + if (ObjectUtil.isEmpty(jsonIvt4)) { String point_location = raw_jo.getString("point_location"); if (StrUtil.equals(point_location, "0")) { map.put("point_location", "1"); @@ -186,6 +189,10 @@ public class RawFoilServiceImpl implements RawFoilService { CallEmpReelTask callEmpReelTask = new CallEmpReelTask(null); String task_id = callEmpReelTask.createTask(param); + // 更新工单状态 + jsonRaw.put("status", "02"); + rawTab.update(jsonRaw); + // 下发任务 JSONObject jsonObject = callEmpReelTask.renotifyAcs(task_id); if (StrUtil.equals(jsonObject.getString("status"), "200")) { @@ -201,28 +208,39 @@ public class RawFoilServiceImpl implements RawFoilService { @Override public void confirmBlanking(JSONObject whereJson) { + WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); + + 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"), "02")) throw new BadRequestException("工单状态不为空轴搬出"); + //查询该母卷号对应的任务 String container_name = whereJson.getString("container_name"); JSONObject task_jo = WQLObject.getWQLObject("SCH_BASE_Task").query("material_code = '"+container_name+"'").uniqueResult(0); - //下发ACS,执行取满放空的AGV动作 + + // 更新工单状态为确认下卷 } @Override public JSONObject finishBlanking(JSONObject whereJson) { - String start_pint_code = whereJson.getString("point_code"); + + JSONObject raw_jo = whereJson.getJSONObject("raw_jo"); + String start_pint_code = raw_jo.getString("point_code"); WQLObject regionTab = WQLObject.getWQLObject("ST_IVT_CoolRegionIO"); // 冷却区出入表 WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase"); // 物料表 - WQLObject coolTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表 + WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表 WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); // 任务表 //查询该母卷号对应的任务 - String container_name = whereJson.getString("container_name"); + String container_name = raw_jo.getString("container_name"); JSONObject task_jo = WQLObject.getWQLObject("SCH_BASE_Task").query("material_code = '"+container_name+"'").uniqueResult(0); - JSONObject jsonCool = coolTab.query("mfg_order_name = '" + whereJson.getString("mfg_order_name") + "'").uniqueResult(0); + 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 = ""; @@ -260,7 +278,7 @@ public class RawFoilServiceImpl implements RawFoilService { Long currentUserId = SecurityUtils.getCurrentUserId(); String currentUsername = SecurityUtils.getCurrentUsername(); - JSONObject jsonMater = materTab.query("material_code = '" + jsonCool.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()); @@ -269,7 +287,7 @@ public class RawFoilServiceImpl implements RawFoilService { jsonRegion.put("material_id", jsonMater.getString("material_id")); jsonRegion.put("pcsn", ""); jsonRegion.put("vehicle_code", ""); - jsonRegion.put("qty", jsonCool.getString("productin_qty")); + jsonRegion.put("qty", jsonRaw.getString("productin_qty")); jsonRegion.put("qty_unit_id", ""); jsonRegion.put("bill_status", "10"); jsonRegion.put("start_point_code", start_pint_code); @@ -282,6 +300,10 @@ public class RawFoilServiceImpl implements RawFoilService { jsonRegion.put("create_time", DateUtil.now()); regionTab.insert(jsonRegion); + // 更新工单状态为下卷完成 + jsonRaw.put("status", "04"); + rawTab.update(jsonRaw); + // 6.下发任务入库任务 BookTwoConfirmTask bookTwoConfirmTask = new BookTwoConfirmTask(null); JSONObject jsonObject = bookTwoConfirmTask.renotifyAcs(task_jo.getString("task_id")); @@ -307,9 +329,12 @@ public class RawFoilServiceImpl implements RawFoilService { WQLObject coolTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表 JSONObject jsonCool = coolTab.query("mfg_order_name = '" + whereJson.getString("mfg_order_name") + "'").uniqueResult(0); + + if (!StrUtil.equals(jsonCool.getString("status"), "04")) throw new BadRequestException("工单不为下卷完成"); + jsonCool.put("status", "2"); jsonCool.put("realend_time", DateUtil.now()); - jsonCool.put("finish_type", "02"); + jsonCool.put("finish_type", "09"); coolTab.update(jsonCool); JSONObject jo = new JSONObject();