|
@@ -74,6 +74,10 @@ public class AdminWebsitLogic {
|
|
|
AdminUserLogic adminUserLogic;
|
|
|
// @Autowired
|
|
|
// EnterpriseWechatWorkerLogic enterpriseWechatWorkerLogic;
|
|
|
+ @Autowired
|
|
|
+ PgOrderBaseService pgOrderBaseService;
|
|
|
+ @Autowired
|
|
|
+ AdminUserService adminUserService;
|
|
|
|
|
|
/**
|
|
|
* 区域列表
|
|
@@ -379,11 +383,11 @@ public class AdminWebsitLogic {
|
|
|
if (count > 0) {
|
|
|
throw new RemoteServiceException("当前部门存在子级,删除失败");
|
|
|
}
|
|
|
- final Integer existUserCount = adminUserWebsitRelaService.lambdaQuery()
|
|
|
- .eq(AdminUserWebsitRela::getAdminWebsitId, websitId)
|
|
|
+ final Integer existOrderCount = pgOrderBaseService.lambdaQuery()
|
|
|
+ .eq(PgOrderBase::getWebsitId, websitId)
|
|
|
.count();
|
|
|
- if (existUserCount > 0) {
|
|
|
- throw new RemoteServiceException("当前部门存在与账号绑定关系,删除失败");
|
|
|
+ if (existOrderCount > 0) {
|
|
|
+ throw new RemoteServiceException("当前网点已存在关联的工单,删除失败");
|
|
|
}
|
|
|
AdminUserCom adminUser = commonLogic.getAdminUser(request);
|
|
|
final AdminWebsit adminWebsit = adminWebsitService.getById(websitId);
|
|
@@ -405,13 +409,21 @@ public class AdminWebsitLogic {
|
|
|
// workWechatLogic.deleteOrganization(idd,adminUser.getAdminCompanyWechat());
|
|
|
// }
|
|
|
for (String id : ids) {
|
|
|
- final Integer existSubUserCount = adminUserWebsitRelaService.lambdaQuery()
|
|
|
+ List<AdminUserWebsitRela> relaList = adminUserWebsitRelaService.lambdaQuery()
|
|
|
+ .eq(AdminUserWebsitRela::getCompanyWechatId, adminWebsit.getCompanyWechatId())
|
|
|
.eq(AdminUserWebsitRela::getAdminWebsitId, id)
|
|
|
- .count();
|
|
|
+ .list();
|
|
|
+
|
|
|
+ adminUserService.lambdaUpdate()
|
|
|
+ .eq(AdminUser::getCompanyWechatId, adminWebsit.getCompanyWechatId())
|
|
|
+ .in(AdminUser::getAdminUserId, relaList.stream().map(AdminUserWebsitRela::getAdminUserId).collect(Collectors.toList()))
|
|
|
+ .remove();
|
|
|
+
|
|
|
+ adminUserWebsitRelaService.lambdaUpdate()
|
|
|
+ .eq(AdminUserWebsitRela::getCompanyWechatId, adminWebsit.getCompanyWechatId())
|
|
|
+ .eq(AdminUserWebsitRela::getAdminWebsitId, id)
|
|
|
+ .remove();
|
|
|
|
|
|
- if (existSubUserCount > 0) {
|
|
|
- throw new RemoteServiceException(websitId + "部门的" + id + "子级部门存在与账号绑定关系,删除失败");
|
|
|
- }
|
|
|
}
|
|
|
adminWebsitService.lambdaUpdate().in(AdminWebsit::getWebsitId, ids).remove();
|
|
|
}
|
|
@@ -435,6 +447,7 @@ public class AdminWebsitLogic {
|
|
|
}
|
|
|
|
|
|
adminDeptWebsitService.lambdaUpdate().eq(AdminDeptWebsit::getWebsitId, websitId).remove();
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|