|
@@ -1,27 +1,39 @@
|
1
|
1
|
package com.ruoyi.postCheck.service.impl;
|
2
|
2
|
|
3
|
|
-import java.math.BigDecimal;
|
4
|
|
-import java.util.ArrayList;
|
5
|
|
-import java.util.Date;
|
6
|
|
-import java.util.List;
|
7
|
|
-
|
|
3
|
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|
4
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
5
|
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
8
|
6
|
import com.ruoyi.common.constant.PostAssessmentRatingOtherEnum;
|
9
|
|
-import com.ruoyi.common.utils.DateUtils;
|
10
|
7
|
import com.ruoyi.common.utils.SecurityUtils;
|
11
|
|
-import com.ruoyi.common.utils.spring.SpringUtils;
|
|
8
|
+import com.ruoyi.postCheck.domain.PostAssessmentRatingOther;
|
12
|
9
|
import com.ruoyi.postCheck.domain.PostAssessmentRatingOtherInfo;
|
|
10
|
+import com.ruoyi.postCheck.domain.PostAssessmentRules;
|
13
|
11
|
import com.ruoyi.postCheck.domain.tools.PostAssessmentRatingOtherInfoDept;
|
14
|
|
-import io.swagger.annotations.ApiImplicitParam;
|
15
|
|
-import io.swagger.annotations.ApiModelProperty;
|
16
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
17
|
|
-import org.springframework.stereotype.Service;
|
|
12
|
+import com.ruoyi.postCheck.mapper.PostAssessmentRatingMapper;
|
|
13
|
+import com.ruoyi.postCheck.mapper.PostAssessmentRatingOtherInfoMapper;
|
18
|
14
|
import com.ruoyi.postCheck.mapper.PostAssessmentRatingOtherMapper;
|
19
|
|
-import com.ruoyi.postCheck.domain.PostAssessmentRatingOther;
|
|
15
|
+import com.ruoyi.postCheck.mapper.PostAssessmentRulesMapper;
|
20
|
16
|
import com.ruoyi.postCheck.service.IPostAssessmentRatingOtherService;
|
21
|
|
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
22
|
|
-import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|
17
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
18
|
+import org.springframework.stereotype.Service;
|
23
|
19
|
import org.springframework.transaction.annotation.Transactional;
|
24
|
20
|
|
|
21
|
+import java.math.BigDecimal;
|
|
22
|
+import java.util.ArrayList;
|
|
23
|
+import java.util.Date;
|
|
24
|
+import java.util.List;
|
|
25
|
+import java.util.UUID;
|
|
26
|
+import java.util.stream.Collectors;
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
25
|
37
|
/**
|
26
|
38
|
* 打分表(职能互评生产日常)Service业务层处理
|
27
|
39
|
*
|
|
@@ -31,6 +43,12 @@ import org.springframework.transaction.annotation.Transactional;
|
31
|
43
|
@Service
|
32
|
44
|
public class PostAssessmentRatingOtherServiceImpl extends ServiceImpl<PostAssessmentRatingOtherMapper, PostAssessmentRatingOther> implements IPostAssessmentRatingOtherService {
|
33
|
45
|
@Autowired
|
|
46
|
+ private PostAssessmentRulesMapper postAssessmentRulesMapper;
|
|
47
|
+ @Autowired
|
|
48
|
+ private PostAssessmentRatingOtherInfoMapper postAssessmentRatingOtherInfoMapper;
|
|
49
|
+ @Autowired
|
|
50
|
+ private PostAssessmentRatingMapper postAssessmentRatingMapper;
|
|
51
|
+ @Autowired
|
34
|
52
|
private PostAssessmentRatingOtherMapper postAssessmentRatingOtherMapper;
|
35
|
53
|
|
36
|
54
|
/**
|
|
@@ -42,94 +60,45 @@ public class PostAssessmentRatingOtherServiceImpl extends ServiceImpl<PostAssess
|
42
|
60
|
@Override
|
43
|
61
|
public PostAssessmentRatingOther selectPostAssessmentRatingOtherById(Long id) {
|
44
|
62
|
PostAssessmentRatingOther data = postAssessmentRatingOtherMapper.selectPostAssessmentRatingOtherById(id);
|
45
|
|
-
|
46
|
|
- id = 123456789l;
|
47
|
|
- data = new PostAssessmentRatingOther();
|
48
|
|
-
|
49
|
|
-// PostAssessmentRatingOther data = new PostAssessmentRatingOther();
|
50
|
|
- data.setId(id);
|
51
|
|
- data.setType(PostAssessmentRatingOtherEnum.TYPE_ZN_HP.getValue());
|
52
|
|
- data.setBatchId("111111");
|
53
|
|
- data.setStatus(PostAssessmentRatingOtherEnum.STATUS_ING.getValue());//状态
|
54
|
|
- data.setStartTime(new Date());//评分时间
|
55
|
|
-
|
56
|
|
-
|
|
63
|
+ List<PostAssessmentRatingOther> postAssessmentRatingOthers = postAssessmentRatingOtherMapper.selectList(Wrappers.<PostAssessmentRatingOther>lambdaQuery()
|
|
64
|
+ .eq(PostAssessmentRatingOther::getBatchId,data.getBatchId())
|
|
65
|
+ );
|
|
66
|
+ if (postAssessmentRatingOthers.isEmpty()){
|
|
67
|
+ return new PostAssessmentRatingOther();
|
|
68
|
+ }
|
57
|
69
|
// String[] deptArr = new String[]{"健康安全环保中心", "生产指挥中心", "设备管理中心", "技术中心", "仓储组", "党建工作部", "内控法务部", "人力资源部", "商务部", "办公室", "规划计划部", "信息中心", "财务资金部"};
|
58
|
|
-
|
|
70
|
+ Long type = 2L;
|
|
71
|
+ if (data.getType() == 2){
|
|
72
|
+ type = 3L;
|
|
73
|
+ }
|
|
74
|
+ List<PostAssessmentRules> postAssessmentRules = postAssessmentRulesMapper.selectList(Wrappers.<PostAssessmentRules>lambdaQuery()
|
|
75
|
+ .eq(PostAssessmentRules::getType, type)
|
|
76
|
+ );
|
59
|
77
|
List<PostAssessmentRatingOtherInfo> children = new ArrayList<>();
|
60
|
|
-
|
61
|
|
- String[] deptArr = new String[]{"健康安全环保中心", "生产指挥中心", "设备管理中心", "技术中心", "仓储组", "党建工作部", "内控法务部", "人力资源部", "商务部", "办公室", "规划计划部", "信息中心", "财务资金部"};
|
62
|
|
- PostAssessmentRatingOtherInfo child1 = new PostAssessmentRatingOtherInfo();
|
63
|
|
- child1.setId(System.currentTimeMillis());
|
64
|
|
- child1.setRatingOtherId(id);
|
|
78
|
+ for (PostAssessmentRules postAssessmentRule : postAssessmentRules) {
|
|
79
|
+ PostAssessmentRatingOtherInfo child1 = new PostAssessmentRatingOtherInfo();
|
65
|
80
|
// "评分分类/项目/专业:职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规与保密职责;5-任职资格与能力素质要求;6-岗位责任制文件完整性与适宜性;
|
66
|
81
|
// 10-工作态度;11-部门协作;12-廉洁从业;13-主要工作完成情况;
|
67
|
82
|
// 20-HSE;21-生产;22-设备;")
|
68
|
|
- child1.setDutyType(10);
|
69
|
|
- child1.setScoreWeight(new BigDecimal(20));
|
70
|
|
- List<PostAssessmentRatingOtherInfoDept> children1 = new ArrayList<>();
|
71
|
|
- for (int i = 0; i < deptArr.length; i++) {
|
72
|
|
- Long deptId = Long.parseLong(String.valueOf(i + 1));
|
73
|
|
- String deptName = deptArr[i];
|
74
|
|
- children1.add(new PostAssessmentRatingOtherInfoDept(deptId, deptName, new BigDecimal(20 - i)));
|
75
|
|
- }
|
76
|
|
- child1.setChildren(children1);
|
77
|
|
- child1.setRule("评分标准-工作态度");
|
78
|
|
-
|
79
|
|
- PostAssessmentRatingOtherInfo child2 = new PostAssessmentRatingOtherInfo();
|
80
|
|
- child2.setId(System.currentTimeMillis());
|
81
|
|
- child2.setRatingOtherId(id);
|
82
|
|
- child2.setDutyType(11);
|
83
|
|
- child2.setScoreWeight(new BigDecimal(20));
|
84
|
|
- List<PostAssessmentRatingOtherInfoDept> children2 = new ArrayList<>();
|
85
|
|
- for (int i = 0; i < deptArr.length; i++) {
|
86
|
|
- Long deptId = Long.parseLong(String.valueOf(i + 1));
|
87
|
|
- String deptName = deptArr[i];
|
88
|
|
- children2.add(new PostAssessmentRatingOtherInfoDept(deptId, deptName, new BigDecimal(20 - i)));
|
|
83
|
+ child1.setDutyType(postAssessmentRule.getDutyType());
|
|
84
|
+ child1.setScoreWeight(new BigDecimal(postAssessmentRule.getFullScore()));
|
|
85
|
+ List<PostAssessmentRatingOtherInfoDept> children1 = new ArrayList<>();
|
|
86
|
+ for (PostAssessmentRatingOther postAssessmentRatingOther : postAssessmentRatingOthers) {
|
|
87
|
+ List<PostAssessmentRatingOtherInfo> postAssessmentRatingOtherInfos = postAssessmentRatingOtherInfoMapper.selectList(Wrappers.<PostAssessmentRatingOtherInfo>lambdaQuery()
|
|
88
|
+ .eq(PostAssessmentRatingOtherInfo::getRatingOtherId,postAssessmentRatingOther.getId())
|
|
89
|
+ .eq(PostAssessmentRatingOtherInfo::getDutyType,postAssessmentRule.getDutyType())
|
|
90
|
+ );
|
|
91
|
+ BigDecimal distance = new BigDecimal("0");
|
|
92
|
+ if (postAssessmentRatingOtherInfos.isEmpty()){
|
|
93
|
+ continue;
|
|
94
|
+ }
|
|
95
|
+ distance = postAssessmentRatingOtherInfos.get(0).getByDeptScore();
|
|
96
|
+ children1.add(new PostAssessmentRatingOtherInfoDept(postAssessmentRatingOtherInfos.get(0).getId(),postAssessmentRatingOther.getDeptId(), postAssessmentRatingMapper.getSysDeptName(postAssessmentRatingOther.getDeptId()), distance));
|
|
97
|
+ }
|
|
98
|
+ child1.setChildren(children1);
|
|
99
|
+ children.add(child1);
|
89
|
100
|
}
|
90
|
|
- child2.setChildren(children2);
|
91
|
|
- child2.setRule("评分标准-部门协作");
|
92
|
|
-
|
93
|
|
-
|
94
|
|
- PostAssessmentRatingOtherInfo child3 = new PostAssessmentRatingOtherInfo();
|
95
|
|
- child3.setId(System.currentTimeMillis());
|
96
|
|
- child3.setRatingOtherId(id);
|
97
|
|
- child3.setDutyType(12);
|
98
|
|
- child3.setScoreWeight(new BigDecimal(20));
|
99
|
|
- List<PostAssessmentRatingOtherInfoDept> children3 = new ArrayList<>();
|
100
|
|
- for (int i = 0; i < deptArr.length; i++) {
|
101
|
|
- Long deptId = Long.parseLong(String.valueOf(i + 1));
|
102
|
|
- String deptName = deptArr[i];
|
103
|
|
- children3.add(new PostAssessmentRatingOtherInfoDept(deptId, deptName, new BigDecimal(20 - i)));
|
104
|
|
- }
|
105
|
|
- child3.setChildren(children3);
|
106
|
|
- child3.setRule("评分标准-廉洁从业");
|
107
|
|
-
|
108
|
|
-
|
109
|
|
- PostAssessmentRatingOtherInfo child4 = new PostAssessmentRatingOtherInfo();
|
110
|
|
- child4.setId(System.currentTimeMillis());
|
111
|
|
- child4.setRatingOtherId(id);
|
112
|
|
- child4.setDutyType(13);
|
113
|
|
- child4.setScoreWeight(new BigDecimal(20));
|
114
|
|
- List<PostAssessmentRatingOtherInfoDept> children4 = new ArrayList<>();
|
115
|
|
- for (int i = 0; i < deptArr.length; i++) {
|
116
|
|
- Long deptId = Long.parseLong(String.valueOf(i + 1));
|
117
|
|
- String deptName = deptArr[i];
|
118
|
|
- children4.add(new PostAssessmentRatingOtherInfoDept(deptId, deptName, new BigDecimal(20 - i)));
|
119
|
|
- }
|
120
|
|
- child4.setChildren(children4);
|
121
|
|
- child4.setRule("评分标准-主要工作完成情况");
|
122
|
|
-
|
123
|
|
-
|
124
|
|
- children.add(child1);
|
125
|
|
- children.add(child2);
|
126
|
|
- children.add(child3);
|
127
|
|
- children.add(child4);
|
128
|
|
-
|
129
|
|
-
|
130
|
101
|
data.setChildren(children);
|
131
|
|
-
|
132
|
|
-
|
133
|
102
|
return data;
|
134
|
103
|
}
|
135
|
104
|
|
|
@@ -141,60 +110,18 @@ public class PostAssessmentRatingOtherServiceImpl extends ServiceImpl<PostAssess
|
141
|
110
|
*/
|
142
|
111
|
@Override
|
143
|
112
|
public List<PostAssessmentRatingOther> selectPostAssessmentRatingOtherList(PostAssessmentRatingOther postAssessmentRatingOther) {
|
144
|
|
- List<PostAssessmentRatingOther> list = postAssessmentRatingOtherMapper.selectPostAssessmentRatingOtherList(postAssessmentRatingOther);
|
145
|
|
- list = new ArrayList<>();
|
146
|
|
-
|
147
|
|
- Long id = 123456789l;
|
148
|
|
- PostAssessmentRatingOther data = new PostAssessmentRatingOther();
|
149
|
|
- data.setId(id);
|
150
|
|
- data.setType(PostAssessmentRatingOtherEnum.TYPE_ZN_HP.getValue());
|
151
|
|
- data.setBatchId("111111");
|
152
|
|
- data.setStatus(PostAssessmentRatingOtherEnum.STATUS_ING.getValue());//状态
|
153
|
|
- data.setStartTime(new Date());//评分时间
|
154
|
|
-
|
155
|
|
-// String[] deptArr = new String[]{"", "", "", "", "", "", "", "", "", "", "", "", ""};
|
156
|
|
-
|
157
|
|
- List<PostAssessmentRatingOtherInfo> children = new ArrayList<>();
|
158
|
|
-
|
159
|
|
- PostAssessmentRatingOtherInfo child1 = new PostAssessmentRatingOtherInfo();
|
160
|
|
- child1.setId(System.currentTimeMillis());
|
161
|
|
- child1.setRatingOtherId(id);
|
162
|
|
-// "评分分类/项目/专业:职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规与保密职责;5-任职资格与能力素质要求;6-岗位责任制文件完整性与适宜性;
|
163
|
|
-// 10-工作态度;11-部门协作;12-廉洁从业;13-主要工作完成情况;
|
164
|
|
-// 20-HSE;21-生产;22-设备;")
|
165
|
|
- child1.setDutyType(10);
|
166
|
|
- child1.setScoreWeight(new BigDecimal(20));
|
167
|
|
-
|
168
|
|
- PostAssessmentRatingOtherInfo child2 = new PostAssessmentRatingOtherInfo();
|
169
|
|
- child2.setId(System.currentTimeMillis());
|
170
|
|
- child2.setRatingOtherId(id);
|
171
|
|
- child2.setDutyType(11);
|
172
|
|
- child2.setScoreWeight(new BigDecimal(20));
|
173
|
|
-
|
174
|
|
-
|
175
|
|
- PostAssessmentRatingOtherInfo child3 = new PostAssessmentRatingOtherInfo();
|
176
|
|
- child3.setId(System.currentTimeMillis());
|
177
|
|
- child3.setRatingOtherId(id);
|
178
|
|
- child3.setDutyType(12);
|
179
|
|
- child3.setScoreWeight(new BigDecimal(20));
|
180
|
|
-
|
181
|
|
-
|
182
|
|
- PostAssessmentRatingOtherInfo child4 = new PostAssessmentRatingOtherInfo();
|
183
|
|
- child4.setId(System.currentTimeMillis());
|
184
|
|
- child4.setRatingOtherId(id);
|
185
|
|
- child4.setDutyType(13);
|
186
|
|
- child4.setScoreWeight(new BigDecimal(20));
|
187
|
|
-
|
188
|
|
-
|
189
|
|
- children.add(child1);
|
190
|
|
- children.add(child2);
|
191
|
|
- children.add(child3);
|
192
|
|
- children.add(child4);
|
193
|
|
-
|
194
|
|
-
|
195
|
|
- data.setChildren(children);
|
196
|
|
-
|
197
|
|
- list.add(data);
|
|
113
|
+ List<PostAssessmentRatingOther> list = postAssessmentRatingOtherMapper.selectPostAssessmentRatingOtherListGroup(postAssessmentRatingOther);
|
|
114
|
+ if (list.isEmpty()){
|
|
115
|
+ return new ArrayList<>();
|
|
116
|
+ }
|
|
117
|
+ List<Long> collect = list.stream().map(PostAssessmentRatingOther::getId).collect(Collectors.toList());
|
|
118
|
+ List<PostAssessmentRatingOtherInfo> children = postAssessmentRatingOtherInfoMapper.selectList(Wrappers.<PostAssessmentRatingOtherInfo>lambdaQuery()
|
|
119
|
+ .in(PostAssessmentRatingOtherInfo::getRatingOtherId,collect)
|
|
120
|
+ );
|
|
121
|
+ for (PostAssessmentRatingOther assessmentRatingOther : list) {
|
|
122
|
+ List<PostAssessmentRatingOtherInfo> collect1 = children.stream().filter(d -> d.getRatingOtherId().equals(assessmentRatingOther.getId())).collect(Collectors.toList());
|
|
123
|
+ assessmentRatingOther.setChildren(collect1);
|
|
124
|
+ }
|
198
|
125
|
return list;
|
199
|
126
|
}
|
200
|
127
|
|
|
@@ -272,39 +199,91 @@ public class PostAssessmentRatingOtherServiceImpl extends ServiceImpl<PostAssess
|
272
|
199
|
return 0;
|
273
|
200
|
}
|
274
|
201
|
|
|
202
|
+ List<PostAssessmentRules> postAssessmentRules = new ArrayList<>();
|
275
|
203
|
//初始化13个职能部门评分 类型:1-职能互评;
|
276
|
204
|
if (type == PostAssessmentRatingOtherEnum.TYPE_ZN_HP.getValue()) {
|
277
|
|
-
|
278
|
|
- return SpringUtils.getBean(PostAssessmentRatingOtherServiceImpl.class).batchAddRatingOtherZhiNengDept(startTime);
|
|
205
|
+ postAssessmentRules = postAssessmentRulesMapper.selectList(Wrappers.<PostAssessmentRules>lambdaQuery()
|
|
206
|
+ .eq(PostAssessmentRules::getType,2)
|
|
207
|
+ );
|
279
|
208
|
}
|
280
|
209
|
|
281
|
210
|
//初始化13个生产部门评分 类型:2-生产日常;
|
282
|
211
|
if (type == PostAssessmentRatingOtherEnum.TYPE_SC_RC.getValue()) {
|
283
|
|
- return SpringUtils.getBean(PostAssessmentRatingOtherServiceImpl.class).batchAddRatingOtherShengChanDept(startTime);
|
|
212
|
+ postAssessmentRules =postAssessmentRulesMapper.selectList(Wrappers.<PostAssessmentRules>lambdaQuery()
|
|
213
|
+ .eq(PostAssessmentRules::getType,3)
|
|
214
|
+ );
|
|
215
|
+
|
|
216
|
+ }
|
|
217
|
+ List<Long> deptIdList = postAssessmentRatingOtherMapper.getDeptIdList(postAssessmentRatingOther.getDeptId());
|
|
218
|
+ String string = UUID.randomUUID().toString();
|
|
219
|
+ for (Long deptId : deptIdList) {
|
|
220
|
+ PostAssessmentRatingOther postAssessmentRatingOtherOther =new PostAssessmentRatingOther();
|
|
221
|
+ postAssessmentRatingOtherOther.setId(Long.parseLong(IdWorker.getIdStr().substring(4)));
|
|
222
|
+ postAssessmentRatingOtherOther.setType(type);
|
|
223
|
+ postAssessmentRatingOtherOther.setBatchId(string);
|
|
224
|
+ postAssessmentRatingOtherOther.setStartTime(new Date());
|
|
225
|
+ postAssessmentRatingOtherOther.setStatus(1);
|
|
226
|
+ postAssessmentRatingOtherOther.setDeptId(deptId);
|
|
227
|
+ postAssessmentRatingOtherOther.setCreateDefault();
|
|
228
|
+ postAssessmentRatingOtherOther.setCreateUserId(SecurityUtils.getLoginUser().getUserId());
|
|
229
|
+ postAssessmentRatingOtherMapper.insert(postAssessmentRatingOtherOther);
|
|
230
|
+ if(!postAssessmentRules.isEmpty()){
|
|
231
|
+ for (PostAssessmentRules postAssessmentRule : postAssessmentRules) {
|
|
232
|
+ PostAssessmentRatingOtherInfo info = new PostAssessmentRatingOtherInfo();
|
|
233
|
+ info.setId(Long.parseLong(IdWorker.getIdStr().substring(4)));
|
|
234
|
+ info.setRatingOtherId(postAssessmentRatingOtherOther.getId());
|
|
235
|
+ info.setDutyType(postAssessmentRule.getDutyType());
|
|
236
|
+ info.setScoreWeight(new BigDecimal(postAssessmentRule.getFullScore()));
|
|
237
|
+ info.setByDeptId(deptId);
|
|
238
|
+ info.setCreateDefault();
|
|
239
|
+ postAssessmentRatingOtherInfoMapper.insert(info);
|
|
240
|
+ }
|
|
241
|
+
|
|
242
|
+ }
|
284
|
243
|
}
|
285
|
|
- return 0;
|
|
244
|
+ return 1;
|
286
|
245
|
}
|
287
|
246
|
|
288
|
|
- /**
|
289
|
|
- * 初始化13个职能部门评分 类型:1-职能互评;
|
290
|
|
- *
|
291
|
|
- * @param startTime 评分时间
|
292
|
|
- */
|
293
|
|
- @Transactional(rollbackFor = Exception.class)
|
294
|
|
- public int batchAddRatingOtherZhiNengDept(Date startTime) {
|
295
|
|
- //TODO 待开发:
|
|
247
|
+ @Override
|
|
248
|
+ public int batchAddRatingOtherUpdate(PostAssessmentRatingOther postAssessmentRatingOther) {
|
|
249
|
+ List<PostAssessmentRatingOther> postAssessmentRatingOthers = postAssessmentRatingOtherMapper.selectList(Wrappers.<PostAssessmentRatingOther>lambdaQuery()
|
|
250
|
+ .eq(PostAssessmentRatingOther::getBatchId,postAssessmentRatingOther.getBatchId())
|
|
251
|
+ );
|
|
252
|
+ if (postAssessmentRatingOthers.isEmpty()){
|
|
253
|
+ throw new RuntimeException("提交失败");
|
|
254
|
+ }
|
|
255
|
+ List<Long> collect = postAssessmentRatingOthers.stream().map(PostAssessmentRatingOther::getId).collect(Collectors.toList());
|
|
256
|
+ List<PostAssessmentRatingOtherInfo> info = postAssessmentRatingOtherInfoMapper.selectList(Wrappers.<PostAssessmentRatingOtherInfo>lambdaQuery()
|
|
257
|
+ .in(PostAssessmentRatingOtherInfo::getRatingOtherId,collect)
|
|
258
|
+ );
|
|
259
|
+ List<PostAssessmentRatingOtherInfo> children = postAssessmentRatingOther.getChildren();
|
|
260
|
+ children.forEach(x->{
|
|
261
|
+ List<PostAssessmentRatingOtherInfoDept> dept = x.getChildren();
|
|
262
|
+ dept.forEach(y->{
|
|
263
|
+ List<PostAssessmentRatingOtherInfo> collect1 = info.stream().filter(d -> d.getByDeptId().equals(y.getByDeptId()) && d.getDutyType().equals(x.getDutyType())).collect(Collectors.toList());
|
|
264
|
+ for (PostAssessmentRatingOtherInfo postAssessmentRatingOtherInfo : collect1) {
|
|
265
|
+ postAssessmentRatingOtherInfo.setUpdateDefault();
|
|
266
|
+ postAssessmentRatingOtherInfo.setByDeptScore(y.getByDeptScore());
|
|
267
|
+ postAssessmentRatingOtherInfoMapper.updateById(postAssessmentRatingOtherInfo);
|
|
268
|
+ }
|
|
269
|
+ });
|
|
270
|
+ });
|
296
|
271
|
return 1;
|
297
|
272
|
}
|
298
|
273
|
|
299
|
|
-
|
300
|
|
- /**
|
301
|
|
- * 初始化13个生产部门评分 类型:2-生产日常;
|
302
|
|
- *
|
303
|
|
- * @param startTime 评分时间
|
304
|
|
- */
|
305
|
|
- @Transactional(rollbackFor = Exception.class)
|
306
|
|
- public int batchAddRatingOtherShengChanDept(Date startTime) {
|
307
|
|
- //TODO 待开发:
|
|
274
|
+ @Override
|
|
275
|
+ public int productionDepartmentSub(List<PostAssessmentRatingOther> postAssessmentRatingOther) {
|
|
276
|
+ for (PostAssessmentRatingOther assessmentRatingOther : postAssessmentRatingOther) {
|
|
277
|
+ List<PostAssessmentRatingOtherInfo> children = assessmentRatingOther.getChildren();
|
|
278
|
+ children.forEach(x->{
|
|
279
|
+ PostAssessmentRatingOtherInfo info = new PostAssessmentRatingOtherInfo();
|
|
280
|
+ info.setId(x.getId());
|
|
281
|
+ info.setByDeptScore(x.getByDeptScore());
|
|
282
|
+ info.setUpdateDefault();
|
|
283
|
+ postAssessmentRatingOtherInfoMapper.updateById(info);
|
|
284
|
+ });
|
|
285
|
+ }
|
308
|
286
|
return 1;
|
309
|
287
|
}
|
|
288
|
+
|
310
|
289
|
}
|