From aa4b5495bf9fd6602ce929bda28a7e5a8f32c960 Mon Sep 17 00:00:00 2001 From: "DESKTOP-5DIJMF9\\admin" <2388969634@qq.com> Date: Wed, 11 Dec 2024 10:54:00 +0800 Subject: [PATCH] =?UTF-8?q?opt:sap=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/ifs/sap/SapToWmsServiceImpl.java | 39 +++++++++++++++---- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/lxservice/com/noblelift/imp/products/mes/service/ifs/sap/SapToWmsServiceImpl.java b/lxservice/com/noblelift/imp/products/mes/service/ifs/sap/SapToWmsServiceImpl.java index 745f389..b6869d1 100644 --- a/lxservice/com/noblelift/imp/products/mes/service/ifs/sap/SapToWmsServiceImpl.java +++ b/lxservice/com/noblelift/imp/products/mes/service/ifs/sap/SapToWmsServiceImpl.java @@ -496,8 +496,14 @@ public class SapToWmsServiceImpl implements SapToWmsService { String matnr_begin = form.optString("matnr_begin"); String matnr_end = form.optString("matnr_end"); //如果查询未填入工厂编码,默认查1060 - String werks_begin = form.optString("werks_begin","1060"); - String werks_end = form.optString("werks_end","1060"); + String werks_begin = form.optString("werks_begin"); + if (uString.isBlank(werks_begin)) { + werks_begin = "1060"; + } + String werks_end = form.optString("werks_end"); + if (uString.isBlank(werks_end)) { + werks_end = "1060"; + } String lgort_begin = form.optString("lgort_begin"); String lgort_end = form.optString("lgort_end"); @@ -777,7 +783,7 @@ public class SapToWmsServiceImpl implements SapToWmsService { // 新增 wo_SAP_Mater.insert(joi); - JSONObject jo = MD_ME_MaterialBase.query("material_code='" + MATNR + "'").uniqueResult(0); + JSONObject jo = MD_ME_MaterialBase.query("sysisdelete='0' and material_code='" + MATNR + "'").uniqueResult(0); String datanow = WDK.getDateTime(); if (jo == null) {// 新增 @@ -789,8 +795,13 @@ public class SapToWmsServiceImpl implements SapToWmsService { JSONObject unit = WQLObject.getWQLObject("MD_PB_MeasureUnit") .query("unit_name = '" + joi.optString("MEINS") + "'").uniqueResult(0); jo.put("base_unit_uuid", unit.optString("measure_unit_uuid")); + + String GEWEI = joi.optString("GEWEI"); + if (uString.isBlank(GEWEI)) { + GEWEI = "KG"; + } JSONObject weight_unit = WQLObject.getWQLObject("MD_PB_MeasureUnit") - .query("unit_name = '" + joi.optString("GEWEI","KG") + "'").uniqueResult(0); + .query("unit_name = '" + GEWEI + "'").uniqueResult(0); if(weight_unit==null||weight_unit.isNullObject()){ jo.put("weight_unit_uuid", "EFA1CBA910AF4EBFA7246DBA89C73058"); }else{ @@ -806,8 +817,13 @@ public class SapToWmsServiceImpl implements SapToWmsService { jo.put("salver_limit_height", "0"); jo.put("salver_qty", "0"); jo.put("net_weight", joi.optString("NTGEW")); + + String LGORT2 = joi.optString("LGORT"); + if (uString.isBlank(LGORT2)) { + LGORT2 = "-1"; + } JSONObject sect = WQLObject.getWQLObject("ST_BS_SectAttr") - .query("ext_id = '" + joi.optString("LGORT") + "'").uniqueResult(0); + .query("sysisdelete='0' and ext_id = '" + LGORT2 + "'").uniqueResult(0); if (sect == null) { sect = new JSONObject(); sect.put("sect_type", ""); @@ -854,16 +870,25 @@ public class SapToWmsServiceImpl implements SapToWmsService { JSONObject unit = WQLObject.getWQLObject("MD_PB_MeasureUnit") .query("unit_name = '" + joi.optString("MEINS") + "'").uniqueResult(0); jo.put("base_unit_uuid", unit.optString("measure_unit_uuid")); + + String GEWEI = joi.optString("GEWEI"); + if (uString.isBlank(GEWEI)) { + GEWEI = "KG"; + } JSONObject weight_unit = WQLObject.getWQLObject("MD_PB_MeasureUnit") - .query("unit_name = '" + joi.optString("GEWEI","KG") + "'").uniqueResult(0); + .query("unit_name = '" + GEWEI + "'").uniqueResult(0); if(weight_unit==null||weight_unit.isNullObject()){ jo.put("weight_unit_uuid", "EFA1CBA910AF4EBFA7246DBA89C73058"); }else{ jo.put("weight_unit_uuid", weight_unit.optString("measure_unit_uuid")); } jo.put("net_weight", joi.optString("NTGEW")); + String LGORT2 = joi.optString("LGORT"); + if (uString.isBlank(LGORT2)) { + LGORT2 = "-1"; + } JSONObject sect = WQLObject.getWQLObject("ST_BS_SectAttr") - .query("ext_id = '" + joi.optString("LGORT") + "'").uniqueResult(0); + .query("sysisdelete='0' and ext_id = '" + LGORT2 + "'").uniqueResult(0); if (sect == null) { sect = new JSONObject(); sect.put("sect_type", "");