|
@@ -370,7 +370,7 @@ public class WeiXinCorpController {
|
|
|
String corpId = jsonObject.getString("AuthCorpId");
|
|
|
String corpWxUserId = jsonObject.getString("UserID");
|
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectById(corpId);
|
|
|
- if (!StringUtils.isEmpty(wxCorpInfo.getContactSecret())) {
|
|
|
+ if (!StringUtils.isEmpty(wxCorpInfo.getContactSecret()) && !StringUtils.isEmpty(wxCorpInfo.getContactSecret())) {
|
|
|
Integer companyId = wxCorpInfo.getCompanyId();
|
|
|
SysRole defaultRole = sysRoleMapper.selectOne(new QueryWrapper<SysRole>().eq("company_id", companyId).eq("is_default", 1));
|
|
|
//通过通讯录secret获取到员工姓名
|
|
@@ -416,7 +416,7 @@ public class WeiXinCorpController {
|
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectById(corpId);
|
|
|
Integer companyId = wxCorpInfo.getCompanyId();
|
|
|
//只有授权通讯录同步的,才有机会更新部门或者上级
|
|
|
- if (!StringUtils.isEmpty(wxCorpInfo.getContactSecret())) {
|
|
|
+ if (!StringUtils.isEmpty(wxCorpInfo.getContactSecret()) && !StringUtils.isEmpty(wxCorpInfo.getContactSecret())) {
|
|
|
String remoteCorpConcactAccessToken = getRemoteCorpConcactAccessToken(wxCorpInfo);
|
|
|
String curCorpAccessToken = getCorpAccessToken(wxCorpInfo);
|
|
|
Integer curUserWXDeptid = 0;
|
|
@@ -476,7 +476,7 @@ public class WeiXinCorpController {
|
|
|
Integer deptId = jsonObject.getInt("Id");
|
|
|
Integer parentDeptId = jsonObject.getInt("ParentId");
|
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectById(corpId);
|
|
|
- if (wxCorpInfo != null && !StringUtils.isEmpty(wxCorpInfo.getContactSecret())) {
|
|
|
+ if (wxCorpInfo != null && !StringUtils.isEmpty(wxCorpInfo.getContactSecret()) && !StringUtils.isEmpty(wxCorpInfo.getContactSecret())) {
|
|
|
String remoteCorpConcactAccessToken = getRemoteCorpConcactAccessToken(wxCorpInfo);
|
|
|
Integer companyId = wxCorpInfo.getCompanyId();
|
|
|
Department department = new Department();
|
|
@@ -501,7 +501,7 @@ public class WeiXinCorpController {
|
|
|
Integer deptId = jsonObject.getInt("Id");
|
|
|
Integer parentDeptId = jsonObject.getInt("ParentId");
|
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectById(corpId);
|
|
|
- if (wxCorpInfo != null && !StringUtils.isEmpty(wxCorpInfo.getContactSecret())) {
|
|
|
+ if (wxCorpInfo != null && !StringUtils.isEmpty(wxCorpInfo.getContactSecret()) && !StringUtils.isEmpty(wxCorpInfo.getContactSecret())) {
|
|
|
if (parentDeptId != null) {
|
|
|
//发生父部门的结构变化了
|
|
|
Department department = departmentMapper.selectOne(new QueryWrapper<Department>().eq("company_id", wxCorpInfo.getCompanyId()).eq("corpwx_deptid", deptId));
|
|
@@ -531,13 +531,10 @@ public class WeiXinCorpController {
|
|
|
System.err.println("同步获取部门详情报错:"+resultObj.toString());
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- // TODO
|
|
|
// 解密失败,失败原因请查看异常
|
|
|
e.printStackTrace();
|
|
|
}
|