Commit 03a98631 by 徐高华

群活码-链接调整

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