|
|
@@ -6,8 +6,11 @@ import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication; |
|
|
|
import com.ningdatech.pmapi.provincial.model.dto.ProvincialApplicationDTO; |
|
|
|
import com.ningdatech.pmapi.provincial.model.dto.ProvincialProjectDTO; |
|
|
|
import org.assertj.core.util.Lists; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.util.Collections; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Objects; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
@@ -23,13 +26,15 @@ public class ApplicationConverter { |
|
|
|
.regionCode(projectInfo.getAreaCode()) |
|
|
|
.regionName(projectInfo.getArea()) |
|
|
|
.projectName(projectInfo.getProjectName()) |
|
|
|
.projectId(String.valueOf(projectInfo.getId())) |
|
|
|
.projectId(projectInfo.getProjectCode()) |
|
|
|
.projectType(projectInfo.getProjectType()) |
|
|
|
.totalMoney(projectInfo.getDeclareAmount()) |
|
|
|
.yearBudget(projectInfo.getAnnualPlanAmount()) |
|
|
|
.budgetFrom(projectInfo.getDeclareHaveAmount() + "," + |
|
|
|
projectInfo.getDeclareGovOwnFinanceAmount() + "," |
|
|
|
+ projectInfo.getDeclareGovSuperiorFinanceAmount()) |
|
|
|
.budgetFrom(checkAddBudget(projectInfo.getDeclareHaveAmount() |
|
|
|
,projectInfo.getDeclareGovOwnFinanceAmount(), |
|
|
|
projectInfo.getDeclareGovSuperiorFinanceAmount(), |
|
|
|
projectInfo.getDeclareBankLendingAmount(), |
|
|
|
projectInfo.getDeclareOtherAmount())) |
|
|
|
.year(String.valueOf(projectInfo.getProjectYear())) |
|
|
|
.financialCode(projectInfo.getFinancialCode()) |
|
|
|
.developCode(projectInfo.getDevelopCode()) |
|
|
@@ -52,10 +57,35 @@ public class ApplicationConverter { |
|
|
|
.otherFile(projectInfo.getPreliminaryPlanFile()) |
|
|
|
.projectRemark(projectInfo.getProjectRemarks()) |
|
|
|
.includeApplication(projectInfo.getIncludeApplication()) |
|
|
|
.projectApplyFile(projectInfo.getProjectApplicationForm()) |
|
|
|
.researchReport(projectInfo.getPreliminaryPlanFile()) |
|
|
|
.applicationInfo(convertApplications(applications)) |
|
|
|
.build(); |
|
|
|
} |
|
|
|
|
|
|
|
private static String checkAddBudget(BigDecimal declareHaveAmount, BigDecimal declareGovOwnFinanceAmount, |
|
|
|
BigDecimal declareGovSuperiorFinanceAmount,BigDecimal declareBankLendingAmount, |
|
|
|
BigDecimal otherAmount) { |
|
|
|
StringBuffer sb = new StringBuffer(); |
|
|
|
|
|
|
|
if(Objects.nonNull(declareHaveAmount) && declareHaveAmount.compareTo(BigDecimal.ZERO) > 0){ |
|
|
|
sb.append("自有资金,"); |
|
|
|
} |
|
|
|
if(Objects.nonNull(declareGovOwnFinanceAmount) && declareGovOwnFinanceAmount.compareTo(BigDecimal.ZERO) > 0){ |
|
|
|
sb.append("政府投资-本级财政资金,"); |
|
|
|
} |
|
|
|
if(Objects.nonNull(declareGovSuperiorFinanceAmount) && declareGovSuperiorFinanceAmount.compareTo(BigDecimal.ZERO) > 0){ |
|
|
|
sb.append("政府投资-上级财政资金,"); |
|
|
|
} |
|
|
|
if(Objects.nonNull(declareGovSuperiorFinanceAmount) && declareGovSuperiorFinanceAmount.compareTo(BigDecimal.ZERO) > 0){ |
|
|
|
sb.append("银行贷款,"); |
|
|
|
} |
|
|
|
if(Objects.nonNull(otherAmount) && otherAmount.compareTo(BigDecimal.ZERO) > 0){ |
|
|
|
sb.append("其他资金"); |
|
|
|
} |
|
|
|
return sb.toString(); |
|
|
|
} |
|
|
|
|
|
|
|
//放入项目 app |
|
|
|
private static List<ProvincialApplicationDTO> convertApplications(List<ProjectApplication> applications) { |
|
|
|
if(CollUtil.isEmpty(applications)){ |
|
|
@@ -98,6 +128,9 @@ public class ApplicationConverter { |
|
|
|
.isProduceCommonComponent(projectApplication.getProduceCommonComponent()) |
|
|
|
.produceCommonComponent(projectApplication.getProduceCommonComponents()) |
|
|
|
.publishSide(projectApplication.getPublishSide()) |
|
|
|
.isS2(projectApplication.getIsAccountAppName()) |
|
|
|
.accountAppName(projectApplication.getAccountAppName()) |
|
|
|
.applicationEstimateFile(projectApplication.getApplicationEstimateFile()) |
|
|
|
.build(); |
|
|
|
} |
|
|
|
|
|
|
|