Browse Source

快手-人群报表-省份

yangzian 3 years ago
parent
commit
3078086327

+ 3 - 0
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/constant/KuaishouConstant.java

@@ -26,6 +26,9 @@ public class KuaishouConstant {
     //获取代理商数据
     //获取代理商数据
     public static final String ANGENT_REPORT = "/rest/openapi/v1/agent/report";
     public static final String ANGENT_REPORT = "/rest/openapi/v1/agent/report";
 
 
+    //人群分析报表
+    public static final String AUDIENCE_REPORT = "/rest/openapi/v1/report/audience_report";
+
 
 
 
 
 }
 }

+ 484 - 0
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/entity/KuaishouAudienceReportDaily.java

@@ -0,0 +1,484 @@
+package cn.com.ctop.job.kuaishou.data.entity;
+
+import cn.com.ctop.job.kuaishou.data.utils.DateUtils;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.math.BigDecimal;
+
+/**
+ * 快手-人群报表
+ *
+ * @author zian Y
+ * @date 2022-01-06
+ * @version V1.0
+ */
+@Data
+@TableName("kuaishou_audience_province_report_daily")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "kuaishou_audience_province_report_daily对象", description = "快手-人群报表")
+public class KuaishouAudienceReportDaily {
+
+  /** 广告主id */
+  @ApiModelProperty(value = "广告主id")
+  private Long advertiserId;
+  /** 数据日期,格式:YYYYMMDD */
+  @ApiModelProperty(value = "数据日期,格式:YYYYMMDD")
+  private Integer statDate;
+  /** 花费(元) */
+  @ApiModelProperty(value = "花费(元)")
+  private BigDecimal charge;
+  /** 封面曝光数 */
+  @ApiModelProperty(value = "封面曝光数")
+  private Long show;
+  /** 封面点击数 */
+  @ApiModelProperty(value = "封面点击数")
+  private Long photoClick;
+  /** 素材曝光数 */
+  @ApiModelProperty(value = "素材曝光数")
+  private Long aclick;
+  /** 行为数 */
+  @ApiModelProperty(value = "行为数")
+  private Long bclick;
+  /** 封面点击率 */
+  @ApiModelProperty(value = "封面点击率")
+  private BigDecimal photoClickRatio;
+  /** 3s播放率 */
+  @ApiModelProperty(value = "3s播放率")
+  private BigDecimal play3sRatio;
+  /** 行为率 */
+  @ApiModelProperty(value = "行为率")
+  private BigDecimal actionRatio;
+  /** 平均千次曝光花费(元) */
+  @Excel(name = "平均千次曝光花费(元)", width = 15)
+  @ApiModelProperty(value = "平均千次曝光花费(元)")
+  private BigDecimal impression1kCost;
+  /** 平均点击单价(元) */
+  @Excel(name = "平均点击单价(元)", width = 15)
+  @ApiModelProperty(value = "平均点击单价(元)")
+  private BigDecimal photoClickCost;
+  /** 平均行为单价(元) */
+  @Excel(name = "平均行为单价(元)", width = 15)
+  @ApiModelProperty(value = "平均行为单价(元)")
+  private BigDecimal actionCost;
+  /** 分享数 */
+  @Excel(name = "分享数", width = 15)
+  @ApiModelProperty(value = "分享数")
+  private Long share;
+  /** 评论数 */
+  @Excel(name = "评论数", width = 15)
+  @ApiModelProperty(value = "评论数")
+  private Long comment;
+  /** 点赞数 */
+  @Excel(name = "点赞数", width = 15)
+  @ApiModelProperty(value = "点赞数")
+  private Long like;
+  /** 新增关注数 */
+  @Excel(name = "新增关注数", width = 15)
+  @ApiModelProperty(value = "新增关注数")
+  private Long follow;
+  /** 取消关注数 */
+  @Excel(name = "取消关注数", width = 15)
+  @ApiModelProperty(value = "取消关注数")
+  private Long cancelFollow;
+  /** 举报数 */
+  @Excel(name = "举报数", width = 15)
+  @ApiModelProperty(value = "举报数")
+  private Long report;
+  /** 拉黑数 */
+  @Excel(name = "拉黑数", width = 15)
+  @ApiModelProperty(value = "拉黑数")
+  private Long block;
+  /** 减少此类作品数 */
+  @Excel(name = "减少此类作品数", width = 15)
+  @ApiModelProperty(value = "减少此类作品数")
+  private Long negative;
+  /** 提交按钮点击数(历史字段,同下方“表单提交数”,预计年底删除该字段) */
+  @Excel(name = "提交按钮点击数(历史字段,同下方“表单提交数”,预计年底删除该字段)", width = 15)
+  @ApiModelProperty(value = "提交按钮点击数(历史字段,同下方“表单提交数”,预计年底删除该字段)")
+  private Long submit;
+  /** 应用下载数据-安卓下载开始数 */
+  @Excel(name = "应用下载数据-安卓下载开始数", width = 15)
+  @ApiModelProperty(value = "应用下载数据-安卓下载开始数")
+  private Long downloadStarted;
+  /** 应用下载数据-安卓下载完成数 */
+  @Excel(name = "应用下载数据-安卓下载完成数", width = 15)
+  @ApiModelProperty(value = "应用下载数据-安卓下载完成数")
+  private Long downloadCompleted;
+  /** 应用下载数据-激活数 */
+  @Excel(name = "应用下载数据-激活数", width = 15)
+  @ApiModelProperty(value = "应用下载数据-激活数")
+  private Long activation;
+  /** 应用下载数据-首日付费次数 */
+  @Excel(name = "应用下载数据-首日付费次数", width = 15)
+  @ApiModelProperty(value = "应用下载数据-首日付费次数")
+  private Long eventPayFirstDay;
+  /** 应用下载数据-首日付费金额 */
+  @Excel(name = "应用下载数据-首日付费金额", width = 15)
+  @ApiModelProperty(value = "应用下载数据-首日付费金额")
+  private BigDecimal eventPayPurchaseAmountFirstDay;
+  /** 应用下载数据-首日ROI */
+  @Excel(name = "应用下载数据-首日ROI", width = 15)
+  @ApiModelProperty(value = "应用下载数据-首日ROI")
+  private BigDecimal eventPayFirstDayRoi;
+  /** 应用下载数据-付费次数 */
+  @Excel(name = "应用下载数据-付费次数", width = 15)
+  @ApiModelProperty(value = "应用下载数据-付费次数")
+  private Long eventPay;
+  /** 应用下载数据-付费金额 */
+  @Excel(name = "应用下载数据-付费金额", width = 15)
+  @ApiModelProperty(value = "应用下载数据-付费金额")
+  private BigDecimal eventPayPurchaseAmount;
+  /** 应用下载数据-ROI */
+  @Excel(name = "应用下载数据-ROI", width = 15)
+  @ApiModelProperty(value = "应用下载数据-ROI")
+  private BigDecimal eventPayRoi;
+  /** 应用下载数据-注册数 */
+  @Excel(name = "应用下载数据-注册数", width = 15)
+  @ApiModelProperty(value = "应用下载数据-注册数")
+  private Long eventRegister;
+  /** 应用下载数据-注册成本 */
+  @Excel(name = "应用下载数据-注册成本", width = 15)
+  @ApiModelProperty(value = "应用下载数据-注册成本")
+  private BigDecimal eventRegisterCost;
+  /** 应用下载数据-注册率 */
+  @Excel(name = "应用下载数据-注册率", width = 15)
+  @ApiModelProperty(value = "应用下载数据-注册率")
+  private BigDecimal eventRegisterRatio;
+  /** 应用下载数据-完件数 */
+  @Excel(name = "应用下载数据-完件数", width = 15)
+  @ApiModelProperty(value = "应用下载数据-完件数")
+  private Long eventJinJianApp;
+  /** 应用下载数据-完件成本 */
+  @Excel(name = "应用下载数据-完件成本", width = 15)
+  @ApiModelProperty(value = "应用下载数据-完件成本")
+  private BigDecimal eventJinJianAppCost;
+  /** 应用下载数据-授信数 */
+  @Excel(name = "应用下载数据-授信数", width = 15)
+  @ApiModelProperty(value = "应用下载数据-授信数")
+  private Long eventCreditGrantApp;
+  /** 应用下载数据-授信成本 */
+  @Excel(name = "应用下载数据-授信成本", width = 15)
+  @ApiModelProperty(value = "应用下载数据-授信成本")
+  private BigDecimal eventCreditGrantAppCost;
+  /** 应用下载数据-授信率 */
+  @Excel(name = "应用下载数据-授信率", width = 15)
+  @ApiModelProperty(value = "应用下载数据-授信率")
+  private BigDecimal eventCreditGrantAppRatio;
+  /** 应用下载数据-付款成功数 */
+  @Excel(name = "应用下载数据-付款成功数", width = 15)
+  @ApiModelProperty(value = "应用下载数据-付款成功数")
+  private Long eventOrderPaid;
+  /** 应用下载数据-付款成功金额 */
+  @Excel(name = "应用下载数据-付款成功金额", width = 15)
+  @ApiModelProperty(value = "应用下载数据-付款成功金额")
+  private BigDecimal eventOrderPaidPurchaseAmount;
+  /** 应用下载数据-单次付款成本 */
+  @Excel(name = "应用下载数据-单次付款成本", width = 15)
+  @ApiModelProperty(value = "应用下载数据-单次付款成本")
+  private BigDecimal eventOrderPaidCost;
+  /** 应用下载数据-次留数(仅支持分日查询) */
+  @Excel(name = "应用下载数据-次留数(仅支持分日查询)", width = 15)
+  @ApiModelProperty(value = "应用下载数据-次留数(仅支持分日查询)")
+  private Long eventNextDayStay;
+  /** 应用下载数据-次留成本(仅支持分日查询) */
+  @Excel(name = "应用下载数据-次留成本(仅支持分日查询)", width = 15)
+  @ApiModelProperty(value = "应用下载数据-次留成本(仅支持分日查询)")
+  private BigDecimal eventNextDayStayCost;
+  /** 应用下载数据-次留率(仅支持分日查询) */
+  @Excel(name = "应用下载数据-次留率(仅支持分日查询)", width = 15)
+  @ApiModelProperty(value = "应用下载数据-次留率(仅支持分日查询)")
+  private BigDecimal eventNextDayStayRatio;
+  /** 落地页数据-表单提交数 */
+  @Excel(name = "落地页数据-表单提交数", width = 15)
+  @ApiModelProperty(value = "落地页数据-表单提交数")
+  private Long formCount;
+  /** 落地页数据-表单提交单价 */
+  @Excel(name = "落地页数据-表单提交单价", width = 15)
+  @ApiModelProperty(value = "落地页数据-表单提交单价")
+  private BigDecimal formCost;
+  /** 落地页数据-表单提交点击率 */
+  @Excel(name = "落地页数据-表单提交点击率", width = 15)
+  @ApiModelProperty(value = "落地页数据-表单提交点击率")
+  private BigDecimal formActionRatio;
+  /** 落地页数据-落地页完件数 */
+  @Excel(name = "落地页数据-落地页完件数", width = 15)
+  @ApiModelProperty(value = "落地页数据-落地页完件数")
+  private Long eventJinJianLandingPage;
+  /** 落地页数据-落地页完件成本 */
+  @Excel(name = "落地页数据-落地页完件成本", width = 15)
+  @ApiModelProperty(value = "落地页数据-落地页完件成本")
+  private BigDecimal eventJinJianLandingPageCost;
+  /** 落地页数据-落地页授信数 */
+  @Excel(name = "落地页数据-落地页授信数", width = 15)
+  @ApiModelProperty(value = "落地页数据-落地页授信数")
+  private Long eventCreditGrantLandingPage;
+  /** 落地页数据-落地页授信成本 */
+  @Excel(name = "落地页数据-落地页授信成本", width = 15)
+  @ApiModelProperty(value = "落地页数据-落地页授信成本")
+  private BigDecimal eventCreditGrantLandingPageCost;
+  /** 落地页数据-落地页授信率 */
+  @Excel(name = "落地页数据-落地页授信率", width = 15)
+  @ApiModelProperty(value = "落地页数据-落地页授信率")
+  private BigDecimal eventCreditGrantLandingPageRatio;
+  /** 落地页数据-有效线索数 */
+  @Excel(name = "落地页数据-有效线索数", width = 15)
+  @ApiModelProperty(value = "落地页数据-有效线索数")
+  private Long eventValidClues;
+  /** 落地页数据-有效线索成本 */
+  @Excel(name = "落地页数据-有效线索成本", width = 15)
+  @ApiModelProperty(value = "落地页数据-有效线索成本")
+  private BigDecimal eventValidCluesCost;
+  /** 微信复制数 */
+  @Excel(name = "微信复制数", width = 15)
+  @ApiModelProperty(value = "微信复制数")
+  private Long eventAddWechat;
+  /** 微信复制成本 */
+  @Excel(name = "微信复制成本", width = 15)
+  @ApiModelProperty(value = "微信复制成本")
+  private BigDecimal eventAddWechatCost;
+  /** 微信复制率 */
+  @Excel(name = "微信复制率", width = 15)
+  @ApiModelProperty(value = "微信复制率")
+  private BigDecimal eventAddWechatRatio;
+  /** 智能电话-确认接通数 */
+  @Excel(name = "智能电话-确认接通数", width = 15)
+  @ApiModelProperty(value = "智能电话-确认接通数")
+  private Long eventGetThrough;
+  /** 智能电话-确认接通成本 */
+  @Excel(name = "智能电话-确认接通成本", width = 15)
+  @ApiModelProperty(value = "智能电话-确认接通成本")
+  private BigDecimal eventGetThroughCost;
+  /** 智能电话-确认接通率 */
+  @Excel(name = "智能电话-确认接通率", width = 15)
+  @ApiModelProperty(value = "智能电话-确认接通率")
+  private BigDecimal eventGetThroughRatio;
+
+  private Long eventAppInvoked;
+  private BigDecimal eventAppInvokedCost;
+  private BigDecimal eventAppInvokedRatio;
+  private Long unionEventPayPurchaseAmount7d;
+  private BigDecimal unionEventPayPurchaseAmount7dRoi;
+  private String placementType;
+  private String adScene;
+  private Long eventOrderSuccessed;
+  private BigDecimal adPhotoPlayed10sRatio;
+  private BigDecimal keyActionCost;
+  private BigDecimal eventAddShoppingCartCost;
+  private BigDecimal eventAdWatchTimesRatio;
+  private BigDecimal eventOutboundCallCost;
+  private Long eventOutboundCall;
+  private BigDecimal actionNewRatio;
+  private Long eventWatchAppAd;
+  private BigDecimal eventMultiConversionCost;
+  private Long eventPhoneCardActivate;
+  private BigDecimal adPhotoPlayed75percentRatio;
+  private BigDecimal keyActionRatio;
+  private BigDecimal eventAdWatchTimesCost;
+  private Long eventAddShoppingCart;
+  private Long keyAction;
+  private Long eventMultiConversion;
+  private Long eventWechatConnected;
+  private Long eventDspGiftForm;
+  private Long eventIntentionConfirmed;
+  private Long eventPhoneGetThrough;
+  private BigDecimal eventMultiConversionRatio;
+  private BigDecimal eventMeasurementHouse;
+  private BigDecimal adPhotoPlayed2sRatio;
+  private BigDecimal eventOutboundCallRatio;
+  private Long eventAdWatchTimes;
+  private BigDecimal play5sRatio;
+  private BigDecimal playEndRatio;
+  private BigDecimal eventNewUserPay;
+  private BigDecimal eventNewUserPayCost;
+  private BigDecimal eventNewUserPayRatio;
+  private BigDecimal click1kCost;
+  private Long adProductCnt;
+  private Long eventGoodsView;
+  private Long merchantRecoFans;
+  private BigDecimal eventOrderAmountRoi;
+  private BigDecimal eventGoodsViewCost;
+  private BigDecimal merchantRecoFansCost;
+  private Long eventButtonClick;
+  private BigDecimal eventButtonClickCost;
+  private BigDecimal eventButtonClickRatio;
+  private BigDecimal eventOrderPaidRoi;
+  private Long eventNewUserJinjianApp;
+  private BigDecimal eventNewUserJinjianAppCost;
+  private BigDecimal eventNewUserJinjianAppRoi;
+  private Long eventNewUserCreditGrantApp;
+  private BigDecimal eventNewUserCreditGrantAppCost;
+  private BigDecimal eventNewUserCreditGrantAppRoi;
+  private Long eventNewUserJinjianPage;
+  private BigDecimal eventNewUserJinjianPageCost;
+  private BigDecimal eventNewUserJinjianPageRoi;
+  private Long eventNewUserCreditGrantPage;
+  private BigDecimal eventNewUserCreditGrantPageCost;
+  private BigDecimal eventNewUserCreditGrantPageRoi;
+  private Long eventAppointForm;
+  private BigDecimal eventAppointFormCost;
+  private BigDecimal eventAppointFormRatio;
+  private Long eventAppointJumpClick;
+  private BigDecimal eventAppointJumpClickCost;
+  private BigDecimal eventAppointJumpClickRatio;
+  private BigDecimal eventCreditGrantLandingRatio;
+
+
+  //'广告计划ID',
+  private long campaignId;
+  //'广告组ID',
+  private long unitId;
+  //广告创意ID',
+  private long creativeId;
+  //省份',
+  private String province;
+  //省份id',
+  private long provinceId;
+
+
+
+
+  public static KuaishouAudienceReportDaily getKuaishouAudienceInfo(JSONObject returnJson){
+    KuaishouAudienceReportDaily reportDaily = new KuaishouAudienceReportDaily();
+    reportDaily.setAdvertiserId(returnJson.getLong("advertiser_id"));
+    reportDaily.setStatDate(DateUtils.getDateInteger(returnJson.getString("stat_date")));
+    reportDaily.setProvince(returnJson.getString("province"));
+    reportDaily.setCharge(returnJson.getBigDecimal("charge"));
+    reportDaily.setShow(returnJson.getLong("show"));
+    reportDaily.setPhotoClick(returnJson.getLong("photo_click"));
+    reportDaily.setAclick(returnJson.getLong("aclick"));
+    reportDaily.setBclick(returnJson.getLong("bclick"));
+    reportDaily.setPhotoClickRatio(returnJson.getBigDecimal("photo_click_ratio"));
+    reportDaily.setPlay3sRatio(returnJson.getBigDecimal("play_3s_ratio"));
+    reportDaily.setActionRatio(returnJson.getBigDecimal("action_ratio"));
+    reportDaily.setImpression1kCost(returnJson.getBigDecimal("impression_1k_cost"));
+    reportDaily.setPhotoClickCost(returnJson.getBigDecimal("photo_click_cost"));
+    reportDaily.setActionCost(returnJson.getBigDecimal("action_cost"));
+    reportDaily.setShare(returnJson.getLong("share"));
+    reportDaily.setComment(returnJson.getLong("comment"));
+    reportDaily.setLike(returnJson.getLong("like"));
+    reportDaily.setFollow(returnJson.getLong("follow"));
+    reportDaily.setCancelFollow(returnJson.getLong("cancel_follow"));
+    reportDaily.setReport(returnJson.getLong("report"));
+    reportDaily.setBlock(returnJson.getLong("block"));
+    reportDaily.setNegative(returnJson.getLong("negative"));
+    reportDaily.setSubmit(returnJson.getLong("submit"));
+    reportDaily.setDownloadStarted(returnJson.getLong("download_started"));
+    reportDaily.setDownloadCompleted(returnJson.getLong("download_completed"));
+    reportDaily.setActivation(returnJson.getLong("activation"));
+    reportDaily.setEventPayFirstDay(returnJson.getLong("event_pay_first_day"));
+    reportDaily.setEventPayPurchaseAmountFirstDay(returnJson.getBigDecimal("event_pay_purchase_amount_first_day"));
+    reportDaily.setEventPayFirstDayRoi(returnJson.getBigDecimal("event_pay_first_day_roi"));
+    reportDaily.setEventPay(returnJson.getLong("event_pay"));
+    reportDaily.setEventPayPurchaseAmount(returnJson.getBigDecimal("event_pay_purchase_amount"));
+    reportDaily.setEventPayRoi(returnJson.getBigDecimal("event_pay_roi"));
+    reportDaily.setEventRegister(returnJson.getLong("event_register"));
+    reportDaily.setEventRegisterCost(returnJson.getBigDecimal("event_register_cost"));
+    reportDaily.setEventRegisterRatio(returnJson.getBigDecimal("event_register_ratio"));
+    reportDaily.setEventJinJianApp(returnJson.getLong("event_jin_jian_app"));
+    reportDaily.setEventJinJianAppCost(returnJson.getBigDecimal("event_jin_jian_app_cost"));
+    reportDaily.setEventCreditGrantApp(returnJson.getLong("event_credit_grant_app"));
+    reportDaily.setEventCreditGrantAppCost(returnJson.getBigDecimal("event_credit_grant_app_cost"));
+    reportDaily.setEventCreditGrantAppRatio(returnJson.getBigDecimal("event_credit_grant_app_ratio"));
+    reportDaily.setEventOrderPaid(returnJson.getLong("event_order_paid"));
+    reportDaily.setEventOrderPaidPurchaseAmount(returnJson.getBigDecimal("event_order_paid_purchase_amount"));
+    reportDaily.setEventOrderPaidCost(returnJson.getBigDecimal("event_order_paid_cost"));
+    reportDaily.setEventNextDayStay(returnJson.getLong("event_next_day_stay"));
+    reportDaily.setEventNextDayStayCost(returnJson.getBigDecimal("event_next_day_stay_cost"));
+    reportDaily.setEventNextDayStayRatio(returnJson.getBigDecimal("event_next_day_stay_ratio"));
+    reportDaily.setFormCount(returnJson.getLong("form_count"));
+    reportDaily.setFormCost(returnJson.getBigDecimal("form_cost"));
+    reportDaily.setFormActionRatio(returnJson.getBigDecimal("form_action_ratio"));
+    reportDaily.setEventJinJianLandingPage(returnJson.getLong("event_jin_jian_landing_page"));
+    reportDaily.setEventJinJianLandingPageCost(returnJson.getBigDecimal("event_jin_jian_landing_page_cost"));
+    reportDaily.setEventCreditGrantLandingPage(returnJson.getLong("event_credit_grant_landing_page"));
+    reportDaily.setEventCreditGrantLandingPageCost(returnJson.getBigDecimal("event_credit_grant_landing_page_cost"));
+    reportDaily.setEventCreditGrantLandingPageRatio(returnJson.getBigDecimal("event_credit_grant_landing_page_ratio"));
+    reportDaily.setEventValidClues(returnJson.getLong("event_valid_clues"));
+    reportDaily.setEventValidCluesCost(returnJson.getBigDecimal("event_valid_clues_cost"));
+    reportDaily.setEventAddWechat(returnJson.getLong("event_add_wechat"));
+    reportDaily.setEventAddWechatCost(returnJson.getBigDecimal("event_add_wechat_cost"));
+    reportDaily.setEventAddWechatRatio(returnJson.getBigDecimal("event_add_wechat_ratio"));
+    reportDaily.setEventGetThrough(returnJson.getLong("event_get_through"));
+    reportDaily.setEventGetThroughCost(returnJson.getBigDecimal("event_get_through_cost"));
+    reportDaily.setEventGetThroughRatio(returnJson.getBigDecimal("event_get_through_ratio"));
+    reportDaily.setEventAppInvoked(returnJson.getLong("event_app_invoked"));
+    reportDaily.setEventAppInvokedCost(returnJson.getBigDecimal("event_app_invoked_cost"));
+    reportDaily.setEventAppInvokedRatio(returnJson.getBigDecimal("event_app_invoked_ratio"));
+    reportDaily.setEventCreditGrantLandingRatio(returnJson.getBigDecimal("event_credit_grant_landing_ratio"));
+    reportDaily.setPlay5sRatio(returnJson.getBigDecimal("play_5s_ratio"));
+    reportDaily.setPlayEndRatio(returnJson.getBigDecimal("play_end_ratio"));
+    reportDaily.setEventNewUserPay(returnJson.getBigDecimal("event_new_user_pay"));
+    reportDaily.setEventNewUserPayCost(returnJson.getBigDecimal("event_new_user_pay_cost"));
+    reportDaily.setEventNewUserPayRatio(returnJson.getBigDecimal("event_new_user_pay_ratio"));
+    reportDaily.setClick1kCost(returnJson.getBigDecimal("click_1k_cost"));
+    reportDaily.setAdProductCnt(returnJson.getLong("ad_product_cnt"));
+    reportDaily.setEventGoodsView(returnJson.getLong("event_goods_view"));
+    reportDaily.setMerchantRecoFans(returnJson.getLong("merchant_reco_fans"));
+    reportDaily.setEventGoodsViewCost(returnJson.getBigDecimal("event_goods_view_cost"));
+    reportDaily.setMerchantRecoFansCost(returnJson.getBigDecimal("merchant_reco_fans_cost"));
+    reportDaily.setEventOrderAmountRoi(returnJson.getBigDecimal("event_order_amount_roi"));
+    reportDaily.setEventButtonClick(returnJson.getLong("event_button_click"));
+    reportDaily.setEventButtonClickCost(returnJson.getBigDecimal("event_button_click_cost"));
+    reportDaily.setEventButtonClickRatio(returnJson.getBigDecimal("event_button_click_ratio"));
+    reportDaily.setEventOrderPaidRoi(returnJson.getBigDecimal("event_order_paid_roi"));
+    reportDaily.setEventNewUserJinjianApp(returnJson.getLong("event_new_user_jinjian_app"));
+    reportDaily.setEventNewUserJinjianAppCost(returnJson.getBigDecimal("event_new_user_jinjian_app_cost"));
+    reportDaily.setEventNewUserJinjianAppRoi(returnJson.getBigDecimal("event_new_user_jinjian_app_roi"));
+    reportDaily.setEventNewUserCreditGrantApp(returnJson.getLong("event_new_user_credit_grant_app"));
+    reportDaily.setEventNewUserCreditGrantAppCost(returnJson.getBigDecimal("event_new_user_credit_grant_app_cost"));
+    reportDaily.setEventNewUserCreditGrantAppRoi(returnJson.getBigDecimal("event_new_user_credit_grant_app_roi"));
+    reportDaily.setEventNewUserJinjianPage(returnJson.getLong("event_new_user_jinjian_page"));
+    reportDaily.setEventNewUserJinjianPageCost(returnJson.getBigDecimal("event_new_user_jinjian_page_cost"));
+    reportDaily.setEventNewUserJinjianPageRoi(returnJson.getBigDecimal("event_new_user_jinjian_page_roi"));
+    reportDaily.setEventNewUserCreditGrantPage(returnJson.getLong("event_new_user_credit_grant_page"));
+    reportDaily.setEventNewUserCreditGrantPageCost(returnJson.getBigDecimal("event_new_user_credit_grant_page_cost"));
+    reportDaily.setEventNewUserCreditGrantPageRoi(returnJson.getBigDecimal("event_new_user_credit_grant_page_roi"));
+    reportDaily.setEventAppointForm(returnJson.getLong("event_appoint_form"));
+    reportDaily.setEventAppointFormCost(returnJson.getBigDecimal("event_appoint_form_cost"));
+    reportDaily.setEventAppointFormRatio(returnJson.getBigDecimal("event_appoint_form_ratio"));
+    reportDaily.setEventAppointJumpClick(returnJson.getLong("event_appoint_jump_click"));
+    reportDaily.setEventAppointJumpClickCost(returnJson.getBigDecimal("event_appoint_jump_click_cost"));
+    reportDaily.setEventAppointJumpClickRatio(returnJson.getBigDecimal("event_appoint_jump_click_ratio"));
+    reportDaily.setUnionEventPayPurchaseAmount7d(returnJson.getLong("union_event_pay_purchase_amount_7d"));
+    reportDaily.setUnionEventPayPurchaseAmount7dRoi(returnJson.getBigDecimal("union_event_pay_purchase_amount_7d_roi"));
+    reportDaily.setPlacementType(returnJson.getString("placement_type"));
+    reportDaily.setAdScene(returnJson.getString("ad_scene"));
+    reportDaily.setEventOrderSuccessed(returnJson.getLong("event_order_successed"));
+    reportDaily.setAdPhotoPlayed10sRatio(returnJson.getBigDecimal("ad_photo_played_10s_ratio"));
+    reportDaily.setKeyActionCost(returnJson.getBigDecimal("key_action_cost"));
+    reportDaily.setEventAddShoppingCartCost(returnJson.getBigDecimal("event_add_shopping_cart_cost"));
+    reportDaily.setEventAdWatchTimesRatio(returnJson.getBigDecimal("event_ad_watch_times_ratio"));
+    reportDaily.setEventOutboundCallCost(returnJson.getBigDecimal("event_outbound_call_cost"));
+    reportDaily.setEventOutboundCall(returnJson.getLong("event_outbound_call"));
+    reportDaily.setActionNewRatio(returnJson.getBigDecimal("action_new_ratio"));
+    reportDaily.setEventWatchAppAd(returnJson.getLong("event_watch_app_ad"));
+    reportDaily.setEventMultiConversionCost(returnJson.getBigDecimal("event_multi_conversion_cost"));
+    reportDaily.setEventPhoneCardActivate(returnJson.getLong("event_phone_card_activate"));
+    reportDaily.setAdPhotoPlayed75percentRatio(returnJson.getBigDecimal("ad_photo_played_75percent_ratio"));
+    //  reportDaily.setKeyActionRatio(returnJson.getBigDecimal("key_action_ratio"));
+    reportDaily.setEventAdWatchTimesCost(returnJson.getBigDecimal("event_ad_watch_times_cost"));
+    reportDaily.setEventAddShoppingCart(returnJson.getLong("event_add_shopping_cart"));
+    reportDaily.setKeyAction(returnJson.getLong("key_action"));
+    reportDaily.setEventMultiConversion(returnJson.getLong("event_multi_conversion"));
+    reportDaily.setEventWechatConnected(returnJson.getLong("event_wechat_connected"));
+    reportDaily.setEventDspGiftForm(returnJson.getLong("event_dsp_gift_form"));
+    reportDaily.setEventIntentionConfirmed(returnJson.getLong("event_intention_confirmed"));
+    reportDaily.setEventPhoneGetThrough(returnJson.getLong("event_phone_get_through"));
+    reportDaily.setEventMultiConversionRatio(returnJson.getBigDecimal("event_multi_conversion_ratio"));
+    reportDaily.setEventMeasurementHouse(returnJson.getBigDecimal("event_measurement_house"));
+    reportDaily.setAdPhotoPlayed2sRatio(returnJson.getBigDecimal("ad_photo_played_2s_ratio"));
+    reportDaily.setEventOutboundCallRatio(returnJson.getBigDecimal("event_outbound_call_ratio"));
+    reportDaily.setEventAdWatchTimes(returnJson.getLong("event_ad_watch_times"));
+    return reportDaily;
+  }
+
+
+}

