From 94006b7f29d411d37b4a7188abc47058a5a1f935 Mon Sep 17 00:00:00 2001 From: zds <2388969634@qq.com> Date: Mon, 11 Jul 2022 15:58:16 +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/AutoformulaServiceImpl.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/pf/service/impl/AutoformulaServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/pf/service/impl/AutoformulaServiceImpl.java index 4287e9ec..443dd5c7 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/pf/service/impl/AutoformulaServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/pf/service/impl/AutoformulaServiceImpl.java @@ -3653,6 +3653,7 @@ public class AutoformulaServiceImpl implements AutoformulaService { @Override public void autoAll(JSONObject map) { WQLObject MD_ME_ProductMaterialExt = WQLObject.getWQLObject("MD_ME_ProducMaterialExt"); + WQLObject pdm_bi_workprocedureparaproduct = WQLObject.getWQLObject("pdm_bi_workprocedureparaproduct"); WQLObject md_me_materialbase = WQLObject.getWQLObject("md_me_materialbase"); WQLObject PDM_BI_WorkOrder = WQLObject.getWQLObject("PDM_BI_WorkOrder"); JSONArray rows = map.getJSONArray("rows"); @@ -3665,14 +3666,21 @@ public class AutoformulaServiceImpl implements AutoformulaService { if(workorder == null){ throw new BadRequestException("当前工令信息查询失败!"); } + JSONObject result = new JSONObject(); if("20".equals(workorder.getString("status"))){ JSONObject material = MD_ME_ProductMaterialExt.query("material_id ='"+material_id+"'").uniqueResult(0); if(material == null ){ throw new BadRequestException("当前成品查询不到成品物料扩展信息!"); } + JSONObject materPa = pdm_bi_workprocedureparaproduct.query("para_code ='QM008' and workprocedure_code='GX002' and material_id ='"+material_id+"'").uniqueResult(0); + + if(materPa == null ){ + throw new BadRequestException("当前成品查询不到球磨工艺参数球磨时间!"); + } JSONObject mater = md_me_materialbase.query("material_id ='"+material_id+"'").uniqueResult(0); workorder.put("formula_type","01"); + workorder.put("ball_time",materPa.getDouble("value")); workorder.put("waste_limit_down","0"); workorder.put("waste_limit_up","0"); workorder.put("c_balance",material.getString("c_balance"));