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

@@ -47,22 +47,15 @@ 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)) {
log.info("您已获得过积分了,仅能获取一次积分。");
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>()
@@ -129,6 +122,14 @@ public class ReceivePonitsService {
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.setTenantId(request.getTenantId());
userPointsDetail.setOpenid(request.getOpenid());

Loading…
Cancel
Save