+ 21 - 0
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/mapper/KuaishouAudienceReportDailyMapper.java

@@ -0,0 +1,21 @@
+package cn.com.ctop.job.kuaishou.data.mapper;
+
+import cn.com.ctop.job.kuaishou.data.entity.KuaishouAudienceReportDaily;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 快手-人群报表
+ *
+ * @author zian Y
+ *   2022-01-06
+ * @version V1.0
+ */
+public interface KuaishouAudienceReportDailyMapper extends BaseMapper<KuaishouAudienceReportDaily> {
+
+  //快手-人群报表--省份
+  void replaceBatchKsAudienceProvince(@Param("addList") List<KuaishouAudienceReportDaily> addList);
+
+}

+ 285 - 0
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/mapper/xml/KuaishouAudienceReportDailyMapper.xml

@@ -0,0 +1,285 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.job.kuaishou.data.mapper.KuaishouAudienceReportDailyMapper">
+
+    <!-- 快手-人群报表-省份-->
+    <insert id="replaceBatchKsAudienceProvince">
+        replace into kuaishou_audience_province_report_daily(
+        `advertiser_id`,
+        `stat_date`,
+        `campaign_id`,
+        `unit_id`,
+        `creative_id`,
+        `province`,
+        `province_id`,
+        `charge`,
+        `show`,
+        `photo_click`,
+        `aclick`,
+        `bclick`,
+        `photo_click_ratio`,
+        `play_3s_ratio`,
+        `action_ratio`,
+        `impression_1k_cost`,
+        `photo_click_cost`,
+        `action_cost`,
+        `share`,
+        `comment`,
+        `like`,
+        `follow`,
+        `cancel_follow`,
+        `report`,
+        `block`,
+        `negative`,
+        `submit`,
+        `download_started`,
+        `download_completed`,
+        `activation`,
+        `event_pay_first_day`,
+        `event_pay_purchase_amount_first_day`,
+        `event_pay_first_day_roi`,
+        `event_pay`,
+        `event_pay_purchase_amount`,
+        `event_pay_roi`,
+        `event_register`,
+        `event_register_cost`,
+        `event_register_ratio`,
+        `event_jin_jian_app`,
+        `event_jin_jian_app_cost`,
+        `event_credit_grant_app`,
+        `event_credit_grant_app_cost`,
+        `event_credit_grant_app_ratio`,
+        `event_order_paid`,
+        `event_order_paid_purchase_amount`,
+        `event_order_paid_cost`,
+        `event_next_day_stay`,
+        `event_next_day_stay_cost`,
+        `event_next_day_stay_ratio`,
+        `form_count`,
+        `form_cost`,
+        `form_action_ratio`,
+        `event_jin_jian_landing_page`,
+        `event_jin_jian_landing_page_cost`,
+        `event_credit_grant_landing_page`,
+        `event_credit_grant_landing_page_cost`,
+        `event_credit_grant_landing_page_ratio`,
+        `event_valid_clues`,
+        `event_valid_clues_cost`,
+        `event_add_wechat`,
+        `event_add_wechat_cost`,
+        `event_add_wechat_ratio`,
+        `event_get_through`,
+        `event_get_through_cost`,
+        `event_get_through_ratio`
+        <!--`event_app_invoked`,
+        `event_app_invoked_cost`,
+        `event_app_invoked_ratio`,
+        `event_credit_grant_landing_ratio`,
+        `play_5s_ratio`,
+        `play_end_ratio`,
+        `event_new_user_pay`,
+        `event_new_user_pay_cost`,
+        `event_new_user_pay_ratio`,
+        `click_1k_cost`,
+        `ad_product_cnt`,
+        `event_goods_view`,
+        `merchant_reco_fans`,
+        `event_order_amount_roi`,
+        `event_goods_view_cost`,
+        `merchant_reco_fans_cost`,
+        `event_button_click`,
+        `event_button_click_cost`,
+        `event_button_click_ratio`,
+        `event_order_paid_roi`,
+        `event_new_user_jinjian_app`,
+        `event_new_user_jinjian_app_cost`,
+        `event_new_user_jinjian_app_roi`,
+        `event_new_user_credit_grant_app`,
+        `event_new_user_credit_grant_app_cost`,
+        `event_new_user_credit_grant_app_roi`,
+        `event_new_user_jinjian_page`,
+        `event_new_user_jinjian_page_cost`,
+        `event_new_user_jinjian_page_roi`,
+        `event_new_user_credit_grant_page`,
+        `event_new_user_credit_grant_page_cost`,
+        `event_new_user_credit_grant_page_roi`,
+        `event_appoint_form`,
+        `event_appoint_form_cost`,
+        `event_appoint_form_ratio`,
+        `event_appoint_jump_click`,
+        `event_appoint_jump_click_cost`,
+        `event_appoint_jump_click_ratio`,
+        `union_event_pay_purchase_amount_7d`,
+        `union_event_pay_purchase_amount_7d_roi`,
+        `placement_type`,
+        `ad_scene`,
+        `event_order_successed`,
+        `ad_photo_played_10s_ratio`,
+        `key_action_cost`,
+        `event_add_shopping_cart_cost`,
+        `event_ad_watch_times_ratio`,
+        `event_outbound_call_cost`,
+        `event_outbound_call`,
+        `action_new_ratio`,
+        `event_watch_app_ad`,
+        `event_multi_conversion_cost`,
+        `event_phone_card_activate`,
+        `ad_photo_played_75percent_ratio`,
+        `key_action_ratio`,
+        `event_ad_watch_times_cost`,
+        `event_add_shopping_cart`,
+        `key_action`,
+        `event_multi_conversion`,
+        `event_wechat_connected`,
+        `event_dsp_gift_form`,
+        `event_intention_confirmed`,
+        `event_phone_get_through`,
+        `event_multi_conversion_ratio`,
+        `event_measurement_house`,
+        `ad_photo_played_2s_ratio`,
+        `event_outbound_call_ratio`,
+        `event_ad_watch_times`
+-->
+        )
+        values
+        <foreach collection="addList" item="add" separator=",">
+            (
+            #{add.advertiserId},
+            #{add.statDate},
+            #{add.campaignId},
+            #{add.unitId},
+            #{add.creativeId},
+            #{add.province},
+            #{add.provinceId},
+            #{add.charge},
+            #{add.show},
+            #{add.photoClick},
+            #{add.aclick},
+            #{add.bclick},
+            #{add.photoClickRatio},
+            #{add.play3sRatio},
+            #{add.actionRatio},
+            #{add.impression1kCost},
+            #{add.photoClickCost},
+            #{add.actionCost},
+            #{add.share},
+            #{add.comment},
+            #{add.like},
+            #{add.follow},
+            #{add.cancelFollow},
+            #{add.report},
+            #{add.block},
+            #{add.negative},
+            #{add.submit},
+            #{add.downloadStarted},
+            #{add.downloadCompleted},
+            #{add.activation},
+            #{add.eventPayFirstDay},
+            #{add.eventPayPurchaseAmountFirstDay},
+            #{add.eventPayFirstDayRoi},
+            #{add.eventPay},
+            #{add.eventPayPurchaseAmount},
+            #{add.eventPayRoi},
+            #{add.eventRegister},
+            #{add.eventRegisterCost},
+            #{add.eventRegisterRatio},
+            #{add.eventJinJianApp},
+            #{add.eventJinJianAppCost},
+            #{add.eventCreditGrantApp},
+            #{add.eventCreditGrantAppCost},
+            #{add.eventCreditGrantAppRatio},
+            #{add.eventOrderPaid},
+            #{add.eventOrderPaidPurchaseAmount},
+            #{add.eventOrderPaidCost},
+            #{add.eventNextDayStay},
+            #{add.eventNextDayStayCost},
+            #{add.eventNextDayStayRatio},
+            #{add.formCount},
+            #{add.formCost},
+            #{add.formActionRatio},
+            #{add.eventJinJianLandingPage},
+            #{add.eventJinJianLandingPageCost},
+            #{add.eventCreditGrantLandingPage},
+            #{add.eventCreditGrantLandingPageCost},
+            #{add.eventCreditGrantLandingPageRatio},
+            #{add.eventValidClues},
+            #{add.eventValidCluesCost},
+            #{add.eventAddWechat},
+            #{add.eventAddWechatCost},
+            #{add.eventAddWechatRatio},
+            #{add.eventGetThrough},
+            #{add.eventGetThroughCost},
+            #{add.eventGetThroughRatio}
+            <!-- #{add.eventAppInvoked},
+             #{add.eventAppInvokedCost},
+             #{add.eventAppInvokedRatio},
+             #{add.eventCreditGrantLandingRatio},
+             #{add.play5sRatio},
+             #{add.playEndRatio},
+             #{add.eventNewUserPay},
+             #{add.eventNewUserPayCost},
+             #{add.eventNewUserPayRatio},
+             #{add.click1kCost},
+             #{add.adProductCnt},
+             #{add.eventGoodsView},
+             #{add.merchantRecoFans},
+             #{add.eventOrderAmountRoi},
+             #{add.eventGoodsViewCost},
+             #{add.merchantRecoFansCost},
+             #{add.eventButtonClick},
+             #{add.eventButtonClickCost},
+             #{add.eventButtonClickRatio},
+             #{add.eventOrderPaidRoi},
+             #{add.eventNewUserJinjianApp},
+             #{add.eventNewUserJinjianAppCost},
+             #{add.eventNewUserJinjianAppRoi},
+             #{add.eventNewUserCreditGrantApp},
+             #{add.eventNewUserCreditGrantAppCost},
+             #{add.eventNewUserCreditGrantAppRoi},
+             #{add.eventNewUserJinjianPage},
+             #{add.eventNewUserJinjianPageCost},
+             #{add.eventNewUserJinjianPageRoi},
+             #{add.eventNewUserCreditGrantPage},
+             #{add.eventNewUserCreditGrantPageCost},
+             #{add.eventNewUserCreditGrantPageRoi},
+             #{add.eventAppointForm},
+             #{add.eventAppointFormCost},
+             #{add.eventAppointFormRatio},
+             #{add.eventAppointJumpClick},
+             #{add.eventAppointJumpClickCost},
+             #{add.eventAppointJumpClickRatio},
+             #{add.unionEventPayPurchaseAmount7d},
+             #{add.unionEventPayPurchaseAmount7dRoi},
+             #{add.placementType},
+             #{add.adScene},
+             #{add.eventOrderSuccessed},
+             #{add.adPhotoPlayed10sRatio},
+             #{add.keyActionCost},
+             #{add.eventAddShoppingCartCost},
+             #{add.eventAdWatchTimesRatio},
+             #{add.eventOutboundCallCost},
+             #{add.eventOutboundCall},
+             #{add.actionNewRatio},
+             #{add.eventWatchAppAd},
+             #{add.eventMultiConversionCost},
+             #{add.eventPhoneCardActivate},
+             #{add.adPhotoPlayed75percentRatio},
+             #{add.keyActionRatio},
+             #{add.eventAdWatchTimesCost},
+             #{add.eventAddShoppingCart},
+             #{add.keyAction},
+             #{add.eventMultiConversion},
+             #{add.eventWechatConnected},
+             #{add.eventDspGiftForm},
+             #{add.eventIntentionConfirmed},
+             #{add.eventPhoneGetThrough},
+             #{add.eventMultiConversionRatio},
+             #{add.eventMeasurementHouse},
+             #{add.adPhotoPlayed2sRatio},
+             #{add.eventOutboundCallRatio},
+             #{add.eventAdWatchTimes}
+ -->
+             )
+         </foreach>
+     </insert>
+ </mapper>

