新增网格员接口
This commit is contained in:
parent
090de658ff
commit
69d38c2a1b
@ -3,11 +3,13 @@ package cn.com.tenlion.usercenter.controller.resource.teammember;
|
|||||||
import cn.com.tenlion.usercenter.pojo.dtos.teammember.TeamMemberDTO;
|
import cn.com.tenlion.usercenter.pojo.dtos.teammember.TeamMemberDTO;
|
||||||
import cn.com.tenlion.usercenter.service.teammember.ITeamMemberService;
|
import cn.com.tenlion.usercenter.service.teammember.ITeamMemberService;
|
||||||
import ink.wgink.common.base.DefaultBaseController;
|
import ink.wgink.common.base.DefaultBaseController;
|
||||||
|
import ink.wgink.exceptions.ParamsException;
|
||||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||||
import ink.wgink.pojo.ListPage;
|
import ink.wgink.pojo.ListPage;
|
||||||
import ink.wgink.pojo.result.ErrorResult;
|
import ink.wgink.pojo.result.ErrorResult;
|
||||||
import ink.wgink.pojo.result.SuccessResultData;
|
import ink.wgink.pojo.result.SuccessResultData;
|
||||||
import ink.wgink.pojo.result.SuccessResultList;
|
import ink.wgink.pojo.result.SuccessResultList;
|
||||||
|
import ink.wgink.pojo.vos.IdsVO;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@ -196,4 +198,42 @@ public class TeamMemberResourceController extends DefaultBaseController {
|
|||||||
return teamMemberService.listPageSubByAreaCodeAndSort(areaCode, sort, page);
|
return teamMemberService.listPageSubByAreaCodeAndSort(areaCode, sort, page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "队伍人员列表(通过部门ID列表)", notes = "队伍人员列表(通过部门ID列表)接口")
|
||||||
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
|
@PostMapping("list/department-ids")
|
||||||
|
public List<TeamMemberDTO> listByDepartmentIds(@RequestBody IdsVO idsVO) {
|
||||||
|
if (idsVO.getIds().isEmpty()) {
|
||||||
|
throw new ParamsException("id列表不能为空");
|
||||||
|
}
|
||||||
|
return teamMemberService.listByDepartmentIds(idsVO.getIds());
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取队伍人员分页列表(通过部门ID列表)", notes = "获取队伍人员分页列表(通过部门ID列表)接口")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
||||||
|
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
||||||
|
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
|
||||||
|
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
|
||||||
|
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
|
||||||
|
})
|
||||||
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
|
@PostMapping("listpage/department-ids")
|
||||||
|
public SuccessResultList<List<TeamMemberDTO>> listPageByDepartmentIds(ListPage page, @RequestBody IdsVO idsVO) {
|
||||||
|
if (idsVO.getIds().isEmpty()) {
|
||||||
|
throw new ParamsException("id列表不能为空");
|
||||||
|
}
|
||||||
|
Map<String, Object> params = requestParams();
|
||||||
|
page.setParams(params);
|
||||||
|
return teamMemberService.listPageByDepartmentIds(page, idsVO.getIds());
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "队伍人员统计(通过部门ID列表)", notes = "队伍人员统计(通过部门ID列表)接口")
|
||||||
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
|
@PostMapping("count/department-ids")
|
||||||
|
public SuccessResultData<Integer> countByDepartmentIds(@RequestBody IdsVO idsVO) {
|
||||||
|
if (idsVO.getIds().isEmpty()) {
|
||||||
|
throw new ParamsException("id列表不能为空");
|
||||||
|
}
|
||||||
|
return teamMemberService.countByDepartmentIds(idsVO.getIds());
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,6 +1,7 @@
|
|||||||
package cn.com.tenlion.usercenter.service.teammember;
|
package cn.com.tenlion.usercenter.service.teammember;
|
||||||
|
|
||||||
import ink.wgink.pojo.ListPage;
|
import ink.wgink.pojo.ListPage;
|
||||||
|
import ink.wgink.pojo.result.SuccessResultData;
|
||||||
import ink.wgink.pojo.result.SuccessResultList;
|
import ink.wgink.pojo.result.SuccessResultList;
|
||||||
import cn.com.tenlion.usercenter.pojo.dtos.teammember.TeamMemberDTO;
|
import cn.com.tenlion.usercenter.pojo.dtos.teammember.TeamMemberDTO;
|
||||||
import cn.com.tenlion.usercenter.pojo.vos.teammember.TeamMemberVO;
|
import cn.com.tenlion.usercenter.pojo.vos.teammember.TeamMemberVO;
|
||||||
@ -303,4 +304,28 @@ public interface ITeamMemberService {
|
|||||||
*/
|
*/
|
||||||
SuccessResultList<List<TeamMemberDTO>> listPageSubByAreaCodeAndSort(String areaCode, String sort, ListPage page);
|
SuccessResultList<List<TeamMemberDTO>> listPageSubByAreaCodeAndSort(String areaCode, String sort, ListPage page);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 队伍人员列表(通过部门ID列表)
|
||||||
|
*
|
||||||
|
* @param departmentIds 部门ID列表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<TeamMemberDTO> listByDepartmentIds(List<String> departmentIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取队伍人员分页列表(通过部门ID列表)
|
||||||
|
*
|
||||||
|
* @param page
|
||||||
|
* @param departmentIds 部门ID列表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
SuccessResultList<List<TeamMemberDTO>> listPageByDepartmentIds(ListPage page, List<String> departmentIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 队伍人员统计(通过部门ID列表)
|
||||||
|
*
|
||||||
|
* @param departmentIds
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
SuccessResultData<Integer> countByDepartmentIds(List<String> departmentIds);
|
||||||
}
|
}
|
@ -14,7 +14,9 @@ import ink.wgink.interfaces.role.IRoleUserBaseService;
|
|||||||
import ink.wgink.interfaces.user.IUserBaseService;
|
import ink.wgink.interfaces.user.IUserBaseService;
|
||||||
import ink.wgink.pojo.ListPage;
|
import ink.wgink.pojo.ListPage;
|
||||||
import ink.wgink.pojo.dtos.user.UserDTO;
|
import ink.wgink.pojo.dtos.user.UserDTO;
|
||||||
|
import ink.wgink.pojo.result.SuccessResultData;
|
||||||
import ink.wgink.pojo.result.SuccessResultList;
|
import ink.wgink.pojo.result.SuccessResultList;
|
||||||
|
import ink.wgink.service.department.service.IDepartmentUserService;
|
||||||
import ink.wgink.util.UUIDUtil;
|
import ink.wgink.util.UUIDUtil;
|
||||||
import ink.wgink.util.map.HashMapUtil;
|
import ink.wgink.util.map.HashMapUtil;
|
||||||
import ink.wgink.util.string.WStringUtil;
|
import ink.wgink.util.string.WStringUtil;
|
||||||
@ -40,6 +42,8 @@ public class TeamMemberServiceImpl extends DefaultBaseService implements ITeamMe
|
|||||||
private IUserBaseService userBaseService;
|
private IUserBaseService userBaseService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IRoleUserBaseService roleUserBaseService;
|
private IRoleUserBaseService roleUserBaseService;
|
||||||
|
@Autowired
|
||||||
|
private IDepartmentUserService departmentUserService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void save(TeamMemberVO teamMemberVO) {
|
public void save(TeamMemberVO teamMemberVO) {
|
||||||
@ -297,6 +301,38 @@ public class TeamMemberServiceImpl extends DefaultBaseService implements ITeamMe
|
|||||||
return listPage(page);
|
return listPage(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TeamMemberDTO> listByDepartmentIds(List<String> departmentIds) {
|
||||||
|
List<String> userIds = departmentUserService.listUserId(departmentIds);
|
||||||
|
if (userIds.isEmpty()) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
Map<String, Object> params = getHashMap(2);
|
||||||
|
params.put("userIds", userIds);
|
||||||
|
return list(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SuccessResultList<List<TeamMemberDTO>> listPageByDepartmentIds(ListPage page, List<String> departmentIds) {
|
||||||
|
List<String> userIds = departmentUserService.listUserId(departmentIds);
|
||||||
|
if (userIds.isEmpty()) {
|
||||||
|
return new SuccessResultList<>(new ArrayList<>(), 1, 0L);
|
||||||
|
}
|
||||||
|
page.getParams().put("userIds", userIds);
|
||||||
|
return listPage(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SuccessResultData<Integer> countByDepartmentIds(List<String> departmentIds) {
|
||||||
|
List<String> userIds = departmentUserService.listUserId(departmentIds);
|
||||||
|
if (userIds.isEmpty()) {
|
||||||
|
return new SuccessResultData<>(0);
|
||||||
|
}
|
||||||
|
Map<String, Object> params = getHashMap(2);
|
||||||
|
params.put("userIds", userIds);
|
||||||
|
return new SuccessResultData<>(count(params));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置用户
|
* 设置用户
|
||||||
*
|
*
|
||||||
|
@ -373,6 +373,13 @@
|
|||||||
<if test="areaCode != null and areaCode != ''">
|
<if test="areaCode != null and areaCode != ''">
|
||||||
t1.area_code = #{areaCode}
|
t1.area_code = #{areaCode}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="userIds != null and userIds.size > 0">
|
||||||
|
AND
|
||||||
|
t1.user_id IN
|
||||||
|
<foreach collection="userIds" index="index" open="(" separator="," close=")">
|
||||||
|
#{userIds[${index}]}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user