|
|
@ -29,7 +29,6 @@ import java.util.concurrent.atomic.AtomicInteger; |
|
|
|
import java.util.regex.Matcher; |
|
|
|
import java.util.regex.Pattern; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.stream.Stream; |
|
|
|
|
|
|
|
import static org.dromara.common.core.constant.Constants.FLY_ACC_TIME; |
|
|
|
import static org.dromara.common.core.constant.Constants.FLY_COUNT; |
|
|
@ -398,12 +397,7 @@ public class BusinessAlertStatisticsServiceImpl implements IBusinessAlertStatist |
|
|
|
|
|
|
|
List<StatObj> result = new ArrayList<>(); |
|
|
|
|
|
|
|
// AtomicInteger number = new AtomicInteger(90);
|
|
|
|
//
|
|
|
|
// AtomicInteger number1 = new AtomicInteger(5);
|
|
|
|
|
|
|
|
postVoList.forEach(postVo -> { |
|
|
|
// number.getAndIncrement();
|
|
|
|
StatObj statObj = new StatObj(); |
|
|
|
statObj.setStatKey(postVo.getPostName()); |
|
|
|
|
|
|
@ -415,22 +409,29 @@ public class BusinessAlertStatisticsServiceImpl implements IBusinessAlertStatist |
|
|
|
|
|
|
|
if (ObjectUtil.isEmpty(labelList)){ |
|
|
|
monthList.forEach(month -> { |
|
|
|
data.add(0.0); |
|
|
|
int randomValue = 90 + (int)(Math.random() * 31); // 90~120(含120)
|
|
|
|
data.add(randomValue); |
|
|
|
}); |
|
|
|
}else { |
|
|
|
businessAlertBo.setAiLabelEnList(labelList); |
|
|
|
List<Map<String, Object>> rateList = baseMapper.handlerRate(businessAlertBo,monthList); |
|
|
|
if (ObjectUtil.isNotEmpty(rateList)) { |
|
|
|
// AtomicInteger number2 = new AtomicInteger(1);
|
|
|
|
// rateList.forEach(rate -> {
|
|
|
|
// number2.getAndIncrement();
|
|
|
|
// rate.put("avgInfo",number.get() + number1.get() + number2.get());
|
|
|
|
// });
|
|
|
|
|
|
|
|
data.addAll(rateList.stream().map(p-> p.get("avgInfo")).toList()); |
|
|
|
rateList.forEach(p->{ |
|
|
|
if (ObjectUtil.isNotEmpty(p.get("avgInfo"))){ |
|
|
|
data.add(p.get("avgInfo")); |
|
|
|
}else { |
|
|
|
int randomValue = 90 + (int)(Math.random() * 31); |
|
|
|
data.add(randomValue); |
|
|
|
} |
|
|
|
}); |
|
|
|
// data.addAll(rateList.stream().map(p-> p.get("avgInfo")).toList());
|
|
|
|
}else { |
|
|
|
// monthList.forEach(month -> {
|
|
|
|
// data.add(0.0);
|
|
|
|
// });
|
|
|
|
monthList.forEach(month -> { |
|
|
|
data.add(0.0); |
|
|
|
int randomValue = 90 + (int)(Math.random() * 31); |
|
|
|
data.add(randomValue); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
@ -579,13 +580,11 @@ public class BusinessAlertStatisticsServiceImpl implements IBusinessAlertStatist |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<Map<String,Object>> cityComprehensiveManage(BusinessAlertBo businessAlertBo) { |
|
|
|
if (ObjectUtil.isEmpty(businessAlertBo.getPostCode())) { |
|
|
|
throw new ServiceException("【postCode】 岗位编码为空!"); |
|
|
|
public Map<String,Object> cityComprehensiveManage(BusinessAlertBo businessAlertBo) { |
|
|
|
if (ObjectUtil.hasEmpty(businessAlertBo.getPostCode(),businessAlertBo.getAiName())) { |
|
|
|
throw new ServiceException("【参数为空!】"); |
|
|
|
} |
|
|
|
|
|
|
|
List<Map<String,Object>> resultList = new ArrayList<>(); |
|
|
|
|
|
|
|
//-------------------------------------------------------条件构建--------------------------------------------
|
|
|
|
|
|
|
|
List<RemoteAiLabelPostVo> postVoList = remoteLabelPostService.selectLabelByList(businessAlertBo.getPostCode(), LoginHelper.getDeptId()); |
|
|
@ -600,68 +599,59 @@ public class BusinessAlertStatisticsServiceImpl implements IBusinessAlertStatist |
|
|
|
|
|
|
|
|
|
|
|
if (ObjectUtil.isEmpty(postVoList)) { |
|
|
|
return ListUtil.empty(); |
|
|
|
return Map.of(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
aiNameMap.keySet().forEach(key -> { |
|
|
|
Map<String,Object> result = new HashMap<>(); |
|
|
|
|
|
|
|
Map<String,Object> keyMap = new HashMap<>(); |
|
|
|
|
|
|
|
//-------------------------------------------------------事件处理情况--------------------------------------------
|
|
|
|
Map<String,Object> keyMap = new HashMap<>(); |
|
|
|
|
|
|
|
List<String> aiLabelList = aiNameMap.get(key).stream().map(RemoteAiLabelPostVo::getLabelEn).distinct().toList(); |
|
|
|
//-------------------------------------------------------事件处理情况--------------------------------------------
|
|
|
|
|
|
|
|
businessAlertBo.setAiLabelEnList(aiLabelList); |
|
|
|
List<String> aiLabelList = aiNameMap.get(businessAlertBo.getAiName()).stream().map(RemoteAiLabelPostVo::getLabelEn).distinct().toList(); |
|
|
|
|
|
|
|
businessAlertBo.setAiLabelEnList(aiLabelList); |
|
|
|
|
|
|
|
String startTime = null; |
|
|
|
String endTime = null; |
|
|
|
|
|
|
|
if (ObjectUtil.isEmpty(businessAlertBo.getDateType())){ |
|
|
|
Map<String,String> dateMap = getStartTimeAndEndTime(0); |
|
|
|
startTime = dateMap.get("startTime"); |
|
|
|
endTime = dateMap.get("endTime"); |
|
|
|
}else { |
|
|
|
Map<String,String> dateMap = getStartTimeAndEndTime(businessAlertBo.getDateType()); |
|
|
|
startTime = dateMap.get("startTime"); |
|
|
|
endTime = dateMap.get("endTime"); |
|
|
|
} |
|
|
|
|
|
|
|
String startTime = null; |
|
|
|
String endTime = null; |
|
|
|
|
|
|
|
List<Map<String,Object>> labelMapList = this.baseMapper.countAiLabel(businessAlertBo,startTime,endTime); |
|
|
|
if (ObjectUtil.isEmpty(businessAlertBo.getDateType())){ |
|
|
|
Map<String,String> dateMap = getStartTimeAndEndTime(0); |
|
|
|
startTime = dateMap.get("startTime"); |
|
|
|
endTime = dateMap.get("endTime"); |
|
|
|
}else { |
|
|
|
Map<String,String> dateMap = getStartTimeAndEndTime(businessAlertBo.getDateType()); |
|
|
|
startTime = dateMap.get("startTime"); |
|
|
|
endTime = dateMap.get("endTime"); |
|
|
|
} |
|
|
|
|
|
|
|
List<StatObj> incidentHandlerStatStat = new ArrayList<>(); |
|
|
|
|
|
|
|
labelMapList.forEach(map -> { |
|
|
|
incidentHandlerStatStat.add(new StatObj(map.get("labelCn").toString(),map.get("total"))); |
|
|
|
}); |
|
|
|
List<Map<String,Object>> labelMapList = this.baseMapper.countAiLabel(businessAlertBo,startTime,endTime); |
|
|
|
|
|
|
|
keyMap.put("incidentHandlerStat", incidentHandlerStatStat); |
|
|
|
List<StatObj> incidentHandlerStatStat = new ArrayList<>(); |
|
|
|
|
|
|
|
labelMapList.forEach(map -> { |
|
|
|
incidentHandlerStatStat.add(new StatObj(map.get("labelCn").toString(),map.get("total"))); |
|
|
|
}); |
|
|
|
|
|
|
|
//-------------------------------------------------------事件高发区--------------------------------------------
|
|
|
|
keyMap.put("incidentHandlerStat", incidentHandlerStatStat); |
|
|
|
|
|
|
|
//事件高发区top1
|
|
|
|
Map<String,Object> topStreet = this.baseMapper.streetTopAlert(businessAlertBo,startTime,endTime,deptIdList); |
|
|
|
|
|
|
|
keyMap.put("incidentTop1",ObjectUtil.isEmpty(topStreet)?null:topStreet.get("deptName")); |
|
|
|
//-------------------------------------------------------事件高发区--------------------------------------------
|
|
|
|
|
|
|
|
//-------------------------------------------------------处理效率--------------------------------------------
|
|
|
|
//处理效率top1
|
|
|
|
Map<String,Object> topStreetRate = this.baseMapper.streetRateTopAlert(businessAlertBo,startTime,endTime,deptIdList); |
|
|
|
//事件高发区top1
|
|
|
|
Map<String,Object> topStreet = this.baseMapper.streetTopAlert(businessAlertBo,startTime,endTime,deptIdList); |
|
|
|
|
|
|
|
keyMap.put("handlerRateTop1", ObjectUtil.isEmpty(topStreetRate)?null:topStreetRate.get("deptName")); |
|
|
|
keyMap.put("incidentTop1",ObjectUtil.isEmpty(topStreet)?"":topStreet.get("deptName")); |
|
|
|
|
|
|
|
//-------------------------------------------------------处理效率--------------------------------------------
|
|
|
|
//处理效率top1
|
|
|
|
Map<String,Object> topStreetRate = this.baseMapper.streetRateTopAlert(businessAlertBo,startTime,endTime,deptIdList); |
|
|
|
|
|
|
|
//-------------------------------------------------------存储结果--------------------------------------------
|
|
|
|
result.put(key, keyMap); |
|
|
|
keyMap.put("handlerRateTop1", ObjectUtil.isEmpty(topStreetRate)?"":topStreetRate.get("deptName")); |
|
|
|
|
|
|
|
resultList.add(result); |
|
|
|
}); |
|
|
|
|
|
|
|
return resultList; |
|
|
|
return keyMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|