@@ -57,8 +57,12 @@ public enum ProjectStatusEnum { | |||||
*/ | */ | ||||
PROJECT_APPROVED(20000, "已立项", null), | PROJECT_APPROVED(20000, "已立项", null), | ||||
TO_BE_PURCHASED(20001, "待采购", GovProjectStatusEnum.APPROVED), | TO_BE_PURCHASED(20001, "待采购", GovProjectStatusEnum.APPROVED), | ||||
ON_PURCHASING(20007, "采购中", GovProjectStatusEnum.APPROVED), | |||||
UNDER_CONSTRUCTION(20002, "建设中", null), | UNDER_CONSTRUCTION(20002, "建设中", null), | ||||
TO_BE_FINALLY_INSPECTED(20003, "待终验", GovProjectStatusEnum.HAS_PRE_INS), | TO_BE_FINALLY_INSPECTED(20003, "待终验", GovProjectStatusEnum.HAS_PRE_INS), | ||||
ON_FINALLY_INSPECTED(20010, "终验中", GovProjectStatusEnum.HAS_PRE_INS), | |||||
TO_BE_FIRST_INSPECTED(20008, "待初验", null), | |||||
ON_FIRST_INSPECTED(20009, "初验中", null), | |||||
FINAL_ACCEPTANCE_IS_UNDER_REVIEW(20004, "终验审核中", null), | FINAL_ACCEPTANCE_IS_UNDER_REVIEW(20004, "终验审核中", null), | ||||
FINAL_ACCEPTANCE_REVIEW_FAILED(20005, "终验审核不通过", null), | FINAL_ACCEPTANCE_REVIEW_FAILED(20005, "终验审核不通过", null), | ||||
OPERATION(20006, "待开工", GovProjectStatusEnum.PURCHASED), | OPERATION(20006, "待开工", GovProjectStatusEnum.PURCHASED), | ||||
@@ -0,0 +1,55 @@ | |||||
package com.hz.pm.api.projectlib.model.enumeration; | |||||
import cn.hutool.core.util.StrUtil; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.Getter; | |||||
import java.util.Arrays; | |||||
import java.util.Optional; | |||||
/** | |||||
* <p> | |||||
* 标段状态 | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 15:49 2024/2/23 | |||||
*/ | |||||
@Getter | |||||
@AllArgsConstructor | |||||
public enum TenderStatusEnum { | |||||
DTXCGXX(ProjectStatusEnum.ON_PURCHASING, 101, "待填写采购信息"), | |||||
DTXHTXX(ProjectStatusEnum.ON_PURCHASING, 102, "待填写合同信息"), | |||||
DTXSSJH(ProjectStatusEnum.ON_PURCHASING, 103, "待填写实施计划"), | |||||
DSCCYCL(ProjectStatusEnum.TO_BE_FIRST_INSPECTED, 201, "待上传初验材料"), | |||||
DXCFHXSQ(ProjectStatusEnum.ON_FIRST_INSPECTED, 301, "待信创符合性申请"), | |||||
XCFHXSQZ(ProjectStatusEnum.ON_FIRST_INSPECTED, 302, "信创符合性申请中"), | |||||
XCFHXSQSB(ProjectStatusEnum.ON_FIRST_INSPECTED, 303, "信创符合性申请不通过"), | |||||
DZYSB(ProjectStatusEnum.ON_FIRST_INSPECTED, 401, "待终验申报"), | |||||
ZYSQZ(ProjectStatusEnum.ON_FINALLY_INSPECTED, 501, "终验申报中"), | |||||
ZYSQSB(ProjectStatusEnum.ON_FINALLY_INSPECTED, 502, "终验申报不同过"), | |||||
ZYWC(ProjectStatusEnum.ACCEPTED, 601, "终验完成"); | |||||
private final ProjectStatusEnum projectStatus; | |||||
private final Integer tenderStatus; | |||||
private final String desc; | |||||
public boolean eq(Integer tenderStatus) { | |||||
return this.getTenderStatus().equals(tenderStatus); | |||||
} | |||||
public static TenderStatusEnum getByStatus(Integer tenderStatus) { | |||||
return Arrays.stream(values()) | |||||
.filter(w -> w.eq(tenderStatus)) | |||||
.findFirst() | |||||
.orElse(null); | |||||
} | |||||
public static String getDescByStatus(Integer tenderStatus) { | |||||
return Optional.ofNullable(getByStatus(tenderStatus)) | |||||
.flatMap(w -> Optional.of(w.getDesc())) | |||||
.orElse(StrUtil.EMPTY); | |||||
} | |||||
} |