提交 82c46a1f 作者: 典文龙

去除过滤校验

上级 377820b2
......@@ -48,13 +48,13 @@ public class DistributeServiceImpl extends ServiceImpl<AccountDistributeLogMappe
log.info("开始执行复用任务....");
AuthInfoVO sourceAuth = distributeDTO.getSourceAuth();
Integer targetAuthListSize = distributeDTO.getTargetAuthListSize();
/*if (ObjectUtil.isNotNull(sourceAuth.getAppId())) {
if (ObjectUtil.isNotNull(sourceAuth.getAppId())) {
List<AccountSetupVO> accountSetupVOList = kanbanCommonMapper.getRole(userId, distributeDTO.getAccountId());
int size = accountSetupVOList.size();
if (targetAuthListSize != size) {
return new BaseResult().error("暂无权限");
}
}*/
}
myExecutorDistributeService.myExecutorDistribute(distributeDTO, userId, distributeLogList, sourceAuth);
return new BaseResult().success("复用进行中, 请等待");
......
......@@ -13,6 +13,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
......@@ -47,15 +48,6 @@ public class MyExecutorDistributeServiceImpl implements MyExecutorDistributeServ
//获取到当天再投的进行复用
List<AuthInfoVO> targetAuthList = distributeDTO.getTargetAuthList();
//删除目标公众号配置
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());
List<String> typeList = distributeDTO.getTypeList();
......@@ -67,7 +59,6 @@ public class MyExecutorDistributeServiceImpl implements MyExecutorDistributeServ
//关回复用
try {
log.info("开始关回复用");
//removeBatch(distributeDTO.appIds(), type);
FollowReplyCopyDTO followReplyCopyDTO = new FollowReplyCopyDTO(sourceAuth, targetAuthList);
followReplyService.copy(followReplyCopyDTO);
log.info("关回复用结束");
......@@ -80,7 +71,6 @@ public class MyExecutorDistributeServiceImpl implements MyExecutorDistributeServ
//关键词复用
try {
log.info("开始关键词复用");
//removeBatch(distributeDTO.appIds(), type);
CustomerKeywordCopyDTO customerKeywordCopyDTO = new CustomerKeywordCopyDTO();
customerKeywordCopyDTO.replace(sourceAuth, targetAuthList, targetAppList);
keywordService.copy(customerKeywordCopyDTO);
......@@ -93,7 +83,7 @@ public class MyExecutorDistributeServiceImpl implements MyExecutorDistributeServ
//延时客服复用
try {
log.info("开始延时客服复用");
removeBatch(distributeDTO.appIds(), type);
removeBatch(distributeDTO.appIds(), type, new ArrayList<>());
customerGraphicsDelayService.copy(sourceAuth.getAppId(), "", "", null, targetApp);
log.info("延时客服复用结束");
} catch (Exception e) {
......@@ -104,7 +94,7 @@ public class MyExecutorDistributeServiceImpl implements MyExecutorDistributeServ
//菜单管理复用
try {
log.info("开始菜单管理复用");
removeBatch(distributeDTO.appIds(), type);
removeBatch(distributeDTO.appIds(), type, distributeDTO.getAuthIds());
MenuMainCopyDTO menuMainCopyDTO = new MenuMainCopyDTO();
menuMainCopyDTO.addList(sourceAuth.getId(), idList);
menuFeignClient.copy(menuMainCopyDTO);
......@@ -130,7 +120,7 @@ public class MyExecutorDistributeServiceImpl implements MyExecutorDistributeServ
distributeService.saveBatch(distributeLogList);
}
private void removeBatch(List<String> appIds, String type) {
private void removeBatch(List<String> appIds, String type, List<Long> authIds) {
if ("3".equals(type)) {
try {
LambdaQueryWrapper<CustomerGraphicsDelay> wrapper = new LambdaQueryWrapper<CustomerGraphicsDelay>().in(CustomerGraphicsDelay::getAppId, appIds).eq(CustomerGraphicsDelay::getIsDeleted, 0);
......@@ -153,6 +143,13 @@ public class MyExecutorDistributeServiceImpl implements MyExecutorDistributeServ
} catch (Exception e) {
log.error("Failed to delete menu reuse configuration: {}", e.getMessage(), e);
}
try {
if (!authIds.isEmpty()) {
materialMenuConfigService.removeById(authIds);
}
} catch (Exception e) {
log.error("Failed to delete the target public account configuration :{}", e.getMessage(), e);
}
}
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论