From 5ae947073bfbde6e94fa556684b1bf1828fb1358 Mon Sep 17 00:00:00 2001 From: OTTO <731554297@qq.com> Date: Wed, 18 Dec 2024 14:00:50 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E9=9C=80=E6=B1=82=E9=87=8D=E6=9E=84):=20?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BA=A7=E5=93=81=E9=9C=80=E6=B1=82=E8=A7=84?= =?UTF-8?q?=E6=A0=BC=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 固定模块不允许编辑不允许删除 Signed-off-by: OTTO <731554297@qq.com> --- .../controller/PmsProductModuleController.java | 11 ----------- .../service/impl/PmsProductModuleServiceImpl.java | 7 ++++++- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/controller/PmsProductModuleController.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/controller/PmsProductModuleController.java index 59afde017..5822085d4 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/controller/PmsProductModuleController.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/controller/PmsProductModuleController.java @@ -108,15 +108,4 @@ public class PmsProductModuleController extends BaseController { return toAjax(pmsProductModuleService.deletePmsProductModuleById(id)); } - - /** - * 初始化固定模块 - */ - @RequiresPermissions("pms:pmsProductModule:manage") - @Log(title = "产品模块", businessType = BusinessType.UPDATE) - @PutMapping("/{productIdentifier}/initModule") - @ApiOperation(value = "初始化固定模块") - public AjaxResult initProductModule(@PathVariable String productIdentifier) { - return toAjax(pmsProductModuleService.initProductModule(productIdentifier)); - } } diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductModuleServiceImpl.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductModuleServiceImpl.java index 36fcbda45..215f0b336 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductModuleServiceImpl.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/product/service/impl/PmsProductModuleServiceImpl.java @@ -173,6 +173,9 @@ public class PmsProductModuleServiceImpl implements IPmsProductModuleService throw new ServiceException("[%s]不允许进行操作", NO_MODULE); } PmsProductModule oldPmsProductModule = selectPmsProductModuleById(pmsProductModule.getId(), true); + if (oldPmsProductModule.getIsFixedModule()) { + throw new ServiceException("固定模块不允许进行操作"); + } String name; // 当type为1时则取产品需求数量、为2时取测试用例数量 if (PmsConstants.PRODUCT_TAG_AND_MODULE_TYPE.equals(oldPmsProductModule.getType())) { @@ -221,7 +224,9 @@ public class PmsProductModuleServiceImpl implements IPmsProductModuleService public int deletePmsProductModuleById(Long id) { PmsProductModule oldPmsProductModule = selectPmsProductModuleById(id, true); - + if (oldPmsProductModule.getIsFixedModule()) { + throw new ServiceException("固定模块不允许进行操作"); + } PmsProductModule pmsProductModuleSearch=new PmsProductModule(); pmsProductModuleSearch.setParentId(id); List pmsProductModuleChildList=pmsProductModuleMapper.selectPmsProductModuleList(pmsProductModuleSearch);