修正值

This commit is contained in:
zds
2022-09-02 22:22:45 +08:00
parent 430706ec92
commit c5f4f9ae8b
7 changed files with 136 additions and 4 deletions

View File

@@ -312,6 +312,10 @@ public class AutoformulaServiceImpl implements AutoformulaService {
}
});
}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"))
@@ -618,6 +622,11 @@ public class AutoformulaServiceImpl implements AutoformulaService {
double bom_ivt_qty = bomdlt_Cr3C2.getDouble("bom_ivt_qty");
//含碳比
double value = FactoryWarranty.getDouble("value");
//获取修正值
double change_qty = this.getWCChange(bomdlt_Cr3C2.getString("material_id"),bomdlt_Cr3C2.getString("pcsn"));
value = value + change_qty;
//总碳
CT1 = CT1 + bom_ivt_qty*value/100.0;
@@ -1685,6 +1694,10 @@ public class AutoformulaServiceImpl implements AutoformulaService {
double bom_ivt_qty = bomdlt_Cr3C2.getDouble("bom_ivt_qty");
//含碳比
double is_tan = FactoryWarranty.getDouble("value");
//获取修正值
double change_qty = this.getWCChange(bomdlt_Cr3C2.getString("material_id"),bomdlt_Cr3C2.getString("pcsn"));
is_tan = is_tan + change_qty;
//总碳
CT1 = CT1 + bom_ivt_qty*is_tan/100.0;
//总碳化钨
@@ -2750,6 +2763,10 @@ public class AutoformulaServiceImpl implements AutoformulaService {
}
});
}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"))
@@ -3170,6 +3187,10 @@ public class AutoformulaServiceImpl implements AutoformulaService {
double bom_ivt_qty = bomdlt_Cr3C2.getDouble("bom_ivt_qty");
//含碳比
double is_tan = FactoryWarranty.getDouble("value");
//获取修正值
double change_qty = this.getWCChange(bomdlt_Cr3C2.getString("material_id"),bomdlt_Cr3C2.getString("pcsn"));
is_tan = is_tan + change_qty;
//总碳
CT1 = CT1 + bom_ivt_qty*is_tan/100.0;
//更新含碳比
@@ -4134,4 +4155,26 @@ public class AutoformulaServiceImpl implements AutoformulaService {
}
public double getWCChange(String material_id,String pcsn){
WQLObject PDM_BI_SuppWCChange = WQLObject.getWQLObject("PDM_BI_SuppWCChange"); // 工艺路线主表
double wcchange = 0.0;
//获取碳化钒
JSONObject FactoryWarranty = WQL.getWO("QPF_INITFORMULA01")
.addParam("material_id",material_id)
.addParam("pcsn",pcsn)
.addParam("flag","9")
.process()
.uniqueResult(0);
if(FactoryWarranty!=null){
String source_id = FactoryWarranty.getString("source_id");
JSONObject jo = PDM_BI_SuppWCChange.query("material_id='"+material_id+"' and supp_id='"+source_id+"'").uniqueResult(0);
if(jo!=null){
wcchange = jo.getDouble("change_qty");
}
}
return wcchange;
}
}

View File

@@ -400,6 +400,10 @@ public class FormulaServiceImpl implements FormulaService {
}
});
}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"))
@@ -521,6 +525,9 @@ public class FormulaServiceImpl implements FormulaService {
}
});
}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"))
@@ -1045,4 +1052,26 @@ public class FormulaServiceImpl implements FormulaService {
e.printStackTrace();
}
}
public double getWCChange(String material_id,String pcsn){
WQLObject PDM_BI_SuppWCChange = WQLObject.getWQLObject("PDM_BI_SuppWCChange"); // 工艺路线主表
double wcchange = 0.0;
//获取碳化钒
JSONObject FactoryWarranty = WQL.getWO("QPF_INITFORMULA01")
.addParam("material_id",material_id)
.addParam("pcsn",pcsn)
.addParam("flag","9")
.process()
.uniqueResult(0);
if(FactoryWarranty!=null){
String source_id = FactoryWarranty.getString("source_id");
JSONObject jo = PDM_BI_SuppWCChange.query("material_id='"+material_id+"' and supp_id='"+source_id+"'").uniqueResult(0);
if(jo!=null){
wcchange = jo.getDouble("change_qty");
}
}
return wcchange;
}
}

View File

@@ -54,6 +54,9 @@ public class InitformulaServiceImpl implements InitformulaService {
String material_type_id = jo.getString("material_type_id");
//如果该物料是碳化钨
if(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"))
@@ -953,6 +956,10 @@ public class InitformulaServiceImpl implements InitformulaService {
}
});
}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"))
@@ -1171,4 +1178,27 @@ public class InitformulaServiceImpl implements InitformulaService {
return ret;
}
public double getWCChange(String material_id,String pcsn){
WQLObject PDM_BI_SuppWCChange = WQLObject.getWQLObject("PDM_BI_SuppWCChange"); // 工艺路线主表
double wcchange = 0.0;
//获取碳化钒
JSONObject FactoryWarranty = WQL.getWO("QPF_INITFORMULA01")
.addParam("material_id",material_id)
.addParam("pcsn",pcsn)
.addParam("flag","9")
.process()
.uniqueResult(0);
if(FactoryWarranty!=null){
String source_id = FactoryWarranty.getString("source_id");
JSONObject jo = PDM_BI_SuppWCChange.query("material_id='"+material_id+"' and supp_id='"+source_id+"'").uniqueResult(0);
if(jo!=null){
wcchange = jo.getDouble("change_qty");
}
}
return wcchange;
}
}

View File

@@ -566,5 +566,28 @@
ENDPAGEQUERY
ENDIF
IF 输入.flag = "9"
QUERY
SELECT
ReceiveMst.receive_id,
ReceiveMst.source_id,
ReceiveDtl.receivedtl_id,
ReceiveDtl.material_id,
ReceiveDtl.pcsn
FROM
PCS_RC_ReceiveDtl ReceiveDtl
LEFT JOIN PCS_RC_ReceiveMst ReceiveMst ON ReceiveMst.receive_id = ReceiveDtl.receive_id
WHERE
1 = 1 and ReceiveMst.is_delete='0' and ReceiveMst.source_type='01'
OPTION 输入.material_id <> ""
ReceiveDtl.material_id = 输入.material_id
ENDOPTION
OPTION 输入.pcsn <> ""
ReceiveDtl.pcsn = 输入.pcsn
ENDOPTION
ENDSELECT
ENDQUERY
ENDIF