This commit is contained in:
zds
2022-12-26 10:39:06 +08:00
parent 63ff53ac84
commit 18f773cabb
3 changed files with 60 additions and 15 deletions

View File

@@ -4520,6 +4520,8 @@ public class AutoformulaServiceImpl implements AutoformulaService {
* @return
*/
JSONObject autoCalculationBy03(JSONObject json){
//
WQLObject PDM_BI_WasteBallTime = WQLObject.getWQLObject("PDM_BI_WasteBallTime");
//工令
String workorder_id = json.getString("workorder_id");
//软废下限
@@ -4550,6 +4552,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
double net_qty = workorder_qty;
double chunfen_qty = -1;
double ball_time = -1;
//rf最高开单重量
HashMap<String,JSONObject> rf_plan_map = new HashMap<String,JSONObject>();
@@ -4715,11 +4718,39 @@ public class AutoformulaServiceImpl implements AutoformulaService {
tableDtl.add(jo);
});
}
List<Double> doubles = new ArrayList<Double>();
rf_list.forEach((value)->{
JSONObject jo = (JSONObject) value;
jo.put("bucket_type","01");
tableDtl.add(jo);
//获取bom第一个碳化钨
JSONObject bomdtl = WQL.getWO("QPF_AUTOFORMULA02")
.addParam("material_id",jo.getString("material_id"))
.addParam("flag","8")
.process()
.uniqueResult(0);
if(bomdtl!=null){
JSONObject WasteBallTime = PDM_BI_WasteBallTime.query("material_id='"+bomdtl.getString("material_id")+"'").uniqueResult(0);
if(WasteBallTime!=null){
String mater_code = jo.getString("material_code");
String[] strs = mater_code.split("-");
String brf = strs[strs.length-1];
String now_qty = WasteBallTime.getString( brf.toLowerCase()+"_qty");
if (StrUtil.isNotEmpty(now_qty)) {
doubles.add(Double.valueOf(now_qty));
}
}
}
});
//进行集合排序
Collections.sort(doubles, Collections.reverseOrder());
if(doubles.size()>0){
ball_time = doubles.get(0);
}
yzj_list.forEach((value)->{
JSONObject jo = (JSONObject) value;
jo.put("is_need_manage","1");
@@ -4842,6 +4873,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
JSONObject result = new JSONObject();
result.put("tableDtl",dtl_new);
result.put("chunfen_qty",chunfen_qty);
result.put("ball_time",ball_time);
return result;
}

View File

@@ -350,3 +350,23 @@
ENDQUERY
ENDIF
IF 输入.flag = "8"
QUERY
SELECT
bomdtl.*
FROM
MD_PD_ProductBOM bom
LEFT JOIN md_pd_productbomdtl bomdtl ON bom.bom_id = bomdtl.bom_id
WHERE
1 = 1
AND bom.is_delete = '0'
AND bom.is_used = '1'
AND bomdtl.material_prop_scode = '09030101'
OPTION 输入.material_id <> ""
bom.material_id = 输入.material_id
ENDOPTION
ORDER BY bomdtl.seqno DESC
ENDSELECT
ENDQUERY
ENDIF

View File

@@ -431,6 +431,7 @@ export default {
mstrow: {},
tabledis: [],
XLList: [],
ball_time: '0',
chunfen_qty: '0',
form: { waste_limit_down: 0, waste_limit_uo: 0 },
form2: {
@@ -1104,11 +1105,16 @@ export default {
.then(_ => {
this.form.workorder_qty = parseFloat(this.chunfen_qty)
this.fullscreenLoading = true
autoformula.autoCalculation(this.form).then(res => {
autoformula.autoCalculation(this.form).then(res2 => {
this.crud.notify('自动计算成功!')
this.tableDtl = res.tableDtl
debugger
this.tableDtl = res2.tableDtl
this.form2.total_qty1 = 0
this.form2.add_qty1 = 0
this.ball_time = res2.ball_time
if ((parseFloat(this.ball_time) > 0)) {
this.form.ball_time = parseFloat(this.ball_time)
}
for (let i = 0; i < this.tableDtl.length; i++) {
const row = this.tableDtl[i]
row.edit = true
@@ -1119,19 +1125,6 @@ export default {
}
this.tableDtl.splice(i, 1, row)
}
/* this.tabledis = res.tabledis
this.form2.total_qty2 = 0
this.form2.add_qty2 = 0
for (let i = 0; i < this.tabledis.length; i++) {
const row = this.tabledis[i]
row.edit = true
if (row.is_need_manage === '1') {
this.form2.total_qty2 = this.form2.total_qty2 + parseFloat(row.formula_qty)
} else {
this.form2.add_qty2 = this.form2.add_qty2 + parseFloat(row.formula_qty)
}
this.tabledis.splice(i, 1, row)
}*/
this.fullscreenLoading = false
}).catch(() => {
this.fullscreenLoading = false