|
@@ -12,6 +12,7 @@ import com.ningdatech.pmapi.common.util.BizUtils; |
|
|
import com.ningdatech.pmapi.gov.enumeration.GovProjectClassifiedEnum; |
|
|
import com.ningdatech.pmapi.gov.enumeration.GovProjectClassifiedEnum; |
|
|
import com.ningdatech.pmapi.gov.manage.GovProjectCollectionManage; |
|
|
import com.ningdatech.pmapi.gov.manage.GovProjectCollectionManage; |
|
|
import com.ningdatech.pmapi.gov.model.vo.*; |
|
|
import com.ningdatech.pmapi.gov.model.vo.*; |
|
|
|
|
|
import com.ningdatech.pmapi.projectdeclared.model.vo.PurchaseVO; |
|
|
import com.ningdatech.pmapi.projectlib.model.entity.Project; |
|
|
import com.ningdatech.pmapi.projectlib.model.entity.Project; |
|
|
import com.ningdatech.pmapi.projectlib.model.vo.ProjectApplicationVO; |
|
|
import com.ningdatech.pmapi.projectlib.model.vo.ProjectApplicationVO; |
|
|
import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO; |
|
|
import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO; |
|
@@ -20,6 +21,7 @@ import lombok.extern.slf4j.Slf4j; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.springframework.stereotype.Component; |
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
import java.time.LocalDateTime; |
|
|
import java.time.LocalDateTime; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import java.util.Objects; |
|
|
import java.util.Objects; |
|
@@ -87,6 +89,7 @@ public class ProjectConvertUtil { |
|
|
// TODO 缺少状态映射 |
|
|
// TODO 缺少状态映射 |
|
|
// baseinfo.setBaseProjSetProg(); |
|
|
// baseinfo.setBaseProjSetProg(); |
|
|
baseinfo.setBaseProjType(project.getProjectType()); |
|
|
baseinfo.setBaseProjType(project.getProjectType()); |
|
|
|
|
|
baseinfo.setDeleted(Boolean.FALSE); |
|
|
return baseinfo; |
|
|
return baseinfo; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -106,7 +109,17 @@ public class ProjectConvertUtil { |
|
|
} |
|
|
} |
|
|
return app.getApplicationName(); |
|
|
return app.getApplicationName(); |
|
|
}).collect(Collectors.joining(StrPool.SEMICOLON_CHINA)); |
|
|
}).collect(Collectors.joining(StrPool.SEMICOLON_CHINA)); |
|
|
apply.setBaseAccountAppName(appName); |
|
|
|
|
|
|
|
|
String appCode = projectApplications.stream().map(app -> { |
|
|
|
|
|
if (StringUtils.isNotBlank(app.getRelatedExistsApplication())) { |
|
|
|
|
|
return app.getRelatedExistsApplicationCode(); |
|
|
|
|
|
} |
|
|
|
|
|
return app.getAppCode(); |
|
|
|
|
|
}).collect(Collectors.joining(StrPool.SEMICOLON_CHINA)); |
|
|
|
|
|
String accountName = projectApplications.stream().map(app -> app.getAccountAppName()) |
|
|
|
|
|
.collect(Collectors.joining(StrPool.SEMICOLON_CHINA)); |
|
|
|
|
|
apply.setBaseAccountAppName(accountName); |
|
|
|
|
|
apply.setBaseProjSys(appName); |
|
|
|
|
|
apply.setBaseProjSysCode(appCode); |
|
|
} |
|
|
} |
|
|
apply.setBaseBasisAmountOri(project.getBaseBasisAmountOri()); |
|
|
apply.setBaseBasisAmountOri(project.getBaseBasisAmountOri()); |
|
|
String coreBusiness = project.getCoreBusiness(); |
|
|
String coreBusiness = project.getCoreBusiness(); |
|
@@ -134,8 +147,6 @@ public class ProjectConvertUtil { |
|
|
apply.setBaseHistorProjName(project.getBaseHistorProjName()); |
|
|
apply.setBaseHistorProjName(project.getBaseHistorProjName()); |
|
|
apply.setBaseHistorProjYear(project.getBaseHistorProjYear()); |
|
|
apply.setBaseHistorProjYear(project.getBaseHistorProjYear()); |
|
|
apply.setBaseProjApplyFile(project.getProjectApplicationForm()); |
|
|
apply.setBaseProjApplyFile(project.getProjectApplicationForm()); |
|
|
apply.setBaseProjApplyFilePdf(collectionManage.convertAndUpload(project |
|
|
|
|
|
.getProjectApplicationForm()).toString()); |
|
|
|
|
|
String beginTime = project.getBeginTime(); |
|
|
String beginTime = project.getBeginTime(); |
|
|
String endTime = project.getEndTime(); |
|
|
String endTime = project.getEndTime(); |
|
|
if(StringUtils.isNotBlank(beginTime)){ |
|
|
if(StringUtils.isNotBlank(beginTime)){ |
|
@@ -145,12 +156,62 @@ public class ProjectConvertUtil { |
|
|
apply.setBaseProjEndTime(BizUtils.convertLocalDateTime(endTime)); |
|
|
apply.setBaseProjEndTime(BizUtils.convertLocalDateTime(endTime)); |
|
|
} |
|
|
} |
|
|
apply.setBaseProjDuration(project.getBuildCycle()); |
|
|
apply.setBaseProjDuration(project.getBuildCycle()); |
|
|
|
|
|
apply.setBaseProjConsClass(project.getBuildLevel()); |
|
|
|
|
|
apply.setBaseProjIntro(project.getProjectIntroduction()); |
|
|
|
|
|
apply.setBaseProjBasis(project.getBaseProjBasis()); |
|
|
|
|
|
apply.setBaseProjBasisFile(project.getBaseProjBasisFile()); |
|
|
|
|
|
apply.setBaseProjDeclAmount(project.getAnnualPlanAmount()); |
|
|
|
|
|
apply.setBaseProjTotalAmount(project.getDeclareAmount()); |
|
|
|
|
|
apply.setBaseProjSetYear(Objects.nonNull(project.getProjectYear()) |
|
|
|
|
|
? String.valueOf(project.getProjectYear()) : null); |
|
|
|
|
|
apply.setBaseProjRemark(project.getProjectRemarks()); |
|
|
|
|
|
apply.setBaseProjOtherFile(project.getBaseProjOtherFile()); |
|
|
|
|
|
apply.setBaseResearchReportFile(project.getBaseResearchReportFile()); |
|
|
|
|
|
apply.setBeseExpectedResults(project.getBeseExpectedResults()); |
|
|
|
|
|
apply.setSetProjCodeFinan(project.getFinancialCode()); |
|
|
|
|
|
apply.setMissing(StringUtils.isNotBlank(project.getBaseHistorProjId()) ? Boolean.FALSE : Boolean.TRUE); |
|
|
return apply; |
|
|
return apply; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//转化审批信息 |
|
|
//转化审批信息 |
|
|
private GovBizProjectApproveVO buildApprove(ProjectDetailVO project) { |
|
|
private GovBizProjectApproveVO buildApprove(ProjectDetailVO project) { |
|
|
GovBizProjectApproveVO approve = new GovBizProjectApproveVO(); |
|
|
GovBizProjectApproveVO approve = new GovBizProjectApproveVO(); |
|
|
|
|
|
approve.setBaseProjId(project.getProjectCode()); |
|
|
|
|
|
approve.setBaseProjName(project.getProjectName()); |
|
|
|
|
|
approve.setApprovalFile(project.getApprovedFile()); |
|
|
|
|
|
approve.setAreaCode(RegionConst.RC_LS); |
|
|
|
|
|
approve.setDeleted(Boolean.FALSE); |
|
|
|
|
|
approve.setBaseDevelopCode(project.getDevelopCode()); |
|
|
|
|
|
approve.setBaseExpertTotalMoney(project.getProposeTotalInvest()); |
|
|
|
|
|
approve.setBaseExpertYearMoney(project.getProposeAnnualBudget()); |
|
|
|
|
|
approve.setBaseInitialReviewTotalMoney(project.getApprovalAmount()); |
|
|
|
|
|
approve.setBaseProjReplyAmount(project.getApprovalBudget()); |
|
|
|
|
|
approve.setBaseReviewCommentsFile(project.getProposeAttachFiles()); |
|
|
|
|
|
List<ProjectApplicationVO> projectApplications = project.getProjectApplications(); |
|
|
|
|
|
if(CollUtil.isNotEmpty(projectApplications)){ |
|
|
|
|
|
Integer max = 0; |
|
|
|
|
|
for(ProjectApplicationVO app : projectApplications){ |
|
|
|
|
|
max = Math.max(app.getSecrecyGrade(),max); |
|
|
|
|
|
} |
|
|
|
|
|
if(max > 0){ |
|
|
|
|
|
approve.setEqualProtectionLevel(String.format(max.toString(), |
|
|
|
|
|
StrPool.FORMAT_DATE_SINGLE_DIGITS)); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
approve.setPreliminaryDesignScheme(project.getPreliminaryPlanFile()); |
|
|
|
|
|
approve.setPreliminaryDesignFile(project.getPreliminaryInspectionMaterials()); |
|
|
|
|
|
approve.setBaseReviewOpinion(project.getProposeAttach()); |
|
|
|
|
|
if(Objects.nonNull(project.getBaseReviewResults())){ |
|
|
|
|
|
approve.setBaseReviewResults(String.format(project.getBaseReviewResults().toString(), |
|
|
|
|
|
StrPool.FORMAT_DATE_SINGLE_DIGITS)); |
|
|
|
|
|
} |
|
|
|
|
|
List<PurchaseVO> purchases = project.getPurchases(); |
|
|
|
|
|
if(CollUtil.isNotEmpty(purchases)){ |
|
|
|
|
|
purchases.stream().map(PurchaseVO::getTransactionAmount) |
|
|
|
|
|
.filter(Objects::nonNull).reduce(BigDecimal::add) |
|
|
|
|
|
.ifPresent(j -> approve.setReleaseYearMoney(j)); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return approve; |
|
|
return approve; |
|
|
} |
|
|
} |
|
|