Browse Source

优化:任务配置。

lym 9 months ago
parent
commit
5014f0b47d

+ 1 - 1
src/main/java/com/hywa/banktest/bankframework/schedule/TransSchedule.java

@@ -137,7 +137,7 @@ public class TransSchedule {
 		}
 	}
 
-	@Scheduled(cron = "0 0/5 * * * ?")
+	@Scheduled(cron = "0 0/5 5-23 * * ?")
 	public void checkClearFile(){
 		log.info("--->开始调度文件了啊");
 		String checkTime = DateUtils.formatDate(new Date(),DateUtils.DEFAULT_FORMAT);

+ 7 - 0
src/main/java/com/hywa/banktest/bankframework/utils/FtpUtil.java

@@ -38,6 +38,12 @@ public class FtpUtil {
 		ftpClient.setControlEncoding("utf-8");
 		try {
 			ftpClient.connect(hostname, port);
+			//设置连接连接超时时间
+			ftpClient.setConnectTimeout(4*1000);
+			//设置连接时间读取超时时间
+			ftpClient.setDefaultTimeout(4*1000);
+			//设置数据读取超时的时间
+			ftpClient.setDataTimeout(4*1000);
 			ftpClient.login(username, password);
 			int replyCode = ftpClient.getReplyCode();
 			if (!FTPReply.isPositiveCompletion(replyCode)) {
@@ -242,6 +248,7 @@ public class FtpUtil {
 				}
 			} catch (Exception e) {
 				e.printStackTrace();
+				closeFtpClient(ftpClient);
 				return localNewFiles;
 			}
 

+ 2 - 1
src/main/resources/mappers/clearing/ClearingRecordMapper.xml

@@ -35,7 +35,8 @@
         <![CDATA[
            AND aa.clearing_timed<= CONCAT(#{checkTime},' 23:59:59')
         ]]> -->
-
+        <!-- 2023年中旬发现银行有遗漏回盘文件,2022年前的未回盘文件银行不能提供了 -->
+        AND aa.bank_clearing_file >= "20220101qut001.txt"
     order by aa.bank_clearing_file desc
       
   </select>