Explorar o código

Merge branch 'master' of http://git.tjyourong.com.cn/ctop/adsp-boot

zhaoxian %!s(int64=4) %!d(string=hai) anos
pai
achega
5a958f0157

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 55 - 87
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java


+ 4 - 1
module-alarm/src/main/java/cn/com/ctop/alarm/modules/service/impl/RuleAccountTemplateServiceImpl.java

@@ -37,7 +37,7 @@ public class RuleAccountTemplateServiceImpl extends ServiceImpl<RuleAccountTempl
     private IRuleAccountThresholdService ruleAccountThresholdService;
 
     /**
-     * 推送模板到账
+     * 推送模板到账
      *
      * @param accountId
      * @param templateId
@@ -95,6 +95,9 @@ public class RuleAccountTemplateServiceImpl extends ServiceImpl<RuleAccountTempl
                 threshold.setAccountId(accountId);
                 threshold.setGroupId(groupId);
                 threshold.setRuleId(ruleBase.getId());
+                if (ruleBase.getVariableType() == 0) {
+                    threshold.setThreshold(ruleBase.getThreshold());
+                }
                 if (isCopy == 1) {
                     threshold.setBatchNo(batchId);
                 }

+ 6 - 20
module-alarm/src/main/java/cn/com/ctop/alarm/modules/service/impl/RuleGroupServiceImpl.java

@@ -1,20 +1,8 @@
 package cn.com.ctop.alarm.modules.service.impl;
 
 import cn.com.ctop.alarm.modules.constant.MatchLogic;
-import cn.com.ctop.alarm.modules.entity.AlarmEventSend;
-import cn.com.ctop.alarm.modules.entity.RuleAccountTemplate;
-import cn.com.ctop.alarm.modules.entity.RuleAccountThreshold;
-import cn.com.ctop.alarm.modules.entity.RuleBase;
-import cn.com.ctop.alarm.modules.entity.RuleGroup;
-import cn.com.ctop.alarm.modules.entity.RuleIndicator;
-import cn.com.ctop.alarm.modules.entity.RuleTemplate;
-import cn.com.ctop.alarm.modules.mapper.AlarmEventSendMapper;
-import cn.com.ctop.alarm.modules.mapper.RuleAccountTemplateMapper;
-import cn.com.ctop.alarm.modules.mapper.RuleAccountThresholdMapper;
-import cn.com.ctop.alarm.modules.mapper.RuleBaseMapper;
-import cn.com.ctop.alarm.modules.mapper.RuleGroupMapper;
-import cn.com.ctop.alarm.modules.mapper.RuleIndicatorMapper;
-import cn.com.ctop.alarm.modules.mapper.RuleTemplateMapper;
+import cn.com.ctop.alarm.modules.entity.*;
+import cn.com.ctop.alarm.modules.mapper.*;
 import cn.com.ctop.alarm.modules.service.IRuleAccountTemplateService;
 import cn.com.ctop.alarm.modules.service.IRuleGroupService;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
@@ -36,12 +24,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.StringJoiner;
-import java.util.UUID;
+import java.util.*;
 
 /**
  * 规则组
@@ -791,6 +774,9 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
                                     continue;
                                 }
                                 RuleAccountThreshold threshold = new RuleAccountThreshold();
+                                if (ruleBase.getVariableType() == 0) {
+                                    threshold.setThreshold(ruleBase.getThreshold());
+                                }
                                 threshold.setAccountId(accountId);
                                 if (isCopy == 1) {
                                     threshold.setBatchNo(batchId);

+ 1 - 2
module-common/src/main/java/cn/com/ctop/common/module/entity/RuleDataTarget.java

@@ -31,9 +31,8 @@ public class RuleDataTarget {
 	private Long planId;
 	private String planName;
 	/**retargetingTagsExclude*/
-	@Excel(name = "retargetingTagsExclude", width = 15)
-    @ApiModelProperty(value = "retargetingTagsExclude")
 	private String retargetingTagsExclude;
+	private String retargetingTagsInclude;
 	/**hideIfExists*/
 	@Excel(name = "hideIfExists", width = 15)
     @ApiModelProperty(value = "hideIfExists")

+ 11 - 3
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/ByteDancePlanRuleDataJob.java

