|
@@ -1,8 +1,7 @@
|
1
|
1
|
package com.lyg.application.util;
|
2
|
2
|
|
3
|
3
|
|
4
|
|
-import cn.dev33.satoken.util.SaResult;
|
5
|
|
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
4
|
+import com.lyg.application.DTO.ErrorDto;
|
6
|
5
|
import com.lyg.application.entity.TaIncompatible;
|
7
|
6
|
import com.lyg.application.entity.TaRotation;
|
8
|
7
|
import com.lyg.application.mapper.TaIncompatibleMapper;
|
|
@@ -47,7 +46,7 @@ public class Rule {
|
47
|
46
|
params.put("passTime", passTime);
|
48
|
47
|
|
49
|
48
|
|
50
|
|
- Object result = siftRule(params);
|
|
49
|
+ List<ErrorDto> result = siftRule(params);
|
51
|
50
|
|
52
|
51
|
return result;
|
53
|
52
|
}
|
|
@@ -55,41 +54,21 @@ public class Rule {
|
55
|
54
|
}
|
56
|
55
|
|
57
|
56
|
|
58
|
|
- public Object siftRule(Map<String, String> params) {
|
59
|
|
- String oldOrgCode = params.get("oldOrgCode");
|
60
|
|
- String newOrgCode = params.get("newOrgCode");
|
|
57
|
+ public List<ErrorDto> siftRule(Map<String, String> params) {
|
61
|
58
|
String primaryPost = params.get("primaryPost");
|
62
|
59
|
String targetPost = params.get("targetPost");
|
63
|
|
- String passTime = params.get("passTime");
|
64
|
60
|
|
65
|
|
- //普通规则
|
66
|
|
- if (oldOrgCode.equals(newOrgCode)) {
|
67
|
|
- List<TaIncompatible> taIncompatibleList = regularRules(primaryPost, targetPost);
|
|
61
|
+ List<TaRotation> repelList = getMonthRules(params);
|
68
|
62
|
|
69
|
|
-// List<TaIncompatible> taIncompatibleList = taIncompatibleService.getRegularRules(, );
|
|
63
|
+ List<TaIncompatible> taIncompatibleList = regularRules(primaryPost, targetPost);
|
70
|
64
|
|
71
|
|
- if (taIncompatibleList.size() == 0) {
|
72
|
|
- return "普通规则:根据不相容设置这两个岗位是相容的";
|
73
|
|
- } else {
|
74
|
|
- return taIncompatibleList;
|
75
|
|
- }
|
|
65
|
+ RuleDetail ruleDetail=new RuleDetail();
|
76
|
66
|
|
77
|
|
- } else {
|
78
|
|
- params.put("oldOrgCode", oldOrgCode);
|
79
|
|
- params.put("newOrgCode", newOrgCode);
|
80
|
|
- params.put("primaryPost", primaryPost);
|
81
|
|
- params.put("targetPost", targetPost);
|
82
|
|
- params.put("passTime", passTime);
|
83
|
|
- //三个月规则
|
84
|
|
- List<TaRotation> repelList = getMonthRules(params);
|
85
|
|
-// List<TaRotation> repelList = taIncompatibleService.getMonthRules(params);
|
86
|
|
- if (repelList.size() == 0) {
|
87
|
|
- return "三个月规则: 这是两个岗位是相容的";
|
88
|
|
- } else {
|
89
|
|
- return repelList;
|
90
|
|
- }
|
|
67
|
+ List<ErrorDto> result = ruleDetail.planRuleType(taIncompatibleList,repelList);
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+ return result;
|
91
|
71
|
|
92
|
|
- }
|
93
|
72
|
|
94
|
73
|
}
|
95
|
74
|
|
|
@@ -111,7 +90,7 @@ public class Rule {
|
111
|
90
|
LocalDate newDate = LocalDate.parse(passTime, formatter).minusMonths(3);
|
112
|
91
|
|
113
|
92
|
List<String> oldPostList = taIncompatibleMapper.getMonthRulesPrimary(primaryPost, Constants.MONTH_RULE);
|
114
|
|
- List<String> newPostList = taIncompatibleMapper.getMonthRulesTarget(targetPost, Constants.MONTH_RULE);
|
|
93
|
+ List<String> newPostList = taIncompatibleMapper.getMonthRulesPrimary(targetPost, Constants.MONTH_RULE);
|
115
|
94
|
|
116
|
95
|
if (oldPostList.size() == 0 && newPostList.size() == 0) {
|
117
|
96
|
return repelList;
|
|
@@ -122,8 +101,8 @@ public class Rule {
|
122
|
101
|
List<String> targetList = oldPostList;//目标岗位+原来不相容岗位
|
123
|
102
|
targetList.add(targetPost);
|
124
|
103
|
|
125
|
|
- // 拿到数据 不相容轮岗数据
|
126
|
|
- repelList = taRotationMapper.selectRepel(orgList, targetList, newDate);
|
|
104
|
+ //拿到数据 不相容轮岗数据
|
|
105
|
+ repelList = taRotationMapper.selectRepel(orgList, targetList, newDate,params);
|
127
|
106
|
|
128
|
107
|
return repelList;
|
129
|
108
|
}
|