|
|
@@ -47,6 +47,23 @@ public class ReceivePonitsService { |
|
|
|
log.info("全民护河领取积分:校验失败:{}", result.getMsg()); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
WestreamKnowUser westreamKnowUser = westreamKnowUserMapper.selectOne(new LambdaQueryWrapper<WestreamKnowUser>() |
|
|
|
.eq(WestreamKnowUser::getTenantId, request.getTenantId()) |
|
|
|
.eq(WestreamKnowUser::getOpenid, request.getOpenid()) |
|
|
|
.eq(WestreamKnowUser::getKnowId, request.getKnowId()) |
|
|
|
.eq(WestreamKnowUser::getMark, MarkEnum.VALID.getCode())); |
|
|
|
if (ObjectUtil.isNotEmpty(westreamKnowUser)) { |
|
|
|
return JsonResult.error("您已获得过积分了,仅能获取一次积分。"); |
|
|
|
} else { |
|
|
|
westreamKnowUser = new WestreamKnowUser(); |
|
|
|
westreamKnowUser.setTenantId(request.getTenantId()); |
|
|
|
westreamKnowUser.setOpenid(request.getOpenid()); |
|
|
|
westreamKnowUser.setKnowId(request.getKnowId()); |
|
|
|
westreamKnowUser.setCreateUser(0); |
|
|
|
westreamKnowUser.setCreateTime(DateUtils.now()); |
|
|
|
westreamKnowUserMapper.insert(westreamKnowUser); |
|
|
|
} |
|
|
|
|
|
|
|
ThDict dict = dictMapper.selectOne(new LambdaQueryWrapper<ThDict>() |
|
|
|
.eq(ThDict::getTenantId, request.getTenantId()) |
|
|
@@ -88,7 +105,7 @@ public class ReceivePonitsService { |
|
|
|
if (ObjectUtil.isNotEmpty(totalPointsByToDay)) { |
|
|
|
if (totalPointsByToDay >= dailyLimitWestreamSubmit) { |
|
|
|
log.info("领取积分,已超过每日领取积分上限,totalPointsByToDay:{}, dailyLimitWestreamSubmit:{}", totalPointsByToDay, dailyLimitWestreamSubmit); |
|
|
|
return JsonResult.error("已超过每日领取积分上限"); |
|
|
|
return JsonResult.error("今日积分已领取或已超过每日积分上限"); |
|
|
|
} |
|
|
|
} else { |
|
|
|
totalPointsByToDay = 0; |
|
|
@@ -100,7 +117,7 @@ public class ReceivePonitsService { |
|
|
|
} |
|
|
|
if ((points + totalPointsByToDay) > dailyLimitWestreamSubmit) { |
|
|
|
log.info("此次领取积分,加上今天已领积分,已超过每日积分上限,points:{},totalPointsByToDay:{}, dailyLimitWestreamSubmit:{}", points, totalPointsByToDay, dailyLimitWestreamSubmit); |
|
|
|
return JsonResult.error("此次领取积分,加上今天已领积分,已超过每日积分上限"); |
|
|
|
return JsonResult.error("今日积分已领取或已超过每日积分上限"); |
|
|
|
} |
|
|
|
|
|
|
|
WestreamUser westreamUser = westreamUserMapper.selectOne(new LambdaQueryWrapper<WestreamUser>() |
|
|
@@ -112,23 +129,6 @@ public class ReceivePonitsService { |
|
|
|
return JsonResult.error("该用户不存在"); |
|
|
|
} |
|
|
|
|
|
|
|
WestreamKnowUser westreamKnowUser = westreamKnowUserMapper.selectOne(new LambdaQueryWrapper<WestreamKnowUser>() |
|
|
|
.eq(WestreamKnowUser::getTenantId, request.getTenantId()) |
|
|
|
.eq(WestreamKnowUser::getOpenid, request.getOpenid()) |
|
|
|
.eq(WestreamKnowUser::getKnowId, request.getKnowId()) |
|
|
|
.eq(WestreamKnowUser::getMark, MarkEnum.VALID.getCode())); |
|
|
|
if (ObjectUtil.isNotEmpty(westreamKnowUser)) { |
|
|
|
return JsonResult.error("您已获得过积分了,仅能获取一次积分。"); |
|
|
|
} else { |
|
|
|
westreamKnowUser = new WestreamKnowUser(); |
|
|
|
westreamKnowUser.setTenantId(request.getTenantId()); |
|
|
|
westreamKnowUser.setOpenid(request.getOpenid()); |
|
|
|
westreamKnowUser.setKnowId(request.getKnowId()); |
|
|
|
westreamKnowUser.setCreateUser(0); |
|
|
|
westreamKnowUser.setCreateTime(DateUtils.now()); |
|
|
|
westreamKnowUserMapper.insert(westreamKnowUser); |
|
|
|
} |
|
|
|
|
|
|
|
UserPointsDetail userPointsDetail = new UserPointsDetail(); |
|
|
|
userPointsDetail.setTenantId(request.getTenantId()); |
|
|
|
userPointsDetail.setOpenid(request.getOpenid()); |