Commit 3ecf2e9a by 王祖波

Merge branch 'feature-content2' into 'master'

Feature content2

See merge request !1179
parents 35c958a8 739c5280
......@@ -19,6 +19,7 @@ import com.gic.haoban.manage.api.dto.notify.qdto.NotifyMessageBatchQDTO;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
import com.gic.haoban.manage.service.service.WxEnterpriseRelatedService;
import com.gic.wechat.api.dto.qywx.QywxTemplateCardSendMessageDTO;
import org.apache.commons.collections.CollectionUtils;
......@@ -169,6 +170,8 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
logger.info("商户未关联好办或都已停用enterpriseId={}", enterpriseId);
return ServiceResponse.success();
}
List<TabHaobanWxEnterprise> wxEnterpriseList = wxEnterpriseRelatedService.listByEnterpriseId(enterpriseId);
List<String> wxEnterpriseIdList = wxEnterpriseList.stream().map(TabHaobanWxEnterprise::getWxEnterpriseId).collect(Collectors.toList());
List<String> clerkIdList = clerkService.getclerkListByStoreIds(storeIdList);
if (CollectionUtils.isEmpty(clerkIdList)) {
logger.info("门店导购列表为空");
......@@ -185,7 +188,7 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
return ServiceResponse.success();
}
notifyMessageBatchQDTO.setTemplateCode(messageTypeEnum.getTemplateCode());
Map<String, List<StaffClerkRelationDTO>> map = relationList.stream().collect(Collectors.groupingBy(StaffClerkRelationDTO::getWxEnterpriseId));
Map<String, List<StaffClerkRelationDTO>> map = relationList.stream().filter(x->wxEnterpriseIdList.contains(x.getWxEnterpriseId())).collect(Collectors.groupingBy(StaffClerkRelationDTO::getWxEnterpriseId));
map.forEach((wxEnterpriseId,v)->{
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId);
if (qwDTO == null) {
......
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