This commit is contained in:
2022-08-02 14:11:42 +08:00
parent 6ae3fe3d36
commit 0e68a529c7
2 changed files with 6 additions and 6 deletions

View File

@@ -412,23 +412,23 @@ public class DeviceScreenServiceImpl implements DeviceScreenService {
device.put("end_time","");
device.put("product_time","");
String device_id = device.getString("device_id");
JSONArray order_rows = WQLObject.getWQLObject("mps_bd_produceshiftorder").query("device_id = '" + device_id + "' AND produce_date like '" + date + "' AND is_delete = '0'").getResultJSONArray(0);
/*JSONArray order_rows = WQLObject.getWQLObject("mps_bd_produceshiftorder").query("device_id = '" + device_id + "' AND produce_date like '" + date + "' AND is_delete = '0'").getResultJSONArray(0);
for (int j = 0; j < order_rows.size(); j++) {
JSONObject order = order_rows.getJSONObject(i);
product_qty += order.getIntValue("real_qty");
}
}*/
// device.put("product_qty", product_qty);
//查询最近的一条开机状态
JSONObject start_jo = WQLObject.getWQLObject("pdm_bi_devicerunstatusrecord").query("device_id = '" + device_id + "' AND status_type = '02' order by end_time desc").uniqueResult(0);
JSONObject start_jo = WQLObject.getWQLObject("pdm_bi_devicerunstatusrecord").query("device_id = '" + device_id + "' AND status_type = '01' order by end_time desc").uniqueResult(0);
if (ObjectUtil.isNotEmpty(start_jo)) {
device.put("start_time", start_jo.getString("end_time"));
}
if (StrUtil.isEmpty(device.getString("status_type"))) {
if (StrUtil.isNotEmpty(device.getString("status_type"))) {
//查询最近的一条关机状态
JSONObject end_jo = WQLObject.getWQLObject("pdm_bi_devicerunstatusrecord").query("device_id = '" + device_id + "' AND status_type = '01' order by end_time desc").uniqueResult(0);
if (ObjectUtil.isNotEmpty(end_jo)) {
device.put("end_time", end_jo.getString("end_time"));
device.put("end_time", end_jo.getString("start_time"));
}
}

View File

@@ -243,7 +243,7 @@
device.device_code,
device.device_name,
pro.workprocedure_name,
(case when run.status_type is null then '关机'
(case when run.status_type = '01' then '关机'
when run.status_type = '02' then '开机'
when run.status_type = '03' then '生产中'
when run.status_type = '04' then '待机'