+ 5 - 4
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/service/IAdUnitReportService.java

@@ -15,12 +15,13 @@ import java.util.PrimitiveIterator;
  */
  */
 public interface IAdUnitReportService{
 public interface IAdUnitReportService{
 
 
-    public void getAdUnitReport(Long advertiserId, String accessToken, String startDate, String endDate, int page);
+    void getAdUnitReport(Long advertiserId, String accessToken, String startDate, String endDate, int page);
 
 
-    public void getAdPlanReport(Long advertiserId, String accessToken, String startDate, String endDate, int page);
+    void getAdPlanReport(Long advertiserId, String accessToken, String startDate, String endDate, int page);
 
 
-    public void getAgentReport();
+    void getAgentReport();
 
 
-    public void getKuaishouAccountAdSceneDaily(Long advertiserId, String accessToken, String startDate, String endDate, int page, String temporalGranularity, List<String> reportDims);
+    void getKuaishouAccountAdSceneDaily(Long advertiserId, String accessToken, String startDate, String endDate, int page, String temporalGranularity, List<String> reportDims);
 
 
+    void crowdAnalysisReport(Long advertiserId, String accessToken, String date,  List<Long> campaignIds,List<Long> unitIds, List<String> reportDims,Integer page);
 }
 }

+ 61 - 6
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/service/impl/AdUnitReportServiceImpl.java

