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