...
|
...
|
@@ -21,6 +21,7 @@ import com.yoho.service.model.social.response.UserInfoRspBO; |
|
|
import com.yohobuy.platform.common.enums.ArticleTypeEnum;
|
|
|
import com.yohobuy.platform.common.exception.PlatformException;
|
|
|
import com.yohobuy.platform.common.helper.ImagesHelper;
|
|
|
import com.yohobuy.platform.common.util.CollectionUtil;
|
|
|
import com.yohobuy.platform.common.util.DateUtil;
|
|
|
import com.yohobuy.platform.common.util.SerializeUtils;
|
|
|
import com.yohobuy.platform.common.util.StringUtil;
|
...
|
...
|
@@ -28,6 +29,7 @@ import com.yohobuy.platform.dal.grass.*; |
|
|
import com.yohobuy.platform.dal.grass.model.*;
|
|
|
import com.yohobuy.platform.dal.guang.IAuthorDAO;
|
|
|
import com.yohobuy.platform.dal.guang.model.Author;
|
|
|
import com.yohobuy.platform.dal.product.model.Goods;
|
|
|
import com.yohobuy.platform.grass.cache.UserInfoCacheHelper;
|
|
|
import com.yohobuy.platform.grass.service.IGrassArticleService;
|
|
|
import com.yohobuy.platform.grass.service.IGrassRefreshCacheService;
|
...
|
...
|
@@ -845,6 +847,24 @@ public class GrassArticleServiceImpl implements IGrassArticleService { |
|
|
List<GrassArticleBlock> articleBlocks = grassArticleBlockDao.selectByArticleId(articleId);
|
|
|
List<Integer> uidList = handleUserWithAt(articleBlocks);
|
|
|
if(CollectionUtils.isNotEmpty(uidList)){
|
|
|
List<GrassInformRecord> informRecordList = grassInformRecordDao.selectByArticleIdAndUidsAndSceneType(articleId, uidList, MsgInformSceneEnum.ARTICLE_AT_INFORM.getType());
|
|
|
Map<Integer, List<GrassInformRecord>> map = informRecordList.stream().collect(Collectors.groupingBy(GrassInformRecord::getUid));
|
|
|
List<GrassInformRecord> addInformRecords = Lists.newArrayList();
|
|
|
List<Integer> sendedList = Lists.newArrayList();
|
|
|
for (Integer uid : uidList) {
|
|
|
//已经发过站内信了
|
|
|
if (CollectionUtils.isNotEmpty(map.get(uid))) {
|
|
|
sendedList.add(uid);
|
|
|
} else { //第一次发,记录发送
|
|
|
GrassInformRecord grassInformRecord = new GrassInformRecord();
|
|
|
grassInformRecord.setArticleId(articleId);
|
|
|
grassInformRecord.setUid(uid);
|
|
|
grassInformRecord.setSceneType(MsgInformSceneEnum.ARTICLE_AT_INFORM.getType());
|
|
|
grassInformRecord.setCreateTime(com.yoho.core.common.utils.DateUtil.getCurrentTimeSecond());
|
|
|
addInformRecords.add(grassInformRecord);
|
|
|
}
|
|
|
}
|
|
|
uidList.removeAll(sendedList);
|
|
|
if(filterFlag){
|
|
|
//查询社区大号、品牌号、KOL的uid
|
|
|
List<Integer> groupIds = new ArrayList<>();
|
...
|
...
|
@@ -926,12 +946,17 @@ public class GrassArticleServiceImpl implements IGrassArticleService { |
|
|
addReqList.add(addReq);
|
|
|
});
|
|
|
sendBatchInbox(addReqList);
|
|
|
|
|
|
if(CollectionUtils.isNotEmpty(addInformRecords)){
|
|
|
grassInformRecordDao.insertBatch(addInformRecords);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public void sendBatchInbox(List<GrassInBoxAddReq> reqs){
|
|
|
try {
|
|
|
if(CollectionUtils.isEmpty(reqs)){
|
|
|
return;
|
|
|
}
|
|
|
logger.info("before gateway.addBatchGrassInBox.addReqList size is {}", reqs.size());
|
|
|
String url = apiUrl + "/guang/api/addBatchInBox/?client_type=h5";
|
|
|
serviceCaller.post("gateway.addBatchGrassInBox", url, reqs,
|
...
|
...
|
|