Commit 03a98631 by 徐高华

群活码-链接调整

parent 0cea089b
......@@ -219,8 +219,12 @@ public class HmLinkApiServiceImpl implements HmLinkApiService {
chatActivity.setWxEnterpriseId(wxEnterpriseId);
hmQDTO.setChatActivity(chatActivity);
if(StringUtils.isNotBlank(inStoreId)) {
log.info("lbs后指定门店={}",inStoreId);
hmQDTO.setInStoreId(inStoreId);
List<GroupChatHmBO> hmBOList = joinRuleManager.handleMainStore(hmQDTO);
if(CollectionUtils.isNotEmpty(hmBOList)) {
hmId = hmBOList.get(0).getChatHmId() ;
}
}else {
JSONArray arr = JSONArray.parseArray(chatStoreRule) ;
for(int i=0;i< arr.size();i++) {
......@@ -229,18 +233,21 @@ public class HmLinkApiServiceImpl implements HmLinkApiService {
if(open == 1) {
int type = json.getIntValue("type") ;
if(type==1) {
log.info("服务门店");
List<GroupChatHmBO> hmBOList = joinRuleManager.handleMainStore(hmQDTO);
if(CollectionUtils.isNotEmpty(hmBOList)) {
hmId = hmBOList.get(0).getChatHmId() ;
break;
}
}else if(type==2) {
log.info("协管门店");
List<GroupChatHmBO> hmBOList = joinRuleManager.handleOtherStore(hmQDTO);
if(CollectionUtils.isNotEmpty(hmBOList)) {
hmId = hmBOList.get(0).getChatHmId() ;
break;
}
}else if(type==3) {
log.info("lbs门店");
if(StringUtils.isNotEmpty(qdto.getLatitude()) && StringUtils.isNotEmpty(qdto.getLongitude()) && StringUtils.isNotEmpty(qdto.getDistrictCode())) {
Page<StoreDTO> page = new Page<>() ;
Map<String, Object> params = new HashMap<String, Object>();
......@@ -257,11 +264,13 @@ public class HmLinkApiServiceImpl implements HmLinkApiService {
break;
}
List<String> storeIds = page.getResult().stream().map(StoreDTO::getStoreId).collect(Collectors.toList());
log.info("lbs门店={}",storeIds);
//获取storeId对应活码
Map<String, List<GroupChatHmBO>> storeToHmMap = this.joinRuleManager.getStoreIdToGroupChatHmBOMap(enterpriseId, wxEnterpriseId, storeIds);
if (MapUtil.isEmpty(storeToHmMap)) {
break;
}
log.info("lbs门店={}",storeToHmMap.size());
if(storeToHmMap.size()==1) {
hmId = storeToHmMap.values().iterator().next().get(0).getChatHmId();
break;
......@@ -294,6 +303,7 @@ public class HmLinkApiServiceImpl implements HmLinkApiService {
}
}
}
log.info("hmid={}",hmId);
GroupChatHmBO hm = null;
if (null == hmId) {
log.info("群活码不存在");
......
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