From 239927b057f65a040594f7a4cb08c8881b303797 Mon Sep 17 00:00:00 2001
From: cjl <276999030@qq.com>
Date: Fri, 18 Aug 2023 14:52:16 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/cjl-230812' into cjl-230812
---
screen-api/src/main/java/com/moral/api/controller/CruiserController.java | 30 ++++++++++++++++++++++++++++--
1 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/screen-api/src/main/java/com/moral/api/controller/CruiserController.java b/screen-api/src/main/java/com/moral/api/controller/CruiserController.java
index 421fd08..4e852a2 100644
--- a/screen-api/src/main/java/com/moral/api/controller/CruiserController.java
+++ b/screen-api/src/main/java/com/moral/api/controller/CruiserController.java
@@ -1,11 +1,13 @@
package com.moral.api.controller;
+import com.moral.api.pojo.dto.historySecondCruiser.HistorySecondCruiserResultDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
@@ -16,6 +18,8 @@
import org.springframework.web.multipart.MultipartHttpServletRequest;
import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -77,17 +81,39 @@
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "token", value = "token", required = true, paramType = "header", dataType = "String"),
@ApiImplicitParam(name = "mac", value = "������mac", required = true, paramType = "query", dataType = "String"),
- @ApiImplicitParam(name = "time", value = "���������2021-08-18", required = true, paramType = "query", dataType = "String")
+ @ApiImplicitParam(name = "time1", value = "���������2021-08-18", required = true, paramType = "query", dataType = "String"),
+ @ApiImplicitParam(name = "time2", value = "���������2021-08-18", required = true, paramType = "query", dataType = "String")
})
public ResultMessage carTrajectory(HttpServletRequest request) {
Map<String, Object> params = WebUtils.getParametersStartingWith(request, null);
if (!params.containsKey("mac") || !params.containsKey("time1")|| !params.containsKey("time2")) {
return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(), ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg());
}
- List<Map<String, Object>> response = specialDeviceService.carTrajectory(params);
+ List<Map<String, Object>> response = specialDeviceService.carTrajectory(params,true);
return ObjectUtils.isEmpty(response) ? ResultMessage.ok() : ResultMessage.ok(response);
}
+ @GetMapping("carTrajectoryNewAvg")
+ @ApiOperation(value = "���������������", notes = "���������������")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "token", value = "token", required = true, paramType = "header", dataType = "String"),
+ @ApiImplicitParam(name = "mac", value = "������mac", required = true, paramType = "query", dataType = "String"),
+ @ApiImplicitParam(name = "time1", value = "���������2021-08-18", required = true, paramType = "query", dataType = "String"),
+ @ApiImplicitParam(name = "time2", value = "���������2021-08-18", required = true, paramType = "query", dataType = "String"),
+ @ApiImplicitParam(name = "type", value = "������������", required = true, paramType = "query", dataType = "String"),
+ @ApiImplicitParam(name = "range", value = "������", required = true, paramType = "query", dataType = "int")
+ })
+ public ResultMessage carTrajectoryNewAvg(HttpServletRequest request) {
+ Map<String, Object> params = WebUtils.getParametersStartingWith(request, null);
+ if (!params.containsKey("mac") || !params.containsKey("time1")||!params.containsKey("range")|| !params.containsKey("type")|| !params.containsKey("time2")) {
+ return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(), ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg());
+ }
+ List<HistorySecondCruiserResultDTO> response = specialDeviceService.carTrajectoryNewAvg(params);
+ //������������������
+
+ return ObjectUtils.isEmpty(response) ? ResultMessage.ok() : ResultMessage.ok(response);
+
+ }
/**
* ���������������
--
Gitblit v1.8.0