Merge pull request 'm' (#37) from yanyang into master

Reviewed-on: #37
Este commit está contenido en:
闫阳 2023-12-28 15:44:48 +08:00
commit 8c3d387257
Se han modificado 3 ficheros con 6 adiciones y 6 borrados

Ver fichero

@ -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 {

Ver fichero

@ -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 {

Ver fichero

@ -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 {