修改
This commit is contained in:
@@ -320,7 +320,7 @@ public class DeviceScreenServiceImpl implements DeviceScreenService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONObject deviceCensus(JSONObject param) {
|
public JSONObject deviceCensus(JSONObject param) {
|
||||||
JSONArray pro_rows = WQL.getWO("QDEVICE_SCREEN").addParam("flag", "6").process().getResultJSONArray(0);
|
JSONArray pro_rows = WQL.getWO("QDEVICE_SCREEN").addParam("flag", "10").process().getResultJSONArray(0);
|
||||||
JSONArray result = new JSONArray();
|
JSONArray result = new JSONArray();
|
||||||
for (int i = 0; i < pro_rows.size(); i++) {
|
for (int i = 0; i < pro_rows.size(); i++) {
|
||||||
JSONObject pro = pro_rows.getJSONObject(i);
|
JSONObject pro = pro_rows.getJSONObject(i);
|
||||||
@@ -370,13 +370,14 @@ public class DeviceScreenServiceImpl implements DeviceScreenService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONObject deviceUseRate(JSONObject param) {
|
public JSONObject deviceUseRate(JSONObject param) {
|
||||||
JSONArray pro_rows = WQL.getWO("QDEVICE_SCREEN").addParam("flag", "6").process().getResultJSONArray(0);
|
JSONArray pro_rows = WQL.getWO("QDEVICE_SCREEN").addParam("flag", "10").process().getResultJSONArray(0);
|
||||||
JSONArray result = new JSONArray();
|
JSONArray result = new JSONArray();
|
||||||
for (int i = 0; i < pro_rows.size(); i++) {
|
for (int i = 0; i < pro_rows.size(); i++) {
|
||||||
JSONObject pro = pro_rows.getJSONObject(i);
|
JSONObject pro = pro_rows.getJSONObject(i);
|
||||||
JSONObject jo = new JSONObject();
|
JSONObject jo = new JSONObject();
|
||||||
jo.put("workprocedure_name", pro.getString("workprocedure_name"));
|
jo.put("workprocedure_name", pro.getString("workprocedure_name"));
|
||||||
jo.put("teep", (i + 1) * 10);
|
jo.put("teep", (i + 1) * 10);
|
||||||
|
result.add(jo);
|
||||||
}
|
}
|
||||||
JSONObject returnjo = new JSONObject();
|
JSONObject returnjo = new JSONObject();
|
||||||
returnjo.put("code", "1");
|
returnjo.put("code", "1");
|
||||||
@@ -403,16 +404,22 @@ public class DeviceScreenServiceImpl implements DeviceScreenService {
|
|||||||
|
|
||||||
//查询最近的一条开机状态
|
//查询最近的一条开机状态
|
||||||
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 = '02' order by end_time desc").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isNotEmpty(start_jo)) {
|
||||||
device.put("start_time", start_jo.getString("end_time"));
|
device.put("start_time", start_jo.getString("end_time"));
|
||||||
if (StrUtil.isEmpty(device.getString("end_time"))){
|
}
|
||||||
|
if (StrUtil.isEmpty(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);
|
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("end_time"));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//查询最近的一个工单
|
//查询最近的一个工单
|
||||||
JSONObject order_jo = WQLObject.getWQLObject("mps_bd_produceshiftorder").query("device_id = '"+device_id+"' AND is_delete = '0' AND is_actice = '1' order by realproducestart_date desc").uniqueResult(0);
|
JSONObject order_jo = WQLObject.getWQLObject("mps_bd_produceshiftorder").query("device_id = '" + device_id + "' AND is_delete = '0' order by realproducestart_date desc").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isNotEmpty(order_jo)) {
|
||||||
device.put("product_time", order_jo.getString("produce_date"));
|
device.put("product_time", order_jo.getString("produce_date"));
|
||||||
|
}
|
||||||
result.add(device);
|
result.add(device);
|
||||||
}
|
}
|
||||||
JSONObject returnjo = new JSONObject();
|
JSONObject returnjo = new JSONObject();
|
||||||
|
|||||||
@@ -143,7 +143,7 @@
|
|||||||
IF 输入.flag = "6"
|
IF 输入.flag = "6"
|
||||||
QUERY
|
QUERY
|
||||||
SELECT
|
SELECT
|
||||||
COUNT( record_id ) AS err_times
|
COUNT( record_id ) AS err_times,
|
||||||
MAX( device.device_name ) AS device_name
|
MAX( device.device_name ) AS device_name
|
||||||
FROM
|
FROM
|
||||||
pdm_bi_devicerunstatusrecord run
|
pdm_bi_devicerunstatusrecord run
|
||||||
@@ -161,7 +161,7 @@
|
|||||||
IF 输入.flag = "7"
|
IF 输入.flag = "7"
|
||||||
QUERY
|
QUERY
|
||||||
SELECT
|
SELECT
|
||||||
device_id
|
device.device_id
|
||||||
FROM
|
FROM
|
||||||
pdm_bi_devicerunstatusrecord run
|
pdm_bi_devicerunstatusrecord run
|
||||||
LEFT JOIN pdm_bi_device device ON device.device_id = run.device_id
|
LEFT JOIN pdm_bi_device device ON device.device_id = run.device_id
|
||||||
@@ -179,7 +179,7 @@
|
|||||||
IF 输入.flag = "8"
|
IF 输入.flag = "8"
|
||||||
QUERY
|
QUERY
|
||||||
SELECT
|
SELECT
|
||||||
device_id
|
device.device_id
|
||||||
FROM
|
FROM
|
||||||
pdm_bi_devicerunstatusrecord run
|
pdm_bi_devicerunstatusrecord run
|
||||||
LEFT JOIN pdm_bi_device device ON device.device_id = run.device_id
|
LEFT JOIN pdm_bi_device device ON device.device_id = run.device_id
|
||||||
|
|||||||
Reference in New Issue
Block a user