Commit c389618b by 墨竹

feat:bug修改

parent d1a57666
...@@ -769,7 +769,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -769,7 +769,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
dto.setAvatar(StringUtils.isBlank(dto.getAvatar()) ? midRelatedDto.getAvatar() : dto.getAvatar()); dto.setAvatar(StringUtils.isBlank(dto.getAvatar()) ? midRelatedDto.getAvatar() : dto.getAvatar());
dto.setMemberUnionidRelatedId(midRelatedDto.getMemberUnionidRelatedId()); dto.setMemberUnionidRelatedId(midRelatedDto.getMemberUnionidRelatedId());
if (StringUtils.isAnyBlank(dto.getExternalUserid(),dto.getSelfExternalUserid())) { if (StringUtils.isAnyBlank(dto.getExternalUserid(), dto.getSelfExternalUserid())) {
log.error("加好友异常、请检查配置是否正常(如:检查客户联系回调、老好办助手回调、代开发回调(是否配置多个回调、企微权限是否正常、密钥是否正确)、好办权限等),wxEnterpriseId:{}", wxEnterpriseId); log.error("加好友异常、请检查配置是否正常(如:检查客户联系回调、老好办助手回调、代开发回调(是否配置多个回调、企微权限是否正常、密钥是否正确)、好办权限等),wxEnterpriseId:{}", wxEnterpriseId);
return null; return null;
} }
...@@ -2014,9 +2014,9 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -2014,9 +2014,9 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
wxEnterpriseService.updateUseridFlagById(2, null, wxEnterpriseId); wxEnterpriseService.updateUseridFlagById(2, null, wxEnterpriseId);
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("corpid",corpid); jsonObject.put("corpid", corpid);
jsonObject.put("wxEnterpriseId",wxEnterpriseId); jsonObject.put("wxEnterpriseId", wxEnterpriseId);
jsonObject.put("secret",secretSetting.getSecretVal()); jsonObject.put("secret", secretSetting.getSecretVal());
GicMQClient clientInstance = GICMQClientUtil.getClientInstance(); GicMQClient clientInstance = GICMQClientUtil.getClientInstance();
try { try {
clientInstance.sendMessage("updateNewUseridCorpidMq", jsonObject.toJSONString()); clientInstance.sendMessage("updateNewUseridCorpidMq", jsonObject.toJSONString());
...@@ -2033,7 +2033,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -2033,7 +2033,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
log.error("传入为空"); log.error("传入为空");
return; return;
} }
log.info("转换corpid、userid start params:{}",params); log.info("转换corpid、userid start params:{}", params);
JSONObject jsonObject = JSON.parseObject(params); JSONObject jsonObject = JSON.parseObject(params);
String wxEnterpriseId = jsonObject.getString("wxEnterpriseId"); String wxEnterpriseId = jsonObject.getString("wxEnterpriseId");
String corpid = jsonObject.getString("corpid"); String corpid = jsonObject.getString("corpid");
...@@ -2045,7 +2045,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -2045,7 +2045,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
rateLimiter.trySetRate(RateType.OVERALL, 5, 1, RateIntervalUnit.SECONDS); rateLimiter.trySetRate(RateType.OVERALL, 5, 1, RateIntervalUnit.SECONDS);
BasePageInfo basePageInfo = new BasePageInfo(); BasePageInfo basePageInfo = new BasePageInfo();
int pageNum = 1; int pageNum = 1;
while (true){ while (true) {
rateLimiter.acquire(); rateLimiter.acquire();
basePageInfo.setPageNum(pageNum); basePageInfo.setPageNum(pageNum);
basePageInfo.setPageSize(1000); basePageInfo.setPageSize(1000);
...@@ -2064,10 +2064,10 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -2064,10 +2064,10 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
for (QywxNewUseridDTO qywxNewUseridDTO : qywxNewUseridDTOList) { for (QywxNewUseridDTO qywxNewUseridDTO : qywxNewUseridDTOList) {
String userid = qywxNewUseridDTO.getUserid(); String userid = qywxNewUseridDTO.getUserid();
String openUserid = qywxNewUseridDTO.getOpen_userid(); String openUserid = qywxNewUseridDTO.getOpen_userid();
log.info("转换新的userid,userid:{},openUserid:{}",userid,openUserid); log.info("转换新的userid,userid:{},openUserid:{}", userid, openUserid);
staffService.updateUserIdByUserId(wxEnterpriseId,openUserid,userid); staffService.updateUserIdByUserId(wxEnterpriseId, openUserid, userid);
} }
pageNum ++; pageNum++;
} }
//更新导购员工关联关系表 //更新导购员工关联关系表
...@@ -2080,13 +2080,14 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -2080,13 +2080,14 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
externalClerkRelatedService.updateUserIdByWxEnterpriseId(wxEnterpriseId); externalClerkRelatedService.updateUserIdByWxEnterpriseId(wxEnterpriseId);
//更新自建外部联系人id //更新自建外部联系人id
memberUnionRelatedService.updateExternalUseridByWxEnterpriseId(wxEnterpriseId); memberUnionRelatedService.updateExternalUseridByWxEnterpriseId(wxEnterpriseId);
log.info("转换corpid、userid end params:{}",params); log.info("转换corpid、userid end params:{}", params);
//迁移完成 //迁移完成
updateUseridFlagById(wxEnterpriseId,corpid); updateUseridFlagById(wxEnterpriseId, corpid);
} }
/** /**
* 迁移完成 * 迁移完成
*
* @param wxEnterpriseId * @param wxEnterpriseId
* @param corpid * @param corpid
*/ */
...@@ -2095,16 +2096,16 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -2095,16 +2096,16 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
String openCorpid = qywxUserApiService.toOpenCorpid(corpid, serviceCorpid); String openCorpid = qywxUserApiService.toOpenCorpid(corpid, serviceCorpid);
TabHaobanWxApplication tabHaobanWxApplication = wxApplicationMapper.selectByCorpId(corpid, 3); TabHaobanWxApplication tabHaobanWxApplication = wxApplicationMapper.selectByCorpId(corpid, 3);
if (tabHaobanWxApplication == null) { if (tabHaobanWxApplication == null) {
log.info("代开发应用不存在:{}",corpid); log.info("代开发应用不存在:{}", corpid);
return; return;
} }
wxApplicationMapper.updateCorpidById(tabHaobanWxApplication.getWxApplicationId(),openCorpid); String[] openidType = {"1", "3"};
String[] openidType = {"1","3"};
//调用完成接口 //调用完成接口
boolean flag = qywxUserApiService.finishOpenidMigration(corpid, serviceCorpid, tabHaobanWxApplication.getAgentId(), openidType); boolean flag = qywxUserApiService.finishOpenidMigration(corpid, serviceCorpid, tabHaobanWxApplication.getAgentId(), openidType);
if (flag) { if (flag) {
wxApplicationMapper.updateCorpidById(tabHaobanWxApplication.getWxApplicationId(), openCorpid);
wxEnterpriseService.updateUseridFlagById(1, openCorpid, wxEnterpriseId); wxEnterpriseService.updateUseridFlagById(1, openCorpid, wxEnterpriseId);
}else { } else {
wxEnterpriseService.updateUseridFlagById(3, openCorpid, wxEnterpriseId); wxEnterpriseService.updateUseridFlagById(3, openCorpid, wxEnterpriseId);
} }
String lockKey = "updateNewUseridCorpid_" + wxEnterpriseId; String lockKey = "updateNewUseridCorpid_" + wxEnterpriseId;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment