소스 검색

出价预警

zhaoxian 3 년 전
부모
커밋
3bbdd75522

+ 15 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/entity/Project.java

@@ -1,5 +1,6 @@
 package cn.com.ctop.common.module.entity;
 
+import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
@@ -116,9 +117,15 @@ public class Project {
     private Date updateTime;
 
 
+    //优化目标出价类型
     private String bidType;
+
+    //转化目标
     private String ocpxActionType;
 
+    //深度转化目标
+    private String deepConversionType;
+
     @TableField(exist = false)
     private String responsibleId_dictText; // 运营负责人
 
@@ -135,4 +142,12 @@ public class Project {
     private Integer needExamine;
     @TableField(exist = false)
     private String supplierCode_dictText;
+
+    //转化目标
+    @TableField(exist = false)
+    private JSONArray ocpxActionTypeArray;
+
+    //深度转化目标
+    @TableField(exist = false)
+    private JSONArray deepConversionTypeArray;
 }

+ 9 - 8
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/xml/ProjectMapper.xml

@@ -16,14 +16,15 @@
     </select>
 
     <select id="getWarningInfoByProjectId" resultType="com.alibaba.fastjson.JSONObject">
-     select
-     id projectId,
-     project_name projectName,
-     max_bid maxBid,
-     bid_type bidType,
-     ocpx_action_type ocpxActionType
-     from ctop_project
-     where id = #{projectId}
+        select
+            id projectId,
+            project_name projectName,
+            max_bid maxBid,
+            bid_type bidType,
+            ocpx_action_type ocpxActionType,
+            deep_conversion_type deepConversionType
+        from ctop_project
+        where id = #{projectId}
     </select>
 
     <select id="querySupplierCodeById" resultType="java.lang.String">

+ 10 - 10
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouAccountAutoDoServiceImpl.java

@@ -2559,16 +2559,16 @@ public class AiKuaishouAccountAutoDoServiceImpl implements IAiKuaishouAccountAut
                 log.info("-----每日补充创建 (自定义高质量)账户:{},本次可建组数:{}", strategy.getAccountId(), unitNum);
                 unitNum = this.autoCreateCreative(strategy, 2, unitNum);
             }
-            if (unitNum > 0 && material.contains("3")) {
-                //3历史遗漏
-                log.info("-----每日补充创建 (自定义历史遗漏)账户:{},本次可建组数:{}", strategy.getAccountId(), unitNum);
-                unitNum = this.autoCreateCreative(strategy, 3, unitNum);
-            }
-            if (unitNum > 0 && material.contains("4")) {
-                //4历史打捞素材
-                log.info("-----每日补充创建 (自定义历史打捞)账户:{},本次可建组数:{}", strategy.getAccountId(), unitNum);
-                this.autoCreateCreative(strategy, 4, unitNum);
-            }
+//            if (unitNum > 0 && material.contains("3")) {
+//                //3历史遗漏
+//                log.info("-----每日补充创建 (自定义历史遗漏)账户:{},本次可建组数:{}", strategy.getAccountId(), unitNum);
+//                unitNum = this.autoCreateCreative(strategy, 3, unitNum);
+//            }
+//            if (unitNum > 0 && material.contains("4")) {
+//                //4历史打捞素材
+//                log.info("-----每日补充创建 (自定义历史打捞)账户:{},本次可建组数:{}", strategy.getAccountId(), unitNum);
+//                this.autoCreateCreative(strategy, 4, unitNum);
+//            }
         }
 
         if (strategy.getProgramPlanCnt() != null && strategy.getProgramUnitCnt() != null) {

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/document/mapper/xml/DocumentLibraryMapper.xml

@@ -9,7 +9,7 @@
     </insert>
 
     <insert id="insertBatch" parameterType="cn.com.ctop.kuaishou.modules.document.entity.DocumentLibraryInfo">
-        insert into ctop_document_library
+        replace into ctop_document_library
         (copy_writer_id,copy_writer,account_id,status,create_time)
         values
         <foreach collection="list" item="video" separator=",">

+ 20 - 27
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java

@@ -1,4 +1,4 @@
-/*
+
 package org.jeecg.modules.ctop.controller;
 
 import cn.com.ctop.common.module.entity.*;
@@ -37,6 +37,8 @@ import cn.com.ctop.toutiao.modules.report.service.*;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.ibatis.annotations.Param;
@@ -58,11 +60,9 @@ import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
-
-*/
 /**
  * @author jeecg-boot
- *//*
+ */
 
 @RestController
 @RequestMapping("/test")
@@ -993,22 +993,7 @@ public class TestController {
 
     }
 
-    @GetMapping("checkFile")
-    public Map<String, Object> checkFile() {
-        String nowDate = DateUtils.getDate("yyyy-MM-dd");
-        String statDate = getAnotherDay("yyyy-MM-dd", nowDate, -1);
-        //  查询快手token
-        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_KUAISHOU);
-        if (null == tokens || tokens.size() <= 0) {
-            log.info("定时获取快手数据异常:未获取到可用的token");
-        }
-        for (CtopOauthToken token : tokens) {
-            dailyReportTaskService.getTaskList(token.getAccountId(), token.getAccessToken(), statDate);
-        }
-        Map<String, Object> result = new HashMap<>();
-        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
-        return result;
-    }
+
 
 
     @GetMapping("loadBytedanceHistoryData")
