From c9227740f02c4973751fe63f1f51ee24d5649caf Mon Sep 17 00:00:00 2001 From: heheng <heheng@123456> Date: 星期三, 05 二月 2025 16:46:42 +0800 Subject: [PATCH] 新增强制校验 --- exam-system/src/main/java/com/gkhy/exam/pay/service/impl/NonCoalCategoryServiceImpl.java | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/exam-system/src/main/java/com/gkhy/exam/pay/service/impl/NonCoalCategoryServiceImpl.java b/exam-system/src/main/java/com/gkhy/exam/pay/service/impl/NonCoalCategoryServiceImpl.java index e638391..b26f1ea 100644 --- a/exam-system/src/main/java/com/gkhy/exam/pay/service/impl/NonCoalCategoryServiceImpl.java +++ b/exam-system/src/main/java/com/gkhy/exam/pay/service/impl/NonCoalCategoryServiceImpl.java @@ -63,6 +63,12 @@ if (!nonCoalCategory.getDistrictCode().startsWith(Constants.DIS_XINJIANG_CODE)) { throw new RuntimeException("地州信息错误"); } + if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) { + if (!SecurityUtils.getDeptDistrictCode().equals(nonCoalCategory.getDistrictCode())) { + throw new RuntimeException("仅可新增本地州数据"); + } + + } checkSubjectName(nonCoalCategory); nonCoalCategory.setCreateBy(SecurityUtils.getUsername()); return nonCoalCategoryMapper.insertNonCoalCategory(nonCoalCategory); -- Gitblit v1.9.2