|
@@ -7,16 +7,20 @@ import cn.com.ctop.common.module.utils.StatusCode;
|
|
import cn.com.ctop.kuaishou.modules.ai.entity.KuaishouAccountSpeedExploreLog;
|
|
import cn.com.ctop.kuaishou.modules.ai.entity.KuaishouAccountSpeedExploreLog;
|
|
import cn.com.ctop.kuaishou.modules.ai.mapper.KuaishouAccountSpeedExploreLogMapper;
|
|
import cn.com.ctop.kuaishou.modules.ai.mapper.KuaishouAccountSpeedExploreLogMapper;
|
|
import cn.com.ctop.kuaishou.modules.ai.service.IKuaishouAccountSpeedExploreLogService;
|
|
import cn.com.ctop.kuaishou.modules.ai.service.IKuaishouAccountSpeedExploreLogService;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.ai.vo.SpeedExploreGroupVO;
|
|
import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
|
|
import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.report.service.IKuaishouGroupExploreService;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import org.jeecg.common.util.DateUtils;
|
|
import org.jeecg.common.util.DateUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
|
|
+import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -31,6 +35,10 @@ public class KuaishouAccountSpeedExploreLogServiceImpl extends ServiceImpl<Kuais
|
|
private ICtopOauthTokenService tokenService;
|
|
private ICtopOauthTokenService tokenService;
|
|
@Autowired
|
|
@Autowired
|
|
private IKuaishouInterfaceService kuaishouInterfaceService;
|
|
private IKuaishouInterfaceService kuaishouInterfaceService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IKuaishouGroupExploreService kuaishouGroupExploreService;
|
|
|
|
+ @Resource
|
|
|
|
+ private KuaishouAccountSpeedExploreLogMapper kuaishouAccountSpeedExploreLogMapper;
|
|
@Override
|
|
@Override
|
|
public Map<String, Object> openSpeedExplore(KuaishouAccountSpeedExploreLog kuaishouAccountSpeedExploreLog) throws Exception{
|
|
public Map<String, Object> openSpeedExplore(KuaishouAccountSpeedExploreLog kuaishouAccountSpeedExploreLog) throws Exception{
|
|
Map<String,Object> result = new HashMap<>();
|
|
Map<String,Object> result = new HashMap<>();
|
|
@@ -61,9 +69,22 @@ public class KuaishouAccountSpeedExploreLogServiceImpl extends ServiceImpl<Kuais
|
|
//3:根据转化目标查询相应的符合条件的广告组数据
|
|
//3:根据转化目标查询相应的符合条件的广告组数据
|
|
//优化目标 2 行为数 180 激活数 53 表单数 190 付费 191 首日ROI
|
|
//优化目标 2 行为数 180 激活数 53 表单数 190 付费 191 首日ROI
|
|
Integer convertType = kuaishouAccountSpeedExploreLog.getConvertType();
|
|
Integer convertType = kuaishouAccountSpeedExploreLog.getConvertType();
|
|
|
|
+ //查询相关符合条件的广告组数据
|
|
|
|
+ List<SpeedExploreGroupVO> speedExploreGroupVos = this.getSpeedExploreGroupVOSByParams(DateUtils.formatDate(endDate),kuaishouAccountSpeedExploreLog.getAccountId(),kuaishouAccountSpeedExploreLog.getConvertType(),kuaishouAccountSpeedExploreLog.getConvertCount(),kuaishouAccountSpeedExploreLog.getGroupCount());
|
|
|
|
+ if(null==speedExploreGroupVos||speedExploreGroupVos.isEmpty()){
|
|
|
|
+ speedExploreGroupVos.forEach(speedExploreGroupVO -> {
|
|
|
|
+ //触发加速探索逻辑
|
|
|
|
+ kuaishouGroupExploreService.unitOpenSpeedExplore(speedExploreGroupVO.getAccountId(),speedExploreGroupVO.getUnitId(),kuaishouAccountSpeedExploreLog.getGroupAccount(),kuaishouAccountSpeedExploreLog.getId());
|
|
|
|
+ //缺广告组加速探索记录数据表
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ private List<SpeedExploreGroupVO> getSpeedExploreGroupVOSByParams(String date, Long accountId, Integer convertType, Integer convertCount,Integer groupCount) {
|
|
|
|
+ return kuaishouAccountSpeedExploreLogMapper.getSpeedExploreGroupVosByParams(date,accountId,convertType,convertCount,groupCount);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|