Browse Source

feat: 大屏

master
李永德 11 months ago
parent
commit
24307dc65a
  1. 5
      lms/nladmin-system/src/main/java/org/nl/wms/dashboard/service/DashboardService.java
  2. 40
      lms/nladmin-system/src/main/java/org/nl/wms/dashboard/wql/DASHBOARD.wql
  3. 16
      lms/nladmin-system/src/test/java/org/nl/test/TempTest.java

5
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;
}

40
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

16
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));
}
}

Loading…
Cancel
Save