新增资源接口,调整名称
This commit is contained in:
parent
025114837e
commit
ccf133f9ae
@ -143,7 +143,7 @@ public interface IDepartmentBaseService {
|
||||
* @param departmentParentId
|
||||
* @return
|
||||
*/
|
||||
List<DepartmentPO> listByParentId(String departmentParentId);
|
||||
List<DepartmentPO> listPOByParentId(String departmentParentId);
|
||||
|
||||
/**
|
||||
* 通过上级ID和添加获取组织部门全部增量列表(简单格式)
|
||||
@ -152,7 +152,7 @@ public interface IDepartmentBaseService {
|
||||
* @param addDate
|
||||
* @return
|
||||
*/
|
||||
List<DepartmentPO> listByParentIdAndAddDate(String departmentParentId, String addDate);
|
||||
List<DepartmentPO> listPOByParentIdAndAddDate(String departmentParentId, String addDate);
|
||||
|
||||
/**
|
||||
* 通过上级ID和更新获取组织部门全部新增和修改的列表(简单格式)
|
||||
@ -161,6 +161,6 @@ public interface IDepartmentBaseService {
|
||||
* @param updateDate
|
||||
* @return
|
||||
*/
|
||||
List<DepartmentPO> listByParentIdAndUpdateDate(String departmentParentId, String updateDate);
|
||||
List<DepartmentPO> listPOByParentIdAndUpdateDate(String departmentParentId, String updateDate);
|
||||
|
||||
}
|
||||
|
@ -21,6 +21,8 @@ public class IdsVO {
|
||||
|
||||
@ApiModelProperty(name = "ids", value = "ID列表")
|
||||
private List<String> ids;
|
||||
@ApiModelProperty(name = "ids2", value = "ID列表")
|
||||
private List<String> ids2;
|
||||
|
||||
public List<String> getIds() {
|
||||
return ids == null ? new ArrayList() : ids;
|
||||
@ -30,11 +32,21 @@ public class IdsVO {
|
||||
this.ids = ids;
|
||||
}
|
||||
|
||||
public List<String> getIds2() {
|
||||
return ids2;
|
||||
}
|
||||
|
||||
public void setIds2(List<String> ids2) {
|
||||
this.ids2 = ids2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuilder sb = new StringBuilder("{");
|
||||
sb.append("\"ids\":")
|
||||
.append(ids);
|
||||
sb.append(",\"ids2\":")
|
||||
.append(ids2);
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
|
@ -0,0 +1,195 @@
|
||||
package ink.wgink.service.department.controller.resources;
|
||||
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.dtos.ZTreeDTO;
|
||||
import ink.wgink.pojo.dtos.department.DepartmentDTO;
|
||||
import ink.wgink.pojo.pos.DepartmentPO;
|
||||
import ink.wgink.pojo.result.ErrorResult;
|
||||
import ink.wgink.pojo.result.SuccessResultData;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.pojo.vos.IdsVO;
|
||||
import ink.wgink.service.department.service.IDepartmentService;
|
||||
import io.swagger.annotations.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: DepartmentController
|
||||
* @Description: 组织部门
|
||||
* @Author: wenc
|
||||
* @Date: 2019/1/8 7:23 PM
|
||||
* @Version: 1.0
|
||||
**/
|
||||
@Api(tags = ISystemConstant.API_TAGS_RESOURCE_PREFIX + "组织部门")
|
||||
@RestController
|
||||
@RequestMapping(ISystemConstant.RESOURCE_PREFIX + "/department")
|
||||
public class DepartmentResourceController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private IDepartmentService departmentService;
|
||||
|
||||
@ApiOperation(value = "组织部门列表", notes = "组织部门列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "departmentParentId", value = "组织部门上级ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list")
|
||||
public List<DepartmentDTO> list() {
|
||||
Map<String, Object> params = new HashMap<>(0);
|
||||
return departmentService.list(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "组织部门列表", notes = "组织部门列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "departmentParentId", value = "组织部门上级ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list/{departmentParentId}")
|
||||
public List<DepartmentDTO> list(@PathVariable("departmentParentId") String departmentParentId) {
|
||||
Map<String, Object> params = new HashMap<>(0);
|
||||
params.put("departmentParentId", departmentParentId);
|
||||
return departmentService.list(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "组织部门列表", notes = "组织部门列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "departmentParentId", value = "组织部门上级ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list-all")
|
||||
public List<DepartmentDTO> listAll() {
|
||||
Map<String, Object> params = requestParams();
|
||||
return departmentService.listAll(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "组织部门zTree列表", notes = "组织部门zTree列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "父ID", paramType = "query", dataType = "String")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list-ztree")
|
||||
public List<ZTreeDTO> listZTree() {
|
||||
Map<String, Object> params = requestParams();
|
||||
String departmentParentId = "0";
|
||||
if (!StringUtils.isBlank(params.get("id") == null ? null : params.get("id").toString())) {
|
||||
departmentParentId = params.get("id").toString();
|
||||
}
|
||||
return departmentService.listZTree(departmentParentId, params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "组织部门详情", notes = "组织部门详情接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "departmentId", value = "部门ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("get/{departmentId}")
|
||||
public DepartmentDTO get(@PathVariable("departmentId") String departmentId) {
|
||||
return departmentService.get(departmentId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "组织部门分页列表", notes = "组织部门分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "parentId", value = "上级ID", paramType = "query", dataType = "String"),
|
||||
@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)})
|
||||
@GetMapping("listpage")
|
||||
public SuccessResultList<List<DepartmentDTO>> listPage(ListPage page) {
|
||||
Map<String, Object> params = requestParams();
|
||||
String departmentParentId = "0";
|
||||
if (!StringUtils.isBlank(params.get("parentId") == null ? null : params.get("parentId").toString())) {
|
||||
departmentParentId = params.get("parentId").toString();
|
||||
}
|
||||
params.put("departmentParentId", departmentParentId);
|
||||
page.setParams(params);
|
||||
return departmentService.listPage(page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "组织部门详情", notes = "组织部门详情接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "departmentId", value = "部门ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("get-po/{departmentId}")
|
||||
public DepartmentPO getPO(@PathVariable("departmentId") String departmentId) {
|
||||
return departmentService.getPO(departmentId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "组织部门详情", notes = "组织部门详情接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list-po")
|
||||
public List<DepartmentPO> listPO() {
|
||||
Map<String, Object> params = requestParams();
|
||||
return departmentService.listPO(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "组织部门ID列表", notes = "组织部门ID列表接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list-id")
|
||||
public List<String> listId() {
|
||||
Map<String, Object> params = requestParams();
|
||||
return departmentService.listId(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "组织部门详情", notes = "组织部门详情接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "departmentParentId", value = "上级部门ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list-po/parentid/{departmentParentId}")
|
||||
public List<DepartmentPO> listPOByParentId(@PathVariable("departmentParentId") String departmentParentId) {
|
||||
return departmentService.listPOByParentId(departmentParentId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "组织部门详情", notes = "组织部门详情接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "departmentId", value = "部门ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PostMapping("list-po/ids")
|
||||
public List<DepartmentPO> listPO(@RequestBody IdsVO idsVO) {
|
||||
return departmentService.listPO(idsVO.getIds());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "组织部门详情", notes = "组织部门详情接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "departmentParentId", value = "上级部门ID", paramType = "path"),
|
||||
@ApiImplicitParam(name = "addDate", value = "添加时间,yyyy-MM-dd", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list-po/parentid/{departmentParentId}/add-date/{addDate}")
|
||||
public List<DepartmentPO> listPOByParentIdAndAddDate(@PathVariable("departmentParentId") String departmentParentId, @PathVariable("addDate") String addDate) {
|
||||
return departmentService.listPOByParentIdAndAddDate(departmentParentId, addDate);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "组织部门详情", notes = "组织部门详情接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "departmentParentId", value = "上级部门ID", paramType = "path"),
|
||||
@ApiImplicitParam(name = "updateDate", value = "修改时间,yyyy-MM-dd", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list-po/parentid/{departmentParentId}/update-date/{updateDate}")
|
||||
public List<DepartmentPO> listPOByParentIdAndUpdateDate(@PathVariable("departmentParentId") String departmentParentId, @PathVariable("updateDate") String updateDate) {
|
||||
return departmentService.listPOByParentIdAndUpdateDate(departmentParentId, updateDate);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "统计", notes = "统计接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("count")
|
||||
public SuccessResultData<Integer> count() {
|
||||
Map<String, Object> params = requestParams();
|
||||
Integer count = departmentService.count(params);
|
||||
return new SuccessResultData<>(count);
|
||||
}
|
||||
}
|
@ -0,0 +1,111 @@
|
||||
package ink.wgink.service.department.controller.resources;
|
||||
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.dtos.department.DepartmentUserDTO;
|
||||
import ink.wgink.pojo.result.ErrorResult;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.pojo.vos.IdsVO;
|
||||
import ink.wgink.service.department.service.IDepartmentUserService;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* When you feel like quitting. Think about why you started
|
||||
* 当你想要放弃的时候,想想当初你为何开始
|
||||
*
|
||||
* @ClassName: DepartmentUserController
|
||||
* @Description: 组织部门用户
|
||||
* @Author: wanggeng
|
||||
* @Date: 2021/1/28 4:19 下午
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Api(tags = ISystemConstant.API_TAGS_RESOURCE_PREFIX + "组织部门用户")
|
||||
@RestController
|
||||
@RequestMapping(ISystemConstant.RESOURCE_PREFIX + "/department/user")
|
||||
public class DepartmentUserResourceController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private IDepartmentUserService departmentUserService;
|
||||
|
||||
@ApiOperation(value = "组织部门用户列表", notes = "组织部门用户列表接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list")
|
||||
public List<DepartmentUserDTO> list() {
|
||||
Map<String, Object> params = requestParams();
|
||||
return departmentUserService.list(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "组织部门用户列表", notes = "通过组织部门ID获取组织部门用户列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "departmentId", value = "部门ID", paramType = "path"),
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list/{departmentId}")
|
||||
public List<DepartmentUserDTO> list(@PathVariable("departmentId") String departmentId) {
|
||||
return departmentUserService.list(departmentId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "组织部门用户列表", notes = "通过部门ID列表获取组织部门用户列表接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PostMapping("list/department-ids")
|
||||
public List<DepartmentUserDTO> listByDepartmentIds(@RequestBody IdsVO idsVO) {
|
||||
return departmentUserService.list(idsVO.getIds());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "组织部门用户ID列表", notes = "通过部门ID组织部门用户ID列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "departmentId", value = "部门ID", paramType = "path"),
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list-user-id/{departmentId}")
|
||||
public List<String> listUserId(@PathVariable("departmentId") String departmentId) {
|
||||
return departmentUserService.listUserId(departmentId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "组织部门用户ID列表", notes = "通过组织部门ID列表获取组织部门用户ID列表接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list-user-id/department-ids")
|
||||
public List<String> listUserIdByDepartmentIds(@RequestBody IdsVO idsVO) {
|
||||
return departmentUserService.listUserId(idsVO.getIds());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "组织部门用户ID列表", notes = "通过组织部门ID与用户ID列表获取组织部门用户ID列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "departmentId", value = "部门ID", paramType = "path"),
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list-user-id/department-id/{departmentId}/user-ids")
|
||||
public List<String> listUserIdByDepartmentIdAndUserIds(@PathVariable("departmentId") String departmentId, @RequestBody IdsVO idsVO) {
|
||||
return departmentUserService.listUserId(departmentId, idsVO.getIds());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "组织部门用户ID列表", notes = "通过组织部门ID列表与用户ID列表获取用户ID列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "departmentId", value = "部门ID", paramType = "path"),
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list-user-id/department-ids/user-ids")
|
||||
public List<String> listUserIdByDepartmentIdsAndUserIds(@RequestBody IdsVO idsVO) {
|
||||
return departmentUserService.listUserId(idsVO.getIds(), idsVO.getIds2());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "组织部门用户列表", notes = "组织部门用户列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "departmentId", value = "部门ID", paramType = "path"),
|
||||
@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")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("listpage/{departmentId}")
|
||||
public SuccessResultList<List<DepartmentUserDTO>> listPage(@PathVariable("departmentId") String departmentId, ListPage page) {
|
||||
return departmentUserService.listPage(departmentId, page);
|
||||
}
|
||||
|
||||
}
|
@ -17,6 +17,7 @@ import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.dtos.ZTreeDTO;
|
||||
import ink.wgink.pojo.dtos.department.DepartmentDTO;
|
||||
import ink.wgink.pojo.dtos.department.DepartmentSimpleDTO;
|
||||
import ink.wgink.pojo.pos.DepartmentPO;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.pojo.result.UploadExcelResultDTO;
|
||||
import ink.wgink.service.department.dao.IDepartmentDao;
|
||||
@ -127,7 +128,7 @@ public class DepartmentServiceImpl extends DefaultBaseService implements IDepart
|
||||
|
||||
@Override
|
||||
public void updateMerge(String departmentId, MergeDepartmentInfoVO mergeDepartmentInfoVO) {
|
||||
ink.wgink.pojo.pos.DepartmentPO departmentPO = getPO(departmentId);
|
||||
DepartmentPO departmentPO = getPO(departmentId);
|
||||
if (departmentPO == null) {
|
||||
throw new SearchException("部门不存在");
|
||||
}
|
||||
@ -318,36 +319,39 @@ public class DepartmentServiceImpl extends DefaultBaseService implements IDepart
|
||||
}
|
||||
|
||||
@Override
|
||||
public ink.wgink.pojo.pos.DepartmentPO getPO(String departmentId) {
|
||||
public DepartmentPO getPO(String departmentId) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
params.put("departmentId", departmentId);
|
||||
return departmentDao.getSimple(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ink.wgink.pojo.pos.DepartmentPO> listPO(Map<String, Object> params) {
|
||||
public List<DepartmentPO> listPO(Map<String, Object> params) {
|
||||
return departmentDao.listPO(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ink.wgink.pojo.pos.DepartmentPO> listPO(List<String> departmentIds) {
|
||||
public List<DepartmentPO> listPO(List<String> departmentIds) {
|
||||
if(departmentIds.isEmpty()) {
|
||||
|
||||
}
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
params.put("departmentIds", departmentIds);
|
||||
return listPO(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ink.wgink.pojo.pos.DepartmentPO> listByParentId(String departmentParentId) {
|
||||
public List<DepartmentPO> listPOByParentId(String departmentParentId) {
|
||||
return listSimpleByParentIdAndAddDateOrUpdateDate(departmentParentId, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ink.wgink.pojo.pos.DepartmentPO> listByParentIdAndAddDate(String departmentParentId, String addDate) {
|
||||
public List<DepartmentPO> listPOByParentIdAndAddDate(String departmentParentId, String addDate) {
|
||||
return listSimpleByParentIdAndAddDateOrUpdateDate(departmentParentId, addDate, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ink.wgink.pojo.pos.DepartmentPO> listByParentIdAndUpdateDate(String departmentParentId, String updateDate) {
|
||||
public List<DepartmentPO> listPOByParentIdAndUpdateDate(String departmentParentId, String updateDate) {
|
||||
return listSimpleByParentIdAndAddDateOrUpdateDate(departmentParentId, null, updateDate);
|
||||
}
|
||||
|
||||
@ -359,10 +363,10 @@ public class DepartmentServiceImpl extends DefaultBaseService implements IDepart
|
||||
* @param updateDate 更新日期
|
||||
* @return
|
||||
*/
|
||||
private List<ink.wgink.pojo.pos.DepartmentPO> listSimpleByParentIdAndAddDateOrUpdateDate(String departmentParentId, String addDate, String updateDate) {
|
||||
private List<DepartmentPO> listSimpleByParentIdAndAddDateOrUpdateDate(String departmentParentId, String addDate, String updateDate) {
|
||||
Map<String, Object> params = getHashMap(3);
|
||||
if (!StringUtils.equals(ISystemConstant.TREE_ROOT_ID, departmentParentId)) {
|
||||
ink.wgink.pojo.pos.DepartmentPO departmentPO = getPO(departmentParentId);
|
||||
DepartmentPO departmentPO = getPO(departmentParentId);
|
||||
if (departmentPO == null) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
@ -0,0 +1,155 @@
|
||||
package ink.wgink.service.position.controller.resources;
|
||||
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.dtos.ZTreeDTO;
|
||||
import ink.wgink.pojo.dtos.position.PositionDTO;
|
||||
import ink.wgink.pojo.pos.PositionPO;
|
||||
import ink.wgink.pojo.result.ErrorResult;
|
||||
import ink.wgink.pojo.result.SuccessResultData;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.pojo.vos.IdsVO;
|
||||
import ink.wgink.service.position.service.IPositionService;
|
||||
import io.swagger.annotations.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: PositionController
|
||||
* @Description: 职位
|
||||
* @Author: admin
|
||||
* @Date: 2019-04-11 22:41:20
|
||||
* @Version: 1.0
|
||||
**/
|
||||
@Api(tags = ISystemConstant.API_TAGS_RESOURCE_PREFIX + "职位管理接口")
|
||||
@RestController
|
||||
@RequestMapping(ISystemConstant.RESOURCE_PREFIX + "/position")
|
||||
public class PositionResourceController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private IPositionService positionService;
|
||||
|
||||
@ApiOperation(value = "职位列表", notes = "职位列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "positionParentId", value = "职位上级ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list-all")
|
||||
public List<PositionDTO> listAll() {
|
||||
return positionService.listAllByParentId("0");
|
||||
}
|
||||
|
||||
@ApiOperation(value = "职位列表", notes = "职位列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "positionParentId", value = "职位上级ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list-all/parentid/{positionParentId}")
|
||||
public List<PositionDTO> listAllByParentId(@PathVariable("positionParentId") String positionParentId) {
|
||||
return positionService.listAllByParentId(positionParentId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "职位详情", notes = "职位详情接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "positionId", value = "职位ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("get")
|
||||
public PositionDTO get() {
|
||||
Map<String, Object> params = requestParams();
|
||||
return positionService.get(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "职位详情", notes = "职位详情接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "positionId", value = "职位ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("get/id/{positionId}")
|
||||
public PositionDTO getById(@PathVariable("positionId") String positionId) {
|
||||
return positionService.get(positionId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "zTree列表", notes = "zTree列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "父ID", paramType = "query", dataType = "String")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list-ztree")
|
||||
public List<ZTreeDTO> listZTree() {
|
||||
Map<String, Object> params = requestParams();
|
||||
String positionParentId = "0";
|
||||
if (!StringUtils.isBlank(params.get(ISystemConstant.PARAMS_ID) == null ? null : params.get(ISystemConstant.PARAMS_ID).toString())) {
|
||||
positionParentId = params.get(ISystemConstant.PARAMS_ID).toString();
|
||||
}
|
||||
params.put("positionParentId", positionParentId);
|
||||
return positionService.listZTree(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "分页职位列表", notes = "分页职位列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "parentId", value = "上级ID", paramType = "query", dataType = "String"),
|
||||
@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)})
|
||||
@GetMapping("listpage")
|
||||
public SuccessResultList<List<PositionDTO>> listPage(ListPage page) {
|
||||
Map<String, Object> params = requestParams();
|
||||
String positionParentId = "0";
|
||||
if (!StringUtils.isBlank(params.get("parentId") == null ? null : params.get("parentId").toString())) {
|
||||
positionParentId = params.get("parentId").toString();
|
||||
}
|
||||
params.put("positionParentId", positionParentId);
|
||||
page.setParams(params);
|
||||
return positionService.listPage(page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "取职位列表", notes = "获取用户职位接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PostMapping("list")
|
||||
public List<PositionDTO> list() {
|
||||
Map<String, Object> params = requestParams();
|
||||
return positionService.list(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "通过ID列表获取职位列表", notes = "通过ID列表获取用户职位接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PostMapping("list/ids")
|
||||
public List<PositionDTO> listByIds(@RequestBody IdsVO idsVO) {
|
||||
return positionService.list(idsVO.getIds());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "取职位列表", notes = "用户职位接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PostMapping("list-po")
|
||||
public List<PositionPO> listPO() {
|
||||
Map<String, Object> params = requestParams();
|
||||
return positionService.listPO(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "通过ID列表获取职位列表", notes = "通过ID列表获取用户职位接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PostMapping("list-po/ids")
|
||||
public List<PositionPO> listPOByIds(@RequestBody IdsVO idsVO) {
|
||||
return positionService.listPO(idsVO.getIds());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "统计", notes = "统计接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("count")
|
||||
public SuccessResultData<Integer> count() {
|
||||
Map<String, Object> params = requestParams();
|
||||
Integer count = positionService.count(params);
|
||||
return new SuccessResultData<>(count);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,92 @@
|
||||
package ink.wgink.service.position.controller.resources;
|
||||
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.dtos.position.PositionUserDTO;
|
||||
import ink.wgink.pojo.pos.PositionPO;
|
||||
import ink.wgink.pojo.result.ErrorResult;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.pojo.vos.IdsVO;
|
||||
import ink.wgink.service.position.service.IPositionUserService;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* When you feel like quitting. Think about why you started
|
||||
* 当你想要放弃的时候,想想当初你为何开始
|
||||
*
|
||||
* @ClassName: PositionUserController
|
||||
* @Description: 职位用户
|
||||
* @Author: wanggeng
|
||||
* @Date: 2021/2/16 11:31 上午
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Api(tags = ISystemConstant.API_TAGS_RESOURCE_PREFIX + "职位用户")
|
||||
@RestController
|
||||
@RequestMapping(ISystemConstant.RESOURCE_PREFIX + "/position/user")
|
||||
public class PositionUserResourceController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private IPositionUserService positionUserService;
|
||||
|
||||
@ApiOperation(value = "人员ID列表", notes = "通过职位获取人员ID列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "positionId", value = "职位ID", paramType = "path"),
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list-userid/{positionId}")
|
||||
public List<String> listUserId(@PathVariable("positionId") String positionId) {
|
||||
return positionUserService.listUserId(positionId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "人员ID列表", notes = "通过职位获取人员ID列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "positionId", value = "职位ID", paramType = "path"),
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list-userid/position-ids")
|
||||
public List<String> listUserIdByPositionIds(@RequestBody IdsVO idsVO) {
|
||||
return positionUserService.listUserId(idsVO.getIds());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "组人员列表", notes = "组人员列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "positionId", value = "组ID", paramType = "path", dataType = "String"),
|
||||
@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")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("listpage/{positionId}")
|
||||
public SuccessResultList<List<PositionUserDTO>> listPage(@PathVariable("positionId") String positionId, ListPage page) {
|
||||
Map<String, Object> params = requestParams();
|
||||
page.setParams(params);
|
||||
return positionUserService.listPage(positionId, page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "职位列表", notes = "通过用户ID获取职位列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "positionId", value = "组ID", paramType = "path", dataType = "String"),
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list-position-po/userid/{userId}")
|
||||
public List<PositionPO> listPositionPOByUserId(@PathVariable("userId") String userId) {
|
||||
return positionUserService.listPositionPOByUserId(userId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "职位列表", notes = "通过用户ID列表获取职位列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "positionId", value = "组ID", paramType = "path", dataType = "String"),
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list-position-po/user-ids")
|
||||
public List<PositionPO> listPositionPOByUserId(@RequestBody IdsVO idsVO) {
|
||||
return positionUserService.listPositionPOByUserIds(idsVO.getIds());
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,154 @@
|
||||
package ink.wgink.service.role.controller.resources;
|
||||
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.exceptions.SearchException;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.dtos.ZTreeDTO;
|
||||
import ink.wgink.pojo.dtos.role.RoleDTO;
|
||||
import ink.wgink.pojo.pos.RolePO;
|
||||
import ink.wgink.pojo.result.ErrorResult;
|
||||
import ink.wgink.pojo.result.SuccessResultData;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.pojo.vos.IdsVO;
|
||||
import ink.wgink.service.role.service.IRoleService;
|
||||
import io.swagger.annotations.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: RoleController
|
||||
* @Description: 角色
|
||||
* @Author: wenc
|
||||
* @Date: 2019/1/6 3:03 PM
|
||||
* @Version: 1.0
|
||||
* @MenuUrl: admin/role/goroles
|
||||
**/
|
||||
@Api(tags = ISystemConstant.API_TAGS_RESOURCE_PREFIX + "角色")
|
||||
@RestController
|
||||
@RequestMapping(ISystemConstant.RESOURCE_PREFIX + "/role")
|
||||
public class RoleResourceController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private IRoleService roleService;
|
||||
|
||||
@ApiOperation(value = "角色详情", notes = "角色详情接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("get")
|
||||
public RoleDTO get() {
|
||||
Map<String, Object> params = requestParams();
|
||||
return roleService.get(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "角色详情", notes = "角色详情接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "roleId", value = "角色ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("get/{roleId}")
|
||||
public RoleDTO getRole(@PathVariable("roleId") String roleId) {
|
||||
return roleService.get(roleId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "角色列表", notes = "角色列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "roleParentId", value = "角色上级ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list")
|
||||
public List<RoleDTO> list() {
|
||||
Map<String, Object> params = requestParams();
|
||||
return roleService.list(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "角色列表", notes = "角色列表接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list-po")
|
||||
public List<RolePO> listPO() {
|
||||
Map<String, Object> params = requestParams();
|
||||
return roleService.listPO(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "角色列表", notes = "角色列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "roleParentId", value = "角色上级ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PostMapping("list-po/role-ids")
|
||||
public List<RolePO> listPOByRoleIds(@RequestBody IdsVO idsVO) {
|
||||
return roleService.listPO(idsVO.getIds());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "全部角色列表", notes = "全部角色列表接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list-all")
|
||||
public List<RoleDTO> listAll(@PathVariable("roleParentId") String roleParentId) {
|
||||
Map<String, Object> params = requestParams();
|
||||
params.put("roleParentId", "0");
|
||||
return roleService.listAll(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "角色列表", notes = "角色列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "roleParentId", value = "角色上级ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list-all/parentid/{roleParentId}")
|
||||
public List<RoleDTO> listAllByParentId(@PathVariable("roleParentId") String roleParentId) {
|
||||
Map<String, Object> params = requestParams();
|
||||
params.put("roleParentId", roleParentId);
|
||||
return roleService.listAll(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "角色zTree列表", notes = "角色zTree列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "上级ID", paramType = "query", dataType = "String")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list-ztree")
|
||||
public List<ZTreeDTO> listZTree() throws SearchException {
|
||||
Map<String, Object> params = requestParams();
|
||||
String roleParentId = ISystemConstant.TREE_ROOT_ID;
|
||||
if (!StringUtils.isBlank(params.get(ISystemConstant.PARAMS_ID) == null ? null : params.get(ISystemConstant.PARAMS_ID).toString())) {
|
||||
roleParentId = params.get(ISystemConstant.PARAMS_ID).toString();
|
||||
}
|
||||
params.put("roleParentId", roleParentId);
|
||||
return roleService.listZTree(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "角色分页列表", notes = "角色分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "parentId", value = "上级ID", paramType = "query", dataType = "String"),
|
||||
@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)})
|
||||
@GetMapping("listpage")
|
||||
public SuccessResultList<List<RoleDTO>> listPage(ListPage page) throws SearchException {
|
||||
Map<String, Object> params = requestParams();
|
||||
String roleParentId = "0";
|
||||
if (!StringUtils.isBlank(params.get(ISystemConstant.PARAMS_PARENT_ID) == null ? null : params.get(ISystemConstant.PARAMS_PARENT_ID).toString())) {
|
||||
roleParentId = params.get(ISystemConstant.PARAMS_PARENT_ID).toString();
|
||||
}
|
||||
params.put("roleParentId", roleParentId);
|
||||
page.setParams(params);
|
||||
return roleService.listPage(page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "统计", notes = "统计接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("count")
|
||||
public SuccessResultData<Integer> count() {
|
||||
Map<String, Object> params = requestParams();
|
||||
Integer count = roleService.count(params);
|
||||
return new SuccessResultData<>(count);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
package ink.wgink.service.role.controller.resources;
|
||||
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.dtos.role.RoleUserDTO;
|
||||
import ink.wgink.pojo.pos.RolePO;
|
||||
import ink.wgink.pojo.result.ErrorResult;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.pojo.vos.IdsVO;
|
||||
import ink.wgink.service.role.service.IRoleUserService;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* When you feel like quitting. Think about why you started
|
||||
* 当你想要放弃的时候,想想当初你为何开始
|
||||
*
|
||||
* @ClassName: RoleUserController
|
||||
* @Description: 角色用户
|
||||
* @Author: WangGeng
|
||||
* @Date: 2021/2/18 11:19
|
||||
* @Version: 1.0
|
||||
**/
|
||||
@Api(tags = ISystemConstant.API_TAGS_RESOURCE_PREFIX + "角色用户")
|
||||
@RestController
|
||||
@RequestMapping(ISystemConstant.RESOURCE_PREFIX + "/role/user")
|
||||
public class RoleUserResourceController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private IRoleUserService roleUserService;
|
||||
|
||||
@ApiOperation(value = "角色用户ID列表", notes = "通过角色ID获取角色用户ID列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "roleId", value = "用户角色ID", paramType = "path"),
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list-userid/roleid/{roleId}")
|
||||
public List<String> listUserIdByRoleId(@PathVariable("roleId") String roleId) {
|
||||
return roleUserService.listUserId(roleId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "角色用户ID列表", notes = "通过角色ID列表获取角色用户ID列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "roleId", value = "用户角色ID", paramType = "path"),
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PostMapping("list-userid/role-ids")
|
||||
public List<String> listUserIdByRoleIds(@RequestBody IdsVO idsVO) {
|
||||
return roleUserService.listUserId(idsVO.getIds());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "角色用户分页列表", notes = "角色用户分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "roleId", value = "角色ID", paramType = "path", dataType = "String"),
|
||||
@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")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list-page/{roleId}")
|
||||
public SuccessResultList<List<RoleUserDTO>> listPage(@PathVariable("roleId") String roleId, ListPage page) {
|
||||
Map<String, Object> params = requestParams();
|
||||
page.setParams(params);
|
||||
return roleUserService.listPage(roleId, page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "角色列表", notes = "通过用户ID获取角色列表")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "userId", value = "用户ID", paramType = "path", dataType = "String"),
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list-page/userid/{userId}")
|
||||
public List<RolePO> listRolePOByUserId(@PathVariable("userId") String userId) {
|
||||
return roleUserService.listRolePOByUserId(userId);
|
||||
}
|
||||
|
||||
}
|
@ -1,143 +0,0 @@
|
||||
package ink.wgink.service.role.pojo.pos;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName: RoleDTO
|
||||
* @Description: 角色
|
||||
* @Author: wenc
|
||||
* @Date: 2019/1/6 3:50 PM
|
||||
* @Version: 1.0
|
||||
**/
|
||||
public class RolePO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 5002416086605618923L;
|
||||
private String roleId;
|
||||
private String roleParentId;
|
||||
private Boolean isParent;
|
||||
private String roleName;
|
||||
private String roleSummary;
|
||||
private String roleDataAuthority;
|
||||
private String roleCode;
|
||||
private String roleInsert;
|
||||
private String roleDelete;
|
||||
private String roleUpdate;
|
||||
private String roleQuery;
|
||||
|
||||
public String getRoleId() {
|
||||
return roleId == null ? "" : roleId.trim();
|
||||
}
|
||||
|
||||
public void setRoleId(String roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
public String getRoleParentId() {
|
||||
return roleParentId == null ? "" : roleParentId.trim();
|
||||
}
|
||||
|
||||
public void setRoleParentId(String roleParentId) {
|
||||
this.roleParentId = roleParentId;
|
||||
}
|
||||
|
||||
public Boolean getParent() {
|
||||
return isParent;
|
||||
}
|
||||
|
||||
public void setParent(Boolean parent) {
|
||||
isParent = parent;
|
||||
}
|
||||
|
||||
public String getRoleName() {
|
||||
return roleName == null ? "" : roleName.trim();
|
||||
}
|
||||
|
||||
public void setRoleName(String roleName) {
|
||||
this.roleName = roleName;
|
||||
}
|
||||
|
||||
public String getRoleSummary() {
|
||||
return roleSummary == null ? "" : roleSummary.trim();
|
||||
}
|
||||
|
||||
public void setRoleSummary(String roleSummary) {
|
||||
this.roleSummary = roleSummary;
|
||||
}
|
||||
|
||||
public String getRoleDataAuthority() {
|
||||
return roleDataAuthority == null ? "" : roleDataAuthority.trim();
|
||||
}
|
||||
|
||||
public void setRoleDataAuthority(String roleDataAuthority) {
|
||||
this.roleDataAuthority = roleDataAuthority;
|
||||
}
|
||||
|
||||
public String getRoleCode() {
|
||||
return roleCode == null ? "" : roleCode.trim();
|
||||
}
|
||||
|
||||
public void setRoleCode(String roleCode) {
|
||||
this.roleCode = roleCode;
|
||||
}
|
||||
|
||||
public String getRoleInsert() {
|
||||
return roleInsert == null ? "" : roleInsert.trim();
|
||||
}
|
||||
|
||||
public void setRoleInsert(String roleInsert) {
|
||||
this.roleInsert = roleInsert;
|
||||
}
|
||||
|
||||
public String getRoleDelete() {
|
||||
return roleDelete == null ? "" : roleDelete.trim();
|
||||
}
|
||||
|
||||
public void setRoleDelete(String roleDelete) {
|
||||
this.roleDelete = roleDelete;
|
||||
}
|
||||
|
||||
public String getRoleUpdate() {
|
||||
return roleUpdate == null ? "" : roleUpdate.trim();
|
||||
}
|
||||
|
||||
public void setRoleUpdate(String roleUpdate) {
|
||||
this.roleUpdate = roleUpdate;
|
||||
}
|
||||
|
||||
public String getRoleQuery() {
|
||||
return roleQuery == null ? "" : roleQuery.trim();
|
||||
}
|
||||
|
||||
public void setRoleQuery(String roleQuery) {
|
||||
this.roleQuery = roleQuery;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuilder sb = new StringBuilder("{");
|
||||
sb.append("\"roleId\":")
|
||||
.append("\"").append(roleId).append("\"");
|
||||
sb.append(",\"roleParentId\":")
|
||||
.append("\"").append(roleParentId).append("\"");
|
||||
sb.append(",\"isParent\":")
|
||||
.append(isParent);
|
||||
sb.append(",\"roleName\":")
|
||||
.append("\"").append(roleName).append("\"");
|
||||
sb.append(",\"roleSummary\":")
|
||||
.append("\"").append(roleSummary).append("\"");
|
||||
sb.append(",\"roleDataAuthority\":")
|
||||
.append("\"").append(roleDataAuthority).append("\"");
|
||||
sb.append(",\"roleCode\":")
|
||||
.append("\"").append(roleCode).append("\"");
|
||||
sb.append(",\"roleInsert\":")
|
||||
.append("\"").append(roleInsert).append("\"");
|
||||
sb.append(",\"roleDelete\":")
|
||||
.append("\"").append(roleDelete).append("\"");
|
||||
sb.append(",\"roleUpdate\":")
|
||||
.append("\"").append(roleUpdate).append("\"");
|
||||
sb.append(",\"roleQuery\":")
|
||||
.append("\"").append(roleQuery).append("\"");
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user