Commit 041e041c by 徐高华

Merge branch 'feature/xgh/202506迭代' into 'developer'

群活码

See merge request !3039
parents a08e8def 26fa313d
......@@ -49,6 +49,10 @@ public class HmLinkChatServiceImpl implements HmLinkChatService {
public int save(String wxEnterpriseId,String enterpriseId,Long linkId, List<HmLinkChatDTO> list, Long otherHmId, TabHmLink oldLink) {
log.info("保存群链接={}", JSON.toJSONString(list));
List<HmLinkChatDTO> oldList = this.hmLinkChatMapper.listByLinkId(wxEnterpriseId, enterpriseId, linkId) ;
if(CollectionUtils.isEmpty(list)) {
log.info("删除关联群活码={},{}", linkId, null);
this.hmLinkChatMapper.delete(linkId, null , 0);
}
if(CollectionUtils.isNotEmpty(list)) {
List<HmLinkChatDTO> updateList = list.stream().filter(dto -> null != dto.getLinkChatId()).collect(Collectors.toList());
List<Long> notDelIdList = updateList.stream().map(dto -> dto.getLinkChatId()).collect(Collectors.toList());
......
......@@ -223,7 +223,8 @@ public class HmLinkApiServiceImpl implements HmLinkApiService {
hmQDTO.setInStoreId(inStoreId);
List<GroupChatHmBO> hmBOList = joinRuleManager.handleMainStore(hmQDTO);
if(CollectionUtils.isNotEmpty(hmBOList)) {
hmId = hmBOList.get(0).getChatHmId() ;
int sort = new Random().nextInt(hmBOList.size()) ;
hmId = hmBOList.get(sort).getChatHmId() ;
}
}else {
JSONArray arr = JSONArray.parseArray(chatStoreRule) ;
......@@ -236,14 +237,16 @@ public class HmLinkApiServiceImpl implements HmLinkApiService {
log.info("服务门店");
List<GroupChatHmBO> hmBOList = joinRuleManager.handleMainStore(hmQDTO);
if(CollectionUtils.isNotEmpty(hmBOList)) {
hmId = hmBOList.get(0).getChatHmId() ;
int sort = new Random().nextInt(hmBOList.size()) ;
hmId = hmBOList.get(sort).getChatHmId() ;
break;
}
}else if(type==2) {
log.info("协管门店");
List<GroupChatHmBO> hmBOList = joinRuleManager.handleOtherStore(hmQDTO);
if(CollectionUtils.isNotEmpty(hmBOList)) {
hmId = hmBOList.get(0).getChatHmId() ;
int sort = new Random().nextInt(hmBOList.size()) ;
hmId = hmBOList.get(sort).getChatHmId() ;
break;
}
}else if(type==3) {
......
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