From 465c4e57b9bd0cf7692b951df0f17ca697b71e4b Mon Sep 17 00:00:00 2001 From: kaiyu <404897439@qq.com> Date: Wed, 12 May 2021 13:40:52 +0800 Subject: [PATCH] screen-manage 增加单位转换模块删除功能 --- screen-manage/src/main/java/com/moral/api/service/impl/OrganizationServiceImpl.java | 40 ++++------------------------------------ 1 files changed, 4 insertions(+), 36 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..2de9059 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); @@ -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; -- Gitblit v1.8.0