From 24307dc65a640e48dbbd14b65d4c3502d4efedd1 Mon Sep 17 00:00:00 2001 From: liyongde <1419499670@qq.com> Date: Thu, 28 Dec 2023 16:15:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A4=A7=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/service/DashboardService.java | 5 ++- .../org/nl/wms/dashboard/wql/DASHBOARD.wql | 40 +++++++++++++++++++ .../src/test/java/org/nl/test/TempTest.java | 16 ++++++++ 3 files changed, 60 insertions(+), 1 deletion(-) diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/dashboard/service/DashboardService.java b/lms/nladmin-system/src/main/java/org/nl/wms/dashboard/service/DashboardService.java index 7ef6f77..22e9cea 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/dashboard/service/DashboardService.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/dashboard/service/DashboardService.java @@ -300,7 +300,10 @@ public class DashboardService { */ public JSONObject homepageEquipment() { JSONObject result = new JSONObject(); - + JSONArray productReport = WQL.getWO("DASHBOARD").addParam("flag", "5").process().getResultJSONArray(0); + JSONArray deviceReport = WQL.getWO("DASHBOARD").addParam("flag", "6").process().getResultJSONArray(0); + result.put("productReport", productReport); + result.put("deviceReport", deviceReport); return result; } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/dashboard/wql/DASHBOARD.wql b/lms/nladmin-system/src/main/java/org/nl/wms/dashboard/wql/DASHBOARD.wql index 3099fc2..75d8544 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/dashboard/wql/DASHBOARD.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/dashboard/wql/DASHBOARD.wql @@ -119,3 +119,43 @@ ENDSELECT ENDQUERY ENDIF + + IF 输入.flag = "5" + QUERY + SELECT + sd.create_time, + mm.material_code, + IF(LEFT(sd.point_code, 2) = 'YJ' ,CONCAT(sd.qty, '块'),CONCAT(sd.weight,'千克')) AS number + FROM + `st_ivt_vehicle_detail` sd + LEFT JOIN md_me_materialbase mm ON mm.material_id = sd.material_id + WHERE sd.point_code LIKE 'YJ%' OR sd.point_code LIKE 'HL%' + ORDER BY sd.create_time DESC + LIMIT 20 + ENDSELECT + ENDQUERY + ENDIF + IF 输入.flag = "6" + QUERY + SELECT + dn.device_code, + dn.failure_time, + IF(ISNULL(dn.failure_info), '-', dn.failure_info) AS failure_info + FROM + `das_device_number` dn + WHERE + (dn.device_code, dn.failure_time) IN ( + SELECT + device_code, + MAX(failure_time) AS latest_failure_time + FROM + `das_device_number` + GROUP BY + device_code + ) + ORDER BY + dn.failure_time DESC + LIMIT 20; + ENDSELECT + ENDQUERY + ENDIF diff --git a/lms/nladmin-system/src/test/java/org/nl/test/TempTest.java b/lms/nladmin-system/src/test/java/org/nl/test/TempTest.java index 9b6dcec..6cf084f 100644 --- a/lms/nladmin-system/src/test/java/org/nl/test/TempTest.java +++ b/lms/nladmin-system/src/test/java/org/nl/test/TempTest.java @@ -37,4 +37,20 @@ public class TempTest { .uniqueResult(0); System.out.println(info); } + + @Test + public void test02() { + String dateStr = "2023-06-14 07:32:05"; + String trimmedDateStr = dateStr.substring(dateStr.indexOf('-') + 1); + System.out.println(trimmedDateStr); + } + + @Test + public void test03() { + JSONObject point = new JSONObject(); + point.put("point_code", "333"); + JSONArray request_param = new JSONArray(); + request_param.add(point.getString("point_code")); + System.out.println(String.valueOf(request_param)); + } }