diff --git a/src/main/java/com/biutag/supervision/constants/enums/BusinessTypeEnum.java b/src/main/java/com/biutag/supervision/constants/enums/BusinessTypeEnum.java index 71d27c8..22749f3 100644 --- a/src/main/java/com/biutag/supervision/constants/enums/BusinessTypeEnum.java +++ b/src/main/java/com/biutag/supervision/constants/enums/BusinessTypeEnum.java @@ -34,6 +34,6 @@ public enum BusinessTypeEnum { return businessTypeEnum; } } - throw new RuntimeException("无此业务类型"); + return null; } } diff --git a/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfileDepartController.java b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfileDepartController.java index 7ea30ec..c0202ec 100644 --- a/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfileDepartController.java +++ b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfileDepartController.java @@ -43,6 +43,7 @@ public class ProfileDepartController { private final SupDepartService departService; private final SupPoliceService policeService; private final NegativeService negativeService; + private final NegativeBlameService negativeBlameService; private final BusinessDepartService businessDepartService; @GetMapping @@ -74,10 +75,11 @@ public class ProfileDepartController { 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.getPersonStatus())).count()); + 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.getPersonStatus()) || PersonTypeEnum.xj.getValue().equals(item.getPersonStatus())).count()); + profileDepart.getDepartInfo().setAuxSize(polices.stream().filter(item -> PersonTypeEnum.aux.getValue().equals(item.getPersonType()) || PersonTypeEnum.xj.getValue().equals(item.getPersonType())).count()); + List list = negativeService.list(new LambdaQueryWrapper().eq(Negative::getInvolveDepartId, departId) .in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()))); profileDepart.getNegativeInfo().setSize(list.size()); @@ -109,7 +111,8 @@ public class ProfileDepartController { profileDepart.setProblemSourcesList(problemSourcesList); // 业务类型占比 Map> businessTypeGroup = list.stream().collect(Collectors.groupingBy(Negative::getBusinessTypeCode)); - List businessTypeList = businessTypeGroup.keySet().stream().map(key -> new PieItem(BusinessTypeEnum.get(key).getLabel(), businessTypeGroup.get(key).size())).toList(); + List businessTypeList = businessTypeGroup.keySet().stream().map(key -> new PieItem(Optional.ofNullable(BusinessTypeEnum.get(key)).map(BusinessTypeEnum::getLabel).orElse(key), + businessTypeGroup.get(key).size())).toList(); profileDepart.setBusinessTypeList(businessTypeList); // 个人问题排名 List policeBarList = profileDepartMapper.selectPoliceTop10(departId, beginTime, endTime); diff --git a/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfilePoliceController.java b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfilePoliceController.java index 30e48f6..9dc3e40 100644 --- a/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfilePoliceController.java +++ b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfilePoliceController.java @@ -13,13 +13,15 @@ import com.biutag.supervision.pojo.domain.ProfileDepart; import com.biutag.supervision.pojo.domain.ProfilePolice; import com.biutag.supervision.pojo.dto.common.BarItem; import com.biutag.supervision.pojo.dto.common.PieItem; -import com.biutag.supervision.pojo.entity.BusinessDepart; import com.biutag.supervision.pojo.entity.BusinessPolice; import com.biutag.supervision.pojo.entity.Negative; import com.biutag.supervision.pojo.entity.NegativeBlame; import com.biutag.supervision.pojo.model.PoliceNegativeModel; import com.biutag.supervision.pojo.param.DepartPoliceQueryParam; -import com.biutag.supervision.service.*; +import com.biutag.supervision.service.BusinessPoliceService; +import com.biutag.supervision.service.NegativeBlameService; +import com.biutag.supervision.service.NegativeService; +import com.biutag.supervision.service.SupPoliceService; import lombok.RequiredArgsConstructor; import org.springframework.format.annotation.DateTimeFormat; import org.springframework.web.bind.annotation.GetMapping; @@ -77,7 +79,8 @@ public class ProfilePoliceController { int jcjBusinessSize = businessPoliceService.list(new LambdaQueryWrapper() .between(BusinessPolice::getDate, beginTime, endTime) .eq(BusinessPolice::getBusinessType, BusinessTypeEnum.JCJ_110.getValue()) - .eq(BusinessPolice::getPoliceIdCode, idCode)) + .eq(BusinessPolice::getEmpNo, profilePolice.getPoliceInfo().getEmpNo()) + .eq(BusinessPolice::getPoliceName, profilePolice.getPoliceInfo().getName())) .stream().mapToInt(BusinessPolice::getNumber).sum(); Set negativeIds = negativeBlameService.list(new LambdaQueryWrapper().eq(NegativeBlame::getBlameIdCode, idCode)).stream().map(NegativeBlame::getNegativeId).collect(Collectors.toSet()); @@ -89,7 +92,8 @@ public class ProfilePoliceController { int zfbaBusinessSize = businessPoliceService.list(new LambdaQueryWrapper() .between(BusinessPolice::getDate, beginTime, endTime) .eq(BusinessPolice::getBusinessType, BusinessTypeEnum.ZFBA.getValue()) - .eq(BusinessPolice::getPoliceIdCode, idCode)) + .eq(BusinessPolice::getEmpNo, profilePolice.getPoliceInfo().getEmpNo()) + .eq(BusinessPolice::getPoliceName, profilePolice.getPoliceInfo().getName())) .stream().mapToInt(BusinessPolice::getNumber).sum(); int zfbaSize = negativeIds.isEmpty() ? 0 : negativeService.list(new LambdaQueryWrapper() .between(Negative::getCrtTime, beginTime, endTime) @@ -100,16 +104,17 @@ public class ProfilePoliceController { List list = negativeIds.isEmpty() ? new ArrayList<>() : negativeService.list(new LambdaQueryWrapper() .between(Negative::getCrtTime, beginTime, endTime) - .eq(Negative::getBusinessTypeCode, BusinessTypeEnum.JCJ_110.getValue()) .in(Negative::getId, negativeIds) .in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()))); // 问题来源占比 Map> problemSourcesGroup = list.stream().collect(Collectors.groupingBy(Negative::getProblemSourcesCode)); - List problemSourcesList = problemSourcesGroup.keySet().stream().map(key -> new PieItem(Optional.ofNullable(ProblemSourcesEnum.get(key)).map(ProblemSourcesEnum::getLabel).orElse(key), problemSourcesGroup.get(key).size())).toList(); + List problemSourcesList = problemSourcesGroup.keySet().stream().map(key -> new PieItem(Optional.ofNullable(ProblemSourcesEnum.get(key)).map(ProblemSourcesEnum::getLabel).orElse(key), + problemSourcesGroup.get(key).size())).toList(); profilePolice.setProblemSourcesList(problemSourcesList); // 业务类型占比 Map> businessTypeGroup = list.stream().collect(Collectors.groupingBy(Negative::getBusinessTypeCode)); - List businessTypeList = businessTypeGroup.keySet().stream().map(key -> new PieItem(BusinessTypeEnum.get(key).getLabel(), businessTypeGroup.get(key).size())).toList(); + List businessTypeList = businessTypeGroup.keySet().stream().map(key -> new PieItem(Optional.ofNullable(BusinessTypeEnum.get(key)).map(BusinessTypeEnum::getLabel).orElse(key) + , businessTypeGroup.get(key).size())).toList(); profilePolice.setBusinessTypeList(businessTypeList); // 风险问题构成 雷达图 List problemTypeBarList = profilePoliceMapper.selectProblemType(idCode, beginTime, endTime); diff --git a/src/main/java/com/biutag/supervision/job/DepartJob.java b/src/main/java/com/biutag/supervision/job/DepartJob.java new file mode 100644 index 0000000..02473f9 --- /dev/null +++ b/src/main/java/com/biutag/supervision/job/DepartJob.java @@ -0,0 +1,13 @@ +package com.biutag.supervision.job; + +import org.springframework.stereotype.Component; + +/** + * @author wxc + * @date 2024/11/4 + */ +@Component +public class DepartJob { + + +} diff --git a/src/main/resources/mapper/ProfilePoliceMapper.xml b/src/main/resources/mapper/ProfilePoliceMapper.xml index e7b3fc0..57ea08b 100644 --- a/src/main/resources/mapper/ProfilePoliceMapper.xml +++ b/src/main/resources/mapper/ProfilePoliceMapper.xml @@ -18,7 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" FROM sup_police p LEFT JOIN sup_depart d ON p.org_id = d.id - LEFT JOIN sup_depart d1 ON d.pid = d1.id and d1.level = 2 + LEFT JOIN sup_depart d1 ON d.pid = d1.id and d1.level >= 2 LEFT JOIN negative_blame nb ON p.id_code = nb.blameIdCode LEFT JOIN negative n ON nb.negativeId = n.id AND n.checkStatus IN ( '1', '2' )