批次修改、系统参数优化
This commit is contained in:
@@ -4,6 +4,7 @@ package org.nl.wms.pf.service.impl;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
@@ -115,6 +116,16 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
yzj_list = ret.getJSONArray("yzj_list");
|
||||
cw_list = ret.getJSONArray("cw_list");
|
||||
}else{
|
||||
WQLObject wo_param = WQLObject.getWQLObject("sys_param");
|
||||
JSONObject param = wo_param.query("is_active='1' and is_delete='0' and code='IS_LIMIT_RF'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(param)) {
|
||||
throw new BadRequestException("是否开启软废限制系统参数查询失败!");
|
||||
}
|
||||
String value = param.getString("value");
|
||||
String value_is_active = "";
|
||||
if("1".equals(value)){
|
||||
value_is_active = "1";
|
||||
}//.addParam("is_active",value_is_active)
|
||||
//获取库存集合
|
||||
JSONArray ivts = new JSONArray();
|
||||
for(int i=0;i<MaterialSets.size();i++){
|
||||
@@ -122,6 +133,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
String set_material_id = MaterialSet.getString("set_material_id");
|
||||
JSONArray now_ivts = WQL.getWO("QPF_AUTOFORMULA01")
|
||||
.addParam("material_id",set_material_id)
|
||||
.addParam("is_active",value_is_active)
|
||||
.addParam("quality_scode","02")
|
||||
.addParam("workorder_id",workorder_id)
|
||||
.addParam("flag","22")
|
||||
@@ -474,6 +486,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
.addParam("material_id",bomdtl_material_id)
|
||||
.addParam("workorder_id",workorder_id)
|
||||
.addParam("quality_scode","01")
|
||||
.addParam("is_active","1")
|
||||
.addParam("prior_level",prior_level)
|
||||
.addParam("flag","22")
|
||||
.process().getResultJSONArray(0);
|
||||
@@ -1203,12 +1216,24 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
}
|
||||
//获取库存集合
|
||||
JSONArray ivts = new JSONArray();
|
||||
|
||||
WQLObject wo_param = WQLObject.getWQLObject("sys_param");
|
||||
JSONObject param = wo_param.query("is_active='1' and is_delete='0' and code='IS_LIMIT_RF'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(param)) {
|
||||
throw new BadRequestException("是否开启软废限制系统参数查询失败!");
|
||||
}
|
||||
String value = param.getString("value");
|
||||
String value_is_active = "";
|
||||
if("1".equals(value)){
|
||||
value_is_active = "1";
|
||||
}
|
||||
for(int i=0;i<MaterialSets.size();i++){
|
||||
JSONObject MaterialSet = MaterialSets.getJSONObject(i);
|
||||
String set_material_id = MaterialSet.getString("set_material_id");
|
||||
JSONArray now_ivts = WQL.getWO("QPF_AUTOFORMULA01")
|
||||
.addParam("material_id",set_material_id)
|
||||
.addParam("workorder_id",workorder_id)
|
||||
.addParam("is_active",value_is_active)
|
||||
.addParam("quality_scode","02")
|
||||
.addParam("flag","22")
|
||||
.process().getResultJSONArray(0);
|
||||
@@ -1322,6 +1347,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
JSONArray bom_materials = WQL.getWO("QPF_AUTOFORMULA01")
|
||||
.addParam("material_id",bomdtl_material_id)
|
||||
.addParam("quality_scode","01")
|
||||
.addParam("is_active","1")
|
||||
.addParam("workorder_id",workorder_id)
|
||||
.addParam("prior_level",prior_level)
|
||||
.addParam("flag","22")
|
||||
@@ -1394,13 +1420,13 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
//重量
|
||||
double bom_ivt_qty = bomdlt_Cr3C2.getDouble("bom_ivt_qty");
|
||||
//含碳比
|
||||
double value = FactoryWarranty.getDouble("value");
|
||||
double is_tan = FactoryWarranty.getDouble("value");
|
||||
//总碳
|
||||
CT1 = CT1 + bom_ivt_qty*value/100.0;
|
||||
CT1 = CT1 + bom_ivt_qty*is_tan/100.0;
|
||||
//总碳化钨
|
||||
CT1_weight = CT1_weight + bom_ivt_qty;
|
||||
//更新含碳比
|
||||
bomdlt_Cr3C2.put("is_tan",value);
|
||||
bomdlt_Cr3C2.put("is_tan",is_tan);
|
||||
bomdlts_plan_map.put(bomdlt_Cr3C2.getString("stockrecord_id"),bomdlt_Cr3C2);
|
||||
}
|
||||
//BOM中碳化钨需含总碳
|
||||
@@ -1474,9 +1500,9 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
//已配重量
|
||||
double finished_qty = tjj_map_jo.getDouble("finished_qty");
|
||||
//质保书含量比
|
||||
double value = tjj_finished.getDouble("value");
|
||||
double is_tan = tjj_finished.getDouble("value");
|
||||
//当前含量重量
|
||||
double finished = bom_ivt_qty*value/100.0;
|
||||
double finished = bom_ivt_qty*is_tan/100.0;
|
||||
//累计各碳化钨中已含添加剂重量
|
||||
tjj_map_jo.put("finished_qty",finished_qty+finished);
|
||||
tjj_map.put(tjj_material_id,tjj_map_jo);
|
||||
@@ -1572,9 +1598,9 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
//已配重量
|
||||
double finished_qty = tjj_map_jo.getDouble("finished_qty");
|
||||
//质保书含量比
|
||||
double value = tjj_finished.getDouble("value");
|
||||
double is_tan = tjj_finished.getDouble("value");
|
||||
//当前含量重量
|
||||
double finished = bom_ivt_qty_jo*value/100.0;
|
||||
double finished = bom_ivt_qty_jo*is_tan/100.0;
|
||||
//累计各碳化钨中已含添加剂重量
|
||||
tjj_map_jo.put("finished_qty",finished_qty+finished);
|
||||
tjj_map.put(tjj_material_id,tjj_map_jo);
|
||||
@@ -1656,9 +1682,9 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
//已配重量
|
||||
double finished_qty = tjj_map_jo.getDouble("finished_qty");
|
||||
//质保书含量比
|
||||
double value = tjj_finished.getDouble("value");
|
||||
double is_tan = tjj_finished.getDouble("value");
|
||||
//当前含量重量
|
||||
double finished = bom_ivt_qty_jo*value/100.0;
|
||||
double finished = bom_ivt_qty_jo*is_tan/100.0;
|
||||
//累计各碳化钨中已含添加剂重量
|
||||
tjj_map_jo.put("finished_qty",finished_qty+finished);
|
||||
tjj_map.put(tjj_material_id,tjj_map_jo);
|
||||
@@ -1735,9 +1761,9 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
//已配重量
|
||||
double finished_qty = tjj_map_jo.getDouble("finished_qty");
|
||||
//质保书含量比
|
||||
double value = tjj_finished.getDouble("value");
|
||||
double is_tan = tjj_finished.getDouble("value");
|
||||
//当前含量重量
|
||||
double finished = bom_ivt_qty*value/100.0;
|
||||
double finished = bom_ivt_qty*is_tan/100.0;
|
||||
//累计各碳化钨中已含添加剂重量
|
||||
tjj_map_jo.put("finished_qty",finished_qty+finished);
|
||||
tjj_map.put(tjj_material_id,tjj_map_jo);
|
||||
@@ -1832,9 +1858,9 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
//已配重量
|
||||
double finished_qty = tjj_map_jo.getDouble("finished_qty");
|
||||
//质保书含量比
|
||||
double value = tjj_finished.getDouble("value");
|
||||
double is_tan = tjj_finished.getDouble("value");
|
||||
//当前含量重量
|
||||
double finished = bom_ivt_qty_jo*value/100.0;
|
||||
double finished = bom_ivt_qty_jo*is_tan/100.0;
|
||||
//累计各碳化钨中已含添加剂重量
|
||||
tjj_map_jo.put("finished_qty",finished_qty+finished);
|
||||
tjj_map.put(tjj_material_id,tjj_map_jo);
|
||||
@@ -1915,9 +1941,9 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
//已配重量
|
||||
double finished_qty = tjj_map_jo.getDouble("finished_qty");
|
||||
//质保书含量比
|
||||
double value = tjj_finished.getDouble("value");
|
||||
double is_tan = tjj_finished.getDouble("value");
|
||||
//当前含量重量
|
||||
double finished = bom_ivt_qty_jo*value/100.0;
|
||||
double finished = bom_ivt_qty_jo*is_tan/100.0;
|
||||
//累计各碳化钨中已含添加剂重量
|
||||
tjj_map_jo.put("finished_qty",finished_qty+finished);
|
||||
tjj_map.put(tjj_material_id,tjj_map_jo);
|
||||
@@ -2110,6 +2136,16 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
yzj_list = ret.getJSONArray("yzj_list");
|
||||
cw_list = ret.getJSONArray("cw_list");
|
||||
}else{
|
||||
WQLObject wo_param = WQLObject.getWQLObject("sys_param");
|
||||
JSONObject param = wo_param.query("is_active='1' and is_delete='0' and code='IS_LIMIT_RF'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(param)) {
|
||||
throw new BadRequestException("是否开启软废限制系统参数查询失败!");
|
||||
}
|
||||
String value = param.getString("value");
|
||||
String value_is_active = "";
|
||||
if("1".equals(value)){
|
||||
value_is_active = "1";
|
||||
}
|
||||
//获取库存集合
|
||||
JSONArray ivts = new JSONArray();
|
||||
for(int i=0;i<MaterialSets.size();i++){
|
||||
@@ -2117,6 +2153,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
String set_material_id = MaterialSet.getString("set_material_id");
|
||||
JSONArray now_ivts = WQL.getWO("QPF_AUTOFORMULA01")
|
||||
.addParam("material_id",set_material_id)
|
||||
.addParam("is_active",value_is_active)
|
||||
.addParam("quality_scode","02")
|
||||
.addParam("workorder_id",workorder_id)
|
||||
.addParam("flag","22")
|
||||
@@ -2362,6 +2399,16 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
if(MaterialSets.size() == 0){
|
||||
throw new BadRequestException("产品"+material_code+"未配置新料模式可配粉软废信息!");
|
||||
}
|
||||
WQLObject wo_param = WQLObject.getWQLObject("sys_param");
|
||||
JSONObject param = wo_param.query("is_active='1' and is_delete='0' and code='IS_LIMIT_RF'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(param)) {
|
||||
throw new BadRequestException("是否开启软废限制系统参数查询失败!");
|
||||
}
|
||||
String value = param.getString("value");
|
||||
String value_is_active = "";
|
||||
if("1".equals(value)){
|
||||
value_is_active = "1";
|
||||
}
|
||||
//获取库存集合
|
||||
JSONArray ivts = new JSONArray();
|
||||
for(int i=0;i<MaterialSets.size();i++){
|
||||
@@ -2369,6 +2416,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
String set_material_id = MaterialSet.getString("set_material_id");
|
||||
JSONArray now_ivts = WQL.getWO("QPF_AUTOFORMULA01")
|
||||
.addParam("material_id",set_material_id)
|
||||
.addParam("is_active",value_is_active)
|
||||
.addParam("quality_scode","02")
|
||||
.addParam("workorder_id",workorder_id)
|
||||
.addParam("flag","22")
|
||||
@@ -2543,6 +2591,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
.addParam("material_id",bomdtl_material_id)
|
||||
.addParam("quality_scode","01")
|
||||
.addParam("prior_level",prior_level)
|
||||
.addParam("is_active","1")
|
||||
.addParam("workorder_id",workorder_id)
|
||||
.addParam("flag","22")
|
||||
.process().getResultJSONArray(0);
|
||||
@@ -2643,11 +2692,11 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
//重量
|
||||
double bom_ivt_qty = bomdlt_Cr3C2.getDouble("bom_ivt_qty");
|
||||
//含碳比
|
||||
double value = FactoryWarranty.getDouble("value");
|
||||
double is_tan = FactoryWarranty.getDouble("value");
|
||||
//总碳
|
||||
CT1 = CT1 + bom_ivt_qty*value/100.0;
|
||||
CT1 = CT1 + bom_ivt_qty*is_tan/100.0;
|
||||
//更新含碳比
|
||||
bomdlt_Cr3C2.put("is_tan",value);
|
||||
bomdlt_Cr3C2.put("is_tan",is_tan);
|
||||
bomdlts_need_map.put(bomdlt_Cr3C2.getString("material_id"),bomdlt_Cr3C2);
|
||||
}
|
||||
//软废总碳
|
||||
@@ -2660,9 +2709,9 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
//碳化钨总含量
|
||||
double rf_Cr3C2 = ivt_new.getDouble("rf_Cr3C2");
|
||||
//含碳比
|
||||
double value = ivt_new.getDouble("is_tan");
|
||||
double is_tan = ivt_new.getDouble("is_tan");
|
||||
//总碳
|
||||
CT1 = CT1 + formula_qty*value/100.0*net_rate/100.0*rf_Cr3C2/100.0;
|
||||
CT1 = CT1 + formula_qty*is_tan/100.0*net_rate/100.0*rf_Cr3C2/100.0;
|
||||
}
|
||||
//BOM中碳化钨需含总碳
|
||||
double CT2 = new_qty*(sum_Cr3C2/100.0)*(c_balance/100.0);
|
||||
@@ -3450,6 +3499,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
JSONArray now_ivts = WQL.getWO("QPF_AUTOFORMULA01")
|
||||
.addParam("material_id",bomdtl_material_id)
|
||||
.addParam("quality_scode","01")
|
||||
.addParam("is_active","1")
|
||||
.addParam("prior_level",prior_level)
|
||||
.addParam("workorder_id",workorder_id)
|
||||
.addParam("flag","22")
|
||||
|
||||
@@ -223,13 +223,15 @@ public class InitformulaServiceImpl implements InitformulaService {
|
||||
WQLObject PDM_BI_WorkOrder = WQLObject.getWQLObject("PDM_BI_WorkOrder"); // 工艺路线主表
|
||||
WQLObject PDM_BI_Formula = WQLObject.getWQLObject("PDM_BI_Formula");
|
||||
WQLObject PDM_BI_FormulaDtl = WQLObject.getWQLObject("PDM_BI_FormulaDtl");
|
||||
|
||||
WQLObject md_me_materialbase = WQLObject.getWQLObject("md_me_materialbase");
|
||||
WQLObject md_me_producmaterialext = WQLObject.getWQLObject("md_me_producmaterialext");
|
||||
String workorder_id = whereJson.getString("workorder_id");
|
||||
String material_id = whereJson.getString("material_id");
|
||||
JSONObject order = PDM_BI_WorkOrder.query("is_delete='0' and workorder_id='"+workorder_id+"'").uniqueResult(0);
|
||||
if(order == null){
|
||||
throw new BadRequestException("当前工令信息查询失败!");
|
||||
}
|
||||
String pcsn = order.getString("pcsn");
|
||||
String status = order.getString("status");
|
||||
if(!"20,30".contains(status)){
|
||||
throw new BadRequestException("当前工令非提交或开单中状态,不允许开单确认!");
|
||||
@@ -276,6 +278,8 @@ public class InitformulaServiceImpl implements InitformulaService {
|
||||
Formula_01.put("syscompanyid", deptId);
|
||||
double bill_qty = 0;
|
||||
double billpure_qty = 0;
|
||||
//软废纯粉总重
|
||||
double RF_total = 0;
|
||||
int mn =1;
|
||||
for(int i = 0;i<tableDtl.size();i++){
|
||||
JSONObject jo = tableDtl.getJSONObject(i);
|
||||
@@ -327,11 +331,19 @@ public class InitformulaServiceImpl implements InitformulaService {
|
||||
}else{
|
||||
Formula_01.put("extadd_qty",Formula_01.getDouble("extadd_qty")+jo.getDouble("formula_qty"));
|
||||
}
|
||||
JSONObject md_jo = md_me_materialbase.query("is_delete='0' and material_id='"+jo.getString("material_id")+"'").uniqueResult(0);
|
||||
if(md_jo!=null){
|
||||
//是否软废
|
||||
if(MaterOptTypeEnum.RF.getClass_idStr().contains(md_jo.getString("material_type_id"))){
|
||||
JSONObject pro_jo = md_me_producmaterialext.query("material_id='"+jo.getString("material_id")+"'").uniqueResult(0);
|
||||
double net_rate = pro_jo.getDouble("net_rate");
|
||||
RF_total = RF_total+jo.getDouble("formula_qty")*pro_jo.getDouble("net_rate")/100.0;
|
||||
}
|
||||
}
|
||||
bill_qty = bill_qty+jo.getDouble("formula_qty");
|
||||
PDM_BI_FormulaDtl.insert(jo);
|
||||
}
|
||||
Formula_01.put("total_qty",Formula_01.getDouble("masterbucket_qty")+Formula_01.getDouble("extadd_qty"));
|
||||
PDM_BI_Formula.insert(Formula_01);
|
||||
|
||||
JSONArray tabledis = whereJson.getJSONArray("tabledis");
|
||||
if("1".equals(whereJson.getString("is_again_put")) && tabledis.size()>0){
|
||||
JSONObject Formula_02 = new JSONObject();
|
||||
@@ -416,12 +428,54 @@ public class InitformulaServiceImpl implements InitformulaService {
|
||||
}else{
|
||||
Formula_02.put("extadd_qty",Formula_02.getDouble("extadd_qty")+jo.getDouble("formula_qty"));
|
||||
}
|
||||
JSONObject md_jo = md_me_materialbase.query("is_delete='0' and material_id='"+jo.getString("material_id")+"'").uniqueResult(0);
|
||||
if(md_jo!=null){
|
||||
//是否软废
|
||||
if(MaterOptTypeEnum.RF.getClass_idStr().contains(md_jo.getString("material_type_id"))){
|
||||
JSONObject pro_jo = md_me_producmaterialext.query("material_id='"+jo.getString("material_id")+"'").uniqueResult(0);
|
||||
double net_rate = pro_jo.getDouble("net_rate");
|
||||
RF_total = RF_total+jo.getDouble("formula_qty")*pro_jo.getDouble("net_rate")/100.0;
|
||||
}
|
||||
}
|
||||
bill_qty = bill_qty+jo.getDouble("formula_qty");
|
||||
PDM_BI_FormulaDtl.insert(jo);
|
||||
}
|
||||
if(billpure_qty>0){
|
||||
double RF_per = RF_total/billpure_qty;
|
||||
if(RF_per>=0.5){
|
||||
if(!pcsn.endsWith("R")){
|
||||
pcsn = pcsn+"R";
|
||||
}
|
||||
}else{
|
||||
if(pcsn.endsWith("R")){
|
||||
pcsn = pcsn.replace("R","");
|
||||
}
|
||||
}
|
||||
}else{
|
||||
pcsn = pcsn.replace("R","");
|
||||
}
|
||||
Formula_02.put("pcsn",pcsn);
|
||||
Formula_02.put("total_qty",Formula_02.getDouble("masterbucket_qty")+Formula_02.getDouble("extadd_qty"));
|
||||
PDM_BI_Formula.insert(Formula_02);
|
||||
}
|
||||
if(billpure_qty>0){
|
||||
double RF_per = RF_total/billpure_qty;
|
||||
if(RF_per>=0.5){
|
||||
if(!pcsn.endsWith("R")){
|
||||
pcsn = pcsn+"R";
|
||||
}
|
||||
}else{
|
||||
if(pcsn.endsWith("R")){
|
||||
pcsn = pcsn.replace("R","");
|
||||
}
|
||||
}
|
||||
}else{
|
||||
pcsn = pcsn.replace("R","");
|
||||
}
|
||||
Formula_01.put("pcsn",pcsn);
|
||||
Formula_01.put("total_qty",Formula_01.getDouble("masterbucket_qty")+Formula_01.getDouble("extadd_qty"));
|
||||
PDM_BI_Formula.insert(Formula_01);
|
||||
order.put("pcsn",pcsn);
|
||||
order.put("status","30");
|
||||
order.put("billpure_qty",billpure_qty+"");
|
||||
order.put("bill_qty",bill_qty+"");
|
||||
@@ -441,13 +495,15 @@ public class InitformulaServiceImpl implements InitformulaService {
|
||||
WQLObject PDM_BI_WorkOrder = WQLObject.getWQLObject("PDM_BI_WorkOrder"); // 工艺路线主表
|
||||
WQLObject PDM_BI_Formula = WQLObject.getWQLObject("PDM_BI_Formula");
|
||||
WQLObject PDM_BI_FormulaDtl = WQLObject.getWQLObject("PDM_BI_FormulaDtl");
|
||||
|
||||
WQLObject md_me_materialbase = WQLObject.getWQLObject("md_me_materialbase");
|
||||
WQLObject md_me_producmaterialext = WQLObject.getWQLObject("md_me_producmaterialext");
|
||||
String workorder_id = whereJson.getString("workorder_id");
|
||||
String material_id = whereJson.getString("material_id");
|
||||
JSONObject order = PDM_BI_WorkOrder.query("is_delete='0' and workorder_id='"+workorder_id+"'").uniqueResult(0);
|
||||
if(order == null){
|
||||
throw new BadRequestException("当前工令信息查询失败!");
|
||||
}
|
||||
String pcsn = order.getString("pcsn");
|
||||
String status = order.getString("status");
|
||||
if(!"20,30".contains(status)){
|
||||
throw new BadRequestException("当前工令非提交或开单中状态,不允许开单确认!");
|
||||
@@ -494,6 +550,8 @@ public class InitformulaServiceImpl implements InitformulaService {
|
||||
Formula_01.put("remark", whereJson.getString("remark"));
|
||||
double bill_qty = 0;
|
||||
double billpure_qty = 0;
|
||||
//软废纯粉总重
|
||||
double RF_total = 0;
|
||||
int nn = 1;
|
||||
for(int i = 0;i<tableDtl.size();i++){
|
||||
JSONObject jo = tableDtl.getJSONObject(i);
|
||||
@@ -545,11 +603,20 @@ public class InitformulaServiceImpl implements InitformulaService {
|
||||
}else{
|
||||
Formula_01.put("extadd_qty",Formula_01.getDouble("extadd_qty")+jo.getDouble("formula_qty"));
|
||||
}
|
||||
JSONObject md_jo = md_me_materialbase.query("is_delete='0' and material_id='"+jo.getString("material_id")+"'").uniqueResult(0);
|
||||
if(md_jo!=null){
|
||||
//是否软废
|
||||
if(MaterOptTypeEnum.RF.getClass_idStr().contains(md_jo.getString("material_type_id"))){
|
||||
JSONObject pro_jo = md_me_producmaterialext.query("material_id='"+jo.getString("material_id")+"'").uniqueResult(0);
|
||||
double net_rate = pro_jo.getDouble("net_rate");
|
||||
RF_total = RF_total+jo.getDouble("formula_qty")*pro_jo.getDouble("net_rate")/100.0;
|
||||
}
|
||||
}
|
||||
|
||||
bill_qty = bill_qty+jo.getDouble("formula_qty");
|
||||
PDM_BI_FormulaDtl.insert(jo);
|
||||
}
|
||||
Formula_01.put("total_qty",Formula_01.getDouble("masterbucket_qty")+Formula_01.getDouble("extadd_qty"));
|
||||
PDM_BI_Formula.insert(Formula_01);
|
||||
|
||||
JSONArray tabledis = whereJson.getJSONArray("tabledis");
|
||||
if("1".equals(whereJson.getString("is_again_put")) && tabledis.size()>0){
|
||||
JSONObject Formula_02 = new JSONObject();
|
||||
@@ -634,12 +701,53 @@ public class InitformulaServiceImpl implements InitformulaService {
|
||||
}else{
|
||||
Formula_02.put("extadd_qty",Formula_02.getDouble("extadd_qty")+jo.getDouble("formula_qty"));
|
||||
}
|
||||
JSONObject md_jo = md_me_materialbase.query("is_delete='0' and material_id='"+jo.getString("material_id")+"'").uniqueResult(0);
|
||||
if(md_jo!=null){
|
||||
//是否软废
|
||||
if(MaterOptTypeEnum.RF.getClass_idStr().contains(md_jo.getString("material_type_id"))){
|
||||
JSONObject pro_jo = md_me_producmaterialext.query("material_id='"+jo.getString("material_id")+"'").uniqueResult(0);
|
||||
double net_rate = pro_jo.getDouble("net_rate");
|
||||
RF_total = RF_total+jo.getDouble("formula_qty")*pro_jo.getDouble("net_rate")/100.0;
|
||||
}
|
||||
}
|
||||
bill_qty = bill_qty+jo.getDouble("formula_qty");
|
||||
PDM_BI_FormulaDtl.insert(jo);
|
||||
}
|
||||
if(billpure_qty>0){
|
||||
double RF_per = RF_total/billpure_qty;
|
||||
if(RF_per>=0.5){
|
||||
if(!pcsn.endsWith("R")){
|
||||
pcsn = pcsn+"R";
|
||||
}
|
||||
}else{
|
||||
if(pcsn.endsWith("R")){
|
||||
pcsn = pcsn.replace("R","");
|
||||
}
|
||||
}
|
||||
}else{
|
||||
pcsn = pcsn.replace("R","");
|
||||
}
|
||||
Formula_02.put("total_qty",Formula_02.getDouble("masterbucket_qty")+Formula_02.getDouble("extadd_qty"));
|
||||
PDM_BI_Formula.insert(Formula_02);
|
||||
}
|
||||
if(billpure_qty>0){
|
||||
double RF_per = RF_total/billpure_qty;
|
||||
if(RF_per>=0.5){
|
||||
if(!pcsn.endsWith("R")){
|
||||
pcsn = pcsn+"R";
|
||||
}
|
||||
}else{
|
||||
if(pcsn.endsWith("R")){
|
||||
pcsn = pcsn.replace("R","");
|
||||
}
|
||||
}
|
||||
}else{
|
||||
pcsn = pcsn.replace("R","");
|
||||
}
|
||||
Formula_01.put("pcsn",pcsn);
|
||||
Formula_01.put("total_qty",Formula_01.getDouble("masterbucket_qty")+Formula_01.getDouble("extadd_qty"));
|
||||
PDM_BI_Formula.insert(Formula_01);
|
||||
order.put("pcsn",pcsn);
|
||||
order.put("status","40");
|
||||
order.put("billpure_qty",billpure_qty+"");
|
||||
order.put("bill_qty",bill_qty+"");
|
||||
|
||||
@@ -180,10 +180,12 @@
|
||||
WHERE
|
||||
1 = 1
|
||||
AND structivt.sum_qty > 0
|
||||
AND structivt.is_active = '1'
|
||||
OPTION 输入.material_id <> ""
|
||||
structivt.material_id = 输入.material_id
|
||||
ENDOPTION
|
||||
OPTION 输入.is_active <> ""
|
||||
structivt.is_active = 输入.is_active
|
||||
ENDOPTION
|
||||
OPTION 输入.quality_scode <> ""
|
||||
structivt.quality_scode = 输入.quality_scode
|
||||
ENDOPTION
|
||||
|
||||
Reference in New Issue
Block a user