1、企业添加字段
2、添加推荐下线列表API
This commit is contained in:
@@ -136,23 +136,48 @@ public class UserRefereeController extends BaseController {
|
||||
@ApiOperation("查询推荐人信息")
|
||||
@GetMapping("/getReferee/{id}")
|
||||
public ApiResult<User> getReferee(@PathVariable("id") Integer id) {
|
||||
if(id == null){
|
||||
return fail("参数错误",null);
|
||||
if (id == null) {
|
||||
return fail("参数错误", null);
|
||||
}
|
||||
|
||||
final UserReferee referee = userRefereeService.getOne(new LambdaQueryWrapper<UserReferee>()
|
||||
.eq(UserReferee::getUserId, id)
|
||||
.eq(UserReferee::getDeleted,0));
|
||||
.eq(UserReferee::getDeleted, 0));
|
||||
|
||||
if (ObjectUtil.isEmpty(referee)) {
|
||||
return fail("查询失败",null);
|
||||
return fail("查询失败", null);
|
||||
}
|
||||
|
||||
final User user = userService.getByIdRel(referee.getDealerId());
|
||||
if (ObjectUtil.isNotEmpty(user)) {
|
||||
return success(user);
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -67,6 +67,9 @@
|
||||
</if>
|
||||
<if test="param.leaderId != null">
|
||||
AND a.leader_id = #{param.leaderId}
|
||||
</if>
|
||||
<if test="param.estateOnly != null">
|
||||
AND a.estate IS NOT null
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
|
||||
@@ -133,6 +133,12 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</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">
|
||||
AND a.phone IN
|
||||
<foreach collection="param.phones" item="item" separator="," open="(" close=")">
|
||||
|
||||
@@ -66,6 +66,10 @@ public class OrganizationParam extends BaseParam {
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private String park;
|
||||
|
||||
@ApiModelProperty(value = "有所属产业的企业")
|
||||
@TableField(exist = false)
|
||||
private Boolean estateOnly;
|
||||
|
||||
@ApiModelProperty(value = "机构图片")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private String image;
|
||||
|
||||
@@ -13,6 +13,7 @@ import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@@ -86,6 +87,10 @@ public class UserParam extends BaseParam {
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer organizationId;
|
||||
|
||||
@ApiModelProperty("机构id合集")
|
||||
@TableField(exist = false)
|
||||
private Set<Integer> organizationIds;
|
||||
|
||||
@ApiModelProperty("用户分组ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer groupId;
|
||||
|
||||
Reference in New Issue
Block a user