|
@@ -1448,7 +1448,6 @@ public class WeiXinCorpController {
|
|
//改造老版的接口,从平台获取客户通讯录
|
|
//改造老版的接口,从平台获取客户通讯录
|
|
@RequestMapping("/getCorpMembsFromPlatform")
|
|
@RequestMapping("/getCorpMembsFromPlatform")
|
|
public HttpRespMsg getCorpMembsFromPlatform(Integer companyId) {
|
|
public HttpRespMsg getCorpMembsFromPlatform(Integer companyId) {
|
|
- Company company = companyMapper.selectById(companyId);
|
|
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
|
|
if (wxCorpInfo == null) {
|
|
if (wxCorpInfo == null) {
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
@@ -1489,6 +1488,11 @@ public class WeiXinCorpController {
|
|
} else {
|
|
} else {
|
|
//
|
|
//
|
|
System.out.println("找到了已有部门== name=="+curDept.getDepartmentName());
|
|
System.out.println("找到了已有部门== name=="+curDept.getDepartmentName());
|
|
|
|
+ if (parentId != 1 && curDept.getCorpwxDeptpid() == null) {
|
|
|
|
+ //有父部门需要更新
|
|
|
|
+ curDept.setCorpwxDeptpid(parentId);
|
|
|
|
+ departmentMapper.updateById(curDept);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1896,10 +1900,10 @@ public class WeiXinCorpController {
|
|
List<Department> allDbDeptList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", companyId));
|
|
List<Department> allDbDeptList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", companyId));
|
|
for (Department department : allDbDeptList) {
|
|
for (Department department : allDbDeptList) {
|
|
Integer corpwxpid = department.getCorpwxDeptpid();
|
|
Integer corpwxpid = department.getCorpwxDeptpid();
|
|
- if (corpwxpid != null && corpwxpid == 1) {
|
|
|
|
|
|
+ if (corpwxpid == null || corpwxpid == 1) {
|
|
|
|
|
|
} else {
|
|
} else {
|
|
- Optional<Department> first = allDbDeptList.stream().filter(all -> all.getCorpwxDeptid().intValue() == corpwxpid).findFirst();
|
|
|
|
|
|
+ Optional<Department> first = allDbDeptList.stream().filter(all -> all.getCorpwxDeptid() != null && all.getCorpwxDeptid().intValue() == corpwxpid).findFirst();
|
|
if (first.isPresent()) {
|
|
if (first.isPresent()) {
|
|
//按照企业微信的部门父部门找到了
|
|
//按照企业微信的部门父部门找到了
|
|
Integer sysPid = first.get().getDepartmentId();
|
|
Integer sysPid = first.get().getDepartmentId();
|