Browse Source

标签 2边都可以设置

master
PoffyZhang 1 year ago
parent
commit
93b9c79253
6 changed files with 84 additions and 21 deletions
  1. +66
    -14
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java
  2. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectMapper.xml
  3. +11
    -5
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectRenewalFundDeclarationMapper.xml
  4. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/po/ProjectRenewalFundDeclarationPO.java
  5. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/AnnualAmountVO.java
  6. +1
    -1
      pmapi/src/test/java/com/ningdatech/pmapi/projectCollection/ProjectCollection2Test.java

+ 66
- 14
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java View File

@@ -15,8 +15,10 @@ import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.common.util.ExcelDownUtil;
import com.ningdatech.pmapi.common.util.ExcelExportStyle;
import com.ningdatech.pmapi.gov.model.entity.GovBizProjectApply;
import com.ningdatech.pmapi.gov.model.entity.GovBizProjectApprove;
import com.ningdatech.pmapi.gov.model.entity.GovBizProjectBaseinfo;
import com.ningdatech.pmapi.gov.service.IGovBizProjectApplyService;
import com.ningdatech.pmapi.gov.service.IGovBizProjectApproveService;
import com.ningdatech.pmapi.gov.service.IGovBizProjectBaseinfoService;
import com.ningdatech.pmapi.projectdeclared.model.dto.ProjectRenewalDeclareExportDTO;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectRenewalApprovalStatusEnum;
@@ -69,6 +71,8 @@ public class ProjectRenewalFundManage {

private final IGovBizProjectApplyService applyService;

private final IGovBizProjectApproveService approveService;

/**
* 项目续建资金库列表 分页
* @param req
@@ -103,21 +107,28 @@ public class ProjectRenewalFundManage {
ProjectRenewalFundDeclarationVO vo = new ProjectRenewalFundDeclarationVO();
BeanUtils.copyProperties(renewal, vo);
// 查询项目信息
Project project = projectService.getById(renewal.getProjectId());
if(Objects.isNull(project)){
return vo;
}
vo.setApprovalAmount(project.getApprovalAmount());
vo.setProjectName(project.getProjectName());
vo.setProjectType(project.getProjectType());
vo.setStage(project.getStage());
vo.setStatus(project.getStatus());
vo.setBuildOrgName(project.getBuildOrgName());
vo.setAnnualPaymentAmount(renewal.getAnnualPaymentAmount());
if (ProjectStatusEnum.ACCEPTED.getCode().equals(project.getStatus())) {
Project project = projectService.getProjectByCode(renewal.getProjectCode());
GovBizProjectBaseinfo baseinfo = baseinfoService.getOne(Wrappers.lambdaQuery(GovBizProjectBaseinfo.class)
.eq(GovBizProjectBaseinfo::getBaseProjId, renewal.getProjectCode())
.last(BizConst.LIMIT_1));
GovBizProjectApply apply = applyService.getOne(Wrappers.lambdaQuery(GovBizProjectApply.class)
.eq(GovBizProjectApply::getBaseProjId, renewal.getProjectCode())
.last(BizConst.LIMIT_1));
GovBizProjectApprove approve = approveService.getOne(Wrappers.lambdaQuery(GovBizProjectApprove.class)
.eq(GovBizProjectApprove::getBaseProjId, renewal.getProjectCode())
.last(BizConst.LIMIT_1));
if(Objects.nonNull(project)){
vo.setApprovalAmount(project.getApprovalAmount());
vo.setProjectName(project.getProjectName());
vo.setProjectType(project.getProjectType());
vo.setStage(project.getStage());
vo.setStatus(project.getStatus());
vo.setBuildOrgName(project.getBuildOrgName());
vo.setAnnualPaymentAmount(renewal.getAnnualPaymentAmount());
List<AnnualAmountVO> annualAmounts = Lists.newArrayList();
annualAmounts.add(AnnualAmountVO.builder()
.projectId(project.getId())
.projectCode(project.getProjectCode())
.projectYear(project.getProjectYear())
.annualAmount(project.getAnnualPlanAmount())
.build());
@@ -130,6 +141,41 @@ public class ProjectRenewalFundManage {
declarations.forEach(declaration -> {
annualAmounts.add(AnnualAmountVO.builder()
.projectId(project.getId())
.projectCode(project.getProjectCode())
.projectYear(declaration.getProjectYear())
.annualAmount(declaration.getAnnualPaymentAmount())
.build());
})
);
vo.setAnnualAccumulateAmountList(annualAmounts);
}else if(Objects.nonNull(baseinfo)){
if(Objects.nonNull(approve)){
vo.setApprovalAmount(approve.getBaseInitialReviewTotalMoney());
}
vo.setProjectName(baseinfo.getBaseProjName());
vo.setProjectType(baseinfo.getBaseProjType());
// vo.setStage(project.getStage());
vo.setStatus(StringUtils.isNotBlank(baseinfo.getBaseProjSetProg()) ?
Integer.parseInt(baseinfo.getBaseProjSetProg()) : null);
vo.setBuildOrgName(baseinfo.getBaseBuildDeprt());
vo.setAnnualPaymentAmount(renewal.getAnnualPaymentAmount());
List<AnnualAmountVO> annualAmounts = Lists.newArrayList();
annualAmounts.add(AnnualAmountVO.builder()
.projectId(baseinfo.getId())
.projectCode(baseinfo.getBaseProjId())
.projectYear(StringUtils.isNotBlank(apply.getBaseProjSetYear()) ? Integer.parseInt(apply.getBaseProjSetYear()) : null)
.annualAmount(apply.getBaseProjDeclAmount())
.build());
List<ProjectRenewalFundDeclaration> renewalDeclarations = projectRenewalFundDeclarationService.list(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class)
.eq(ProjectRenewalFundDeclaration::getProjectCode, vo.getProjectCode())
.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(baseinfo.getId())
.projectCode(baseinfo.getBaseProjId())
.projectYear(declaration.getProjectYear())
.annualAmount(declaration.getAnnualPaymentAmount())
.build());
@@ -199,8 +245,14 @@ public class ProjectRenewalFundManage {
}

declaration.setApprovalStatus(ProjectRenewalApprovalStatusEnum.PENDING.name());
declaration.setRegionCode(project.getAreaCode());
declaration.setOrgCode(project.getBuildOrgCode());
if(Objects.nonNull(project)){
declaration.setRegionCode(project.getAreaCode());
declaration.setOrgCode(project.getBuildOrgCode());
}else if(Objects.nonNull(baseinfo)){
declaration.setRegionCode(StringUtils.isNotBlank(baseinfo.getBaseAreaCode()) ? baseinfo.getBaseAreaCode().substring(0,6) : StringUtils.EMPTY);
declaration.setOrgCode(baseinfo.getBaseBuildDeprtDing());
}

if(!projectRenewalFundDeclarationService.saveOrUpdate(declaration)){
throw new BusinessException(String.format("申报失败 【%s】",dto.getId()));
}


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectMapper.xml View File

@@ -327,7 +327,7 @@
approve.base_initial_review_total_money approval_amount,
NULL stage,
CAST(b.base_proj_set_prog AS INTEGER) status,
NULL annual_plan_amount,
apply.base_proj_decl_amount annual_plan_amount,
NULL biz_domain,
NULL inst_code,
NULL is_higher_super_org,


+ 11
- 5
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectRenewalFundDeclarationMapper.xml View File

@@ -10,12 +10,16 @@
prfd.project_year,prfd.annual_payment_amount,prfd.have_amount,
prfd.gov_own_finance_amount,prfd.gov_superior_finance_amount,
prfd.bank_lending_amount,prfd.other_amount,prfd.approval_status,prfd.deleted,
p.project_type,p.project_name,p.build_org_name
(case when p.project_type is null then b.base_proj_type else p.project_type end) project_type,
(case when p.project_name is null then b.base_proj_name else p.project_name end) project_name,
(case when p.build_org_name is null then b.base_build_deprt else p.build_org_name end) build_org_name,prfd.project_code
from nd_project_renewal_fund_declaration prfd
left join nd_project p on prfd.project_id = p.id
left join nd_project p on prfd.project_code = p.project_code and p.newest = true
left join gov_biz_project_baseinfo b on prfd.project_code = b.base_proj_code and b.deleted = false
where prfd.deleted = false
<if test="param.projectName != null and param.projectName != ''">
and p.project_name like concat('%',#{param.projectName},'%')
and (p.project_name like concat('%',#{param.projectName},'%') or
b.base_proj_name like concat('%',#{param.projectName},'%'))
</if>
<if test="param.orgCode != null and param.orgCode != ''">
and prfd.org_code = #{param.orgCode}
@@ -24,7 +28,8 @@
and prfd.region_code = #{param.regionCode}
</if>
<if test="param.projectType != null">
and p.project_type = #{param.projectType}
and (p.project_type = #{param.projectType} or
b.base_proj_type = #{param.projectType})
</if>
<if test="param.year != null">
and prfd.project_year = #{param.year}
@@ -33,7 +38,8 @@
and p.stage = #{param.stage}
</if>
<if test="param.status != null">
and p.status = #{param.status}
and (p.status = #{param.status} or
b.base_proj_set_prog = #{param.status})
</if>
<if test="param.startTime != null">
and prfd.create_on &gt;= #{param.startTime}


+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/po/ProjectRenewalFundDeclarationPO.java View File

@@ -36,6 +36,8 @@ public class ProjectRenewalFundDeclarationPO implements Serializable {

@ApiModelProperty("关联项目ID")
private Long projectId;
@ApiModelProperty("项目编号")
private String projectCode;

@ApiModelProperty("项目年份")
private Integer projectYear;


+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/AnnualAmountVO.java View File

@@ -23,6 +23,9 @@ public class AnnualAmountVO {
@ApiModelProperty("项目ID")
private Long projectId;

@ApiModelProperty("项目Code")
private String projectCode;

@ApiModelProperty("年份")
private Integer projectYear;



+ 1
- 1
pmapi/src/test/java/com/ningdatech/pmapi/projectCollection/ProjectCollection2Test.java View File

@@ -132,7 +132,7 @@ public class ProjectCollection2Test extends AppTests {
@Test
public void test2(){
//恢复误删
String baseProjId = "33110000020210100149";
String baseProjId = "33110000020210100017";

baseinfoService.update(Wrappers.lambdaUpdate(GovBizProjectBaseinfo.class)
.eq(GovBizProjectBaseinfo::getBaseProjId,baseProjId)


Loading…
Cancel
Save