From 5a630f86b916bad0d933f55b063db8feb473b864 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 24 Nov 2020 17:44:22 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=BB=84=E7=BB=87=E4=B8=8B=E6=9C=89?= =?UTF-8?q?=E7=BD=91=E6=A0=BC=EF=BC=8C=E4=B8=8D=E5=85=81=E8=AE=B8=E5=88=A0?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/exception/EpmetErrorCode.java | 1 + .../com/epmet/service/impl/AgencyServiceImpl.java | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index f10e88c565..dc329f28f8 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -67,6 +67,7 @@ public enum EpmetErrorCode { NOT_DEL_AGENCY(8202, "该机关存在下级机关,不允许删除"), NOT_DEL_AGENCY_PER(8205, "该机关存在工作人员,不允许删除"), NOT_DEL_DEPARTMENT(8206, "该部门存在工作人员,不允许删除"), + NOT_DEL_AGENCY_GRID(8207, "该机关存在网格,不允许删除"), REQUIRE_PERMISSION(8301, "您没有足够的操作权限"), diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java index 8fbd617cf2..afb9739daa 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java @@ -26,6 +26,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.constant.CustomerAgencyConstant; import com.epmet.constant.RoleKeyConstants; import com.epmet.dao.CustomerAgencyDao; +import com.epmet.dao.CustomerGridDao; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.GovStaffRoleDTO; import com.epmet.dto.form.*; @@ -64,6 +65,8 @@ public class AgencyServiceImpl implements AgencyService { private EpmetUserOpenFeignClient epmetUserOpenFeignClient; @Autowired private StaffServiceImpl staffServiceImpl; + @Autowired + private CustomerGridDao customerGridDao; /** * @param formDTO @@ -188,7 +191,14 @@ public class AgencyServiceImpl implements AgencyService { result.setMsg(EpmetErrorCode.NOT_DEL_AGENCY_PER.getMsg()); return result; } - //3:删除当前机关组织(逻辑删) + //3:组织下有网格,不允许删除 + int gridCount = customerGridDao.selectGridCountByAgencyId(formDTO.getAgencyId()); + if (gridCount > NumConstant.ZERO) { + result.setCode(EpmetErrorCode.NOT_DEL_AGENCY_GRID.getCode()); + result.setMsg(EpmetErrorCode.NOT_DEL_AGENCY_GRID.getMsg()); + return result; + } + //4:删除当前机关组织(逻辑删) if (customerAgencyDao.deleteById(formDTO.getAgencyId()) < NumConstant.ONE) { log.error(CustomerAgencyConstant.DEL_EXCEPTION); throw new RenException(CustomerAgencyConstant.DEL_EXCEPTION); From cba96c4487d39ae8331ffcdaa3302e1d8196ca9f Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 25 Nov 2020 11:07:28 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E3=80=90?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=B0=8F=E7=BB=84=E4=BF=A1=E6=81=AF=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E3=80=91,=E4=BF=AE=E5=A4=8D=E5=8F=AA=E6=9C=89?= =?UTF-8?q?=E5=85=9A=E5=91=98=E8=BA=AB=E4=BB=BD=E6=97=A0=E6=B3=95=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=B0=8F=E7=BB=84=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/modules/group/service/impl/ResiGroupServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java index e5507ab766..11582bc216 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java @@ -1189,7 +1189,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl