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