优化
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user