Commit b152f992 by “Kongxiangkun”

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

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