|
@@ -912,12 +912,13 @@ public class WeiXinCorpController {
|
|
data.setAuthUsername(authUserInfo.getString("name"));
|
|
data.setAuthUsername(authUserInfo.getString("name"));
|
|
String userId = authUserInfo.getString("userid");//授权人的userid
|
|
String userId = authUserInfo.getString("userid");//授权人的userid
|
|
|
|
|
|
- //检查公司名称是否存在
|
|
|
|
- List<Company> cpList = companyMapper.selectList(new QueryWrapper<Company>().eq("company_name", corpName).or().eq("company_name", data.getCorpFullName()));
|
|
|
|
|
|
+ //检查公司名称是否存在,按照corpid比对
|
|
|
|
+ WxCorpInfo findCorp = wxCorpInfoMapper.selectById(corpId);
|
|
|
|
+
|
|
Company company = null;
|
|
Company company = null;
|
|
SysRole managerRole = null;
|
|
SysRole managerRole = null;
|
|
- if (cpList.size() > 0) {
|
|
|
|
- company = cpList.get(0);
|
|
|
|
|
|
+ if (findCorp != null) {
|
|
|
|
+ company = companyMapper.selectById(findCorp.getCompanyId());
|
|
managerRole = sysRoleMapper.selectOne(new QueryWrapper<SysRole>().eq("company_id", company.getId()).eq("rolename", com.management.platform.constant.Constant.ROLE_SUPER_MANAGER));
|
|
managerRole = sysRoleMapper.selectOne(new QueryWrapper<SysRole>().eq("company_id", company.getId()).eq("rolename", com.management.platform.constant.Constant.ROLE_SUPER_MANAGER));
|
|
} else {
|
|
} else {
|
|
//首先生成一个新公司,增加会员的试用一个月
|
|
//首先生成一个新公司,增加会员的试用一个月
|
|
@@ -1010,7 +1011,6 @@ public class WeiXinCorpController {
|
|
data.setSaasSyncContact(enableNewVersion?1:0);
|
|
data.setSaasSyncContact(enableNewVersion?1:0);
|
|
wxCorpInfoMapper.insert(data);
|
|
wxCorpInfoMapper.insert(data);
|
|
//默认普通员工的角色
|
|
//默认普通员工的角色
|
|
- SysRole defaultUserRole = sysRoleService.getOne(new QueryWrapper<SysRole>().eq("company_id", company.getId()).eq("is_default", 1));
|
|
|
|
JSONObject userDetail = getUserInfo(curCorpAccessToken, userId);
|
|
JSONObject userDetail = getUserInfo(curCorpAccessToken, userId);
|
|
//检查授权人是否存在
|
|
//检查授权人是否存在
|
|
int cnt = userMapper.selectCount(new QueryWrapper<User>().eq("corpwx_userid", userId));
|
|
int cnt = userMapper.selectCount(new QueryWrapper<User>().eq("corpwx_userid", userId));
|