From 3a9aa33cdf2cc5e6081df5b3c94ac8372ec12b0b Mon Sep 17 00:00:00 2001
From: lizijie <lzjiiie@163.com>
Date: Thu, 13 May 2021 11:29:15 +0800
Subject: [PATCH] 站点增删改查接口
---
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