From cc6337338ea130f9b03781445cf934f97f90bfcd Mon Sep 17 00:00:00 2001 From: liyongde <1419499670@qq.com> Date: Wed, 28 Jun 2023 10:50:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A4=A7=E5=B1=8F=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/BigScreenServiceImpl.java | 18 ++++++++++++++++-- .../cockpit/wql/COCKPIT_PROCESS_PRODUCTION.wql | 4 ++-- .../cockpit/wql/COCKPIT_SORTE_AND_PACKAGE.wql | 1 + 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/service/impl/BigScreenServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/service/impl/BigScreenServiceImpl.java index 2c904ba..6a581eb 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/service/impl/BigScreenServiceImpl.java +++ b/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 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); diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/wql/COCKPIT_PROCESS_PRODUCTION.wql b/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/wql/COCKPIT_PROCESS_PRODUCTION.wql index 31c4f59..bbe47d4 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/wql/COCKPIT_PROCESS_PRODUCTION.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/wql/COCKPIT_PROCESS_PRODUCTION.wql @@ -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 diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/wql/COCKPIT_SORTE_AND_PACKAGE.wql b/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/wql/COCKPIT_SORTE_AND_PACKAGE.wql index d0711c7..130cc0c 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/wql/COCKPIT_SORTE_AND_PACKAGE.wql +++ b/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_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