|
@@ -75,6 +75,14 @@ public class ProtectionServiceImpl extends ServiceImpl<ProtectionMapper, Protect
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public Long edit(ProtectionEditDto dto) {
|
|
public Long edit(ProtectionEditDto dto) {
|
|
|
|
|
+ LambdaQueryWrapper<Protection> repeatNameWrapper=new LambdaQueryWrapper<>();
|
|
|
|
|
+ repeatNameWrapper.eq(Protection::getOrgId,dto.getOrgId())
|
|
|
|
|
+ .eq(Protection::getName,dto.getName())
|
|
|
|
|
+ .ne(Protection::getId,ObjectUtil.isNull(dto.getId())?0:dto.getId());
|
|
|
|
|
+
|
|
|
|
|
+ if(baseMapper.exists(repeatNameWrapper)){
|
|
|
|
|
+ throw new RuntimeException("防区名称重复");
|
|
|
|
|
+ }
|
|
|
Protection protection = new Protection();
|
|
Protection protection = new Protection();
|
|
|
if (dto.getId() != null) {
|
|
if (dto.getId() != null) {
|
|
|
protection = getById(dto.getId());
|
|
protection = getById(dto.getId());
|