@@ -2,10 +2,7 @@ package cn.com.ctop.job.kuaishou.data.service.impl;
 
 
 import cn.com.ctop.job.kuaishou.data.constant.KuaishouConstant;
 import cn.com.ctop.job.kuaishou.data.constant.KuaishouConstant;
 import cn.com.ctop.job.kuaishou.data.entity.*;
 import cn.com.ctop.job.kuaishou.data.entity.*;
-import cn.com.ctop.job.kuaishou.data.mapper.AdUnitReportMapper;
-import cn.com.ctop.job.kuaishou.data.mapper.KuaishouAccountAdSceneReportDailyMapper;
-import cn.com.ctop.job.kuaishou.data.mapper.OauthAgentTokenMapper;
-import cn.com.ctop.job.kuaishou.data.mapper.OauthTokenMapper;
+import cn.com.ctop.job.kuaishou.data.mapper.*;
 import cn.com.ctop.job.kuaishou.data.service.IAdUnitReportService;
 import cn.com.ctop.job.kuaishou.data.service.IAdUnitReportService;
 import cn.com.ctop.job.kuaishou.data.service.IOauthTokenService;
 import cn.com.ctop.job.kuaishou.data.service.IOauthTokenService;
 import cn.com.ctop.job.kuaishou.data.utils.Check;
 import cn.com.ctop.job.kuaishou.data.utils.Check;
