Browse Source

fiex:人员抽检修复

master
pengwei 1 month ago
parent
commit
65d016b839
  1. 22
      src/main/java/com/biutag/supervision/controller/sensitiveperception/ProfileDepartController.java

22
src/main/java/com/biutag/supervision/controller/sensitiveperception/ProfileDepartController.java

@ -19,6 +19,7 @@ import com.biutag.supervision.pojo.model.DepartNegativeModel;
import com.biutag.supervision.pojo.param.DepartNegativeQueryParam; import com.biutag.supervision.pojo.param.DepartNegativeQueryParam;
import com.biutag.supervision.pojo.vo.NegativeProfile; import com.biutag.supervision.pojo.vo.NegativeProfile;
import com.biutag.supervision.service.*; import com.biutag.supervision.service.*;
import dm.jdbc.util.StringUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
@ -151,6 +152,8 @@ public class ProfileDepartController {
profileDepart.setProblemTypeList(problemTypeList); profileDepart.setProblemTypeList(problemTypeList);
// 个人问题排名 // 个人问题排名
List<NegativeBlame> blames = blameService.list(new LambdaQueryWrapper<NegativeBlame>().in(NegativeBlame::getNegativeId, negativeIds).eq(NegativeBlame::getType, BlameType.personal.name())); List<NegativeBlame> blames = blameService.list(new LambdaQueryWrapper<NegativeBlame>().in(NegativeBlame::getNegativeId, negativeIds).eq(NegativeBlame::getType, BlameType.personal.name()));
blames= blames.stream().filter(s-> StringUtil.isNotEmpty(s.getBlameEmpNo())).toList();
if(CollectionUtil.isNotEmpty(blames)){
Map<String, List<NegativeBlame>> policeGroup = blames.stream().collect(Collectors.groupingBy(NegativeBlame::getBlameEmpNo)); Map<String, List<NegativeBlame>> policeGroup = blames.stream().collect(Collectors.groupingBy(NegativeBlame::getBlameEmpNo));
List<BarItem> policeBarList = policeGroup.keySet().stream().map(key -> { List<BarItem> policeBarList = policeGroup.keySet().stream().map(key -> {
List<NegativeBlame> list1 = policeGroup.get(key); List<NegativeBlame> list1 = policeGroup.get(key);
@ -166,17 +169,30 @@ public class ProfileDepartController {
return new BarItem(name, BigDecimal.valueOf(list1.size())); return new BarItem(name, BigDecimal.valueOf(list1.size()));
}).sorted(Comparator.comparing(BarItem::getValue).reversed()).toList(); }).sorted(Comparator.comparing(BarItem::getValue).reversed()).toList();
profileDepart.setPoliceLeadBarList(policeLeadBarList); profileDepart.setPoliceLeadBarList(policeLeadBarList);
}else{
profileDepart.setPoliceBarList(new ArrayList<>());
profileDepart.setPoliceLeadBarList(new ArrayList<>());
}
if(CollectionUtil.isNotEmpty(negativeProblemRelations)){
// 突出问题排名 // 突出问题排名
Map<String, List<NegativeProblemRelation>> collect = negativeProblemRelations.stream().collect(Collectors.groupingBy(item -> item.getOneLevelContent() + " / " + item.getTwoLevelContent() + " / " + item.getThreeLevelContent())); Map<String, List<NegativeProblemRelation>> collect = negativeProblemRelations.stream().collect(Collectors.groupingBy(item -> item.getOneLevelContent() + " / " + item.getTwoLevelContent() + " / " + item.getThreeLevelContent()));
List<BarItem> problemTypeBarList = collect.keySet().stream().map(key -> new BarItem(key, new BigDecimal(collect.get(key).size()))).sorted(Comparator.comparing(BarItem::getValue).reversed()).toList(); List<BarItem> problemTypeBarList = collect.keySet().stream().map(key -> new BarItem(key, new BigDecimal(collect.get(key).size()))).sorted(Comparator.comparing(BarItem::getValue).reversed()).toList();
profileDepart.setProblemTypeBarList(problemTypeBarList); profileDepart.setProblemTypeBarList(problemTypeBarList);
}else{
profileDepart.setProblemTypeBarList(new ArrayList<>());
}
//List<Object> result = negativeScoreService.calculateDepartScore(beginTime, endTime, departId);
//List<Object> result = negativeScoreService.calculateDepartScore(beginTime, endTime, departId);
if(CollectionUtil.isNotEmpty(list)){
profileDepart.setScore(BigDecimal.valueOf(list.stream().mapToDouble(NegativeScoreDepart::getScore).sum())); profileDepart.setScore(BigDecimal.valueOf(list.stream().mapToDouble(NegativeScoreDepart::getScore).sum()));
}
// profileDepart.setExpression(result.get(1).toString()); // profileDepart.setExpression(result.get(1).toString());
// profileDepart.setRemarks(result.get(2).toString()); // profileDepart.setRemarks(result.get(2).toString());
if(CollectionUtil.isNotEmpty(negatives)){
List<NegativeProfile> negativeProfiles = negatives.stream().map(item -> { List<NegativeProfile> negativeProfiles = negatives.stream().map(item -> {
NegativeProfile negativeProfile = new NegativeProfile(); NegativeProfile negativeProfile = new NegativeProfile();
BeanUtil.copyProperties(item, negativeProfile); BeanUtil.copyProperties(item, negativeProfile);
@ -186,6 +202,10 @@ public class ProfileDepartController {
return negativeProfile; return negativeProfile;
}).toList(); }).toList();
profileDepart.setNegatives(negativeProfiles); profileDepart.setNegatives(negativeProfiles);
}else{
profileDepart.setNegatives(new ArrayList<>());
}
return Result.success(profileDepart); return Result.success(profileDepart);
} }

Loading…
Cancel
Save