yumeng преди 5 години
родител
ревизия
dac0681f42

+ 1 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialInfoController.java

@@ -82,6 +82,7 @@ public class MaterialInfoController {
         return result;
     }
 
+
     /**
      * 分页列表查询
      *

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

@@ -144,7 +144,7 @@ public class SampleTest {
     @Test
     public void testMail() throws Exception {
         // String accessToken, Long advertiserId, Date startDate, Date endDate, Integer page
-        kuaishouInterfaceService.getAppSearch(23212L, "cbe8dfe599d36ff59417d5037bbc0a15", "快");
+        kuaishouInterfaceService.getTargetingTags(23212L, "24b9c4ead0e4e8d1d61e9c040b8bae6f");
     }
 
 

+ 89 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/BatchController.java

@@ -175,7 +175,6 @@ public class BatchController {
         return result;
     }
 
-
     /**
      * 批量修改广告计划预算
      *
@@ -462,7 +461,7 @@ public class BatchController {
 
 
     /**
-     * 获取可选的深度类型
+     * 获取app列表
      *
      * @param accountId
      * @param appName
@@ -489,5 +488,93 @@ public class BatchController {
 
     }
 
+    /**
+     * 获取项目最高出价
+     *
+     * @param accountId
+     * @return
+     */
+    @GetMapping(value = "/getProjectMaxBid")
+    public Result<BigDecimal> getProjectMaxBid(Long accountId) {
+        Result<BigDecimal> result = new Result<>();
+        try {
+            if (Check.isNull(accountId)) {
+                throw new Exception("请传入accountId");
+            }
+            BigDecimal maxBid = batchService.getProjectMaxBid(accountId);
+            result.setSuccess(true);
+            result.setResult(maxBid);
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+            result.setMessage(e.getMessage());
+        }
+
+        return result;
+
+    }
+
+
+    /**
+     * 获取项目最高出价
+     *
+     * @param campaignId
+     * @return
+     */
+    @GetMapping(value = "/checkUnitName")
+    public Result<Boolean> checkUnitName(Long campaignId, String unitName) {
+        Result<Boolean> result = new Result<>();
+        try {
+            if (Check.isNull(campaignId)) {
+                throw new Exception("请传入广告计划id");
+            }
+            if (Check.isNull(unitName)) {
+                throw new Exception("请传入广告组名称");
+            }
+            Boolean checkUnitName = batchService.checkUnitName(campaignId, unitName);
+            result.setSuccess(true);
+            result.setResult(checkUnitName);
+            if (!checkUnitName) {
+                result.setMessage("广告组名称该计划下已存在");
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+            result.setMessage(e.getMessage());
+        }
+
+        return result;
+    }
+
+
+    /**
+     * 批量创建广告组
+     *
+     * @param requestJson
+     * @return
+     */
+    @PostMapping(value = "/createUnit")
+    public Result<JSONObject> createUnit(@RequestBody JSONObject requestJson) {
+        Result<JSONObject> result = new Result<>();
+        try {
+            if (Check.isNull(requestJson)) {
+                throw new Exception("入参为空");
+            }
+
+            JSONObject unitJson = batchService.createUnit(requestJson);
+            result.setSuccess(true);
+            result.setResult(unitJson);
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+            result.setMessage(e.getMessage());
+        }
+
+        return result;
+    }
+
 
 }

+ 2 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/BatchMapper.java

@@ -10,4 +10,6 @@ public interface BatchMapper {
     BigDecimal getHourCost(@Param("accountId") Long accountId, @Param("statDate") String statDate);
 
     BigDecimal getBudget(@Param("accountId") Long accountId);
+
+    BigDecimal getProjectMaxBidByProject(@Param("projectId") Long projectId);
 }

+ 9 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/BatchMapper.xml

@@ -43,4 +43,13 @@
     </select>
 
 
+    <select id="getProjectMaxBidByProject" resultType="java.math.BigDecimal">
+      select
+      max_bid
+      from
+      ctop_project
+      where id = #{projectId}
+    </select>
+
+
 </mapper>

+ 27 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IBatchService.java

