浏览代码

切换表

yumeng 5 年之前
父节点
当前提交
1b7ce261b5

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

@@ -22,7 +22,7 @@ import java.util.Map;
 public interface IKuaishouInterfaceService {
     KuaishouResult<KuaishouReportHourlyAccount> getAccountHourlyReport(String accessToken, Long advertiserId, String startDate, String endDate, int pageSize, int pageNum);
 
-    KuaishouResult<KuaishouReportDailyAccountNew> getAccountDailyReport(String accessToken, Long advertiserId, String startDate, String endDate, int pageSize, int pageNum);
+    KuaishouResult<KuaishouReportDailyAccount> getAccountDailyReport(String accessToken, Long advertiserId, String startDate, String endDate, int pageSize, int pageNum);
 
     KuaishouResult<KuaishouReportDailyCampaign> getCampaignDailyReport(String accessToken, Long advertiserId, String startDate, String endDate, int pageSize, int pageNum);
 

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

@@ -377,17 +377,6 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
 
         for (int i = 0; i < details.size(); i++) {
             JSONObject detailJson = details.getJSONObject(i);
-
-            var show = detailJson.getLong("show");
-            detailJson.put("photo_show", show);
-            var like = detailJson.getLong("like");
-            detailJson.put("photo_like", like);
-            var KuaishouReportDailyAccountOld = JSONObject.toJavaObject(detailJson, KuaishouReportDailyAccount.class);
-            KuaishouReportDailyAccountOld.setAccountId(token.getAccountId());
-            KuaishouReportDailyAccountOld.setId("" + token.getAccountId() + KuaishouReportDailyAccountOld.getStatDate());
-            dailyAccountService.saveOrUpdate(KuaishouReportDailyAccountOld);
-
-
             if (!Check.isNull(detailJson)) {
                 detailJson.put("photo_share", detailJson.getString("share"));
                 detailJson.put("photo_comment", detailJson.getString("comment"));
@@ -399,19 +388,16 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                 detailJson.remove("show");
                 detailJson.remove("adScene");
                 detailJson.remove("stat_hour");
-                KuaishouReportDailyAccountNew kuaishouReportDailyAccount = JsonUtil.jsonToObj(detailJson, KuaishouReportDailyAccountNew.class);
+                KuaishouReportDailyAccount kuaishouReportDailyAccount = JsonUtil.jsonToObj(detailJson, KuaishouReportDailyAccount.class);
                 kuaishouReportDailyAccount.setAccountId(token.getAccountId());
                 dailyAccountMapper.insertSelective(kuaishouReportDailyAccount);
-
             }
-
-
         }
         getAccountDailyReportByPage(token, startDate, endDate, page + 1);
     }
 
     @Override
