syh há 5 anos atrás
pai
commit
e7b4af189e

+ 0 - 4
module-report/src/main/java/cn/com/ctop/bytedance/aa.java

@@ -1,4 +0,0 @@
-package cn.com.ctop.bytedance;
-
-public class aa {
-}

+ 2 - 1
module-report/src/main/java/cn/com/ctop/bytedance/mapper/BytedanceReportMapper.java

@@ -1,6 +1,7 @@
 package cn.com.ctop.bytedance.mapper;
 
 
+import cn.com.ctop.bytedance.vo.ReportVO;
 import com.alibaba.fastjson.JSONObject;
 import org.apache.ibatis.annotations.Param;
 
@@ -14,7 +15,7 @@ public interface BytedanceReportMapper {
      * @param date
      * @return
      */
-    JSONObject selectDayReport(@Param("date") String date);
+    ReportVO selectDayReport(@Param("date") String date);
 
     /**
      * 查询明细

+ 1 - 1
module-report/src/main/java/cn/com/ctop/bytedance/mapper/xml/BytedanceReportMapper.xml

@@ -3,7 +3,7 @@
 <mapper namespace="cn.com.ctop.bytedance.mapper.BytedanceReportMapper">
 
 
-    <select id="selectDayReport" resultType="com.alibaba.fastjson.JSONObject">
+    <select id="selectDayReport" resultType="cn.com.ctop.bytedance.vo.ReportVO">
       select
        sum(charge) cost,
        sum(photo_show) photoShow,

+ 5 - 1
module-report/src/main/java/cn/com/ctop/bytedance/service/impl/BytedanceReportServiceImpl.java

@@ -4,6 +4,7 @@ import cn.com.ctop.bytedance.entity.BytedanceAdvertiserDailyReport;
 import cn.com.ctop.bytedance.mapper.BytedanceAdvertiserDailyReportMapper;
 import cn.com.ctop.bytedance.mapper.BytedanceReportMapper;
 import cn.com.ctop.bytedance.service.IBytedanceReportService;
+import cn.com.ctop.bytedance.vo.ReportVO;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.mapper.UserAllocationMapper;
 import cn.com.ctop.common.module.utils.Check;
@@ -203,7 +204,10 @@ public class BytedanceReportServiceImpl implements IBytedanceReportService {
             String nowDate = DateUtils.getNowDate("yyyy-MM-dd"); // 当前日期
             String anotherDay = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1); // 当前日期-1
             if (type == 1) { // 今日总消耗
-                accountJson = reportMapper.selectDayReport(nowDate);
+                ReportVO reportVO = reportMapper.selectDayReport(nowDate);
+                System.err.println("12312312313131313131313131313131");
+                System.err.println(reportVO.toString());
+                System.err.println("----------------------------------------------");
                 JSONObject yesterJson = reportMapper.selectYesterday(anotherDay);
                 if (!Check.isNull(yesterJson)) {
                     BigDecimal cost = accountJson.getBigDecimal("cost"); // 今日消耗

+ 26 - 0
module-report/src/main/java/cn/com/ctop/bytedance/vo/ReportVO.java

@@ -0,0 +1,26 @@
+package cn.com.ctop.bytedance.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+@Data
+public class ReportVO implements Serializable {
+    private BigDecimal cost;
+    private Long photoShow;
+    private Long photoClick;
+    private Long aclick;
+    private String statDate;
+
+    @Override
+    public String toString() {
+        return "ReportVO{" +
+                "cost=" + cost +
+                ", photoShow=" + photoShow +
+                ", photoClick=" + photoClick +
+                ", aclick=" + aclick +
+                ", statDate='" + statDate + '\'' +
+                '}';
+    }
+}