Commit 2ac0c565e8e9418f7d4f424cf07e64574192ffae
1 parent
9090a114
feature(*): 修改个人考评
修改个人考评
Showing
7 changed files
with
181 additions
and
195 deletions
fw-morax-common/src/main/java/cn/fw/morax/common/constant/Constant.java
... | ... | @@ -52,6 +52,11 @@ public class Constant { |
52 | 52 | public final static String SEPARATOR = "_"; |
53 | 53 | |
54 | 54 | /** |
55 | + * 时间分隔符 | |
56 | + */ | |
57 | + public final static String TIME_SEPARATOR = "——"; | |
58 | + | |
59 | + /** | |
55 | 60 | * 薪酬报表车系名称 |
56 | 61 | */ |
57 | 62 | public final static String REPORT_CAR_SERIES_NAME = "carSeriesName"; | ... | ... |
fw-morax-dao/src/main/resources/mapper/eval/EvalShopPoolDao.xml
... | ... | @@ -4,23 +4,31 @@ |
4 | 4 | |
5 | 5 | <!-- 通用查询映射结果 --> |
6 | 6 | <resultMap id="BaseResultMap" type="cn.fw.morax.domain.db.eval.EvalShopPool"> |
7 | - <result column="id" property="id"/> | |
8 | - <result column="egc" property="egc"/> | |
9 | - <result column="eval_group_id" property="evalGroupId"/> | |
10 | - <result column="shop_id" property="shopId"/> | |
11 | - <result column="shop_name" property="shopName"/> | |
12 | - <result column="reward" property="reward"/> | |
13 | - <result column="score" property="score"/> | |
14 | - <result column="score_ratio" property="scoreRatio"/> | |
15 | - <result column="monthly" property="monthly"/> | |
16 | - <result column="group_id" property="groupId"/> | |
17 | - <result column="yn" property="yn"/> | |
18 | - <result column="create_time" property="createTime"/> | |
19 | - <result column="update_time" property="updateTime"/> | |
7 | + <result column="id" property="id"/> | |
8 | + <result column="eval_group_rank_id" property="evalGroupRankId"/> | |
9 | + <result column="eval_group_rank_stage_id" property="evalGroupRankStageId"/> | |
10 | + <result column="egc" property="egc"/> | |
11 | + <result column="eval_group_id" property="evalGroupId"/> | |
12 | + <result column="shop_id" property="shopId"/> | |
13 | + <result column="shop_name" property="shopName"/> | |
14 | + <result column="reward" property="reward"/> | |
15 | + <result column="status" property="status"/> | |
16 | + <result column="score" property="score"/> | |
17 | + <result column="score_ratio" property="scoreRatio"/> | |
18 | + <result column="rank" property="rank"/> | |
19 | + <result column="data_date" property="dataDate"/> | |
20 | + <result column="monthly" property="monthly"/> | |
21 | + <result column="group_id" property="groupId"/> | |
22 | + <result column="yn" property="yn"/> | |
23 | + <result column="create_time" property="createTime"/> | |
24 | + <result column="update_time" property="updateTime"/> | |
20 | 25 | </resultMap> |
21 | 26 | |
22 | 27 | <sql id="all_columns"> |
23 | - id,eval_id,egc,eval_group_id,shop_id,shop_name,reward,status,score,score_ratio,monthly,group_id | |
28 | + id,eval_group_rank_id,eval_group_rank_stage_id | |
29 | + ,egc,eval_group_id,shop_id,shop_name,reward | |
30 | + ,status,score,score_ratio,rank,data_date | |
31 | + ,monthly,group_id,yn,create_time,update_time | |
24 | 32 | </sql> |
25 | 33 | |
26 | 34 | <select id="getLastPool" resultType="cn.fw.morax.domain.db.eval.EvalShopPool"> |
... | ... | @@ -45,18 +53,24 @@ |
45 | 53 | |
46 | 54 | <select id="queryPagePool" resultType="cn.fw.morax.domain.vo.eval.EvalShopPoolVO"> |
47 | 55 | SELECT |
48 | - id, | |
49 | - eval_id, | |
50 | - egc, | |
51 | - eval_group_id, | |
52 | - shop_id, | |
53 | - shop_name, | |
54 | - reward, | |
55 | - status, | |
56 | - score, | |
57 | - score_ratio, | |
58 | - monthly, | |
59 | - group_id | |
56 | + id | |
57 | + ,eval_group_rank_id | |
58 | + ,eval_group_rank_stage_id | |
59 | + ,egc | |
60 | + ,eval_group_id | |
61 | + ,shop_id | |
62 | + ,shop_name | |
63 | + ,reward | |
64 | + ,status | |
65 | + ,score | |
66 | + ,score_ratio | |
67 | + ,rank | |
68 | + ,data_date | |
69 | + ,monthly | |
70 | + ,group_id | |
71 | + ,yn | |
72 | + ,create_time | |
73 | + ,update_time | |
60 | 74 | from eval_shop_pool |
61 | 75 | where yn = 1 |
62 | 76 | and group_id = #{condition.groupId} | ... | ... |
fw-morax-dao/src/main/resources/mapper/eval/EvalUserPoolDao.xml
... | ... | @@ -4,43 +4,63 @@ |
4 | 4 | |
5 | 5 | <!-- 通用查询映射结果 --> |
6 | 6 | <resultMap id="BaseResultMap" type="cn.fw.morax.domain.db.eval.EvalUserPool"> |
7 | - <result column="id" property="id"/> | |
8 | - <result column="egc" property="egc"/> | |
9 | - <result column="eval_group_id" property="evalGroupId"/> | |
10 | - <result column="user_id" property="userId"/> | |
11 | - <result column="user_name" property="userName"/> | |
12 | - <result column="post_id" property="postId"/> | |
13 | - <result column="post_name" property="postName"/> | |
14 | - <result column="shop_id" property="shopId"/> | |
15 | - <result column="shop_name" property="shopName"/> | |
16 | - <result column="fund_shop_id" property="fundShopId"/> | |
17 | - <result column="fund_shop_name" property="fundShopName"/> | |
18 | - <result column="reward" property="reward"/> | |
19 | - <result column="score" property="score"/> | |
20 | - <result column="monthly" property="monthly"/> | |
21 | - <result column="group_id" property="groupId"/> | |
22 | - <result column="yn" property="yn"/> | |
23 | - <result column="create_time" property="createTime"/> | |
24 | - <result column="update_time" property="updateTime"/> | |
7 | + <result column="id" property="id"/> | |
8 | + <result column="eval_group_rank_id" property="evalGroupRankId"/> | |
9 | + <result column="eval_group_rank_stage_id" property="evalGroupRankStageId"/> | |
10 | + <result column="egc" property="egc"/> | |
11 | + <result column="eval_group_id" property="evalGroupId"/> | |
12 | + <result column="user_id" property="userId"/> | |
13 | + <result column="user_name" property="userName"/> | |
14 | + <result column="post_id" property="postId"/> | |
15 | + <result column="post_name" property="postName"/> | |
16 | + <result column="shop_id" property="shopId"/> | |
17 | + <result column="shop_name" property="shopName"/> | |
18 | + <result column="fund_shop_id" property="fundShopId"/> | |
19 | + <result column="fund_shop_name" property="fundShopName"/> | |
20 | + <result column="reward" property="reward"/> | |
21 | + <result column="score" property="score"/> | |
22 | + <result column="score_ratio" property="scoreRatio"/> | |
23 | + <result column="rank" property="rank"/> | |
24 | + <result column="inclusion" property="inclusion"/> | |
25 | + <result column="data_date" property="dataDate"/> | |
26 | + <result column="monthly" property="monthly"/> | |
27 | + <result column="group_id" property="groupId"/> | |
28 | + <result column="yn" property="yn"/> | |
29 | + <result column="create_time" property="createTime"/> | |
30 | + <result column="update_time" property="updateTime"/> | |
25 | 31 | </resultMap> |
26 | 32 | |
33 | + <sql id="all_columns"> | |
34 | + id,eval_group_rank_id,eval_group_rank_stage_id,egc,eval_group_id,user_id,user_name,post_id | |
35 | + ,post_name,shop_id,shop_name,fund_shop_id,fund_shop_name | |
36 | + ,reward,score,score_ratio,rank,inclusion,data_date | |
37 | + ,monthly,group_id,yn,create_time,update_time | |
38 | + | |
39 | + </sql> | |
40 | + | |
27 | 41 | <select id="getLastPool" resultType="cn.fw.morax.domain.db.eval.EvalUserPool"> |
28 | 42 | SELECT |
29 | - t1.id, | |
30 | - t1.egc, | |
31 | - t1.eval_group_id, | |
32 | - t1.user_id, | |
33 | - t1.user_name, | |
34 | - t1.post_id, | |
35 | - t1.post_name, | |
36 | - t1.shop_id, | |
37 | - t1.shop_name, | |
38 | - t1.fund_shop_id, | |
39 | - t1.fund_shop_name, | |
40 | - t1.reward, | |
41 | - t1.score, | |
42 | - t1.monthly, | |
43 | - t1.group_id | |
43 | + t1.id | |
44 | + ,t1.eval_group_rank_id | |
45 | + ,t1.eval_group_rank_stage_id | |
46 | + ,t1.egc | |
47 | + ,t1.eval_group_id | |
48 | + ,t1.user_id | |
49 | + ,t1.user_name | |
50 | + ,t1.post_id | |
51 | + ,t1.post_name | |
52 | + ,t1.shop_id | |
53 | + ,t1.shop_name | |
54 | + ,t1.fund_shop_id | |
55 | + ,t1.fund_shop_name | |
56 | + ,t1.reward | |
57 | + ,t1.score | |
58 | + ,t1.score_ratio | |
59 | + ,t1.rank | |
60 | + ,t1.inclusion | |
61 | + ,t1.data_date | |
62 | + ,t1.monthly | |
63 | + ,t1.group_id | |
44 | 64 | FROM |
45 | 65 | eval_user_pool t1, |
46 | 66 | ( |
... | ... | @@ -61,7 +81,7 @@ |
61 | 81 | |
62 | 82 | <select id="queryPagePool" resultType="cn.fw.morax.domain.vo.eval.EvalUserPoolVO"> |
63 | 83 | SELECT |
64 | - * | |
84 | + <include refid="all_columns"/> | |
65 | 85 | from eval_user_pool |
66 | 86 | where yn = 1 |
67 | 87 | and group_id = #{condition.groupId} | ... | ... |
fw-morax-domain/src/main/java/cn/fw/morax/domain/db/eval/EvalRewardDist.java
... | ... | @@ -13,6 +13,7 @@ import lombok.experimental.Accessors; |
13 | 13 | |
14 | 14 | import java.io.Serializable; |
15 | 15 | import java.math.BigDecimal; |
16 | +import java.time.LocalDate; | |
16 | 17 | import java.time.LocalDateTime; |
17 | 18 | import java.util.List; |
18 | 19 | |
... | ... | @@ -36,31 +37,42 @@ public class EvalRewardDist extends BaseAuditableTimeEntity<EvalRewardDist, Long |
36 | 37 | * 用户id |
37 | 38 | */ |
38 | 39 | private Long userId; |
39 | - | |
40 | 40 | /** |
41 | - * 考评id | |
41 | + * 考评组id | |
42 | + */ | |
43 | + private Long evalGroupId; | |
44 | + /** | |
45 | + * 考评排名组id | |
46 | + */ | |
47 | + private Long evalGroupRankId; | |
48 | + /** | |
49 | + * 考评排名组阶段id | |
42 | 50 | */ |
43 | - private Long evalId; | |
51 | + private Long evalGroupRankStageId; | |
44 | 52 | |
45 | 53 | /** |
46 | - * 考评组编码 | |
54 | + * 考评组名称 | |
47 | 55 | */ |
48 | - private Long evalGroupId; | |
56 | + private String evalGroupName; | |
57 | + /** | |
58 | + * 考评排名组名称 | |
59 | + */ | |
60 | + private String evalGroupRankName; | |
49 | 61 | |
50 | 62 | /** |
51 | - * 考评类型; 1:活动考评 2:其他考评 | |
63 | + * 考评排名组阶段名称 | |
52 | 64 | */ |
53 | - private EvalTypeEnum evalType; | |
65 | + private String evalGroupRankStageName; | |
54 | 66 | |
55 | 67 | /** |
56 | - * 考评 | |
68 | + * 生效时间 | |
57 | 69 | */ |
58 | - private String evalName; | |
70 | + private LocalDate beginTime; | |
59 | 71 | |
60 | 72 | /** |
61 | - * 考评组 | |
73 | + * 结束时间 | |
62 | 74 | */ |
63 | - private String evalGroupName; | |
75 | + private LocalDate overTime; | |
64 | 76 | |
65 | 77 | /** |
66 | 78 | * 考评组id | ... | ... |
fw-morax-domain/src/main/java/cn/fw/morax/domain/db/eval/EvalShopPool.java
... | ... | @@ -30,11 +30,6 @@ public class EvalShopPool extends BaseAuditableTimeEntity<EvalShopPool, Long> { |
30 | 30 | * 考评组编码 |
31 | 31 | */ |
32 | 32 | private String egc; |
33 | - | |
34 | - /** | |
35 | - * 考评id | |
36 | - */ | |
37 | - private Long evalId; | |
38 | 33 | /** |
39 | 34 | * 考评组id |
40 | 35 | */ |
... | ... | @@ -48,26 +43,6 @@ public class EvalShopPool extends BaseAuditableTimeEntity<EvalShopPool, Long> { |
48 | 43 | */ |
49 | 44 | private Long evalGroupRankStageId; |
50 | 45 | |
51 | -// /** | |
52 | -// * 用户id | |
53 | -// */ | |
54 | -// private Long userId; | |
55 | -// | |
56 | -// /** | |
57 | -// * 用户名称 | |
58 | -// */ | |
59 | -// private String userName; | |
60 | - | |
61 | -// /** | |
62 | -// * 岗位id | |
63 | -// */ | |
64 | -// private Long postId; | |
65 | -// | |
66 | -// /** | |
67 | -// * 岗位名称 | |
68 | -// */ | |
69 | -// private String postName; | |
70 | - | |
71 | 46 | /** |
72 | 47 | * 门店id |
73 | 48 | */ |
... | ... | @@ -78,16 +53,6 @@ public class EvalShopPool extends BaseAuditableTimeEntity<EvalShopPool, Long> { |
78 | 53 | */ |
79 | 54 | private String shopName; |
80 | 55 | |
81 | -// /** | |
82 | -// * 社保公积金门店id | |
83 | -// */ | |
84 | -// private Long fundShopId; | |
85 | -// | |
86 | -// /** | |
87 | -// * 社保公积金门店名称 | |
88 | -// */ | |
89 | -// private String fundShopName; | |
90 | - | |
91 | 56 | /** |
92 | 57 | * 考评奖惩 |
93 | 58 | */ | ... | ... |
fw-morax-domain/src/main/java/cn/fw/morax/domain/vo/eval/EvalShopPoolVO.java
... | ... | @@ -12,6 +12,7 @@ import lombok.EqualsAndHashCode; |
12 | 12 | |
13 | 13 | import java.math.BigDecimal; |
14 | 14 | import java.time.LocalDate; |
15 | +import java.time.YearMonth; | |
15 | 16 | import java.util.List; |
16 | 17 | |
17 | 18 | /** |
... | ... | @@ -27,56 +28,22 @@ import java.util.List; |
27 | 28 | public class EvalShopPoolVO { |
28 | 29 | |
29 | 30 | private static final long serialVersionUID = 1L; |
30 | - | |
31 | - /** | |
32 | - * 考评池id | |
33 | - */ | |
34 | - private Long id; | |
35 | - | |
36 | 31 | /** |
37 | 32 | * 考评组编码 |
38 | 33 | */ |
39 | 34 | private String egc; |
40 | - | |
41 | - /** | |
42 | - * 考评组 | |
43 | - */ | |
44 | - private String evalGroupName; | |
45 | - | |
46 | - /** | |
47 | - * 考评id | |
48 | - */ | |
49 | - private Long evalId; | |
50 | 35 | /** |
51 | 36 | * 考评组id |
52 | 37 | */ |
53 | 38 | private Long evalGroupId; |
54 | - | |
55 | - | |
56 | 39 | /** |
57 | - * 考评类型; 1:活动考评 2:其他考评 | |
40 | + * 考评排名组id | |
58 | 41 | */ |
59 | - private EvalTypeEnum evalType; | |
60 | - | |
61 | -// /** | |
62 | -// * 用户id | |
63 | -// */ | |
64 | -// private Long userId; | |
65 | -// | |
66 | -// /** | |
67 | -// * 用户名称 | |
68 | -// */ | |
69 | -// private String userName; | |
70 | - | |
71 | -// /** | |
72 | -// * 岗位id | |
73 | -// */ | |
74 | -// private Long postId; | |
75 | -// | |
76 | -// /** | |
77 | -// * 岗位名称 | |
78 | -// */ | |
79 | -// private String postName; | |
42 | + private Long evalGroupRankId; | |
43 | + /** | |
44 | + * 考评排名组阶段id | |
45 | + */ | |
46 | + private Long evalGroupRankStageId; | |
80 | 47 | |
81 | 48 | /** |
82 | 49 | * 门店id |
... | ... | @@ -88,16 +55,6 @@ public class EvalShopPoolVO { |
88 | 55 | */ |
89 | 56 | private String shopName; |
90 | 57 | |
91 | -// /** | |
92 | -// * 社保公积金门店id | |
93 | -// */ | |
94 | -// private Long fundShopId; | |
95 | -// | |
96 | -// /** | |
97 | -// * 社保公积金门店名称 | |
98 | -// */ | |
99 | -// private String fundShopName; | |
100 | - | |
101 | 58 | /** |
102 | 59 | * 考评奖惩 |
103 | 60 | */ |
... | ... | @@ -114,20 +71,14 @@ public class EvalShopPoolVO { |
114 | 71 | private BigDecimal scoreRatio; |
115 | 72 | |
116 | 73 | /** |
117 | - * 绩效总分 | |
74 | + * 排名 | |
118 | 75 | */ |
119 | - private BigDecimal totalScore; | |
120 | - | |
121 | - /** | |
122 | - * 考评得分率(格式化) | |
123 | - */ | |
124 | - private String scoreRatioFormat; | |
76 | + private Integer rank; | |
125 | 77 | |
126 | 78 | /** |
127 | 79 | * 月度 |
128 | 80 | */ |
129 | - private String monthly; | |
130 | - | |
81 | + private YearMonth monthly; | |
131 | 82 | |
132 | 83 | /** |
133 | 84 | * 数据日期 | ... | ... |
fw-morax-service/src/main/java/cn/fw/morax/service/biz/eval/EvalRewardService.java
... | ... | @@ -5,6 +5,7 @@ import cn.fw.common.cache.locker.DistributedLocker; |
5 | 5 | import cn.fw.common.exception.BusinessException; |
6 | 6 | import cn.fw.common.web.auth.LoginAuthBean; |
7 | 7 | import cn.fw.morax.common.config.TodoVal; |
8 | +import cn.fw.morax.common.constant.Constant; | |
8 | 9 | import cn.fw.morax.common.pojo.event.ApprovalResultEvent; |
9 | 10 | import cn.fw.morax.common.utils.DateUtil; |
10 | 11 | import cn.fw.morax.common.utils.PublicUtil; |
... | ... | @@ -44,9 +45,11 @@ import org.springframework.stereotype.Service; |
44 | 45 | import org.springframework.transaction.annotation.Transactional; |
45 | 46 | |
46 | 47 | import java.math.BigDecimal; |
48 | +import java.text.DateFormat; | |
47 | 49 | import java.text.DecimalFormat; |
48 | 50 | import java.time.LocalDate; |
49 | 51 | import java.time.LocalDateTime; |
52 | +import java.time.format.DateTimeFormatter; | |
50 | 53 | import java.util.*; |
51 | 54 | import java.util.concurrent.RejectedExecutionException; |
52 | 55 | import java.util.concurrent.ThreadPoolExecutor; |
... | ... | @@ -169,7 +172,7 @@ public class EvalRewardService { |
169 | 172 | log.error("考评奖惩没有门店:{}", JSON.toJSONString(evalGroup)); |
170 | 173 | return; |
171 | 174 | } |
172 | -// sendDistRewardTodo(shopRewardDims, evalGroup, evalGroupRank, evalGroupRankStage); | |
175 | + sendDistRewardTodo(shopRewardDims, evalGroup, evalGroupRank, evalGroupRankStage); | |
173 | 176 | } |
174 | 177 | |
175 | 178 | /** |
... | ... | @@ -181,12 +184,14 @@ public class EvalRewardService { |
181 | 184 | public void sendDistRewardTodo(List<EvalGroupRewardDim> shopRewardDims, EvalGroup evalGroup, |
182 | 185 | EvalGroupRank evalGroupRank, EvalGroupRankStage evalGroupRankStage) { |
183 | 186 | String evalGroupRankName = evalGroupRank.getName(); |
184 | - String evalGroupRankStageName = evalGroupRankStage.getName(); | |
185 | - DecimalFormat decimalFormat = new DecimalFormat("##########.##"); | |
186 | - List<BacklogBatchPlanItemReqDTO> itemList = new ArrayList<>(); | |
187 | + DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd"); | |
188 | + String beginTimeStr = dtf.format(evalGroupRankStage.getBeginTime()); | |
189 | + String endTimeStr = dtf.format(evalGroupRankStage.getOverTime()); | |
190 | + String timeStr = beginTimeStr + Constant.TIME_SEPARATOR + endTimeStr; | |
191 | + String evalGroupRankStageName = (evalGroupRank.getMultiStage()) ? evalGroupRankStage.getName() : "---"; | |
187 | 192 | |
193 | + List<BacklogBatchPlanItemReqDTO> itemList = new ArrayList<>(); | |
188 | 194 | List<Long> distPoolIds = new ArrayList<>(); |
189 | - final Date expireTime = DateUtil.localDateTime2Date(LocalDateTime.now().plusDays(2L)); | |
190 | 195 | for (EvalGroupRewardDim rewardDim : shopRewardDims) { |
191 | 196 | final String roleCode = rewardDim.getDistRoleCode(); |
192 | 197 | List<EvalShopPool> pools = evalShopPoolService.list(Wrappers.<EvalShopPool>lambdaQuery() |
... | ... | @@ -219,33 +224,15 @@ public class EvalRewardService { |
219 | 224 | } |
220 | 225 | //奖惩为0不分配 |
221 | 226 | if (BigDecimal.ZERO.compareTo(reward) == 0) { |
222 | - return; | |
227 | + continue; | |
223 | 228 | } |
224 | 229 | |
225 | - EvalRewardDist rewardDist = transferPo(evalGroup); | |
230 | + EvalRewardDist rewardDist = this.convertRewardDist(evalGroup, evalGroupRank, evalGroupRankStage, poolIds, manageShopIds); | |
226 | 231 | rewardDist.setUserId(user.getUserId()); |
227 | - rewardDist.setEvalShopPoolIds(poolIds); | |
228 | - rewardDist.setShopIds(manageShopIds); | |
229 | - rewardDist.setEvalName(evalGroupRankName); | |
230 | -// rewardDist.setEvalType(evalType); | |
231 | 232 | rewardDist.setReward(reward); |
232 | 233 | evalRewardDistService.save(rewardDist); |
233 | - | |
234 | - BacklogBatchPlanItemReqDTO planItemReq = new BacklogBatchPlanItemReqDTO(); | |
235 | - planItemReq.setDataId(rewardDist.getId().toString()); | |
236 | - planItemReq.setUserId(user.getUserId()); | |
237 | - planItemReq.setPlanTime(new Date()); | |
238 | - planItemReq.setExpireTime(expireTime); | |
239 | - | |
240 | - Map<String, String> dynamicMap = new HashMap<>(8); | |
241 | - dynamicMap.put("evalGroupName", evalGroupRankName); | |
242 | - dynamicMap.put("evalName", evalGroupRankStageName); | |
243 | -// dynamicMap.put("evalType", evalType.getName()); | |
244 | - dynamicMap.put("amount", decimalFormat.format(rewardDist.getReward())); | |
245 | - planItemReq.setDynamicMap(dynamicMap); | |
246 | - | |
247 | - Map<String, Object> extraData = new HashMap<>(); | |
248 | - planItemReq.setExtraData(extraData); | |
234 | + BacklogBatchPlanItemReqDTO planItemReq = this.createBacklog(rewardDist, user.getUserId()); | |
235 | + planItemReq.setDynamicMap(rewardDistDynamicMap(rewardDist, evalGroupRankName, evalGroupRankStageName, timeStr)); | |
249 | 236 | itemList.add(planItemReq); |
250 | 237 | } |
251 | 238 | } |
... | ... | @@ -269,11 +256,43 @@ public class EvalRewardService { |
269 | 256 | } |
270 | 257 | } |
271 | 258 | |
272 | - public EvalRewardDist transferPo(EvalGroup evalGroup) { | |
259 | + | |
260 | + public BacklogBatchPlanItemReqDTO createBacklog(EvalRewardDist rewardDist, Long userId) { | |
261 | + Date expireTime = DateUtil.localDateTime2Date(LocalDateTime.now().plusDays(2L)); | |
262 | + BacklogBatchPlanItemReqDTO planItemReq = new BacklogBatchPlanItemReqDTO(); | |
263 | + planItemReq.setDataId(rewardDist.getId().toString()); | |
264 | + planItemReq.setUserId(userId); | |
265 | + planItemReq.setPlanTime(new Date()); | |
266 | + planItemReq.setExpireTime(expireTime); | |
267 | + planItemReq.setExtraData(new HashMap<>()); | |
268 | + return planItemReq; | |
269 | + } | |
270 | + | |
271 | + public Map<String, String> rewardDistDynamicMap(EvalRewardDist rewardDist, String evalGroupRankName, String evalGroupRankStageName, String timeStr) { | |
272 | + DecimalFormat decimalFormat = new DecimalFormat("##########.##"); | |
273 | + Map<String, String> dynamicMap = new HashMap<>(8); | |
274 | + dynamicMap.put("evalGroupRankName", evalGroupRankName); | |
275 | + dynamicMap.put("evalGroupRankStageName", evalGroupRankStageName); | |
276 | + dynamicMap.put("evalGroupRankStageTime", timeStr); | |
277 | + dynamicMap.put("amount", decimalFormat.format(rewardDist.getReward())); | |
278 | + return dynamicMap; | |
279 | + } | |
280 | + | |
281 | + public EvalRewardDist convertRewardDist(EvalGroup evalGroup, EvalGroupRank evalGroupRank, EvalGroupRankStage evalGroupRankStage, | |
282 | + List<Long> poolIds, List<Long> manageShopIds) { | |
273 | 283 | EvalRewardDist rewardDist = new EvalRewardDist(); |
274 | - rewardDist.setEvalId(evalGroup.getEvalGroupRankId()); | |
275 | 284 | rewardDist.setEvalGroupId(evalGroup.getId()); |
276 | -// rewardDist.setEvalGroupName(evalGroup.getName()); | |
285 | + rewardDist.setEvalGroupRankId(evalGroupRank.getId()); | |
286 | + rewardDist.setEvalGroupRankStageId(evalGroupRankStage.getId()); | |
287 | + rewardDist.setEvalGroupRankName(evalGroupRank.getName()); | |
288 | + String evalGroupRankStageName = (PublicUtil.isNotEmpty(evalGroupRankStage.getName()) ? evalGroupRankStage.getName() : "---"); | |
289 | + rewardDist.setEvalGroupRankStageName(evalGroupRankStageName); | |
290 | + rewardDist.setBeginTime(evalGroupRankStage.getBeginTime()); | |
291 | + rewardDist.setOverTime(evalGroupRankStage.getOverTime()); | |
292 | + rewardDist.setEvalShopPoolIds(poolIds); | |
293 | + rewardDist.setShopIds(manageShopIds); | |
294 | + | |
295 | + rewardDist.setEvalGroupId(evalGroup.getId()); | |
277 | 296 | rewardDist.setStatus(EvalRewardDistStatusEnum.NO_DIST); |
278 | 297 | rewardDist.setGroupId(evalGroup.getGroupId()); |
279 | 298 | rewardDist.setYn(Boolean.TRUE); | ... | ... |