fix: 大屏数据修改
This commit is contained in:
@@ -2,6 +2,7 @@ package org.nl.wms.cockpit.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONException;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -38,6 +39,7 @@ import java.util.concurrent.ThreadPoolExecutor;
|
||||
public class BigScreenServiceImpl implements BigScreenService {
|
||||
|
||||
private final WmsToAcsService wmsToAcsService;
|
||||
|
||||
/**
|
||||
* 車间情况大屏信息
|
||||
*
|
||||
@@ -385,7 +387,7 @@ public class BigScreenServiceImpl implements BigScreenService {
|
||||
JSONArray data = ObjectUtil.isNotEmpty(devicesStatus) ? devicesStatus.getJSONArray("data") : res;
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
JSONObject object = data.getJSONObject(i);
|
||||
object.put("color_status", ColorEnum.getColorEnumByIndex(object.getInteger("status")));
|
||||
object.put("color_status", object.getInteger("status"));
|
||||
}
|
||||
return data;
|
||||
}, pool);
|
||||
@@ -1313,6 +1315,18 @@ public class BigScreenServiceImpl implements BigScreenService {
|
||||
JSONArray res = new JSONArray();
|
||||
JSONObject jsonObject = wmsToAcsService.queryBzx();
|
||||
res = jsonObject.getJSONArray("data");
|
||||
res.sort((o1, o2) -> {
|
||||
try {
|
||||
JSONObject obj1 = (JSONObject) o1;
|
||||
JSONObject obj2 = (JSONObject) o2;
|
||||
String deviceCode1 = obj1.getString("device_code");
|
||||
String deviceCode2 = obj2.getString("device_code");
|
||||
return deviceCode1.compareTo(deviceCode2);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
for (int i = 0; i < res.size(); i++) {
|
||||
JSONObject BZX = res.getJSONObject(i);
|
||||
int vehicleType = BZX.getInteger("vehicle_type") + 2;
|
||||
@@ -1323,7 +1337,7 @@ public class BigScreenServiceImpl implements BigScreenService {
|
||||
WQLObject vdTab = WQLObject.getWQLObject("st_ivt_vehicle_detail");
|
||||
JSONObject object = vdTab.query("vehicle_type = '" + vehicleType + "'" +
|
||||
" AND vehicle_code = '" + vehicleCode + "'").uniqueResult(0);
|
||||
BZX.put("qty", object.getString("qty"));
|
||||
BZX.put("qty", ObjectUtil.isNotEmpty(object) ? object.getString("qty") : "");
|
||||
}
|
||||
return res;
|
||||
}, pool);
|
||||
|
||||
@@ -339,9 +339,9 @@
|
||||
FROM
|
||||
`pdm_bi_device` d
|
||||
WHERE ((d.region_code = 'YZ' AND d.device_model = '5')
|
||||
OR (d.region_code = 'FJ' AND d.device_model = '9'))
|
||||
OR (d.region_code = 'FJ' AND d.device_model IN ('9','10')))
|
||||
AND d.device_code <> 'FJRGCD01'
|
||||
ORDER BY d.device_model, d.region_code, d.device_code
|
||||
ORDER BY d.region_code DESC, d.device_model, d.device_code
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
@@ -158,6 +158,7 @@
|
||||
LEFT JOIN pdm_bd_workorder w ON w.workorder_id = vd.workorder_id
|
||||
LEFT JOIN pdm_bi_device d ON d.device_code = w.device_code
|
||||
WHERE p.region_code = 'FJ' AND p.point_type IN ('1','2')
|
||||
AND p.point_code NOT IN ('FJCD02DJ01', 'FJCD02DJ02', 'FJMD02DJ01', 'FJMD02DJ02')
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
Reference in New Issue
Block a user