lxw
2022-07-19 c52b51ba6024573ead2a7cd50c591dde44281ccd
src/main/java/com/whyc/service/FtpService.java
@@ -4,7 +4,6 @@
import com.whyc.dto.FileDirPath;
import com.whyc.dto.FtpHelper;
import com.whyc.dto.ZipUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
@@ -15,11 +14,8 @@
@Service
@EnableScheduling   // 2.开启定时任务
public class FtpService {
    @Autowired(required = false)
    private FtpHelper ftpHelper;
    //定时上传指定目录下文件
    @Scheduled(cron = "0/20 06 17 * * ?")
    @Scheduled(cron = "0/20 30 17 * * ?")
    private void sendFtpFile(){
        FtpHelper ftp = new FtpHelper(YamlProperties.ftpIp, YamlProperties.ftpPort, YamlProperties.ftpUserName, YamlProperties.ftpPassword);
        String fileDirName = FileDirPath.getFileDirName();