|
|
|
|
|
|
|
|
Integer totalPointsByToDay = userPointsDetailMapper.selectTotalPointsByToDay(request.getOpenid(), pointsTime, changeName); |
|
|
Integer totalPointsByToDay = userPointsDetailMapper.selectTotalPointsByToDay(request.getOpenid(), pointsTime, changeName); |
|
|
if (ObjectUtil.isNotEmpty(totalPointsByToDay)) { |
|
|
if (ObjectUtil.isNotEmpty(totalPointsByToDay)) { |
|
|
if (totalPointsByToDay >= dailyLimitWestreamSubmit) { |
|
|
if (totalPointsByToDay >= dailyLimitWestreamSubmit) { |
|
|
log.info("领取积分,已超过每日积分上限,totalPointsByToDay:{}, dailyLimitWestreamSubmit:{}", totalPointsByToDay, dailyLimitWestreamSubmit); |
|
|
|
|
|
return JsonResult.error("已超过每日积分上限"); |
|
|
|
|
|
|
|
|
log.info("领取积分,已超过每日领取积分上限,totalPointsByToDay:{}, dailyLimitWestreamSubmit:{}", totalPointsByToDay, dailyLimitWestreamSubmit); |
|
|
|
|
|
return JsonResult.error("已超过每日领取积分上限"); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
Integer points = 0; |
|
|
|
|
|
if (ObjectUtil.isNotEmpty(dictData)) { |
|
|
|
|
|
points = Integer.parseInt(dictData.getValue()); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
if ((points + totalPointsByToDay) >= dailyLimitWestreamSubmit) { |
|
|
|
|
|
log.info("此次领取积分,加上今天已领积分,已超过每日积分上限,points:{},totalPointsByToDay:{}, dailyLimitWestreamSubmit:{}", points, totalPointsByToDay, dailyLimitWestreamSubmit); |
|
|
|
|
|
return JsonResult.error("此次领取积分,加上今天已领积分,已超过每日积分上限"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
WestreamUser westreamUser = westreamUserMapper.selectOne(new LambdaQueryWrapper<WestreamUser>() |
|
|
WestreamUser westreamUser = westreamUserMapper.selectOne(new LambdaQueryWrapper<WestreamUser>() |
|
|
.eq(WestreamUser::getTenantId, request.getTenantId()) |
|
|
.eq(WestreamUser::getTenantId, request.getTenantId()) |
|
|
|
|
|
|
|
|
userPointsDetail.setChangeName("阅读知识"); |
|
|
userPointsDetail.setChangeName("阅读知识"); |
|
|
userPointsDetail.setType(1); |
|
|
userPointsDetail.setType(1); |
|
|
userPointsDetail.setCreateTime(DateUtils.now()); |
|
|
userPointsDetail.setCreateTime(DateUtils.now()); |
|
|
Integer points = 0; |
|
|
|
|
|
if (ObjectUtil.isNotEmpty(dictData)) { |
|
|
|
|
|
points = Integer.parseInt(dictData.getValue()); |
|
|
|
|
|
userPointsDetail.setPointsChange(points); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
userPointsDetail.setPointsChange(points); |
|
|
userPointsDetail.setPointsTime(DateUtils.now()); |
|
|
userPointsDetail.setPointsTime(DateUtils.now()); |
|
|
|
|
|
|
|
|
Integer row = userPointsDetailMapper.insert(userPointsDetail); |
|
|
Integer row = userPointsDetailMapper.insert(userPointsDetail); |