优化
This commit is contained in:
Binary file not shown.
@@ -401,25 +401,30 @@ public class FormulaServiceImpl implements FormulaService {
|
||||
jo.put("is_"+key,bomdlts2_now+"");
|
||||
}
|
||||
});
|
||||
if (StrUtil.isEmpty(jo.getString("is_tan"))) {
|
||||
jo.put("is_tan",jo.getString("is_tan2"));
|
||||
}
|
||||
}else if(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.THW.getClass_idStr().contains(material_type_id)){//碳化钨新料
|
||||
//获取修正值
|
||||
double change_qty = this.getWCChange(jo.getString("material_id"),jo.getString("pcsn"));
|
||||
jo.put("change_qty",change_qty);
|
||||
|
||||
//获取碳含量
|
||||
JSONObject FactoryWarranty = WQL.getWO("QPF_AUTOFORMULA01")
|
||||
.addParam("material_id",jo.getString("material_id"))
|
||||
.addParam("pcsn",jo.getString("pcsn"))
|
||||
.addParam("flag","3")
|
||||
.process()
|
||||
.uniqueResult(0);
|
||||
if(FactoryWarranty==null){
|
||||
if (StrUtil.isEmpty(jo.getString("change_qty"))) {
|
||||
//获取修正值
|
||||
double change_qty = this.getWCChange(jo.getString("material_id"),jo.getString("pcsn"));
|
||||
jo.put("change_qty",change_qty);
|
||||
}
|
||||
if (StrUtil.isEmpty(jo.getString("is_tan"))) {
|
||||
jo.put("is_tan","0");
|
||||
}else{
|
||||
//含碳比
|
||||
double value = FactoryWarranty.getDouble("value");
|
||||
//更新含碳比
|
||||
jo.put("is_tan",value);
|
||||
//获取碳含量
|
||||
JSONObject FactoryWarranty = WQL.getWO("QPF_AUTOFORMULA01")
|
||||
.addParam("material_id",jo.getString("material_id"))
|
||||
.addParam("pcsn",jo.getString("pcsn"))
|
||||
.addParam("flag","3")
|
||||
.process()
|
||||
.uniqueResult(0);
|
||||
if(FactoryWarranty!=null){
|
||||
//含碳比
|
||||
double value = FactoryWarranty.getDouble("value");
|
||||
//更新含碳比
|
||||
jo.put("is_tan",value);
|
||||
}
|
||||
}
|
||||
//获取碳化铬
|
||||
JSONObject FactoryWarranty2 = WQL.getWO("QPF_AUTOFORMULA01")
|
||||
@@ -458,7 +463,9 @@ public class FormulaServiceImpl implements FormulaService {
|
||||
jo.put("is_09030102","100");
|
||||
}else if(MaterOptTypeEnum.TF.getClass_idStr().contains(jo.getString("material_id")) ||(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.TF.getClass_idStr().contains(material_type_id))){//C粉新料
|
||||
//如果该物料是c粉
|
||||
jo.put("is_tan","100");
|
||||
if (StrUtil.isEmpty(jo.getString("is_tan"))) {
|
||||
jo.put("is_tan","100");
|
||||
}
|
||||
}
|
||||
dtl_new.add(jo);
|
||||
}
|
||||
@@ -491,11 +498,7 @@ public class FormulaServiceImpl implements FormulaService {
|
||||
//成型剂
|
||||
if (StrUtil.isNotEmpty(jo.getString("formingtype_code"))) {
|
||||
jo.put("is_"+jo.getString("formingtype_code"),"100");
|
||||
}/*else if(jo.getString("material_type").equals("02")){//物料分类
|
||||
if(jo.getString("material_id").equals("1503644362788179968")){
|
||||
jo.put("is_tan","100");
|
||||
}
|
||||
}*/else if(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.RD_AND_PG.getClass_idStr().contains(material_type_id)){//软废
|
||||
}else if(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.RD_AND_PG.getClass_idStr().contains(material_type_id)){//软废
|
||||
String jo_material_id = jo.getString("material_id");
|
||||
JSONArray bomdlts = WQL.getWO("QPF_AUTOFORMULA01")
|
||||
.addParam("material_id",jo_material_id)
|
||||
@@ -526,24 +529,30 @@ public class FormulaServiceImpl implements FormulaService {
|
||||
jo.put("is_"+key,bomdlts2_now+"");
|
||||
}
|
||||
});
|
||||
if (StrUtil.isEmpty(jo.getString("is_tan"))) {
|
||||
jo.put("is_tan",jo.getString("is_tan2"));
|
||||
}
|
||||
}else if(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.THW.getClass_idStr().contains(material_type_id)){//碳化钨新料
|
||||
//获取修正值
|
||||
double change_qty = this.getWCChange(jo.getString("material_id"),jo.getString("pcsn"));
|
||||
jo.put("change_qty",change_qty);
|
||||
//获取碳含量
|
||||
JSONObject FactoryWarranty = WQL.getWO("QPF_AUTOFORMULA01")
|
||||
.addParam("material_id",jo.getString("material_id"))
|
||||
.addParam("pcsn",jo.getString("pcsn"))
|
||||
.addParam("flag","3")
|
||||
.process()
|
||||
.uniqueResult(0);
|
||||
if(FactoryWarranty==null){
|
||||
if (StrUtil.isEmpty(jo.getString("change_qty"))) {
|
||||
//获取修正值
|
||||
double change_qty = this.getWCChange(jo.getString("material_id"),jo.getString("pcsn"));
|
||||
jo.put("change_qty",change_qty);
|
||||
}
|
||||
if (StrUtil.isEmpty(jo.getString("is_tan"))) {
|
||||
jo.put("is_tan","0");
|
||||
}else{
|
||||
//含碳比
|
||||
double value = FactoryWarranty.getDouble("value");
|
||||
//更新含碳比
|
||||
jo.put("is_tan",value);
|
||||
//获取碳含量
|
||||
JSONObject FactoryWarranty = WQL.getWO("QPF_AUTOFORMULA01")
|
||||
.addParam("material_id",jo.getString("material_id"))
|
||||
.addParam("pcsn",jo.getString("pcsn"))
|
||||
.addParam("flag","3")
|
||||
.process()
|
||||
.uniqueResult(0);
|
||||
if(FactoryWarranty!=null){
|
||||
//含碳比
|
||||
double value = FactoryWarranty.getDouble("value");
|
||||
//更新含碳比
|
||||
jo.put("is_tan",value);
|
||||
}
|
||||
}
|
||||
//获取碳化铬
|
||||
JSONObject FactoryWarranty2 = WQL.getWO("QPF_AUTOFORMULA01")
|
||||
@@ -582,7 +591,9 @@ public class FormulaServiceImpl implements FormulaService {
|
||||
jo.put("is_09030102","100");
|
||||
}else if(MaterOptTypeEnum.TF.getClass_idStr().contains(jo.getString("material_id")) ||(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.TF.getClass_idStr().contains(material_type_id))){//C粉新料
|
||||
//如果该物料是c粉
|
||||
jo.put("is_tan","100");
|
||||
if (StrUtil.isEmpty(jo.getString("is_tan"))) {
|
||||
jo.put("is_tan","100");
|
||||
}
|
||||
}
|
||||
dtl_new.add(jo);
|
||||
}
|
||||
@@ -599,11 +610,7 @@ public class FormulaServiceImpl implements FormulaService {
|
||||
//成型剂
|
||||
if (StrUtil.isNotEmpty(jo.getString("formingtype_code"))) {
|
||||
jo.put("is_"+jo.getString("formingtype_code"),"100");
|
||||
}/*else if(jo.getString("material_type").equals("02")){//物料分类
|
||||
if(jo.getString("material_id").equals("1503644362788179968")){
|
||||
jo.put("is_tan","100");
|
||||
}
|
||||
}*/else if(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.RD_AND_PG.getClass_idStr().contains(material_type_id)){//软废
|
||||
}else if(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.RD_AND_PG.getClass_idStr().contains(material_type_id)){//软废
|
||||
String jo_material_id = jo.getString("material_id");
|
||||
JSONArray bomdlts = WQL.getWO("QPF_AUTOFORMULA01")
|
||||
.addParam("material_id",jo_material_id)
|
||||
@@ -634,21 +641,30 @@ public class FormulaServiceImpl implements FormulaService {
|
||||
jo.put("is_"+key,bomdlts2_now+"");
|
||||
}
|
||||
});
|
||||
if (StrUtil.isEmpty(jo.getString("is_tan"))) {
|
||||
jo.put("is_tan",jo.getString("is_tan2"));
|
||||
}
|
||||
}else if(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.THW.getClass_idStr().contains(material_type_id)){//碳化钨新料
|
||||
//获取碳含量
|
||||
JSONObject FactoryWarranty = WQL.getWO("QPF_AUTOFORMULA01")
|
||||
.addParam("material_id",jo.getString("material_id"))
|
||||
.addParam("pcsn",jo.getString("pcsn"))
|
||||
.addParam("flag","3")
|
||||
.process()
|
||||
.uniqueResult(0);
|
||||
if(FactoryWarranty==null){
|
||||
if (StrUtil.isEmpty(jo.getString("change_qty"))) {
|
||||
//获取修正值
|
||||
double change_qty = this.getWCChange(jo.getString("material_id"),jo.getString("pcsn"));
|
||||
jo.put("change_qty",change_qty);
|
||||
}
|
||||
if (StrUtil.isEmpty(jo.getString("is_tan"))) {
|
||||
jo.put("is_tan","0");
|
||||
}else{
|
||||
//含碳比
|
||||
double value = FactoryWarranty.getDouble("value");
|
||||
//更新含碳比
|
||||
jo.put("is_tan",value);
|
||||
//获取碳含量
|
||||
JSONObject FactoryWarranty = WQL.getWO("QPF_AUTOFORMULA01")
|
||||
.addParam("material_id",jo.getString("material_id"))
|
||||
.addParam("pcsn",jo.getString("pcsn"))
|
||||
.addParam("flag","3")
|
||||
.process()
|
||||
.uniqueResult(0);
|
||||
if(FactoryWarranty!=null){
|
||||
//含碳比
|
||||
double value = FactoryWarranty.getDouble("value");
|
||||
//更新含碳比
|
||||
jo.put("is_tan",value);
|
||||
}
|
||||
}
|
||||
//获取碳化铬
|
||||
JSONObject FactoryWarranty2 = WQL.getWO("QPF_AUTOFORMULA01")
|
||||
@@ -687,7 +703,9 @@ public class FormulaServiceImpl implements FormulaService {
|
||||
jo.put("is_09030102","100");
|
||||
}else if(MaterOptTypeEnum.TF.getClass_idStr().contains(jo.getString("material_id")) ||(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.TF.getClass_idStr().contains(material_type_id))){//C粉新料
|
||||
//如果该物料是c粉
|
||||
jo.put("is_tan","100");
|
||||
if (StrUtil.isEmpty(jo.getString("is_tan"))) {
|
||||
jo.put("is_tan","100");
|
||||
}
|
||||
}
|
||||
dis_new.add(jo);
|
||||
}
|
||||
|
||||
@@ -321,6 +321,7 @@ public class InitformulaServiceImpl implements InitformulaService {
|
||||
Formula_01.put("waste_limit_up",whereJson.getString("waste_limit_up"));
|
||||
Formula_01.put("is_again_put",whereJson.getString("is_again_put"));
|
||||
Formula_01.put("formula_type",whereJson.getString("formula_type"));
|
||||
Formula_01.put("c_balance",whereJson.getString("c_balance"));
|
||||
Formula_01.put("bucket_type","01");
|
||||
|
||||
Formula_01.put("masterbucket_qty","0");
|
||||
@@ -440,6 +441,7 @@ public class InitformulaServiceImpl implements InitformulaService {
|
||||
Formula_02.put("waste_limit_up",whereJson.getString("waste_limit_up"));
|
||||
Formula_02.put("is_again_put",whereJson.getString("is_again_put"));
|
||||
Formula_02.put("formula_type",whereJson.getString("formula_type"));
|
||||
Formula_02.put("c_balance",whereJson.getString("c_balance"));
|
||||
Formula_02.put("bucket_type","02");
|
||||
|
||||
Formula_02.put("masterbucket_qty","0");
|
||||
@@ -621,6 +623,7 @@ public class InitformulaServiceImpl implements InitformulaService {
|
||||
Formula_01.put("waste_limit_up",whereJson.getString("waste_limit_up"));
|
||||
Formula_01.put("is_again_put",whereJson.getString("is_again_put"));
|
||||
Formula_01.put("formula_type",whereJson.getString("formula_type"));
|
||||
Formula_01.put("c_balance",whereJson.getString("c_balance"));
|
||||
Formula_01.put("bucket_type","01");
|
||||
Formula_01.put("masterbucket_qty","0");
|
||||
Formula_01.put("extadd_qty","0");
|
||||
@@ -740,6 +743,7 @@ public class InitformulaServiceImpl implements InitformulaService {
|
||||
Formula_02.put("waste_limit_up",whereJson.getString("waste_limit_up"));
|
||||
Formula_02.put("is_again_put",whereJson.getString("is_again_put"));
|
||||
Formula_02.put("formula_type",whereJson.getString("formula_type"));
|
||||
Formula_02.put("c_balance",whereJson.getString("c_balance"));
|
||||
Formula_02.put("bucket_type","02");
|
||||
Formula_02.put("masterbucket_qty","0");
|
||||
Formula_02.put("extadd_qty","0");
|
||||
@@ -915,12 +919,16 @@ public class InitformulaServiceImpl implements InitformulaService {
|
||||
if(Formula == null ){
|
||||
throw new BadRequestException("当前配方信息查询失败!");
|
||||
}
|
||||
|
||||
JSONObject material = MD_ME_ProductMaterialExt.query("material_id ='"+material_id+"'").uniqueResult(0);
|
||||
if(material == null ){
|
||||
throw new BadRequestException("当前成品查询不到成品物料扩展信息!");
|
||||
}
|
||||
Formula.put("net_rate",material.getString("net_rate"));
|
||||
Formula.put("c_balance",material.getString("c_balance"));
|
||||
|
||||
if (StrUtil.isEmpty(Formula.getString("c_balance"))) {
|
||||
Formula.put("c_balance",material.getString("c_balance"));
|
||||
}
|
||||
JSONArray dtl = WQL.getWO("QPF_INITFORMULA01")
|
||||
.addParam("workorder_id",workorder.getString("workorder_id"))
|
||||
.addParam("material_id",workorder.getString("material_id"))
|
||||
@@ -934,11 +942,7 @@ public class InitformulaServiceImpl implements InitformulaService {
|
||||
//成型剂
|
||||
if (StrUtil.isNotEmpty(jo.getString("formingtype_code"))) {
|
||||
jo.put("is_"+jo.getString("formingtype_code"),"100");
|
||||
}/*else if(jo.getString("material_type").equals("02")){//物料分类
|
||||
if(jo.getString("material_id").equals("1503644362788179968")){
|
||||
jo.put("is_tan","100");
|
||||
}
|
||||
}*/else if(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.RD_AND_PG.getClass_idStr().contains(material_type_id)){//软废
|
||||
}else if(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.RD_AND_PG.getClass_idStr().contains(material_type_id)){//软废
|
||||
String jo_material_id = jo.getString("material_id");
|
||||
JSONArray bomdlts = WQL.getWO("QPF_AUTOFORMULA01")
|
||||
.addParam("material_id",jo_material_id)
|
||||
@@ -969,26 +973,32 @@ public class InitformulaServiceImpl implements InitformulaService {
|
||||
jo.put("is_"+key,bomdlts2_now+"");
|
||||
}
|
||||
});
|
||||
}else if(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.THW.getClass_idStr().contains(material_type_id)){//碳化钨新料
|
||||
|
||||
//获取修正值
|
||||
double change_qty = this.getWCChange(jo.getString("material_id"),jo.getString("pcsn"));
|
||||
jo.put("change_qty",change_qty);
|
||||
//获取碳含量
|
||||
JSONObject FactoryWarranty = WQL.getWO("QPF_AUTOFORMULA01")
|
||||
.addParam("material_id",jo.getString("material_id"))
|
||||
.addParam("pcsn",jo.getString("pcsn"))
|
||||
.addParam("flag","3")
|
||||
.process()
|
||||
.uniqueResult(0);
|
||||
if(FactoryWarranty==null){
|
||||
jo.put("is_tan","0");
|
||||
}else{
|
||||
//含碳比
|
||||
double value = FactoryWarranty.getDouble("value");
|
||||
//更新含碳比
|
||||
jo.put("is_tan",value);
|
||||
if (StrUtil.isEmpty(jo.getString("is_tan"))) {
|
||||
jo.put("is_tan",jo.getString("is_tan2"));
|
||||
}
|
||||
}else if(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.THW.getClass_idStr().contains(material_type_id)){//碳化钨新料
|
||||
if (StrUtil.isEmpty(jo.getString("change_qty"))) {
|
||||
//获取修正值
|
||||
double change_qty = this.getWCChange(jo.getString("material_id"),jo.getString("pcsn"));
|
||||
jo.put("change_qty",change_qty);
|
||||
}
|
||||
if (StrUtil.isEmpty(jo.getString("is_tan"))) {
|
||||
jo.put("is_tan","0");
|
||||
//获取碳含量
|
||||
JSONObject FactoryWarranty = WQL.getWO("QPF_AUTOFORMULA01")
|
||||
.addParam("material_id",jo.getString("material_id"))
|
||||
.addParam("pcsn",jo.getString("pcsn"))
|
||||
.addParam("flag","3")
|
||||
.process()
|
||||
.uniqueResult(0);
|
||||
if(FactoryWarranty!=null){
|
||||
//含碳比
|
||||
double value = FactoryWarranty.getDouble("value");
|
||||
//更新含碳比
|
||||
jo.put("is_tan",value);
|
||||
}
|
||||
}
|
||||
|
||||
//获取碳化铬
|
||||
JSONObject FactoryWarranty2 = WQL.getWO("QPF_AUTOFORMULA01")
|
||||
.addParam("material_id",jo.getString("material_id"))
|
||||
@@ -1026,7 +1036,9 @@ public class InitformulaServiceImpl implements InitformulaService {
|
||||
jo.put("is_09030102","100");
|
||||
}else if(MaterOptTypeEnum.TF.getClass_idStr().contains(jo.getString("material_id")) ||(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.TF.getClass_idStr().contains(material_type_id))){//C粉新料
|
||||
//如果该物料是c粉
|
||||
jo.put("is_tan","100");
|
||||
if (StrUtil.isEmpty(jo.getString("is_tan"))) {
|
||||
jo.put("is_tan","100");
|
||||
}
|
||||
}
|
||||
dtl_new.add(jo);
|
||||
}
|
||||
@@ -1043,11 +1055,7 @@ public class InitformulaServiceImpl implements InitformulaService {
|
||||
//成型剂
|
||||
if (StrUtil.isNotEmpty(jo.getString("formingtype_code"))) {
|
||||
jo.put("is_"+jo.getString("formingtype_code"),"100");
|
||||
}/*else if(jo.getString("material_type").equals("02")){//物料分类
|
||||
if(jo.getString("material_id").equals("1503644362788179968")){
|
||||
jo.put("is_tan","100");
|
||||
}
|
||||
}*/else if(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.RD_AND_PG.getClass_idStr().contains(material_type_id)){//软废
|
||||
}else if(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.RD_AND_PG.getClass_idStr().contains(material_type_id)){//软废
|
||||
String jo_material_id = jo.getString("material_id");
|
||||
JSONArray bomdlts = WQL.getWO("QPF_AUTOFORMULA01")
|
||||
.addParam("material_id",jo_material_id)
|
||||
@@ -1078,21 +1086,30 @@ public class InitformulaServiceImpl implements InitformulaService {
|
||||
jo.put("is_"+key,bomdlts2_now+"");
|
||||
}
|
||||
});
|
||||
if (StrUtil.isEmpty(jo.getString("is_tan"))) {
|
||||
jo.put("is_tan",jo.getString("is_tan2"));
|
||||
}
|
||||
}else if(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.THW.getClass_idStr().contains(material_type_id)){//碳化钨新料
|
||||
//获取碳含量
|
||||
JSONObject FactoryWarranty = WQL.getWO("QPF_AUTOFORMULA01")
|
||||
.addParam("material_id",jo.getString("material_id"))
|
||||
.addParam("pcsn",jo.getString("pcsn"))
|
||||
.addParam("flag","3")
|
||||
.process()
|
||||
.uniqueResult(0);
|
||||
if(FactoryWarranty==null){
|
||||
if (StrUtil.isEmpty(jo.getString("change_qty"))) {
|
||||
//获取修正值
|
||||
double change_qty = this.getWCChange(jo.getString("material_id"),jo.getString("pcsn"));
|
||||
jo.put("change_qty",change_qty);
|
||||
}
|
||||
if (StrUtil.isEmpty(jo.getString("is_tan"))) {
|
||||
jo.put("is_tan","0");
|
||||
}else{
|
||||
//含碳比
|
||||
double value = FactoryWarranty.getDouble("value");
|
||||
//更新含碳比
|
||||
jo.put("is_tan",value);
|
||||
//获取碳含量
|
||||
JSONObject FactoryWarranty = WQL.getWO("QPF_AUTOFORMULA01")
|
||||
.addParam("material_id",jo.getString("material_id"))
|
||||
.addParam("pcsn",jo.getString("pcsn"))
|
||||
.addParam("flag","3")
|
||||
.process()
|
||||
.uniqueResult(0);
|
||||
if(FactoryWarranty!=null){
|
||||
//含碳比
|
||||
double value = FactoryWarranty.getDouble("value");
|
||||
//更新含碳比
|
||||
jo.put("is_tan",value);
|
||||
}
|
||||
}
|
||||
//获取碳化铬
|
||||
JSONObject FactoryWarranty2 = WQL.getWO("QPF_AUTOFORMULA01")
|
||||
@@ -1131,7 +1148,9 @@ public class InitformulaServiceImpl implements InitformulaService {
|
||||
jo.put("is_09030102","100");
|
||||
}else if(MaterOptTypeEnum.TF.getClass_idStr().contains(jo.getString("material_id")) ||(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.TF.getClass_idStr().contains(material_type_id))){//C粉新料
|
||||
//如果该物料是c粉
|
||||
jo.put("is_tan","100");
|
||||
if (StrUtil.isEmpty(jo.getString("is_tan"))) {
|
||||
jo.put("is_tan","100");
|
||||
}
|
||||
}
|
||||
dis_new.add(jo);
|
||||
}
|
||||
|
||||
@@ -359,7 +359,7 @@
|
||||
SELECT
|
||||
FormulaDtl.*,
|
||||
Formula.bucket_type,
|
||||
producmaterialext.c_balance AS is_tan,
|
||||
producmaterialext.c_balance AS is_tan2,
|
||||
mb.material_type_id,
|
||||
case when structivt2.sum_ivt_qty>0 then '1'
|
||||
else '0' end as is_rf_xl,
|
||||
|
||||
Reference in New Issue
Block a user