From ed653645515b97b90ad654eb59f2da0cc128d918 Mon Sep 17 00:00:00 2001 From: yanyang Date: Thu, 28 Dec 2023 15:42:36 +0800 Subject: [PATCH] m --- .../com/cnbm/packing/controller/ProductLevelController.java | 4 ++-- .../java/com/cnbm/packing/controller/ScenesController.java | 4 ++-- .../com/cnbm/packing/controller/WorkingTimeController.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ym-packing/src/main/java/com/cnbm/packing/controller/ProductLevelController.java b/ym-packing/src/main/java/com/cnbm/packing/controller/ProductLevelController.java index 001ec7f..4420eb7 100644 --- a/ym-packing/src/main/java/com/cnbm/packing/controller/ProductLevelController.java +++ b/ym-packing/src/main/java/com/cnbm/packing/controller/ProductLevelController.java @@ -108,13 +108,13 @@ public class ProductLevelController { ProductLevelDTO entity = productLevelService.get(dto.getId()); QueryWrapper wrapper1 = new QueryWrapper<>(); wrapper1.eq(ProductLevel.CODE, dto.getCode()); - if(entity.getCode()!=dto.getCode() && productLevelMapper.selectCount(wrapper1)!= 0){ + if(!entity.getCode().equals(dto.getCode()) && productLevelMapper.selectCount(wrapper1)!= 0){ return new Result().error(1,"编码重复"); } //验证名称是否重名 QueryWrapper wrapper2 = new QueryWrapper<>(); wrapper2.eq(ProductLevel.PRODUCT_LEVEL, dto.getProductLevel()); - if(entity.getProductLevel()!=dto.getProductLevel() && productLevelMapper.selectCount(wrapper2)!= 0){ + if(!entity.getProductLevel().equals(dto.getProductLevel()) && productLevelMapper.selectCount(wrapper2)!= 0){ return new Result().error(1,"名称重复"); } else { diff --git a/ym-packing/src/main/java/com/cnbm/packing/controller/ScenesController.java b/ym-packing/src/main/java/com/cnbm/packing/controller/ScenesController.java index 8abd27a..f993eb2 100644 --- a/ym-packing/src/main/java/com/cnbm/packing/controller/ScenesController.java +++ b/ym-packing/src/main/java/com/cnbm/packing/controller/ScenesController.java @@ -109,14 +109,14 @@ public class ScenesController { ScenesDTO entity = scenesService.get(dto.getId()); QueryWrapper wrapper1 = new QueryWrapper<>(); wrapper1.eq(Scenes.CODE, dto.getCode()); - if(entity.getCode()!=dto.getCode() && scenesMapper.selectCount(wrapper1)!= 0){ + if(!entity.getCode().equals(dto.getCode()) && scenesMapper.selectCount(wrapper1)!= 0){ return new Result().error(1,"编码重复"); } //验证名称是否重名 QueryWrapper wrapper2 = new QueryWrapper<>(); wrapper2.eq(Scenes.SCENES_NAME, dto.getScenesName()); System.out.println(scenesMapper.selectCount(wrapper2)); - if(entity.getScenesName()!=dto.getScenesName() && scenesMapper.selectCount(wrapper2)!= 0){ + if(!entity.getScenesName().equals(dto.getScenesName()) && scenesMapper.selectCount(wrapper2)!= 0){ return new Result().error(1,"名称重复"); } else { diff --git a/ym-packing/src/main/java/com/cnbm/packing/controller/WorkingTimeController.java b/ym-packing/src/main/java/com/cnbm/packing/controller/WorkingTimeController.java index 5a049ba..5f36631 100644 --- a/ym-packing/src/main/java/com/cnbm/packing/controller/WorkingTimeController.java +++ b/ym-packing/src/main/java/com/cnbm/packing/controller/WorkingTimeController.java @@ -106,13 +106,13 @@ public class WorkingTimeController { WorkingTimeDTO entity = workingTimeService.get(dto.getId()); QueryWrapper wrapper1 = new QueryWrapper<>(); wrapper1.eq(WorkingTime.CODE, dto.getCode()); - if(entity.getCode()!=dto.getCode() && workingTimeMapper.selectCount(wrapper1)!= 0){ + if(!entity.getCode().equals(dto.getCode()) && workingTimeMapper.selectCount(wrapper1)!= 0){ return new Result().error(1,"编码重复"); } //验证名称是否重名 QueryWrapper wrapper2 = new QueryWrapper<>(); wrapper2.eq( WorkingTime.ORDER_NAME, dto.getOrderName()); - if(entity.getOrderName()!=dto.getOrderName() && workingTimeMapper.selectCount(wrapper2)!= 0){ + if(!entity.getOrderName().equals(dto.getOrderName()) && workingTimeMapper.selectCount(wrapper2)!= 0){ return new Result().error(1,"名称重复"); } else { -- 2.45.2