优化
This commit is contained in:
@@ -469,6 +469,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
for(int i=0;i<bomdlts.size();i++){
|
||||
JSONObject bomdlt = bomdlts.getJSONObject(i);
|
||||
double nedd_qty = new_qty*bomdlt.getDouble("standard_rate")/100.0;
|
||||
nedd_qty = NumberUtil.round(nedd_qty,3).doubleValue();
|
||||
bomdlt.put("need_qty",nedd_qty);
|
||||
String material_type_id = bomdlt.getString("material_type_id");
|
||||
//如果该物料是碳化钨
|
||||
@@ -507,7 +508,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
bom_material.put("is_need_move","1");
|
||||
bom_material.put("is_need_manage","1");
|
||||
bom_material.put("need_sum_qty",new_qty*bomdlt.getDouble("standard_rate")/100.0);
|
||||
double bom_ivt_qty = bom_material.getDouble("sum_ivt_qty");
|
||||
double bom_ivt_qty = NumberUtil.roundDown(bom_material.getDouble("sum_ivt_qty"),3).doubleValue();
|
||||
if(bom_ivt_qty>=nedd_qty){
|
||||
bom_material.put("bom_ivt_qty",nedd_qty);
|
||||
//如果该物料是碳化钨
|
||||
@@ -1299,6 +1300,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
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");
|
||||
ivt_qty = NumberUtil.roundDown(ivt_qty,3).doubleValue();
|
||||
double formula_qty = 0;
|
||||
double rf_up = rf_left_weight.doubleValue()/(material_net_rate/100.0);
|
||||
if(ivt_qty<rf_up){
|
||||
@@ -1353,6 +1355,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
for(int i=0;i<bomdlts.size();i++){
|
||||
JSONObject bomdlt = bomdlts.getJSONObject(i);
|
||||
double nedd_qty = new_qty*bomdlt.getDouble("standard_rate")/100.0;
|
||||
nedd_qty = NumberUtil.round(nedd_qty,3).doubleValue();
|
||||
bomdlt.put("need_qty",nedd_qty);
|
||||
String material_type_id = bomdlt.getString("material_type_id");
|
||||
//如果该物料是碳化钨
|
||||
@@ -1384,6 +1387,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
continue;
|
||||
}
|
||||
double bom_ivt_qty = bom_material.getDouble("sum_ivt_qty");
|
||||
bom_ivt_qty = NumberUtil.roundDown(bom_ivt_qty,3).doubleValue();
|
||||
//设置物料类型为物料
|
||||
bom_material.put("stockrecord_id",IdUtil.getSnowflake(1, 1).nextId()+"");
|
||||
bom_material.put("material_type","01");
|
||||
@@ -2530,7 +2534,8 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
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");
|
||||
if(ivt_new.getDouble("sum_ivt_qty") <=0){
|
||||
ivt_qty = NumberUtil.roundDown(ivt_qty,3).doubleValue();
|
||||
if(ivt_qty <=0){
|
||||
continue;
|
||||
}
|
||||
//软废纯粉系数
|
||||
@@ -2568,6 +2573,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
if(bomdlts_need_map.containsKey(fi_bomdtl_material_id)){
|
||||
JSONObject bomdlt = bomdlts_need_map.get(fi_bomdtl_material_id);
|
||||
double left_qty = bomdlt.getDouble("left_qty");
|
||||
left_qty = NumberUtil.round(left_qty,3).doubleValue();
|
||||
if(left_qty==0){
|
||||
continue outer;
|
||||
}
|
||||
@@ -2590,6 +2596,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
//更新产品所需物料的所需重量
|
||||
JSONObject bomdlt = bomdlts_need_map.get(fi_bomdtl_material_id);
|
||||
double left_qty = bomdlt.getDouble("left_qty");
|
||||
left_qty = NumberUtil.round(left_qty,3).doubleValue();
|
||||
if(left_qty<now_qty){
|
||||
left_qty = 0;
|
||||
bomdlt.put("left_qty",left_qty);
|
||||
@@ -2617,6 +2624,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
bomdlts_need_map.forEach((key,bomdlt)->{
|
||||
String bomdtl_material_id = bomdlt.getString("material_id");
|
||||
double left_qty = bomdlt.getDouble("left_qty");
|
||||
left_qty = NumberUtil.round(left_qty,3).doubleValue();
|
||||
String is_need_move = bomdlt.getString("is_need_move");
|
||||
//获取Y1、X1、X2….剩余>0的物料
|
||||
if(left_qty>0){
|
||||
@@ -2648,7 +2656,8 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
continue;
|
||||
}
|
||||
double ivt_qty = now_ivt.getDouble("sum_ivt_qty");
|
||||
if(now_ivt.getDouble("sum_ivt_qty") <=0){
|
||||
ivt_qty = NumberUtil.roundDown(ivt_qty,3).doubleValue();
|
||||
if(ivt_qty <=0){
|
||||
continue;
|
||||
}
|
||||
if(left_qty<ivt_qty){
|
||||
@@ -3527,6 +3536,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
}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();
|
||||
String is_need_move = bomdlts_plan.getString("is_need_move");
|
||||
String prior_level = bomdlts_plan.getString("prior_level");
|
||||
if (StrUtil.isEmpty(prior_level)) {
|
||||
@@ -3555,7 +3565,8 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
continue;
|
||||
}
|
||||
double ivt_qty = now_ivt.getDouble("sum_ivt_qty");
|
||||
if(now_ivt.getDouble("sum_ivt_qty") <=0){
|
||||
ivt_qty = NumberUtil.roundDown(ivt_qty,3).doubleValue();
|
||||
if(ivt_qty<=0){
|
||||
continue;
|
||||
}
|
||||
if(left_qty<ivt_qty){
|
||||
|
||||
@@ -337,7 +337,7 @@ export default {
|
||||
if (rows[i].order_status < '40' || rows.length !== 1) {
|
||||
this.print1_flag = true
|
||||
}
|
||||
if (rows[i].status < '30' || rows.length !== 1 || "GX003,GX004,GX009,GX010,GX011".indexOf(rows[i].workprocedure_code)===-1) {
|
||||
if (rows.length !== 1 || "GX003,GX004,GX009,GX010,GX011".indexOf(rows[i].workprocedure_code)===-1) {
|
||||
this.print2_flag = true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user