|
@@ -346,21 +346,21 @@ public class UserController {
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping("/getOU")
|
|
@RequestMapping("/getOU")
|
|
- public HttpRespMsg getOU(String ouName) throws NamingException {
|
|
|
|
|
|
+ public HttpRespMsg getOU() throws NamingException {
|
|
HttpRespMsg httpRespMsg=new HttpRespMsg();
|
|
HttpRespMsg httpRespMsg=new HttpRespMsg();
|
|
- httpRespMsg.setData(userService.ldapGetOU(ouName));
|
|
|
|
|
|
+ httpRespMsg.setData(userService.ldapGetOU());
|
|
return httpRespMsg;
|
|
return httpRespMsg;
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping("/getUser")
|
|
@RequestMapping("/getUser")
|
|
- public HttpRespMsg getUser(String ouName) throws Exception {
|
|
|
|
|
|
+ public HttpRespMsg getUser() throws Exception {
|
|
HttpRespMsg httpRespMsg=new HttpRespMsg();
|
|
HttpRespMsg httpRespMsg=new HttpRespMsg();
|
|
- httpRespMsg.setData(userService.getUser(ouName));
|
|
|
|
|
|
+ httpRespMsg.setData(userService.getUser());
|
|
return httpRespMsg;
|
|
return httpRespMsg;
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping("/initSystemForAd")
|
|
@RequestMapping("/initSystemForAd")
|
|
- public HttpRespMsg initSystemForAd(String companyName,String ouName) throws Exception {
|
|
|
|
|
|
+ public HttpRespMsg initSystemForAd(String companyName) throws Exception {
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
Company company = new Company().setCompanyName(companyName)
|
|
Company company = new Company().setCompanyName(companyName)
|
|
.setExpirationDate(LocalDateTime.now().plusDays(36500));
|
|
.setExpirationDate(LocalDateTime.now().plusDays(36500));
|
|
@@ -388,7 +388,7 @@ public class UserController {
|
|
companyReportMapper.insert(companyReport);
|
|
companyReportMapper.insert(companyReport);
|
|
}
|
|
}
|
|
SysRole role = sysRoleMapper.selectOne(new QueryWrapper<SysRole>().eq("company_id", company.getId()).eq("rolename","普通员工"));
|
|
SysRole role = sysRoleMapper.selectOne(new QueryWrapper<SysRole>().eq("company_id", company.getId()).eq("rolename","普通员工"));
|
|
- List<JSONObject> deptArrays = userService.ldapGetOU(ouName);
|
|
|
|
|
|
+ List<JSONObject> deptArrays = userService.ldapGetOU();
|
|
for (JSONObject dept : deptArrays) {
|
|
for (JSONObject dept : deptArrays) {
|
|
Department department=new Department();
|
|
Department department=new Department();
|
|
department.setDepartmentName(dept.getString("name"))
|
|
department.setDepartmentName(dept.getString("name"))
|
|
@@ -405,7 +405,7 @@ public class UserController {
|
|
departmentMapper.insert(department);
|
|
departmentMapper.insert(department);
|
|
}
|
|
}
|
|
List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", company.getId()));
|
|
List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", company.getId()));
|
|
- List<JSONObject> userArrays = userService.getUser(ouName);
|
|
|
|
|
|
+ List<JSONObject> userArrays = userService.getUser();
|
|
for (JSONObject user : userArrays) {
|
|
for (JSONObject user : userArrays) {
|
|
User u=new User();
|
|
User u=new User();
|
|
u.setId(SnowFlake.nextId()+"")
|
|
u.setId(SnowFlake.nextId()+"")
|
|
@@ -427,8 +427,8 @@ public class UserController {
|
|
if(one!=null){
|
|
if(one!=null){
|
|
u.setDepartmentId(one.getDepartmentId()).setDepartmentName(one.getDepartmentName()).setDepartmentCascade(convertDepartmentIdToCascade(one.getDepartmentId(),departmentList));
|
|
u.setDepartmentId(one.getDepartmentId()).setDepartmentName(one.getDepartmentName()).setDepartmentCascade(convertDepartmentIdToCascade(one.getDepartmentId(),departmentList));
|
|
}
|
|
}
|
|
|
|
+ userService.save(u);
|
|
}
|
|
}
|
|
- userService.save(u);
|
|
|
|
}
|
|
}
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|