|
@@ -2276,18 +2276,20 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//打包zip 上传oss
|
|
//打包zip 上传oss
|
|
|
- String zipPath = zhiyuan + "/zhongzheng-admin/src/main/resources/"
|
|
|
|
|
- + String.format("%s预约考试%s.zip", DateUtils.timestampToDateFormat(bo.getApplySiteExamTime(), "yyyy-MM-dd"), DateUtils.getNowTime());
|
|
|
|
|
- FileUtils.toZip(zipPath, destDirPath, true);
|
|
|
|
|
|
|
+// String zipPath = zhiyuan + "/zhongzheng-admin/src/main/resources/"
|
|
|
|
|
+// + String.format("%s预约考试%s.zip", DateUtils.timestampToDateFormat(bo.getApplySiteExamTime(), "yyyy-MM-dd"), DateUtils.getNowTime());
|
|
|
|
|
+ String filename = FileUtils.encodingZipFilename("学员信息数据");
|
|
|
|
|
+ String zipFile = FileUtils.getZipAbsoluteFile(filename);
|
|
|
|
|
+ FileUtils.toZip(zipFile, destDirPath, true);
|
|
|
//上传oss
|
|
//上传oss
|
|
|
- OssRequest ossRequest = new OssRequest();
|
|
|
|
|
- ossRequest.setGradeId(0L);
|
|
|
|
|
- ossRequest.setUserId(0L);
|
|
|
|
|
- ossRequest.setImageStatus(7);
|
|
|
|
|
- File file1 = new File(zipPath);
|
|
|
|
|
- ossRequest.setFile(FileUtils.getMultipartFile(file1));
|
|
|
|
|
|
|
+// OssRequest ossRequest = new OssRequest();
|
|
|
|
|
+// ossRequest.setGradeId(0L);
|
|
|
|
|
+// ossRequest.setUserId(0L);
|
|
|
|
|
+// ossRequest.setImageStatus(7);
|
|
|
|
|
+// File file1 = new File(zipPath);
|
|
|
|
|
+// ossRequest.setFile(FileUtils.getMultipartFile(file1));
|
|
|
try {
|
|
try {
|
|
|
- String upload = ossService.upload(ossRequest);
|
|
|
|
|
|
|
+// String upload = ossService.upload(ossRequest);
|
|
|
//删除本地资源
|
|
//删除本地资源
|
|
|
Path pathStr = Paths.get(destDirPath);
|
|
Path pathStr = Paths.get(destDirPath);
|
|
|
try (Stream<Path> walk = Files.walk(pathStr)) {
|
|
try (Stream<Path> walk = Files.walk(pathStr)) {
|
|
@@ -2297,14 +2299,14 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
|
|
|
log.error("删除本地资源失败:" + DateUtils.getNowTime());
|
|
log.error("删除本地资源失败:" + DateUtils.getNowTime());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Path zipStr = Paths.get(zipPath);
|
|
|
|
|
- try (Stream<Path> walk = Files.walk(zipStr)) {
|
|
|
|
|
- walk.sorted(Comparator.reverseOrder())
|
|
|
|
|
- .forEach(FileUtils::deleteDirectoryStream);
|
|
|
|
|
- } catch (IOException e) {
|
|
|
|
|
- log.error("删除本地资源失败:" + DateUtils.getNowTime());
|
|
|
|
|
- }
|
|
|
|
|
- map.put("zip", AjaxResult.success(upload));
|
|
|
|
|
|
|
+// Path zipStr = Paths.get(zipPath);
|
|
|
|
|
+// try (Stream<Path> walk = Files.walk(zipStr)) {
|
|
|
|
|
+// walk.sorted(Comparator.reverseOrder())
|
|
|
|
|
+// .forEach(FileUtils::deleteDirectoryStream);
|
|
|
|
|
+// } catch (IOException e) {
|
|
|
|
|
+// log.error("删除本地资源失败:" + DateUtils.getNowTime());
|
|
|
|
|
+// }
|
|
|
|
|
+ map.put("zip", AjaxResult.success(filename));
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|