|
@@ -237,14 +237,14 @@ public class UserService extends BaseController {
|
|
UserUtils.putCache("selectOffice", user.getOffice().getId());
|
|
UserUtils.putCache("selectOffice", user.getOffice().getId());
|
|
}
|
|
}
|
|
if (!loginUser.getComId().equals("1")){
|
|
if (!loginUser.getComId().equals("1")){
|
|
- Role comRole = systemService.getRoleByEnname(loginUser.getCompany().getId(), user.getOffice(),"yg");
|
|
|
|
- if (comRole != null && !comRole.getCompany().getId().equals("1")){
|
|
|
|
|
|
+// Role comRole = systemService.getRoleByEnname(loginUser.getCompany().getId(), user.getOffice(),"yg");
|
|
|
|
+// if (comRole != null && !comRole.getCompany().getId().equals("1")){
|
|
Useroffice useroffice = new Useroffice();
|
|
Useroffice useroffice = new Useroffice();
|
|
useroffice.setUserId(user.getId());
|
|
useroffice.setUserId(user.getId());
|
|
useroffice.setStatus("3");
|
|
useroffice.setStatus("3");
|
|
useroffice.setMaster(UserUtils.getUser().getId());
|
|
useroffice.setMaster(UserUtils.getUser().getId());
|
|
useroffice.setCompanyId(loginUser.getCompany().getId());
|
|
useroffice.setCompanyId(loginUser.getCompany().getId());
|
|
- useroffice.setOfficeId(comRole.getOffice().getId());
|
|
|
|
|
|
+ useroffice.setOfficeId(user.getOffice().getId());
|
|
List<Useroffice> listOffice = userofficeService.findList(useroffice);
|
|
List<Useroffice> listOffice = userofficeService.findList(useroffice);
|
|
if(listOffice==null || listOffice.size()==0){
|
|
if(listOffice==null || listOffice.size()==0){
|
|
userofficeService.save(useroffice);
|
|
userofficeService.save(useroffice);
|
|
@@ -253,10 +253,10 @@ public class UserService extends BaseController {
|
|
oldUseroffice.setOfficeId(user.getOffice().getId());
|
|
oldUseroffice.setOfficeId(user.getOffice().getId());
|
|
userofficeService.save(oldUseroffice);
|
|
userofficeService.save(oldUseroffice);
|
|
}
|
|
}
|
|
- }
|
|
|
|
- if (b) {
|
|
|
|
- systemService.assignUserToRole(comRole, user,0);
|
|
|
|
- }
|
|
|
|
|
|
+// }
|
|
|
|
+// if (b) {
|
|
|
|
+// systemService.assignUserToRole(comRole, user,0);
|
|
|
|
+// }
|
|
}else {
|
|
}else {
|
|
systemService.addUserToRole(user);
|
|
systemService.addUserToRole(user);
|
|
}
|
|
}
|