Commit b152f992 by “Kongxiangkun”

修改评论发放积分和首次打开小程序发放积分逻辑

parent 4ddcd6a1
...@@ -461,14 +461,14 @@ public class PointDetailsServiceImpl extends ServiceImpl<PointDetailsMapper, com ...@@ -461,14 +461,14 @@ public class PointDetailsServiceImpl extends ServiceImpl<PointDetailsMapper, com
Integer readCount = pointDetailsMapper.getCountTodayByLearnType(accountId, PointTypeEnum.READ.getKey()); Integer readCount = pointDetailsMapper.getCountTodayByLearnType(accountId, PointTypeEnum.READ.getKey());
pointDetailVO.addPoint(PointChangeReasonConstant.POINT_READ.getKey(), PointChangeReasonConstant.POINT_READ.getValue(), pointDetailVO.addPoint(PointChangeReasonConstant.POINT_READ.getKey(), PointChangeReasonConstant.POINT_READ.getValue(),
readCount, (readCount != null && readCount >= 5) ? 1 : 0); readCount, (readCount != null && readCount >= 5) ? 1 : 0);
//投稿
Integer pubCount = pointDetailsMapper.getCountTodayByLearnType(accountId, PointTypeEnum.PUBLICATION.getKey());
pointDetailVO.addPoint(PointChangeReasonConstant.POINT_DRAFT.getKey(),
PointChangeReasonConstant.POINT_DRAFT.getValue(), pubCount, 0);
//评论 //评论
Integer commentCount = pointDetailsMapper.getCountTodayByLearnType(accountId, PointTypeEnum.COMMENT.getKey()); Integer commentCount = pointDetailsMapper.getCountTodayByLearnType(accountId, PointTypeEnum.COMMENT.getKey());
pointDetailVO.addPoint(PointChangeReasonConstant.POINT_COMMENT.getKey(), pointDetailVO.addPoint(PointChangeReasonConstant.POINT_COMMENT.getKey(),
PointChangeReasonConstant.POINT_COMMENT.getValue(), commentCount, 0); PointChangeReasonConstant.POINT_COMMENT.getValue(), commentCount, 0);
//投稿
Integer pubCount = pointDetailsMapper.getCountTodayByLearnType(accountId, PointTypeEnum.PUBLICATION.getKey());
pointDetailVO.addPoint(PointChangeReasonConstant.POINT_DRAFT.getKey(),
PointChangeReasonConstant.POINT_DRAFT.getValue(), pubCount, 0);
//活动 //活动
Integer activityCount = pointDetailsMapper.getCountTodayByLearnType(accountId, PointTypeEnum.ACITVITY.getKey()); Integer activityCount = pointDetailsMapper.getCountTodayByLearnType(accountId, PointTypeEnum.ACITVITY.getKey());
pointDetailVO.addPoint(PointChangeReasonConstant.CREDITSIGNDONE.getKey(), pointDetailVO.addPoint(PointChangeReasonConstant.CREDITSIGNDONE.getKey(),
......
...@@ -169,7 +169,7 @@ public class PointServiceImpl extends ServiceImpl<PointMapper, Point> implements ...@@ -169,7 +169,7 @@ public class PointServiceImpl extends ServiceImpl<PointMapper, Point> implements
pd.setLearnSource(date); pd.setLearnSource(date);
EntityWrapper<PointDetails> wrapper = new EntityWrapper<PointDetails>(pd); EntityWrapper<PointDetails> wrapper = new EntityWrapper<PointDetails>(pd);
int cnt = pointDetailsService.selectCount(wrapper); int cnt = pointDetailsService.selectCount(wrapper);
log.info("登录 赠送积分判断是否为首次登录:{}", cnt); log.info("当日首次打开小程序首页 赠送积分判断是否为首次打开:{}", cnt);
if(cnt <= 0) { if(cnt <= 0) {
return new PointTypeStrategy(PointTypeEnum.LOGIN, date, PointTypeEnum.LOGIN.getPoint()); return new PointTypeStrategy(PointTypeEnum.LOGIN, date, PointTypeEnum.LOGIN.getPoint());
} }
...@@ -195,15 +195,16 @@ public class PointServiceImpl extends ServiceImpl<PointMapper, Point> implements ...@@ -195,15 +195,16 @@ public class PointServiceImpl extends ServiceImpl<PointMapper, Point> implements
return null; return null;
} }
if(type.equals(PointTypeEnum.COMMENT.getKey())){ if(type.equals(PointTypeEnum.COMMENT.getKey())){
String date = DateUtil.format(new Date(), "yyyy-MM-dd");
PointDetails pd = new PointDetails(); PointDetails pd = new PointDetails();
pd.setAccountId(accountId); pd.setAccountId(accountId);
pd.setLearnType(PointTypeEnum.COMMENT.getKey()); pd.setLearnType(PointTypeEnum.COMMENT.getKey());
pd.setLearnSource(sourceId); pd.setLearnSource(date);
EntityWrapper<PointDetails> wrapper = new EntityWrapper<PointDetails>(pd); EntityWrapper<PointDetails> wrapper = new EntityWrapper<PointDetails>(pd);
int cnt = pointDetailsService.selectCount(wrapper); int cnt = pointDetailsService.selectCount(wrapper);
log.info("评论上架 赠送积分判断此活动是不是首次评论上架:{}", cnt); log.info("评论上架 赠送积分判断此活动是不是首次评论上架:{}", cnt);
if(cnt <= 0) { if(cnt <= 5) {
return new PointTypeStrategy(PointTypeEnum.COMMENT, sourceId, PointTypeEnum.COMMENT.getPoint()); return new PointTypeStrategy(PointTypeEnum.COMMENT, date, PointTypeEnum.COMMENT.getPoint());
} }
return null; return null;
} }
......
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