From 71d27d5daf47c492a1ea99e5c3c679116dcfb39f Mon Sep 17 00:00:00 2001 From: "ZHOUZ\\Noble'lift" <1014987728@qq.com> Date: Tue, 12 Dec 2023 15:20:19 +0800 Subject: [PATCH] =?UTF-8?q?dev=EF=BC=9A=E5=9B=9E=E4=BC=A0=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/InAndOutRetrunServiceImpl.java | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/returns/service/impl/InAndOutRetrunServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/st/returns/service/impl/InAndOutRetrunServiceImpl.java index 803ab2572..56a5e5ba9 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/returns/service/impl/InAndOutRetrunServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/returns/service/impl/InAndOutRetrunServiceImpl.java @@ -97,8 +97,6 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService { WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase"); // 库区表 WQLObject sectTab = WQLObject.getWQLObject("st_ivt_sectattr"); - // 子卷包装关系表 - WQLObject subTab = WQLObject.getWQLObject("pdm_bi_subpackagerelation"); //根据出入单类型判断回传业务 //1、生产入库:回传MES;手工入库:回传SAP @@ -375,7 +373,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService { // 库区表 WQLObject sectTab = WQLObject.getWQLObject("st_ivt_sectattr"); // 子卷包装关系表 - WQLObject subTab = WQLObject.getWQLObject("pdm_bi_subpackagerelation"); + WQLObject subTab = WQLObject.getWQLObject("pdm_bi_subpackagerelationrecord"); JSONArray rows = whereJson.getJSONArray("rows"); for (int i = 0; i < rows.size(); i++) { @@ -422,7 +420,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService { jsonDtl.put("LGORT", lgort); // 明細储存地点 } - JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "'").uniqueResult(0); + JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '"+json2.getString("iostorinv_id")+"'").uniqueResult(0); if (ObjectUtil.isNotEmpty(jsonSub)) { jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次 } @@ -495,7 +493,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService { jsonDtl.put("LGORT", jsonSect.getString("ext_id")); // 明細储存地点 } - JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "'").uniqueResult(0); + JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '"+json2.getString("iostorinv_id")+"'").uniqueResult(0); if (ObjectUtil.isNotEmpty(jsonSub)) { jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次 } @@ -569,8 +567,8 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService { jsonDtl.put("LGORT", lgort); // 明細储存地点 } - JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "'").uniqueResult(0); - if (ObjectUtil.isNotEmpty(jsonSect)) { + JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '"+json2.getString("iostorinv_id")+"'").uniqueResult(0); + if (ObjectUtil.isNotEmpty(jsonSub)) { jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次 } jsonDis.put("VBELN", json.getString("vbeln")); // 交货 @@ -627,7 +625,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService { JSONObject jsonMater = materTab.query("material_id = '" + jsonDis.getString("material_id") + "'").uniqueResult(0); paramDis.put("MATNR", jsonMater.getString("material_code")); - JSONObject jsonSub = subTab.query("container_name = '" + jsonDis.getString("pcsn") + "'").uniqueResult(0); + JSONObject jsonSub = subTab.query("container_name = '" + jsonDis.getString("pcsn") + "' AND bill_id = '"+jsonDis.getString("iostorinv_id")+"'").uniqueResult(0); paramDis.put("ZHL02", jsonSub.getString("width")); paramDis.put("ZZWLHD", jsonSub.getString("thickness")); paramDis.put("CHARG", jsonSub.getString("sap_pcsn")); @@ -761,7 +759,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService { jsonDtl.put("LGORT", jsonSect.getString("ext_id")); // 明細储存地点 } - JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "'").uniqueResult(0); + JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '"+json2.getString("iostorinv_id")+"'").uniqueResult(0); if (ObjectUtil.isNotEmpty(jsonSub)) { jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次 } @@ -869,7 +867,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService { // 库区表 WQLObject sectTab = WQLObject.getWQLObject("st_ivt_sectattr"); // 子卷包装关系表 - WQLObject subTab = WQLObject.getWQLObject("pdm_bi_subpackagerelation"); + WQLObject subTab = WQLObject.getWQLObject("pdm_bi_subpackagerelationrecord"); //根据出入单类型判断回传业务 //1、生产入库:回传MES;手工入库:回传SAP @@ -941,7 +939,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService { jsonDtl.put("LGORT", jo_mst.getString("remark")); // 明細储存地点 } - JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "'").uniqueResult(0); + JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '"+json2.getString("iostorinv_id")+"'").uniqueResult(0); if (ObjectUtil.isNotEmpty(jsonSect)) { jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次 } @@ -995,7 +993,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService { JSONObject jsonMater = materTab.query("material_id = '" + jsonDis.getString("material_id") + "'").uniqueResult(0); paramDis.put("MATNR", jsonMater.getString("material_code")); - JSONObject jsonSub = subTab.query("container_name = '" + jsonDis.getString("pcsn") + "'").uniqueResult(0); + JSONObject jsonSub = subTab.query("container_name = '" + jsonDis.getString("pcsn") + "' AND bill_id = '"+jsonDis.getString("iostorinv_id")+"'").uniqueResult(0); paramDis.put("ZHL02", jsonSub.getString("width")); paramDis.put("ZZWLHD", jsonSub.getString("thickness")); paramDis.put("CHARG", jsonSub.getString("sap_pcsn")); @@ -1094,7 +1092,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService { jsonDtl.put("LGORT", jsonSect.getString("ext_id")); // 明細储存地点 } - JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "'").uniqueResult(0); + JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '"+json2.getString("iostorinv_id")+"'").uniqueResult(0); if (ObjectUtil.isNotEmpty(jsonSub)) { jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次 } @@ -1194,7 +1192,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService { jsonDtl.put("LGORT", lgort); // 明細储存地点 } - JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "'").uniqueResult(0); + JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '"+json2.getString("iostorinv_id")+"'").uniqueResult(0); if (ObjectUtil.isNotEmpty(jsonSect)) { jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次 } @@ -1461,7 +1459,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService { jsonDtl.put("LGORT", jsonSect.getString("ext_id")); // 明細储存地点 } - JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "'").uniqueResult(0); + JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '"+json2.getString("iostorinv_id")+"'").uniqueResult(0); if (ObjectUtil.isNotEmpty(jsonSub)) { jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次 }