Parcourir la source

Merge branch 'test' of http://git.tjyourong.com.cn/ctop/adsp-bytedance into test

huangxuechao il y a 4 ans
Parent
commit
1e1c4aeabc

+ 1 - 0
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/enums/BytedanceCreativeMatTypeEnum.java

@@ -15,6 +15,7 @@ public enum BytedanceCreativeMatTypeEnum {
 
     BYTEDANCE_CREATIVE_IMAGE_MODE_LARGE("CREATIVE_IMAGE_MODE_LARGE","1","大图横图"),
     BYTEDANCE_CREATIVE_IMAGE_MODE_LARGE_VERTICAL("CREATIVE_IMAGE_MODE_LARGE_VERTICAL","2","大图竖图"),
+    BYTEDANCE_CREATIVE_IMAGE_MODE_UNION_SPLASH("CREATIVE_IMAGE_MODE_UNION_SPLASH","3","开屏"),
     BYTEDANCE_CREATIVE_IMAGE_MODE_VIDEO("CREATIVE_IMAGE_MODE_VIDEO","2","横版视频"),
     BYTEDANCE_CREATIVE_IMAGE_MODE_VIDEO_VERTICAL("CREATIVE_IMAGE_MODE_VIDEO_VERTICAL","1","竖版视频");
 

+ 29 - 3
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/mapper/xml/ByteDanceVideoInfoMapper.xml

@@ -157,7 +157,15 @@
         'image' as materialType
         from ctop_bytedance_image_info image
         where account_id = #{accountId}
-        and image.type = #{imageMode}
+        <if test="imageMode = '1'">
+            and image.type = '1'
+        </if>
+        <if test="imageMode = '2'">
+            and (image.type = '2' or image.type = '4')
+        </if>
+        <if test="imageMode = '3'">
+            and (image.type = '3' or image.type = '4')
+        </if>
         and image.create_time &gt;= #{startTime}
         and image.create_time &lt;= #{endTime}
         having creativeCnt &lt;= #{creativeCnt}
@@ -188,7 +196,16 @@
         and report.stat_datetime &lt;= #{endTime}
         group by report.material_id
         order by sum(report.cost) desc ) a
-        left join (select distinct a.* from ctop_bytedance_image_info a where a.account_id = #{accountId} and a.type = #{imageMode})as image
+        left join (select distinct a.* from ctop_bytedance_image_info a where 1 = 1  and a.account_id = #{accountId}
+        <if test="imageMode = '1'">
+            and a.type = '1'
+        </if>
+        <if test="imageMode = '2'">
+            and (a.type = '2' or a.type = '4')
+        </if>
+        <if test="imageMode = '3'">
+            and (a.type = '3' or a.type = '4')
+        </if>)as image
         on a.material_id = image.material_id
         where 1=1
         and a.totalCost &gt; 500
@@ -221,7 +238,16 @@
         and report.stat_datetime &lt;= #{endTime}
         group by report.material_id
         order by sum(report.cost) desc) a
-        left join (select distinct a.* from ctop_bytedance_image_info a where a.account_id =#{accountId} and a.type = #{imageMode}) as image
+        left join (select distinct a.* from ctop_bytedance_image_info a where 1 = 1 and a.account_id =#{accountId}
+        <if test="imageMode = '1'">
+            and a.type = '1'
+        </if>
+        <if test="imageMode = '2'">
+            and (a.type = '2' or a.type = '4')
+        </if>
+        <if test="imageMode = '3'">
+            and (a.type = '3' or a.type = '4')
+        </if>) as image
         on a.material_id = image.material_id
         where 1=1
         and a.totalCost &lt;= 100

+ 6 - 6
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/service/impl/AiBytedanceAdvertiserStrategyServiceImpl.java

@@ -243,9 +243,9 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
                 }
                 dpIndex = adDplinkInfo.getDpLinkIndex();
                 // 超出下标范围
