From a15a8cfd7b01ce4bba6fe9fd876f6704ca23a12d Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期二, 07 一月 2025 16:40:32 +0800 Subject: [PATCH] 1、取水口用水日统计表中增加金额、次数字段; 2、优化或重写“累计流量超过指定值的取水口”、“累计流量低于指定值的取水口”、“指定时间段内用水量超过指定值的取水口”、“指定时间段内消费金额超过指定值的取水口”几个统计查询; 3、改“指定时间段内用水时长超过指定值的取水口”为“指定时间段内用水次数超过指定值的取水口” --- pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/CommandResultCtrl.java | 25 ++++++++++++++----------- 1 files changed, 14 insertions(+), 11 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/CommandResultCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/CommandResultCtrl.java index d9d64c5..21d02e1 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/CommandResultCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/CommandResultCtrl.java @@ -1,8 +1,8 @@ package com.dy.pipIrrRemote.common; +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONObject; import com.dy.common.mw.protocol.Data; -import com.dy.common.webUtil.BaseResponse; -import com.dy.common.webUtil.BaseResponseUtils; import com.dy.pipIrrGlobal.command.ComSupport; import lombok.extern.slf4j.Slf4j; import org.springframework.http.MediaType; @@ -25,18 +25,21 @@ @RequestMapping(path="comRes") public class CommandResultCtrl extends ComSupport { @PostMapping(path = "receive", consumes = MediaType.APPLICATION_JSON_VALUE) - public BaseResponse<String> receive(@RequestBody Data data) { - Long comId = 0L; - if(data.getCommandId() != null) { - comId = Long.parseLong(data.getCommandId()); - } + public void receive(@RequestBody Data data) { + JSONObject job_data = (JSONObject) JSON.toJSON(data); + String job_dataS = job_data.toJSONString(); + JSONObject job_subData = job_data.getJSONObject("subData").getJSONObject("subData"); - CompletableFuture<Data> feature = (CompletableFuture<Data>) features.get(comId); + JSONObject job_response = new JSONObject(); + job_response.put("data", job_subData); + job_response.put("commandCode", job_data.getString("code")); + job_response.put("commandId", job_data.getString("commandId")); + + CompletableFuture<JSONObject> feature = (CompletableFuture<JSONObject>) features.get(job_data.getLong("commandId")); if(feature != null) { - feature.complete(data); + feature.complete(job_response); }else{ - log.error("feature is null"); + feature.complete(new JSONObject()); } - return BaseResponseUtils.buildSuccess("ok"); } } -- Gitblit v1.8.0