Parcourir la source

省级联审状态 debug

tags/24080901
PoffyZhang il y a 1 an
Parent
révision
4025fa5e94
2 fichiers modifiés avec 26 ajouts et 2 suppressions
  1. +17
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/converter/ApplicationConverter.java
  2. +9
    -1
      pmapi/src/test/java/com/ningdatech/pmapi/provincial/Test.java

+ 17
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/converter/ApplicationConverter.java Voir le fichier

@@ -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);


+ 9
- 1
pmapi/src/test/java/com/ningdatech/pmapi/provincial/Test.java Voir le fichier

@@ -7,6 +7,7 @@ import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;

import javax.crypto.Mac;
@@ -22,7 +23,7 @@ import java.security.NoSuchAlgorithmException;
* @Author PoffyZhang
*/
@Slf4j
public class Test extends AppTests {
public class Test {//extends AppTests

@Autowired
private PrequalificationDeclaredProjectManage prequalificationDeclaredProjectManage;
@@ -51,4 +52,11 @@ public class Test extends AppTests {
Project project = projectService.getById(340);
prequalificationDeclaredProjectManage.directStartProcess(project,project.getPreStartUserId());
}

@org.junit.Test
public void Test3333(){
String url = "http://devplat.oss-cn-hangzhou.aliyuncs.com/2023/04/13/5b2e1ef734e14437ba350ef97202c5b7.pdf?Expires=1681367401&OSSAccessKeyId=LTAI4GL7uypycnBjiRn55rMG&Signature=5PbIhpHNZvA2o8xYy8Ujw9Ibhl8%3D";
String s = "Expires";
System.out.println(url.replaceAll("&?" + s + "=[^&]*&", StringUtils.EMPTY));
}
}

Chargement…
Annuler
Enregistrer