修改
This commit is contained in:
@@ -2551,6 +2551,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
}
|
||||
if(left_qty<ivt_qty){
|
||||
flag = true;
|
||||
now_ivt.put("is_flag","1");
|
||||
now_ivt.put("formula_qty",left_qty);
|
||||
now_ivt.put("bom_ivt_qty",left_qty);
|
||||
now_ivt.put("seqno",bomdlt.getString("seqno"));
|
||||
@@ -2567,6 +2568,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
break;
|
||||
}else{
|
||||
flag = true;
|
||||
now_ivt.put("is_flag","1");
|
||||
now_ivt.put("formula_qty",ivt_qty);
|
||||
now_ivt.put("bom_ivt_qty",ivt_qty);
|
||||
now_ivt.put("seqno",bomdlt.getString("seqno"));
|
||||
@@ -2588,12 +2590,15 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
if(flag){
|
||||
bomdlt.put("is_flag","1");
|
||||
}
|
||||
//bomdlt.put("need_qty", bomdlt.getDouble("left_qty"));
|
||||
bomdlt.put("need_qty", bomdlt.getDouble("left_qty"));
|
||||
bomdlt.put("formula_qty", bomdlt.getDouble("left_qty"));
|
||||
bomdlts_need_map.put(bomdlt.getString("material_id"),bomdlt);
|
||||
}else{
|
||||
bomdlt.put("need_qty", bomdlt.getDouble("left_qty"));
|
||||
bomdlt.put("formula_qty", bomdlt.getDouble("left_qty"));
|
||||
bomdlt.put("is_need_manage","1");
|
||||
bomdlt.put("ivt_level","01");
|
||||
bomdlt.put("is_flag","1");
|
||||
bomdlt.put("is_active","1");
|
||||
bomdlt.put("quality_scode","01");
|
||||
bomdlts_need_map.put(bomdlt.getString("material_id"),bomdlt);
|
||||
@@ -2628,7 +2633,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
CT1 = CT1 + bom_ivt_qty*value/100.0;
|
||||
//更新含碳比
|
||||
bomdlt_Cr3C2.put("is_tan",value);
|
||||
bomdlts_need_map.put(bomdlt_Cr3C2.getString("stockrecord_id"),bomdlt_Cr3C2);
|
||||
bomdlts_need_map.put(bomdlt_Cr3C2.getString("material_id"),bomdlt_Cr3C2);
|
||||
}
|
||||
//软废总碳
|
||||
for(int i=0;i<rf_list.size();i++){
|
||||
@@ -2658,7 +2663,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
for(int i=0;i<xl_list.size();i++){
|
||||
JSONObject bomdlt = xl_list.getJSONObject(i);
|
||||
//Y1p+X1p+X2p
|
||||
double need_qty = bomdlt.getDouble("need_qty");
|
||||
double need_qty = bomdlt.getDouble("formula_qty");
|
||||
W = NumberUtil.round(W - need_qty,3).doubleValue();
|
||||
}
|
||||
if(W<0){
|
||||
@@ -2695,7 +2700,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
for(int i=0;i<xl_list.size();i++){
|
||||
JSONObject bomdlt = xl_list.getJSONObject(i);
|
||||
//Y1p+X1p+X2p
|
||||
double need_qty = bomdlt.getDouble("need_qty");
|
||||
double need_qty = bomdlt.getDouble("formula_qty");
|
||||
W = NumberUtil.round(W - need_qty,3).doubleValue();
|
||||
}
|
||||
if(W<0){
|
||||
@@ -2858,9 +2863,9 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
double Y1_bu = finalR3p_jian *standard_rate;
|
||||
//Y12p=Y12p+Y1补
|
||||
Y1p = Y1p + Y1_bu;
|
||||
now_bomdtl.put("need_qty",Y1p);
|
||||
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("is_flag","-1");
|
||||
now_bomdtl.put("formula_qty",Y1p);
|
||||
bomdlts_need_map.put(key,now_bomdtl);
|
||||
}
|
||||
}
|
||||
@@ -2978,9 +2983,9 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
//Y12p=Y12p+Y1补
|
||||
Y1p = Y1p + Y1_bu;
|
||||
}
|
||||
now_bomdtl.put("need_qty",Y1p);
|
||||
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("is_flag","-1");
|
||||
now_bomdtl.put("formula_qty",Y1p);
|
||||
bomdlts_need_map.put(key,now_bomdtl);
|
||||
}
|
||||
});
|
||||
@@ -3065,7 +3070,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
for(int i=0;i<xl_list.size();i++){
|
||||
JSONObject bomdlt = xl_list.getJSONObject(i);
|
||||
//Y1p+X1p+X2p
|
||||
double need_qty = bomdlt.getDouble("need_qty");
|
||||
double need_qty = bomdlt.getDouble("formula_qty");
|
||||
W = NumberUtil.round(W - need_qty,3).doubleValue();
|
||||
}
|
||||
|
||||
@@ -3200,9 +3205,9 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
double Y1_bu = R3p_jian *(standard_rate/100.0);
|
||||
//Y12p=Y12p+Y1补
|
||||
Y1p = Y1p + Y1_bu;
|
||||
now_bomdtl.put("need_qty",Y1p);
|
||||
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("is_flag","-1");
|
||||
now_bomdtl.put("formula_qty",Y1p);
|
||||
bomdlts_need_map.put(key,now_bomdtl);
|
||||
}
|
||||
}
|
||||
@@ -3272,9 +3277,9 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
//Y12p=Y12p+Y1补
|
||||
Y1p = Y1p + Y1_bu;
|
||||
}
|
||||
now_bomdtl.put("need_qty",Y1p);
|
||||
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("is_flag","-1");
|
||||
now_bomdtl.put("formula_qty",Y1p);
|
||||
bomdlts_need_map.put(key,now_bomdtl);
|
||||
}
|
||||
});
|
||||
@@ -3398,6 +3403,15 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
cxj_list.add(bomdlts2_now);
|
||||
}
|
||||
});
|
||||
//处理新料
|
||||
JSONArray xl_list3 = new JSONArray();
|
||||
for(int i=0;i<xl_list.size();i++){
|
||||
JSONObject jo_now = xl_list.getJSONObject(i);
|
||||
JSONObject bomdlts_jo = bomdlts_need_map.get(jo_now.getString("material_id"));
|
||||
if(!bomdlts_jo.getString("is_flag").equals("-1")){
|
||||
xl_list3.add(jo_now);
|
||||
}
|
||||
}
|
||||
bomdlts_need_map.forEach((key,bomdlts_plan)->{
|
||||
if(bomdlts_plan.getString("is_flag").equals("0")){
|
||||
bomdlts_plan.put("formula_qty","0");
|
||||
@@ -3407,7 +3421,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
//bomdlts_plan.put("ivt_level","01");
|
||||
//bomdlts_plan.put("is_active","1");
|
||||
//bomdlts_plan.put("quality_scode","01");
|
||||
xl_list.add(bomdlts_plan);
|
||||
xl_list3.add(bomdlts_plan);
|
||||
}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");
|
||||
@@ -3444,7 +3458,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
now_ivt.put("material_type","01");
|
||||
now_ivt.put("is_need_move",bomdlts_plan.getString("is_need_move"));
|
||||
now_ivt.put("is_need_manage","1");
|
||||
xl_list.add(now_ivt);
|
||||
xl_list3.add(now_ivt);
|
||||
left_qty = 0;
|
||||
break;
|
||||
}else{
|
||||
@@ -3456,7 +3470,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
now_ivt.put("is_need_move",bomdlts_plan.getString("is_need_move"));
|
||||
now_ivt.put("is_need_manage","1");
|
||||
left_qty = NumberUtil.round(left_qty - ivt_qty,3).doubleValue();
|
||||
xl_list.add(now_ivt);
|
||||
xl_list3.add(now_ivt);
|
||||
}
|
||||
}
|
||||
if(left_qty>0){
|
||||
@@ -3468,7 +3482,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
bomdlts_plan.put("ivt_level","01");
|
||||
bomdlts_plan.put("is_active","1");
|
||||
bomdlts_plan.put("quality_scode","01");
|
||||
xl_list.add(bomdlts_plan);
|
||||
xl_list3.add(bomdlts_plan);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -3476,8 +3490,8 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
//汇总新料库存
|
||||
HashMap<String,JSONObject> xl_list_map = new HashMap<String,JSONObject>();
|
||||
|
||||
for(int i=0;i<xl_list.size();i++){
|
||||
JSONObject jo_xl = xl_list.getJSONObject(i);
|
||||
for(int i=0;i<xl_list3.size();i++){
|
||||
JSONObject jo_xl = xl_list3.getJSONObject(i);
|
||||
String key = jo_xl.getString("material_id")+"__"
|
||||
+jo_xl.getString("pcsn")+"__"
|
||||
+jo_xl.getString("ivt_level")+"__"
|
||||
|
||||
Reference in New Issue
Block a user