This commit is contained in:
zds
2022-10-24 17:18:25 +08:00
parent 831383096d
commit 1c1f525000
3 changed files with 36 additions and 1 deletions

View File

@@ -669,7 +669,9 @@ public class AutoformulaServiceImpl implements AutoformulaService {
//获取修正值
double change_qty = this.getWCChange(bomdlt_Cr3C2.getString("material_id"),bomdlt_Cr3C2.getString("pcsn"));
value = value + change_qty;
if(value<0){
throw new BadRequestException("物料"+bomdlt_Cr3C2.getString("material_code")+" "+bomdlt_Cr3C2.getString("material_name")+"修正后含碳量不能为负数:"+value+"");
}
//总碳
CT1 = CT1 + bom_ivt_qty*value/100.0;
@@ -1905,6 +1907,9 @@ public class AutoformulaServiceImpl implements AutoformulaService {
//获取修正值
double change_qty = this.getWCChange(bomdlt_Cr3C2.getString("material_id"),bomdlt_Cr3C2.getString("pcsn"));
is_tan = is_tan + change_qty;
if(is_tan<0){
throw new BadRequestException("物料"+bomdlt_Cr3C2.getString("material_code")+" "+bomdlt_Cr3C2.getString("material_name")+"修正后含碳量不能为负数:"+is_tan+"");
}
//总碳
CT1 = CT1 + bom_ivt_qty*is_tan/100.0;
//总碳化钨
@@ -1921,6 +1926,9 @@ public class AutoformulaServiceImpl implements AutoformulaService {
double rf_cr3c2 = rf_dis.getDouble("rf_cr3c2");
//含碳比
double is_tan = rf_dis.getDouble("is_tan");
if(is_tan<0){
throw new BadRequestException("物料"+rf_dis.getString("material_code")+" "+rf_dis.getString("material_name")+"含碳量不能为负数:"+is_tan+"");
}
//总碳
CT1 = CT1 + net_rate_qty*(rf_cr3c2/100.0)*(is_tan/100.0);
//总碳化钨
@@ -3586,6 +3594,9 @@ public class AutoformulaServiceImpl implements AutoformulaService {
//获取修正值
double change_qty = this.getWCChange(bomdlt_Cr3C2.getString("material_id"),bomdlt_Cr3C2.getString("pcsn"));
is_tan = is_tan + change_qty;
if(is_tan<0){
throw new BadRequestException("物料"+bomdlt_Cr3C2.getString("material_code")+" "+bomdlt_Cr3C2.getString("material_name")+"修正后含碳量不能为负数:"+is_tan+"");
}
//总碳
CT1 = CT1 + bom_ivt_qty*is_tan/100.0;
//更新含碳比
@@ -3603,6 +3614,9 @@ public class AutoformulaServiceImpl implements AutoformulaService {
double rf_Cr3C2 = ivt_new.getDouble("rf_Cr3C2");
//含碳比
double is_tan = ivt_new.getDouble("is_tan");
if(is_tan<0){
throw new BadRequestException("物料"+ivt_new.getString("material_code")+" "+ivt_new.getString("material_name")+"含碳量不能为负数:"+is_tan+"");
}
//总碳
CT1 = CT1 + formula_qty*is_tan/100.0*net_rate/100.0*rf_Cr3C2/100.0;
}

View File

@@ -224,6 +224,13 @@ public class FormulaServiceImpl implements FormulaService {
if(jo.getDouble("formula_qty")<=0){
continue;
}
String is_tan = jo.getString("is_tan");
if (StrUtil.isNotEmpty(is_tan)) {
double is_tan1 = Double.parseDouble(is_tan);
if(is_tan1<0){
throw new BadRequestException("物料"+jo.getString("material_code")+" "+jo.getString("material_name")+"含碳量不能为负数:"+is_tan1+"");
}
}
jo.put("seq_no",(mn)+"");
mn++;
if("1".equals(jo.getString("is_need_manage"))){

View File

@@ -347,6 +347,13 @@ public class InitformulaServiceImpl implements InitformulaService {
if(jo.getDouble("formula_qty")<=0){
continue;
}
String is_tan = jo.getString("is_tan");
if (StrUtil.isNotEmpty(is_tan)) {
double is_tan1 = Double.parseDouble(is_tan);
if(is_tan1<0){
throw new BadRequestException("物料"+jo.getString("material_code")+" "+jo.getString("material_name")+"含碳量不能为负数:"+is_tan1+"");
}
}
jo.put("formula_id",formula_id);
jo.put("formuladtl_id",IdUtil.getSnowflake(1, 1).nextId());
jo.put("formula_code",formula_code);
@@ -640,6 +647,13 @@ public class InitformulaServiceImpl implements InitformulaService {
if(jo.getDouble("formula_qty")<=0){
continue;
}
String is_tan = jo.getString("is_tan");
if (StrUtil.isNotEmpty(is_tan)) {
double is_tan1 = Double.parseDouble(is_tan);
if(is_tan1<0){
throw new BadRequestException("物料"+jo.getString("material_code")+" "+jo.getString("material_name")+"含碳量不能为负数:"+is_tan1+"");
}
}
jo.put("formula_id",formula_id);
jo.put("formuladtl_id",IdUtil.getSnowflake(1, 1).nextId());
jo.put("formula_code",formula_code);