1、企业添加字段
2、新增推荐下线列表API 3、新增注册绑定关系
This commit is contained in:
@@ -59,6 +59,8 @@ public class WxLoginController extends BaseController {
|
||||
private RedisUtil redisUtil;
|
||||
@Resource
|
||||
private ConfigProperties config;
|
||||
@Resource
|
||||
private UserRefereeService userRefereeService;
|
||||
|
||||
public WxLoginController(StringRedisTemplate redisTemplate) {
|
||||
this.redisTemplate = redisTemplate;
|
||||
@@ -168,6 +170,16 @@ public class WxLoginController extends BaseController {
|
||||
userRole.setRoleId(addUser.getRoleId());
|
||||
userRoleService.save(userRole);
|
||||
}
|
||||
// 绑定关系
|
||||
if (userParam.getSceneType() != null && userParam.getSceneType().equals("save_referee") && userParam.getRefereeId() != null) {
|
||||
UserReferee check = userRefereeService.check(addUser.getUserId(), userParam.getRefereeId());
|
||||
if (check == null) {
|
||||
UserReferee userReferee = new UserReferee();
|
||||
userReferee.setDealerId(addUser.getUserId());
|
||||
userReferee.setUserId(userParam.getRefereeId());
|
||||
userRefereeService.save(userReferee);
|
||||
}
|
||||
}
|
||||
return addUser;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,4 +39,5 @@ public interface UserRefereeService extends IService<UserReferee> {
|
||||
*/
|
||||
UserReferee getByIdRel(Integer id);
|
||||
|
||||
UserReferee check(Integer dealerId, Integer userId);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.gxwebsoft.common.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.common.system.mapper.UserRefereeMapper;
|
||||
import com.gxwebsoft.common.system.service.UserRefereeService;
|
||||
@@ -44,4 +45,13 @@ public class UserRefereeServiceImpl extends ServiceImpl<UserRefereeMapper, UserR
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserReferee check(Integer dealerId, Integer userId) {
|
||||
return getOne(
|
||||
new LambdaQueryWrapper<UserReferee>()
|
||||
.eq(UserReferee::getDealerId, dealerId)
|
||||
.eq(UserReferee::getUserId, userId)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user