|
@@ -21,6 +21,8 @@ import javax.annotation.Resource;
|
|
|
import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
import java.nio.file.Files;
|
|
|
+import java.nio.file.Paths;
|
|
|
+import java.nio.file.StandardCopyOption;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.Comparator;
|
|
|
import java.util.Date;
|
|
@@ -50,6 +52,15 @@ public class OutProcessServiceImpl implements IOutProcessService {
|
|
|
if (!syncDir.endsWith(Constants.DIR_END)) {
|
|
|
syncDir += "/";
|
|
|
}
|
|
|
+ //获取外网同步备份目录
|
|
|
+ String bakDir = sysConfigService.selectConfigByKey("out.dir.bak");
|
|
|
+ if (!bakDir.endsWith(Constants.DIR_END)) {
|
|
|
+ bakDir += "/";
|
|
|
+ }
|
|
|
+
|
|
|
+ File bak = new File(bakDir);
|
|
|
+ bak.mkdirs();
|
|
|
+
|
|
|
String fgapInfo = sysConfigService.selectConfigByKey("out.fgap.info");
|
|
|
FtpUtil ftpUtil = JSONObject.parseObject(fgapInfo, FtpUtil.class);
|
|
|
try {
|
|
@@ -85,6 +96,9 @@ public class OutProcessServiceImpl implements IOutProcessService {
|
|
|
|
|
|
String status = "N";
|
|
|
if (flag && flag1) {
|
|
|
+ //移动文件到备份目录
|
|
|
+ Files.move(file.toPath(), Paths.get(bakDir + file.getName()), StandardCopyOption.REPLACE_EXISTING);
|
|
|
+ Files.move(zipFile.toPath(), Paths.get(bakDir + zipFile.getName()), StandardCopyOption.REPLACE_EXISTING);
|
|
|
status = "Y";
|
|
|
}
|
|
|
|