Commit 7a984e80 authored by zhaobiyan's avatar zhaobiyan

Merge branch 'feature_member_score' into dev

parents c86ea3fa e7c3e928
...@@ -71,7 +71,7 @@ public class MemberUserScoreApiImpl implements MemberUserScoreApi { ...@@ -71,7 +71,7 @@ public class MemberUserScoreApiImpl implements MemberUserScoreApi {
if (StringUtils.isBlank(req.getUniqueId())) { if (StringUtils.isBlank(req.getUniqueId())) {
throw exception(SCORE_OPERATE_MUST_HAVE_UNIQUE_ID); throw exception(SCORE_OPERATE_MUST_HAVE_UNIQUE_ID);
} }
MemberUserScoreLogDO memberUserScoreLogDO = logService.getByUniqueId(req.getUniqueId()); MemberUserScoreLogDO memberUserScoreLogDO = logService.getByUniqueId(req.getSourceType() + "_" + req.getUniqueId());
if (memberUserScoreLogDO != null) { if (memberUserScoreLogDO != null) {
throw exception(SCORE_OPERATE_IDEMPOTENT_ERROR); throw exception(SCORE_OPERATE_IDEMPOTENT_ERROR);
} }
...@@ -133,13 +133,13 @@ public class MemberUserScoreApiImpl implements MemberUserScoreApi { ...@@ -133,13 +133,13 @@ public class MemberUserScoreApiImpl implements MemberUserScoreApi {
} }
} }
return req.getMemberIds().stream().map(memberId -> operateScore(MemberUserScoreOperateReqDTO.builder() return req.getMemberIds().stream().map(memberId -> operateScore(MemberUserScoreOperateReqDTO.builder()
.memberId(memberId) .memberId(memberId)
.scoreCount(req.getScoreCount()) .scoreCount(req.getScoreCount())
.operateType(req.getOperateType()) .operateType(req.getOperateType())
.sourceType(req.getSourceType()) .sourceType(req.getSourceType())
.extParam(req.getExtParam()) .extParam(req.getExtParam())
.uniqueId(req.getUniqueId() + "_" + memberId) .uniqueId(req.getUniqueId() + "_" + memberId)
.build())) .build()))
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
...@@ -200,7 +200,7 @@ public class MemberUserScoreApiImpl implements MemberUserScoreApi { ...@@ -200,7 +200,7 @@ public class MemberUserScoreApiImpl implements MemberUserScoreApi {
req.getOperateType().getValue() : req.getSourceType().getOperateType().getValue()) req.getOperateType().getValue() : req.getSourceType().getOperateType().getValue())
.sourceType(req.getSourceType().getValue()) .sourceType(req.getSourceType().getValue())
.extParam(req.getExtParam()) .extParam(req.getExtParam())
.uniqueId(req.getUniqueId()) .uniqueId(req.getSourceType() + "_" + req.getUniqueId())
.build()); .build());
} }
} }
...@@ -64,7 +64,7 @@ public class MemberUserScoreExpireTask implements JobHandler { ...@@ -64,7 +64,7 @@ public class MemberUserScoreExpireTask implements JobHandler {
.memberId(memberUserScoreDetailDO.getMemberId()) .memberId(memberUserScoreDetailDO.getMemberId())
.scoreCount(memberUserScoreDetailDO.getRemainCount()) .scoreCount(memberUserScoreDetailDO.getRemainCount())
.sourceType(ScoreSourceTypeEnum.SYSTEM_EXPIRED) .sourceType(ScoreSourceTypeEnum.SYSTEM_EXPIRED)
.uniqueId(ScoreSourceTypeEnum.SYSTEM_EXPIRED +"_"+ memberUserScoreDetailDO.getId() + "_" + System.currentTimeMillis()) .uniqueId(memberUserScoreDetailDO.getId() + "_" + System.currentTimeMillis())
.extParam(extParam) .extParam(extParam)
.build()); .build());
} catch (Exception e) { } catch (Exception e) {
......
...@@ -60,7 +60,7 @@ public class MemberUserScoreController { ...@@ -60,7 +60,7 @@ public class MemberUserScoreController {
.operateType(ScoreOperateTypeEnum.parseByValue(query.getOperateType())) .operateType(ScoreOperateTypeEnum.parseByValue(query.getOperateType()))
.sourceType(ScoreSourceTypeEnum.MANUAL_OPERATE) .sourceType(ScoreSourceTypeEnum.MANUAL_OPERATE)
.extParam(extParam) .extParam(extParam)
.uniqueId(ScoreSourceTypeEnum.MANUAL_OPERATE + "_" + System.currentTimeMillis()) .uniqueId(String.valueOf(System.currentTimeMillis()))
.build()); .build());
return success(null); return success(null);
} }
......
...@@ -55,7 +55,7 @@ public class MemberUserScoreDetailExpireListener { ...@@ -55,7 +55,7 @@ public class MemberUserScoreDetailExpireListener {
.memberId(detail.getMemberId()) .memberId(detail.getMemberId())
.scoreCount(detail.getRemainCount()) .scoreCount(detail.getRemainCount())
.sourceType(ScoreSourceTypeEnum.SYSTEM_EXPIRED) .sourceType(ScoreSourceTypeEnum.SYSTEM_EXPIRED)
.uniqueId(ScoreSourceTypeEnum.SYSTEM_EXPIRED +"_"+ detail.getId() + "_" + System.currentTimeMillis()) .uniqueId(detail.getId() + "_" + System.currentTimeMillis())
.extParam(extParam) .extParam(extParam)
.build()); .build());
} catch (Exception e) { } catch (Exception e) {
......
...@@ -116,7 +116,7 @@ public class RedeemRewardApiImpl implements RedeemRewardApi { ...@@ -116,7 +116,7 @@ public class RedeemRewardApiImpl implements RedeemRewardApi {
.sourceType(ScoreSourceTypeEnum.EXCHANGE_REWARD) .sourceType(ScoreSourceTypeEnum.EXCHANGE_REWARD)
.scoreCount(redeemRewardReqVO.getRewardCount() * rewardDO.getPointsRequire()) .scoreCount(redeemRewardReqVO.getRewardCount() * rewardDO.getPointsRequire())
.releationId(String.valueOf(redeemId)) .releationId(String.valueOf(redeemId))
.uniqueId(ScoreSourceTypeEnum.EXCHANGE_REWARD + "_" + redeemId) .uniqueId(String.valueOf(redeemId))
.extParam(extParam) .extParam(extParam)
.build()); .build());
} }
......
...@@ -274,7 +274,7 @@ public class RewardRedeemServiceImpl extends AbstractService<RewardRedeemMapper, ...@@ -274,7 +274,7 @@ public class RewardRedeemServiceImpl extends AbstractService<RewardRedeemMapper,
.scoreCount(rewardRedeemDO.getScoreCount()) .scoreCount(rewardRedeemDO.getScoreCount())
.extParam(extParam) .extParam(extParam)
.releationId(String.valueOf(req.getId())) .releationId(String.valueOf(req.getId()))
.uniqueId(ScoreSourceTypeEnum.EXCHANGE_REWARD_CANCEL + "_" + req.getId()) .uniqueId(String.valueOf(req.getId()))
.build()); .build());
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment