|
@@ -13,6 +13,8 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
+import static com.sooka.sponest.data.utils.DataConstants.DOWNLOAD_URL;
|
|
|
+
|
|
|
/**
|
|
|
* 住建-附件Service业务层处理
|
|
|
*
|
|
@@ -217,4 +219,35 @@ public class CenterdataTHousingconstructionAttachServiceImpl implements ICenterd
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String replasePathToFile(String busId,String type){
|
|
|
+ List<CenterdataTHousingconstructionAttach> attachList = getAttachPathToEntityArray(busId);
|
|
|
+
|
|
|
+ StringBuilder newDiles = new StringBuilder();
|
|
|
+
|
|
|
+ String fileurl = SpringUtils.getBean(RemoteConfigService.class).remotegetConfigKey(DOWNLOAD_URL).getData();
|
|
|
+
|
|
|
+ attachList.forEach(attach->{
|
|
|
+ if(StringUtils.isNotEmpty(type)){
|
|
|
+ if(type.equals(attach.getDictType())){
|
|
|
+ String filename = attach.getFileName(); //新建 Microsoft Excel 工作表 (2).xlsx
|
|
|
+ String url = attach.getAttachPath().substring(attach.getAttachPath().indexOf("group1"),attach.getAttachPath().length()); //group1/M00/00/84/wKgKEGawNfGAW7bwAAAxRySSUAM25.xlsx
|
|
|
+ String group = url.substring(0, url.indexOf('/')); //group1
|
|
|
+ newDiles.append(fileurl + "Download?fileName=" + filename + "&&group=" + group + "&&path=" + url.substring(url.indexOf('/') + 1) + "+" + filename + ",");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(type.equals(attach.getDictValue())){
|
|
|
+ String filename = attach.getFileName(); //新建 Microsoft Excel 工作表 (2).xlsx
|
|
|
+ String url = attach.getAttachPath().substring(attach.getAttachPath().indexOf("group1"),attach.getAttachPath().length()); //group1/M00/00/84/wKgKEGawNfGAW7bwAAAxRySSUAM25.xlsx
|
|
|
+ String group = url.substring(0, url.indexOf('/')); //group1
|
|
|
+ newDiles.append(fileurl + "Download?fileName=" + filename + "&&group=" + group + "&&path=" + url.substring(url.indexOf('/') + 1) + "+" + filename + ",");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if(newDiles.length() > 0){
|
|
|
+ newDiles.deleteCharAt(newDiles.length() - 1);
|
|
|
+ }
|
|
|
+ return newDiles.toString();
|
|
|
+ }
|
|
|
}
|