添加通过部门编号查询部门接口
This commit is contained in:
@@ -271,7 +271,7 @@ public class DeptController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据部门获取部门信息
|
||||
* 根据部门Id获取部门信息
|
||||
* @author cdf
|
||||
* @date 2022/7/12
|
||||
*/
|
||||
@@ -284,6 +284,20 @@ public class DeptController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据部门code获取部门信息
|
||||
* @author cdf
|
||||
* @date 2022/7/12
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@GetMapping("/getDeptByCode")
|
||||
@ApiOperation("根据部门Id获取部门信息")
|
||||
public HttpResult<Dept> getDeptByCode(@RequestParam("deptCode")String deptCode) {
|
||||
String methodDescribe = getMethodDescribe("getDeptByCode");
|
||||
Dept result = deptService.getDeptByCode(deptCode);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据部门id获取所有子部门ids
|
||||
|
||||
@@ -148,6 +148,13 @@ public interface IDeptService extends IService<Dept> {
|
||||
*/
|
||||
Dept getDeptById(String id);
|
||||
|
||||
/**
|
||||
* 根据部门code获取部门详情
|
||||
* @author cdf
|
||||
* @date 2022/7/13
|
||||
*/
|
||||
Dept getDeptByCode(String deptCode);
|
||||
|
||||
|
||||
/**
|
||||
* 根据部门id获取部门详情
|
||||
|
||||
@@ -266,6 +266,13 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
return this.baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dept getDeptByCode(String deptCode) {
|
||||
LambdaQueryWrapper<Dept> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(Dept::getCode,deptCode).eq(Dept::getState,DataStateEnum.ENABLE.getCode());
|
||||
return this.baseMapper.selectOne(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 校验参数,检查是否存在相同编码的部门
|
||||
|
||||
Reference in New Issue
Block a user