|
@@ -10,12 +10,10 @@ import com.gree.mall.manager.bean.workorder.IncreVO;
|
|
|
import com.gree.mall.manager.commonmapper.AdminMapper;
|
|
|
import com.gree.mall.manager.exception.RemoteServiceException;
|
|
|
import com.gree.mall.manager.logic.common.CommonLogic;
|
|
|
-import com.gree.mall.manager.plus.entity.AdminDept;
|
|
|
-import com.gree.mall.manager.plus.entity.AdminDeptWebsit;
|
|
|
-import com.gree.mall.manager.plus.entity.AdminUserWebsitRela;
|
|
|
-import com.gree.mall.manager.plus.entity.AdminWebsit;
|
|
|
+import com.gree.mall.manager.plus.entity.*;
|
|
|
import com.gree.mall.manager.plus.service.AdminDeptService;
|
|
|
import com.gree.mall.manager.plus.service.AdminDeptWebsitService;
|
|
|
+import com.gree.mall.manager.plus.service.AdminUserDeptRelaService;
|
|
|
import com.gree.mall.manager.zfire.bean.ZfireParamBean;
|
|
|
import com.gree.mall.manager.zfire.util.FieldUtils;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -46,6 +44,10 @@ public class AdminDeptLogic {
|
|
|
AdminDeptWebsitService adminDeptWebsitService;
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
+ AdminUserDeptRelaService adminUserDeptRelaService;
|
|
|
+
|
|
|
+
|
|
|
|
|
|
public List<AdminDeptTree> tree(HttpServletRequest request) {
|
|
|
|
|
@@ -109,12 +111,19 @@ public class AdminDeptLogic {
|
|
|
|
|
|
public void update(AdminDept adminDept) {
|
|
|
adminDept.updateById();
|
|
|
+
|
|
|
+ adminDeptWebsitService.lambdaUpdate().eq(AdminDeptWebsit::getAdminDeptId,adminDept.getAdminDeptId())
|
|
|
+ .set(AdminDeptWebsit::getDeptName,adminDept.getDeptName()).update();
|
|
|
}
|
|
|
|
|
|
public void del(String id) {
|
|
|
if (adminDeptWebsitService.lambdaQuery().eq(AdminDeptWebsit::getAdminDeptId,id).count() > 0)
|
|
|
throw new RemoteServiceException("存在绑定网点");
|
|
|
|
|
|
+ if (adminUserDeptRelaService.lambdaQuery().eq(AdminUserDeptRela::getAdminDeptId,id).count() > 0) {
|
|
|
+ throw new RemoteServiceException("存在绑定账号");
|
|
|
+ }
|
|
|
+
|
|
|
adminDeptService.removeById(id);
|
|
|
}
|
|
|
|
|
@@ -127,6 +136,12 @@ public class AdminDeptLogic {
|
|
|
}
|
|
|
|
|
|
public void delWebsit(String adminDeptWebsitId) {
|
|
|
+ AdminDeptWebsit adminDeptWebsit = adminDeptWebsitService.getById(adminDeptWebsitId);
|
|
|
+
|
|
|
+ AdminDept adminDept = adminDeptService.getById(adminDeptWebsit.getAdminDeptId());
|
|
|
+ if (adminDept.getPId().equals("1"))
|
|
|
+ throw new RemoteServiceException("商户不能删除绑定网点");
|
|
|
+
|
|
|
adminDeptWebsitService.removeById(adminDeptWebsitId);
|
|
|
}
|
|
|
|