@@ -1,6 +1,7 @@
 package cn.com.ctop.kuaishou.modules.batch.service;
 
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCampaign;
+import com.alibaba.fastjson.JSONObject;
 
 import java.math.BigDecimal;
 
@@ -29,4 +30,30 @@ public interface IBatchService {
      * @return
      */
     KuaiShouCampaign getCampaignInfo(Long accountId, Long campaignId);
+
+
+    /**
+     * 获取项目最高出价
+     *
+     * @param accountId
+     * @return
+     */
+    BigDecimal getProjectMaxBid(Long accountId);
+
+    /**
+     * 校验广告组名称是否重复
+     *
+     * @param campaignId
+     * @param unitName
+     * @return
+     */
+    Boolean checkUnitName(Long campaignId, String unitName);
+
+    /**
+     * 批量创建广告组
+     *
+     * @param requestJson
+     * @return
+     */
+    JSONObject createUnit(JSONObject requestJson) throws Exception;
 }

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

@@ -1,9 +1,19 @@
 package cn.com.ctop.kuaishou.modules.batch.service.impl;
 
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.entity.UserAllocation;
+import cn.com.ctop.common.module.mapper.UserAllocationMapper;
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCampaign;
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouGroup;
 import cn.com.ctop.kuaishou.modules.batch.mapper.BatchMapper;
 import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouCampaignMapper;
+import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouGroupMapper;
 import cn.com.ctop.kuaishou.modules.batch.service.IBatchService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
@@ -12,6 +22,7 @@ import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
 import java.util.Date;
+import java.util.Map;
 
 @Slf4j
 @Service
