Browse Source

提交领取积分代码

pull/31/head
wanjing 11 months ago
parent
commit
3f85aa9eba
1 changed files with 10 additions and 9 deletions
  1. +10
    -9
      tuoheng-api/src/main/java/com/tuoheng/api/service/points/receive/ReceivePonitsService.java

+ 10
- 9
tuoheng-api/src/main/java/com/tuoheng/api/service/points/receive/ReceivePonitsService.java View File

log.info("全民护河领取积分:校验失败:{}", result.getMsg()); log.info("全民护河领取积分:校验失败:{}", result.getMsg());
return result; return result;
} }
WestreamKnowUser westreamKnowUser = westreamKnowUserMapper.selectOne(new LambdaQueryWrapper<WestreamKnowUser>() WestreamKnowUser westreamKnowUser = westreamKnowUserMapper.selectOne(new LambdaQueryWrapper<WestreamKnowUser>()
.eq(WestreamKnowUser::getTenantId, request.getTenantId()) .eq(WestreamKnowUser::getTenantId, request.getTenantId())
.eq(WestreamKnowUser::getOpenid, request.getOpenid()) .eq(WestreamKnowUser::getOpenid, request.getOpenid())
.eq(WestreamKnowUser::getKnowId, request.getKnowId()) .eq(WestreamKnowUser::getKnowId, request.getKnowId())
.eq(WestreamKnowUser::getMark, MarkEnum.VALID.getCode())); .eq(WestreamKnowUser::getMark, MarkEnum.VALID.getCode()));
if (ObjectUtil.isNotEmpty(westreamKnowUser)) { if (ObjectUtil.isNotEmpty(westreamKnowUser)) {
log.info("您已获得过积分了,仅能获取一次积分。");
return JsonResult.error("您已获得过积分了,仅能获取一次积分。"); 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>() ThDict dict = dictMapper.selectOne(new LambdaQueryWrapper<ThDict>()
return JsonResult.error("该用户不存在"); return JsonResult.error("该用户不存在");
} }


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 userPointsDetail = new UserPointsDetail();
userPointsDetail.setTenantId(request.getTenantId()); userPointsDetail.setTenantId(request.getTenantId());
userPointsDetail.setOpenid(request.getOpenid()); userPointsDetail.setOpenid(request.getOpenid());

Loading…
Cancel
Save