From b3f59428ee3612bc8fbaac44abe335bc2dea86be Mon Sep 17 00:00:00 2001 From: "ZHOUZ\\Noble'lift" <1014987728@qq.com> Date: Sun, 8 Oct 2023 17:46:14 +0800 Subject: [PATCH] =?UTF-8?q?dev:=E6=94=B9=E5=88=87=E5=87=BA=E5=BA=93?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=A4=9A=E6=9D=A1=E6=98=8E=E7=BB=86=E6=8E=A8?= =?UTF-8?q?=E9=80=81=EF=BC=8C=E5=B9=85=E5=AE=BD=E7=B2=BE=E5=BA=A6=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sap/service/impl/SapToLmsServiceImpl.java | 105 ++++++++++-------- .../impl/ProductInstorServiceImpl.java | 2 +- .../dto/SlittingproductionplanDto.java | 5 +- .../service/impl/OutBillQueryServiceImpl.java | 4 +- .../wms/pdm/order/slittingplan/index.vue | 36 ++++-- .../src/views/wms/stat/inbillquery/index2.vue | 8 ++ .../src/views/wms/stat/outbillquery/index.vue | 2 +- .../views/wms/stat/outbillquery/index2.vue | 2 +- 8 files changed, 103 insertions(+), 61 deletions(-) diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/ext/sap/service/impl/SapToLmsServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/ext/sap/service/impl/SapToLmsServiceImpl.java index 10ddc0b3d..0847e4838 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/ext/sap/service/impl/SapToLmsServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/ext/sap/service/impl/SapToLmsServiceImpl.java @@ -29,8 +29,8 @@ public class SapToLmsServiceImpl implements SapToLmsService { @Override - public JSONObject getReCutInfo(JSONObject jo) { - log.info("getReCutInfo的输入参数为:------------------------" + jo.toString()); + public JSONObject getReCutInfo(JSONObject json) { + log.info("getReCutInfo的输入参数为:------------------------" + json.toString()); JSONObject jsonMst = new JSONObject(); @@ -38,7 +38,8 @@ public class SapToLmsServiceImpl implements SapToLmsService { String msg = "改切出库单据推送成功!"; try { - String LGORT = jo.getString("LGORT"); + JSONArray dtl_ja = json.getJSONArray("ITEM"); + String LGORT = dtl_ja.getJSONObject(0).getString("LGORT"); JSONObject stor_jo = WQLObject.getWQLObject("ST_IVT_BSRealStorAttr").query("ext_id = '" + LGORT + "'").uniqueResult(0); if (ObjectUtil.isEmpty(stor_jo)) { result.put("RTYPE", "E"); @@ -51,7 +52,7 @@ public class SapToLmsServiceImpl implements SapToLmsService { jsonMst.put("stor_id", stor_jo.getString("stor_id")); jsonMst.put("stor_code", stor_jo.getString("stor_code")); jsonMst.put("stor_name", stor_jo.getString("stor_name")); - jsonMst.put("detail_count", "1"); + jsonMst.put("detail_count", dtl_ja.size()); jsonMst.put("bill_status", "10"); jsonMst.put("create_mode", "03"); jsonMst.put("bill_type", "1003"); @@ -59,49 +60,55 @@ public class SapToLmsServiceImpl implements SapToLmsService { jsonMst.put("user", "sap"); JSONArray dtls = new JSONArray(); - String sap_pcsn = jo.getString("CHARG"); - if (StrUtil.isEmpty("sap_pcsn")) { - throw new BadRequestException("请求参数SAP批次不能为空!"); - } - JSONObject sub_jo = WQLObject.getWQLObject("PDM_BI_SubPackageRelation").query("sap_pcsn = '" + sap_pcsn + "'").uniqueResult(0); - if (ObjectUtil.isEmpty(sub_jo)) { - throw new BadRequestException("LMS中不存在SAP批次为【" + sap_pcsn + "】的包装关系"); - } - String container_name = sub_jo.getString("container_name"); - JSONObject struct_ivt = WQLObject.getWQLObject("st_ivt_structivt").query("pcsn = '" + container_name + "'").uniqueResult(0); - if (ObjectUtil.isEmpty(struct_ivt)) { - throw new BadRequestException("SAP批次为【" + sap_pcsn + "】的成品卷不存在或已经出库!"); - } else { - if (struct_ivt.getDoubleValue("frozen_qty") > 0) { - msg = "SAP批次为【" + sap_pcsn + "】的成品卷已经被分配或出库中"; - }else { - JSONObject dtl = new JSONObject(); - //查询该物料 - JSONObject mater_jo = WQLObject.getWQLObject("md_me_materialbase").query("material_code = '" + sub_jo.getString("product_name") + "'").uniqueResult(0); - if (ObjectUtil.isEmpty(mater_jo)) { - throw new BadRequestException("未查询到物料:" + sub_jo.getString("product_name") + ",信息!"); - } - dtl.put("material_id", mater_jo.getString("material_id")); - dtl.put("pcsn", container_name); - dtl.put("box_no", sub_jo.getString("package_box_sn")); - JSONObject unit = WQLObject.getWQLObject("md_pb_measureunit").query("measure_unit_id = '" + mater_jo.getString("base_unit_id") + "'").uniqueResult(0); - if (ObjectUtil.isEmpty(unit)) { - throw new BadRequestException("未查询到物料计量单位:" + mater_jo.getString("base_unit_id") + ",信息!"); - } - dtl.put("qty_unit_id", unit.getString("measure_unit_id")); - dtl.put("qty_unit_name", unit.getString("unit_name")); - dtl.put("plan_qty", sub_jo.getString("net_weight")); - dtls.add(dtl); - - - jsonMst.put("tableData", dtls); - String iostorinv_id = checkOutBillService.insertDtl(jsonMst); - - //调用自动分配 - JSONObject out_jo = new JSONObject(); - out_jo.put("iostorinv_id", iostorinv_id); - checkOutBillService.allDiv(out_jo); + for (int i = 0; i < dtl_ja.size(); i++) { + JSONObject jo = dtl_ja.getJSONObject(i); + String sap_pcsn = jo.getString("CHARG"); + if (StrUtil.isEmpty("sap_pcsn")) { + throw new BadRequestException("请求参数SAP批次不能为空!"); } + JSONObject sub_jo = WQLObject.getWQLObject("PDM_BI_SubPackageRelation").query("sap_pcsn = '" + sap_pcsn + "'").uniqueResult(0); + if (ObjectUtil.isEmpty(sub_jo)) { + throw new BadRequestException("LMS中不存在SAP批次为【" + sap_pcsn + "】的包装关系"); + } + String container_name = sub_jo.getString("container_name"); + JSONObject struct_ivt = WQLObject.getWQLObject("st_ivt_structivt").query("pcsn = '" + container_name + "'").uniqueResult(0); + if (ObjectUtil.isEmpty(struct_ivt)) { + throw new BadRequestException("SAP批次为【" + sap_pcsn + "】的成品卷不存在或已经出库!"); + } else { + if (struct_ivt.getDoubleValue("frozen_qty") > 0) { + msg = "SAP批次为【" + sap_pcsn + "】的成品卷已经被分配或出库中"; + } else { + JSONObject dtl = new JSONObject(); + //查询该物料 + JSONObject mater_jo = WQLObject.getWQLObject("md_me_materialbase").query("material_code = '" + sub_jo.getString("product_name") + "'").uniqueResult(0); + if (ObjectUtil.isEmpty(mater_jo)) { + throw new BadRequestException("未查询到物料:" + sub_jo.getString("product_name") + ",信息!"); + } + dtl.put("material_id", mater_jo.getString("material_id")); + dtl.put("pcsn", container_name); + dtl.put("box_no", sub_jo.getString("package_box_sn")); + JSONObject unit = WQLObject.getWQLObject("md_pb_measureunit").query("measure_unit_id = '" + mater_jo.getString("base_unit_id") + "'").uniqueResult(0); + if (ObjectUtil.isEmpty(unit)) { + throw new BadRequestException("未查询到物料计量单位:" + mater_jo.getString("base_unit_id") + ",信息!"); + } + dtl.put("qty_unit_id", unit.getString("measure_unit_id")); + dtl.put("qty_unit_name", unit.getString("unit_name")); + dtl.put("plan_qty", sub_jo.getString("net_weight")); + dtls.add(dtl); + } + } + } + + if (!dtls.isEmpty()){ + jsonMst.put("tableData", dtls); + String iostorinv_id = checkOutBillService.insertDtl(jsonMst); + + //调用自动分配 + JSONObject out_jo = new JSONObject(); + out_jo.put("iostorinv_id", iostorinv_id); + checkOutBillService.allDiv(out_jo); + }else { + throw new BadRequestException("推送失败!SAP推送的子卷明细不符合出库状态!"); } } catch (Exception exception) { result.put("TYPE", "E"); @@ -498,10 +505,12 @@ public class SapToLmsServiceImpl implements SapToLmsService { JSONObject jsonDtl = new JSONObject(); JSONObject jsonMater = materTab.query("material_code = '" + jsonObject.getString("MATNR") + "'").uniqueResult(0); - if (ObjectUtil.isEmpty(jsonMater)) throw new BadRequestException("此物料不存在" + jsonObject.getString("MATNR")); + if (ObjectUtil.isEmpty(jsonMater)) + throw new BadRequestException("此物料不存在" + jsonObject.getString("MATNR")); JSONObject jsonUnit = unitTab.query("measure_unit_id = '" + jsonMater.getString("base_unit_id") + "'").uniqueResult(0); - if (ObjectUtil.isEmpty(jsonObject.getString("KALAB"))) throw new BadRequestException("调拨数量不能为空!"); + if (ObjectUtil.isEmpty(jsonObject.getString("KALAB"))) + throw new BadRequestException("调拨数量不能为空!"); if (ObjectUtil.isEmpty(jsonObject.getString("ZVBELN"))) throw new BadRequestException("订单不能为空!"); jsonDtl.put("material_id", jsonMater.getString("material_id")); diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/impl/ProductInstorServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/impl/ProductInstorServiceImpl.java index d27689c44..c47ac4921 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/impl/ProductInstorServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/impl/ProductInstorServiceImpl.java @@ -125,7 +125,7 @@ public class ProductInstorServiceImpl implements ProductInstorService { mst_jo.put("tableData", box_rows); mst_jo.put("biz_date", DateUtil.now()); - RLock lock = redissonClient.getLock("pda_ioIn:" + option); + RLock lock = redissonClient.getLock("pda_ioIn"); boolean tryLock = lock.tryLock(5, TimeUnit.SECONDS); try { if (tryLock) { diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/dto/SlittingproductionplanDto.java b/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/dto/SlittingproductionplanDto.java index 2ae99bf9b..a01079ca1 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/dto/SlittingproductionplanDto.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/dto/SlittingproductionplanDto.java @@ -50,7 +50,7 @@ public class SlittingproductionplanDto implements Serializable { private String split_group; /** 生产顺序 */ - private BigDecimal manufacture_sort; + private String manufacture_sort; /** 生产订单 */ private String mfg_order_name; @@ -138,4 +138,7 @@ public class SlittingproductionplanDto implements Serializable { /** 气涨轴编码 */ private String qzzno; + + /** 销售订单及行号 */ + private String sale_order_name; } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/stat/service/impl/OutBillQueryServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/stat/service/impl/OutBillQueryServiceImpl.java index 11837715b..b5c5d321c 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/stat/service/impl/OutBillQueryServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/stat/service/impl/OutBillQueryServiceImpl.java @@ -184,7 +184,7 @@ public class OutBillQueryServiceImpl implements OutBillQueryService { mp.put("发货客户名称", json.getString("customer_description")); mp.put("销售订单", json.getString("sale_order_name")); mp.put("出库日期", json.getString("input_time")); - mp.put("产品规格", json.getString("width")); + mp.put("产品规格", String.format("%.0f", json.getDoubleValue("width"))); mp.put("产品厚度", json.getString("thickness")); mp.put("单位面积", json.getString("mass_per_unit_area")); mp.put("制单人", json.getString("input_optname")); @@ -247,7 +247,7 @@ public class OutBillQueryServiceImpl implements OutBillQueryService { mp.put("发货客户名称", json.getString("customer_description")); mp.put("销售订单", json.getString("sale_order_name")); mp.put("出库日期", json.getString("input_time")); - mp.put("产品规格", json.getIntValue("width")); + mp.put("产品规格", String.format("%.0f", json.getDoubleValue("width"))); mp.put("产品厚度", json.getString("thickness")); mp.put("单位面积", json.getString("mass_per_unit_area")); mp.put("制单人", json.getString("input_optname")); diff --git a/lms/nladmin-ui/src/views/wms/pdm/order/slittingplan/index.vue b/lms/nladmin-ui/src/views/wms/pdm/order/slittingplan/index.vue index b8120a7b3..792180257 100644 --- a/lms/nladmin-ui/src/views/wms/pdm/order/slittingplan/index.vue +++ b/lms/nladmin-ui/src/views/wms/pdm/order/slittingplan/index.vue @@ -380,44 +380,53 @@ + + + + + + + - - + + - - + + + + + + + - - -