|
@@ -18,12 +18,15 @@ import com.ruoyi.postCheck.domain.PostPlan;
|
18
|
18
|
import com.ruoyi.postCheck.domain.PostPlanInfo;
|
19
|
19
|
import com.ruoyi.postCheck.domain.homePage.PostTotalView;
|
20
|
20
|
import com.ruoyi.postCheck.domain.join.PostPlanJoinProblem;
|
|
21
|
+import com.ruoyi.postCheck.domain.problemStatistics.ProblemNumberBase;
|
|
22
|
+import com.ruoyi.postCheck.domain.tools.ProblemCategory;
|
21
|
23
|
import com.ruoyi.postCheck.mapper.PostAssessmentRatingMapper;
|
22
|
24
|
import com.ruoyi.postCheck.mapper.PostAssessmentRulesMapper;
|
23
|
25
|
import com.ruoyi.postCheck.mapper.PostListMapper;
|
24
|
26
|
import com.ruoyi.postCheck.mapper.PostPlanInfoMapper;
|
25
|
27
|
import com.ruoyi.postCheck.mapper.PostPlanMapper;
|
26
|
28
|
import com.ruoyi.postCheck.service.IPostPlanJoinProblemService;
|
|
29
|
+import io.swagger.annotations.ApiModelProperty;
|
27
|
30
|
import lombok.Data;
|
28
|
31
|
import org.apache.commons.lang3.StringUtils;
|
29
|
32
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -36,14 +39,6 @@ import org.springframework.transaction.annotation.Transactional;
|
36
|
39
|
import org.springframework.util.CollectionUtils;
|
37
|
40
|
|
38
|
41
|
|
39
|
|
-
|
40
|
|
-
|
41
|
|
-
|
42
|
|
-
|
43
|
|
-
|
44
|
|
-
|
45
|
|
-
|
46
|
|
-
|
47
|
42
|
/**
|
48
|
43
|
* 岗检问题表Service业务层处理
|
49
|
44
|
*
|
|
@@ -66,6 +61,7 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
|
66
|
61
|
private IPostPlanJoinProblemService postPlanJoinProblemService;
|
67
|
62
|
@Autowired
|
68
|
63
|
private PostListMapper postListMapper;
|
|
64
|
+
|
69
|
65
|
/**
|
70
|
66
|
* 查询岗检问题表
|
71
|
67
|
*
|
|
@@ -157,7 +153,7 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
|
157
|
153
|
PostPlanInfo postPlanInfo = postPlanInfoMapper.selectById(planInfoId);
|
158
|
154
|
PostPlan postPlan = postPlanMapper.selectById(postPlanInfo.getPostPlanId());
|
159
|
155
|
List<PostCheckedProblem> postCheckedProblems = postCheckedProblemMapper.selectList(Wrappers.<PostCheckedProblem>lambdaQuery()
|
160
|
|
- .eq(PostCheckedProblem::getCheckedDeptId,departmentId)
|
|
156
|
+ .eq(PostCheckedProblem::getCheckedDeptId, departmentId)
|
161
|
157
|
.between(PostCheckedProblem::getCreateTime, postPlan.getStartTime(), postPlan.getEndTime())
|
162
|
158
|
|
163
|
159
|
);
|
|
@@ -173,37 +169,37 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
|
173
|
169
|
Optional<PostAssessmentRules> first = postAssessmentRules.stream().filter(d -> d.getDutyType().equals(postCheckedProblem.getDutyType())).findFirst();
|
174
|
170
|
if (first.isPresent() && score.compareTo(new BigDecimal("0")) > 0) {
|
175
|
171
|
// 计算岗检得分
|
176
|
|
- if (postCheckedProblem.getProblemLevel().equals("1")){
|
|
172
|
+ if (postCheckedProblem.getProblemLevel().equals("1")) {
|
177
|
173
|
score = score.subtract(first.get().getProblemLevelOne());
|
178
|
|
- }else if(postCheckedProblem.getProblemLevel().equals("2")){
|
|
174
|
+ } else if (postCheckedProblem.getProblemLevel().equals("2")) {
|
179
|
175
|
score = score.subtract(first.get().getProblemLevelTwo());
|
180
|
176
|
}
|
181
|
177
|
}
|
182
|
178
|
}
|
183
|
179
|
|
184
|
180
|
// todo 公式计算
|
185
|
|
- if (postCheckedProblems.size()>0){
|
|
181
|
+ if (postCheckedProblems.size() > 0) {
|
186
|
182
|
BigDecimal bigDecimal = new BigDecimal("1");
|
187
|
183
|
List<PostPlanInfo> postPlanInfos = postPlanInfoMapper.selectList(Wrappers.<PostPlanInfo>lambdaQuery()
|
188
|
|
- .eq(PostPlanInfo::getPostPlanId,postPlan.getId())
|
|
184
|
+ .eq(PostPlanInfo::getPostPlanId, postPlan.getId())
|
189
|
185
|
);
|
190
|
|
- if (postPlanInfos.size() <= 0){
|
|
186
|
+ if (postPlanInfos.size() <= 0) {
|
191
|
187
|
score = new BigDecimal("0");
|
192
|
|
- }else{
|
|
188
|
+ } else {
|
193
|
189
|
BigDecimal divide = new BigDecimal(postCheckedProblems.size()).divide(new BigDecimal(postPlanInfos.size()).multiply(new BigDecimal("6")));
|
194
|
|
- if (divide.compareTo(new BigDecimal("0"))<=0 || divide.compareTo(new BigDecimal("1")) > 0){
|
|
190
|
+ if (divide.compareTo(new BigDecimal("0")) <= 0 || divide.compareTo(new BigDecimal("1")) > 0) {
|
195
|
191
|
score = new BigDecimal("0");
|
196
|
|
- }else{
|
|
192
|
+ } else {
|
197
|
193
|
score = bigDecimal.subtract(divide);
|
198
|
194
|
}
|
199
|
195
|
}
|
200
|
|
- }else{
|
|
196
|
+ } else {
|
201
|
197
|
score = new BigDecimal("0");
|
202
|
198
|
}
|
203
|
|
- postAssessmentRatingMapper.update(null,Wrappers.<PostAssessmentRating>lambdaUpdate()
|
204
|
|
- .set(PostAssessmentRating::getPositionScore,score)
|
205
|
|
- .eq(PostAssessmentRating::getDeptId,departmentId)
|
206
|
|
- .eq(PostAssessmentRating::getPlanId,postPlan.getId())
|
|
199
|
+ postAssessmentRatingMapper.update(null, Wrappers.<PostAssessmentRating>lambdaUpdate()
|
|
200
|
+ .set(PostAssessmentRating::getPositionScore, score)
|
|
201
|
+ .eq(PostAssessmentRating::getDeptId, departmentId)
|
|
202
|
+ .eq(PostAssessmentRating::getPlanId, postPlan.getId())
|
207
|
203
|
);
|
208
|
204
|
}
|
209
|
205
|
|
|
@@ -502,5 +498,78 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
|
502
|
498
|
postTotalView.setUncheckedPostCount(uncheckedPostCount);
|
503
|
499
|
return postTotalView;
|
504
|
500
|
}
|
|
501
|
+
|
|
502
|
+ /**
|
|
503
|
+ * 按问题属性分组统计问题类别
|
|
504
|
+ *
|
|
505
|
+ * @return
|
|
506
|
+ */
|
|
507
|
+ @Override
|
|
508
|
+ public List<ProblemCategory> problemCategoryByAttribute() {
|
|
509
|
+// @ApiModelProperty("职责权限问题")
|
|
510
|
+// private Integer problemCategoryOne;
|
|
511
|
+// @ApiModelProperty("工作内容问题")
|
|
512
|
+// private Integer problemCategoryTwo;
|
|
513
|
+// @ApiModelProperty("工作标准问题")
|
|
514
|
+// private Integer problemCategoryThree;
|
|
515
|
+// @ApiModelProperty("考核奖励问题")
|
|
516
|
+// private Integer problemCategoryFour;
|
|
517
|
+// @ApiModelProperty("任职资格问题")
|
|
518
|
+// private Integer problemCategoryFive;
|
|
519
|
+// @ApiModelProperty("其他")
|
|
520
|
+// private Integer problemCategorySix;
|
|
521
|
+// @ApiModelProperty("总数量")
|
|
522
|
+// private Integer problemTotal;
|
|
523
|
+
|
|
524
|
+ List<ProblemCategory> list = postCheckedProblemMapper.problemCategoryByAttribute();
|
|
525
|
+ ProblemCategory totalData = new ProblemCategory();
|
|
526
|
+ totalData.setProblemAttribute(999);
|
|
527
|
+ totalData.setProblemAttributeView("总计");
|
|
528
|
+ int problemCategoryOne = 0;
|
|
529
|
+ int problemCategoryTwo = 0;
|
|
530
|
+ int problemCategoryThree = 0;
|
|
531
|
+ int problemCategoryFour = 0;
|
|
532
|
+ int problemCategoryFive = 0;
|
|
533
|
+ int problemCategorySix = 0;
|
|
534
|
+ for (ProblemCategory data : list) {
|
|
535
|
+// Integer problemAttribute = data.getProblemAttribute();
|
|
536
|
+// switch (problemAttribute) {
|
|
537
|
+// case 1: {
|
|
538
|
+// setProblemAttributeView("完整问题");
|
|
539
|
+//
|
|
540
|
+// break;
|
|
541
|
+// }
|
|
542
|
+// case 2: {
|
|
543
|
+// setProblemAttributeView("有效性问题");
|
|
544
|
+//
|
|
545
|
+// break;
|
|
546
|
+// }
|
|
547
|
+// case 3: {
|
|
548
|
+// setProblemAttributeView("适宜性问题");
|
|
549
|
+//
|
|
550
|
+// break;
|
|
551
|
+// }
|
|
552
|
+//
|
|
553
|
+// default:
|
|
554
|
+// setProblemAttributeView("Other");
|
|
555
|
+// break;
|
|
556
|
+// }
|
|
557
|
+
|
|
558
|
+ problemCategoryOne += data.getProblemCategoryOne();
|
|
559
|
+ problemCategoryTwo += data.getProblemCategoryTwo();
|
|
560
|
+ problemCategoryThree += data.getProblemCategoryThree();
|
|
561
|
+ problemCategoryFour += data.getProblemCategoryFour();
|
|
562
|
+ problemCategoryFive += data.getProblemCategoryFive();
|
|
563
|
+ problemCategorySix += data.getProblemCategorySix();
|
|
564
|
+ }
|
|
565
|
+ totalData.setProblemCategoryOne(problemCategoryOne);
|
|
566
|
+ totalData.setProblemCategoryTwo(problemCategoryTwo);
|
|
567
|
+ totalData.setProblemCategoryThree(problemCategoryThree);
|
|
568
|
+ totalData.setProblemCategoryFour(problemCategoryFour);
|
|
569
|
+ totalData.setProblemCategoryFive(problemCategoryFive);
|
|
570
|
+ totalData.setProblemCategorySix(problemCategorySix);
|
|
571
|
+ list.add(totalData);
|
|
572
|
+ return list;
|
|
573
|
+ }
|
505
|
574
|
}
|
506
|
575
|
|