Kaynağa Gözat

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

huangxuechao 4 yıl önce
ebeveyn
işleme
8c605f3218

+ 1 - 1
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/dockapi/MarketingServiceImpl.java

@@ -524,7 +524,7 @@ public class MarketingServiceImpl implements MarketingService{
             log.error("广告计划更新状态接口异常==》accountId:{},message:{}", token.getAccountId(), jsonObject.getString("message"));
             return Result.error("广告计划更新状态接口异常");
         }
-        return Result.successMsg("广告状态修改成功",jsonObject.getString("data"));
+        return Result.successMsg("广告计划状态修改成功",jsonObject.getString("data"));
     }
 
 

+ 3 - 0
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/report/entity/vo/ReportCostVo.java

@@ -57,5 +57,8 @@ public class ReportCostVo implements Serializable {
     //操作状态
     private String optStatus;
 
+    //计划预算
+    private BigDecimal adBudget;
+
 
 }

+ 4 - 1
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/report/service/impl/BytedanceAdvertiserHourlyReportServiceImpl.java

@@ -124,7 +124,7 @@ public class BytedanceAdvertiserHourlyReportServiceImpl extends ServiceImpl<Byte
         strategyQueryWrapper.last("limit 1");
         AiBytedanceAdvertiserStrategy strategy = aiBytedanceAdvertiserStrategyMapper.selectOne(strategyQueryWrapper);
         //没有预算则使用上阶段花费
-        double accountBudget = Check.isNull(strategy) ? lastCost : strategy.getAccountBudget().doubleValue();
+        double accountBudget = Check.isNull(strategy) || strategy.getAccountBudget().intValue() == 0 ? lastCost : strategy.getAccountBudget().doubleValue();
         //花费占比
         double costShare = nowCost / accountBudget;
         resultMap.put("costShare",new Double(accountBudget).intValue() == 0 ? "0" : df.format(costShare));
@@ -325,6 +325,7 @@ public class BytedanceAdvertiserHourlyReportServiceImpl extends ServiceImpl<Byte
 
         }
 
+
         for (ReportCostVo reportCostVo : reportCostVoList) {
             reportCostVo.setCostStr(String.format("%.2f",reportCostVo.getCost()));
             //出价  ctop_bytedance_advertise_plan 广告计划信息表
@@ -335,6 +336,8 @@ public class BytedanceAdvertiserHourlyReportServiceImpl extends ServiceImpl<Byte
             ByteDanceAdvertisePlan planInfo = byteDanceAdvertisePlanMapper.selectOne(planQueryWrapper);
             reportCostVo.setCpaBid(Check.isNull(planInfo) ? "0" : String.format("%.2f",planInfo.getCpaBid()));
             reportCostVo.setBid(Check.isNull(planInfo) ? "0" : String.format("%.2f",planInfo.getBid()));
+            //广告预算 (修改出价不能大于广告计划预算)
+            reportCostVo.setAdBudget(Check.isNull(planInfo) ? new BigDecimal(0) : planInfo.getBudget());
 
             // 平均千次展显费用 = 总花费/展示数 * 1000
             double show = 0;

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

@@ -157,7 +157,7 @@ public class BytedanceReportController {
 			byteDanceAdvertisePlan.setBid(bid);
 			//更新 表 定向包id
 			byteDanceAdvertisePlanService.updatePlanOrPackage(byteDanceAdvertisePlan);
-			return Result.successMsg("修改bid成功。",null);
+			return Result.successMsg("修改出价成功。",null);
 		}catch (Exception e){
 			log.error("投放数据-更新计划出价-bid异常",e);
 			return Result.error("请求失败,请联系开发人员!");
@@ -201,7 +201,7 @@ public class BytedanceReportController {
 				byteDanceAdvertisePlanService.updatePlanOrPackage(byteDanceAdvertisePlan);
 			}
 
-			return Result.successMsg("修改cpaBid成功。",null);
+			return Result.successMsg("修改出价成功。",null);
 		}catch (Exception e){
 			log.error("投放数据-更新计划出价-cpaBid异常",e);
 			return Result.error("请求失败,请联系开发人员!");