/getFBStats:允许时间段查询。
parent
3e2a38397d
commit
4146d1fc2a
|
|
@ -356,10 +356,13 @@ public class QXWarnController {
|
||||||
* @param dto
|
* @param dto
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "历史7天暴雨预警叫应信息统计")
|
@ApiOperation(value = "历史n天暴雨预警叫应信息统计")
|
||||||
@PostMapping("/getFBStats")
|
@PostMapping("/getFBStats")
|
||||||
@Cacheable(value = THIS_REDIS_KEY, key = "#root.method.name+':'+#dto.toString()")
|
@Cacheable(value = THIS_REDIS_KEY, key = "#root.method.name+':'+#dto.toString()")
|
||||||
public ResultJson<FBStatsVO> getFeedBackStats(@RequestBody GroupWarningDto dto) {
|
public ResultJson<FBStatsVO> getFeedBackStats(@RequestBody GroupWarningDto dto) {
|
||||||
|
String startTime = dto.getStartTime();
|
||||||
|
String endTime = dto.getEndTime();
|
||||||
|
if(Objects.isNull(startTime)&&Objects.isNull(endTime)){
|
||||||
//当前时间
|
//当前时间
|
||||||
Calendar startCalendarDay = Calendar.getInstance();
|
Calendar startCalendarDay = Calendar.getInstance();
|
||||||
int year = startCalendarDay.get(Calendar.YEAR);
|
int year = startCalendarDay.get(Calendar.YEAR);
|
||||||
|
|
@ -397,10 +400,28 @@ public class QXWarnController {
|
||||||
// }
|
// }
|
||||||
fbStatsVO = getCount3(data);
|
fbStatsVO = getCount3(data);
|
||||||
// System.out.println("周统计:"+weekWarnNum +"个");
|
// System.out.println("周统计:"+weekWarnNum +"个");
|
||||||
|
|
||||||
}
|
|
||||||
return ResultJson.ok(fbStatsVO);
|
return ResultJson.ok(fbStatsVO);
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
ApiDto searchDto = new ApiDto();
|
||||||
|
ArrayList<ApiDto.Filter> filter = Lists.newArrayList();
|
||||||
|
searchDto.setStartTime(startTime);
|
||||||
|
searchDto.setEndTime(endTime);
|
||||||
|
searchDto.setPageNumber(dto.getPageNumber());
|
||||||
|
searchDto.setPageSize(99999);
|
||||||
|
searchDto.setFilter(filter);
|
||||||
|
String searchstr = HttpUtil.sendPost("http://223.75.53.141:8000/shzh/met/zyqxfw/api/warning/getGroupWarning", JSON.toJSONString(searchDto));
|
||||||
|
JSONObject searchjson = JSON.parseObject(searchstr);
|
||||||
|
System.out.println("searchjson:"+searchjson);
|
||||||
|
FBStatsVO fbStatsVO = null;
|
||||||
|
if (searchjson != null && searchjson.getInteger("code") == HttpStatus.SC_OK) {
|
||||||
|
List<WarningData> data = searchjson.getJSONArray("data").toJavaList(WarningData.class);
|
||||||
|
fbStatsVO = getCount3(data);
|
||||||
|
return ResultJson.ok(fbStatsVO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
private FBStatsVO getCount3(List<WarningData> data){
|
private FBStatsVO getCount3(List<WarningData> data){
|
||||||
int sum = 0;
|
int sum = 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue