|
@@ -5,6 +5,7 @@ package com.jeeplus.modules.filing.filingImages.service;
|
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.jeeplus.common.config.Global;
|
|
|
+import com.jeeplus.common.utils.PropertiesLoader;
|
|
|
import com.jeeplus.core.persistence.Page;
|
|
|
import com.jeeplus.core.service.CrudService;
|
|
|
import com.jeeplus.core.web.Servlets;
|
|
@@ -36,6 +37,8 @@ import java.net.URLEncoder;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
+import static com.jeeplus.common.config.Global.SYS_TYPE;
|
|
|
+
|
|
|
/**
|
|
|
* 图片管理Service
|
|
|
*
|
|
@@ -66,6 +69,11 @@ public class FilingImagesService extends CrudService<FilingImagesMapper, FilingI
|
|
|
@Autowired
|
|
|
private ReviewStageMapper reviewStageMapper;
|
|
|
|
|
|
+ /**
|
|
|
+ * 属性文件加载对象
|
|
|
+ */
|
|
|
+ private static PropertiesLoader loader = new PropertiesLoader("/properties/jeeplus.properties");
|
|
|
+
|
|
|
public List<FilingImages> findByProjectId(String id) {
|
|
|
return mapper.findByProjectId(id);
|
|
|
}
|
|
@@ -318,9 +326,17 @@ public class FilingImagesService extends CrudService<FilingImagesMapper, FilingI
|
|
|
*/
|
|
|
public void disposeFileList(List<FilingImages> filingImages, String downloadPath) throws IOException {
|
|
|
ZipCompressUtil zipCompressUtil = new ZipCompressUtil();
|
|
|
- for (FilingImages info : filingImages) {
|
|
|
- zipCompressUtil.downloadRuralProject(info.getImgPath().substring(0, info.getImgPath().lastIndexOf("/")), info.getImgPath().substring(info.getImgPath().lastIndexOf("/") + 1, info.getImgPath().length()), downloadPath);
|
|
|
+ String FILE_PREFIX = loader.getProperty("linux.file.store.prefix");
|
|
|
+ if (SYS_TYPE.equals("1")) {
|
|
|
+ for (FilingImages info : filingImages) {
|
|
|
+ zipCompressUtil.downloadRuralProject(info.getImgPath().substring(0, info.getImgPath().lastIndexOf("/")), info.getImgPath().substring(info.getImgPath().lastIndexOf("/") + 1, info.getImgPath().length()), downloadPath);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ for (FilingImages info : filingImages) {
|
|
|
+ zipCompressUtil.downloadRuralProject(FILE_PREFIX+info.getImgPath().substring(0, info.getImgPath().lastIndexOf("/")), info.getImgPath().substring(info.getImgPath().lastIndexOf("/") + 1, info.getImgPath().length()), downloadPath);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|