@@ -80,7 +80,7 @@ public class ProjectConvert { | |||||
return Collections.emptyList(); | return Collections.emptyList(); | ||||
} | } | ||||
List<ProjectProcureReq> req = procures.stream() | |||||
return procures.stream() | |||||
.map(p -> { | .map(p -> { | ||||
ProjectProcureReq r = BeanUtil.copyProperties(p, ProjectProcureReq.class); | ProjectProcureReq r = BeanUtil.copyProperties(p, ProjectProcureReq.class); | ||||
if (Objects.nonNull(p.getId())) { | if (Objects.nonNull(p.getId())) { | ||||
@@ -91,7 +91,6 @@ public class ProjectConvert { | |||||
return r; | return r; | ||||
}) | }) | ||||
.collect(Collectors.toList()); | .collect(Collectors.toList()); | ||||
return req; | |||||
} | } | ||||
private static List<ProjectProcureReq> convertProcuresVo(List<GovBizProjectProcureVO> procures) { | private static List<ProjectProcureReq> convertProcuresVo(List<GovBizProjectProcureVO> procures) { | ||||
@@ -99,7 +98,7 @@ public class ProjectConvert { | |||||
return Collections.emptyList(); | return Collections.emptyList(); | ||||
} | } | ||||
List<ProjectProcureReq> req = procures.stream() | |||||
return procures.stream() | |||||
.map(p -> { | .map(p -> { | ||||
ProjectProcureReq r = BeanUtil.copyProperties(p, ProjectProcureReq.class); | ProjectProcureReq r = BeanUtil.copyProperties(p, ProjectProcureReq.class); | ||||
if (Objects.nonNull(p.getId())) { | if (Objects.nonNull(p.getId())) { | ||||
@@ -110,7 +109,6 @@ public class ProjectConvert { | |||||
return r; | return r; | ||||
}) | }) | ||||
.collect(Collectors.toList()); | .collect(Collectors.toList()); | ||||
return req; | |||||
} | } | ||||
private static List<ProjectProcureReq> convertProcuresVoWithConvertPdf(List<GovBizProjectProcureVO> procures) { | private static List<ProjectProcureReq> convertProcuresVoWithConvertPdf(List<GovBizProjectProcureVO> procures) { | ||||
@@ -118,7 +116,7 @@ public class ProjectConvert { | |||||
return Collections.emptyList(); | return Collections.emptyList(); | ||||
} | } | ||||
List<ProjectProcureReq> req = procures.stream() | |||||
return procures.stream() | |||||
.map(p -> { | .map(p -> { | ||||
ProjectProcureReq r = BeanUtil.copyProperties(p, ProjectProcureReq.class); | ProjectProcureReq r = BeanUtil.copyProperties(p, ProjectProcureReq.class); | ||||
r.setBiddingFile(StringUtils.isNotBlank(p.getBiddingFilePdf()) ? p.getBiddingFilePdf() : | r.setBiddingFile(StringUtils.isNotBlank(p.getBiddingFilePdf()) ? p.getBiddingFilePdf() : | ||||
@@ -132,17 +130,14 @@ public class ProjectConvert { | |||||
return r; | return r; | ||||
}) | }) | ||||
.collect(Collectors.toList()); | .collect(Collectors.toList()); | ||||
return req; | |||||
} | } | ||||
private static ProjectMimplementReq convertMimplement(GovBizProjectMimplementDTO mimplement) { | private static ProjectMimplementReq convertMimplement(GovBizProjectMimplementDTO mimplement) { | ||||
ProjectMimplementReq req = BeanUtil.copyProperties(mimplement, ProjectMimplementReq.class); | |||||
return req; | |||||
return BeanUtil.copyProperties(mimplement, ProjectMimplementReq.class); | |||||
} | } | ||||
private static ProjectMimplementReq convertMimplementVo(GovBizProjectMimplementVO mimplement) { | private static ProjectMimplementReq convertMimplementVo(GovBizProjectMimplementVO mimplement) { | ||||
ProjectMimplementReq req = BeanUtil.copyProperties(mimplement, ProjectMimplementReq.class); | |||||
return req; | |||||
return BeanUtil.copyProperties(mimplement, ProjectMimplementReq.class); | |||||
} | } | ||||
private static ProjectMimplementReq convertMimplementVoWithConvertPdf(GovBizProjectMimplementVO mimplement) { | private static ProjectMimplementReq convertMimplementVoWithConvertPdf(GovBizProjectMimplementVO mimplement) { | ||||
@@ -174,8 +169,7 @@ public class ProjectConvert { | |||||
} | } | ||||
public static ProjectCimplementReq convertCimplement(GovBizProjectCimplementDTO cimplement) { | public static ProjectCimplementReq convertCimplement(GovBizProjectCimplementDTO cimplement) { | ||||
ProjectCimplementReq req = BeanUtil.copyProperties(cimplement, ProjectCimplementReq.class); | |||||
return req; | |||||
return BeanUtil.copyProperties(cimplement, ProjectCimplementReq.class); | |||||
} | } | ||||
public static ProjectCimplementReq convertCimplementVo(GovBizProjectCimplementVO cimplement) { | public static ProjectCimplementReq convertCimplementVo(GovBizProjectCimplementVO cimplement) { | ||||
@@ -1,59 +0,0 @@ | |||||
package com.hz.pm.api.gov.enumeration; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.Getter; | |||||
import lombok.NoArgsConstructor; | |||||
import org.apache.commons.lang3.StringUtils; | |||||
import java.util.Objects; | |||||
/** | |||||
* GovProjectStatusEnum | |||||
* | |||||
* @return | |||||
* @author ZPF | |||||
* @since 2023/10/24 16:27 | |||||
*/ | |||||
@Getter | |||||
@AllArgsConstructor | |||||
@NoArgsConstructor | |||||
public enum GovProjectStatusEnum { | |||||
/** | |||||
* 项目归集 状态 | |||||
*/ | |||||
APPROVAL("01", "评审中"), | |||||
PENDING("02", "待立项"), | |||||
REJECTED("03","已驳回"), | |||||
APPROVED("04","已立项"), | |||||
PURCHASED("05","已采购"), | |||||
HAS_PRE_INS("06","已初验"), | |||||
HAS_FINAL_INS("07","已终验"), | |||||
TERMINATED("00","已终止"); | |||||
private String code; | |||||
private String desc; | |||||
public static String getDescByCode(Integer code) { | |||||
if (Objects.isNull(code)) { | |||||
return StringUtils.EMPTY; | |||||
} | |||||
for (GovProjectStatusEnum t : GovProjectStatusEnum.values()) { | |||||
if (code.equals(t.getCode())) { | |||||
return t.desc; | |||||
} | |||||
} | |||||
return StringUtils.EMPTY; | |||||
} | |||||
public static GovProjectStatusEnum match(String code) { | |||||
if (StringUtils.isBlank(code)) { | |||||
return null; | |||||
} | |||||
for (GovProjectStatusEnum t : GovProjectStatusEnum.values()) { | |||||
if (code.equals(t.getCode())) { | |||||
return t; | |||||
} | |||||
} | |||||
return null; | |||||
} | |||||
} |
@@ -1,361 +0,0 @@ | |||||
package com.hz.pm.api.gov.utils; | |||||
import cn.hutool.core.collection.CollUtil; | |||||
import com.alibaba.fastjson.JSON; | |||||
import com.alibaba.fastjson.JSONArray; | |||||
import com.alibaba.fastjson.JSONObject; | |||||
import com.google.common.collect.Lists; | |||||
import com.hz.pm.api.projectdeclared.model.vo.PurchaseFullInfoVO; | |||||
import com.ningdatech.basic.util.StrPool; | |||||
import com.ningdatech.file.entity.File; | |||||
import com.ningdatech.file.service.FileService; | |||||
import com.hz.pm.api.common.model.constant.RegionConst; | |||||
import com.hz.pm.api.common.util.BizUtils; | |||||
import com.hz.pm.api.gov.enumeration.GovProjectClassifiedEnum; | |||||
import com.hz.pm.api.gov.model.vo.*; | |||||
import com.hz.pm.api.projectdeclared.model.vo.PurchaseVO; | |||||
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus; | |||||
import com.hz.pm.api.projectlib.model.enumeration.ProjectTypeNewEnum; | |||||
import com.hz.pm.api.projectlib.model.vo.ProjectApplicationVO; | |||||
import com.hz.pm.api.projectlib.model.vo.ProjectDetailVO; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.apache.commons.lang3.StringUtils; | |||||
import java.math.BigDecimal; | |||||
import java.util.Collections; | |||||
import java.util.List; | |||||
import java.util.Objects; | |||||
import java.util.stream.Collectors; | |||||
/** | |||||
* @Classname ProjectCollectionUtil | |||||
* @Description | |||||
* @Date 2023/9/14 9:07 | |||||
* @Author PoffyZhang | |||||
*/ | |||||
@Slf4j | |||||
public class ProjectConvertUtil { | |||||
/** | |||||
* 申报项目 转为 项目归集 | |||||
* | |||||
* @param project | |||||
* @return | |||||
*/ | |||||
public static GovBizProjectDetailVO declaredToCollection(ProjectDetailVO project, FileService fileService) { | |||||
GovBizProjectDetailVO projectCollection = new GovBizProjectDetailVO(); | |||||
if (Objects.isNull(project)) { | |||||
return projectCollection; | |||||
} | |||||
String projectCode = project.getProjectCode(); | |||||
String projectName = project.getProjectName(); | |||||
projectCollection.setBaseProjId(projectCode); | |||||
projectCollection.setBaseProjName(projectName); | |||||
projectCollection.setBaseinfo(buildBaseinfo(project)); | |||||
projectCollection.setApply(buildApply(project)); | |||||
projectCollection.setApprove(buildApprove(project, fileService)); | |||||
String projectType = project.getProjectType(); | |||||
ProjectTypeNewEnum match = ProjectTypeNewEnum.match(projectType); | |||||
if (Objects.nonNull(match)) { | |||||
switch (match) { | |||||
case SJ_BUILD: | |||||
case FIRST_BUILD: | |||||
case SZ_BUILD: | |||||
projectCollection.setCimplement(buildCim(project)); | |||||
break; | |||||
case NEW_OPERA: | |||||
case XU_OPERA: | |||||
projectCollection.setMimplement(buildMim(project)); | |||||
break; | |||||
default: | |||||
break; | |||||
} | |||||
} | |||||
projectCollection.setProcures(buildProcure(project)); | |||||
return projectCollection; | |||||
} | |||||
//转化基本信息 | |||||
private static GovBizProjectBaseinfoVO buildBaseinfo(ProjectDetailVO project) { | |||||
GovBizProjectBaseinfoVO baseinfo = new GovBizProjectBaseinfoVO(); | |||||
baseinfo.setBaseProjId(project.getProjectCode()); | |||||
baseinfo.setBaseProjName(project.getProjectName()); | |||||
baseinfo.setAreaCode(RegionConst.RC_HZ); | |||||
baseinfo.setBaseAreaCode(project.getAreaCode() + RegionConst.NINE_CODE_LAST); | |||||
baseinfo.setBaseAreaName(project.getArea()); | |||||
baseinfo.setBaseBuildDeprt(project.getBuildOrgName()); | |||||
baseinfo.setBaseBuildDeprtDing(project.getBuildOrgCode()); | |||||
baseinfo.setBaseBuildDepartUsci(project.getOrgCreditCode()); | |||||
baseinfo.setBaseConstructionType(project.getBaseConstructionType()); | |||||
baseinfo.setBaseManDeprt(project.getSuperOrg()); | |||||
baseinfo.setBaseManDeprtDing(project.getSuperOrgCode()); | |||||
baseinfo.setBaseManDepartUsci(project.getSuperOrgCreditCode()); | |||||
baseinfo.setBaseProjContacts(project.getContactName()); | |||||
baseinfo.setBaseProjContactsCall(project.getContactPhone()); | |||||
baseinfo.setBaseProjIsConfidentiality(GovProjectClassifiedEnum.NOT_CLASSIFIED.getCode()); | |||||
baseinfo.setBaseProjPrincipal(project.getResponsibleMan()); | |||||
baseinfo.setBaseProjPrincipalCall(project.getResponsibleManMobile()); | |||||
baseinfo.setBaseProvManDeprt(project.getHigherSuperOrg()); | |||||
baseinfo.setBaseProvManDepartDing(project.getHigherSuperOrgCode()); | |||||
baseinfo.setBaseProvManDeprtType(project.getBaseProvManDeprtType()); | |||||
ProjectStatus projectStatus = ProjectStatus.getNoNull(project.getStatus()); | |||||
if (projectStatus.getCollectStatus() != null) { | |||||
baseinfo.setBaseProjSetProg(projectStatus.getCollectStatus().getCode()); | |||||
} | |||||
baseinfo.setBaseProjType(project.getProjectType()); | |||||
baseinfo.setDeleted(Boolean.FALSE); | |||||
return baseinfo; | |||||
} | |||||
//转化申报信息 | |||||
private static GovBizProjectApplyVO buildApply(ProjectDetailVO project) { | |||||
GovBizProjectApplyVO apply = new GovBizProjectApplyVO(); | |||||
apply.setBaseProjName(project.getProjectName()); | |||||
apply.setAreaCode(RegionConst.RC_HZ); | |||||
apply.setBaseHistorProjId(project.getBaseHistorProjId()); | |||||
apply.setBaseBasisEstablish(project.getBaseBasisEstablish()); | |||||
List<ProjectApplicationVO> projectApplications = project.getProjectApplications(); | |||||
if (CollUtil.isNotEmpty(projectApplications)) { | |||||
String appName = projectApplications.stream().map(app -> { | |||||
if (StringUtils.isNotBlank(app.getRelatedExistsApplication())) { | |||||
return app.getRelatedExistsApplication(); | |||||
} | |||||
return app.getApplicationName(); | |||||
}).collect(Collectors.joining(StrPool.SEMICOLON_CHINA)); | |||||
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 -> StringUtils.isNotBlank(app.getAccountAppName()) ? app.getAccountAppName() : null) | |||||
.filter(Objects::nonNull) | |||||
.collect(Collectors.joining(StrPool.SEMICOLON_CHINA)); | |||||
apply.setBaseAccountAppName(accountName); | |||||
apply.setBaseProjSys(appName); | |||||
apply.setBaseProjSysCode(appCode); | |||||
} | |||||
apply.setBaseBasisAmountOri(project.getBaseBasisAmountOri()); | |||||
String coreBusiness = project.getCoreBusiness(); | |||||
if (StringUtils.isNotBlank(coreBusiness)) { | |||||
try { | |||||
JSONArray coreJson = JSON.parseArray(coreBusiness); | |||||
String matters = coreJson.stream().map(j -> { | |||||
JSONObject matterJson = JSON.parseObject(JSON.toJSONString(j)); | |||||
return matterJson.getString("matterName"); | |||||
}).filter(Objects::nonNull) | |||||
.collect(Collectors.joining(StrPool.SEMICOLON_CHINA)); | |||||
String matterCodes = coreJson.stream().map(j -> { | |||||
JSONObject matterJson = JSON.parseObject(JSON.toJSONString(j)); | |||||
return matterJson.getString("oid"); | |||||
}).filter(Objects::nonNull) | |||||
.collect(Collectors.joining(StrPool.SEMICOLON_CHINA)); | |||||
apply.setBaseCoreBusiness(matters); | |||||
apply.setBaseCoreBusinessCode(matterCodes); | |||||
} catch (Exception e) { | |||||
log.error("项目转化失败", e); | |||||
} | |||||
} | |||||
apply.setBaseDevelopCode(project.getDevelopCode()); | |||||
apply.setBaseLowestLevel(project.getLowestLevel()); | |||||
apply.setBaseHistorProjName(project.getBaseHistorProjName()); | |||||
apply.setBaseHistorProjYear(project.getBaseHistorProjYear()); | |||||
apply.setBaseProjApplyFile(project.getProjectApplicationForm()); | |||||
String beginTime = project.getBeginTime(); | |||||
String endTime = project.getEndTime(); | |||||
if (StringUtils.isNotBlank(beginTime)) { | |||||
apply.setBaseProjStartTime(BizUtils.convertLocalDateTime(beginTime)); | |||||
} | |||||
if (StringUtils.isNotBlank(endTime)) { | |||||
apply.setBaseProjEndTime(BizUtils.convertLocalDateTime(endTime)); | |||||
} | |||||
if (StringUtils.isNotBlank(beginTime) && StringUtils.isNotBlank(endTime)) { | |||||
try { | |||||
String yearEnd = endTime.split(StrPool.DASH)[0]; | |||||
String yearStart = beginTime.split(StrPool.DASH)[0]; | |||||
String monthEnd = endTime.split(StrPool.DASH)[1]; | |||||
String monthStart = beginTime.split(StrPool.DASH)[1]; | |||||
Integer duration = Integer.parseInt(monthEnd) - Integer.parseInt(monthStart) + | |||||
(Integer.parseInt(yearEnd) - Integer.parseInt(yearStart)) * 12; | |||||
apply.setBaseProjDuration(String.valueOf(duration)); | |||||
} catch (Exception e) { | |||||
log.error("日期转换失败:", e); | |||||
} | |||||
} | |||||
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; | |||||
} | |||||
//转化审批信息 | |||||
private static GovBizProjectApproveVO buildApprove(ProjectDetailVO project, FileService fileService) { | |||||
GovBizProjectApproveVO approve = new GovBizProjectApproveVO(); | |||||
approve.setBaseProjName(project.getProjectName()); | |||||
File file = fileService.getById(project.getApprovedFile()); | |||||
if (Objects.nonNull(file)) { | |||||
approve.setApprovalFile(JSON.toJSONString(Lists.newArrayList(file))); | |||||
} | |||||
approve.setAreaCode(RegionConst.RC_HZ); | |||||
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(StrPool.FORMAT_DATE_SINGLE_DIGITS, max)); | |||||
} | |||||
} | |||||
approve.setPreliminaryDesignScheme(project.getPreliminaryPlanFile()); | |||||
approve.setBaseReviewOpinion(project.getProposeAttach()); | |||||
if (Objects.nonNull(project.getBaseReviewResults())) { | |||||
approve.setBaseReviewResults(String.format(StrPool.FORMAT_DATE_SINGLE_DIGITS, | |||||
project.getBaseReviewResults())); | |||||
} | |||||
List<PurchaseFullInfoVO> purchases = project.getPurchaseDetails(); | |||||
if (CollUtil.isNotEmpty(purchases)) { | |||||
purchases.stream().map(w -> w.getPurchase().getTransactionAmount()) | |||||
.filter(Objects::nonNull).reduce(BigDecimal::add) | |||||
.ifPresent(approve::setReleaseYearMoney); | |||||
} | |||||
return approve; | |||||
} | |||||
//转化建设 实施 | |||||
private static GovBizProjectCimplementVO buildCim(ProjectDetailVO project) { | |||||
GovBizProjectCimplementVO cim = new GovBizProjectCimplementVO(); | |||||
cim.setBaseProjName(project.getProjectName()); | |||||
cim.setBaseEngineerPostpoFile(project.getSupportingMaterialsFile()); | |||||
cim.setAreaCode(RegionConst.RC_HZ); | |||||
cim.setDeleted(Boolean.FALSE); | |||||
cim.setBaseDevelopCode(project.getDevelopCode()); | |||||
//总结报告 | |||||
cim.setBaseSummReportFile(searchReportFile(project, 5, 2)); | |||||
//监理总结报告 | |||||
cim.setBaseEstaSummFile(searchReportFile(project, 5, 3)); | |||||
//建设核查表 | |||||
cim.setBaseCheckFile(searchReportFile(project, 3, 2)); | |||||
cim.setBaseThirdAcceptFile(searchReportFile(project, 5, 4)); | |||||
cim.setBaseInitialOpinionFile(searchReportFile(project, 5, 5)); | |||||
List<ProjectApplicationVO> projectApplications = project.getProjectApplications(); | |||||
if (CollUtil.isNotEmpty(projectApplications)) { | |||||
String appCode = projectApplications.stream().map(app -> { | |||||
if (StringUtils.isNotBlank(app.getRelatedExistsApplication())) { | |||||
return app.getRelatedExistsApplicationCode(); | |||||
} | |||||
return app.getAppCode(); | |||||
}).collect(Collectors.joining(StrPool.SEMICOLON_CHINA)); | |||||
cim.setBaseProjSysCode(appCode); | |||||
} | |||||
return cim; | |||||
} | |||||
//转化运维实施 | |||||
private static GovBizProjectMimplementVO buildMim(ProjectDetailVO project) { | |||||
GovBizProjectMimplementVO mim = new GovBizProjectMimplementVO(); | |||||
// mim.setBaseProjId(project.getProjectCode()); | |||||
mim.setBaseProjName(project.getProjectName()); | |||||
mim.setBaseEngineerPostpoFile(project.getSupportingMaterialsFile()); | |||||
mim.setAreaCode(RegionConst.RC_HZ); | |||||
mim.setDeleted(Boolean.FALSE); | |||||
mim.setBaseDevelopCode(project.getDevelopCode()); | |||||
//监理总结报告 | |||||
mim.setBaseEstaSummFile(searchReportFile(project, 5, 3)); | |||||
//建设核查表 | |||||
// mim.setBaseCheckFile(searchReportFile(project,3,2)); | |||||
mim.setBaseThirdAcceptFile(searchReportFile(project, 5, 4)); | |||||
// mim.setBaseInitialOpinionFile(searchReportFile(project,5,5)); | |||||
List<ProjectApplicationVO> projectApplications = project.getProjectApplications(); | |||||
if (CollUtil.isNotEmpty(projectApplications)) { | |||||
String appCode = projectApplications.stream().map(app -> { | |||||
if (StringUtils.isNotBlank(app.getRelatedExistsApplication())) { | |||||
return app.getRelatedExistsApplicationCode(); | |||||
} | |||||
return app.getAppCode(); | |||||
}).collect(Collectors.joining(StrPool.SEMICOLON_CHINA)); | |||||
mim.setBaseProjSysCode(appCode); | |||||
} | |||||
return mim; | |||||
} | |||||
//转化采购信息 | |||||
private static List<GovBizProjectProcureVO> buildProcure(ProjectDetailVO project) { | |||||
List<PurchaseFullInfoVO> purchases = project.getPurchaseDetails(); | |||||
if (CollUtil.isNotEmpty(purchases)) { | |||||
return purchases.stream().map(w -> { | |||||
GovBizProjectProcureVO purchase = new GovBizProjectProcureVO(); | |||||
PurchaseVO p = w.getPurchase(); | |||||
purchase.setBaseProjName(project.getProjectName()); | |||||
purchase.setAreaCode(RegionConst.RC_HZ); | |||||
purchase.setDeleted(Boolean.FALSE); | |||||
purchase.setBaseBidName(p.getBidName()); | |||||
purchase.setBasePurchasingAgencies(p.getAgency()); | |||||
purchase.setBaseUnifiedCreditCode(p.getPurchaseSocialCreditCode()); | |||||
purchase.setBaseConsDeprt(p.getSupplier()); | |||||
purchase.setBaseConsDeprtUsci(p.getSupplierSocialCreditCode()); | |||||
purchase.setBasePaymentTime(p.getTransactionTime()); | |||||
purchase.setBaseProjPurchaseAmount(p.getTransactionAmount()); | |||||
purchase.setBaseProjPurchaseWay(p.getPurchaseMethod()); | |||||
purchase.setBasePurchaseCode(p.getBudgetExecConfirmNo()); | |||||
purchase.setBaseWinningBidTime(p.getTransactionTime()); | |||||
purchase.setBiddingFile(p.getAcceptanceLetter()); | |||||
purchase.setSetProjCodeFinan(project.getFinancialCode()); | |||||
purchase.setPurchaseFile(p.getBidDoc()); | |||||
return purchase; | |||||
}).collect(Collectors.toList()); | |||||
} | |||||
return Collections.emptyList(); | |||||
} | |||||
/** | |||||
* 查询项目 初验终验的 报告 | |||||
* | |||||
* @param project | |||||
* @return | |||||
*/ | |||||
private static String searchReportFile(ProjectDetailVO project, Integer firstIndex, Integer secondIndex) { | |||||
/*if (Objects.isNull(project)) { | |||||
return null; | |||||
} | |||||
if (StringUtils.isNotBlank(project.getFinalAcceptanceMaterials())) { | |||||
return searchReportFileInner(project.getFinalAcceptanceMaterials(), firstIndex, secondIndex); | |||||
} else if (StringUtils.isNotBlank(project.getPreliminaryInspectionMaterials())) { | |||||
return searchReportFileInner(project.getFinalAcceptanceMaterials(), firstIndex, secondIndex); | |||||
}*/ | |||||
return null; | |||||
} | |||||
private static String searchReportFileInner(String fileStr, Integer firstIndex, Integer secondIndex) { | |||||
try { | |||||
JSONArray jsonArray = JSON.parseArray(fileStr); | |||||
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(jsonArray.get(firstIndex - 1))); | |||||
JSONArray data = jsonObject.getJSONArray("data"); | |||||
JSONObject wangong = JSON.parseObject(JSON.toJSONString(data.get(secondIndex - 1))); | |||||
JSONArray files = wangong.getJSONArray("files"); | |||||
return JSON.toJSONString(files); | |||||
} catch (Exception e) { | |||||
log.error("解析文件失败:", e); | |||||
} | |||||
return null; | |||||
} | |||||
} |
@@ -1,7 +1,9 @@ | |||||
package com.hz.pm.api.meeting.controller; | package com.hz.pm.api.meeting.controller; | ||||
import com.hz.pm.api.meeting.entity.dto.ProjectReviewResultDTO; | |||||
import com.hz.pm.api.meeting.entity.dto.ReviewProjectDTO; | import com.hz.pm.api.meeting.entity.dto.ReviewProjectDTO; | ||||
import com.hz.pm.api.meeting.entity.enumeration.MeetingReviewTypeEnum; | |||||
import com.hz.pm.api.meeting.entity.req.*; | import com.hz.pm.api.meeting.entity.req.*; | ||||
import com.hz.pm.api.meeting.entity.vo.*; | import com.hz.pm.api.meeting.entity.vo.*; | ||||
import com.hz.pm.api.meeting.manage.MeetingManage; | import com.hz.pm.api.meeting.manage.MeetingManage; | ||||
@@ -196,6 +198,13 @@ public class MeetingController { | |||||
return meetingManage.projectsByMeetingId(meetingId); | return meetingManage.projectsByMeetingId(meetingId); | ||||
} | } | ||||
@ApiOperation("获取最新的项目评审详情") | |||||
@GetMapping("/projectReviewDetail/{projectId}/{meetingType}") | |||||
public ProjectReviewResultDTO projectReviewDetail(@PathVariable Long projectId, | |||||
@PathVariable MeetingReviewTypeEnum meetingType) { | |||||
return meetingManage.projectReviewDetail(projectId, meetingType); | |||||
} | |||||
@PostMapping("/result/upload") | @PostMapping("/result/upload") | ||||
@ApiOperation("上传会议结果") | @ApiOperation("上传会议结果") | ||||
@WebLog("上传会议结果") | @WebLog("上传会议结果") | ||||
@@ -28,7 +28,9 @@ public enum MeetingReviewTypeEnum { | |||||
DEPT_JOIN_REVIEW("部门联审", "4"), | DEPT_JOIN_REVIEW("部门联审", "4"), | ||||
FAIRNESS_REVIEW( "公平性审查","5"); | |||||
FAIRNESS_REVIEW("公平性审查", "5"), | |||||
PROJECT_REVIEW("项目评审", "6"); | |||||
private final String value; | private final String value; | ||||
private final String code; | private final String code; | ||||
@@ -0,0 +1,43 @@ | |||||
package com.hz.pm.api.meeting.entity.req; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import java.math.BigDecimal; | |||||
/** | |||||
* <p> | |||||
* ProjectReviewInfoReq | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 10:50 2024/4/17 | |||||
*/ | |||||
@Data | |||||
public class ProjectReviewInfoReq { | |||||
@ApiModelProperty("建设必要性") | |||||
private String buildNecessity; | |||||
@ApiModelProperty("需求合理性") | |||||
private String needRationality; | |||||
@ApiModelProperty("技术方案可行性") | |||||
private String techFeasibility; | |||||
@ApiModelProperty("审核结果:1 通过、0 不通过") | |||||
private Integer reviewResult; | |||||
@ApiModelProperty("其他意见") | |||||
private String otherAdvices; | |||||
@ApiModelProperty("投资测算合理性") | |||||
private String investRationality; | |||||
@ApiModelProperty("建议资金(单位:万元)") | |||||
private BigDecimal suggestedFunding; | |||||
@ApiModelProperty("相关材料") | |||||
private String attachFiles; | |||||
} |
@@ -2,6 +2,7 @@ package com.hz.pm.api.meeting.entity.req; | |||||
import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.ApiModelProperty; | ||||
import lombok.Data; | import lombok.Data; | ||||
import lombok.EqualsAndHashCode; | |||||
import javax.validation.constraints.NotNull; | import javax.validation.constraints.NotNull; | ||||
import java.math.BigDecimal; | import java.math.BigDecimal; | ||||
@@ -15,7 +16,8 @@ import java.math.BigDecimal; | |||||
* @since 15:35 2023/12/18 | * @since 15:35 2023/12/18 | ||||
*/ | */ | ||||
@Data | @Data | ||||
public class ProjectReviewResultUploadReq { | |||||
@EqualsAndHashCode(callSuper = true) | |||||
public class ProjectReviewResultUploadReq extends ProjectReviewInfoReq { | |||||
@ApiModelProperty("会议ID") | @ApiModelProperty("会议ID") | ||||
@NotNull(message = "会议ID不能为空") | @NotNull(message = "会议ID不能为空") | ||||
@@ -25,28 +27,4 @@ public class ProjectReviewResultUploadReq { | |||||
@NotNull(message = "项目关联会议ID不能为空") | @NotNull(message = "项目关联会议ID不能为空") | ||||
private Long meetingProjectId; | private Long meetingProjectId; | ||||
@ApiModelProperty("建设必要性") | |||||
private String buildNecessity; | |||||
@ApiModelProperty("需求合理性") | |||||
private String needRationality; | |||||
@ApiModelProperty("技术方案可行性") | |||||
private String techFeasibility; | |||||
@ApiModelProperty("审核结果:1 通过、0 不通过") | |||||
private Integer reviewResult; | |||||
@ApiModelProperty("其他意见") | |||||
private String otherAdvices; | |||||
@ApiModelProperty("投资测算合理性") | |||||
private String investRationality; | |||||
@ApiModelProperty("建议资金(单位:万元)") | |||||
private BigDecimal suggestedFunding; | |||||
@ApiModelProperty("相关材料") | |||||
private String attachFiles; | |||||
} | } |
@@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
import com.hz.pm.api.common.helper.RegionCacheHelper; | import com.hz.pm.api.common.helper.RegionCacheHelper; | ||||
import com.hz.pm.api.common.model.constant.BizConst; | |||||
import com.hz.pm.api.expert.entity.ExpertUserFullInfo; | import com.hz.pm.api.expert.entity.ExpertUserFullInfo; | ||||
import com.hz.pm.api.expert.service.IExpertUserFullInfoService; | import com.hz.pm.api.expert.service.IExpertUserFullInfoService; | ||||
import com.hz.pm.api.gov.service.IBelongOrgService; | import com.hz.pm.api.gov.service.IBelongOrgService; | ||||
@@ -875,6 +876,9 @@ public class MeetingManage { | |||||
break; | break; | ||||
case FAIRNESS_REVIEW: | case FAIRNESS_REVIEW: | ||||
break; | break; | ||||
case PROJECT_REVIEW: | |||||
buildOptionProjectQuery(query, meetingType, ProjectStatus.WITHOUT_PROJECT_REVIEW); | |||||
break; | |||||
default: | default: | ||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
@@ -903,6 +907,19 @@ public class MeetingManage { | |||||
return Collections.emptyList(); | return Collections.emptyList(); | ||||
} | } | ||||
public ProjectReviewResultDTO projectReviewDetail(Long projectId, MeetingReviewTypeEnum type) { | |||||
Wrapper<MeetingInnerProject> query = Wrappers.lambdaQuery(MeetingInnerProject.class) | |||||
.orderByDesc(MeetingInnerProject::getUpdateOn) | |||||
.exists("select 1 from meeting m where m.id = meeting_inner_project.meeting_id " + | |||||
"and project_id = {0} and type = {1}", projectId, type) | |||||
.last(BizConst.LIMIT_1); | |||||
MeetingInnerProject projectReview = meetingInnerProjectService.getOne(query); | |||||
if (projectReview == null) { | |||||
return null; | |||||
} | |||||
return ProjectReviewResultBuilder.convert(projectReview); | |||||
} | |||||
private void buildOptionProjectQuery(LambdaQueryWrapper<Project> query, String meetingType, ProjectStatus status) { | private void buildOptionProjectQuery(LambdaQueryWrapper<Project> query, String meetingType, ProjectStatus status) { | ||||
query.eq(Project::getStatus, status.getCode()); | query.eq(Project::getStatus, status.getCode()); | ||||
String sql = String.format("select 1 from meeting m inner join meeting_inner_project mip on" + | String sql = String.format("select 1 from meeting m inner join meeting_inner_project mip on" + | ||||
@@ -0,0 +1,48 @@ | |||||
package com.hz.pm.api.projectdeclared.controller; | |||||
import com.hz.pm.api.expert.model.vo.ProjectReviewDetailVO; | |||||
import com.hz.pm.api.projectdeclared.manage.ProjectReviewManage; | |||||
import com.hz.pm.api.projectdeclared.model.req.ProjectReviewApplyReq; | |||||
import com.hz.pm.api.projectlib.model.req.ProjectListReq; | |||||
import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO; | |||||
import com.ningdatech.basic.model.PageVo; | |||||
import io.swagger.annotations.Api; | |||||
import io.swagger.annotations.ApiOperation; | |||||
import lombok.RequiredArgsConstructor; | |||||
import org.springframework.web.bind.annotation.*; | |||||
/** | |||||
* <p> | |||||
* ProjectReviewController | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 10:52 2024/4/17 | |||||
*/ | |||||
@Api(tags = "项目评审控制器") | |||||
@RestController | |||||
@RequiredArgsConstructor | |||||
@RequestMapping("/api/v1/projectReview") | |||||
public class ProjectReviewController { | |||||
private final ProjectReviewManage projectReviewManage; | |||||
@ApiOperation("提交项目评审申请") | |||||
@PostMapping(value = {"/submit", "resubmit"}) | |||||
public void projectReviewApply(@RequestBody ProjectReviewApplyReq req) { | |||||
projectReviewManage.projectReviewApply(req); | |||||
} | |||||
@ApiOperation("项目评审详情") | |||||
@GetMapping("/detail/{projectId}") | |||||
public ProjectReviewDetailVO projectReviewDetail(@PathVariable Long projectId) { | |||||
return projectReviewManage.projectReviewDetail(projectId); | |||||
} | |||||
@ApiOperation("项目评审列表") | |||||
@GetMapping("/pageReviewProject") | |||||
public PageVo<ProjectLibListItemVO> pageReviewProject(ProjectListReq req) { | |||||
return projectReviewManage.pageReviewProject(req); | |||||
} | |||||
} |
@@ -0,0 +1,58 @@ | |||||
package com.hz.pm.api.projectdeclared.entity; | |||||
import com.baomidou.mybatisplus.annotation.*; | |||||
import io.swagger.annotations.ApiModel; | |||||
import lombok.Data; | |||||
import java.math.BigDecimal; | |||||
import java.time.LocalDateTime; | |||||
/** | |||||
* <p> | |||||
* 项目评审信息表 | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 2024-04-17 | |||||
*/ | |||||
@Data | |||||
@TableName("ND_PROJECT_REVIEW") | |||||
@ApiModel(value = "NdProjectReview对象") | |||||
public class ProjectReview { | |||||
@TableId(value = "ID", type = IdType.AUTO) | |||||
private Long id; | |||||
private Long projectId; | |||||
private String projectCode; | |||||
private String buildNecessity; | |||||
private String needRationality; | |||||
private String techFeasibility; | |||||
private Short reviewResult; | |||||
private String otherAdvices; | |||||
private String investRationality; | |||||
private BigDecimal suggestedFunding; | |||||
private String attachFiles; | |||||
@TableField(fill = FieldFill.INSERT_UPDATE) | |||||
private LocalDateTime updateOn; | |||||
@TableField(fill = FieldFill.INSERT_UPDATE) | |||||
private Long updateBy; | |||||
@TableField(fill = FieldFill.INSERT) | |||||
private LocalDateTime createOn; | |||||
@TableField(fill = FieldFill.INSERT) | |||||
private Long createBy; | |||||
} |
@@ -361,7 +361,8 @@ public class DeclaredProjectManage { | |||||
if ((total = page.getTotal()) == 0) { | if ((total = page.getTotal()) == 0) { | ||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
List<ProjectLibListItemVO> records = CollUtils.convert(page.getRecords(), w -> BeanUtil.copyProperties(w, ProjectLibListItemVO.class)); | |||||
List<ProjectLibListItemVO> records = CollUtils.convert(page.getRecords(), | |||||
w -> BeanUtil.copyProperties(w, ProjectLibListItemVO.class)); | |||||
return PageVo.of(records, total); | return PageVo.of(records, total); | ||||
} | } | ||||
@@ -0,0 +1,158 @@ | |||||
package com.hz.pm.api.projectdeclared.manage; | |||||
import cn.hutool.core.bean.BeanUtil; | |||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||||
import com.hz.pm.api.common.enumeration.ProjectProcessStageEnum; | |||||
import com.hz.pm.api.common.model.constant.BizConst; | |||||
import com.hz.pm.api.common.statemachine.util.ProjectStateMachineUtil; | |||||
import com.hz.pm.api.expert.model.vo.ProjectReviewDetailVO; | |||||
import com.hz.pm.api.meeting.entity.domain.MeetingInnerProject; | |||||
import com.hz.pm.api.projectdeclared.entity.ProjectReview; | |||||
import com.hz.pm.api.projectdeclared.model.req.ProjectReviewApplyReq; | |||||
import com.hz.pm.api.projectdeclared.service.IProjectReviewService; | |||||
import com.hz.pm.api.projectlib.helper.ProjectHelper; | |||||
import com.hz.pm.api.projectlib.model.entity.Project; | |||||
import com.hz.pm.api.projectlib.model.entity.ProjectInst; | |||||
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus; | |||||
import com.hz.pm.api.projectlib.model.req.ProjectListReq; | |||||
import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO; | |||||
import com.hz.pm.api.projectlib.service.IProjectInstService; | |||||
import com.hz.pm.api.projectlib.service.IProjectService; | |||||
import com.hz.pm.api.sys.manage.ProcessModelManage; | |||||
import com.hz.pm.api.user.security.model.UserFullInfoDTO; | |||||
import com.hz.pm.api.user.security.model.UserInfoDetails; | |||||
import com.hz.pm.api.user.util.LoginUserUtil; | |||||
import com.ningdatech.basic.exception.BizException; | |||||
import com.ningdatech.basic.model.PageVo; | |||||
import com.ningdatech.basic.util.CollUtils; | |||||
import com.wflow.bean.entity.WflowModels; | |||||
import com.wflow.workflow.bean.dto.OrgInfoDTO; | |||||
import com.wflow.workflow.bean.vo.ProcessStartParamsVo; | |||||
import com.wflow.workflow.service.ProcessInstanceService; | |||||
import lombok.RequiredArgsConstructor; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.springframework.stereotype.Component; | |||||
import org.springframework.transaction.annotation.Transactional; | |||||
import java.util.Collections; | |||||
import java.util.List; | |||||
import java.util.Map; | |||||
import java.util.Objects; | |||||
/** | |||||
* <p> | |||||
* ProjectReviewManage | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 10:54 2024/4/17 | |||||
*/ | |||||
@Slf4j | |||||
@Component | |||||
@RequiredArgsConstructor | |||||
public class ProjectReviewManage { | |||||
private final IProjectReviewService projectReviewService; | |||||
private final ProcessModelManage processModelManage; | |||||
private final DeclaredProjectHelper declaredProjectHelper; | |||||
private final IProjectService projectService; | |||||
private final ProcessInstanceService processInstanceService; | |||||
private final IProjectInstService projectInstService; | |||||
private final ProjectStateMachineUtil projectStateMachineUtil; | |||||
@Transactional(rollbackFor = Exception.class) | |||||
public synchronized void projectReviewApply(ProjectReviewApplyReq req) { | |||||
Project project = projectService.getById(req.getProjectId()); | |||||
if (!ProjectStatus.WITHOUT_PROJECT_REVIEW.eq(project.getStatus()) | |||||
&& !ProjectStatus.PROJECT_REVIEW_FAILED.eq(project.getStatus())) { | |||||
throw BizException.wrap("该项目不允许申请项目评审"); | |||||
} | |||||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||||
WflowModels model = processModelManage.getWflowModels(ProjectProcessStageEnum.PROJECT_REVIEW, | |||||
user.getMhUnitId()); | |||||
if (Objects.isNull(model)) { | |||||
throw BizException.wrap("找不到项目评审流程配置"); | |||||
} | |||||
ProcessStartParamsVo processParam = new ProcessStartParamsVo(); | |||||
processParam.setUser(declaredProjectHelper.buildUser(user)); | |||||
processParam.setProcessUsers(Collections.emptyMap()); | |||||
processParam.setFormData(Collections.emptyMap()); | |||||
// 获取发起单位、发起单位主管单位、发起单位上级主管条线单位信息 | |||||
Map<String, OrgInfoDTO> orgMap = declaredProjectHelper.buildOrgModelMap(user.getUserId(), project); | |||||
String instanceId = processInstanceService.startProcessLs(model, processParam, orgMap); | |||||
ProjectInst projectInst = new ProjectInst(); | |||||
projectInst.setInstCode(instanceId); | |||||
projectInst.setInstType(ProjectProcessStageEnum.PROJECT_REVIEW); | |||||
projectInst.setProjectId(req.getProjectId()); | |||||
projectInstService.save(projectInst); | |||||
projectStateMachineUtil.pass(project); | |||||
projectService.updateById(project); | |||||
ProjectReview projReview = projectReviewService.getOne(Wrappers | |||||
.lambdaQuery(ProjectReview.class) | |||||
.eq(ProjectReview::getProjectId, req.getProjectId()) | |||||
.orderByDesc(ProjectReview::getId) | |||||
.last(BizConst.LIMIT_1)); | |||||
if (projReview == null) { | |||||
projReview = new ProjectReview(); | |||||
projReview.setProjectCode(project.getProjectCode()); | |||||
} | |||||
BeanUtil.copyProperties(req, projReview); | |||||
projectReviewService.saveOrUpdate(projReview); | |||||
log.info("项目评审提交成功 【{}】", instanceId); | |||||
} | |||||
public ProjectReviewDetailVO projectReviewDetail(Long projectId) { | |||||
ProjectReview projReview = projectReviewService.getOne(Wrappers | |||||
.lambdaQuery(ProjectReview.class) | |||||
.eq(ProjectReview::getProjectId, projectId) | |||||
.orderByDesc(ProjectReview::getId) | |||||
.last(BizConst.LIMIT_1)); | |||||
return BeanUtil.copyProperties(projReview, ProjectReviewDetailVO.class); | |||||
} | |||||
/** | |||||
* 项目列表 | |||||
* | |||||
* @param req | |||||
* @return | |||||
*/ | |||||
public PageVo<ProjectLibListItemVO> pageReviewProject(ProjectListReq req) { | |||||
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req); | |||||
query.in(Project::getProcessStatus, | |||||
ProjectStatus.WITHOUT_PROJECT_REVIEW.getCode(), | |||||
ProjectStatus.ON_PROJECT_REVIEW.getCode(), | |||||
ProjectStatus.PROJECT_REVIEW_FAILED.getCode()); | |||||
// 当非预审申报的时候 是自己单位 当是预审申报的时候 要主管单位 | |||||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||||
preQuery(query, user); | |||||
query.eq(Project::getNewest, Boolean.TRUE); | |||||
Page<Project> page = projectService.page(req.page(), query); | |||||
long total; | |||||
if ((total = page.getTotal()) == 0) { | |||||
return PageVo.empty(); | |||||
} | |||||
List<ProjectLibListItemVO> records = CollUtils.convert(page.getRecords(), | |||||
w -> BeanUtil.copyProperties(w, ProjectLibListItemVO.class)); | |||||
return PageVo.of(records, total); | |||||
} | |||||
//当非预审申报的时候 是自己单位 当是预审申报的时候 要主管单位 并且他是单位管理员 | |||||
private void preQuery(LambdaQueryWrapper<Project> query, UserInfoDetails user) { | |||||
//如果当前登录是单位管理员 | |||||
String mhUnitId = user.getMhUnitIdStr(); | |||||
if (user.getIsOrgAdmin()) { | |||||
query.and(s1 -> s1.eq(Project::getSuperOrgCode, mhUnitId) | |||||
.or(q2 -> q2.eq(Project::getBuildOrgCode, mhUnitId))); | |||||
} else { | |||||
//否则 只能看到 非预审 并且 | |||||
query.and(q2 -> q2.eq(Project::getBuildOrgCode, mhUnitId)); | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,16 @@ | |||||
package com.hz.pm.api.projectdeclared.mapper; | |||||
import com.hz.pm.api.projectdeclared.entity.ProjectReview; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
/** | |||||
* <p> | |||||
* Mapper 接口 | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 2024-04-17 | |||||
*/ | |||||
public interface ProjectReviewMapper extends BaseMapper<ProjectReview> { | |||||
} |
@@ -0,0 +1,5 @@ | |||||
<?xml version="1.0" encoding="UTF-8"?> | |||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||||
<mapper namespace="com.hz.pm.api.projectdeclared.mapper.ProjectReviewMapper"> | |||||
</mapper> |
@@ -0,0 +1,21 @@ | |||||
package com.hz.pm.api.projectdeclared.model.req; | |||||
import com.hz.pm.api.meeting.entity.req.ProjectReviewInfoReq; | |||||
import lombok.Data; | |||||
import lombok.EqualsAndHashCode; | |||||
/** | |||||
* <p> | |||||
* ProjectReviewApplyReq | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 10:57 2024/4/17 | |||||
*/ | |||||
@Data | |||||
@EqualsAndHashCode(callSuper = true) | |||||
public class ProjectReviewApplyReq extends ProjectReviewInfoReq { | |||||
private Long projectId; | |||||
} |
@@ -0,0 +1,16 @@ | |||||
package com.hz.pm.api.projectdeclared.service; | |||||
import com.hz.pm.api.projectdeclared.entity.ProjectReview; | |||||
import com.baomidou.mybatisplus.extension.service.IService; | |||||
/** | |||||
* <p> | |||||
* 服务类 | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 2024-04-17 | |||||
*/ | |||||
public interface IProjectReviewService extends IService<ProjectReview> { | |||||
} |
@@ -0,0 +1,20 @@ | |||||
package com.hz.pm.api.projectdeclared.service.impl; | |||||
import com.hz.pm.api.projectdeclared.entity.ProjectReview; | |||||
import com.hz.pm.api.projectdeclared.mapper.ProjectReviewMapper; | |||||
import com.hz.pm.api.projectdeclared.service.IProjectReviewService; | |||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||||
import org.springframework.stereotype.Service; | |||||
/** | |||||
* <p> | |||||
* 服务实现类 | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 2024-04-17 | |||||
*/ | |||||
@Service | |||||
public class ProjectReviewServiceImpl extends ServiceImpl<ProjectReviewMapper, ProjectReview> implements IProjectReviewService { | |||||
} |
@@ -2,7 +2,6 @@ package com.hz.pm.api.projectlib.controller; | |||||
import com.alibaba.fastjson.JSONObject; | import com.alibaba.fastjson.JSONObject; | ||||
import com.hz.pm.api.common.helper.UserInfoHelper; | import com.hz.pm.api.common.helper.UserInfoHelper; | ||||
import com.hz.pm.api.gov.model.vo.GovBizProjectDetailVO; | |||||
import com.hz.pm.api.projectlib.manage.ProjectLibManage; | import com.hz.pm.api.projectlib.manage.ProjectLibManage; | ||||
import com.hz.pm.api.projectlib.model.req.ProjectApplicationListReq; | import com.hz.pm.api.projectlib.model.req.ProjectApplicationListReq; | ||||
import com.hz.pm.api.projectlib.model.req.ProjectListReq; | import com.hz.pm.api.projectlib.model.req.ProjectListReq; | ||||
@@ -38,7 +37,6 @@ import java.util.List; | |||||
public class ProjectLibController { | public class ProjectLibController { | ||||
private final ProjectLibManage projectLibManage; | private final ProjectLibManage projectLibManage; | ||||
private final UserInfoHelper userInfoHelper; | private final UserInfoHelper userInfoHelper; | ||||
@GetMapping("/list") | @GetMapping("/list") | ||||
@@ -92,12 +90,6 @@ public class ProjectLibController { | |||||
return projectLibManage.getProjectDetail(id); | return projectLibManage.getProjectDetail(id); | ||||
} | } | ||||
@GetMapping("/convert-to-collection/{projectCode}") | |||||
@ApiOperation("申报项目转化为项目归集") | |||||
public GovBizProjectDetailVO convertToCollection(@PathVariable String projectCode) { | |||||
return projectLibManage.convertToCollection(projectCode); | |||||
} | |||||
@GetMapping("/detail/{projectCode}") | @GetMapping("/detail/{projectCode}") | ||||
@ApiOperation("获取项目详情(编号)") | @ApiOperation("获取项目详情(编号)") | ||||
public ProjectDetailVO detailProjectCode(@PathVariable String projectCode) { | public ProjectDetailVO detailProjectCode(@PathVariable String projectCode) { | ||||
@@ -116,4 +108,5 @@ public class ProjectLibController { | |||||
public void exportList(@Valid @RequestBody ProjectListReq param, HttpServletResponse response) { | public void exportList(@Valid @RequestBody ProjectListReq param, HttpServletResponse response) { | ||||
projectLibManage.exportList(param, response); | projectLibManage.exportList(param, response); | ||||
} | } | ||||
} | } |
@@ -31,8 +31,6 @@ import com.hz.pm.api.expert.model.enumeration.ReviewTemplateTypeEnum; | |||||
import com.hz.pm.api.expert.service.IExpertReviewService; | import com.hz.pm.api.expert.service.IExpertReviewService; | ||||
import com.hz.pm.api.filemanage.model.entity.ProjectApplyBorrow; | import com.hz.pm.api.filemanage.model.entity.ProjectApplyBorrow; | ||||
import com.hz.pm.api.filemanage.service.INdProjectApplyBorrowService; | import com.hz.pm.api.filemanage.service.INdProjectApplyBorrowService; | ||||
import com.hz.pm.api.gov.model.vo.GovBizProjectDetailVO; | |||||
import com.hz.pm.api.gov.utils.ProjectConvertUtil; | |||||
import com.hz.pm.api.performance.model.dto.ProjectCoreBusinessDTO; | import com.hz.pm.api.performance.model.dto.ProjectCoreBusinessDTO; | ||||
import com.hz.pm.api.performance.model.entity.ProjectCoreBusinessIndicators; | import com.hz.pm.api.performance.model.entity.ProjectCoreBusinessIndicators; | ||||
import com.hz.pm.api.performance.service.IProjectCoreBusinessIndicatorsService; | import com.hz.pm.api.performance.service.IProjectCoreBusinessIndicatorsService; | ||||
@@ -1545,15 +1543,4 @@ public class ProjectLibManage { | |||||
} | } | ||||
} | } | ||||
/** | |||||
* 申报项目转化为 项目归集 | |||||
* | |||||
* @param projectCode \ | |||||
* @return \ | |||||
*/ | |||||
public GovBizProjectDetailVO convertToCollection(String projectCode) { | |||||
ProjectDetailVO projectDetailVO = this.detailProjectCode(projectCode); | |||||
return ProjectConvertUtil.declaredToCollection(projectDetailVO, fileService); | |||||
} | |||||
} | } |
@@ -1,7 +1,6 @@ | |||||
package com.hz.pm.api.projectlib.model.enumeration.status; | package com.hz.pm.api.projectlib.model.enumeration.status; | ||||
import cn.hutool.core.util.StrUtil; | import cn.hutool.core.util.StrUtil; | ||||
import com.hz.pm.api.gov.enumeration.GovProjectStatusEnum; | |||||
import com.ningdatech.basic.exception.BizException; | import com.ningdatech.basic.exception.BizException; | ||||
import lombok.AllArgsConstructor; | import lombok.AllArgsConstructor; | ||||
import lombok.Getter; | import lombok.Getter; | ||||
@@ -24,53 +23,52 @@ public enum ProjectStatus implements IStatus<Integer, String> { | |||||
/** | /** | ||||
* 项目阶段:未立项 | * 项目阶段:未立项 | ||||
*/ | */ | ||||
NOT_APPROVED(10000, "未立项", null), | |||||
TO_BE_DECLARED(10015, "待申报", null), | |||||
NOT_APPROVED(10000, "未立项"), | |||||
TO_BE_DECLARED(10015, "待申报"), | |||||
/** | /** | ||||
* 合规性审查 | * 合规性审查 | ||||
*/ | */ | ||||
ON_COMPLIANCE_REVIEW(10030, "合规性审查中", null), | |||||
COMPLIANCE_REVIEW_FAILED(10031, "合规性审查不通过", null), | |||||
ON_COMPLIANCE_REVIEW(10030, "合规性审查中"), | |||||
COMPLIANCE_REVIEW_FAILED(10031, "合规性审查不通过"), | |||||
/** | /** | ||||
* 项目评审 | * 项目评审 | ||||
*/ | */ | ||||
WITHOUT_PROJECT_REVIEW(10040, "待项目评审", null), | |||||
ON_PROJECT_REVIEW(10041, "项目评审中", null), | |||||
PROJECT_REVIEW_FAILED(10042, "项目评审不通过", null), | |||||
WITHOUT_PROJECT_REVIEW(10040, "待项目评审"), | |||||
ON_PROJECT_REVIEW(10041, "项目评审中"), | |||||
PROJECT_REVIEW_FAILED(10042, "项目评审不通过"), | |||||
ON_ANNUAL_PLAN(10010, "年度计划中", null), | |||||
ON_ANNUAL_PLAN(10010, "年度计划中"), | |||||
/** | /** | ||||
* 信产项目备案 | * 信产项目备案 | ||||
*/ | */ | ||||
DECLARED_APPROVED_TO_BE_RECORD(10022, "待立项备案", null), | |||||
DECLARED_APPROVED_RECORD_AUDITING(10023, "立项备案审核中", null), | |||||
DECLARED_APPROVED_RECORD_FAILED(10024, "立项备案审核不通过", null), | |||||
DECLARED_APPROVED_TO_BE_RECORD(10022, "待立项备案"), | |||||
DECLARED_APPROVED_RECORD_AUDITING(10023, "立项备案审核中"), | |||||
DECLARED_APPROVED_RECORD_FAILED(10024, "立项备案审核不通过"), | |||||
/** | /** | ||||
* 项目阶段:已立项 | * 项目阶段:已立项 | ||||
*/ | */ | ||||
PROJECT_APPROVED(20000, "已立项", null), | |||||
TO_BE_PURCHASED(20001, "待采购", GovProjectStatusEnum.APPROVED), | |||||
ON_PURCHASING(20007, "采购中", GovProjectStatusEnum.APPROVED), | |||||
PROJECT_APPROVED(20000, "已立项"), | |||||
TO_BE_PURCHASED(20001, "待采购"), | |||||
ON_PURCHASING(20007, "采购中"), | |||||
TO_BE_FIRST_INSPECTED(20008, "待上传初验材料", null), | |||||
ON_PILOT_RUNNING(20009, "试运行中", null), | |||||
TO_BE_FIRST_INSPECTED(20008, "待上传初验材料"), | |||||
ON_PILOT_RUNNING(20009, "试运行中"), | |||||
ON_FINALLY_INSPECTED(20004, "终验审核中", null), | |||||
FINALLY_INSPECTED_FAILED(20005, "终验审核不通过", null), | |||||
ON_FINALLY_INSPECTED(20004, "终验审核中"), | |||||
FINALLY_INSPECTED_FAILED(20005, "终验审核不通过"), | |||||
/** | /** | ||||
* 项目阶段:已归档 | * 项目阶段:已归档 | ||||
*/ | */ | ||||
ARCHIVED(30000, "已归档", null), | |||||
ACCEPTED(30001, "已验收", GovProjectStatusEnum.HAS_FINAL_INS); | |||||
ARCHIVED(30000, "已归档"), | |||||
ACCEPTED(30001, "已验收"); | |||||
private final Integer code; | private final Integer code; | ||||
private final String desc; | private final String desc; | ||||
private final GovProjectStatusEnum collectStatus; | |||||
public static String getDesc(Integer code) { | public static String getDesc(Integer code) { | ||||
return get(code).flatMap(w -> Optional.of(w.getDesc())).orElse(StrUtil.EMPTY); | return get(code).flatMap(w -> Optional.of(w.getDesc())).orElse(StrUtil.EMPTY); | ||||
@@ -55,7 +55,7 @@ public class CodeGen { | |||||
} | } | ||||
public static void main(String[] args) { | public static void main(String[] args) { | ||||
generate("WendyYang", "projectlib", PATH_YYD, "nd_purchase_status_change"); | |||||
generate("WendyYang", "projectdeclared", PATH_YYD, "nd_project_review"); | |||||
} | } | ||||
} | } |