@@ -20,6 +31,8 @@ public class BatchServiceImpl implements IBatchService {
     private BatchMapper batchMapper;
     @Autowired
     private KuaiShouCampaignMapper campaignMapper;
+    @Autowired
+    private UserAllocationMapper userAllocationMapper;
 
 
     /**
@@ -66,6 +79,306 @@ public class BatchServiceImpl implements IBatchService {
         return campaign;
     }
 
+    /**
+     * 获取项目最高出价
+     *
+     * @param accountId
+     * @return
+     */
+
+    @Override
+    public BigDecimal getProjectMaxBid(Long accountId) {
+        QueryWrapper<UserAllocation> userAllocationQueryWrapper = new QueryWrapper<>();
+        userAllocationQueryWrapper.eq("account_id", accountId);
+        userAllocationQueryWrapper.eq("media_id", "2");
+        userAllocationQueryWrapper.orderByDesc("create_time");
+        userAllocationQueryWrapper.last("limit 1");
+        UserAllocation userAllocation = userAllocationMapper.selectOne(userAllocationQueryWrapper);
+        if (!Check.isNull(userAllocation)) {
+            return batchMapper.getProjectMaxBidByProject(userAllocation.getProjectId());
+        }
+        return new BigDecimal(0);
+    }
+
+
+    /**
+     * 校验广告组名称是否重复
+     *
+     * @param campaignId
+     * @param unitName
+     * @return
+     */
+    @Autowired
+    private KuaiShouGroupMapper kuaiShouGroupMapper;
+
+    @Override
+    public Boolean checkUnitName(Long campaignId, String unitName) {
+        QueryWrapper<KuaiShouGroup> groupQueryWrapper = new QueryWrapper<>();
+        groupQueryWrapper.eq("campaign_id", campaignId);
+        groupQueryWrapper.eq("unit_name", unitName);
+        groupQueryWrapper.orderByDesc("create_time");
+        groupQueryWrapper.last("limit 1");
+        KuaiShouGroup kuaiShouGroup = kuaiShouGroupMapper.selectOne(groupQueryWrapper);
+        if (!Check.isNull(kuaiShouGroup)) {
+            return false;
+        }
+        return true;
+    }
+
+
+    /**
+     * 批量创建广告组
+     *
+     * @param requestJson
+     * @return
+     */
+    @Autowired
+    private ICtopOauthTokenService oauthTokenService;
+    @Autowired
+    private IKuaishouInterfaceService kuaishouInterfaceService;
+
+    @Override
+    public JSONObject createUnit(JSONObject requestJson) throws Exception {
+        System.err.println(requestJson);
+        Long accountId = requestJson.getLong("accountId");
+        CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
+        if (Check.isNull(oauthToken)) {
+            throw new Exception("未获取到账户信息");
+        }
+
+        Long campaignId = requestJson.getLong("campaignId");
+        if (Check.isNull(campaignId)) {
+            throw new Exception("请选择广告计划");
+        }
+
+        JSONObject unitJson = new JSONObject();
+        unitJson.put("campaign_id", campaignId);
+
+        // 资源位置
+        JSONArray scene_id = requestJson.getJSONArray("scene_id");
+        if (!Check.isNull(scene_id)) {
+            unitJson.put("scene_id", scene_id);
+        }
+
+        // 资源创作方式
+        if (!Check.isNull(requestJson.getInteger("unit_type"))) {
+            unitJson.put("unit_type", requestJson.getInteger("unit_type"));
+        }
+
+        //投放开始时间
+        if (!Check.isNull(requestJson.getString("begin_time"))) {
+            unitJson.put("begin_time", requestJson.getString("begin_time"));
+        }
+        // 投放结束时间
+        if (!Check.isNull(requestJson.getString("end_time"))) {
+            unitJson.put("end_time", requestJson.getString("end_time"));
+        }
+        // 投放时间段
+        if (!Check.isNull(requestJson.getString("schedule_time"))) {
+            unitJson.put("schedule_time", requestJson.getString("schedule_time"));
+        }
+        // 广告组单日预算
+        if (!Check.isNull(requestJson.getLong("day_budget"))) {
+            unitJson.put("day_budget", requestJson.getLong("day_budget"));
+        }
+        // url类型
+        if (!Check.isNull(requestJson.getInteger("url_type"))) {
+            unitJson.put("url_type", requestJson.getInteger("url_type"));
+        }
+        // url
+        if (!Check.isNull(requestJson.getString("url"))) {
+            unitJson.put("url", requestJson.getString("url"));
+        }
+        // appId
+        if (!Check.isNull(requestJson.getLong("appId"))) {
+            unitJson.put("app_id", requestJson.getLong("appId"));
+        }
+        // 创意展现方式
+        if (!Check.isNull(requestJson.getInteger("show_mode"))) {
+            unitJson.put("show_mode", requestJson.getInteger("show_mode"));
+        }
+        if (!Check.isNull(requestJson.getInteger("speed"))) {
+            unitJson.put("speed", requestJson.getInteger("speed"));
+        }
+
+
+        // -----------------用户定向-----------
+        JSONObject targetJson = new JSONObject();
+
+        // 地域
+        if (!Check.isNull(requestJson.getJSONArray("region"))) {
+            targetJson.put("region", requestJson.getJSONArray("region"));
+        }
+
+        // 自定义年龄段
+        JSONArray ageArr = requestJson.getJSONArray("age");
+        if (!Check.isNull(ageArr)) {
+            JSONObject ageJson = new JSONObject();
+            ageJson.put("min", ageArr.get(0));
+            ageJson.put("max", ageArr.get(1));
+            targetJson.put("age", ageJson);
+        }
+        // 固定年龄段
+        if (!Check.isNull(requestJson.getJSONArray("ages_range"))) {
+            targetJson.put("ages_range", requestJson.getJSONArray("ages_range"));
+        }
+        // 性别
+        if (!Check.isNull(requestJson.getInteger("gender"))) {
+            targetJson.put("gender", requestJson.getInteger("gender"));
+        }
+        //操作系统
+        if (!Check.isNull(requestJson.getInteger("platform_os"))) {
+            targetJson.put("platform_os", requestJson.getInteger("platform_os"));
+        }
+        //Android版本
+        if (!Check.isNull(requestJson.getInteger("android_osv"))) {
+            targetJson.put("android_osv", requestJson.getInteger("android_osv"));
+        }
+        // iOS版本
+        if (!Check.isNull(requestJson.getInteger("ios_osv"))) {
+            targetJson.put("ios_osv", requestJson.getInteger("ios_osv"));
+        }
+        //网络环境
+        if (!Check.isNull(requestJson.getInteger("network"))) {
+            targetJson.put("network", requestJson.getInteger("network"));
+        }
+        //设备品牌
+        if (!Check.isNull(requestJson.getJSONArray("device_brand"))) {
+            targetJson.put("device_brand", requestJson.getJSONArray("device_brand"));
+        }
+        //设备价格
+        if (!Check.isNull(requestJson.getJSONArray("device_price"))) {
+            targetJson.put("device_price", requestJson.getJSONArray("device_price"));
+        }
+        //商业兴趣类型
+        if (!Check.isNull(requestJson.getInteger("business_interest_type"))) {
+            targetJson.put("business_interest_type", requestJson.getInteger("business_interest_type"));
+        }
+        // 商业兴趣
+        if (!Check.isNull(requestJson.getJSONArray("business_interest"))) {
+            targetJson.put("business_interest", requestJson.getJSONArray("business_interest"));
+        }
+        //网红粉丝
+        if (!Check.isNull(requestJson.getJSONArray("fans_star"))) {
+            targetJson.put("fans_star", requestJson.getJSONArray("fans_star"));
+        }
+        //兴趣视频用户
+        if (!Check.isNull(requestJson.getJSONArray("interest_video"))) {
+            targetJson.put("interest_video", requestJson.getJSONArray("interest_video"));
+        }
+        // APP行为-按分类
+        if (!Check.isNull(requestJson.getJSONArray("app_interest"))) {
+            targetJson.put("app_interest", requestJson.getJSONArray("app_interest"));
+        }
+        // APP行为-按APP名称
+        if (!Check.isNull(requestJson.getJSONArray("app_ids"))) {
+            targetJson.put("app_ids", requestJson.getJSONArray("app_ids"));
+        }
+        // 人群包定向
+        if (!Check.isNull(requestJson.getJSONArray("population"))) {
+            targetJson.put("population", requestJson.getJSONArray("population"));
+        }
+        // 人群包排除
+        if (!Check.isNull(requestJson.getJSONArray("exclude_population"))) {
+            targetJson.put("exclude_population", requestJson.getJSONArray("exclude_population"));
+        }
+
+        JSONObject intelliExtendJson = new JSONObject();
+
+        // 开启智能扩量
+        if (!Check.isNull(requestJson.getInteger("is_open"))) {
+            intelliExtendJson.put("is_open", requestJson.getInteger("is_open"));
+        }
+        //不可突破年龄
+        if (!Check.isNull(requestJson.getInteger("no_age_break"))) {
+            intelliExtendJson.put("no_age_break", requestJson.getInteger("no_age_break"));
+        }
+        //不可突破性别
+        if (!Check.isNull(requestJson.getInteger("no_gender_break"))) {
+            intelliExtendJson.put("no_gender_break", requestJson.getInteger("no_gender_break"));
+        }
+        // 不可突破地域
+        if (!Check.isNull(requestJson.getInteger("no_area_break"))) {
+            intelliExtendJson.put("no_area_break", requestJson.getInteger("no_area_break"));
+        }
+        if (!Check.isNull(intelliExtendJson)) {
+            targetJson.put("intelli_extend", intelliExtendJson);
+        }
+
+        unitJson.put("target", targetJson);
+
+
+        JSONArray groupArr = requestJson.getJSONArray("groupArr");
+        if (Check.isNull(groupArr)) {
+            throw new Exception("请输入需要创建的广告组");
+        }
+
+
+        JSONObject returnJson = new JSONObject();
+        // 创建条数
+        returnJson.put("total", groupArr.size());
+        JSONArray successArr = new JSONArray();
+        JSONArray failArr = new JSONArray();
+
+        for (int i = 0; i < groupArr.size(); i++) {
+            JSONObject groupJson = groupArr.getJSONObject(i);
+            if (!Check.isNull(groupJson)) {
+                // 出价
+                if (!Check.isNull(groupJson.getLong("bid"))) {
+                    unitJson.put("bid", groupJson.getLong("bid"));
+                }
+                // 出价类型
+                if (!Check.isNull(groupJson.getInteger("bid_type"))) {
+                    unitJson.put("bid_type", groupJson.getInteger("bid_type"));
+                }
+                // 深度转化出价
+                if (!Check.isNull(groupJson.getLong("cpa_bid"))) {
+                    unitJson.put("cpa_bid", groupJson.getLong("cpa_bid"));
+                }
+                // 深度转化目标出价
+                if (!Check.isNull(groupJson.getLong("deep_conversion_bid"))) {
+                    unitJson.put("deep_conversion_bid", groupJson.getLong("deep_conversion_bid"));
+                }
+                // 深度转化目标
+                if (!Check.isNull(groupJson.getInteger("deep_conversion_type"))) {
+                    unitJson.put("deep_conversion_type", groupJson.getInteger("deep_conversion_type"));
+                }
+                // 优化目标
+                if (!Check.isNull(groupJson.getInteger("ocpx_action_type"))) {
+                    unitJson.put("ocpx_action_type", groupJson.getInteger("ocpx_action_type"));
+                }
+                String unitName = groupJson.getString("unitName");
+                if (!Check.isNull(unitName)) {
+                    unitJson.put("unit_name", unitName);
+                }
+
+                Map<String, Object> returnUnitMap = kuaishouInterfaceService.adUnitCreate(oauthToken.getAccessToken(), accountId, unitJson);
+                if (!Check.isNullMap(returnUnitMap)) {
+                    Integer code = (Integer) returnUnitMap.get("code");
+                    if (code == 0) {
+                        JSONObject successJson = new JSONObject();
+                        successJson.put("unit_id", returnUnitMap.get("unitId"));
+                        successJson.put("unit_name", unitName);
+                        successJson.put("scene_id", scene_id);
+                        successArr.add(successJson);
+                    } else {
+                        JSONObject failJson = new JSONObject();
+                        failJson.put("unit_name", unitName);
+                        failJson.put("failMessage", returnUnitMap.get("message"));
+                        failArr.add(failJson);
+                    }
+
+                }
+
+            }
+
+        }
+
+        returnJson.put("success", successArr);
+        returnJson.put("fail", failArr);
+        return returnJson;
+    }
+
 
 }
 

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

