|
@@ -7,6 +7,7 @@ import com.qgutech.qgyun.apaas.sync.cpsfzzk.enums.MonthEnum; |
|
@@ -7,6 +7,7 @@ import com.qgutech.qgyun.apaas.sync.cpsfzzk.enums.MonthEnum; |
|
7
|
import com.qgutech.qgyun.apaas.sync.cpsfzzk.mapper.ScoreCardReviewRecordMapper;
|
7
|
import com.qgutech.qgyun.apaas.sync.cpsfzzk.mapper.ScoreCardReviewRecordMapper;
|
|
8
|
import com.qgutech.qgyun.apaas.sync.cpsfzzk.model.ScoreCard;
|
8
|
import com.qgutech.qgyun.apaas.sync.cpsfzzk.model.ScoreCard;
|
|
9
|
import com.qgutech.qgyun.apaas.sync.cpsfzzk.model.ScoreCardReviewRecord;
|
9
|
import com.qgutech.qgyun.apaas.sync.cpsfzzk.model.ScoreCardReviewRecord;
|
|
|
|
10
|
+import lombok.extern.slf4j.Slf4j;
|
|
10
|
import org.apache.commons.collections4.CollectionUtils;
|
11
|
import org.apache.commons.collections4.CollectionUtils;
|
|
11
|
import org.springframework.stereotype.Service;
|
12
|
import org.springframework.stereotype.Service;
|
|
12
|
import org.springframework.transaction.annotation.Transactional;
|
13
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -21,6 +22,8 @@ import java.util.stream.Collectors; |
|
@@ -21,6 +22,8 @@ import java.util.stream.Collectors; |
|
21
|
/**
|
22
|
/**
|
|
22
|
* ScoreCardReviewRecord 服务
|
23
|
* ScoreCardReviewRecord 服务
|
|
23
|
*/
|
24
|
*/
|
|
|
|
25
|
+
|
|
|
|
26
|
+@Slf4j
|
|
24
|
@Service
|
27
|
@Service
|
|
25
|
public class ScoreCardReviewRecordService extends BaseServiceImpl<ScoreCardReviewRecord> {
|
28
|
public class ScoreCardReviewRecordService extends BaseServiceImpl<ScoreCardReviewRecord> {
|
|
26
|
|
29
|
|
|
@@ -80,7 +83,7 @@ public class ScoreCardReviewRecordService extends BaseServiceImpl<ScoreCardRevie |
|
@@ -80,7 +83,7 @@ public class ScoreCardReviewRecordService extends BaseServiceImpl<ScoreCardRevie |
|
80
|
* <p>
|
83
|
* <p>
|
|
81
|
* 处理流程:根据入参 id 获取回顾记录详情 -> 根据记录中的记分卡信息获取记分卡详情 ->
|
84
|
* 处理流程:根据入参 id 获取回顾记录详情 -> 根据记录中的记分卡信息获取记分卡详情 ->
|
|
82
|
* 根据回顾记录的月份取对应记分卡对应月份的目标值回填到回顾记录 ->
|
85
|
* 根据回顾记录的月份取对应记分卡对应月份的目标值回填到回顾记录 ->
|
|
83
|
- * 回顾记录的是否达标暂默认为达标 -> 最后更新对应回顾记录信息
|
86
|
+ * 最后更新对应回顾记录信息
|
|
84
|
*
|
87
|
*
|
|
85
|
* @param id 回顾记录ID
|
88
|
* @param id 回顾记录ID
|
|
86
|
* @return 更新后的回顾记录
|
89
|
* @return 更新后的回顾记录
|
|
@@ -100,16 +103,38 @@ public class ScoreCardReviewRecordService extends BaseServiceImpl<ScoreCardRevie |
|
@@ -100,16 +103,38 @@ public class ScoreCardReviewRecordService extends BaseServiceImpl<ScoreCardRevie |
|
100
|
Assert.notNull(month, "monthEm is invalid!");
|
103
|
Assert.notNull(month, "monthEm is invalid!");
|
|
101
|
record.setMonthTargetVal(scoreCardService.getMonthTargetValue(scoreCard, month));
|
104
|
record.setMonthTargetVal(scoreCardService.getMonthTargetValue(scoreCard, month));
|
|
102
|
|
105
|
|
|
103
|
- // 4. 回顾记录的是否达标暂默认为达标
|
|
|
|
104
|
- // TODO 后续补充根据月份目标值与实际值计算是否达标的逻辑
|
|
|
|
105
|
- record.setMonthFinishFlag(Boolean.TRUE);
|
|
|
|
106
|
-
|
|
|
|
107
|
- // 5. 最后更新对应回顾记录信息
|
106
|
+ // 4. 最后更新对应回顾记录信息
|
|
108
|
scoreCardReviewRecordMapper.updateByPrimaryKeySelective(record);
|
107
|
scoreCardReviewRecordMapper.updateByPrimaryKeySelective(record);
|
|
109
|
return record;
|
108
|
return record;
|
|
110
|
}
|
109
|
}
|
|
111
|
|
110
|
|
|
112
|
/**
|
111
|
/**
|
|
|
|
112
|
+ * 根据公司级记分ID和月份获取对应目标值
|
|
|
|
113
|
+ * <p>
|
|
|
|
114
|
+ *
|
|
|
|
115
|
+ * @param gsjjfkxxId 记分卡ID
|
|
|
|
116
|
+ * @param monthEm 月份
|
|
|
|
117
|
+ * @return 对应月份目标值
|
|
|
|
118
|
+ */
|
|
|
|
119
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
120
|
+ public String getTargetByJfkIdAndMonth(String gsjjfkxxId, String monthEm) {
|
|
|
|
121
|
+ Assert.hasLength(gsjjfkxxId, "gsjjfkxxId is empty!");
|
|
|
|
122
|
+ Assert.hasLength(monthEm, "monthEm is empty!");
|
|
|
|
123
|
+
|
|
|
|
124
|
+ log.info("getTargetByJfkIdAndMonth gsjjfkxxId:{}, monthEm:{}", gsjjfkxxId, monthEm);
|
|
|
|
125
|
+
|
|
|
|
126
|
+ // 1. 获取记分卡详情
|
|
|
|
127
|
+ ScoreCard scoreCard = scoreCardService.getById(gsjjfkxxId);
|
|
|
|
128
|
+
|
|
|
|
129
|
+ // 2. 根据回顾记录的月份获取对应记分卡对应月份的目标值,回填到回顾记录
|
|
|
|
130
|
+ Integer month = MonthEnum.getMonthByCode(monthEm);
|
|
|
|
131
|
+ Assert.notNull(month, "monthEm is invalid!");
|
|
|
|
132
|
+ String targetValue = scoreCardService.getMonthTargetValue(scoreCard, month);
|
|
|
|
133
|
+ log.info("getTargetByJfkIdAndMonth targetValue:{}", targetValue);
|
|
|
|
134
|
+ return targetValue;
|
|
|
|
135
|
+ }
|
|
|
|
136
|
+
|
|
|
|
137
|
+ /**
|
|
113
|
* 根据 ID 将回顾记录回写到对应记分卡
|
138
|
* 根据 ID 将回顾记录回写到对应记分卡
|
|
114
|
* <p>
|
139
|
* <p>
|
|
115
|
* 处理流程:根据入参 id 获取回顾记录详情 -> 根据记录中的记分卡信息获取记分卡详情 ->
|
140
|
* 处理流程:根据入参 id 获取回顾记录详情 -> 根据记录中的记分卡信息获取记分卡详情 ->
|