新料优化
This commit is contained in:
@@ -1508,7 +1508,9 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
double rf_net_total_weight = 0;
|
||||
for(int i=0;i<ivts_new.size();i++){
|
||||
JSONObject ivt_new = ivts_new.getJSONObject(i);
|
||||
//可分配库存重量
|
||||
double ivt_qty = ivt_new.getDouble("sum_ivt_qty");
|
||||
//纯粉系数
|
||||
double net_rate = ivt_new.getDouble("net_rate");
|
||||
ivt_qty = NumberUtil.roundDown(ivt_qty,3).doubleValue();
|
||||
double formula_qty = 0;
|
||||
@@ -1526,12 +1528,38 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
rf_left_weight = NumberUtil.round(NumberUtil.sub(rf_left_weight,now_ivt_qty),3);
|
||||
//累加软废纯粉重量
|
||||
rf_net_total_weight = rf_net_total_weight + now_ivt_qty;
|
||||
//分配软废重量
|
||||
ivt_new.put("formula_qty",NumberUtil.round(formula_qty,3));
|
||||
//纯粉重量
|
||||
ivt_new.put("net_rate_qty",NumberUtil.round(now_ivt_qty,3));
|
||||
ivt_new.put("material_type","01");
|
||||
ivt_new.put("is_need_move","1");
|
||||
ivt_new.put("is_need_manage","1");
|
||||
ivt_new.put("is_rf_xl","1");
|
||||
|
||||
//获取软废Bom,统计软废总含碳化钨
|
||||
String rf_material_id = ivt_new.getString("material_id");
|
||||
JSONArray rf_bomdlts = WQL.getWO("QPF_AUTOFORMULA01")
|
||||
.addParam("material_id",rf_material_id)
|
||||
.addParam("is_need_manage","1")
|
||||
.addParam("flag","1")
|
||||
.process().getResultJSONArray(0);
|
||||
if(rf_bomdlts.size()==0){
|
||||
throw new BadRequestException("物料"+ivt_new.getString("material_code")+" "+ivt_new.getString("material_name")+"未配置物料bom!");
|
||||
}
|
||||
//该软废碳化钨总含量
|
||||
double rf_Cr3C2 = 0.0;
|
||||
//b、若Y1、X1、X2…中有等于0的,R2中含量>0,则跳过此软废,进行下一软废计算;
|
||||
for(int j=0;j<rf_bomdlts.size();j++){
|
||||
JSONObject fi_bomdtl = rf_bomdlts.getJSONObject(j);
|
||||
//物料分类
|
||||
String fi_bomdtl_material_type_id = fi_bomdtl.getString("material_type_id");
|
||||
//如果是碳化钨
|
||||
if(MaterOptTypeEnum.THW.getClass_idStr().contains(fi_bomdtl_material_type_id)){
|
||||
rf_Cr3C2 = rf_Cr3C2 + fi_bomdtl.getDouble("standard_rate");
|
||||
}
|
||||
}
|
||||
ivt_new.put("rf_cr3c2",rf_Cr3C2);
|
||||
rf_list.add(ivt_new);
|
||||
if(rf_left_weight.doubleValue() <=0){
|
||||
break;
|
||||
@@ -1665,8 +1693,22 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
bomdlt_Cr3C2.put("is_tan",is_tan);
|
||||
bomdlts_plan_map.put(bomdlt_Cr3C2.getString("stockrecord_id"),bomdlt_Cr3C2);
|
||||
}
|
||||
for(int i=0;i<rf_list.size();i++){
|
||||
JSONObject rf_dis = rf_list.getJSONObject(i);
|
||||
//重量
|
||||
double net_rate_qty = rf_dis.getDouble("net_rate_qty");
|
||||
//总含碳化钨比
|
||||
double rf_cr3c2 = rf_dis.getDouble("rf_cr3c2");
|
||||
//含碳比
|
||||
double is_tan = rf_dis.getDouble("is_tan");
|
||||
//总碳
|
||||
CT1 = CT1 + net_rate_qty*(rf_cr3c2/100.0)*(is_tan/100.0);
|
||||
//总碳化钨
|
||||
CT1_weight = CT1_weight + net_rate_qty*(rf_cr3c2/100.0);
|
||||
}
|
||||
|
||||
//BOM中碳化钨需含总碳
|
||||
double CT2 = new_qty*(sum_Cr3C2/100.0)*(c_balance/100.0);
|
||||
double CT2 = workorder_qty*(sum_Cr3C2/100.0)*(c_balance/100.0);
|
||||
if(CT1==CT2){//配粉结束
|
||||
//判断已含添加剂与需配添加剂大小
|
||||
tjj_map.forEach((key,tjj_map_now)->{
|
||||
|
||||
Reference in New Issue
Block a user