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"));