Explorar o código

修改快手图片消耗查询逻辑

syh %!s(int64=4) %!d(string=hai) anos
pai
achega
edbd20f363

+ 14 - 4
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -8,11 +8,11 @@ import cn.com.ctop.common.module.service.*;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouDailyReportTaskService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouAgentAccount;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouAgentAccountMapper;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
-import cn.com.ctop.toutiao.modules.report.service.IByteDanceVideoReportDailyService;
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceFundDailyService;
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
 import cn.com.ctop.toutiao.modules.report.service.IReportService;
@@ -32,6 +32,8 @@ import org.springframework.test.context.ActiveProfiles;
 import org.springframework.test.context.junit4.SpringRunner;
 
 import java.math.BigDecimal;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
@@ -272,7 +274,18 @@ public class SampleTest {
             }
         }
     }
+    @Autowired
+    private IKuaishouInterfaceService kuaishouInterfaceService;
 
+    @Test
+    public void loadKuaishouGroupData() throws ParseException {
+        Date endDate = new Date();
+        String anotherDay = DateUtils.getAnotherDay("yyyy-MM-dd", DateUtils.formatDate(endDate), -1);
+        SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd");
+        Date startDate = sim.parse(anotherDay);
+        CtopOauthToken token = tokenService.getTokenByAccountId(7087890L);
+        kuaishouInterfaceService.getGroupList(token, startDate, endDate);
+    }
 
 
 
@@ -308,9 +321,6 @@ public class SampleTest {
 
     @Autowired
     private IBytedanceReportService bytedanceReportService;
-
-    @Autowired
-    private IByteDanceVideoReportDailyService videoReportDailyService;
     @Test
     public void loadMatData(){
         List<UserAllocation> allocations = allocationService.getByParams(289L,null,0);

+ 1 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java

@@ -1211,6 +1211,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         headers.put("Content-Type", "application/json");
 
         String result = HttpUtils.kuaiShouhttpPostRequest(url, param.toJSONString(), headers);
+        System.out.println(result);
         JSONObject resultJson = JSONObject.parseObject(result);
         if (Check.isNull(resultJson)) {
             log.error("获取广告组接口异常,advertiserId:{}", token.getAccountId());

+ 4 - 4
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyImageMapper.xml

@@ -107,7 +107,7 @@
     <select id="imageCost" resultType="cn.com.ctop.common.module.vo.KuaishouImageCostVO">
         select
         report.cover_url as 'image_url' ,
-        report.code as 'signature',
+        report.cover_id as 'signature',
         group_concat(distinct p.project_name) AS 'project_name',
         sum(report.charge) AS 'charge',
         sum(report.photo_click) AS 'photo_click',
@@ -125,7 +125,7 @@
         where
             1=1
         and
-            report.code is not null
+            report.cover_id is not null
         <if test="startDate!=null">
             and report.stat_date &gt;= #{startDate}
         </if>
@@ -139,9 +139,9 @@
             </foreach>
         </if>
         <if test="code!=null">
-            and report.code = #{code}
+            and report.cover_id = #{code}
         </if>
-        group by report.code
+        group by report.cover_id
         order by sum(report.charge) desc
     </select>
     <select id="imageCostEntity" resultType="cn.com.ctop.common.module.vo.KuaishouImageCostVOEntity">

+ 0 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/ByteDanceVideoReportDailyServiceImpl.java

@@ -43,7 +43,6 @@ public class ByteDanceVideoReportDailyServiceImpl extends ServiceImpl<ByteDanceV
         videoInfoListByCompanyId(startDate, endDate, "d57fecdcf7a94d009736d9c850731582");
         //华东
         videoInfoListByCompanyId(startDate, endDate, "4b10089775c040119e139087517aed88");
-
     }
 
     private void videoInfoListByCompanyId(String startDate, String endDate, String companyId){