-                // 已创建计划 > 账户配置结束下标 || 已创建计划 > 结束下标 || 已创建计划 > 账户配置最大组个数 * 组下计划个数
-                if( dpIndex < strategy.getDpLinkStartIndex() || dpIndex > strategy.getDpLinkEndIndex() || dpIndex > strategy.getCampaignCnt()*strategy.getCampaignAdCnt()){
-                    log.info("此账户策略创建结束===已创建的计划超过了账户配置中dp链接结束下标===>账户id:{};策略id:{}", token.getAccountId(),strategy.getId());
+                // 已使用dp链接 < 账户配置结束下标 || 已使用dp链接 > 结束下标
+                if( dpIndex < strategy.getDpLinkStartIndex() || dpIndex > strategy.getDpLinkEndIndex()){
+                    log.info("此账户策略创建结束===已创建dp链接超过了限制===>账户id:{};策略id:{}", token.getAccountId(),strategy.getId());
                     return 0L;
                 }
                 //组名称
@@ -1091,7 +1091,7 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
         if(result.contains("{{序号}}")){
             //查询同素材类型当天已有计划数量
             int i = adDplinkInfoService.getDpLinkInfoCount(strategy.getAccountId(),strategy.getCreativeImageMode());
-            Long num = GetCampaignNum.getCampaignNameNum(strategy.getCampaignCnt(),strategy.getCampaignAdCnt(), i == 0 ? i+1 : i);
+            Long num = GetCampaignNum.getCampaignNameNum(strategy.getCampaignCnt(),strategy.getCampaignAdCnt(), i+1);
             result = result.replace("{{序号}}",String.valueOf(num));
         }
 
@@ -1158,7 +1158,7 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
      */
     private List<ByteDanceVideoInfo> getImageInfoByCreateType(Long projectId,AiBytedanceAdvertiserStrategy strategy, String startTime, String endTime, Integer createType, Long videoCnt) {
         //根据 imageMode 获取素材类型
-        //1-大图横图; 2-大图竖图
+        //1-大图横图; 2-大图竖图 3-开屏
         String imageMode = BytedanceCreativeMatTypeEnum.getNameByType(strategy.getCreativeImageMode());
         //1:上新素材 2:跑量素材 3:遗漏素材 4:打捞素材
         if(createType == 1||createType == 3){
@@ -1561,7 +1561,7 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
             log.info("{}当前时间内需要创建计划总数:{}", strategy.getAccountId(), unitNum);
             //查询当前账户创建自定义类型计划数量
             int unitCreateCnt = planService.queryToDayBuiltCount(strategy.getAccountId());
-            log.info("{}截止目前创建总数:{}", strategy.getAccountId(), unitCreateCnt);
+            log.info("{}截止目前创建计划总数:{}", strategy.getAccountId(), unitCreateCnt);
             long remindCnt = unitNum - unitCreateCnt;
             if (remindCnt >= 1) {
                 log.info("{}计划创建不足,剩余需要创建个数{},使用上新素材创建", strategy.getAccountId(), remindCnt);

+ 3 - 3
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/common/utils/GetCampaignNum.java

@@ -22,15 +22,15 @@ public class GetCampaignNum {
 
         Long zu = countNum / campaignAdCnt;
         Long yu = countNum % campaignAdCnt;
-        System.out.println("余---"+yu);
+        //System.out.println("余---"+yu);
         // 不能整除 有余数 则 组 = 商 + 1
         // 整除 组 = 商
         Long count = yu != 0 ? zu.intValue()+1 : zu;
        // 账户配置中的组数量 < 当前 组序号
         if (count.intValue() <= campaignCnt){
-            System.out.println("序号----------"+count);
+            System.out.println("序号----------"+count);
         }else {
-            System.out.println("序号-超过了最大值-----"+count);
+            System.out.println("序号-超过了规定的最大值-----"+count);
         }
         return count;
     }

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/bytedance/advertise/controller/AiBytedanceAdvertiserStrategyController.java

@@ -452,7 +452,7 @@ public class AiBytedanceAdvertiserStrategyController {
 	@GetMapping(value = "/getAdAudiencePackage")
 	public Result getAdAudiencePackage(@RequestParam(value = "accountId",required = false) String accountId,
 									   @RequestParam(value = "landingType",required = false) String landingType,
-									   @RequestParam(value = "deliveryRange",required = false,defaultValue = "DEFAULT") String deliveryRange) {
+									   @RequestParam(value = "deliveryRange",required = false) String deliveryRange) {
 		try {
 			if (Check.isNull(accountId)){
 				return Result.errorMsg("请选择账户。");