|
@@ -55,22 +55,58 @@ public class PlatformAreaServiceImpl extends AbstractCrudService<PlatformAreaMap
|
|
throw new BusinessException("无此租户,请联系管理员");
|
|
throw new BusinessException("无此租户,请联系管理员");
|
|
}
|
|
}
|
|
LambdaQueryWrapper<PlatformArea> queryWrapper = Wrappers.lambdaQuery();
|
|
LambdaQueryWrapper<PlatformArea> queryWrapper = Wrappers.lambdaQuery();
|
|
- queryWrapper.eq(PlatformArea::getEnable, 1).eq(PlatformArea::getPlatformAreaCode, platformArea.getPlatformAreaCode());
|
|
|
|
|
|
+ queryWrapper.eq(PlatformArea::getEnable, 1)
|
|
|
|
+ .eq(PlatformArea::getPlatformAreaCode, platformArea.getPlatformAreaCode())
|
|
|
|
+ .eq(PlatformArea::getTenantId,tenantDaya.get(0).getTenantId());
|
|
List<PlatformArea> platformAreaList = this.list(queryWrapper);
|
|
List<PlatformArea> platformAreaList = this.list(queryWrapper);
|
|
if (platformAreaList!=null&&!platformAreaList.isEmpty()){
|
|
if (platformAreaList!=null&&!platformAreaList.isEmpty()){
|
|
throw new BusinessException("台区编号重复,不可重复添加台区");
|
|
throw new BusinessException("台区编号重复,不可重复添加台区");
|
|
- }else {
|
|
|
|
- platformArea.setCreator(SecurityUtils.getLoginUser().getUser().getUserName());
|
|
|
|
- platformArea.setCreateTime(new Date());
|
|
|
|
- platformArea.setTenantId(tenantDaya.get(0).getTenantId());
|
|
|
|
- platformArea.setEnable(1);
|
|
|
|
- this.save(platformArea);
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ LambdaQueryWrapper<PlatformArea> queryWrapper1 = Wrappers.lambdaQuery();
|
|
|
|
+ queryWrapper1.eq(PlatformArea::getEnable, 1)
|
|
|
|
+ .eq(PlatformArea::getPlatformAreaName, platformArea.getPlatformAreaName())
|
|
|
|
+ .eq(PlatformArea::getTenantId,tenantDaya.get(0).getTenantId());
|
|
|
|
+ List<PlatformArea> platformAreaList1 = this.list(queryWrapper1);
|
|
|
|
+ if (platformAreaList1!=null&&!platformAreaList1.isEmpty()){
|
|
|
|
+ throw new BusinessException("台区名称重复,不可重复添加台区");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ platformArea.setCreator(SecurityUtils.getLoginUser().getUser().getUserName());
|
|
|
|
+ platformArea.setCreateTime(new Date());
|
|
|
|
+ platformArea.setTenantId(tenantDaya.get(0).getTenantId());
|
|
|
|
+ platformArea.setEnable(1);
|
|
|
|
+ this.save(platformArea);
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void platformAreaUpdate(PlatformArea platformArea){
|
|
public void platformAreaUpdate(PlatformArea platformArea){
|
|
|
|
+ List<SysUser> tenantDaya = userMapper.getTenantId(SecurityUtils.getLoginUser().getUser().getUserId());
|
|
|
|
+ if (tenantDaya.size()<0) {
|
|
|
|
+ throw new BusinessException("无此租户,请联系管理员");
|
|
|
|
+ }
|
|
|
|
+ LambdaQueryWrapper<PlatformArea> queryWrapper = Wrappers.lambdaQuery();
|
|
|
|
+ queryWrapper.eq(PlatformArea::getEnable, 1)
|
|
|
|
+ .eq(PlatformArea::getPlatformAreaCode, platformArea.getPlatformAreaCode())
|
|
|
|
+ .eq(PlatformArea::getTenantId,tenantDaya.get(0).getTenantId())
|
|
|
|
+ .ne(PlatformArea::getId,platformArea.getId());
|
|
|
|
+ List<PlatformArea> platformAreaList = this.list(queryWrapper);
|
|
|
|
+ if (platformAreaList!=null&&!platformAreaList.isEmpty()){
|
|
|
|
+ throw new BusinessException("台区编号重复,不可修改台区");
|
|
|
|
+ }
|
|
|
|
+ LambdaQueryWrapper<PlatformArea> queryWrapper1 = Wrappers.lambdaQuery();
|
|
|
|
+ queryWrapper1.eq(PlatformArea::getEnable, 1)
|
|
|
|
+ .eq(PlatformArea::getPlatformAreaName, platformArea.getPlatformAreaName())
|
|
|
|
+ .eq(PlatformArea::getTenantId,tenantDaya.get(0).getTenantId())
|
|
|
|
+ .ne(PlatformArea::getId,platformArea.getId());
|
|
|
|
+ List<PlatformArea> platformAreaList1 = this.list(queryWrapper1);
|
|
|
|
+ if (platformAreaList1!=null&&!platformAreaList1.isEmpty()){
|
|
|
|
+ throw new BusinessException("台区名称重复,不可修改台区");
|
|
|
|
+ }
|
|
this.updateById(platformArea);
|
|
this.updateById(platformArea);
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|