浏览代码

修改时间区间计算逻辑

songyh 3 年之前
父节点
当前提交
3d90f9170d

+ 2 - 1
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/service/IAiBytedanceAdvertiserStrategyService.java

@@ -9,6 +9,7 @@ import org.jeecg.modules.bytedance.advertise.vo.AdGroupSearchVo;
 import org.jeecg.modules.bytedance.advertise.vo.PlanSearchVo;
 import org.jeecg.modules.bytedance.common.entity.CtopOauthToken;
 
+import java.text.ParseException;
 import java.util.List;
 
 /**
@@ -28,7 +29,7 @@ public interface IAiBytedanceAdvertiserStrategyService extends IService<AiByteda
     Result updateADCreative(AiBytedanceAdvertiserStrategy strategy,String groupModifyTime,String planModifyTime);
 
 
-    Long createCreative(CtopOauthToken token, AiBytedanceAdvertiserStrategy strategy, Integer createType, Long videoCnt, String openUrl);
+    Long createCreative(CtopOauthToken token, AiBytedanceAdvertiserStrategy strategy, Integer createType, Long videoCnt, String openUrl) throws ParseException;
 
     /**
      * 头条 - 配置信息 修改 状态

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

@@ -33,6 +33,7 @@ import org.springframework.stereotype.Service;
 import javax.annotation.Resource;
 import javax.transaction.Transactional;
 import java.math.BigDecimal;
+import java.text.ParseException;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -79,7 +80,7 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
     IAiBytedanceAutocreateLogService iBytedanceAutocreateLogService;
 
     @Override
-    public Long createCreative(CtopOauthToken token, AiBytedanceAdvertiserStrategy strategy, Integer createType, Long videoCnt, String openUrl) {
+    public Long createCreative(CtopOauthToken token, AiBytedanceAdvertiserStrategy strategy, Integer createType, Long videoCnt, String openUrl) throws ParseException {
         UserAllocation userAllocation = userAllocationService.getByAccountId(strategy.getAccountId());
         if(null == userAllocation||userAllocation.getAccountStatus()!=0){
             log.info("此账户不存在或者已经被关闭=>accountId:{}", token.getAccountId());
@@ -90,14 +91,14 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
         //查询相应的素材信息
         Long timeStart = BytedanceCreativeMatTypeEnum.getStartTimeByType(createType.toString());
         Long timeEnd = BytedanceCreativeMatTypeEnum.getEndTimeByType(createType.toString());
-        Long now = System.currentTimeMillis();
         String startTime = DateUtils.formatDate()+" 00:00:00";
         String endTime = DateUtils.formatDate()+" 23:59:59";
+        Long endTimestamp = DateUtils.parseDate(endTime,"yyyy-MM-dd hh:mm:ss").getTime();
         if(timeStart != 0){
-            startTime = DateUtils.formatDateTime(now + timeStart * 60 * 1000L);
+            startTime = DateUtils.formatDateTime(endTimestamp + timeStart * 60 * 1000L);
         }
         if(timeEnd != 0){
-            endTime = DateUtils.formatDateTime(now + timeEnd * 60 * 1000L);
+            endTime = DateUtils.formatDateTime(endTimestamp + timeEnd * 60 * 1000L);
         }
         List<ByteDanceVideoInfo> videoInfos = getvideoOrImageInfoByCreateType(userAllocation.getProjectId(),strategy,startTime,endTime,createType,videoCnt);
         if(null == videoInfos||videoInfos.isEmpty()){

+ 10 - 24
jeecg-boot-module-system/src/main/resources/jeecg/jeecg_database.properties

@@ -1,27 +1,13 @@
 #mysql
+#diver_name=com.mysql.jdbc.Driver
+#url=jdbc:mysql://localhost:3306/jeecg-boot?useUnicode=true&characterEncoding=UTF-8
+#username=root
+#password=root
+#database_name=jeecg-boot
+
+#\u5E94\u7528\u5C42\u6570\u4ED3
 diver_name=com.mysql.jdbc.Driver
-url=jdbc:mysql://localhost:3306/jeecg-boot?useUnicode=true&characterEncoding=UTF-8
+url=jdbc:mysql://192.168.1.187:4000/application?characterEncoding=UTF-8&useUnicode=true&useSSL=false
 username=root
-password=root
-database_name=jeecg-boot
-
-#oracle
-#diver_name=oracle.jdbc.driver.OracleDriver
-#url=jdbc:oracle:thin:@192.168.1.200:1521:ORCL
-#username=scott
-#password=tiger
-#database_name=ORCL
-
-#postgre
-#diver_name=org.postgresql.Driver
-#url=jdbc:postgresql://localhost:5432/jeecg
-#username=postgres
-#password=postgres
-#database_name=jeecg
-
-#SQLServer2005\u4ee5\u4e0a
-#diver_name=org.hibernate.dialect.SQLServerDialect
-#url=jdbc:sqlserver://192.168.1.200:1433;DatabaseName=jeecg
-#username=sa
-#password=SA
-#database_name=jeecg
+password=hcst@2021
+database_name=application