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 5bcc90e6..0ed7cda5 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 @@ -3567,6 +3567,7 @@ public class AutoformulaServiceImpl implements AutoformulaService { }else{ bomdlt.put("need_qty", "0"); bomdlt.put("formula_qty", "0"); + // bomdlt.put("is_flag","0"); bomdlts_need_map.put(bomdlt.getString("material_id"),bomdlt); } @@ -3856,8 +3857,8 @@ public class AutoformulaServiceImpl implements AutoformulaService { double Y1_bu = finalR3p_jian *standard_rate; //Y12p=Y12p+Y1补 Y1p = Y1p + Y1_bu; - now_bomdtl.put("formula_qty",Y1p+now_bomdtl.getDouble("need_qty")); - now_bomdtl.put("need_qty",Y1p+now_bomdtl.getDouble("need_qty")); + now_bomdtl.put("formula_qty",Y1p); + now_bomdtl.put("need_qty",Y1p); now_bomdtl.put("is_flag","-1"); bomdlts_need_map.put(key,now_bomdtl); } @@ -3959,8 +3960,8 @@ public class AutoformulaServiceImpl implements AutoformulaService { //Y12p=Y12p+Y1补 Y1p = Y1p + Y1_bu; } - now_bomdtl.put("formula_qty",Y1p+now_bomdtl.getDouble("need_qty")); - now_bomdtl.put("need_qty",Y1p+now_bomdtl.getDouble("need_qty")); + now_bomdtl.put("formula_qty",Y1p); + now_bomdtl.put("need_qty",Y1p); now_bomdtl.put("is_flag","-1"); bomdlts_need_map.put(key,now_bomdtl); } @@ -4164,8 +4165,8 @@ public class AutoformulaServiceImpl implements AutoformulaService { double Y1_bu = R3p_jian *(standard_rate/100.0); //Y12p=Y12p+Y1补 Y1p = Y1p + Y1_bu; - now_bomdtl.put("formula_qty",Y1p+now_bomdtl.getDouble("need_qty")); - now_bomdtl.put("need_qty",Y1p+now_bomdtl.getDouble("need_qty")); + now_bomdtl.put("formula_qty",Y1p); + now_bomdtl.put("need_qty",Y1p); now_bomdtl.put("is_flag","-1"); bomdlts_need_map.put(key,now_bomdtl); } @@ -4240,8 +4241,8 @@ public class AutoformulaServiceImpl implements AutoformulaService { //Y12p=Y12p+Y1补 Y1p = Y1p + Y1_bu; } - now_bomdtl.put("formula_qty",Y1p+now_bomdtl.getDouble("need_qty")); - now_bomdtl.put("need_qty",Y1p+now_bomdtl.getDouble("need_qty")); + now_bomdtl.put("formula_qty",Y1p); + now_bomdtl.put("need_qty",Y1p); now_bomdtl.put("is_flag","-1"); bomdlts_need_map.put(key,now_bomdtl); } @@ -4368,14 +4369,9 @@ public class AutoformulaServiceImpl implements AutoformulaService { }); //处理新料 JSONArray xl_list3 = new JSONArray(); - for(int i=0;i{ + //不用添加新料的部分 if(bomdlts_plan.getString("is_flag").equals("0")){ bomdlts_plan.put("formula_qty","0"); bomdlts_plan.put("is_rf_xl","1"); @@ -4385,7 +4381,9 @@ public class AutoformulaServiceImpl implements AutoformulaService { //bomdlts_plan.put("is_active","1"); //bomdlts_plan.put("quality_scode","01"); xl_list3.add(bomdlts_plan); - }else if(bomdlts_plan.getString("is_flag").equals("-1")){ + }else + //额外补料部分 + if(bomdlts_plan.getString("is_flag").equals("-1")){ String bomdtl_material_id = bomdlts_plan.getString("material_id"); double left_qty = bomdlts_plan.getDouble("formula_qty"); left_qty = NumberUtil.round(left_qty,3).doubleValue(); @@ -4457,7 +4455,17 @@ public class AutoformulaServiceImpl implements AutoformulaService { } } }); - + //除了is_flag为-1的在上面代码已重新分配过,其他直接加入 xl_list3 + for(int i=0;i xl_list_map = new HashMap();