From d666793c93e91026e129f00bae414217690635ae Mon Sep 17 00:00:00 2001 From: jinpengyong <jpy123456> Date: Thu, 27 May 2021 13:20:34 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev_ --- screen-manage/src/main/java/com/moral/api/service/impl/OrganizationServiceImpl.java | 46 +++++++--------------------------------------- 1 files changed, 7 insertions(+), 39 deletions(-) diff --git a/screen-manage/src/main/java/com/moral/api/service/impl/OrganizationServiceImpl.java b/screen-manage/src/main/java/com/moral/api/service/impl/OrganizationServiceImpl.java index bd2db85..54c25ba 100644 --- a/screen-manage/src/main/java/com/moral/api/service/impl/OrganizationServiceImpl.java +++ b/screen-manage/src/main/java/com/moral/api/service/impl/OrganizationServiceImpl.java @@ -91,26 +91,10 @@ organizationDTO.setMsg(ResponseCodeEnum.ORGANIZATION_EXIST.getMsg()); return organizationDTO; } - //��������������������������� - Integer parentId = organization.getParentId(); - Organization parentOrganization = new Organization(); - if (!ObjectUtils.isEmpty(parentId)) { - parentOrganization.setId(parentId); - parentOrganization.setIsDelete(Constants.NOT_DELETE); - queryWrapper.setEntity(parentOrganization); - parentOrganization = organizationMapper.selectOne(queryWrapper); - if (ObjectUtils.isEmpty(parentOrganization)) { - organizationDTO.setCode(ResponseCodeEnum.ORGANIZATION_PARENT_NOT_EXIST.getCode()); - organizationDTO.setMsg(ResponseCodeEnum.ORGANIZATION_PARENT_NOT_EXIST.getMsg()); - return organizationDTO; - } - } //������������ organizationMapper.insert(organization); //������DTO������ - organizationDTO.setParentOrganization(parentOrganization); - organizationDTO.setOrganization(organization); organizationDTO.setCode(ResponseCodeEnum.SUCCESS.getCode()); organizationDTO.setMsg(ResponseCodeEnum.SUCCESS.getMsg()); @@ -149,21 +133,6 @@ return organizationDTO; } - //������������������������������������������������������ - Integer parentId = organization.getParentId(); - Organization parentOrganization = new Organization(); - if (!ObjectUtils.isEmpty(parentId) && parentId != 0) { - QueryWrapper<Organization> existParentWrapper = new QueryWrapper<>(); - parentOrganization.setId(parentId); - parentOrganization.setIsDelete(Constants.NOT_DELETE); - existParentWrapper.setEntity(parentOrganization); - parentOrganization = organizationMapper.selectOne(existParentWrapper); - if (ObjectUtils.isEmpty(parentOrganization)) { - organizationDTO.setCode(ResponseCodeEnum.ORGANIZATION_PARENT_NOT_EXIST.getCode()); - organizationDTO.setMsg(ResponseCodeEnum.ORGANIZATION_PARENT_NOT_EXIST.getMsg()); - return organizationDTO; - } - } //������������ organizationMapper.updateById(organization); @@ -172,8 +141,6 @@ organization = organizationMapper.selectById(organization.getId()); //������DTO������ - organizationDTO.setParentOrganization(parentOrganization); - organizationDTO.setOrganization(organization); organizationDTO.setCode(ResponseCodeEnum.SUCCESS.getCode()); organizationDTO.setMsg(ResponseCodeEnum.SUCCESS.getMsg()); @@ -182,6 +149,8 @@ return organizationDTO; } + + /** * @Description: ������������������ @@ -197,7 +166,7 @@ //������ Integer id = form.getOrganizationId(); - //������������������������ + //������������������������������������������ Organization existOrganization = new Organization(); existOrganization.setIsDelete(Constants.NOT_DELETE); existOrganization.setId(id); @@ -217,7 +186,7 @@ organizationMapper.update(null, deleteWrapper); //������������������ - userService.deleteUserByOrganizationId(id); + userService.deleteUsersByOrganizationId(id); //��������������������������� List<Organization> children = getAllChildrenOrganization(existOrganization.getId()); @@ -235,7 +204,7 @@ updateWrapper.set("is_delete", Constants.DELETE); organizationMapper.update(null, updateWrapper); //��������������������������� - childrenId.forEach(value->userService.deleteUserByOrganizationId(value)); + childrenId.forEach(value->userService.deleteUsersByOrganizationId(value)); } else {//��������� //���������������������������id @@ -252,7 +221,6 @@ } //������������������ - dto.setOrganization(existOrganization); dto.setCode(ResponseCodeEnum.SUCCESS.getCode()); dto.setMsg(ResponseCodeEnum.SUCCESS.getMsg()); //������������������ @@ -355,7 +323,7 @@ dto.setMsg(ResponseCodeEnum.SUCCESS.getMsg()); dto.setOrganizationDTOS(organizationDTOS); dto.setCurrent(page.getCurrent()); - dto.setPage(page.getPages()); + dto.setPages(page.getPages()); dto.setSize(page.getSize()); dto.setTotal(page.getTotal()); return dto; @@ -379,7 +347,7 @@ queryWrapper.eq("is_delete", Constants.NOT_DELETE); //������������������ List<Organization> organizations = organizationMapper.selectList(queryWrapper); - //������form������������id,��������������������������������������� + //������form������������id,��������������������������������������������� if(!ObjectUtils.isEmpty(id)){ List<Organization> children = getAllChildrenOrganization(id); List<Integer> thisAndchildrenIds = new ArrayList<>();//���id���������������������������id������ -- Gitblit v1.8.0