1.pms代码调整

This commit is contained in:
2024-02-29 18:03:27 +08:00
parent 8122c7569d
commit 789ebff40b
7 changed files with 108 additions and 24 deletions

View File

@@ -481,6 +481,22 @@ public class DeptController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
}
/**
* 根据部门ids获取部门集合
* @author cdf
* @date 2024/2/29
*/
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@PostMapping("/getDeptInfoListByIds")
@ApiOperation("根据部门ids获取部门集合")
@ApiImplicitParam(name = "list", value = "code集合", required = true)
public HttpResult<List<Dept>> getDeptInfoListByIds(@RequestBody List<String> deptIds) {
String methodDescribe = getMethodDescribe("getDeptInfoListByIds");
List<Dept> result = deptService.getDeptInfoListByIds(deptIds);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
}
/**
* 获取所有的部门集合
* @author xy

View File

@@ -238,6 +238,9 @@ public interface IDeptService extends IService<Dept> {
*/
List<Dept> getDeptByCodeList(List<String> list);
List<Dept> getDeptInfoListByIds(List<String> deptIds);
/**
* @Description: 获取所有单位
* @Author: xuyang

View File

@@ -184,7 +184,7 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
List<Integer> deptType = WebUtil.filterDeptType();
String deptIndex = RequestUtil.getDeptIndex();
List<DeptTreeVO> deptList = this.baseMapper.getDeptTree(deptIndex, deptType);
List<DeptTreeVO> finalDeptList = deptList.stream().filter(item->deptIds.contains(item.getCode())).collect(Collectors.toList());
List<DeptTreeVO> finalDeptList = deptList.stream().filter(item->deptIds.contains(item.getId())).collect(Collectors.toList());
return finalDeptList.stream()
.filter(deptVO -> deptVO.getId().equals(deptIndex))
.peek(deptFirst -> deptFirst.setChildren(getChildren(deptFirst, finalDeptList)))
@@ -492,6 +492,11 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
return this.lambdaQuery().in(Dept::getCode,list).eq(Dept::getState,DataStateEnum.ENABLE.getCode()).list();
}
@Override
public List<Dept> getDeptInfoListByIds(List<String> deptIds) {
return this.lambdaQuery().in(Dept::getId,deptIds).eq(Dept::getState,DataStateEnum.ENABLE.getCode()).list();
}
@Override
public List<Dept> getAllDept() {
return this.lambdaQuery().eq(Dept::getState,DataStateEnum.ENABLE.getCode()).list();