Commit 75125c5d authored by tianbo's avatar tianbo

bugfix(ymt,elevator):大屏-应急统计修改

parent 8909826c
......@@ -14,5 +14,5 @@ public interface AlertStatisticsMapper extends BaseMapper<AlertStatistics> {
AlertStatistics getStatisticsMessage(@Param("orgCode")String orgCode, @Param("startDate")String startDate , @Param("endDate")String endDate);
AlertStatistics statisticsInfoByRegionAndDate(@Param("regionCode")String regionCode, @Param("startDate")String startDate , @Param("endDate")String endDate);
AlertStatistics statisticsInfoByRegionAndDate(@Param("regionCode")Integer regionCode, @Param("startDate")String startDate , @Param("endDate")String endDate);
}
......@@ -12,10 +12,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
......@@ -24,11 +21,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.*;
@RestController
......@@ -350,9 +343,9 @@ public class StatisticsController extends BaseController {
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/region/info")
@ApiOperation(httpMethod = "GET", value = "查询区域统计信息", notes = "查询区域统计信息")
public ResponseModel<JSONArray> statisticsRegionInfo(@RequestParam(value = "cityCode") String regionCode, @RequestParam(value = "startDate", required = false) LocalDate startDate, @RequestParam(value = "endDate", required = false) LocalDate endDate) {
return ResponseHelper.buildResponse(alertStatisticsService.statisticInfoByRegionAndDate(regionCode, startDate, endDate));
@PostMapping (value = "/region/info")
@ApiOperation(httpMethod = "POST", value = "查询区域统计信息", notes = "查询区域统计信息")
public ResponseModel<JSONArray> statisticsRegionInfo(@RequestBody Map<String, Object> queryParams) {
return ResponseHelper.buildResponse(alertStatisticsService.statisticInfoByRegionAndDate(queryParams));
}
}
......@@ -165,9 +165,12 @@ public class AlertStatisticsServiceImpl extends BaseService<AlertStatisticsDto,
}
@Override
public JSONArray statisticInfoByRegionAndDate(String regionCode, LocalDate startDate, LocalDate endDate) {
public JSONArray statisticInfoByRegionAndDate(Map<String, Object> params) {
LocalDate today = LocalDate.now();
if (ObjectUtils.isEmpty(startDate) || ObjectUtils.isEmpty(endDate)) {
LocalDate startDate = (LocalDate) params.get("startDate");
LocalDate endDate = (LocalDate) params.get("endDate");
Integer regionCode = (Integer) params.get("cityCode");
if (ObjectUtils.isEmpty(params.get("startDate")) || ObjectUtils.isEmpty(params.get("endDate"))) {
startDate = today.minusDays(6);
endDate = today;
}
......
package com.yeejoin.amos.boot.module.ymt.biz.dao;
import com.yeejoin.amos.boot.module.ymt.api.dto.ESEquipmentCategoryDto;
import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
......
......@@ -10,7 +10,7 @@ import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.ymt.api.dto.ESEquipmentCategoryDto;
import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquipExportDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentMessageDto;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment