From 9199a7c7632b01ac7c5f2ed20dc56c288f80344b Mon Sep 17 00:00:00 2001 From: zhuxinyu <1799009482@qq.com> Date: Mon, 10 Apr 2023 20:31:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AF=8F=E6=9C=88=E6=B5=81=E9=87=8F=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../njcn/device/pq/pojo/param/PqsParam.java | 2 ++ .../controller/OperationContrController.java | 15 +++++++++++---- .../com/njcn/device/pq/mapper/LineMapper.java | 6 ++++-- .../device/pq/mapper/mapping/DeviceMapper.xml | 4 ++-- .../device/pq/mapper/mapping/LineMapper.xml | 18 ++++++++++++++++++ .../njcn/device/pq/service/LineService.java | 2 ++ .../pq/service/impl/LineServiceImpl.java | 6 ++++++ 7 files changed, 45 insertions(+), 8 deletions(-) diff --git a/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/param/PqsParam.java b/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/param/PqsParam.java index 59180de88..0e397d9a6 100644 --- a/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/param/PqsParam.java +++ b/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/param/PqsParam.java @@ -12,6 +12,8 @@ import lombok.NoArgsConstructor; @NoArgsConstructor @EqualsAndHashCode(callSuper = true) public class PqsParam extends DeviceInfoParam.BusinessParam { + @ApiModelProperty("装置id") + private String devId; @ApiModelProperty("当前页码") private Integer pageNum; @ApiModelProperty("当前页条数") diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/OperationContrController.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/OperationContrController.java index 292e198cb..d15c77864 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/OperationContrController.java +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/OperationContrController.java @@ -22,10 +22,7 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.ibatis.annotations.Param; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -118,6 +115,16 @@ public class OperationContrController extends BaseController { return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe); } + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @PostMapping("/getMonthFlow") + @ApiOperation("获取每月流量") + @ApiImplicitParam(name = "deviceInfoParam", value = "实体", required = true) + public HttpResult> getMonthFlow (@RequestBody PqsParam deviceInfoParam){ + String methodDescribe = getMethodDescribe("getMonthFlow"); + LogUtil.njcnDebug(log, "{},参数集合:{}", methodDescribe, deviceInfoParam); + List result = lineService.getMonthFlow(deviceInfoParam); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe); + } @OperateInfo(info = LogEnum.BUSINESS_COMMON) diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/LineMapper.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/LineMapper.java index 649f45d25..981eb08c0 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/LineMapper.java +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/LineMapper.java @@ -420,6 +420,8 @@ public interface LineMapper extends BaseMapper { List getDeviceRunStatistics(@Param("list") List list, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime); - Page getNewDeviceRunStatistics(Page page,@Param("devs") List list, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime); - Page getNewDeviceFlowStatistics(Page page,@Param("devs") List list, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime); + Page getNewDeviceRunStatistics (Page page,@Param("devs") List list, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime); + Page getNewDeviceFlowStatistics (Page page,@Param("devs") List list, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime); + + List getMonthFlow (@Param("devId") String devId,@Param("startTime") DateTime beginOfDay, @Param("endTime") DateTime endOfDay); } diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/DeviceMapper.xml b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/DeviceMapper.xml index c2bfe7fcc..043a32d6c 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/DeviceMapper.xml +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/DeviceMapper.xml @@ -118,7 +118,7 @@ + diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/LineService.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/LineService.java index 6453fa6de..53ba61443 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/LineService.java +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/LineService.java @@ -208,4 +208,6 @@ public interface LineService { Page dailyDeviceAbnormalStatistics(PqsParam param); List dailyDeviceAbnormal(DeviceInfoParam.BusinessParam conditionBusinessParam); + + List getMonthFlow (PqsParam deviceInfoParam); } diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/LineServiceImpl.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/LineServiceImpl.java index aee95534a..ca87f9a39 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/LineServiceImpl.java +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/LineServiceImpl.java @@ -403,6 +403,12 @@ public class LineServiceImpl extends ServiceImpl implements Li return topMsgDetails; } + @Override + public List getMonthFlow(PqsParam deviceInfoParam) { + List list = lineMapper.getMonthFlow(deviceInfoParam.getDevId(),DateUtil.beginOfDay(DateUtil.parse(deviceInfoParam.getSearchBeginTime())),DateUtil.endOfDay(DateUtil.parse(deviceInfoParam.getSearchEndTime()))); + return list; + } + @Override public List getDeviceRunStatistics(DeviceInfoParam.BusinessParam deviceInfoParam) { ArrayList lineFlowMealDetailList = new ArrayList<>();