|
@@ -1,5 +1,6 @@
|
|
|
package com.jiayue.biz.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.util.ZipUtil;
|
|
|
import cn.hutool.db.handler.StringHandler;
|
|
|
import cn.hutool.http.HttpResponse;
|
|
|
import cn.hutool.poi.excel.ExcelReader;
|
|
@@ -70,6 +71,25 @@ public class ProjectProgressServiceImpl implements ProjectProgressService {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ //下载附件
|
|
|
+ public void downloadAttachmentFile(HttpServletResponse response, String id) {
|
|
|
+ File projectProgressDirFileNew = new File(projectProgressDir + id + File.separator + projectProgressAttachment);
|
|
|
+ if (!projectProgressDirFileNew.exists()) {
|
|
|
+ projectProgressDirFileNew.mkdirs();
|
|
|
+ }
|
|
|
+ File zip = ZipUtil.zip(projectProgressDirFileNew);
|
|
|
+
|
|
|
+ if (zip.exists()) {
|
|
|
+ com.jiayue.biz.util.FileUtil.downloadFile(zip, response);
|
|
|
+ cn.hutool.core.io.FileUtil.del(zip);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 保存附件
|
|
@@ -197,8 +217,12 @@ public class ProjectProgressServiceImpl implements ProjectProgressService {
|
|
|
//最终List
|
|
|
List<ProjectProgress> projectProgresses = this.selectProProjectInfo();
|
|
|
List<ProjectProgress> progressList = projectProgresses.stream().filter(p -> p.getProjectId().equals(id)).collect(Collectors.toList());
|
|
|
- ProjectProgress projectProgress = progressList.get(0);
|
|
|
-// ProjectProgress projectProgress = new ProjectProgress();
|
|
|
+ ProjectProgress projectProgress = new ProjectProgress();
|
|
|
+ projectProgress.setId(UUID.randomUUID().toString());
|
|
|
+ projectProgress.setProjectId(id);
|
|
|
+ if(progressList.size() != 0){
|
|
|
+ projectProgress= progressList.get(0);
|
|
|
+ }
|
|
|
projectProgress.setProjectMenusOneList(projectMenusOneList);
|
|
|
|
|
|
mongoTemplate.save(projectProgress, "project_progress");
|