|
|
@@ -11,6 +11,7 @@ import com.ningdatech.pmapi.provincial.model.dto.FileDTO; |
|
|
|
import com.ningdatech.pmapi.provincial.model.dto.ProvincialApplicationDTO; |
|
|
|
import com.ningdatech.pmapi.provincial.model.dto.ProvincialProjectDTO; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.assertj.core.util.Lists; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
@@ -58,7 +59,7 @@ public class ApplicationConverter { |
|
|
|
.superUnit(projectInfo.getSuperOrg()) |
|
|
|
.superUnitCode(projectInfo.getSuperOrgCode()) |
|
|
|
.projectEstimateFile(convertFile(projectInfo.getCalculationTotalInvestmentFile(),fileService)) |
|
|
|
.unitThreePlan(projectInfo.getMainResponsibilitiesApplicantFile()) |
|
|
|
.unitThreePlan(convertFile(projectInfo.getMainResponsibilitiesApplicantFile(),fileService)) |
|
|
|
.otherFile(convertFile(projectInfo.getPreliminaryPlanFile(),fileService)) |
|
|
|
.projectRemark(projectInfo.getProjectRemarks()) |
|
|
|
.includeApplication(projectInfo.getIncludeApplication()) |
|
|
@@ -149,6 +150,7 @@ public class ApplicationConverter { |
|
|
|
String fileName = fileJson.getString("originalFileName"); |
|
|
|
Map<Long, String> fileMap = fileService.findUrlById(Arrays.asList(fileId)); |
|
|
|
String url = fileMap.get(fileId); |
|
|
|
url = removeExpire(url); |
|
|
|
FileDTO file = new FileDTO(); |
|
|
|
file.setFileId(String.valueOf(fileId)); |
|
|
|
file.setFileName(fileName); |
|
|
@@ -162,6 +164,19 @@ public class ApplicationConverter { |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 去除掉 oss链接的超时时间 |
|
|
|
* @param url |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private static String removeExpire(String url) { |
|
|
|
if(StringUtils.isNotBlank(url)){ |
|
|
|
String s = "Expires"; |
|
|
|
return url.replaceAll("&?" + s + "=[^&]*&", StringUtils.EMPTY); |
|
|
|
} |
|
|
|
return StringUtils.EMPTY; |
|
|
|
} |
|
|
|
|
|
|
|
//立项依据的文件格式不一样 |
|
|
|
private static String convertBasicFile(String applicationEstimateFile, FileService fileService) { |
|
|
|
try { |
|
|
@@ -176,6 +191,7 @@ public class ApplicationConverter { |
|
|
|
String fileName = fJson.getString("originalFileName"); |
|
|
|
Map<Long, String> fileMap = fileService.findUrlById(Arrays.asList(fileId)); |
|
|
|
String url = fileMap.get(fileId); |
|
|
|
url = removeExpire(url); |
|
|
|
FileDTO file = new FileDTO(); |
|
|
|
file.setFileId(String.valueOf(fileId)); |
|
|
|
file.setFileName(fileName); |
|
|
|