Commit e6f99e63 by 墨竹

Merge branch 'fixbug_0720' into developer

# Conflicts:
#	haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/config/Config.java
parents 8e43079d c013095c
......@@ -26,6 +26,8 @@ public class Config {
private String historyMbrMassOperWhiteList;
@Value("${qywx_member_suite}")
private String qywxMemberSuite;
@Value("${staff_third_wx_enterpriseId}")
private String staffThirdWxEnterpriseId;
@Value("${hm_link_url}")
private String hmLinkUrl;
......@@ -100,4 +102,12 @@ public class Config {
public void setQywxMemberSuite(String qywxMemberSuite) {
this.qywxMemberSuite = qywxMemberSuite;
}
public String getStaffThirdWxEnterpriseId() {
return staffThirdWxEnterpriseId;
}
public void setStaffThirdWxEnterpriseId(String staffThirdWxEnterpriseId) {
this.staffThirdWxEnterpriseId = staffThirdWxEnterpriseId;
}
}
......@@ -29,6 +29,7 @@ import com.gic.haoban.common.utils.UuidUtil;
import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.enums.SecretTypeEnum;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.dao.mapper.StaffDepartmentRelatedMapper;
import com.gic.haoban.manage.service.dao.mapper.StaffMapper;
import com.gic.haoban.manage.service.entity.*;
......@@ -102,6 +103,8 @@ public class StaffApiServiceImpl implements StaffApiService {
private StoreRangeService storeRangeService;
@Autowired
private EnterpriseService enterpriseService;
@Autowired
private Config config;
@Override
public StaffDTO selectById(String staffId) {
......@@ -314,18 +317,26 @@ public class StaffApiServiceImpl implements StaffApiService {
res.setCode(4);
return res;
}
UserDTO user = qywxUserApiService.getSelfWorkWxUser(corpid, secretSetting.getSecretVal(), userId);
String staffThirdWxEnterpriseId = config.getStaffThirdWxEnterpriseId();
UserDTO user = null;
if (staffThirdWxEnterpriseId.contains(corpid)) {
user = qywxUserApiService.getWorkWxUser(corpid, config.getWxSuiteid(), userId);
} else {
user = qywxUserApiService.getSelfWorkWxUser(corpid, secretSetting.getSecretVal(), userId);
}
if (null == user) {
logger.info("企业微信用户不存在:{}:{}", wxEnterpriseId, userId);
res.setMessage("企业微信用户不存在");
res.setCode(3);
return res;
}
String nationCode = null ;
String nationCode = null;
String phoneNumber = null;
String imageUrl = changeHeaderImageUrl(user.getAvatar());
String mobile = user.getMobile();
if(StringUtils.isNotBlank(mobile)) {
if (StringUtils.isNotBlank(mobile)) {
String[] arr = getNationCodeAndPhoneNumber(mobile);
nationCode = arr[0];
phoneNumber = arr[1];
......@@ -899,7 +910,7 @@ public class StaffApiServiceImpl implements StaffApiService {
return Collections.emptyList();
}
List<String> unBindList = clerkList.stream().filter(clerkId -> !clerkIds.contains(clerkId)).collect(Collectors.toList());
logger.info("未绑定导购id:{}",JSON.toJSONString(unBindList));
logger.info("未绑定导购id:{}", JSON.toJSONString(unBindList));
return unBindList;
}
......@@ -1330,7 +1341,7 @@ public class StaffApiServiceImpl implements StaffApiService {
Object cache = RedisUtil.getCache(cacheKey);
if (cache != null) {
List<String> storeList = (List<String>) cache;
logger.info("从缓存中获取通道={},数量:{}", cacheKey,storeList.size());
logger.info("从缓存中获取通道={},数量:{}", cacheKey, storeList.size());
return storeList;
}
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(clerkId);
......@@ -1376,7 +1387,7 @@ public class StaffApiServiceImpl implements StaffApiService {
}
@Override
public List<String> getHaoBanStoreRolesByStoreWidgetId(String storeWidgetId,String wxEnterpriseId, String enterpriseId) {
public List<String> getHaoBanStoreRolesByStoreWidgetId(String storeWidgetId, String wxEnterpriseId, String enterpriseId) {
return getStoreWidgetIdStoreIds(storeWidgetId, enterpriseId);
}
......
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