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

修改自定义上新状态判定条件

syh 4 éve
szülő
commit
8fa18e7e08

+ 14 - 13
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouAiCreativeJob.java

@@ -4,7 +4,6 @@ import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.HttpUtils2;
 import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAdvertiserStrategy;
 import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouAdvertiserStrategyService;
-import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouCreateCreativeService;
 import com.alibaba.fastjson.JSONObject;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import lombok.extern.slf4j.Slf4j;
@@ -72,20 +71,22 @@ public class KuaishouAiCreativeJob {
             String url = "http://api.tjyourong.com.cn/jeecg-boot/ai/create/kuaishouCustomCreativeSupplement";
             int hour = DateUtils.getNowHour();
             for (AiKuaishouAdvertiserStrategy strategy : strategies) {
-                Map<String, Object> requestMap = new HashMap<>();
-                requestMap.put("id", strategy.getId());
-                requestMap.put("hour", hour);
-                String result = HttpUtils2.httpGet(url, requestMap, null);
-                JSONObject jsonObject = JSONObject.parseObject(result);
-                if (!Check.isNull(jsonObject)) {
-                    Integer code = jsonObject.getInteger("code");
-                    if (code == 0) {
-                        log.info("快手创意补充异步执行中,accountId:{}", strategy.getAccountId());
+                if (null != strategy.getOpenProgramCreate() && strategy.getOpenProgramCreate() != 1) {
+                    Map<String, Object> requestMap = new HashMap<>();
+                    requestMap.put("id", strategy.getId());
+                    requestMap.put("hour", hour);
+                    String result = HttpUtils2.httpGet(url, requestMap, null);
+                    JSONObject jsonObject = JSONObject.parseObject(result);
+                    if (!Check.isNull(jsonObject)) {
+                        Integer code = jsonObject.getInteger("code");
+                        if (code == 0) {
+                            log.info("快手创意补充异步执行中,accountId:{}", strategy.getAccountId());
+                        } else {
+                            log.error("快手创意补充异步执行失败,accountId:{}", strategy.getAccountId());
+                        }
                     } else {
-                        log.error("快手创意补充异步执行失败,accountId:{}", strategy.getAccountId());
+                        log.error("快手创意补充返回结果为空,accountId:{}", strategy.getAccountId());
                     }
-                } else {
-                    log.error("快手创意补充返回结果为空,accountId:{}", strategy.getAccountId());
                 }
             }