@@ -256,6 +256,9 @@ public class KuaiShouUpdateServiceImpl implements IKuaiShouUpdateService {
      * @param putStatus
      * @return
      */
+    @Autowired
+    private KuaiShouCampaignMapper kuaiShouCampaignMapper;
+
     @Override
     public Map<String, Object> updateCampaignStatus(String token, Long advertiserId, Long campaignId, int putStatus, String loginId) {
         Map<String, Object> returnMap = new HashMap<>();
@@ -294,7 +297,14 @@ public class KuaiShouUpdateServiceImpl implements IKuaiShouUpdateService {
                         log.info("修改广告计划状态本地记录添加成功,campaignId:{}", campaignId);
                     }
 
-                    interfaceService.getCampaign(token, advertiserId, campaignId);
+                    if (putStatus == 3) {
+                        Map<String, Object> deleteMap = new HashMap<>();
+                        deleteMap.put("account_id", advertiserId);
+                        deleteMap.put("campaign_id", campaignId);
+                        kuaiShouCampaignMapper.deleteByMap(deleteMap);
+                    } else {
+                        interfaceService.getCampaign(token, advertiserId, campaignId);
+                    }
                     returnMap.put("code", 0);
                     returnMap.put("success", true);
                     returnMap.put("message", "修改成功");

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

@@ -1013,7 +1013,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                         @Override
                         public void run() {
                             try {
-                                Thread.sleep(2 * 1000);
+                                Thread.sleep(1 * 1000);
                             } catch (InterruptedException e) {
                                 e.printStackTrace();
                             }
@@ -1076,6 +1076,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                     JSONObject dataJson = resultJson.getJSONObject("data");
                     if (!Check.isNull(dataJson)) {
                         Long unitId = dataJson.getLong("unit_id");
+                        getGroup(accessToken, advertiserId, unitId);
                         returnMap.put("code", 0);
                         returnMap.put("message", "success");
                         returnMap.put("unitId", unitId);

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

@@ -18,7 +18,16 @@
         ((sum(charge) / sum(form_count)) / #{discount}) afterFormPrice, -- 表单提交单价
         sum(activation) activationCount, -- 激活数
         (sum(charge) / sum(activation)) activationPrice, -- 激活单价
-        ((sum(charge) / sum(activation)) / #{discount}) afterActivationPrice -- 激活单价
+        ((sum(charge) / sum(activation)) / #{discount}) afterActivationPrice, -- 激活单价
+        sum(event_register) eventRegister, -- 注册数
+
+        (case
+        when sum(event_register) != 0
+        then (sum(charge) / sum(charge))
+        else 0
+        end
+        ) eventRegisterCost -- 注册成本
+
         from
         ctop_kuaishou_report_hourly_account
         where stat_date = #{date}
@@ -105,6 +114,15 @@
         (sum(charge) / sum(form_count)) formPrice, -- 表单提交单价
         sum(activation) activationCount, -- 激活数
         (sum(charge) / sum(activation)) activationPrice, -- 激活单价
+        sum(event_register) eventRegister, -- 注册数
+
+        (case
+        when sum(event_register) != 0
+        then (sum(charge) / sum(charge))
+        else 0
+        end
+        ) eventRegisterCost, -- 注册成本
+
         account_id accountId,
         (select auth_name from ctop_user_allocation where account_id = accountId limit 1) accountName
         from

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

@@ -480,7 +480,6 @@ public class AccountReportServiceImpl implements IAccountReportService {
                             chainRatioJson.put("beforeActivationPriceProportion", 0);
                         }
 
-
                         // 转化提交单价
                         BigDecimal nowAfterActivationPrice = nowAccountSummary.getBigDecimal("afterActivationPrice");
                         BigDecimal yesterdayAfterActivationPrice = yesterdayAccountSummary.getBigDecimal("afterActivationPrice");
@@ -495,8 +494,39 @@ public class AccountReportServiceImpl implements IAccountReportService {
                         } else {
                             chainRatioJson.put("afterActivationPriceProportion", 0);
                         }
+
+
+                        BigDecimal nowEventRegisterCost = nowAccountSummary.getBigDecimal("eventRegisterCost");  // 今日注册成本
+                        BigDecimal yesterdayEventRegisterCost = yesterdayAccountSummary.getBigDecimal("eventRegisterCost"); // 昨日注册成本
+                        if (!Check.isNull(nowEventRegisterCost) && !Check.isNull(yesterdayEventRegisterCost)) {
+                            if (yesterdayEventRegisterCost.compareTo(new BigDecimal(0)) != 0) {
+                                BigDecimal eventRegisterCostProportion = (nowEventRegisterCost.subtract(yesterdayEventRegisterCost)).divide(yesterdayEventRegisterCost, 4, RoundingMode.HALF_UP);
+                                chainRatioJson.put("eventRegisterCostProportion", eventRegisterCostProportion);
+                            } else {
+                                chainRatioJson.put("eventRegisterCostProportion", 0);
+                            }
+                        } else {
+                            chainRatioJson.put("eventRegisterCostProportion", 0);
+                        }
+
+
+                        BigDecimal nowEventRegister = nowAccountSummary.getBigDecimal("eventRegister");  // 今日注册数
+                        BigDecimal yesterdayEventRegister = yesterdayAccountSummary.getBigDecimal("eventRegister"); // 昨日注册数
+                        if (!Check.isNull(nowEventRegister) && !Check.isNull(yesterdayEventRegister)) {
+                            if (yesterdayEventRegister.compareTo(new BigDecimal(0)) != 0) {
+                                BigDecimal eventRegisterProportion = (nowEventRegister.subtract(yesterdayEventRegister)).divide(yesterdayEventRegister, 4, RoundingMode.HALF_UP);
+                                chainRatioJson.put("eventRegisterProportion", eventRegisterProportion);
+                            } else {
+                                chainRatioJson.put("eventRegisterProportion", 0);
+                            }
+                        } else {
+                            chainRatioJson.put("eventRegisterProportion", 0);
+                        }
+
+
                         returnJson.put("chainRatio", chainRatioJson);
                     }
+
                 }
             } else if (type == 2) {
                 queryMap.put("statDate", anotherDay);