@@ -13,8 +10,6 @@ import cn.com.ctop.job.kuaishou.data.utils.DateUtils;
 import cn.com.ctop.job.kuaishou.data.utils.HttpUtils;
 import cn.com.ctop.job.kuaishou.data.utils.HttpUtils;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.xxl.job.core.context.XxlJobHelper;
 import com.xxl.job.core.context.XxlJobHelper;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -52,6 +47,9 @@ public class AdUnitReportServiceImpl implements IAdUnitReportService {
     @Resource
     @Resource
     private KuaishouAccountAdSceneReportDailyMapper accountAdSceneReportDailyMapper;
     private KuaishouAccountAdSceneReportDailyMapper accountAdSceneReportDailyMapper;
 
 
+    @Resource
+    private KuaishouAudienceReportDailyMapper audienceReportDailyMapper;
+
 
 
   /**
   /**
    * 获取广告组信息
    * 获取广告组信息
@@ -322,6 +320,63 @@ public class AdUnitReportServiceImpl implements IAdUnitReportService {
     }
     }
 
 
 
 
+  /**
+   * 快手-人群报表
+   * @param advertiserId
+   * @param accessToken
+   * @param date
+   * @param campaignIds  广告计划 ID 集
+   * @param unitIds 广告组 ID 集
+   * @param reportDims 人群报表类型
+   * @param page
+   */
+  @Override
+  public void crowdAnalysisReport(Long advertiserId, String accessToken, String date, List<Long> campaignIds,List<Long> unitIds, List<String> reportDims,Integer page) {
+    log.info("获取人群报表===={}====,账户id:{},开始时间:{},结束时间:{},page==={}", reportDims,advertiserId, date, date,page);
+    try {
+        Map<String, String> headers = new HashMap<>();
+        headers.put("Access-Token", accessToken);
+        headers.put("Content-Type", "application/json");
+        JSONObject requestJson = new JSONObject();
+        requestJson.put("advertiser_id", advertiserId);
+        requestJson.put("start_date", date);
+        requestJson.put("end_date", date);
+        requestJson.put("campaign_ids", campaignIds);
+        requestJson.put("unit_ids", unitIds);
+        requestJson.put("report_dims", reportDims);
+        requestJson.put("page", page);
+        requestJson.put("page_size", 2000);
+
+        String result = HttpUtils.httpPostRequest(postUrl + KuaishouConstant.AUDIENCE_REPORT, requestJson, headers);
+        JSONObject resultJson = JSONObject.parseObject(result);
+
+        Integer code = resultJson.getInteger("code");
+        if (null == code || code != 0) {
+          log.error("获取快手======{}===人群报表=====异常:{},accountId:{}",reportDims, resultJson.getString("message"), advertiserId);
+          return;
+        }
+        JSONArray details = resultJson.getJSONObject("data").getJSONArray("details");
+        if (null == details || details.size() <= 0) {
+          log.error("快手人群报表==={}=====返回详情为空,accountId:{}", reportDims,advertiserId);
+          return;
+        }
+
+        List<KuaishouAudienceReportDaily> addList = new ArrayList<>();
+        for (int i = 0; i < details.size(); i++) {
+          JSONObject returnJson = details.getJSONObject(i);
+          returnJson.put("advertiser_id",advertiserId);
+          KuaishouAudienceReportDaily reportDaily = KuaishouAudienceReportDaily.getKuaishouAudienceInfo(returnJson);
+          addList.add(reportDaily);
+        }
 
 
+        audienceReportDailyMapper.replaceBatchKsAudienceProvince(addList);
+        crowdAnalysisReport(advertiserId, accessToken, date,campaignIds,unitIds, reportDims,page+1);
+        log.info("快手人群报表==={}==========获取完成:accountId:{}", reportDims,advertiserId);
+    }catch (Exception e){
+      log.info(String.valueOf(e));
+    }
 
 
   }
   }
