优化
This commit is contained in:
@@ -508,6 +508,9 @@ public class InitformulaServiceImpl implements InitformulaService {
|
|||||||
//是否软废
|
//是否软废
|
||||||
if(MaterOptTypeEnum.RD_AND_PG.getClass_idStr().contains(md_jo.getString("material_type_id"))){
|
if(MaterOptTypeEnum.RD_AND_PG.getClass_idStr().contains(md_jo.getString("material_type_id"))){
|
||||||
JSONObject pro_jo = md_me_producmaterialext.query("material_id='"+jo.getString("material_id")+"'").uniqueResult(0);
|
JSONObject pro_jo = md_me_producmaterialext.query("material_id='"+jo.getString("material_id")+"'").uniqueResult(0);
|
||||||
|
if(pro_jo ==null){
|
||||||
|
throw new BadRequestException("物料"+jo.getString("material_code")+" "+jo.getString("material_name")+"未设置成品物料扩展信息!");
|
||||||
|
}
|
||||||
double net_rate = pro_jo.getDouble("net_rate");
|
double net_rate = pro_jo.getDouble("net_rate");
|
||||||
RF_total = RF_total+jo.getDouble("formula_qty")*pro_jo.getDouble("net_rate")/100.0;
|
RF_total = RF_total+jo.getDouble("formula_qty")*pro_jo.getDouble("net_rate")/100.0;
|
||||||
}
|
}
|
||||||
@@ -690,6 +693,9 @@ public class InitformulaServiceImpl implements InitformulaService {
|
|||||||
//是否软废
|
//是否软废
|
||||||
if(MaterOptTypeEnum.RD_AND_PG.getClass_idStr().contains(md_jo.getString("material_type_id"))){
|
if(MaterOptTypeEnum.RD_AND_PG.getClass_idStr().contains(md_jo.getString("material_type_id"))){
|
||||||
JSONObject pro_jo = md_me_producmaterialext.query("material_id='"+jo.getString("material_id")+"'").uniqueResult(0);
|
JSONObject pro_jo = md_me_producmaterialext.query("material_id='"+jo.getString("material_id")+"'").uniqueResult(0);
|
||||||
|
if(pro_jo ==null){
|
||||||
|
throw new BadRequestException("物料"+jo.getString("material_code")+" "+jo.getString("material_name")+"未设置成品物料扩展信息!");
|
||||||
|
}
|
||||||
double net_rate = pro_jo.getDouble("net_rate");
|
double net_rate = pro_jo.getDouble("net_rate");
|
||||||
RF_total = RF_total+jo.getDouble("formula_qty")*pro_jo.getDouble("net_rate")/100.0;
|
RF_total = RF_total+jo.getDouble("formula_qty")*pro_jo.getDouble("net_rate")/100.0;
|
||||||
}
|
}
|
||||||
@@ -795,6 +801,9 @@ public class InitformulaServiceImpl implements InitformulaService {
|
|||||||
//是否软废
|
//是否软废
|
||||||
if(MaterOptTypeEnum.RD_AND_PG.getClass_idStr().contains(md_jo.getString("material_type_id"))){
|
if(MaterOptTypeEnum.RD_AND_PG.getClass_idStr().contains(md_jo.getString("material_type_id"))){
|
||||||
JSONObject pro_jo = md_me_producmaterialext.query("material_id='"+jo.getString("material_id")+"'").uniqueResult(0);
|
JSONObject pro_jo = md_me_producmaterialext.query("material_id='"+jo.getString("material_id")+"'").uniqueResult(0);
|
||||||
|
if(pro_jo ==null){
|
||||||
|
throw new BadRequestException("物料"+jo.getString("material_code")+" "+jo.getString("material_name")+"未设置成品物料扩展信息!");
|
||||||
|
}
|
||||||
double net_rate = pro_jo.getDouble("net_rate");
|
double net_rate = pro_jo.getDouble("net_rate");
|
||||||
RF_total = RF_total+jo.getDouble("formula_qty")*pro_jo.getDouble("net_rate")/100.0;
|
RF_total = RF_total+jo.getDouble("formula_qty")*pro_jo.getDouble("net_rate")/100.0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user