From 0b07a1e9852427e350e9f04a130bef38179fd8be Mon Sep 17 00:00:00 2001 From: lyd <1419499670@qq.com> Date: Wed, 2 Nov 2022 16:25:50 +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 --- .../service/impl/KilnServiceImpl.java | 50 ++++++++++++------- .../basedata/service/wql/SCH_Base_Kiln01.wql | 1 + .../wms/st/basedata/inkilncache/index.vue | 17 ++++++- 3 files changed, 47 insertions(+), 21 deletions(-) diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/basedata/service/impl/KilnServiceImpl.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/basedata/service/impl/KilnServiceImpl.java index 0036004..a9799c7 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/basedata/service/impl/KilnServiceImpl.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/basedata/service/impl/KilnServiceImpl.java @@ -38,26 +38,35 @@ public class KilnServiceImpl implements KilnService { @Override public void update(JSONObject jsonObject) { + // 基础信息 Long currentUserId = SecurityUtils.getCurrentUserId(); String nickName = SecurityUtils.getNickName(); String now = DateUtil.now(); - + // 公用信息 String stockrecordId = jsonObject.getString("stockrecord_id"); String material_id = jsonObject.getString("material_id"); String vehicle_code = jsonObject.getString("vehicle_code"); String point_status = jsonObject.getString("point_status"); String ivt_qty = jsonObject.getString("ivt_qty"); - + String is_full = jsonObject.getString("is_full"); + // wql表结构 WQLObject structIvtTab = WQLObject.getWQLObject("ST_IVT_StructIvt"); WQLObject vehicleGroupTab = WQLObject.getWQLObject("st_buss_vehiclegroup"); WQLObject materialTab = WQLObject.getWQLObject("MD_ME_Material"); WQLObject pointTab = WQLObject.getWQLObject("SCH_BASE_Point"); - - JSONObject vehicleGroupObj = null; + // 共用对象 + JSONObject vehicleGroupObj = null; // 组盘信息 if (ObjectUtil.isNotEmpty(vehicle_code)) { vehicleGroupObj = vehicleGroupTab.query("vehicle_code = '" + vehicle_code + "'").uniqueResult(0); } + JSONObject materialObj = null; // 物料信息 + if (ObjectUtil.isNotEmpty(material_id)) { // 获取物料对象 + materialObj = materialTab.query("material_id = '" + jsonObject.getString("material_id") + "'").uniqueResult(0); + + } + + // 判断状态 if (point_status.equals("00")) { // 空位 // 删除仓位库存 structIvtTab.delete("struct_id = '" + jsonObject.getString("struct_id") + "'"); @@ -71,10 +80,10 @@ public class KilnServiceImpl implements KilnService { structIvt.put("stockrecord_id", IdUtil.getSnowflake(1, 1).nextId()); structIvt.put("struct_id", jsonObject.getString("struct_id")); if (ObjectUtil.isNotEmpty(vehicle_code)) - structIvt.put("vehicle_code", jsonObject.getString("vehicle_code")); + structIvt.put("vehicle_code", vehicle_code); structIvt.put("workprocedure_id", jsonObject.getString("workprocedure_id")); if (ObjectUtil.isNotEmpty(material_id)) - structIvt.put("material_id", jsonObject.getString("material_id")); + structIvt.put("material_id", material_id); structIvt.put("producetask_id", jsonObject.getString("producetask_id")); if (ObjectUtil.isNotEmpty(jsonObject.getString("ivt_qty"))) { structIvt.put("canuse_qty", ivt_qty); @@ -82,19 +91,24 @@ public class KilnServiceImpl implements KilnService { } structIvt.put("frozen_qty", 0); structIvt.put("warehousing_qty", 0); - structIvt.put("is_full", 0); + structIvt.put("is_full", is_full); + if (ObjectUtil.isNotEmpty(materialObj)) + structIvt.put("stewing_time", materialObj.getString("stewing_time")); structIvtTab.insert(structIvt); } else { // 不为空就修改 JSONObject structIvt = structIvtTab.query("stockrecord_id = '" + stockrecordId + "'").uniqueResult(0); if (ObjectUtil.isNotEmpty(vehicle_code)) - structIvt.put("vehicle_code", jsonObject.getString("vehicle_code")); + structIvt.put("vehicle_code", vehicle_code); if (ObjectUtil.isNotEmpty(material_id)) - structIvt.put("material_id", jsonObject.getString("material_id")); + structIvt.put("material_id", material_id); structIvt.put("producetask_id", jsonObject.getString("producetask_id")); - if (ObjectUtil.isNotEmpty(jsonObject.getString("ivt_qty"))) { + if (ObjectUtil.isNotEmpty(ivt_qty)) { structIvt.put("canuse_qty", ivt_qty); structIvt.put("ivt_qty", ivt_qty); } + if (ObjectUtil.isNotEmpty(materialObj)) + structIvt.put("stewing_time", materialObj.getString("stewing_time")); + structIvt.put("is_full", is_full); structIvtTab.update(structIvt); } // 组盘表 @@ -104,14 +118,11 @@ public class KilnServiceImpl implements KilnService { vehicleGroup.put("group_id", IdUtil.getSnowflake(1, 1).nextId()); vehicleGroup.put("vehicle_code", vehicle_code); vehicleGroup.put("is_autopackage", 1); - if (ObjectUtil.isNotEmpty(material_id)) { - vehicleGroup.put("material_id", jsonObject.getString("material_id")); - JSONObject material = materialTab.query("material_id = '" + jsonObject.getString("material_id") + "'").uniqueResult(0); - if (ObjectUtil.isNotEmpty(material)) { - vehicleGroup.put("material_code", material.getString("material_code")); - vehicleGroup.put("material_name", material.getString("material_name")); - vehicleGroup.put("material_spec", material.getString("material_spec")); - } + if (ObjectUtil.isNotEmpty(materialObj)) { + vehicleGroup.put("material_id", materialObj.getString("material_id")); + vehicleGroup.put("material_code", materialObj.getString("material_code")); + vehicleGroup.put("material_name", materialObj.getString("material_name")); + vehicleGroup.put("material_spec", materialObj.getString("material_spec")); } vehicleGroup.put("task_id", IdUtil.simpleUUID()); vehicleGroup.put("create_id", currentUserId); @@ -123,7 +134,7 @@ public class KilnServiceImpl implements KilnService { vehicleGroup.put("producetask_id", jsonObject.getString("producetask_id")); vehicleGroup.put("device_id", jsonObject.getString("device_id")); vehicleGroup.put("qty", ivt_qty); - vehicleGroup.put("is_full", "1"); + vehicleGroup.put("is_full", is_full); vehicleGroup.put("material_move_id", IdUtil.simpleUUID()); vehicleGroupTab.insert(vehicleGroup); } @@ -131,6 +142,7 @@ public class KilnServiceImpl implements KilnService { JSONObject point = pointTab.query("point_id = '" + jsonObject.getString("point_id") + "'").uniqueResult(0); point.put("point_status", point_status); point.put("lock_type", jsonObject.getString("lock_type")); + point.put("vehicle_code", jsonObject.getString("vehicle_code")); pointTab.update(point); } } diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/basedata/service/wql/SCH_Base_Kiln01.wql b/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/basedata/service/wql/SCH_Base_Kiln01.wql index dc3a109..4d0a819 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/basedata/service/wql/SCH_Base_Kiln01.wql +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/basedata/service/wql/SCH_Base_Kiln01.wql @@ -48,6 +48,7 @@ structattr.struct_id, structivt.stockrecord_id, structivt.material_id, + structivt.is_full, material.material_name FROM sch_base_point point diff --git a/wms/qd/src/views/wms/st/basedata/inkilncache/index.vue b/wms/qd/src/views/wms/st/basedata/inkilncache/index.vue index b7bc84b..56cca74 100644 --- a/wms/qd/src/views/wms/st/basedata/inkilncache/index.vue +++ b/wms/qd/src/views/wms/st/basedata/inkilncache/index.vue @@ -107,7 +107,7 @@ - + + + + + +