m #37

Merged
yanyang merged 1 commits from yanyang into master 2023-12-28 15:44:48 +08:00
3 changed files with 6 additions and 6 deletions
Showing only changes of commit ed65364551 - Show all commits

View File

@ -108,13 +108,13 @@ public class ProductLevelController {
ProductLevelDTO entity = productLevelService.get(dto.getId());
QueryWrapper<ProductLevel> 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<ProductLevel> 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 {

View File

@ -109,14 +109,14 @@ public class ScenesController {
ScenesDTO entity = scenesService.get(dto.getId());
QueryWrapper<Scenes> 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<Scenes> 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 {

View File

@ -106,13 +106,13 @@ public class WorkingTimeController {
WorkingTimeDTO entity = workingTimeService.get(dto.getId());
QueryWrapper<WorkingTime> 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<WorkingTime> 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 {