Browse Source

fix: 大屏数据修改

master
李永德 1 year ago
parent
commit
cc6337338e
  1. 18
      lms/nladmin-system/src/main/java/org/nl/wms/cockpit/service/impl/BigScreenServiceImpl.java
  2. 4
      lms/nladmin-system/src/main/java/org/nl/wms/cockpit/wql/COCKPIT_PROCESS_PRODUCTION.wql
  3. 1
      lms/nladmin-system/src/main/java/org/nl/wms/cockpit/wql/COCKPIT_SORTE_AND_PACKAGE.wql

18
lms/nladmin-system/src/main/java/org/nl/wms/cockpit/service/impl/BigScreenServiceImpl.java

@ -2,6 +2,7 @@ package org.nl.wms.cockpit.service.impl;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -38,6 +39,7 @@ import java.util.concurrent.ThreadPoolExecutor;
public class BigScreenServiceImpl implements BigScreenService { public class BigScreenServiceImpl implements BigScreenService {
private final WmsToAcsService wmsToAcsService; private final WmsToAcsService wmsToAcsService;
/** /**
* 車间情况大屏信息 * 車间情况大屏信息
* *
@ -385,7 +387,7 @@ public class BigScreenServiceImpl implements BigScreenService {
JSONArray data = ObjectUtil.isNotEmpty(devicesStatus) ? devicesStatus.getJSONArray("data") : res; JSONArray data = ObjectUtil.isNotEmpty(devicesStatus) ? devicesStatus.getJSONArray("data") : res;
for (int i = 0; i < data.size(); i++) { for (int i = 0; i < data.size(); i++) {
JSONObject object = data.getJSONObject(i); JSONObject object = data.getJSONObject(i);
object.put("color_status", ColorEnum.getColorEnumByIndex(object.getInteger("status"))); object.put("color_status", object.getInteger("status"));
} }
return data; return data;
}, pool); }, pool);
@ -1313,6 +1315,18 @@ public class BigScreenServiceImpl implements BigScreenService {
JSONArray res = new JSONArray(); JSONArray res = new JSONArray();
JSONObject jsonObject = wmsToAcsService.queryBzx(); JSONObject jsonObject = wmsToAcsService.queryBzx();
res = jsonObject.getJSONArray("data"); 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++) { for (int i = 0; i < res.size(); i++) {
JSONObject BZX = res.getJSONObject(i); JSONObject BZX = res.getJSONObject(i);
int vehicleType = BZX.getInteger("vehicle_type") + 2; int vehicleType = BZX.getInteger("vehicle_type") + 2;
@ -1323,7 +1337,7 @@ public class BigScreenServiceImpl implements BigScreenService {
WQLObject vdTab = WQLObject.getWQLObject("st_ivt_vehicle_detail"); WQLObject vdTab = WQLObject.getWQLObject("st_ivt_vehicle_detail");
JSONObject object = vdTab.query("vehicle_type = '" + vehicleType + "'" + JSONObject object = vdTab.query("vehicle_type = '" + vehicleType + "'" +
" AND vehicle_code = '" + vehicleCode + "'").uniqueResult(0); " AND vehicle_code = '" + vehicleCode + "'").uniqueResult(0);
BZX.put("qty", object.getString("qty")); BZX.put("qty", ObjectUtil.isNotEmpty(object) ? object.getString("qty") : "");
} }
return res; return res;
}, pool); }, pool);

4
lms/nladmin-system/src/main/java/org/nl/wms/cockpit/wql/COCKPIT_PROCESS_PRODUCTION.wql

@ -339,9 +339,9 @@
FROM FROM
`pdm_bi_device` d `pdm_bi_device` d
WHERE ((d.region_code = 'YZ' AND d.device_model = '5') 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' 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 ENDSELECT
ENDPAGEQUERY ENDPAGEQUERY
ENDIF ENDIF

1
lms/nladmin-system/src/main/java/org/nl/wms/cockpit/wql/COCKPIT_SORTE_AND_PACKAGE.wql

@ -158,6 +158,7 @@
LEFT JOIN pdm_bd_workorder w ON w.workorder_id = vd.workorder_id 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 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') WHERE p.region_code = 'FJ' AND p.point_type IN ('1','2')
AND p.point_code NOT IN ('FJCD02DJ01', 'FJCD02DJ02', 'FJMD02DJ01', 'FJMD02DJ02')
ENDSELECT ENDSELECT
ENDPAGEQUERY ENDPAGEQUERY
ENDIF ENDIF

Loading…
Cancel
Save