瀏覽代碼

自动投放-提升应用安装 收集销售线索

yumeng 4 年之前
父節點
當前提交
ab94066476

+ 12 - 8
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/AiKuaishouAdvertiserStrategyController.java

@@ -62,7 +62,7 @@ public class AiKuaishouAdvertiserStrategyController {
         QueryWrapper<AiKuaishouAdvertiserStrategy> queryWrapper = QueryGenerator.initQueryWrapper(aiKuaishouAdvertiserStrategy, req.getParameterMap());
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         String roleCode = sysRoleService.getRoleCodeByUserId(user.getId());
-        if(!CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN.equals(roleCode)){
+        if (!CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN.equals(roleCode)) {
             queryWrapper.eq("user_id", user.getId());
         }
         Page<AiKuaishouAdvertiserStrategy> page = new Page<>(pageNo, pageSize);
@@ -98,22 +98,25 @@ public class AiKuaishouAdvertiserStrategyController {
         try {
             Long accountId = aiKuaishouAdvertiserStrategy.getAccountId();
             AiKuaishouAdvertiserStrategy getEntity = aiKuaishouAdvertiserStrategyService.getByAccountId(accountId);
-            if(null!=getEntity){
+            if (null != getEntity) {
                 result.error500("该账户配置信息已经被创建");
                 return result;
             }
             UserAllocation allocation = allocationService.getByAccountId(accountId);
-            if(null!=allocation){
+            if (null != allocation) {
                 aiKuaishouAdvertiserStrategy.setUserId(allocation.getUserId());
             }
             aiKuaishouAdvertiserStrategy.setDescription(aiKuaishouAdvertiserStrategy.getDescription().trim());
             Integer singleAppId = aiKuaishouAdvertiserStrategy.getSingleAppid();
             if (null != singleAppId && singleAppId == 1) {
-                Integer appId = Integer.parseInt(JSONArray.parseArray(aiKuaishouAdvertiserStrategy.getAppIdArray()).getString(0));
-                aiKuaishouAdvertiserStrategy.setAppId(appId);
+                if (aiKuaishouAdvertiserStrategy.getCampaignType() == 2 || aiKuaishouAdvertiserStrategy.getCampaignType() == 7) {
+                    Integer appId = Integer.parseInt(JSONArray.parseArray(aiKuaishouAdvertiserStrategy.getAppIdArray()).getString(0));
+                    aiKuaishouAdvertiserStrategy.setAppId(appId);
+                }
+
             }
             aiKuaishouAdvertiserStrategyService.save(aiKuaishouAdvertiserStrategy);
-            Thread thread = new Thread(){
+            Thread thread = new Thread() {
                 @Override
                 public void run() {
                     kuaishouVideoRelateCreativesService.videoRelateCreatives(aiKuaishouAdvertiserStrategy.getAccountId());
@@ -127,6 +130,7 @@ public class AiKuaishouAdvertiserStrategyController {
         }
         return result;
     }
+
     /**
      * 编辑
      *
@@ -261,12 +265,12 @@ public class AiKuaishouAdvertiserStrategyController {
     }
 
     @GetMapping(value = "testCreate")
-    public Map<String,Object> testCreate(Long accountId){
+    public Map<String, Object> testCreate(Long accountId) {
         return aiKuaishouAdvertiserStrategyService.testCreate(accountId);
     }
 
     @GetMapping(value = "aiHistoricalMissingMaterial")
-    public Map<String,Object> aiHistoricalMissingMaterial(Long accountId){
+    public Map<String, Object> aiHistoricalMissingMaterial(Long accountId) {
         return aiKuaishouAdvertiserStrategyService.aiHistoricalMissingMaterial(accountId);
     }
 }