Parcourir la source

修改计划预算

yangzian il y a 3 ans
Parent
commit
7e0a3412ef

+ 5 - 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java

@@ -130,7 +130,9 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/eoaSocket/**","anon");//我的聊天
 
         //filterChainDefinitionMap.put("/advertiser/aiBytedanceAdvertiserStrategy/**","anon");//
-        filterChainDefinitionMap.put("/advertiser/**","anon");//
+        filterChainDefinitionMap.put("/sys/user/**","anon");//
+
+        //filterChainDefinitionMap.put("/advertiser/**","anon");//
         filterChainDefinitionMap.put("/file/**","anon");//
 
         //获取计划和素材维度的审核建议数据
@@ -138,6 +140,8 @@ public class ShiroConfig {
 
         filterChainDefinitionMap.put("/sys/dict/**","anon");//
 
+        filterChainDefinitionMap.put("/advertiser/bytedanceReportController/updateADCpaBid","anon");//
+
         //性能监控  TODO 存在安全漏洞泄露TOEKN(durid连接池也有)
         filterChainDefinitionMap.put("/actuator/**", "anon");
 

+ 6 - 0
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/mapper/xml/ByteDanceAdvertisePlanMapper.xml

@@ -48,6 +48,12 @@
             <if test="scheduleTime != null and scheduleTime!=''">
                 schedule_time = #{scheduleTime},
             </if>
+            <if test="budgetMode != null and budgetMode!=''">
+                budget_mode = #{budgetMode},
+            </if>
+            <if test="budget != null and budget!=''">
+                budget = #{budget},
+            </if>
         </set>
         where id = #{id}
     </update>

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

@@ -163,12 +163,14 @@ public class BytedanceReportController {
 	}
 
 
-	@ApiOperation(value="投放数据-更新计划出价-cpaBid", notes="投放数据-更新计划出价")
+	@ApiOperation(value="投放数据-更新计划出价-cpaBid-计划预算", notes="投放数据-更新计划出价-计划预算")
 	@GetMapping(value = "/updateADCpaBid")
 	public Result updateADCpaBid(@RequestParam("accountId") String accountId,
 									@RequestParam("adId") String adId,
-									@RequestParam("cpaBid") BigDecimal cpaBid,
-									@RequestParam("adScheduleTime") String adScheduleTime) {
+									@RequestParam(value = "cpaBid",required = false) BigDecimal cpaBid,
+									@RequestParam(value = "adScheduleTime",required = false) String adScheduleTime,
+									//@RequestParam(value = "budgetMode",required = false) String budgetMode,
+									@RequestParam(value = "budget",required = false) Integer budget) {
 		try {
 			CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId);
 			PlanSearchVo planSearchVo = new PlanSearchVo();
@@ -191,6 +193,8 @@ public class BytedanceReportController {
 				strategy.setAccountId(Long.valueOf(accountId));
 				strategy.setAdCpaBid(cpaBid);
 				strategy.setAdScheduleTime(adScheduleTime);
+				//strategy.setAdBudgetMode(budgetMode);
+				strategy.setAdBudget(budget);
 				//3 修改广告计划 中的 cpaBid
 				Result resultUpd = marketingService.updateAdvertiserPlan(token,adId,modifyTime,strategy);
 				if (!resultUpd.isSuccess()){
@@ -200,13 +204,15 @@ public class BytedanceReportController {
 				byteDanceAdvertisePlan.setId(Long.valueOf(adId));
 				byteDanceAdvertisePlan.setCpaBid(cpaBid);
 				byteDanceAdvertisePlan.setScheduleTime(adScheduleTime);
+				//byteDanceAdvertisePlan.setBudgetMode(budgetMode);
+				byteDanceAdvertisePlan.setBudget(Check.isNull(budget) ? null : new BigDecimal(budget));
 				//更新 表 bid || 定向包id || 状态
 				byteDanceAdvertisePlanService.updatePlanOrPackage(byteDanceAdvertisePlan);
 			}
 
 			return Result.successMsg("修改出价成功。",null);
 		}catch (Exception e){
-			log.error("投放数据-更新计划出价-cpaBid异常",e);
+			log.error("投放数据-更新计划出价-cpaBid-计划预算异常",e);
 			return Result.error("请求失败,请联系开发人员!");
 		}
 	}