Bläddra i källkod

adq-增加账户自动关停任务

yumeng 11 månader sedan
förälder
incheckning
3d50c4f712

+ 5 - 2
job-adq/src/main/java/cn/com/ctop/job/adq/controller/AdqController.java

@@ -65,6 +65,10 @@ public class AdqController {
     @GetMapping("/testCreativeDaily")
     public void testCreativeDaily() {
 
+        adqReportService.getAdqCreativeHour(63071144L, "084dedee4e57493b0f39900cf14d0d6f", "2025-06-26", "2025-06-26", 1, 1);
+
+
+/*
         List<JSONObject> accountList = adqReportService.getAccountList(null);
         if (!Check.isNull(accountList)) {
             for (int i = 0; i < accountList.size(); i++) {
@@ -76,13 +80,12 @@ public class AdqController {
                     @Override
                     public void run() {
                         accountReportService.getAdqAccountDaily(advertiserId, accessToken, "2025-05-01", "2025-05-11", 1, 1);
-                        adqReportService.getAdqCreativeDaily(advertiserId, accessToken, "2025-05-01", "2025-05-11", 1, 1);
                     }
                 });
 
 
             }
-        }
+        }*/
     }
 
 

+ 2 - 0
job-adq/src/main/java/cn/com/ctop/job/adq/data/mapper/AdqAccountReportMapper.java

@@ -15,4 +15,6 @@ public interface AdqAccountReportMapper {
     void addAccountDailyList(@Param("adds") List<AdqAdvertiserReportDaily> dailyList);
     @DS("selectdb")
     void addAccountDailyListSD(@Param("adds") List<AdqAdvertiserReportDaily> dailyList);
+
+    void updateAdqAccountStatus();
 }

+ 20 - 0
job-adq/src/main/java/cn/com/ctop/job/adq/data/mapper/xml/AdqAccountReportMapper.xml

@@ -222,4 +222,24 @@
             )
         </foreach>
     </insert>
+    <update id="updateAdqAccountStatus">
+        update deepthink.advertiser_bind_info
+        set advertiser_status = 2
+        where advertiser_id in (select t.advertiser_id
+                                from (select t1.advertiser_id as advertiser_id,
+                                             ifnull(
+                                                     (select sum(cost)
+                                                      from media_api.adq_advertiser_report_daily
+                                                      where advertiser_id = t1.advertiser_id
+                                                        and stat_time_day >=
+                                                            date_format(DATE_SUB(CURDATE(), INTERVAL 7 DAY), '%Y%m%d')),
+                                                     0)       as cost
+                                      from deepthink.advertiser_bind_info t1
+                                      where t1.media_type = 3
+                                        and t1.advertiser_status = 1
+                                        and date_format(t1.create_time, '%Y%m%d') &lt;
+                                            date_format(DATE_SUB(CURDATE(), INTERVAL 1 DAY), '%Y%m%d')) t
+                                where t.cost &lt;= 0)
+          and media_type = 3
+    </update>
 </mapper>

+ 2 - 0
job-adq/src/main/java/cn/com/ctop/job/adq/data/service/IAdqRetryReportService.java

@@ -8,4 +8,6 @@ public interface IAdqRetryReportService {
     void getAccountHourRetry(Long id, Long advertiserId, String accessToken, String startDate, String endDate, Integer page,Integer isSend);
 
     void getAccountDailyRetry(Long id, Long advertiserId, String accessToken, String startDate, String endDate, Integer page,Integer isSend);
+
+    void updateAdqAccountStatus();
 }

+ 5 - 0
job-adq/src/main/java/cn/com/ctop/job/adq/data/service/impl/AdqRetryReportServiceImpl.java

@@ -314,4 +314,9 @@ public class AdqRetryReportServiceImpl implements IAdqRetryReportService {
         }
     }
 
+    @Override
+    public void updateAdqAccountStatus() {
+        accountReportMapper.updateAdqAccountStatus();
+    }
+
 }

+ 7 - 1
job-adq/src/main/java/cn/com/ctop/job/adq/handler/AdqRetryReportJob.java

@@ -42,7 +42,6 @@ public class AdqRetryReportJob {
     private IAdqAssetReportService assetReportService;
     @Autowired
     private IAdqAdIncomeService adqAdIncomeService;
-
     @Autowired
     private IAdqFlowDetailsReportService adqFlowDetailsReportService;
 
@@ -176,4 +175,11 @@ public class AdqRetryReportJob {
 
     }
 
+
+    @XxlJob("updateAdqAccountStatus")
+    public void updateAdqAccountStatus()  {
+        retryReportService.updateAdqAccountStatus();
+    }
+
+
 }

+ 4 - 0
job-adq/src/main/resources/logback-prod.xml

@@ -11,7 +11,11 @@
 <!--
     <property name="FILE_PATH" value="/Users/yumeng/logs/spring-log.%d{yyyy-MM-dd}.%i.log"/>
 -->
+    <property name="FILE_PATH" value="/Users/yumeng/logs/spring-log.%d{yyyy-MM-dd}.%i.log"/>
+
+<!--
     <property name="FILE_PATH" value="/data/webapp/hr_job-adq/log/spring-log.%d{yyyy-MM-dd}.%i.log"/>
+-->
 
     <!-- 控制台输出日志 -->
     <appender name="console" class="ch.qos.logback.core.ConsoleAppender">