|
@@ -135,11 +135,13 @@ public class AdminDeptLogic {
|
|
adminDeptService.removeById(id);
|
|
adminDeptService.removeById(id);
|
|
}
|
|
}
|
|
|
|
|
|
- public void addWebsit(AdminDeptWebsit adminDeptWebsit) {
|
|
|
|
- adminDeptWebsit.insert();
|
|
|
|
- }
|
|
|
|
|
|
|
|
public void updateWebsit(AdminDeptWebsit adminDeptWebsit) {
|
|
public void updateWebsit(AdminDeptWebsit adminDeptWebsit) {
|
|
|
|
+
|
|
|
|
+ if (adminDeptWebsitService.lambdaQuery().eq(AdminDeptWebsit::getAdminDeptId,adminDeptWebsit.getAdminDeptId())
|
|
|
|
+ .eq(AdminDeptWebsit::getWebsitId,adminDeptWebsit.getWebsitId()).count() > 0)
|
|
|
|
+ return;
|
|
|
|
+
|
|
adminDeptWebsit.updateById();
|
|
adminDeptWebsit.updateById();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -194,4 +196,24 @@ public class AdminDeptLogic {
|
|
|
|
|
|
return trees;
|
|
return trees;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public void addWebsit(String adminDeptId, List<String> websitIds) {
|
|
|
|
+ AdminDept adminDept = adminDeptService.getById(adminDeptId);
|
|
|
|
+
|
|
|
|
+ List<AdminWebsit> adminWebsits = adminWebsitService.lambdaQuery().in(AdminWebsit::getWebsitId, websitIds).list();
|
|
|
|
+
|
|
|
|
+ for (AdminWebsit adminWebsit : adminWebsits) {
|
|
|
|
+ AdminDeptWebsit adminDeptWebsit = new AdminDeptWebsit();
|
|
|
|
+ adminDeptWebsit.setDeptName(adminDept.getDeptName());
|
|
|
|
+ adminDeptWebsit.setAdminDeptId(adminDept.getAdminDeptId());
|
|
|
|
+ adminDeptWebsit.setWebsitId(adminWebsit.getWebsitId());
|
|
|
|
+ adminDeptWebsit.setWebsitName(adminWebsit.getName());
|
|
|
|
+
|
|
|
|
+ if (adminDeptWebsitService.lambdaQuery().eq(AdminDeptWebsit::getAdminDeptId,adminDeptWebsit.getAdminDeptId())
|
|
|
|
+ .eq(AdminDeptWebsit::getWebsitId,adminWebsit.getWebsitId()).count() > 0)
|
|
|
|
+ continue;
|
|
|
|
+
|
|
|
|
+ adminDeptWebsit.insert();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|