From f5bc0989f3f734ca278d4cf8a442bb05eca12022 Mon Sep 17 00:00:00 2001 From: zds <2388969634@qq.com> Date: Thu, 4 Aug 2022 11:26:28 +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 --- .../nl/wms/pf/service/impl/InitformulaServiceImpl.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/pf/service/impl/InitformulaServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/pf/service/impl/InitformulaServiceImpl.java index c28c9d43..a8abd529 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/pf/service/impl/InitformulaServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/pf/service/impl/InitformulaServiceImpl.java @@ -508,6 +508,9 @@ public class InitformulaServiceImpl implements InitformulaService { //是否软废 if(MaterOptTypeEnum.RD_AND_PG.getClass_idStr().contains(md_jo.getString("material_type_id"))){ JSONObject pro_jo = md_me_producmaterialext.query("material_id='"+jo.getString("material_id")+"'").uniqueResult(0); + if(pro_jo ==null){ + throw new BadRequestException("物料"+jo.getString("material_code")+" "+jo.getString("material_name")+"未设置成品物料扩展信息!"); + } double net_rate = pro_jo.getDouble("net_rate"); RF_total = RF_total+jo.getDouble("formula_qty")*pro_jo.getDouble("net_rate")/100.0; } @@ -690,6 +693,9 @@ public class InitformulaServiceImpl implements InitformulaService { //是否软废 if(MaterOptTypeEnum.RD_AND_PG.getClass_idStr().contains(md_jo.getString("material_type_id"))){ JSONObject pro_jo = md_me_producmaterialext.query("material_id='"+jo.getString("material_id")+"'").uniqueResult(0); + if(pro_jo ==null){ + throw new BadRequestException("物料"+jo.getString("material_code")+" "+jo.getString("material_name")+"未设置成品物料扩展信息!"); + } double net_rate = pro_jo.getDouble("net_rate"); RF_total = RF_total+jo.getDouble("formula_qty")*pro_jo.getDouble("net_rate")/100.0; } @@ -795,6 +801,9 @@ public class InitformulaServiceImpl implements InitformulaService { //是否软废 if(MaterOptTypeEnum.RD_AND_PG.getClass_idStr().contains(md_jo.getString("material_type_id"))){ JSONObject pro_jo = md_me_producmaterialext.query("material_id='"+jo.getString("material_id")+"'").uniqueResult(0); + if(pro_jo ==null){ + throw new BadRequestException("物料"+jo.getString("material_code")+" "+jo.getString("material_name")+"未设置成品物料扩展信息!"); + } double net_rate = pro_jo.getDouble("net_rate"); RF_total = RF_total+jo.getDouble("formula_qty")*pro_jo.getDouble("net_rate")/100.0; }