|
|
|
|
@ -73,33 +73,39 @@ public class ProfileDepartController {
|
|
|
|
|
List<SupPolice> polices = policeService.listAllByDepartId(departId); |
|
|
|
|
profileDepart.getDepartInfo().setMainRole(polices.stream().filter(item -> "正职".equals(item.getPosition())).findFirst().map(SupPolice::getName).orElse(null)); |
|
|
|
|
profileDepart.getDepartInfo().setDeputyRole(polices.stream().filter(item -> "副职".equals(item.getPosition())).map(SupPolice::getName).toList()); |
|
|
|
|
// 民警数量
|
|
|
|
|
profileDepart.getDepartInfo().setPoliceSize(polices.stream().filter(item -> PersonTypeEnum.police.getValue().equals(item.getPersonType())).count()); |
|
|
|
|
|
|
|
|
|
// 协警辅警数量
|
|
|
|
|
profileDepart.getDepartInfo().setAuxSize(polices.stream().filter(item -> PersonTypeEnum.aux.getValue().equals(item.getPersonType()) || PersonTypeEnum.xj.getValue().equals(item.getPersonType())).count()); |
|
|
|
|
|
|
|
|
|
List<Negative> list = negativeService.list(new LambdaQueryWrapper<Negative>().eq(Negative::getInvolveDepartId, departId) |
|
|
|
|
.between(Negative::getCrtTime, beginTime, endTime) |
|
|
|
|
.in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()))); |
|
|
|
|
List<String> negativeIds = list.stream().map(Negative::getId).toList(); |
|
|
|
|
int negativePoliceSize = profileDepartMapper.countByNegativeIdsAndPersonTypes(negativeIds, List.of(PersonTypeEnum.police.getValue())); |
|
|
|
|
int negativePoliceSize = negativeIds.isEmpty() ? 0 : profileDepartMapper.countByNegativeIdsAndPersonTypes(negativeIds, List.of(PersonTypeEnum.police.getValue())); |
|
|
|
|
profileDepart.getDepartInfo().setNegativePoliceSize(negativePoliceSize); |
|
|
|
|
int negativeAuxSize = profileDepartMapper.countByNegativeIdsAndPersonTypes(negativeIds, List.of(PersonTypeEnum.aux.getValue(), PersonTypeEnum.xj.getValue())); |
|
|
|
|
int negativeAuxSize = negativeIds.isEmpty() ? 0 : profileDepartMapper.countByNegativeIdsAndPersonTypes(negativeIds, List.of(PersonTypeEnum.aux.getValue(), PersonTypeEnum.xj.getValue())); |
|
|
|
|
profileDepart.getDepartInfo().setNegativeAuxSize(negativeAuxSize); |
|
|
|
|
|
|
|
|
|
profileDepart.getNegativeInfo().setSize(list.size()); |
|
|
|
|
|
|
|
|
|
int jcjBusinessSize = businessDepartService.list(new LambdaQueryWrapper<BusinessDepart>() |
|
|
|
|
int jcj110BusinessSize = businessDepartService.list(new LambdaQueryWrapper<BusinessDepart>() |
|
|
|
|
.between(BusinessDepart::getDate, beginTime, endTime) |
|
|
|
|
.eq(BusinessDepart::getBusinessType, BusinessTypeEnum.JCJ_110.getValue()) |
|
|
|
|
.eq(BusinessDepart::getDepartId, departId)) |
|
|
|
|
.stream().mapToInt(BusinessDepart::getNumber).sum(); |
|
|
|
|
int jcjSize = negativeService.list(new LambdaQueryWrapper<Negative>() |
|
|
|
|
int jcj110Size = negativeService.list(new LambdaQueryWrapper<Negative>() |
|
|
|
|
.between(Negative::getCrtTime, beginTime, endTime) |
|
|
|
|
.eq(Negative::getBusinessTypeCode, BusinessTypeEnum.JCJ_110.getValue()) |
|
|
|
|
.eq(Negative::getInvolveDepartId, departId) |
|
|
|
|
.in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()))).size(); |
|
|
|
|
int jcj122BusinessSize = businessDepartService.list(new LambdaQueryWrapper<BusinessDepart>() |
|
|
|
|
.between(BusinessDepart::getDate, beginTime, endTime) |
|
|
|
|
.eq(BusinessDepart::getBusinessType, BusinessTypeEnum.JCJ_122.getValue()) |
|
|
|
|
.eq(BusinessDepart::getDepartId, departId)) |
|
|
|
|
.stream().mapToInt(BusinessDepart::getNumber).sum(); |
|
|
|
|
int jcj122Size = negativeService.list(new LambdaQueryWrapper<Negative>() |
|
|
|
|
.between(Negative::getCrtTime, beginTime, endTime) |
|
|
|
|
.eq(Negative::getBusinessTypeCode, BusinessTypeEnum.JCJ_122.getValue()) |
|
|
|
|
.eq(Negative::getInvolveDepartId, departId) |
|
|
|
|
.in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()))).size(); |
|
|
|
|
|
|
|
|
|
int zfbaBusinessSize = businessDepartService.list(new LambdaQueryWrapper<BusinessDepart>() |
|
|
|
|
.between(BusinessDepart::getDate, beginTime, endTime) |
|
|
|
|
.eq(BusinessDepart::getBusinessType, BusinessTypeEnum.ZFBA.getValue()) |
|
|
|
|
@ -110,7 +116,10 @@ public class ProfileDepartController {
|
|
|
|
|
.eq(Negative::getBusinessTypeCode, BusinessTypeEnum.ZFBA.getValue()) |
|
|
|
|
.eq(Negative::getInvolveDepartId, departId) |
|
|
|
|
.in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()))).size(); |
|
|
|
|
profileDepart.getNegativeInfo().setJcjSize(jcjSize).setJcjBusinessSize(jcjBusinessSize).setZfbaBusinessSize(zfbaBusinessSize).setZfbaSize(zfbaSize); |
|
|
|
|
profileDepart.getNegativeInfo().setJcj110Size(jcj110Size).setJcj110BusinessSize(jcj110BusinessSize) |
|
|
|
|
.setJcj122Size(jcj122Size) |
|
|
|
|
.setJcj122BusinessSize(jcj122BusinessSize) |
|
|
|
|
.setZfbaBusinessSize(zfbaBusinessSize).setZfbaSize(zfbaSize); |
|
|
|
|
// 问题来源占比
|
|
|
|
|
Map<String, List<Negative>> problemSourcesGroup = list.stream().collect(Collectors.groupingBy(Negative::getProblemSourcesCode)); |
|
|
|
|
List<PieItem> problemSourcesList = problemSourcesGroup.keySet().stream().map(key -> new PieItem(Optional.ofNullable(ProblemSourcesEnum.get(key)).map(ProblemSourcesEnum::getLabel).orElse(key), problemSourcesGroup.get(key).size())).toList(); |
|
|
|
|
@ -137,7 +146,7 @@ public class ProfileDepartController {
|
|
|
|
|
profileDepart.setProblemTypeRadarIndicator(problemTypeRadarIndicator); |
|
|
|
|
profileDepart.setProblemTypeRadarData(problemTypeRadarData); |
|
|
|
|
// 突出问题排名
|
|
|
|
|
profileDepart.setProblemTypeBarList(problemTypeBarList); |
|
|
|
|
profileDepart.setProblemTypeBarList(profileDepartMapper.selectThirdProblemType(departId, beginTime, endTime)); |
|
|
|
|
return Result.success(profileDepart); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|