|
@@ -16,6 +16,10 @@ import com.jeeplus.modules.filing.approvalStage.mapper.EarlyStageMapper;
|
|
|
import com.jeeplus.modules.filing.approvalStage.mapper.StudyStageMapper;
|
|
|
import com.jeeplus.modules.filing.basicInformation.entity.BasicInformation;
|
|
|
import com.jeeplus.modules.filing.basicInformation.mapper.BasicInformationMapper;
|
|
|
+import com.jeeplus.modules.filing.earlyEngineering.entity.DesignStage;
|
|
|
+import com.jeeplus.modules.filing.earlyEngineering.entity.ReviewStage;
|
|
|
+import com.jeeplus.modules.filing.earlyEngineering.mapper.DesignStageMapper;
|
|
|
+import com.jeeplus.modules.filing.earlyEngineering.mapper.ReviewStageMapper;
|
|
|
import com.jeeplus.modules.filing.filingImages.entity.FilingImages;
|
|
|
import com.jeeplus.modules.filing.filingImages.mapper.FilingImagesMapper;
|
|
|
import com.jeeplus.modules.filing.filingImages.utils.ZipCompressUtil;
|
|
@@ -56,6 +60,12 @@ public class FilingImagesService extends CrudService<FilingImagesMapper, FilingI
|
|
|
@Autowired
|
|
|
private StudyStageMapper studyStageMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private DesignStageMapper designStageMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ReviewStageMapper reviewStageMapper;
|
|
|
+
|
|
|
public List<FilingImages> findByProjectId(String id) {
|
|
|
return mapper.findByProjectId(id);
|
|
|
}
|
|
@@ -72,7 +82,7 @@ public class FilingImagesService extends CrudService<FilingImagesMapper, FilingI
|
|
|
long timeMillis = System.currentTimeMillis();
|
|
|
String fileLocality = "项目附件_" + timeMillis;
|
|
|
//判定当前系统
|
|
|
- String path = Global.getAttachmentDir2();
|
|
|
+ String path = Global.getPath();
|
|
|
path = path + "/" + fileLocality;
|
|
|
//检查该路径对应的目录是否存在. 如果不存在则创建目录
|
|
|
File dir = new File(path);
|
|
@@ -130,7 +140,7 @@ public class FilingImagesService extends CrudService<FilingImagesMapper, FilingI
|
|
|
long timeMillis = System.currentTimeMillis();
|
|
|
String fileLocality = "项目附件_" + timeMillis;
|
|
|
//判定当前系统
|
|
|
- String path = Global.getAttachmentDir2();
|
|
|
+ String path = Global.getPath();
|
|
|
path = path + "/" + fileLocality;
|
|
|
//检查该路径对应的目录是否存在. 如果不存在则创建目录
|
|
|
File dir = new File(path);
|
|
@@ -203,7 +213,7 @@ public class FilingImagesService extends CrudService<FilingImagesMapper, FilingI
|
|
|
long timeMillis = System.currentTimeMillis();
|
|
|
String fileLocality = "项目附件_" + timeMillis;
|
|
|
//判定当前系统
|
|
|
- String path = Global.getAttachmentDir2();
|
|
|
+ String path = Global.getPath();
|
|
|
path = path + "/" + fileLocality;
|
|
|
//检查该路径对应的目录是否存在. 如果不存在则创建目录
|
|
|
File dir = new File(path);
|
|
@@ -360,7 +370,7 @@ public class FilingImagesService extends CrudService<FilingImagesMapper, FilingI
|
|
|
long timeMillis = System.currentTimeMillis();
|
|
|
String fileLocality = "项目附件_" + timeMillis;
|
|
|
//判定当前系统
|
|
|
- String path = Global.getAttachmentDir2();
|
|
|
+ String path = Global.getPath();
|
|
|
path = path + "/" + fileLocality;
|
|
|
//检查该路径对应的目录是否存在. 如果不存在则创建目录
|
|
|
File dir = new File(path);
|
|
@@ -446,4 +456,78 @@ public class FilingImagesService extends CrudService<FilingImagesMapper, FilingI
|
|
|
return file.getPath();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过项目id导出项目的初设阶段
|
|
|
+ *
|
|
|
+ * @param idList
|
|
|
+ */
|
|
|
+ public String exportDesignStage(List<String> idList) throws Exception {
|
|
|
+ //设置下载的压缩包名(固定字符+时间戳)
|
|
|
+ long timeMillis = System.currentTimeMillis();
|
|
|
+ String fileLocality = "项目附件_" + timeMillis;
|
|
|
+ //判定当前系统
|
|
|
+ String path = Global.getPath();
|
|
|
+ path = path + "/" + fileLocality;
|
|
|
+ //检查该路径对应的目录是否存在. 如果不存在则创建目录
|
|
|
+ File dir = new File(path);
|
|
|
+ if (!dir.exists()) {
|
|
|
+ dir.mkdirs();
|
|
|
+ }
|
|
|
+
|
|
|
+ List<DesignStage> allList = new ArrayList<>();
|
|
|
+ //通过id查询出所有的项目信息
|
|
|
+ List<DesignStage> byIdList = designStageMapper.findAll(idList);
|
|
|
+
|
|
|
+ for (DesignStage a :
|
|
|
+ byIdList) {
|
|
|
+ allList.add(a);
|
|
|
+ List<DesignStage> childList = designStageMapper.findChildList(a);
|
|
|
+ if (childList.size() > 0) {
|
|
|
+ for (DesignStage b :
|
|
|
+ childList) {
|
|
|
+ allList.add(b);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //循环遍历,判断项目是否存在
|
|
|
+ for (DesignStage a :
|
|
|
+ allList) {
|
|
|
+ File dirFile = null;
|
|
|
+ List<FilingImages> filingImagesList = null;
|
|
|
+ List<FilingImages> exportList = new ArrayList<>();
|
|
|
+ String downloadPath = path + "/" + a.getProjectCode();
|
|
|
+ String designAnnex = a.getPreDesignAnnex();
|
|
|
+ if (null!=designAnnex && !"".equals(designAnnex)) {
|
|
|
+ dirFile = new File(downloadPath + "/初设阶段");
|
|
|
+ if (designAnnex.contains("|")) {
|
|
|
+ String[] split = designAnnex.split("\\|");
|
|
|
+ for (int i = 0; i < split.length; i++) {
|
|
|
+ FilingImages filingImages = new FilingImages();
|
|
|
+ filingImages.setImgPath(split[i]);
|
|
|
+ filingImages.setProjectCode(a.getProjectCode());
|
|
|
+ filingImages.setPurpose("初设附件");
|
|
|
+ exportList.add(filingImages);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ FilingImages filingImages = new FilingImages();
|
|
|
+ filingImages.setImgPath(designAnnex);
|
|
|
+ filingImages.setProjectCode(a.getProjectCode());
|
|
|
+ filingImages.setPurpose("初设附件");
|
|
|
+ exportList.add(filingImages);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (exportList.size() > 0) {
|
|
|
+ this.disposeFileList(exportList, dirFile.getPath());
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ //处理完之后进行打包压缩并删除之前的文件
|
|
|
+ ZipCompressUtil zipUtil = new ZipCompressUtil();
|
|
|
+ File resultFile = new File(path);
|
|
|
+ File file = zipUtil.zipCompress(resultFile, true);
|
|
|
+ return file.getPath();
|
|
|
+ }
|
|
|
+
|
|
|
}
|