|
@@ -501,4 +501,80 @@ public class IncidentController {
|
|
|
|
|
|
return msgResult;
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value="督办类型数量")
|
|
|
+ @RequestMapping(value = "countByCaseType",method = RequestMethod.POST)
|
|
|
+ public MessageResult<Map> countByCaseType(@RequestAttribute String subject){
|
|
|
+ MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+
|
|
|
+ int total = 0;
|
|
|
+ List<DataDictionary> dataDictionaryList = dataDictionaryService.findByCatalogName("督办类型");
|
|
|
+ for(DataDictionary dataDictionary : dataDictionaryList) {
|
|
|
+ Map<String, Object> searchParams = new HashMap<>();
|
|
|
+ searchParams.put("caseType",dataDictionary.getValue());
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("a.warn_time", "asc"));
|
|
|
+ Page<Incident> page = incidentService.pageSearchPanding(searchParams, 1, 10000, false, sortList);
|
|
|
+ map.put("item" + dataDictionary.getValue(),page.getResult().size());
|
|
|
+ total += page.getResult().size();
|
|
|
+ }
|
|
|
+ map.put("total", total);
|
|
|
+
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(map);
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value="督办类型数量")
|
|
|
+ @RequestMapping(value = "countByWarningLight",method = RequestMethod.POST)
|
|
|
+ public MessageResult<Map> countByWarningLight(@RequestAttribute String subject){
|
|
|
+ MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ int intDanger = 0;
|
|
|
+ int intWarning = 0;
|
|
|
+ int intSafety = 0;
|
|
|
+ int total = 0;
|
|
|
+
|
|
|
+ Map<String,Object> searchParams = new HashMap<>();
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("a.warn_time","asc"));
|
|
|
+
|
|
|
+ Page<Incident> page = incidentService.pageSearchPanding(searchParams,1,10000,false,sortList);
|
|
|
+ total = page.size();
|
|
|
+ for(Incident incident : page.getResult()){
|
|
|
+ List<IncidentStep> incidentStepList = incidentStepService.findListByIncidentId(incident.getId());
|
|
|
+ incident.setStepWarnTime(incidentStepList.get(incidentStepList.size()-1).getWarnTime());
|
|
|
+ //报警灯
|
|
|
+ Date beginTime = new Date();
|
|
|
+ Date endTime = incident.getStepWarnTime();
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
+ calendar.setTime(beginTime);
|
|
|
+
|
|
|
+ if(beginTime.after(endTime)){
|
|
|
+ intDanger++;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ calendar.add(Calendar.DATE, 3);
|
|
|
+ beginTime = calendar.getTime();
|
|
|
+ if(beginTime.after(endTime)){
|
|
|
+ intWarning++;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ intSafety++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ map.put("intDanger",intDanger);
|
|
|
+ map.put("intWarning",intWarning);
|
|
|
+ map.put("intSafety",intSafety);
|
|
|
+ map.put("total",total);
|
|
|
+
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(map);
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
}
|