|
@@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
/**
|
|
/**
|
|
* ManageController
|
|
* ManageController
|
|
@@ -28,11 +29,18 @@ public class ManageController {
|
|
|
|
|
|
@PostMapping("/search")
|
|
@PostMapping("/search")
|
|
public ApiResult findManage(@RequestBody ManageVO manageVO){
|
|
public ApiResult findManage(@RequestBody ManageVO manageVO){
|
|
- ApiResult<List<Department>> deptResult = departmentService.getDeptChild(manageVO.getDeptId() == null ? 12345l : manageVO.getDeptId());
|
|
|
|
List<Long> deptIds = new ArrayList<>();
|
|
List<Long> deptIds = new ArrayList<>();
|
|
- deptResult.getData().stream().forEach(department -> {
|
|
|
|
- deptIds.add(department.getId());
|
|
|
|
- });
|
|
|
|
|
|
+ if(Objects.isNull(manageVO.getDeptId())){
|
|
|
|
+ ApiResult<List<Department>> deptResult = departmentService.getDeptChild(12345l);
|
|
|
|
+ deptResult.getData().stream().forEach(department -> {
|
|
|
|
+ deptIds.add(department.getId());
|
|
|
|
+ });
|
|
|
|
+ }else {
|
|
|
|
+ manageVO.getDeptId().stream().forEach(ids -> {
|
|
|
|
+ deptIds.add(ids);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
manageVO.setDeptIds(deptIds);
|
|
manageVO.setDeptIds(deptIds);
|
|
return manageService.list(manageVO);
|
|
return manageService.list(manageVO);
|
|
}
|
|
}
|