提交 6fb99879 作者: 沈振路

去重复

上级 9c9aa953
......@@ -135,7 +135,7 @@ public class CustomerServiceCommonAsyncComponent {
}
@Async("myExecutor")
public void obtainLink(Long materialId, CustomerGraphics customerGraphics, List<ReferralEntity> referralEntityList) {
public void obtainMessageLink(Long materialId, CustomerGraphics customerGraphics, List<ReferralEntity> referralEntityList) {
// 获取符合人群包条件的用户所属的公众号列表
List<CrowdPackageUserVO> userListFromPackage = conditionMatchService.getUserListFromPackage(customerGraphics.getPackId(), null);
Map<String, List<CrowdPackageUserVO>> storeGroupMap = userListFromPackage.stream().collect(Collectors.groupingBy(CrowdPackageUserVO::getStoreType));
......@@ -149,7 +149,7 @@ public class CustomerServiceCommonAsyncComponent {
// 获取链接
if (CustomerCommonConstant.REPLACE_LINK_NEWS_TYPE_LIST.contains(referralEntity.getNewsType())) {
LOCAL_LOG.info("异步获取图文客服链接");
getAuthListLink(storeGroupMap, customerGraphics, referralEntity);
getMessageAuthListLink(storeGroupMap, customerGraphics, referralEntity);
} else {
LOCAL_LOG.info("newsType: {}, 不需要获取链接", referralEntity.getNewsType());
}
......@@ -160,18 +160,8 @@ public class CustomerServiceCommonAsyncComponent {
}
private List<RegisterUserEntity> encapsulateUserEntity(List<CrowdPackageUserVO> userList) {
List<RegisterUserEntity> userEntityList = new ArrayList<>();
for (CrowdPackageUserVO crowdPackageUserVO : userList) {
RegisterUserEntity registerUserEntity = new RegisterUserEntity();
registerUserEntity.setId(crowdPackageUserVO.getId());
registerUserEntity.setInPackage(crowdPackageUserVO.getInPackage());
userEntityList.add(registerUserEntity);
}
return userEntityList;
}
private void getAuthListLink(Map<String, List<CrowdPackageUserVO>> storeGroupMap, CustomerGraphics customerMain, ReferralEntity customerReferral) {
private void getMessageAuthListLink(Map<String, List<CrowdPackageUserVO>> storeGroupMap, CustomerGraphics customerMain, ReferralEntity customerReferral) {
Long packId = customerMain.getPackId();
LOCAL_LOG.info("开始异步处理客服链接, 客服标题: {}, 人群包主键: {}", customerMain.getName(), packId);
......@@ -372,5 +362,16 @@ public class CustomerServiceCommonAsyncComponent {
}
private List<RegisterUserEntity> encapsulateUserEntity(List<CrowdPackageUserVO> userList) {
List<RegisterUserEntity> userEntityList = new ArrayList<>();
for (CrowdPackageUserVO crowdPackageUserVO : userList) {
RegisterUserEntity registerUserEntity = new RegisterUserEntity();
registerUserEntity.setId(crowdPackageUserVO.getId());
registerUserEntity.setInPackage(crowdPackageUserVO.getInPackage());
userEntityList.add(registerUserEntity);
}
return userEntityList;
}
}
......@@ -225,7 +225,7 @@ public class CustomerGraphicsServiceImpl extends ServiceImpl<CustomerGraphicsMap
byId.setSendStatus(1);
boolean result = super.updateById(byId);
if (result) {
commonAsyncComponent.obtainLink(id, byId, referralEntityList);
commonAsyncComponent.obtainMessageLink(id, byId, referralEntityList);
return new BaseResult().success();
}
return new BaseResult().error("更新失败");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论