Преглед на файлове

IRS档案

tags/24080901
PoffyZhang преди 1 година
родител
ревизия
33bc6b1b4e
променени са 2 файла, в които са добавени 26 реда и са изтрити 113 реда
  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 Целия файл

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

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

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


+ 20
- 113
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java Целия файл

@@ -519,118 +519,16 @@ public class ProjectLibManage {
if (Objects.isNull(projectInfo)) {
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)) {
return null;
}
return getProjectDetailLogic(projectInfo);
}

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

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

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

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

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


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


}

Loading…
Отказ
Запис