@@ -1128,7 +1113,6 @@ public class TestController {
     }
 
 
-
     @GetMapping("/bytedance/effectVideo/get")
     public Map<String, Object> effectVideoGet(String date) {
         Map<String, Object> result = new HashMap<>();
@@ -1313,7 +1297,7 @@ public class TestController {
         return result;
     }
 
-    */
+
 /**
      * 勿动勿删,煜一人群报表数据拉取接口。
      *
@@ -1357,22 +1341,23 @@ public class TestController {
     static CountDownLatch countDownLatch = null;
     @Resource
     AiKuaishouUnitLevelOperationRecordMapper kuaishouUnitLevelOperationRecordMapper;
+
     @GetMapping(value = "/getAudienceDataNew")
-    public void getAudienceData(@RequestParam(required = false,defaultValue = "2019-01-01") String date) throws Exception {
+    public void getAudienceData(@RequestParam(required = false, defaultValue = "2019-01-01") String date) throws Exception {
         int page = 1;
         int pageSize = 2000;
-        if(date.equals("2019-01-01")){
+        if (date.equals("2019-01-01")) {
             date = DateUtils.formatDate(DateUtils.addDay(DateUtils.getNowDate(), -1), "yyyy-MM-dd");
         }
         List<CtopOauthToken> tokens = tokenService.getByProjectId(458L);    //淘特项目
         for (CtopOauthToken token : tokens) {
             Date startDate = DateUtils.addDay(DateUtils.getNowDate(), -1);
-            if(startDate.after(token.getAccessTokenExpiresIn())){   //过期跳过
+            if (startDate.after(token.getAccessTokenExpiresIn())) {   //过期跳过
                 continue;
             }
             Date enDate = DateUtils.addDay(startDate, -30);
             List<AiKuaishouUnitLevelOperationRecord> planIdsAndUnitIds = kuaishouUnitLevelOperationRecordMapper.selectAllByAccountIdAndDate(token.getAccountId(), enDate, startDate);
-            if(Check.isNull(planIdsAndUnitIds)){
+            if (Check.isNull(planIdsAndUnitIds)) {
                 continue;
             }
             countDownLatch = new CountDownLatch(planIdsAndUnitIds.size());
@@ -1493,5 +1478,13 @@ public class TestController {
             log.info("数据更新完成");
         }
     }
-}
 */
+    @GetMapping("checkUnitBid")
+    public Result checkUnitBid(Long accountId) throws Exception {
+        Date nowDate = new Date();
+        CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
+        kuaishouInterfaceService.getGroupList(token, nowDate, nowDate);
+        return Result.ok("success");
+    }
+}
+

+ 7 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/TransferAccountServiceImpl.java

@@ -6,6 +6,7 @@ import cn.com.ctop.common.module.service.ISupplierListService;
 import cn.com.ctop.common.module.service.ISysUserService;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyAccountMapper;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.jeecg.modules.ctop.entity.TransferAccount;
@@ -136,6 +137,12 @@ public class TransferAccountServiceImpl extends ServiceImpl<TransferAccountMappe
             if (!Check.isNullMap(supplierMap)) {
                 project.setSupplierCode_dictText(supplierMap.get(project.getSupplierCode()));
             }
+            if (!Check.isNull(project.getOcpxActionType())&&!project.getOcpxActionType().isEmpty()) {
+                project.setOcpxActionTypeArray(JSONArray.parseArray(project.getOcpxActionType()));
+            }
+            if (!Check.isNull(project.getDeepConversionType())&&!project.getDeepConversionType().isEmpty()) {
+                project.setDeepConversionTypeArray(JSONArray.parseArray(project.getDeepConversionType()));
+            }
         }
         return records;
     }