| | |
| | | */ |
| | | private static final int DEFAULT_HOUR = 0; |
| | | |
| | | @Scheduled(cron = "${task.cron.machine_rec_move:0 3 * * * ?}") |
| | | //@Scheduled(cron = "${task.cron.machine_rec_move:0 3 * * * ?}") |
| | | /* |
| | | public void execute() { |
| | | String networkType = paramService.getParamValue(ParamService.NETWORK_TYPE,ParamService.NETWORK_TYPE_SHEMI); |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 扫描数据库记录,超时则移动文件 |
| | | */ |
| | | |
| | | public void moveValidateFiles() { |
| | | List<Machine> machines = machineService.getEnableMachines(); |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | for (Machine machine : machines) { |
| | | int remainHours = machine.getReceiveDirExpiryHours() != null ?machine.getReceiveDirExpiryHours():DEFAULT_HOUR; |
| | | /*if(remainHours == 0){ |
| | | continue; |
| | | }*/ |
| | | |
| | | //LocalDateTime earlyTime = now.minusHours(remainHours); |
| | | List<MachineFile> pendingFiles = this.machineFileService.lambdaQuery() |
| | | .eq(MachineFile::getDirType,MachineFile.DIR_TYPE_REC) |
| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 文件移动到temp |
| | | * @param overTimeFile |
| | | */ |
| | | private void moveFileToTemp(MachineFile overTimeFile,Machine machine) throws IOException { |
| | | String srcFilepath = MachineFileService.getBasePath(machine,overTimeFile.getDirType())+ File.separator+overTimeFile.getName(); |
| | | Path source = Paths.get(srcFilepath); |
| | |
| | | // 使用 REPLACE_EXISTING 选项来覆盖已存在的文件 |
| | | Files.move(source, target, StandardCopyOption.REPLACE_EXISTING); |
| | | } |
| | | */ |
| | | } |