From c815ad9bee09f73fee9392226137b8b0d25eda29 Mon Sep 17 00:00:00 2001 From: zds <2388969634@qq.com> Date: Mon, 7 Nov 2022 14:56:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pf/service/impl/FormulaServiceImpl.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/pf/service/impl/FormulaServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/pf/service/impl/FormulaServiceImpl.java index 4939e331..6c1cc73b 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/pf/service/impl/FormulaServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/pf/service/impl/FormulaServiceImpl.java @@ -348,6 +348,7 @@ public class FormulaServiceImpl implements FormulaService { @Override @Transactional(rollbackFor = Exception.class) public JSONObject getform(Map json) { + WQLObject MD_ME_ProductMaterialExt = WQLObject.getWQLObject("MD_ME_ProducMaterialExt"); String formula_id = (String) json.get("formula_id"); JSONObject Formula = WQL.getWO("QPF_FORMULA01").addParam("flag","2") .addParam("formula_id",formula_id) @@ -356,6 +357,14 @@ public class FormulaServiceImpl implements FormulaService { if(Formula == null ){ throw new BadRequestException("当前配方信息查询失败!"); } + JSONObject material = MD_ME_ProductMaterialExt.query("material_id ='"+Formula.getString("material_id")+"'").uniqueResult(0); + if(material == null ){ + throw new BadRequestException("当前成品查询不到成品物料扩展信息!"); + } + + if (StrUtil.isEmpty(Formula.getString("c_balance"))) { + Formula.put("c_balance",material.getString("c_balance")); + } JSONArray dtl = WQL.getWO("QPF_INITFORMULA01") .addParam("workorder_id",Formula.getString("workorder_id")) .addParam("material_id",Formula.getString("material_id")) @@ -477,6 +486,7 @@ public class FormulaServiceImpl implements FormulaService { @Override @Transactional(rollbackFor = Exception.class) public JSONObject getView(Map json) { + WQLObject MD_ME_ProductMaterialExt = WQLObject.getWQLObject("MD_ME_ProducMaterialExt"); String formula_id = (String) json.get("formula_id"); JSONObject Formula = WQL.getWO("QPF_FORMULA01").addParam("flag","2") .addParam("formula_id",formula_id) @@ -485,6 +495,14 @@ public class FormulaServiceImpl implements FormulaService { if(Formula == null ){ throw new BadRequestException("当前配方信息查询失败!"); } + JSONObject material = MD_ME_ProductMaterialExt.query("material_id ='"+Formula.getString("material_id")+"'").uniqueResult(0); + if(material == null ){ + throw new BadRequestException("当前成品查询不到成品物料扩展信息!"); + } + + if (StrUtil.isEmpty(Formula.getString("c_balance"))) { + Formula.put("c_balance",material.getString("c_balance")); + } JSONArray dtl = WQL.getWO("QPF_INITFORMULA01") .addParam("workorder_id",Formula.getString("workorder_id")) .addParam("material_id",Formula.getString("material_id"))