优化
This commit is contained in:
@@ -4520,6 +4520,8 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
JSONObject autoCalculationBy03(JSONObject json){
|
JSONObject autoCalculationBy03(JSONObject json){
|
||||||
|
//
|
||||||
|
WQLObject PDM_BI_WasteBallTime = WQLObject.getWQLObject("PDM_BI_WasteBallTime");
|
||||||
//工令
|
//工令
|
||||||
String workorder_id = json.getString("workorder_id");
|
String workorder_id = json.getString("workorder_id");
|
||||||
//软废下限
|
//软废下限
|
||||||
@@ -4550,6 +4552,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
|||||||
double net_qty = workorder_qty;
|
double net_qty = workorder_qty;
|
||||||
|
|
||||||
double chunfen_qty = -1;
|
double chunfen_qty = -1;
|
||||||
|
double ball_time = -1;
|
||||||
|
|
||||||
//rf最高开单重量
|
//rf最高开单重量
|
||||||
HashMap<String,JSONObject> rf_plan_map = new HashMap<String,JSONObject>();
|
HashMap<String,JSONObject> rf_plan_map = new HashMap<String,JSONObject>();
|
||||||
@@ -4715,11 +4718,39 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
|||||||
tableDtl.add(jo);
|
tableDtl.add(jo);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
List<Double> doubles = new ArrayList<Double>();
|
||||||
rf_list.forEach((value)->{
|
rf_list.forEach((value)->{
|
||||||
JSONObject jo = (JSONObject) value;
|
JSONObject jo = (JSONObject) value;
|
||||||
jo.put("bucket_type","01");
|
jo.put("bucket_type","01");
|
||||||
tableDtl.add(jo);
|
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)->{
|
yzj_list.forEach((value)->{
|
||||||
JSONObject jo = (JSONObject) value;
|
JSONObject jo = (JSONObject) value;
|
||||||
jo.put("is_need_manage","1");
|
jo.put("is_need_manage","1");
|
||||||
@@ -4842,6 +4873,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
|||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
result.put("tableDtl",dtl_new);
|
result.put("tableDtl",dtl_new);
|
||||||
result.put("chunfen_qty",chunfen_qty);
|
result.put("chunfen_qty",chunfen_qty);
|
||||||
|
result.put("ball_time",ball_time);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -350,3 +350,23 @@
|
|||||||
ENDQUERY
|
ENDQUERY
|
||||||
ENDIF
|
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
|
||||||
|
|
||||||
|
|||||||
@@ -431,6 +431,7 @@ export default {
|
|||||||
mstrow: {},
|
mstrow: {},
|
||||||
tabledis: [],
|
tabledis: [],
|
||||||
XLList: [],
|
XLList: [],
|
||||||
|
ball_time: '0',
|
||||||
chunfen_qty: '0',
|
chunfen_qty: '0',
|
||||||
form: { waste_limit_down: 0, waste_limit_uo: 0 },
|
form: { waste_limit_down: 0, waste_limit_uo: 0 },
|
||||||
form2: {
|
form2: {
|
||||||
@@ -1104,11 +1105,16 @@ export default {
|
|||||||
.then(_ => {
|
.then(_ => {
|
||||||
this.form.workorder_qty = parseFloat(this.chunfen_qty)
|
this.form.workorder_qty = parseFloat(this.chunfen_qty)
|
||||||
this.fullscreenLoading = true
|
this.fullscreenLoading = true
|
||||||
autoformula.autoCalculation(this.form).then(res => {
|
autoformula.autoCalculation(this.form).then(res2 => {
|
||||||
this.crud.notify('自动计算成功!')
|
this.crud.notify('自动计算成功!')
|
||||||
this.tableDtl = res.tableDtl
|
debugger
|
||||||
|
this.tableDtl = res2.tableDtl
|
||||||
this.form2.total_qty1 = 0
|
this.form2.total_qty1 = 0
|
||||||
this.form2.add_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++) {
|
for (let i = 0; i < this.tableDtl.length; i++) {
|
||||||
const row = this.tableDtl[i]
|
const row = this.tableDtl[i]
|
||||||
row.edit = true
|
row.edit = true
|
||||||
@@ -1119,19 +1125,6 @@ export default {
|
|||||||
}
|
}
|
||||||
this.tableDtl.splice(i, 1, row)
|
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
|
this.fullscreenLoading = false
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.fullscreenLoading = false
|
this.fullscreenLoading = false
|
||||||
|
|||||||
Reference in New Issue
Block a user