提交 5f656c63 作者: 典文龙

修改部分参数

上级 896937a2
......@@ -17,4 +17,9 @@ public class FollowReplyCopyDTO implements Serializable {
private List<AuthInfoVO> targetAuthList;
public FollowReplyCopyDTO(AuthInfoVO sourceAuth, List<AuthInfoVO> targetAuthList) {
this.sourceAuth = sourceAuth;
this.targetAuthList = targetAuthList;
}
}
......@@ -19,4 +19,10 @@ public class CustomerKeywordCopyDTO implements Serializable {
private List<String> targetKeywordList;
public void replace(AuthInfoVO sourceAuth, List<AuthInfoVO> targetAuthList, List<String> targetKeywordList) {
this.sourceAuth = sourceAuth;
this.targetAuthList = targetAuthList;
this.targetKeywordList = targetKeywordList;
}
}
......@@ -89,12 +89,24 @@ public class DistributeServiceImpl extends ServiceImpl<AccountDistributeLogMappe
List<String> targetAppList = distributeDTO.getTargetAppList();
//获取到当天再投的进行复用
List<AuthInfoVO> targetAuthList = distributeDTO.filterInfo(channelIds);
try {
if (!targetAppList.isEmpty()) {
for (AuthInfoVO authInfoVO : targetAuthList) {
menuFeignClient.removeMenu(authInfoVO.getId(), authInfoVO.getAppId());
}
}
} catch (Exception e) {
log.error("Failed to delete menu configuration: {}", e.getMessage(), e);
}
//删除目标公众号配置
try {
List<Long> authIds = distributeDTO.getAuthIds();
materialMenuConfigService.removeById(authIds);
} catch (Exception e) {
log.error("Failed to delete the target public account configuration :{}", e.getMessage(), e);
}
List<String> targetApp = targetAuthList.stream().map(AuthInfoVO::getAppId).collect(Collectors.toList());
List<Long> idList = targetAuthList.stream().map(AuthInfoVO::getId).collect(Collectors.toList());
......@@ -105,28 +117,41 @@ public class DistributeServiceImpl extends ServiceImpl<AccountDistributeLogMappe
switch (type) {
case "1":
//关回复用
FollowReplyCopyDTO followReplyCopyDTO = new FollowReplyCopyDTO();
followReplyCopyDTO.setTargetAuthList(targetAuthList);
followReplyCopyDTO.setSourceAuth(sourceAuth);
try {
FollowReplyCopyDTO followReplyCopyDTO = new FollowReplyCopyDTO(sourceAuth, targetAuthList);
followReplyService.copy(followReplyCopyDTO);
} catch (Exception e) {
log.error("Off reply failed: {}", e.getMessage(), e);
}
break;
case "2":
//关键词复用
try {
CustomerKeywordCopyDTO customerKeywordCopyDTO = new CustomerKeywordCopyDTO();
customerKeywordCopyDTO.setSourceAuth(sourceAuth);
customerKeywordCopyDTO.setTargetKeywordList(targetAppList);
customerKeywordCopyDTO.setTargetAuthList(targetAuthList);
customerKeywordCopyDTO.replace(sourceAuth, targetAuthList, targetAppList);
keywordService.copy(customerKeywordCopyDTO);
} catch (Exception e) {
log.error("Keyword reuse failure: {}", e.getMessage(), e);
}
break;
case "3":
//延时客服复用
try {
customerGraphicsDelayService.copy(sourceAuth.getAppId(), "", "", null, targetApp);
} catch (Exception e) {
log.error("Delayed customer service reuse failure: {}", e.getMessage(), e);
}
break;
case "4":
//菜单管理复用
try {
MenuMainCopyDTO menuMainCopyDTO = new MenuMainCopyDTO();
menuMainCopyDTO.addList(sourceAuth.getId(), idList);
menuFeignClient.copy(menuMainCopyDTO);
} catch (Exception e) {
log.error("Menu management reuse failure: {}", e.getMessage(), e);
}
break;
default:
break;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论