This commit is contained in:
2022-08-19 11:15:59 +08:00

View File

@@ -408,7 +408,7 @@ public class DeviceScreenServiceImpl implements DeviceScreenService {
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);