Forráskód Böngészése

账户配置列表-出价修改为拼接 最小~最大

yangzian 4 éve
szülő
commit
eae8dc060e

+ 3 - 0
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/entity/AiBytedanceAdvertiserStrategy.java

@@ -214,6 +214,9 @@ public class AiBytedanceAdvertiserStrategy{
 	private BigDecimal adBid;
 	/**目标转化出价*/
 	private BigDecimal adCpaBid;
+	//拼接 目标转化出价-前端展示
+	@TableField(exist = false)
+	private String adCpaBidStr;
 	/**深度优化方式*/
 	private String adDeepBidType;
 	/**深度优化出价*/

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

@@ -1269,6 +1269,9 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
         CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId);
         // 获取人群包列表
        Result list = marketingService.selectCustomAudience(token);
+       if (!list.isSuccess()){
+           return Result.errorMsg(list.getMessage());
+       }
         //List<Map<String,Object>> listMap = (List<Map<String, Object>>) list.getResult();
         JSONArray array =(JSONArray)list.getResult();
         List<Map<String,Object>> dataList = JSONArray.parseObject(array.toJSONString(),List.class);

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

@@ -26,6 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
+import java.math.BigDecimal;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
@@ -88,12 +89,17 @@ public class AiBytedanceAdvertiserStrategyController {
 				ruleDataAccountQueryWrapper.eq("account_id",pojo.getAccountId());
 				//获取消耗 余额
 				RuleDataAccount ruleDataAccountVo =  ruleDataAccountService.getOne(ruleDataAccountQueryWrapper);
-				if(null!=ruleDataAccountVo){
+				if (!Check.isNull(ruleDataAccountVo)){
 					//消耗
 					pojo.setCost(ruleDataAccountVo.getCost());
 					//余额
 					pojo.setValidBalance(ruleDataAccountVo.getValidBalance());
+				}else {
+					pojo.setCost(new BigDecimal(0));
+					pojo.setValidBalance(new BigDecimal(0));
 				}
+				//拼接 目标转化出价
+				pojo.setAdCpaBidStr("FIX".equalsIgnoreCase(pojo.getAdBidCreateType()) ? pojo.getAdCpaBid().toString() : (pojo.getAdMinBid() + "~" + pojo.getAdMaxBid()));
 			}
 
 
@@ -159,7 +165,7 @@ public class AiBytedanceAdvertiserStrategyController {
 		try {
 			aiBytedanceAdvertiserStrategyService.removeById(id);
 		} catch (Exception e) {
-			log.error("删除失败",e.getMessage());
+			log.error("删除失败",e);
 			return Result.error("删除失败!");
 		}
 		return Result.successMsg("删除成功!",null);
@@ -226,7 +232,7 @@ public class AiBytedanceAdvertiserStrategyController {
 		try {
 			return aiBytedanceAdvertiserStrategyService.updStaById(id,state,accountId);
 		}catch (Exception e){
-			log.error("修改状态(0开-1关)失败",e.getMessage());
+			log.error("修改状态(0开-1关)失败",e);
 			return Result.error("请求失败,请联系开发人员!");
 		}
 
@@ -238,7 +244,7 @@ public class AiBytedanceAdvertiserStrategyController {
 		try {
 			return aiBytedanceAdvertiserStrategyService.updStaOrCpaOrBudgetById(updAdStaOrCpaOrBudget);
 		}catch (Exception e){
-			log.error("修改出价-预算失败",e.getMessage());
+			log.error("修改出价-预算失败",e);
 			return Result.error("请求失败,请联系开发人员!");
 		}
 
@@ -250,7 +256,7 @@ public class AiBytedanceAdvertiserStrategyController {
 		try {
 			return aiBytedanceAdvertiserStrategyService.getIndustryList(accountId,type);
 		}catch (Exception e){
-			log.error("创建失败",e.getMessage());
+			log.error("创建失败",e);
 			return Result.error("请求失败,请联系开发人员!");
 		}
 	}
@@ -265,7 +271,7 @@ public class AiBytedanceAdvertiserStrategyController {
 		try {
 			return aiBytedanceAdvertiserStrategyService.getCampaignGroup(accountId,adGroupSearchVoList,pageNo,pageSize);
 		}catch (Exception e){
-			log.error("获取广告组异常。",e.getMessage());
+			log.error("获取广告组异常。",e);
 			return Result.error("请求失败,请联系开发人员!");
 		}
 	}
@@ -279,7 +285,7 @@ public class AiBytedanceAdvertiserStrategyController {
 		try {
 			return aiBytedanceAdvertiserStrategyService.getCampaignPlan(accountId,planSearchVoList,pageNo,pageSize);
 		}catch (Exception e){
-			log.error("获取广告计划异常。",e.getMessage());
+			log.error("获取广告计划异常。",e);
 			return Result.error("请求失败,请联系开发人员!");
 		}
 	}
@@ -290,7 +296,7 @@ public class AiBytedanceAdvertiserStrategyController {
 		try {
 			return aiBytedanceAdvertiserStrategyService.creativeReadInfo(accountId,adId);
 		}catch (Exception e){
-			log.error("获取广告组异常。",e.getMessage());
+			log.error("获取广告组异常。",e);
 			return Result.error("请求失败,请联系开发人员!");
 		}
 	}
@@ -303,7 +309,7 @@ public class AiBytedanceAdvertiserStrategyController {
 		try {
 			return aiBytedanceAdvertiserStrategyService.getToolConvert(adConvertQueryVo);
 		}catch (Exception e){
-			log.error("查询广告计划可用转化目标异常",e.getMessage());
+			log.error("查询广告计划可用转化目标异常",e);
 			return Result.error("请求失败,请联系开发人员!");
 		}
 	}
@@ -364,7 +370,7 @@ public class AiBytedanceAdvertiserStrategyController {
 			}
 			return Result.successMsg("根据下载链接获取应用包名成功", map);
 		}catch (Exception e){
-			log.error("根据下载链接获取应用包名异常",e.getMessage());
+			log.error("根据下载链接获取应用包名异常",e);
 			return Result.error("请求失败,请联系开发人员!");
 		}
 	}
@@ -378,7 +384,7 @@ public class AiBytedanceAdvertiserStrategyController {
 		try {
 			return aiBytedanceAdvertiserStrategyService.getAdActionText(accountId,landingType,advancedCreativeType);
 		}catch (Exception e){
-			log.error("获取行动号召异常",e.getMessage());
+			log.error("获取行动号召异常",e);
 			return Result.error("请求失败,请联系开发人员!");
 		}
 	}
@@ -394,7 +400,7 @@ public class AiBytedanceAdvertiserStrategyController {
 		try {
 			return aiBytedanceAdvertiserStrategyService.getAdAudiencePackage(accountId,landingType,deliveryRange);
 		}catch (Exception e){
-			log.error("获取行动号召异常",e.getMessage());
+			log.error("获取行动号召异常",e);
 			return Result.error("请求失败,请联系开发人员!");
 		}
 	}
@@ -406,7 +412,7 @@ public class AiBytedanceAdvertiserStrategyController {
 		try {
 			return aiBytedanceAdvertiserStrategyService.getDMPCustomAudience(accountId);
 		}catch (Exception e){
-			log.error("获取人群包列表异常",e.getMessage());
+			log.error("获取人群包列表异常",e);
 			return Result.error("请求失败,请联系开发人员!");
 		}
 	}