From a1ad7abb7e8b1eed7b95b3ed0acffb6f2efa20ce Mon Sep 17 00:00:00 2001 From: "ZHOUZ\\Noble'lift" <1014987728@qq.com> Date: Mon, 10 Jul 2023 18:23:00 +0800 Subject: [PATCH] =?UTF-8?q?rev:=E5=A4=A7=E5=B1=8F=E6=88=90=E5=93=81?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=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 | 41 +++++++++------- .../wms/cockpit/wql/COCKPIT_MIX_AND_TRAP.wql | 48 +++++++++++++++++++ 2 files changed, 72 insertions(+), 17 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 e3d9c20..8da7571 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 @@ -131,7 +131,7 @@ public class BigScreenServiceImpl implements BigScreenService { dto.setInventory_qty(dto.getQualified_in_qty() + dto.getUnqualified_in_qty()); res.add(dto); } - + return res; }, pool); manufacturedProductsDayProductionTask.thenAccept((result) -> { @@ -853,23 +853,30 @@ public class BigScreenServiceImpl implements BigScreenService { cpDeviceDataStorage.thenAccept((result) -> { //数据 JSONObject result1 = new JSONObject(); - JSONArray jsonArray = new JSONArray(); - for (int i = 1; i <= 5; i++) { - InventoryDto dto = new InventoryDto(); - dto.setInventory_qty(1000000); - dto.setRegion_out_qty(5000); - dto.setRegion_in_qty(9995000); - dto.setMaterial_code("成品" + i); - jsonArray.add(dto); + JSONArray KCDayList = WQL.getWO("COCKPIT_MIX_AND_TRAP").addParamMap(MapOf.of("flag", "7")) + .process().getResultJSONArray(0); + JSONArray KCWeekList = WQL.getWO("COCKPIT_MIX_AND_TRAP").addParamMap(MapOf.of("flag", "8")) + .process().getResultJSONArray(0); + JSONObject jo = WQL.getWO("COCKPIT_MIX_AND_TRAP").addParamMap(MapOf.of("flag", "9")).process().uniqueResult(0); + if (ObjectUtil.isEmpty(jo)) { + result1.put("in_qty", 0); + } else { + result1.put("in_qty", BigDecimal.valueOf(jo.getDoubleValue("total_qty") / 10000).setScale(2, RoundingMode.HALF_UP).toString() + ); + } + if (ObjectUtil.isEmpty(KCDayList)) { + KCDayList = new JSONArray(); + } + if (ObjectUtil.isEmpty(KCWeekList)) { + KCWeekList = new JSONArray(); } - result1.put("in_qty", "100.00"); - result1.put("out_qty", "10.00"); - result1.put("inventory_qty", "90.00"); - result1.put("in_productivity", 30); - result1.put("out_productivity", 60); - result1.put("inv_productivity", 80); - result1.put("KCDayList", jsonArray); - result1.put("KCWeekList", jsonArray); + result1.put("out_qty", "0.00"); + result1.put("inventory_qty", "0.00"); + result1.put("in_productivity", 100); + result1.put("out_productivity", 0); + result1.put("inv_productivity", 0); + result1.put("KCDayList", KCDayList); + result1.put("KCWeekList", KCWeekList); map.put("KC", result1); }).exceptionally((e) -> { JSONObject result = new JSONObject(); diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/wql/COCKPIT_MIX_AND_TRAP.wql b/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/wql/COCKPIT_MIX_AND_TRAP.wql index 1d110d3..dbe0b2f 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/wql/COCKPIT_MIX_AND_TRAP.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/wql/COCKPIT_MIX_AND_TRAP.wql @@ -247,3 +247,51 @@ ENDSELECT ENDPAGEQUERY ENDIF + + IF 输入.flag = "7" + QUERY + SELECT + cMocode AS material_code, + SUM(iNum) as region_in_qty + FROM + st_ivt_regionio + WHERE + cVouchType = '完工入库' + AND + DATE(dDate) = CURDATE() + GROUP BY + cMocode + ENDSELECT + ENDQUERY + ENDIF + + IF 输入.flag = "8" + QUERY + SELECT + cMocode AS material_code, + SUM(iNum) as region_in_qty + FROM + st_ivt_regionio + WHERE + cVouchType = '完工入库' + AND + dDate BETWEEN DATE_SUB( NOW(), INTERVAL 1 WEEK ) AND NOW() + GROUP BY + cMocode + ENDSELECT + ENDQUERY + ENDIF + + IF 输入.flag = "9" + QUERY + SELECT + SUM(iNum) as total_qty + FROM + st_ivt_regionio + WHERE + cVouchType = '完工入库' + AND + DATE(dDate) = CURDATE() + ENDSELECT + ENDQUERY + ENDIF