Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -155,4 +155,29 @@ public class UserRefereeController extends BaseController {
|
|||||||
return fail("查询失败", null);
|
return fail("查询失败", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询推荐人列表")
|
||||||
|
@GetMapping("/getRefereeList/{id}")
|
||||||
|
public ApiResult<List<User>> getRefereeList(@PathVariable("id") Integer id) {
|
||||||
|
if (id == null) {
|
||||||
|
return fail("参数错误", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
final List<UserReferee> refereeList = userRefereeService.list(new LambdaQueryWrapper<UserReferee>()
|
||||||
|
.eq(UserReferee::getUserId, id)
|
||||||
|
.eq(UserReferee::getDeleted, 0));
|
||||||
|
|
||||||
|
if (ObjectUtil.isEmpty(refereeList)) {
|
||||||
|
return fail("查询失败", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
final List<User> users = userService.list(
|
||||||
|
new LambdaQueryWrapper<User>()
|
||||||
|
.in(User::getUserId, refereeList.stream().map(UserReferee::getDealerId).toList())
|
||||||
|
);
|
||||||
|
if (ObjectUtil.isNotEmpty(users)) {
|
||||||
|
return success(users);
|
||||||
|
}
|
||||||
|
return fail("查询失败", null);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,6 +59,8 @@ public class WxLoginController extends BaseController {
|
|||||||
private RedisUtil redisUtil;
|
private RedisUtil redisUtil;
|
||||||
@Resource
|
@Resource
|
||||||
private ConfigProperties config;
|
private ConfigProperties config;
|
||||||
|
@Resource
|
||||||
|
private UserRefereeService userRefereeService;
|
||||||
|
|
||||||
public WxLoginController(StringRedisTemplate redisTemplate) {
|
public WxLoginController(StringRedisTemplate redisTemplate) {
|
||||||
this.redisTemplate = redisTemplate;
|
this.redisTemplate = redisTemplate;
|
||||||
@@ -168,6 +170,16 @@ public class WxLoginController extends BaseController {
|
|||||||
userRole.setRoleId(addUser.getRoleId());
|
userRole.setRoleId(addUser.getRoleId());
|
||||||
userRoleService.save(userRole);
|
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;
|
return addUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -86,6 +86,9 @@ public class Organization implements Serializable {
|
|||||||
@ApiModelProperty(value = "所属行业")
|
@ApiModelProperty(value = "所属行业")
|
||||||
private String industry;
|
private String industry;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "所属产业")
|
||||||
|
private String estate;
|
||||||
|
|
||||||
@ApiModelProperty(value = "负责人id")
|
@ApiModelProperty(value = "负责人id")
|
||||||
private Integer leaderId;
|
private Integer leaderId;
|
||||||
|
|
||||||
|
|||||||
@@ -67,6 +67,9 @@
|
|||||||
</if>
|
</if>
|
||||||
<if test="param.leaderId != null">
|
<if test="param.leaderId != null">
|
||||||
AND a.leader_id = #{param.leaderId}
|
AND a.leader_id = #{param.leaderId}
|
||||||
|
</if>
|
||||||
|
<if test="param.estateOnly != null">
|
||||||
|
AND a.estate IS NOT null
|
||||||
</if>
|
</if>
|
||||||
<if test="param.comments != null">
|
<if test="param.comments != null">
|
||||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
|||||||
@@ -137,6 +137,12 @@
|
|||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
|
<if test="param.organizationIds != null">
|
||||||
|
AND a.organization_id IN
|
||||||
|
<foreach collection="param.organizationIds" item="item" separator="," open="(" close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
<if test="param.phones != null">
|
<if test="param.phones != null">
|
||||||
AND a.phone IN
|
AND a.phone IN
|
||||||
<foreach collection="param.phones" item="item" separator="," open="(" close=")">
|
<foreach collection="param.phones" item="item" separator="," open="(" close=")">
|
||||||
|
|||||||
@@ -66,6 +66,10 @@ public class OrganizationParam extends BaseParam {
|
|||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private String park;
|
private String park;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "有所属产业的企业")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Boolean estateOnly;
|
||||||
|
|
||||||
@ApiModelProperty(value = "机构图片")
|
@ApiModelProperty(value = "机构图片")
|
||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private String image;
|
private String image;
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import lombok.EqualsAndHashCode;
|
|||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -86,6 +87,10 @@ public class UserParam extends BaseParam {
|
|||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer organizationId;
|
private Integer organizationId;
|
||||||
|
|
||||||
|
@ApiModelProperty("机构id合集")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Set<Integer> organizationIds;
|
||||||
|
|
||||||
@ApiModelProperty("用户分组ID")
|
@ApiModelProperty("用户分组ID")
|
||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer groupId;
|
private Integer groupId;
|
||||||
|
|||||||
@@ -39,4 +39,5 @@ public interface UserRefereeService extends IService<UserReferee> {
|
|||||||
*/
|
*/
|
||||||
UserReferee getByIdRel(Integer id);
|
UserReferee getByIdRel(Integer id);
|
||||||
|
|
||||||
|
UserReferee check(Integer dealerId, Integer userId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.gxwebsoft.common.system.service.impl;
|
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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.gxwebsoft.common.system.mapper.UserRefereeMapper;
|
import com.gxwebsoft.common.system.mapper.UserRefereeMapper;
|
||||||
import com.gxwebsoft.common.system.service.UserRefereeService;
|
import com.gxwebsoft.common.system.service.UserRefereeService;
|
||||||
@@ -44,4 +45,13 @@ public class UserRefereeServiceImpl extends ServiceImpl<UserRefereeMapper, UserR
|
|||||||
return param.getOne(baseMapper.selectListRel(param));
|
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