-    public KuaishouResult<KuaishouReportDailyAccountNew> getAccountDailyReport(String accessToken, Long advertiserId, String startDate, String endDate, int pageSize, int pageNum) {
+    public KuaishouResult<KuaishouReportDailyAccount> getAccountDailyReport(String accessToken, Long advertiserId, String startDate, String endDate, int pageSize, int pageNum) {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.ACCOUNT_REPORT;
         Map<String, String> headers = new HashMap<String, String>();
         headers.put("Content-Type", "application/json");
@@ -444,7 +430,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                             detailJson.put("photo_show", show);
                             Long like = detailJson.getLong("like");
                             detailJson.put("photo_like", like);
-                            KuaishouReportDailyAccountNew kuaishouReportDailyAccount = JSONObject.toJavaObject(detailJson, KuaishouReportDailyAccountNew.class);
+                            KuaishouReportDailyAccount kuaishouReportDailyAccount = JSONObject.toJavaObject(detailJson, KuaishouReportDailyAccount.class);
                             kuaishouReportDailyAccount.setAccountId(advertiserId);
                             kuaishouReportDailyAccount.setId("" + advertiserId + kuaishouReportDailyAccount.getStatDate());
                             //dailyAccountService.saveOrUpdate(kuaishouReportDailyAccount);

+ 121 - 65
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouReportDailyAccount.java

@@ -1,6 +1,5 @@
 package cn.com.ctop.kuaishou.modules.report.entity;
 
-import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonProperty;
@@ -19,107 +18,164 @@ public class KuaishouReportDailyAccount implements Serializable {
 
     private Long accountId;
 
-    @JsonProperty("stat_date")
-    private String statDate;
-
-    @JsonProperty
+    @JsonProperty("charge")
     private BigDecimal charge;
 
-    @JsonProperty
+    @JsonProperty("photo_show")
     private Long photoShow;
 
-    @JsonProperty("photo_click")
-    private Long photoClick;
-
-    @JsonProperty
+    @JsonProperty("aclick")
     private Long aclick;
-    @JsonProperty
+
+    @JsonProperty("bclick")
     private Long bclick;
-    @JsonProperty
-    private Long share;
-    @JsonProperty
-    private Long comment;
-    @JsonProperty
+
+    @JsonProperty("photo_share")
+    private Long photoShare;
+
+    @JsonProperty("photo_comment")
+    private Long photoComment;
+
+    @JsonProperty("photo_like")
     private Long photoLike;
-    @JsonProperty
+
+    @JsonProperty("follow")
     private Long follow;
+
     @JsonProperty("cancel_follow")
     private Long cancelFollow;
-    @JsonProperty
+
+    @JsonProperty("report")
     private Long report;
-    @JsonProperty
+
+    @JsonProperty("block")
     private Long block;
-    @JsonProperty
+
+    @JsonProperty("negative")
     private Long negative;
-    @JsonProperty
-    private Long submit;
+
     @JsonProperty("download_started")
     private Long downloadStarted;
+
     @JsonProperty("download_completed")
     private Long downloadCompleted;
-    @JsonProperty
+
+    @JsonProperty("activation")
     private Long activation;
 
-    @JsonProperty
-    private BigDecimal photoClickRatio;
-    @JsonProperty
-    private BigDecimal actionRatio;
+    @JsonProperty("submit")
+    private Long submit;
+
+    @JsonProperty("stat_date")
+    private String statDate;
+
+    @JsonProperty("photo_click")
+    private Long photoClick;
+
+    @JsonProperty("photo_click_ratio")
+    private Double photoClickRatio;
+
+    @JsonProperty("action_ratio")
+    private Double actionRatio;
+
     @JsonProperty("impression_1k_cost")
-    @TableField("impression_1k_cost")
     private BigDecimal impression1kCost;
-    @JsonProperty
+
+    @JsonProperty("photo_click_cost")
     private BigDecimal photoClickCost;
-    @JsonProperty
+
+    @JsonProperty("action_cost")
     private BigDecimal actionCost;
-    @JsonProperty
+
+    @JsonProperty("event_pay_first_day")
     private Long eventPayFirstDay;
-    @JsonProperty
-    private BigDecimal eventPayFirstDayRoi;
-    @JsonProperty
-    private BigDecimal eventPay;
-    @JsonProperty
+
+    @JsonProperty("event_pay_purchase_amount_first_day")
+    private BigDecimal eventPayPurchaseAmountFirstDay;
+
+    @JsonProperty("event_pay_first_day_roi")
+    private Double eventPayFirstDayRoi;
+
+    @JsonProperty("event_pay")
+    private Long eventPay;
+
+    @JsonProperty("event_pay_purchase_amount")
     private BigDecimal eventPayPurchaseAmount;
-    @JsonProperty
-    private BigDecimal eventPayRoi;
-    @JsonProperty
+
+    @JsonProperty("event_pay_roi")
+    private Double eventPayRoi;
+
+    @JsonProperty("event_register")
     private Long eventRegister;
-    @JsonProperty
+
+    @JsonProperty("event_register_cost")
     private BigDecimal eventRegisterCost;
-    @JsonProperty
+
+    @JsonProperty("event_register_ratio")
+    private Double eventRegisterRatio;
+
+    @JsonProperty("event_jin_jian_app")
     private Long eventJinJianApp;
-    @JsonProperty
+
+    @JsonProperty("event_jin_jian_app_cost")
     private BigDecimal eventJinJianAppCost;
-    @JsonProperty
-    private BigDecimal eventPayPurchaseAmountFirstDay;
-    @JsonProperty
+
+    @JsonProperty("event_credit_grant_app")
     private Long eventCreditGrantApp;
-    @JsonProperty
+
+    @JsonProperty("event_credit_grant_app_cost")
     private BigDecimal eventCreditGrantAppCost;
-    @JsonProperty
-    private BigDecimal eventCreditGrantAppRatio;
-    @JsonProperty
-    private BigDecimal eventOrderPaid;
-    @JsonProperty
+
+    @JsonProperty("event_credit_grant_app_ratio")
+    private Double eventCreditGrantAppRatio;
+
+    @JsonProperty("event_order_paid")
+    private Long eventOrderPaid;
+
+    @JsonProperty("event_order_paid_purchase_amount")
     private BigDecimal eventOrderPaidPurchaseAmount;
-    @JsonProperty
-    private BigDecimal eventOrderPaidCost;
-    @JsonProperty
-    private Long formCount;
-    @JsonProperty
-    private BigDecimal formCost;
-    @JsonProperty
-    private BigDecimal formActionRatio;
-    @JsonProperty
+
+    @JsonProperty("event_jin_jian_landing_page")
     private Long eventJinJianLandingPage;
-    @JsonProperty
+
+    @JsonProperty("event_jin_jian_landing_page_cost")
     private BigDecimal eventJinJianLandingPageCost;
-    @JsonProperty
+
+    @JsonProperty("event_credit_grant_landing_page")
     private Long eventCreditGrantLandingPage;
-    @JsonProperty
+
+    @JsonProperty("event_credit_grant_landing_page_cost")
     private BigDecimal eventCreditGrantLandingPageCost;
-    @JsonProperty
+
+    @JsonProperty("event_credit_grant_landing_ratio")
+    private Double eventCreditGrantLandingRatio;
+
+    @JsonProperty("event_next_day_stay_cost")
+    private BigDecimal eventNextDayStayCost;
+
+    @JsonProperty("event_next_day_stay_ratio")
+    private Long eventNextDayStayRatio;
+
+    @JsonProperty("form_action_ratio")
+    private Double formActionRatio;
+
+    @JsonProperty("event_order_paid_cost")
+    private BigDecimal eventOrderPaidCost;
+
+    @JsonProperty("event_next_day_stay")
+    private Long eventNextDayStay;
+
+    @JsonProperty("form_cost")
+    private BigDecimal formCost;
+
+    @JsonProperty("form_count")
+    private Long formCount;
+
+    @JsonProperty("play_3s_ratio")
+    private Double play3sRatio;
+
     private Date createTime;
-    @JsonProperty
+
     private Date updateTime;
 }
 

+ 0 - 183
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouReportDailyAccountNew.java

@@ -1,183 +0,0 @@
-package cn.com.ctop.kuaishou.modules.report.entity;
-
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import lombok.Data;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.util.Date;
-
-
-@Data
-@TableName("ctop_kuaishou_report_daily_account")
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class KuaishouReportDailyAccountNew implements Serializable {
-    private static final long serialVersionUID = 1L;
-    @TableId
-    private String id;
-
-    private Long accountId;
-
-    @JsonProperty("charge")
-    private BigDecimal charge;
-
-    @JsonProperty("photo_show")
-    private Long photoShow;
-
-    @JsonProperty("aclick")
-    private Long aclick;
-
-    @JsonProperty("bclick")
-    private Long bclick;
-
-    @JsonProperty("photo_share")
-    private Long photoShare;
-
-    @JsonProperty("photo_comment")
-    private Long photoComment;
-
-    @JsonProperty("photo_like")
-    private Long photoLike;
-
-    @JsonProperty("follow")
-    private Long follow;
-
-    @JsonProperty("cancel_follow")
-    private Long cancelFollow;
-
-    @JsonProperty("report")
-    private Long report;
-
-    @JsonProperty("block")
-    private Long block;
-
-    @JsonProperty("negative")
-    private Long negative;
-
-    @JsonProperty("download_started")
-    private Long downloadStarted;
-
-    @JsonProperty("download_completed")
-    private Long downloadCompleted;
-
-    @JsonProperty("activation")
-    private Long activation;
-
-    @JsonProperty("submit")
-    private Long submit;
-
-    @JsonProperty("stat_date")
-    private String statDate;
-
-    @JsonProperty("photo_click")
-    private Long photoClick;
-
-    @JsonProperty("photo_click_ratio")
-    private Double photoClickRatio;
-
-    @JsonProperty("action_ratio")
-    private Double actionRatio;
-
-    @JsonProperty("impression_1k_cost")
-    private BigDecimal impression1kCost;
-
-    @JsonProperty("photo_click_cost")
-    private BigDecimal photoClickCost;
-
-    @JsonProperty("action_cost")
-    private BigDecimal actionCost;
-
-    @JsonProperty("event_pay_first_day")
-    private Long eventPayFirstDay;
-
-    @JsonProperty("event_pay_purchase_amount_first_day")
-    private BigDecimal eventPayPurchaseAmountFirstDay;
-
-    @JsonProperty("event_pay_first_day_roi")
-    private Double eventPayFirstDayRoi;
-
-    @JsonProperty("event_pay")
-    private Long eventPay;
-
-    @JsonProperty("event_pay_purchase_amount")
-    private BigDecimal eventPayPurchaseAmount;
-
-    @JsonProperty("event_pay_roi")
-    private Double eventPayRoi;
-
-    @JsonProperty("event_register")
-    private Long eventRegister;
-
-    @JsonProperty("event_register_cost")
-    private BigDecimal eventRegisterCost;
-
-    @JsonProperty("event_register_ratio")
-    private Double eventRegisterRatio;
-
-    @JsonProperty("event_jin_jian_app")
-    private Long eventJinJianApp;
-
-    @JsonProperty("event_jin_jian_app_cost")
-    private BigDecimal eventJinJianAppCost;
-
-    @JsonProperty("event_credit_grant_app")
-    private Long eventCreditGrantApp;
-
-    @JsonProperty("event_credit_grant_app_cost")
-    private BigDecimal eventCreditGrantAppCost;
-
-    @JsonProperty("event_credit_grant_app_ratio")
-    private Double eventCreditGrantAppRatio;
-
-    @JsonProperty("event_order_paid")
-    private Long eventOrderPaid;
-
-    @JsonProperty("event_order_paid_purchase_amount")
-    private BigDecimal eventOrderPaidPurchaseAmount;
-
-    @JsonProperty("event_jin_jian_landing_page")
-    private Long eventJinJianLandingPage;
-
-    @JsonProperty("event_jin_jian_landing_page_cost")
-    private BigDecimal eventJinJianLandingPageCost;
-
-    @JsonProperty("event_credit_grant_landing_page")
-    private Long eventCreditGrantLandingPage;
-
-    @JsonProperty("event_credit_grant_landing_page_cost")
-    private BigDecimal eventCreditGrantLandingPageCost;
-
-    @JsonProperty("event_credit_grant_landing_ratio")
-    private Double eventCreditGrantLandingRatio;
-
-    @JsonProperty("event_next_day_stay_cost")
-    private BigDecimal eventNextDayStayCost;
-
-    @JsonProperty("event_next_day_stay_ratio")
-    private Long eventNextDayStayRatio;
-
-    @JsonProperty("form_action_ratio")
-    private Double formActionRatio;
-
-    @JsonProperty("event_order_paid_cost")
-    private BigDecimal eventOrderPaidCost;
-
-    @JsonProperty("event_next_day_stay")
-    private Long eventNextDayStay;
-
-    @JsonProperty("form_cost")
-    private BigDecimal formCost;
-
-    @JsonProperty("form_count")
-    private Long formCount;
-
-    @JsonProperty("play_3s_ratio")
-    private Double play3sRatio;
-
-    private Date createTime;
-
-    private Date updateTime;
-}

+ 1 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyAccountMapper.java

@@ -1,6 +1,5 @@
 package cn.com.ctop.kuaishou.modules.report.mapper;
 
-import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccountNew;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccount;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
@@ -8,5 +7,5 @@ import org.apache.ibatis.annotations.Param;
 public interface KuaishouReportDailyAccountMapper extends BaseMapper<KuaishouReportDailyAccount> {
     void loadAccountDailyReport(@Param("accountId") Long accountId, @Param("localPath") String localPath);
 
-    void insertSelective(KuaishouReportDailyAccountNew dailyAccount);
+    void insertSelective(KuaishouReportDailyAccount dailyAccount);
 }

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

@@ -2,7 +2,7 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyAccountMapper">
 
-    <resultMap id="BaseResultMap" type="cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccountNew">
+    <resultMap id="BaseResultMap" type="cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccount">
         <id column="id" property="id" jdbcType="BIGINT"/>
         <result column="account_id" property="account_id" jdbcType="BIGINT"/>
         <result column="charge" property="charge" jdbcType="DECIMAL"/>
@@ -82,8 +82,8 @@
   </sql>
 
 
-    <insert id="insertSelective" parameterType="cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccountNew">
-        replace into ctop_kuaishou_report_daily_account_new
+    <insert id="insertSelective" parameterType="cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccount">
+        replace into ctop_kuaishou_report_daily_account
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="id != null">
                 id,
@@ -429,7 +429,7 @@
 
     <insert id="loadAccountDailyReport">
 		LOAD DATA local INFILE  #{localPath}
-		REPLACE INTO TABLE ctop_kuaishou_report_daily_account_new CHARACTER SET utf8mb4
+		REPLACE INTO TABLE ctop_kuaishou_report_daily_account CHARACTER SET utf8mb4
 		FIELDS TERMINATED BY ',' enclosed by '"' LINES TERMINATED BY '\n'
 		IGNORE 1 LINES
 		(@ad_scene,

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

@@ -5,7 +5,7 @@
 
     <insert id="loadCampaignDailyReport">
 		LOAD DATA local INFILE  #{localPath}
-	    REPLACE INTO TABLE ctop_kuaishou_report_daily_campaign_new CHARACTER SET utf8mb4
+	    REPLACE INTO TABLE ctop_kuaishou_report_daily_campaign CHARACTER SET utf8mb4
 		FIELDS TERMINATED BY ',' enclosed by '"' LINES TERMINATED BY '\n'
 		IGNORE 1 LINES
 		(campaign_id,

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

@@ -5,7 +5,7 @@
 
     <insert id="loadCreativeDailyReport">
 		LOAD DATA local INFILE  #{localPath}
-		REPLACE INTO TABLE ctop_kuaishou_report_daily_creative_new CHARACTER SET utf8mb4
+		REPLACE INTO TABLE ctop_kuaishou_report_daily_creative CHARACTER SET utf8mb4
 		FIELDS TERMINATED BY ',' enclosed by '"' LINES TERMINATED BY '\n'
 		IGNORE 1 LINES
 		(
@@ -75,7 +75,7 @@
     </insert>
     <update id="formatCreativeDailyReportData">
         UPDATE
-        ctop_kuaishou_report_daily_creative_new t1
+        ctop_kuaishou_report_daily_creative t1
         SET
         t1.signature = (
         SELECT

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

@@ -4,7 +4,7 @@
 
     <insert id="loadGroupDailyReport">
 		LOAD DATA local INFILE  #{localPath}
-		REPLACE INTO TABLE ctop_kuaishou_report_daily_group_new CHARACTER SET utf8mb4
+		REPLACE INTO TABLE ctop_kuaishou_report_daily_group CHARACTER SET utf8mb4
 		FIELDS TERMINATED BY ',' enclosed by '"' LINES TERMINATED BY '\n'
 		IGNORE 1 LINES
 		(

+ 3 - 3
module-report/src/main/java/cn/com/ctop/bytedance/mapper/xml/MaterialReportMapper.xml

@@ -274,7 +274,7 @@
         from
         ctop_user_allocation t1
         left join
-        ctop_kuaishou_report_daily_creative_new t2
+        ctop_kuaishou_report_daily_creative t2
         on t1.account_id = t2.account_id
         <where>
             <if test="userId != null">
@@ -358,7 +358,7 @@
         END
         ) conversionPrice -- 转化单价
         from
-        ctop_kuaishou_report_daily_creative_new
+        ctop_kuaishou_report_daily_creative
         <where>
             <if test="signature != null">
                 and signature = #{signature}
@@ -534,7 +534,7 @@
         signature signature, -- 视频md5
         account_id accountId
         from
-        ctop_kuaishou_report_daily_creative_new
+        ctop_kuaishou_report_daily_creative
         where  account_id in
         <foreach item="item" index="index" collection="accountIds"
                  open="(" separator="," close=")">