+
+
+}

+ 36 - 0
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/AdUnitReportJob.java

@@ -154,6 +154,42 @@ public class AdUnitReportJob {
 
 
 
 
 
 
+  /**
+   * 快手-人群报表
+   * @throws Exception
+   */
+  @XxlJob("KuaishouAudienceReportJob")
+  public void KuaishouAudienceReportJob() throws Exception {
+    String param = XxlJobHelper.getJobParam(); // 执行参数
+    if (Check.isNull(param)) {
+      log.error("入参为空");
+      return;
+    }
+    String token = tokenService.getByAccountId(Long.valueOf(param));
+    if (Check.isNull(token)) {
+      log.error("此账户未获取到相关token,accountId:{}", param);
+      return;
+    }
+
+    String date = DateUtils.getAnotherDay("yyyy-MM-dd", DateUtils.getNowDate("yyyy-MM-dd"), -1);
+    //广告计划 ID 集
+    List<Long> campaignIds = Arrays.asList();
+    //广告组 ID 集
+    List<Long> unitIds = Arrays.asList();
+    //人群报表类型
+    List<String> reportDims = Arrays.asList("province");
+    dailyExecutorService.submit(
+            new Runnable() {
+              @Override
+              public void run() {
+                adUnitReportService.crowdAnalysisReport(Long.valueOf(param), token, date, campaignIds, unitIds,reportDims,1);
+              }
+            });
+  }
+
+
+
+
 
 
 
 
 }
 }