@@ -11,6 +11,9 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.util.Date;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
 
 @Component
 public class ByteDancePlanRuleDataJob {
@@ -18,16 +21,21 @@ public class ByteDancePlanRuleDataJob {
     private ICtopOauthTokenService tokenService;
     @Autowired
     private IReportService reportService;
+    private ExecutorService executorService = Executors.newFixedThreadPool(10);
 
-    @XxlJob("bytedancePlanLoadJob")
+    @XxlJob("bytedancePlanRuleLoadJob")
     public ReturnT<String> execute(String param) throws Exception {
         Date date = new Date();
         if(null!=param&&!"".equals(param.trim())){
             Long accountId = Long.parseLong(param);
             CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
             reportService.getAdvertiserPlanRuleData(token,date,date,CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+            XxlJobLogger.log("头条计划数据清洗完成:accountId=>{}",param);
+            return ReturnT.SUCCESS;
+        }else{
+            List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
+            tokens.forEach(token -> executorService.submit(()->reportService.getAdvertiserPlanRuleData(token,date,date,CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY)));
+            return ReturnT.SUCCESS;
         }
-        XxlJobLogger.log("头条计划数据清洗完成:accountId=>{}",param);
-        return ReturnT.SUCCESS;
     }
 }

+ 12 - 7
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/RuleDataAccountCleanJob.java

@@ -3,6 +3,8 @@ package cn.com.ctop.job.bytedance.handler;
 /**
  *  Created by JQ.bi on 2020.11.16
  */
+
+import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.toutiao.modules.report.service.IRuleByteDanceAccountService;
 import com.xxl.job.core.biz.model.ReturnT;
@@ -11,6 +13,7 @@ import com.xxl.job.core.log.XxlJobLogger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import java.util.List;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
@@ -23,18 +26,20 @@ public class RuleDataAccountCleanJob {
     @Autowired
     private IRuleByteDanceAccountService ruleByteDanceAccountService;
 
-    private ExecutorService executorPool = Executors.newFixedThreadPool(6);
+    private ExecutorService executorService = Executors.newFixedThreadPool(10);
 
     @XxlJob("ruleDataAccountCleanJob")
     public ReturnT<String> execute(String param) throws Exception {
         XxlJobLogger.log("规则预警账户维度数据开始清洗");
         if (null == param || "".equals(param.trim())) {
-            XxlJobLogger.log("参数异常");
-            return ReturnT.FAIL;
+            List<CtopOauthToken> tokens = oauthTokenService.selectToutiaoToken();
+            tokens.forEach(token -> executorService.submit(()->ruleByteDanceAccountService.cleanRuleDataAccount(token.getAccountId())));
+            return ReturnT.SUCCESS;
+        }else{
+            Long accountId = Long.parseLong(param);
+            ruleByteDanceAccountService.cleanRuleDataAccount(accountId);
+            XxlJobLogger.log("规则预警账户维度数据清洗结束");
+            return ReturnT.SUCCESS;
         }
-        Long accountId = Long.parseLong(param);
-        ruleByteDanceAccountService.cleanRuleDataAccount(accountId);
-        XxlJobLogger.log("规则预警账户维度数据清洗结束");
-        return ReturnT.SUCCESS;
     }
 }

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouAgentAccount.java

@@ -30,7 +30,7 @@ public class KuaishouAgentAccount {
 	@TableId(type = IdType.INPUT)
     @ApiModelProperty(value = "id")
 	@JsonProperty("accountId")
-	private Integer id;
+	private Long id;
 	/**accountId*/
 	@Excel(name = "userId", width = 15)
     @ApiModelProperty(value = "userId")

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

@@ -199,6 +199,7 @@ public class ReportServiceImpl implements IReportService {
                 JSONObject audienceObject = JSONObject.parseObject(plan.getAudience());
                 target.setAccountId(token.getAccountId());
                 target.setAccountName(allocation.getAuthName());
+                target.setDeepBidType(plan.getDeepBidType());
                 target.setPlanId(ruleDataPlan.getPlanId());
                 target.setId(ruleDataPlan.getPlanId());
                 target.setCreateTime(new Date());
@@ -206,6 +207,9 @@ public class ReportServiceImpl implements IReportService {
                 if(null!=audienceObject.getString("retargeting_tags_exclude")){
                     target.setRetargetingTagsExclude(audienceObject.getString("retargeting_tags_exclude"));
                 }
+                if(null!=audienceObject.getString("retargeting_tags_include")){
+                    target.setRetargetingTagsInclude(audienceObject.getString("retargeting_tags_include"));
+                }
                 target.setHideIfConverted(plan.getHideIfConverted());
                 target.setHideIfExists(plan.getHideIfExists());
 
@@ -244,7 +248,7 @@ public class ReportServiceImpl implements IReportService {
     private void formatCreativeData(JSONObject detail, UserAllocation allocation, RuleDataPlan plan) {
         //广告来源
         String source = detail.getString("source");
-        Integer isPresentedVideo = detail.getInteger("is_presented_video");
+        Integer isPresentedVideo = detail.getInteger("isPresentedVideo");
         JSONArray creatives = detail.getJSONArray("creatives");
         if(null!=creatives&&!creatives.isEmpty()){
             for(int i=0;i<creatives.size();i++){