Browse Source

IRS档案

tags/24080901
PoffyZhang 1 year ago
parent
commit
33bc6b1b4e
2 changed files with 26 additions and 113 deletions
  1. +6
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java
  2. +20
    -113
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java

+ 6
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java View File

@@ -91,6 +91,12 @@ public class ProjectLibController {
return projectLibManage.getProjectDetail(id); return projectLibManage.getProjectDetail(id);
} }


@GetMapping("/detail/{projectCode}")
@ApiOperation("获取项目详情(编号)")
public ProjectDetailVO detailProjectCode (@PathVariable String projectCode){
return projectLibManage.detailProjectCode(projectCode);
}

@GetMapping("/processSchedule/{projectId}") @GetMapping("/processSchedule/{projectId}")
@ApiOperation("项目库申报项目当前进度详情") @ApiOperation("项目库申报项目当前进度详情")
public List<ProcessDetailVO> processScheduleDetail(@PathVariable("projectId") Long projectId){ public List<ProcessDetailVO> processScheduleDetail(@PathVariable("projectId") Long projectId){


+ 20
- 113
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java View File

@@ -519,118 +519,16 @@ public class ProjectLibManage {
if (Objects.isNull(projectInfo)) { if (Objects.isNull(projectInfo)) {
return null; return null;
} }
ProjectDetailVO vo = new ProjectDetailVO();
BeanUtils.copyProperties(projectInfo, vo);
vo.buildDynamicForm(projectInfo.getDynamicForm());
// 查询应用
List<ProjectApplication> applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class)
.eq(ProjectApplication::getProjectCode, vo.getProjectCode())
.eq(ProjectApplication::getIsConstruct, projectInfo.getIsConstruct())
.eq(ProjectApplication::getProjectVersion, projectInfo.getVersion()));

List<Long> applicationIds = applications.stream().map(ProjectApplication::getId).collect(Collectors.toList());

//核心业务
if(CollUtil.isNotEmpty(applicationIds)){
List<ProjectCoreBusinessIndicators> coreBizs = projectCoreBusinessIndicatorsService.list(Wrappers.lambdaQuery(ProjectCoreBusinessIndicators.class)
.in(ProjectCoreBusinessIndicators::getApplicationId, applicationIds));
Map<Long,List<ProjectCoreBusinessIndicators>> coreBizMap = coreBizs.stream().collect(Collectors.groupingBy(ProjectCoreBusinessIndicators::getApplicationId));

Optional.ofNullable(applications).ifPresent(apps ->
vo.setProjectApplications(CollUtils.convert(apps,
app -> ProjectHelper.convertVOWithMap(app,coreBizMap))
));
}

List<Long> allVersionProjectId = projectService.getAllVersionProjectId(projectInfo);
//查询采购备案
List<Purchase> purchases = purchaseService.listByProjectId(projectId);
vo.setPurchases(BeanUtil.copyToList(purchases, PurchaseVO.class));

//查询合同备案
Contract contract = contractService.getOne(Wrappers.lambdaQuery(Contract.class)
.in(Contract::getProjectId, allVersionProjectId)
.last(BizConst.LIMIT_1));
ContractVO contractVO = BeanUtil.copyProperties(contract, ContractVO.class);
vo.setContract(contractVO);
List<PaymentPlan> payments = paymentPlanService.list(Wrappers.lambdaQuery(PaymentPlan.class)
.in(PaymentPlan::getProjectId, allVersionProjectId)
.orderByAsc(PaymentPlan::getPaymentTime));
if (Objects.nonNull(contractVO)) {
contractVO.setPayments(convertPayments(payments,
contractVO.getTotalAmount()));
}

//查询实施信息
Operation operation = operationService.getOne(Wrappers.lambdaQuery(Operation.class)
.in(Operation::getProjectId, allVersionProjectId)
.orderByAsc(Operation::getCreateOn)
.last(BizConst.LIMIT_1));
vo.setOperation(BeanUtil.copyProperties(operation, OperationVO.class));

SafetyMonitorVO safetyVo = new SafetyMonitorVO();
//查询风险监测
List<SupplierSafetyQualification> ssq = supplierSafetyQualificationService.list(Wrappers.lambdaQuery(SupplierSafetyQualification.class)
.eq(SupplierSafetyQualification::getProjectCode, projectInfo.getProjectCode()));
if(CollUtil.isNotEmpty(ssq)){
safetyVo.setSupplierSafetyQualification(ssq.stream()
.map(s -> BeanUtil.copyProperties(s, SupplierSafetyQualificationVO.class))
.collect(Collectors.toList()));
}
vo.setSafetyInfo(safetyVo);

List<PersonSafetyInfo> psi = personSafetyInfoService.list(Wrappers.lambdaQuery(PersonSafetyInfo.class)
.eq(PersonSafetyInfo::getProjectCode, projectInfo.getProjectCode()));
if(CollUtil.isNotEmpty(psi)){
safetyVo.setPersonSafetyInfo(psi.stream()
.map(p -> BeanUtil.copyProperties(p, PersonSafetyInfoVO.class))
.collect(Collectors.toList()));
}

//查询初验信息
List<PreInsAcceptancePerson> acceptancePersons = acceptancePersonService.list(Wrappers.lambdaQuery(PreInsAcceptancePerson.class)
.in(PreInsAcceptancePerson::getProjectId, allVersionProjectId)
.orderByAsc(PreInsAcceptancePerson::getCreateOn));
vo.setAcceptancePersons(convertPersons(acceptancePersons));

//查询终验信息
vo.setFinalIrsApps(applicationHandler.generateIrsApp(projectInfo.getProjectCode()));
return getProjectDetailLogic(projectInfo);
}


