Commit 4e8571c6 by 徐高华

通讯录

parent 94cddc37
......@@ -209,11 +209,10 @@ public class StaffApiServiceImpl implements StaffApiService {
return res;
}
UserDTO user = null;
WxEnterpriseQwDTO wxInfo = this.wxEnterpriseService.getQwInfo(wxEnterpriseId) ;
if(wxInfo.getWxSecurityType()==4) {
if(qwDTO.getWxSecurityType()==4) {
user = qywxUserApiService.getWorkWxUser(corpid, config.getWxSuiteid(), userId);
logger.info("成员详情(第三方)={}",JSON.toJSONString(user)) ;
UserDTO userSelf = qywxUserApiService.getSelfWorkWxUser(wxInfo.getDkCorpid(), secretSetting.getSecretVal(), user.getOpen_userid());
UserDTO userSelf = qywxUserApiService.getSelfWorkWxUser(qwDTO.getDkCorpid(), secretSetting.getSecretVal(), user.getOpen_userid());
logger.info("成员详情(代开)={}",JSON.toJSONString(user)) ;
if (user != null && userSelf != null) {
user.setName(userSelf.getName());
......@@ -244,7 +243,7 @@ public class StaffApiServiceImpl implements StaffApiService {
}
staff = (staff == null ? new TabHaobanStaff() : staff);
staff.setWxUserId(userId);
String openUserid = getOpenUserid(userId, corpid);
String openUserid = getOpenUserid(userId, corpid , qwDTO);
if (StringUtils.isNotBlank(openUserid)) {
staff.setWxOpenUseId(openUserid);
}
......@@ -280,7 +279,7 @@ public class StaffApiServiceImpl implements StaffApiService {
} else {
staffService.updateByPrimaryKey(staff);
}
logger.info("门店变更保存:{}", JSONObject.toJSONString(user));
logger.info("staff变更保存:{}", JSONObject.toJSONString(user));
staffDepartChange(staff, wxEnterpriseId, user);
// 返回结果带上员工姓名
res.setResult(staff.getStaffName());
......@@ -294,13 +293,16 @@ public class StaffApiServiceImpl implements StaffApiService {
* @param corpid
* @return
*/
private String getOpenUserid(String userId, String corpid) {
TabHaobanWxApplication tabHaobanWxApplication = wxApplicationService.selectByCorpId(corpid);
List<QywxNewUseridDTO> qywxNewUseridDTOS = qywxUserApiService.useridToOpenuserid(corpid, tabHaobanWxApplication.getSiteId(), Collections.singletonList(userId));
if (CollectionUtils.isEmpty(qywxNewUseridDTOS)) {
private String getOpenUserid(String userId, String corpid , WxEnterpriseQwDTO qwDTO) {
if(qwDTO.getWxSecurityType()==2) {
return userId ;
}
List<QywxNewUseridDTO> list = qywxUserApiService.useridToOpenuserid(qwDTO.getThirdCorpid(), config.getWxSuiteid(), Collections.singletonList(userId));
logger.info("明文userId转密文={}",userId , JSON.toJSONString(list));
if (CollectionUtils.isEmpty(list)) {
return "";
}
return qywxNewUseridDTOS.get(0).getOpen_userid();
return list.get(0).getOpen_userid();
}
private String[] getNationCodeAndPhoneNumber(String phoneNumber) {
......
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