|
@@ -254,15 +254,22 @@ public class OrganizationServiceImpl extends ServiceImpl<OrganizationDao, Organi
|
|
|
LambdaQueryWrapper<OrganizationDepartment> departmentLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
departmentLambdaQueryWrapper.eq(OrganizationDepartment::getOrganizationId,id);
|
|
|
List<OrganizationDepartment> departmentList = organizationDeparementDao.selectList(departmentLambdaQueryWrapper);
|
|
|
- for (OrganizationDepartment organizationDepartment : departmentList) {
|
|
|
- strings.add(organizationDepartment.getId());
|
|
|
- }
|
|
|
- LambdaQueryWrapper<UserBypassAccount> accountLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
- accountLambdaQueryWrapper.in(UserBypassAccount::getDepartmentId,strings);
|
|
|
- List<UserBypassAccount> userBypassAccounts = userBypassAccountService.list(accountLambdaQueryWrapper);
|
|
|
- if (null != userBypassAccounts && userBypassAccounts.size() > 0){
|
|
|
- return CommonResult.failed("该企业已关联企业子账户,请解除关联后进行删除");
|
|
|
+ if (null!=departmentList&&departmentList.size()>0){
|
|
|
+ for (OrganizationDepartment organizationDepartment : departmentList) {
|
|
|
+ strings.add(organizationDepartment.getId());
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (null!=strings&&strings.size()>0){
|
|
|
+ LambdaQueryWrapper<UserBypassAccount> accountLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ accountLambdaQueryWrapper.in(UserBypassAccount::getDepartmentId,strings);
|
|
|
+ List<UserBypassAccount> userBypassAccounts = userBypassAccountService.list(accountLambdaQueryWrapper);
|
|
|
+ if (null != userBypassAccounts && userBypassAccounts.size() > 0){
|
|
|
+ return CommonResult.failed("该企业已关联企业子账户,请解除关联后进行删除");
|
|
|
+ }
|
|
|
}
|
|
|
+ organizationDao.deleteById(id);
|
|
|
+
|
|
|
return CommonResult.success("操作成功");
|
|
|
|
|
|
}
|