rev:大屏成品数据修改

This commit is contained in:
2023-07-10 18:23:00 +08:00
parent 129abe8d87
commit a1ad7abb7e
2 changed files with 72 additions and 17 deletions

View File

@@ -853,23 +853,30 @@ public class BigScreenServiceImpl implements BigScreenService {
cpDeviceDataStorage.thenAccept((result) -> { cpDeviceDataStorage.thenAccept((result) -> {
//数据 //数据
JSONObject result1 = new JSONObject(); JSONObject result1 = new JSONObject();
JSONArray jsonArray = new JSONArray(); JSONArray KCDayList = WQL.getWO("COCKPIT_MIX_AND_TRAP").addParamMap(MapOf.of("flag", "7"))
for (int i = 1; i <= 5; i++) { .process().getResultJSONArray(0);
InventoryDto dto = new InventoryDto(); JSONArray KCWeekList = WQL.getWO("COCKPIT_MIX_AND_TRAP").addParamMap(MapOf.of("flag", "8"))
dto.setInventory_qty(1000000); .process().getResultJSONArray(0);
dto.setRegion_out_qty(5000); JSONObject jo = WQL.getWO("COCKPIT_MIX_AND_TRAP").addParamMap(MapOf.of("flag", "9")).process().uniqueResult(0);
dto.setRegion_in_qty(9995000); if (ObjectUtil.isEmpty(jo)) {
dto.setMaterial_code("成品" + i); result1.put("in_qty", 0);
jsonArray.add(dto); } else {
result1.put("in_qty", BigDecimal.valueOf(jo.getDoubleValue("total_qty") / 10000).setScale(2, RoundingMode.HALF_UP).toString()
);
} }
result1.put("in_qty", "100.00"); if (ObjectUtil.isEmpty(KCDayList)) {
result1.put("out_qty", "10.00"); KCDayList = new JSONArray();
result1.put("inventory_qty", "90.00"); }
result1.put("in_productivity", 30); if (ObjectUtil.isEmpty(KCWeekList)) {
result1.put("out_productivity", 60); KCWeekList = new JSONArray();
result1.put("inv_productivity", 80); }
result1.put("KCDayList", jsonArray); result1.put("out_qty", "0.00");
result1.put("KCWeekList", jsonArray); 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); map.put("KC", result1);
}).exceptionally((e) -> { }).exceptionally((e) -> {
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();

View File

@@ -247,3 +247,51 @@
ENDSELECT ENDSELECT
ENDPAGEQUERY ENDPAGEQUERY
ENDIF 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