设备利用率修改

This commit is contained in:
18188916393
2022-08-19 09:46:42 +08:00
parent 1a50b0f256
commit 841642aca7

View File

@@ -402,13 +402,13 @@ public class DeviceScreenServiceImpl implements DeviceScreenService {
result.add(jo);
}*/
JSONArray result = new JSONArray();
String today = DateUtil.today();
String today = "2022-08-18";
JSONArray workprocedureArr = WQL.getWO("QDEVICE_SCREEN").addParam("flag", "10").process().getResultJSONArray(0);
for (int i = 0; i < workprocedureArr.size(); i++) {
JSONObject workprocedurejo = workprocedureArr.getJSONObject(i);
String workprocedure_id = workprocedurejo.getString("workprocedure_id");
String workprocedure_name = workprocedurejo.getString("workprocedure_name");
//查询每个工序下每个设备(有工单)的产能
//查询每个工序下每个设备(有工单)的产能
/*int Maxproductivity = WQL.getWO("QDEVICE_SCREEN").addParam("flag", "12").addParam("workprocedure_id", workprocedure_id).addParam("produce_date", today)
.process().uniqueResult(0).getIntValue("productivity");*/
int Maxproductivity = WQL.getWO("QDEVICE_SCREEN").addParam("flag", "14").addParam("workprocedure_id", workprocedure_id).addParam("produce_date", today)
@@ -416,7 +416,11 @@ public class DeviceScreenServiceImpl implements DeviceScreenService {
//计算该工序下工单的实际生产数量
int nowproductivity = WQL.getWO("QDEVICE_SCREEN").addParam("flag", "13").addParam("workprocedure_id", workprocedure_id).addParam("produce_date", today)
.process().uniqueResult(0).getIntValue("real_qty");
BigDecimal teep = NumberUtil.round(NumberUtil.div(nowproductivity * 100, Maxproductivity), 2);
BigDecimal teep = new BigDecimal(0);
if (nowproductivity != 0) {
teep = NumberUtil.round(NumberUtil.div(nowproductivity * 100, Maxproductivity), 2);
}
JSONObject jo = new JSONObject();
jo.put("workprocedure_name", workprocedure_name);
jo.put("teep", teep);