设备产能提交

This commit is contained in:
18188916393
2022-08-18 10:46:30 +08:00
parent 8335c503ba
commit 54825ab491
2 changed files with 34 additions and 4 deletions

View File

@@ -407,10 +407,12 @@ public class DeviceScreenServiceImpl implements DeviceScreenService {
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)
.process().uniqueResult(0).getIntValue("productivity");
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)
.process().uniqueResult(0).getIntValue("all_productivity");
//计算该工序下工单的实际生产数量
int nowproductivity = WQL.getWO("QDEVICE_SCREEN").addParam("flag", "13").addParam("workprocedure_id", workprocedure_id).addParam("produce_date", today)
.process().uniqueResult(0).getIntValue("real_qty");

View File

@@ -310,4 +310,32 @@
ENDIF
IF 输入.flag = "14"
QUERY
SELECT
sum( a.max_productivity ) AS all_productivity
FROM
(
SELECT
device.productivity,
device.productivity * TIMESTAMPDIFF( HOUR, realproducestart_date, now( ) ) AS max_productivity,
shiftorder.produceorder_code,
shiftorder.realproducestart_date
FROM
pdm_bi_device device
RIGHT JOIN MPS_BD_ProduceShiftOrder shiftorder ON shiftorder.device_id = device.device_id
WHERE
device.is_delete = '0'
AND device.is_active = '1'
AND ( shiftorder.realproducestart_date <> '' OR shiftorder.realproducestart_date IS NOT NULL )
OPTION 输入.workprocedure_id <> ""
shiftorder.workprocedure_id = 输入.workprocedure_id
ENDOPTION
OPTION 输入.produce_date <> ""
shiftorder.produce_date = 输入.produce_date
ENDOPTION
) a
ENDSELECT
ENDQUERY
ENDIF