|
@@ -2,6 +2,7 @@ package com.ruoyi.postCheck.service.impl;
|
2
|
2
|
|
3
|
3
|
import java.math.BigDecimal;
|
4
|
4
|
import java.math.RoundingMode;
|
|
5
|
+import java.text.SimpleDateFormat;
|
5
|
6
|
import java.util.ArrayList;
|
6
|
7
|
import java.util.Date;
|
7
|
8
|
import java.util.HashMap;
|
|
@@ -25,9 +26,11 @@ import com.ruoyi.postCheck.domain.homePage.PostCheckedProblemView;
|
25
|
26
|
import com.ruoyi.postCheck.domain.homePage.PostCheckedUnCheckedView;
|
26
|
27
|
import com.ruoyi.postCheck.domain.homePage.PostTotalView;
|
27
|
28
|
import com.ruoyi.postCheck.domain.join.PostPlanJoinProblem;
|
|
29
|
+import com.ruoyi.postCheck.domain.problemStatistics.CheckedProblemDeptDetaailView;
|
28
|
30
|
import com.ruoyi.postCheck.domain.problemStatistics.CoverageRateView;
|
29
|
31
|
import com.ruoyi.postCheck.domain.problemStatistics.DutyTypeProblemStatisticsView;
|
30
|
32
|
import com.ruoyi.postCheck.domain.problemStatistics.FunctionDeptProblemContrastView;
|
|
33
|
+import com.ruoyi.postCheck.domain.problemStatistics.HistoryProblemNumberView;
|
31
|
34
|
import com.ruoyi.postCheck.domain.problemStatistics.ProblemAttributeCategoryView;
|
32
|
35
|
import com.ruoyi.postCheck.domain.problemStatistics.ProblemLevelView;
|
33
|
36
|
import com.ruoyi.postCheck.domain.tools.ProblemCategory;
|
|
@@ -49,6 +52,7 @@ import com.ruoyi.postCheck.service.IPostCheckedProblemService;
|
49
|
52
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
50
|
53
|
import org.springframework.transaction.annotation.Transactional;
|
51
|
54
|
import org.springframework.util.CollectionUtils;
|
|
55
|
+import org.springframework.web.context.request.FacesWebRequest;
|
52
|
56
|
|
53
|
57
|
|
54
|
58
|
|
|
@@ -743,16 +747,16 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
|
743
|
747
|
if (postCheckedProblems != null && postCheckedProblems.size() > 0) {
|
744
|
748
|
for (PostCheckedProblem postCheckedProblem : postCheckedProblems) {
|
745
|
749
|
problemTotal++;
|
746
|
|
- if (postCheckedProblem.getProblemAttribute() == 1){
|
|
750
|
+ if (postCheckedProblem.getProblemAttribute() == 1) {
|
747
|
751
|
problemComplete++;
|
748
|
752
|
}
|
749
|
|
- if (postCheckedProblem.getProblemAttribute() == 2){
|
|
753
|
+ if (postCheckedProblem.getProblemAttribute() == 2) {
|
750
|
754
|
problemEffective++;
|
751
|
755
|
}
|
752
|
|
- if (postCheckedProblem.getProblemAttribute() == 3){
|
|
756
|
+ if (postCheckedProblem.getProblemAttribute() == 3) {
|
753
|
757
|
problemSuitable++;
|
754
|
758
|
}
|
755
|
|
- if (postCheckedProblem.getProblemCategory() == null )
|
|
759
|
+ if (postCheckedProblem.getProblemCategory() == null)
|
756
|
760
|
continue;
|
757
|
761
|
if (postCheckedProblem.getProblemCategory().equals("1"))
|
758
|
762
|
problemCategoryOne++;
|
|
@@ -787,8 +791,8 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
|
787
|
791
|
// status = 40 状态:1-待指定整改人(问题录入完成时);2-待填写方案(部门管理员指定整改人后);3-方案填写完成;10-部门审核通过;11-部门审核驳回;20-专业部门人审核(非必填)通过;21-专业部门人审核驳回(非必填);30-整改人待上传实施(整改人上传实施图片);31-上传实施照片完成;40-复查部门人审核通过;41-复查部门人审核驳回
|
788
|
792
|
// is_rectification_completed = 1 整改情况-是否完成(1-Yes;2-No;)
|
789
|
793
|
List<Map<String, Object>> deptIdListByType = postAssessmentRatingOtherMapper.getDeptIdListByType(type);
|
790
|
|
- if (deptIdListByType == null && deptIdListByType.size() == 0){
|
791
|
|
- throw new IllegalArgumentException("查询职能部门个数为:0");
|
|
794
|
+ if (deptIdListByType == null || deptIdListByType.size() == 0) {
|
|
795
|
+ return new ArrayList<>();
|
792
|
796
|
}
|
793
|
797
|
List<String> deptIds = deptIdListByType.stream().map(d -> d.get("deptId").toString()).distinct().collect(Collectors.toList());
|
794
|
798
|
// 查询职能问题数量
|
|
@@ -796,10 +800,10 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
|
796
|
800
|
.in(PostCheckedProblem::getCheckedDeptId, deptIds)
|
797
|
801
|
);
|
798
|
802
|
List<CoverageRateView> list = new ArrayList<>();
|
799
|
|
- if (postCheckedProblems!=null && postCheckedProblems.size()>0){
|
|
803
|
+ if (postCheckedProblems != null && postCheckedProblems.size() > 0) {
|
800
|
804
|
CoverageRateView data = new CoverageRateView();
|
801
|
805
|
data.setProblemTotal(postCheckedProblems.size());
|
802
|
|
- List<PostCheckedProblem> collect = postCheckedProblems.stream().filter(d -> d.getIsRectificationCompleted().equals(1)).collect(Collectors.toList());
|
|
806
|
+ List<PostCheckedProblem> collect = postCheckedProblems.stream().filter(d -> d.getIsRectificationCompleted() != null && d.getIsRectificationCompleted().equals(1)).collect(Collectors.toList());
|
803
|
807
|
data.setProblemComplete(collect.size());
|
804
|
808
|
list.add(data);
|
805
|
809
|
}
|
|
@@ -809,8 +813,8 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
|
809
|
813
|
@Override
|
810
|
814
|
public List<DutyTypeProblemStatisticsView> dutyTypeProblemStatisticsView(Integer type) {
|
811
|
815
|
List<Map<String, Object>> deptIdListByType = postAssessmentRatingOtherMapper.getDeptIdListByType(type);
|
812
|
|
- if (deptIdListByType == null && deptIdListByType.size() == 0){
|
813
|
|
- throw new IllegalArgumentException("查询职能部门个数为:0");
|
|
816
|
+ if (deptIdListByType == null || deptIdListByType.size() == 0) {
|
|
817
|
+ return new ArrayList<>();
|
814
|
818
|
}
|
815
|
819
|
List<String> deptIds = deptIdListByType.stream().map(d -> d.get("deptId").toString()).distinct().collect(Collectors.toList());
|
816
|
820
|
// 查询职能问题数量
|
|
@@ -818,18 +822,18 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
|
818
|
822
|
.in(PostCheckedProblem::getCheckedDeptId, deptIds)
|
819
|
823
|
);
|
820
|
824
|
List<DutyTypeProblemStatisticsView> list = new ArrayList<>();
|
821
|
|
- if (postCheckedProblems!=null && postCheckedProblems.size()>0){
|
|
825
|
+ if (postCheckedProblems != null && postCheckedProblems.size() > 0) {
|
822
|
826
|
// @ApiModelProperty("业务职责")
|
823
|
|
- Integer dutyTypeOne = 0;
|
|
827
|
+ Integer dutyTypeOne = 0;
|
824
|
828
|
|
825
|
829
|
// @ApiModelProperty("党建及党风廉政")
|
826
|
|
- Integer dutyTypeTwo = 0;
|
|
830
|
+ Integer dutyTypeTwo = 0;
|
827
|
831
|
|
828
|
832
|
// @ApiModelProperty("安全环保职责")
|
829
|
|
- Integer dutyTypeThree = 0;
|
|
833
|
+ Integer dutyTypeThree = 0;
|
830
|
834
|
|
831
|
835
|
// @ApiModelProperty("合规保密职")
|
832
|
|
- Integer dutyTypeFour = 0;
|
|
836
|
+ Integer dutyTypeFour = 0;
|
833
|
837
|
for (PostCheckedProblem postCheckedProblem : postCheckedProblems) {
|
834
|
838
|
if (postCheckedProblem.getDutyType() == 1)
|
835
|
839
|
dutyTypeOne++;
|
|
@@ -858,8 +862,8 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
|
858
|
862
|
// select * from "public"."post_checked_problem";
|
859
|
863
|
// group by problem_level 问题等级(一般、重要)
|
860
|
864
|
List<Map<String, Object>> deptIdListByType = postAssessmentRatingOtherMapper.getDeptIdListByType(type);
|
861
|
|
- if (deptIdListByType == null && deptIdListByType.size() == 0){
|
862
|
|
- throw new IllegalArgumentException("查询职能部门个数为:0");
|
|
865
|
+ if (deptIdListByType == null || deptIdListByType.size() == 0) {
|
|
866
|
+ return new ArrayList<>();
|
863
|
867
|
}
|
864
|
868
|
List<String> deptIds = deptIdListByType.stream().map(d -> d.get("deptId").toString()).distinct().collect(Collectors.toList());
|
865
|
869
|
// 查询职能问题数量
|
|
@@ -867,7 +871,7 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
|
867
|
871
|
.in(PostCheckedProblem::getCheckedDeptId, deptIds)
|
868
|
872
|
);
|
869
|
873
|
List<ProblemLevelView> list = new ArrayList<>();
|
870
|
|
- if (postCheckedProblems!=null && postCheckedProblems.size()>0){
|
|
874
|
+ if (postCheckedProblems != null && postCheckedProblems.size() > 0) {
|
871
|
875
|
List<PostCheckedProblem> collect = postCheckedProblems.stream().filter(d -> d.getProblemLevel() != null && d.getProblemLevel().equals("2")).collect(Collectors.toList());
|
872
|
876
|
ProblemLevelView data = new ProblemLevelView();
|
873
|
877
|
data.setProblemLeveOne(collect.size());
|
|
@@ -879,25 +883,81 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
|
879
|
883
|
}
|
880
|
884
|
|
881
|
885
|
@Override
|
882
|
|
- public List<ProblemAttributeCategoryView> problemAttributeCategoryView(Integer type) {
|
|
886
|
+ public List<ProblemAttributeCategoryView> problemAttributeCategoryView(Integer type) {
|
883
|
887
|
// 查询问题表
|
884
|
888
|
// select * from "public"."post_checked_problem";
|
885
|
889
|
// GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
|
886
|
890
|
// GROUP BY problem_category -- 问题类别(职责权限问题、工作内容问题、工作标准问题、考核奖励问题、任职资格问题、其他)
|
887
|
891
|
|
888
|
892
|
List<Map<String, Object>> deptIdListByType = postAssessmentRatingOtherMapper.getDeptIdListByType(type);
|
889
|
|
- if (deptIdListByType == null && deptIdListByType.size() == 0){
|
890
|
|
- throw new IllegalArgumentException("查询职能部门个数为:0");
|
|
893
|
+ if (deptIdListByType == null || deptIdListByType.size() == 0) {
|
|
894
|
+ return new ArrayList<>();
|
891
|
895
|
}
|
892
|
896
|
List<String> deptIds = deptIdListByType.stream().map(d -> d.get("deptId").toString()).distinct().collect(Collectors.toList());
|
893
|
897
|
// 查询职能问题数量
|
894
|
898
|
List<PostCheckedProblem> postCheckedProblems = postCheckedProblemMapper.selectList(Wrappers.<PostCheckedProblem>lambdaQuery()
|
895
|
899
|
.in(PostCheckedProblem::getCheckedDeptId, deptIds)
|
896
|
900
|
);
|
|
901
|
+ List<ProblemAttributeCategoryView> list = new ArrayList<>();
|
|
902
|
+ if (postCheckedProblems != null && postCheckedProblems.size() > 0) {
|
|
903
|
+ Map<String, List<PostCheckedProblem>> collect = postCheckedProblems.stream().collect(Collectors.groupingBy(PostCheckedProblem::getProblemCategory));
|
|
904
|
+// 问题类别(职责权限问题、工作内容问题、工作标准问题、考核奖励问题、任职资格问题、其他)
|
|
905
|
+ for (Map.Entry<String, List<PostCheckedProblem>> stringListEntry : collect.entrySet()) {
|
|
906
|
+ List<PostCheckedProblem> value = stringListEntry.getValue();
|
|
907
|
+ if (value != null && value.size() > 0) {
|
|
908
|
+
|
|
909
|
+ ProblemAttributeCategoryView data = new ProblemAttributeCategoryView();
|
|
910
|
+ if (stringListEntry.getKey().equals("1")) {
|
|
911
|
+ data.setProblemCategoryType(1);
|
|
912
|
+ data.setProblemCategoryTypeView("职责权限问题");
|
|
913
|
+ }
|
|
914
|
+ if (stringListEntry.getKey().equals("2")) {
|
|
915
|
+ data.setProblemCategoryType(2);
|
|
916
|
+ data.setProblemCategoryTypeView("工作内容问题");
|
|
917
|
+ }
|
|
918
|
+ if (stringListEntry.getKey().equals("3")) {
|
|
919
|
+ data.setProblemCategoryType(3);
|
|
920
|
+ data.setProblemCategoryTypeView("工作标准问题");
|
|
921
|
+ }
|
|
922
|
+ if (stringListEntry.getKey().equals("4")) {
|
|
923
|
+ data.setProblemCategoryType(4);
|
|
924
|
+ data.setProblemCategoryTypeView("考核奖励问题");
|
|
925
|
+ }
|
|
926
|
+ if (stringListEntry.getKey().equals("5")) {
|
|
927
|
+ data.setProblemCategoryType(5);
|
|
928
|
+ data.setProblemCategoryTypeView("任职资格问题");
|
|
929
|
+ }
|
|
930
|
+ if (stringListEntry.getKey().equals("6")) {
|
|
931
|
+ data.setProblemCategoryType(6);
|
|
932
|
+ data.setProblemCategoryTypeView("其他");
|
|
933
|
+ }
|
|
934
|
+// @ApiModelProperty("完整性数量")
|
|
935
|
+ int problemComplete = 0;
|
|
936
|
+// @ApiModelProperty("适宜性数量")
|
|
937
|
+ int problemSuitable = 0;
|
|
938
|
+// @ApiModelProperty("有效性数量")
|
|
939
|
+ int problemEffective = 0;
|
|
940
|
+
|
|
941
|
+ for (PostCheckedProblem postCheckedProblem : value) {
|
|
942
|
+ if (postCheckedProblem.getProblemAttribute() == 1) {
|
|
943
|
+ problemComplete++;
|
|
944
|
+ }
|
|
945
|
+ if (postCheckedProblem.getProblemAttribute() == 2) {
|
|
946
|
+ problemEffective++;
|
|
947
|
+ }
|
|
948
|
+ if (postCheckedProblem.getProblemAttribute() == 3) {
|
|
949
|
+ problemSuitable++;
|
|
950
|
+ }
|
|
951
|
+ }
|
|
952
|
+ data.setProblemComplete(problemComplete);// 完整性数量
|
|
953
|
+ data.setProblemSuitable(problemSuitable);// 适宜性数量
|
|
954
|
+ data.setProblemEffective(problemEffective);// 有效性数量
|
|
955
|
+ list.add(data);
|
|
956
|
+ }
|
|
957
|
+ }
|
|
958
|
+ }
|
897
|
959
|
|
898
|
960
|
|
899
|
|
- List<ProblemAttributeCategoryView> list = new ArrayList<>();
|
900
|
|
- ProblemAttributeCategoryView data = new ProblemAttributeCategoryView();
|
901
|
961
|
// data.set完成性
|
902
|
962
|
// data.set适宜性
|
903
|
963
|
// data.set有效性
|
|
@@ -908,7 +968,192 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
|
908
|
968
|
// data.set任职资格
|
909
|
969
|
// data.set其他
|
910
|
970
|
|
911
|
|
- list.add(data);
|
|
971
|
+
|
|
972
|
+ return list;
|
|
973
|
+ }
|
|
974
|
+
|
|
975
|
+ @Override
|
|
976
|
+ public List<HistoryProblemNumberView> historyProblemNumberView(Integer type) {
|
|
977
|
+ // 查询问题表
|
|
978
|
+// select * from "public"."post_checked_problem";
|
|
979
|
+// GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
|
|
980
|
+// GROUP BY problem_category -- 问题类别(职责权限问题、工作内容问题、工作标准问题、考核奖励问题、任职资格问题、其他)
|
|
981
|
+
|
|
982
|
+
|
|
983
|
+ List<Map<String, Object>> deptIdListByType = postAssessmentRatingOtherMapper.getDeptIdListByType(type);
|
|
984
|
+ if (deptIdListByType == null || deptIdListByType.size() == 0) {
|
|
985
|
+ return new ArrayList<>();
|
|
986
|
+ }
|
|
987
|
+ List<String> deptIds = deptIdListByType.stream().map(d -> d.get("deptId").toString()).distinct().collect(Collectors.toList());
|
|
988
|
+ // 查询职能问题数量
|
|
989
|
+ List<PostCheckedProblem> postCheckedProblems = postCheckedProblemMapper.selectList(Wrappers.<PostCheckedProblem>lambdaQuery()
|
|
990
|
+ .in(PostCheckedProblem::getCheckedDeptId, deptIds)
|
|
991
|
+ );
|
|
992
|
+ List<HistoryProblemNumberView> list = new ArrayList<>();
|
|
993
|
+ if (postCheckedProblems != null && postCheckedProblems.size() > 0) {
|
|
994
|
+ SimpleDateFormat adf = new SimpleDateFormat("yyyy-MM-dd");
|
|
995
|
+ Map<String, List<PostCheckedProblem>> collect = postCheckedProblems.stream().collect(Collectors.groupingBy(d -> adf.format(d.getCreateTime()), Collectors.toList()));
|
|
996
|
+ HistoryProblemNumberView data = new HistoryProblemNumberView();
|
|
997
|
+ data.setCheckYear(new Date());
|
|
998
|
+ // @ApiModelProperty("总数量")
|
|
999
|
+ int problemTotal = 0;
|
|
1000
|
+// @ApiModelProperty("完整性数量")
|
|
1001
|
+ int problemComplete = 0;
|
|
1002
|
+// @ApiModelProperty("适宜性数量")
|
|
1003
|
+ int problemSuitable = 0;
|
|
1004
|
+// @ApiModelProperty("有效性数量")
|
|
1005
|
+ int problemEffective = 0;
|
|
1006
|
+// @ApiModelProperty("职责权限问题")
|
|
1007
|
+ int problemCategoryOne = 0;
|
|
1008
|
+// @ApiModelProperty("工作内容问题")
|
|
1009
|
+ int problemCategoryTwo = 0;
|
|
1010
|
+// @ApiModelProperty("工作标准问题")
|
|
1011
|
+ int problemCategoryThree = 0;
|
|
1012
|
+// @ApiModelProperty("考核奖励问题")
|
|
1013
|
+ int problemCategoryFour = 0;
|
|
1014
|
+// @ApiModelProperty("任职资格问题")
|
|
1015
|
+ int problemCategoryFive = 0;
|
|
1016
|
+// @ApiModelProperty("其他")
|
|
1017
|
+ int problemCategorySix = 0;
|
|
1018
|
+ for (Map.Entry<String, List<PostCheckedProblem>> stringListEntry : collect.entrySet()) {
|
|
1019
|
+ List<PostCheckedProblem> value = stringListEntry.getValue();
|
|
1020
|
+ if (value != null && value.size() > 0) {
|
|
1021
|
+ for (PostCheckedProblem postCheckedProblem : value) {
|
|
1022
|
+ problemTotal++;
|
|
1023
|
+ if (postCheckedProblem.getProblemAttribute() == 1) {
|
|
1024
|
+ problemComplete++;
|
|
1025
|
+ }
|
|
1026
|
+ if (postCheckedProblem.getProblemAttribute() == 2) {
|
|
1027
|
+ problemEffective++;
|
|
1028
|
+ }
|
|
1029
|
+ if (postCheckedProblem.getProblemAttribute() == 3) {
|
|
1030
|
+ problemSuitable++;
|
|
1031
|
+ }
|
|
1032
|
+ if (postCheckedProblem.getProblemCategory() == null)
|
|
1033
|
+ continue;
|
|
1034
|
+ if (postCheckedProblem.getProblemCategory().equals("1"))
|
|
1035
|
+ problemCategoryOne++;
|
|
1036
|
+ if (postCheckedProblem.getProblemCategory().equals("2"))
|
|
1037
|
+ problemCategoryTwo++;
|
|
1038
|
+ if (postCheckedProblem.getProblemCategory().equals("3"))
|
|
1039
|
+ problemCategoryThree++;
|
|
1040
|
+ if (postCheckedProblem.getProblemCategory().equals("4"))
|
|
1041
|
+ problemCategoryFour++;
|
|
1042
|
+ if (postCheckedProblem.getProblemCategory().equals("5"))
|
|
1043
|
+ problemCategoryFive++;
|
|
1044
|
+ if (postCheckedProblem.getProblemCategory().equals("6"))
|
|
1045
|
+ problemCategorySix++;
|
|
1046
|
+ }
|
|
1047
|
+ }
|
|
1048
|
+ }
|
|
1049
|
+ data.setProblemTotal(problemTotal);
|
|
1050
|
+ data.setProblemComplete(problemComplete);
|
|
1051
|
+ data.setProblemSuitable(problemSuitable);
|
|
1052
|
+ data.setProblemEffective(problemEffective);
|
|
1053
|
+ data.setProblemCategoryOne(problemCategoryOne);
|
|
1054
|
+ data.setProblemCategoryTwo(problemCategoryTwo);
|
|
1055
|
+ data.setProblemCategoryThree(problemCategoryThree);
|
|
1056
|
+ data.setProblemCategoryFour(problemCategoryFour);
|
|
1057
|
+ data.setProblemCategoryFive(problemCategoryFive);
|
|
1058
|
+ data.setProblemCategorySix(problemCategorySix);
|
|
1059
|
+ list.add(data);
|
|
1060
|
+ }
|
|
1061
|
+ return list;
|
|
1062
|
+ }
|
|
1063
|
+
|
|
1064
|
+ @Override
|
|
1065
|
+ public List<CheckedProblemDeptDetaailView> deptDetaailView(Integer type) {
|
|
1066
|
+ List<Map<String, Object>> deptIdListByType = postAssessmentRatingOtherMapper.getDeptIdListByType(type);
|
|
1067
|
+ if (deptIdListByType == null || deptIdListByType.size() == 0) {
|
|
1068
|
+ return new ArrayList<>();
|
|
1069
|
+ }
|
|
1070
|
+ List<String> deptIds = deptIdListByType.stream().map(d -> d.get("deptId").toString()).distinct().collect(Collectors.toList());
|
|
1071
|
+ // 查询职能问题数量
|
|
1072
|
+ List<PostCheckedProblem> postCheckedProblems = postCheckedProblemMapper.selectList(Wrappers.<PostCheckedProblem>lambdaQuery()
|
|
1073
|
+ .in(PostCheckedProblem::getCheckedDeptId, deptIds)
|
|
1074
|
+ );
|
|
1075
|
+
|
|
1076
|
+ List<CheckedProblemDeptDetaailView> list = new ArrayList<>();
|
|
1077
|
+
|
|
1078
|
+ //TODO 第一步:得到各个部门ID、部门名称、问题总数量、重要问题数量、一般问题数量、统计时间
|
|
1079
|
+ //TODO 第二步:得到4个职责类别的问题数量及整改完成数量(1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;)
|
|
1080
|
+ //TODO 第三步:设置部门的整改率:遍历职责类别计算整改率
|
|
1081
|
+ if (postCheckedProblems != null && postCheckedProblems.size() > 0) {
|
|
1082
|
+ Map<Long, List<PostCheckedProblem>> deptMap = postCheckedProblems.stream().collect(Collectors.groupingBy(PostCheckedProblem::getCheckedDeptId));
|
|
1083
|
+ for (Map.Entry<Long, List<PostCheckedProblem>> longListEntry : deptMap.entrySet()) {
|
|
1084
|
+ Long key = longListEntry.getKey();
|
|
1085
|
+ List<PostCheckedProblem> value = longListEntry.getValue();
|
|
1086
|
+ CheckedProblemDeptDetaailView data1 = new CheckedProblemDeptDetaailView();
|
|
1087
|
+ data1.setDeptId(key); //部门ID
|
|
1088
|
+ data1.setDeptName(postAssessmentRatingMapper.getSysDeptName(key));// 部门名称
|
|
1089
|
+ int problemTotal = 0;
|
|
1090
|
+// @ApiModelProperty("一般")
|
|
1091
|
+ Integer problemLeveOne = 0;
|
|
1092
|
+// @ApiModelProperty("重要")
|
|
1093
|
+ Integer problemLeveTwo = 0;
|
|
1094
|
+ for (PostCheckedProblem postCheckedProblem : value) {
|
|
1095
|
+ problemTotal++;
|
|
1096
|
+ if (postCheckedProblem.getProblemLevel().equals("1")){
|
|
1097
|
+ problemLeveOne++;
|
|
1098
|
+ }
|
|
1099
|
+ if (postCheckedProblem.getProblemLevel().equals("2")){
|
|
1100
|
+ problemLeveTwo++;
|
|
1101
|
+ }
|
|
1102
|
+ }
|
|
1103
|
+ data1.setProblemTotal(problemTotal); //问题数量
|
|
1104
|
+ data1.setProblemLeveTwo(problemLeveTwo); //重要问题
|
|
1105
|
+ data1.setProblemLeveOne(problemLeveOne); //一般问题
|
|
1106
|
+ Map<Integer, List<PostCheckedProblem>> dutyMap = value.stream().collect(Collectors.groupingBy(PostCheckedProblem::getDutyType));
|
|
1107
|
+
|
|
1108
|
+
|
|
1109
|
+ for (Map.Entry<Integer, List<PostCheckedProblem>> integerListEntry : dutyMap.entrySet()) {
|
|
1110
|
+ // @ApiModelProperty("完整性数量")
|
|
1111
|
+ int problemComplete = 0;
|
|
1112
|
+// @ApiModelProperty("适宜性数量")
|
|
1113
|
+ int problemSuitable = 0;
|
|
1114
|
+// @ApiModelProperty("有效性数量")
|
|
1115
|
+ int problemEffective = 0;
|
|
1116
|
+ Integer duty = integerListEntry.getKey();
|
|
1117
|
+ CheckedProblemDeptDetaailView.ProblemAttributeInner child1 = new CheckedProblemDeptDetaailView.ProblemAttributeInner();
|
|
1118
|
+ child1.setDutyType(duty);
|
|
1119
|
+ List<PostCheckedProblem> postCheckedProblemList = integerListEntry.getValue();
|
|
1120
|
+ for (PostCheckedProblem postCheckedProblem : postCheckedProblemList) {
|
|
1121
|
+ if (postCheckedProblem.getProblemAttribute() == 1) {
|
|
1122
|
+ problemComplete++;
|
|
1123
|
+ }
|
|
1124
|
+ if (postCheckedProblem.getProblemAttribute() == 2) {
|
|
1125
|
+ problemEffective++;
|
|
1126
|
+ }
|
|
1127
|
+ if (postCheckedProblem.getProblemAttribute() == 3) {
|
|
1128
|
+ problemSuitable++;
|
|
1129
|
+ }
|
|
1130
|
+ }
|
|
1131
|
+ child1.setProblemComplete(problemComplete);
|
|
1132
|
+ child1.setProblemEffective(problemEffective);
|
|
1133
|
+ child1.setProblemSuitable(problemSuitable);
|
|
1134
|
+ }
|
|
1135
|
+ list.add(data1);
|
|
1136
|
+ }
|
|
1137
|
+ }
|
|
1138
|
+
|
|
1139
|
+
|
|
1140
|
+// data1.setDeptId(1l); //部门ID
|
|
1141
|
+// data1.setDeptName("测试部门名称1");// 部门名称
|
|
1142
|
+// data1.setProblemTotal(10); //问题数量
|
|
1143
|
+// data1.setProblemLeveTwo(2); //重要问题
|
|
1144
|
+// data1.setProblemLeveOne(8); //一般问题
|
|
1145
|
+// data1.setStatisticsTime(new Date());// 统计时间
|
|
1146
|
+//
|
|
1147
|
+// List<CheckedProblemDeptDetaailView.ProblemAttributeInner> children1 = new ArrayList<>();
|
|
1148
|
+// CheckedProblemDeptDetaailView.ProblemAttributeInner child1 = new CheckedProblemDeptDetaailView.ProblemAttributeInner();
|
|
1149
|
+// child1.setProblemComplete(1); //child1.set完整性数量
|
|
1150
|
+// child1.setProblemSuitable(2); //child1.set适宜性数量
|
|
1151
|
+// child1.setProblemEffective(3);//child1.set有效性数量
|
|
1152
|
+// //children1.add(child1);
|
|
1153
|
+// //data1.setChildren(children1);
|
|
1154
|
+// data1.getChildren().add(child1);
|
|
1155
|
+
|
|
1156
|
+
|
912
|
1157
|
return null;
|
913
|
1158
|
}
|
914
|
1159
|
}
|