ソースを参照

项目申报和归集 的并集

master
PoffyZhang 1年前
コミット
90d7e4e01d
3個のファイルの変更32行の追加11行の削除
  1. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java
  2. +29
    -10
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java
  3. +1
    -1
      pmapi/src/test/java/com/ningdatech/pmapi/projectCollection/ProjectCollection2Test.java

+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java ファイルの表示

@@ -319,6 +319,7 @@ public class ProjectLibManage {
List<ProjectLibListItemVO> records = CollUtils.convert(page.getRecords(), w -> {
ProjectLibListItemVO item = new ProjectLibListItemVO();
item.setId(w.getId());
item.setFromType(w.getFromType());
item.setProjectName(w.getProjectName());
item.setProjectCode(w.getProjectCode());
item.setArea(w.getArea());
@@ -400,6 +401,7 @@ public class ProjectLibManage {
List<ProjectLibListItemVO> records = CollUtils.convert(page.getRecords(), w -> {
ProjectLibListItemVO item = new ProjectLibListItemVO();
item.setId(w.getId());
item.setFromType(w.getFromType());
item.setProjectName(w.getProjectName());
item.setProjectCode(w.getProjectCode());
item.setArea(w.getArea());


+ 29
- 10
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java ファイルの表示

@@ -14,6 +14,10 @@ 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;
import com.ningdatech.pmapi.gov.model.entity.GovBizProjectApply;
import com.ningdatech.pmapi.gov.model.entity.GovBizProjectBaseinfo;
import com.ningdatech.pmapi.gov.service.IGovBizProjectApplyService;
import com.ningdatech.pmapi.gov.service.IGovBizProjectBaseinfoService;
import com.ningdatech.pmapi.projectdeclared.model.dto.ProjectRenewalDeclareExportDTO;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectRenewalApprovalStatusEnum;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
@@ -33,6 +37,7 @@ import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import com.wflow.exception.BusinessException;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;

@@ -60,6 +65,10 @@ public class ProjectRenewalFundManage {

private final IProjectService projectService;

private final IGovBizProjectBaseinfoService baseinfoService;

private final IGovBizProjectApplyService applyService;

/**
* 项目续建资金库列表 分页
* @param req
@@ -138,12 +147,16 @@ public class ProjectRenewalFundManage {
*/
public Long declared(ProjectRenewalFundDeclarationDTO dto) {
//要判断 项目id 是否 以及状态是 已验收
Long projectId = dto.getProjectId();
Project project = projectService.getById(projectId);
VUtils.isTrue(Objects.isNull(project)).throwMessage(String.format("关联的项目【%s】不存在 提交失败!",projectId));
VUtils.isTrue(!ProjectStatusEnum.ACCEPTED.getCode().equals(project.getStatus()) ||
!ProjectStatusEnum.ARCHIVED.getCode().equals(project.getStage()))
.throwMessage("提交失败 该项目不是 已验收状态或者已归档阶段");
String projectCode = dto.getProjectCode();
Project project = projectService.getProjectByCode(projectCode);
GovBizProjectBaseinfo baseinfo = baseinfoService.getOne(Wrappers.lambdaQuery(GovBizProjectBaseinfo.class)
.eq(GovBizProjectBaseinfo::getBaseProjId, projectCode)
.last(BizConst.LIMIT_1));
GovBizProjectApply apply = applyService.getOne(Wrappers.lambdaQuery(GovBizProjectApply.class)
.eq(GovBizProjectApply::getBaseProjId, projectCode)
.last(BizConst.LIMIT_1));

VUtils.isTrue(Objects.isNull(project) && Objects.isNull(baseinfo)).throwMessage(String.format("关联的项目【%s】不存在 提交失败!",projectCode));
ProjectRenewalFundDeclaration declaration = new ProjectRenewalFundDeclaration();
//如果是重新申报
if(Objects.nonNull(dto.getId())){
@@ -159,21 +172,27 @@ public class ProjectRenewalFundManage {
//有2个条件要判断 续建资金
//1. 如果有审核中的 是不能继续申请的
long pendingCount = projectRenewalFundDeclarationService.count(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class)
.eq(ProjectRenewalFundDeclaration::getProjectId, projectId)
.eq(ProjectRenewalFundDeclaration::getProjectCode, projectCode)
.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::getProjectCode, projectCode)
.eq(ProjectRenewalFundDeclaration::getApprovalStatus,ProjectRenewalApprovalStatusEnum.PASS.name())
.orderByDesc(ProjectRenewalFundDeclaration::getProjectYear)
.last(BizConst.LIMIT_1));
//如果没有续建资金信息 就要比 当前项目的年度要大
if(Objects.isNull(lastRenewalFund)){
VUtils.isTrue(project.getProjectYear() >= dto.getProjectYear())
.throwMessage("续建资金年度错误!");
if(Objects.nonNull(project)){
VUtils.isTrue(project.getProjectYear() >= dto.getProjectYear())
.throwMessage("续建资金年度错误!");
}else if(Objects.nonNull(apply)){
VUtils.isTrue(StringUtils.isBlank(apply.getBaseProjSetYear()) ||
Integer.parseInt(apply.getBaseProjSetYear()) >= dto.getProjectYear())
.throwMessage("续建资金年度错误!");
}
}else{
VUtils.isTrue(lastRenewalFund.getProjectYear() >= dto.getProjectYear())
.throwMessage("续建资金年度错误!");


+ 1
- 1
pmapi/src/test/java/com/ningdatech/pmapi/projectCollection/ProjectCollection2Test.java ファイルの表示

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

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


読み込み中…
キャンセル
保存