|
@@ -216,10 +216,10 @@ public class So2Controller extends BaseController {
|
|
}
|
|
}
|
|
Map<String, Object> equalsCondition = new HashMap<>();
|
|
Map<String, Object> equalsCondition = new HashMap<>();
|
|
equalsCondition.put("illegalStatus", 2);
|
|
equalsCondition.put("illegalStatus", 2);
|
|
- Map<Object, Object> aisAggs = client.dateHistogramAggs(ElasticConstants.AIS_ILLEGAL_SHIP, AggsType.count, "createTime", "id", equalsCondition, rangeCondition, new DateHistogramInterval(interval));
|
|
|
|
- Map<Object, Object> so2Aggs = client.dateHistogramAggs(ElasticConstants.SO2_ALERT, AggsType.count, "createTime", "id", equalsCondition, rangeCondition, new DateHistogramInterval(interval));
|
|
|
|
|
|
+ Map<Object, Object> aisAggs = client.dateHistogramAggs(AggsType.count, "createTime", "id", equalsCondition, rangeCondition, new DateHistogramInterval(interval), ElasticConstants.AIS_ILLEGAL_SHIP);
|
|
|
|
+ Map<Object, Object> so2Aggs = client.dateHistogramAggs(AggsType.count, "createTime", "id", equalsCondition, rangeCondition, new DateHistogramInterval(interval), ElasticConstants.SO2_ALERT);
|
|
equalsCondition.put("illegalStatus", 3);
|
|
equalsCondition.put("illegalStatus", 3);
|
|
- Map<Object, Object> heiyanAggs = client.dateHistogramAggs(ElasticConstants.HEIYAN_SHIP_RECOGNITION, AggsType.count, "createTime", "id", equalsCondition, rangeCondition, new DateHistogramInterval(interval));
|
|
|
|
|
|
+ Map<Object, Object> heiyanAggs = client.dateHistogramAggs(AggsType.count, "createTime", "id", equalsCondition, rangeCondition, new DateHistogramInterval(interval), ElasticConstants.HEIYAN_SHIP_RECOGNITION);
|
|
Map<String, Map<Object, Object>> result = new HashMap<>();
|
|
Map<String, Map<Object, Object>> result = new HashMap<>();
|
|
result.put("ais", aisAggs);
|
|
result.put("ais", aisAggs);
|
|
result.put("so2", so2Aggs);
|
|
result.put("so2", so2Aggs);
|
|
@@ -227,4 +227,32 @@ public class So2Controller extends BaseController {
|
|
return AjaxResult.success(result);
|
|
return AjaxResult.success(result);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @GetMapping("/third/timeStatic")
|
|
|
|
+ @ApiOperation("for-Third-超标船舶统计-按时间")
|
|
|
|
+ public AjaxResult thirdMonthStatic(@RequestParam(required = false) String interval, @RequestParam(required = false) String startMonth, @RequestParam(required = false) String endMonth) {
|
|
|
|
+ if (StrUtil.isBlank(interval)) {
|
|
|
|
+ // 默认值为1个月
|
|
|
|
+ interval = "1M";
|
|
|
|
+ }
|
|
|
|
+ Map<String, Object> rangeCondition = new HashMap<>();
|
|
|
|
+ if (!StrUtil.isAllBlank(startMonth, endMonth)) {
|
|
|
|
+ if (StrUtil.isNotBlank(startMonth)) {
|
|
|
|
+ startMonth = startMonth + "-01 00:00:00";
|
|
|
|
+ }
|
|
|
|
+ if (StrUtil.isNotBlank(endMonth)) {
|
|
|
|
+ endMonth = DateUtil.formatDate(DateUtil.endOfMonth(DateUtil.parseDate(endMonth + "-01 00:00:00"))) + " 23:59:59";
|
|
|
|
+ }
|
|
|
|
+ rangeCondition.put("createTime", StrUtil.concat(true, "[", startMonth, ",", endMonth, "]"));
|
|
|
|
+ }
|
|
|
|
+ Map<String, Object> equalsCondition = new HashMap<>();
|
|
|
|
+ equalsCondition.put("illegalStatus", 2);
|
|
|
|
+ Map<Object, Object> so2Aggs = client.dateHistogramAggs(AggsType.count, "createTime", "id", equalsCondition, rangeCondition, new DateHistogramInterval(interval), ElasticConstants.SO2_ALERT, ElasticConstants.AIS_ILLEGAL_SHIP);
|
|
|
|
+ equalsCondition.put("illegalStatus", 3);
|
|
|
|
+ Map<Object, Object> heiyanAggs = client.dateHistogramAggs(AggsType.count, "createTime", "id", equalsCondition, rangeCondition, new DateHistogramInterval(interval), ElasticConstants.HEIYAN_SHIP_RECOGNITION);
|
|
|
|
+ Map<String, Map<Object, Object>> result = new HashMap<>();
|
|
|
|
+ result.put("so2", so2Aggs);
|
|
|
|
+ result.put("black", heiyanAggs);
|
|
|
|
+ return AjaxResult.success(result);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|