|
@@ -273,7 +273,7 @@ public class AdminUserLogic {
|
|
|
}
|
|
|
adminUserDeptRelaService.lambdaUpdate().eq(AdminUserDeptRela::getAdminUserId, adminUser.getAdminUserId()).remove();
|
|
|
|
|
|
- List<AdminDept> adminDepts = adminDeptService.lambdaQuery().eq(AdminDept::getAdminDeptId, adminUser.getAdminWebsitId()).list();
|
|
|
+ List<AdminDept> adminDepts = adminDeptService.lambdaQuery().eq(AdminDept::getAdminDeptId, adminUser.getAdminDeptId()).list();
|
|
|
if (adminDepts.size() == 0) {
|
|
|
throw new RemoteServiceException("请选择至少1个部门");
|
|
|
}
|
|
@@ -292,6 +292,7 @@ public class AdminUserLogic {
|
|
|
/**
|
|
|
* 修改帐号
|
|
|
*/
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public void update(HttpServletRequest request, AdminUserAddReqBean newUser) {
|
|
|
|
|
|
AdminUserCom admin = commonLogic.getAdminUser(request);
|
|
@@ -329,12 +330,16 @@ public class AdminUserLogic {
|
|
|
newUser.setType(2);
|
|
|
}
|
|
|
}else {
|
|
|
- AdminDept adminDept = adminDeptService.getById(newUser.getAdminDeptId());
|
|
|
+
|
|
|
+ if (!StringUtil.isEmpty(newUser.getAdminDeptId())){
|
|
|
+
|
|
|
+ AdminDept adminDept = adminDeptService.getById(newUser.getAdminDeptId());
|
|
|
|
|
|
newUser.setCompanyWechatId(adminDept.getCompanyWechatId());
|
|
|
newUser.setCompanyName(adminDept.getCompanyWechatName());
|
|
|
|
|
|
newUser.setType(0);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -345,6 +350,9 @@ public class AdminUserLogic {
|
|
|
newUser.updateById();
|
|
|
|
|
|
|
|
|
+ adminUserWebsitRelaService.lambdaUpdate().eq(AdminUserWebsitRela::getAdminUserId,newUser.getAdminUserId()).remove();
|
|
|
+ adminUserDeptRelaService.lambdaUpdate().eq(AdminUserDeptRela::getAdminUserId,newUser.getAdminUserId()).remove();
|
|
|
+
|
|
|
//部门账号(商户账号在生成商户的时候已经处理了部门)
|
|
|
if (newUser.getType() != 2) {
|
|
|
//添加部门
|