|
|
|
|
@ -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<BusinessPolice>() |
|
|
|
|
.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<String> negativeIds = negativeBlameService.list(new LambdaQueryWrapper<NegativeBlame>().eq(NegativeBlame::getBlameIdCode, idCode)).stream().map(NegativeBlame::getNegativeId).collect(Collectors.toSet()); |
|
|
|
|
@ -89,7 +92,8 @@ public class ProfilePoliceController {
|
|
|
|
|
int zfbaBusinessSize = businessPoliceService.list(new LambdaQueryWrapper<BusinessPolice>() |
|
|
|
|
.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<Negative>() |
|
|
|
|
.between(Negative::getCrtTime, beginTime, endTime) |
|
|
|
|
@ -100,16 +104,17 @@ public class ProfilePoliceController {
|
|
|
|
|
|
|
|
|
|
List<Negative> list = negativeIds.isEmpty() ? new ArrayList<>() : negativeService.list(new LambdaQueryWrapper<Negative>() |
|
|
|
|
.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<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(); |
|
|
|
|
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(); |
|
|
|
|
profilePolice.setProblemSourcesList(problemSourcesList); |
|
|
|
|
// 业务类型占比
|
|
|
|
|
Map<String, List<Negative>> businessTypeGroup = list.stream().collect(Collectors.groupingBy(Negative::getBusinessTypeCode)); |
|
|
|
|
List<PieItem> businessTypeList = businessTypeGroup.keySet().stream().map(key -> new PieItem(BusinessTypeEnum.get(key).getLabel(), businessTypeGroup.get(key).size())).toList(); |
|
|
|
|
List<PieItem> 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<BarItem> problemTypeBarList = profilePoliceMapper.selectProblemType(idCode, beginTime, endTime); |
|
|
|
|
|