Kaynağa Gözat

Merge branch 'master' of http://git.ningdatech.com/liushuai/project-management into dev

tags/24080901
CMM 1 yıl önce
ebeveyn
işleme
037abd7b9c
1 değiştirilmiş dosya ile 25 ekleme ve 0 silme
  1. +25
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java

+ 25
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java Dosyayı Görüntüle

@@ -10,6 +10,7 @@ import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.basic.util.NdDateUtils;
import com.ningdatech.pmapi.common.constant.BizConst;
import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.common.util.ExcelDownUtil;
import com.ningdatech.pmapi.common.util.ExcelExportStyle;
@@ -154,6 +155,30 @@ public class ProjectRenewalFundManage {
declaration.setUpdateOn(LocalDateTime.now());
}
BeanUtils.copyProperties(dto,declaration);

//有2个条件要判断 续建资金
//1. 如果有审核中的 是不能继续申请的
long pendingCount = projectRenewalFundDeclarationService.count(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class)
.eq(ProjectRenewalFundDeclaration::getProjectId, projectId)
.eq(ProjectRenewalFundDeclaration::getApprovalStatus, ProjectRenewalApprovalStatusEnum.PENDING.name()));
VUtils.isTrue(pendingCount > 0L).throwMessage("当前有在审核的续建项目 不能再申请了");

//2.是要当前最新资金的下年度 才能申请
VUtils.isTrue(Objects.isNull(dto.getProjectYear())).throwMessage("新建的续建项目信息 年度不能为空");
ProjectRenewalFundDeclaration lastRenewalFund = projectRenewalFundDeclarationService.getOne(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class)
.eq(ProjectRenewalFundDeclaration::getProjectId, projectId)
.eq(ProjectRenewalFundDeclaration::getApprovalStatus,ProjectRenewalApprovalStatusEnum.PASS.name())
.orderByDesc(ProjectRenewalFundDeclaration::getProjectYear)
.last(BizConst.LIMIT_1));
//如果没有续建资金信息 就要比 当前项目的年度要大
if(Objects.isNull(lastRenewalFund)){
VUtils.isTrue(project.getProjectYear() >= dto.getProjectYear())
.throwMessage("续建资金年度错误!");
}else{
VUtils.isTrue(lastRenewalFund.getProjectYear() >= dto.getProjectYear())
.throwMessage("续建资金年度错误!");
}

declaration.setApprovalStatus(ProjectRenewalApprovalStatusEnum.PENDING.name());
declaration.setRegionCode(project.getAreaCode());
declaration.setOrgCode(project.getBuildOrgCode());


Yükleniyor…
İptal
Kaydet