|
@@ -144,35 +144,40 @@ public class MonitorBytedanceServiceImpl implements IMonitorBytedanceService {
|
|
|
* @param
|
|
|
* @return: org.jeecg.common.api.vo.Result
|
|
|
* @author: zianY
|
|
|
- * @time: 2021/12/28
|
|
|
+ * @time: 2022/01/12
|
|
|
*/
|
|
|
public Result monitorBytedanceActionTrackUrl(String accountId){
|
|
|
//查询 配置的点击监测链接
|
|
|
List<MonitorBytedanceAdVo> accountList = monitorBytedanceActionTrackUrlMapper.getAccountActionTrackUrl(accountId,"1",null);
|
|
|
+ if(Check.isNull(accountList)){
|
|
|
+ log.info("=======暂无账户配置第三方点击监测链接信息=====");
|
|
|
+ return Result.successMsg("=======暂无账户配置第三方点击监测链接信息=====",null);
|
|
|
+ }
|
|
|
for (MonitorBytedanceAdVo accountInfo : accountList) {
|
|
|
//校验 拉取后台计划 监测链接
|
|
|
//根据账户 查询头条计划中的 点击监测链接
|
|
|
List<MonitorBytedanceAdVo> actionTrackUrlList = monitorBytedanceActionTrackUrlMapper.getBytedancPlanActionTrackUrl(Long.valueOf(accountInfo.getAccountId()));
|
|
|
- if (!Check.isNull(actionTrackUrlList)){
|
|
|
- List<String> planList = new ArrayList<>();
|
|
|
- for (MonitorBytedanceAdVo actiontrackUrl : actionTrackUrlList) {
|
|
|
- //配置中的 点击监测链接 != 创建计划中的 点击监测链接
|
|
|
- if (!StringUtils.equals(accountInfo.getActionTrackUrl(),actiontrackUrl.getActionTrackUrl())){
|
|
|
- //关停计划
|
|
|
- CtopOauthToken token = tokenService.getTokenByAccountId(Long.valueOf(accountInfo.getAccountId()));
|
|
|
- marketingServiceImpl.updPlanStatus(token, Arrays.asList(Long.valueOf(actiontrackUrl.getPlanId())),"disable");
|
|
|
- log.info("accountId:=={}==计划id:{}=====第三方点击监测链接不一致,计划已【关停】============",accountInfo.getAccountId(),actiontrackUrl.getPlanId());
|
|
|
- planList.add(actiontrackUrl.getPlanId());
|
|
|
- }
|
|
|
- }
|
|
|
- if (!Check.isNull(planList) && planList.size() > 0){
|
|
|
- //发送预警消息
|
|
|
- accountInfo.setPlanIdList(planList);
|
|
|
- sendEnterpriseWeiXinMessage(accountInfo);
|
|
|
- log.info("accountId:=={}==计划id:{}=====第三方点击监测链接不一致,已发送企业微信通知============",accountInfo.getAccountId(),accountInfo.getPlanIdList());
|
|
|
+ if(Check.isNull(actionTrackUrlList)){
|
|
|
+ log.info("accountId:=={}====暂无计划信息============",accountInfo.getAccountId());
|
|
|
+ return Result.successMsg("accountId:=={"+accountInfo.getAccountId()+"}====暂无计划信息============。",null);
|
|
|
+ }
|
|
|
+ List<String> planList = new ArrayList<>();
|
|
|
+ for (MonitorBytedanceAdVo actiontrackUrl : actionTrackUrlList) {
|
|
|
+ //配置中的 点击监测链接 != 创建计划中的 点击监测链接
|
|
|
+ if (!StringUtils.equals(accountInfo.getActionTrackUrl(),actiontrackUrl.getActionTrackUrl())){
|
|
|
+ //关停计划
|
|
|
+ CtopOauthToken token = tokenService.getTokenByAccountId(Long.valueOf(accountInfo.getAccountId()));
|
|
|
+ marketingServiceImpl.updPlanStatus(token, Arrays.asList(Long.valueOf(actiontrackUrl.getPlanId())),"disable");
|
|
|
+ log.info("accountId:=={}==计划id:{}=====第三方点击监测链接不一致,计划已【关停】============",accountInfo.getAccountId(),actiontrackUrl.getPlanId());
|
|
|
+ planList.add(actiontrackUrl.getPlanId());
|
|
|
}
|
|
|
}
|
|
|
- log.info("accountId:=={}====已创建的计划暂时没有第三方点击监测链接============",accountInfo.getAccountId());
|
|
|
+ if (!Check.isNull(planList) && planList.size() > 0){
|
|
|
+ //发送预警消息
|
|
|
+ accountInfo.setPlanIdList(planList);
|
|
|
+ sendEnterpriseWeiXinMessage(accountInfo);
|
|
|
+ log.info("accountId:=={}==计划id:{}=====第三方点击监测链接不一致,已发送企业微信通知============",accountInfo.getAccountId(),accountInfo.getPlanIdList());
|
|
|
+ }
|
|
|
}
|
|
|
return Result.successMsg("成功。",null);
|
|
|
}
|