//查询年度投资金额 要是已验收的项目
if (ProjectStatusEnum.ACCEPTED.getCode().equals(projectInfo.getStatus())) {
List<AnnualAmountVO> annualAmounts = Lists.newArrayList();
annualAmounts.add(AnnualAmountVO.builder()
.projectId(projectInfo.getId())
.projectYear(projectInfo.getProjectYear())
.annualAmount(projectInfo.getAnnualPlanAmount())
.build());
List<ProjectRenewalFundDeclaration> renewalDeclarations = renewalFundDeclarationService.list(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class)
.eq(ProjectRenewalFundDeclaration::getProjectId, projectInfo.getId())
.eq(ProjectRenewalFundDeclaration::getApprovalStatus, ProjectRenewalApprovalStatusEnum.PASS.name())
.eq(ProjectRenewalFundDeclaration::getDeleted,Boolean.FALSE)
.orderByAsc(ProjectRenewalFundDeclaration::getProjectYear));
Optional.ofNullable(renewalDeclarations).ifPresent(declarations ->
declarations.forEach(declaration -> {
annualAmounts.add(AnnualAmountVO.builder()
.projectId(projectInfo.getId())
.projectYear(declaration.getProjectYear())
.annualAmount(declaration.getAnnualPaymentAmount())
.build());
})
);
vo.setAnnualAccumulateAmountList(annualAmounts);
}
// 处理文件名
List<Long> fileIdList = new ArrayList<>();
BizUtils.notBlank(vo.getApprovedFile(), w -> fileIdList.add(Long.parseLong(w)));
BizUtils.notBlank(vo.getApprovedConstructionPlanFile(), w -> fileIdList.add(Long.parseLong(w)));
if (!fileIdList.isEmpty()) {
List<File> files = fileService.listByIds(fileIdList);
Map<String, String> fileMap = CollUtils.listToMap(files, w -> w.getId().toString(), File::getOriginalFileName);
vo.setApprovedFileName(fileMap.get(vo.getApprovedFile()));
vo.setApprovedConstructionPlanFileName(fileMap.get(vo.getApprovedConstructionPlanFile()));
public ProjectDetailVO detailProjectCode(String projectCode) {
// 查询最新的项目申报信息
Project projectInfo = projectService.getProjectByCode(projectCode);
if (Objects.isNull(projectInfo)) {
return null;
} }
return vo;
return getProjectDetailLogic(projectInfo);
} }


/** /**
@@ -645,6 +543,10 @@ public class ProjectLibManage {
if (Objects.isNull(projectInfo)) { if (Objects.isNull(projectInfo)) {
return null; return null;
} }
return getProjectDetailLogic(projectInfo);
}

private ProjectDetailVO getProjectDetailLogic(Project projectInfo) {
ProjectDetailVO vo = new ProjectDetailVO(); ProjectDetailVO vo = new ProjectDetailVO();
BeanUtils.copyProperties(projectInfo, vo); BeanUtils.copyProperties(projectInfo, vo);
vo.buildDynamicForm(projectInfo.getDynamicForm()); vo.buildDynamicForm(projectInfo.getDynamicForm());
@@ -667,16 +569,16 @@ public class ProjectLibManage {
app -> ProjectHelper.convertVOWithMap(app,coreBizMap)) app -> ProjectHelper.convertVOWithMap(app,coreBizMap))
)); ));
} }
//审批信息 //审批信息
ProcessDetailReq req = new ProcessDetailReq(); ProcessDetailReq req = new ProcessDetailReq();
req.setInstanceId(projectInfo.getInstCode()); req.setInstanceId(projectInfo.getInstCode());
req.setProjectId(projectId);
req.setProjectId(projectInfo.getId());
vo.setProcess(todoService.getProcessDetail(req)); vo.setProcess(todoService.getProcessDetail(req));


List<Long> allVersionProjectId = projectService.getAllVersionProjectId(projectInfo); List<Long> allVersionProjectId = projectService.getAllVersionProjectId(projectInfo);
//查询采购备案 //查询采购备案
List<Purchase> purchases = purchaseService.listByProjectId(projectId);
List<Purchase> purchases = purchaseService.listByProjectId(projectInfo.getId());
vo.setPurchases(BeanUtil.copyToList(purchases, PurchaseVO.class)); vo.setPurchases(BeanUtil.copyToList(purchases, PurchaseVO.class));


//查询合同备案 //查询合同备案
@@ -726,6 +628,8 @@ public class ProjectLibManage {
vo.setAcceptancePersons(convertPersons(acceptancePersons)); vo.setAcceptancePersons(convertPersons(acceptancePersons));


//查询终验信息 //查询终验信息
vo.setFinalIrsApps(applicationHandler.generateIrsApp(projectInfo.getProjectCode()));

//查询年度投资金额 要是已验收的项目 //查询年度投资金额 要是已验收的项目
if (ProjectStatusEnum.ACCEPTED.getCode().equals(projectInfo.getStatus())) { if (ProjectStatusEnum.ACCEPTED.getCode().equals(projectInfo.getStatus())) {
List<AnnualAmountVO> annualAmounts = Lists.newArrayList(); List<AnnualAmountVO> annualAmounts = Lists.newArrayList();
@@ -763,6 +667,7 @@ public class ProjectLibManage {
return vo; return vo;
} }



/** /**
* 申报新项目时 保存项目信息和其它相关联的信息 * 申报新项目时 保存项目信息和其它相关联的信息
* *
@@ -1618,4 +1523,6 @@ public class ProjectLibManage {
}); });
} }
} }


} }

Loading…
Cancel
Save