|
|
@@ -54,7 +54,7 @@ public class ReceivePonitsService { |
|
|
|
.eq(ThDict::getMark, MarkEnum.VALID.getCode())); |
|
|
|
if (ObjectUtil.isEmpty(dict)) { |
|
|
|
log.info("领取积分,该字典类型不存在,tenantId:{}, dictCode:{}", request.getTenantId(), DictEnum.POINTS_RULE.getCode()); |
|
|
|
return JsonResult.success("积分规则未设置"); |
|
|
|
return JsonResult.error("积分规则未设置"); |
|
|
|
} |
|
|
|
|
|
|
|
ThDictData dictData = dictDataMapper.selectOne(new LambdaQueryWrapper<ThDictData>() |
|
|
@@ -64,7 +64,7 @@ public class ReceivePonitsService { |
|
|
|
.eq(ThDictData::getMark, MarkEnum.VALID.getCode())); |
|
|
|
if (ObjectUtil.isEmpty(dictData)) { |
|
|
|
log.info("领取积分,该字典项不存在,tenantId:{}, dictDataName:{}", request.getTenantId(), DictDataEnum.WESTREAM_KNOW.getCode()); |
|
|
|
return JsonResult.success("积分规则未设置"); |
|
|
|
return JsonResult.error("积分规则未设置"); |
|
|
|
} |
|
|
|
|
|
|
|
ThDictData dailyLimitWestreamSubmitDictData = dictDataMapper.selectOne(new LambdaQueryWrapper<ThDictData>() |
|
|
@@ -74,7 +74,7 @@ public class ReceivePonitsService { |
|
|
|
.eq(ThDictData::getMark, MarkEnum.VALID.getCode())); |
|
|
|
if (ObjectUtil.isEmpty(dailyLimitWestreamSubmitDictData)) { |
|
|
|
log.info("领取积分,每日上报最大限额字典项不存在,tenantId:{}, dictDataName:{}", request.getTenantId(), DictDataEnum.DAILY_LIMIT_WESTREAM_SUBMIT.getCode()); |
|
|
|
return JsonResult.success("积分规则未设置"); |
|
|
|
return JsonResult.error("积分规则未设置"); |
|
|
|
} |
|
|
|
|
|
|
|
Integer dailyLimitWestreamSubmit = 0; |
|
|
@@ -83,11 +83,12 @@ public class ReceivePonitsService { |
|
|
|
} |
|
|
|
|
|
|
|
String pointsTime = DateUtils.getDate(); |
|
|
|
Integer totalPointsByToDay = userPointsDetailMapper.selectTotalPointsByToDay(request.getOpenid(), pointsTime); |
|
|
|
String changeName = "阅读知识"; |
|
|
|
Integer totalPointsByToDay = userPointsDetailMapper.selectTotalPointsByToDay(request.getOpenid(), pointsTime, changeName); |
|
|
|
if (ObjectUtil.isNotEmpty(totalPointsByToDay)) { |
|
|
|
if (totalPointsByToDay >= dailyLimitWestreamSubmit) { |
|
|
|
log.info("领取积分,已超过每日积分上限,totalPointsByToDay:{}, dailyLimitWestreamSubmit:{}", totalPointsByToDay, dailyLimitWestreamSubmit); |
|
|
|
return JsonResult.success("已超过每日积分上限"); |
|
|
|
return JsonResult.error("已超过每日积分上限"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@@ -97,7 +98,7 @@ public class ReceivePonitsService { |
|
|
|
.eq(WestreamUser::getMark, MarkEnum.VALID.getCode())); |
|
|
|
if (ObjectUtil.isEmpty(westreamUser)) { |
|
|
|
log.info("领取积分,该用户不存在,tenantId:{}, openid:{}", request.getTenantId(), request.getOpenid()); |
|
|
|
return JsonResult.success("该用户不存在"); |
|
|
|
return JsonResult.error("该用户不存在"); |
|
|
|
} |
|
|
|
|
|
|
|
WestreamKnowUser westreamKnowUser = westreamKnowUserMapper.selectOne(new LambdaQueryWrapper<WestreamKnowUser>() |