diff --git a/service-department/src/main/java/ink/wgink/service/department/controller/api/DepartmentController.java b/service-department/src/main/java/ink/wgink/service/department/controller/api/DepartmentController.java index 89f472b5..5e3cd8c4 100644 --- a/service-department/src/main/java/ink/wgink/service/department/controller/api/DepartmentController.java +++ b/service-department/src/main/java/ink/wgink/service/department/controller/api/DepartmentController.java @@ -9,6 +9,7 @@ import ink.wgink.pojo.ListPage; import ink.wgink.pojo.dtos.ZTreeDTO; import ink.wgink.pojo.dtos.department.DepartmentDTO; import ink.wgink.pojo.result.*; +import ink.wgink.pojo.vos.IdsVO; import ink.wgink.service.department.pojo.vos.DepartmentVO; import ink.wgink.service.department.pojo.vos.MergeDepartmentInfoVO; import ink.wgink.service.department.pojo.vos.MergeNewDepartmentInfoVO; @@ -219,4 +220,14 @@ public class DepartmentController extends DefaultBaseController { return new SuccessResultData<>(departmentService.count(params)); } + @ApiOperation(value = "组织部门列表", notes = "组织部门列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "departmentId", value = "部门ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PostMapping("list/ids") + public List list(@RequestBody IdsVO idsVO) { + return departmentService.listByIds(idsVO.getIds()); + } + } diff --git a/service-department/src/main/resources/templates/department/list-tree-check.html b/service-department/src/main/resources/templates/department/list-tree-check.html index 1898a600..b6436993 100644 --- a/service-department/src/main/resources/templates/department/list-tree-check.html +++ b/service-department/src/main/resources/templates/department/list-tree-check.html @@ -55,7 +55,6 @@ var checkedIds = top.dialog.dialogData.checkedIds ? top.dialog.dialogData.checkedIds : []; var checkedNodes = []; var checkedDepartmentMap = new Map(); - top.dialog.dialogData.checkedNodes = []; function closeBox() { parent.layer.close(parent.layer.getFrameIndex(window.name)); @@ -88,10 +87,11 @@ */ function initCheckNodes(callback) { if(!checkedIds || checkedIds.length == 0) { + callback ? callback() : ''; return; } top.restAjax.post(top.restAjax.path('api/department/list/ids', []), { - ids: checkedIds + ids: [].concat(checkedIds) }, null, function(code, data) { $('#checkedNodeBox').empty(); var checkedNodes = '';