package com.ningdatech.pmapi.projectlib.model.vo;

import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Objects;
import java.util.Optional;

/**
 * <p>
 * 项目归集对象
 * </p>
 *
 * @author ZPF
 * @since 2023-06-21
 */
@Data
@ApiModel(value = "ProjectCollectionVO", description = "项目归集对象")
public class ProjectCollectionVO implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键")
    private Long id;

    @ApiModelProperty("项目编号")
    private String projectCode;

    @ApiModelProperty("所属地区编号")
    private String areaCode;

    @ApiModelProperty("立项依据")
    private String buildBasis;

    @ApiModelProperty("所属地区名称")
    private String area;

    @ApiModelProperty("项目阶段")
    private Integer stage;

    @ApiModelProperty("项目状态")
    private Integer status;

    @ApiModelProperty("项目名称")
    private String projectName;

    @ApiModelProperty("项目负责人")
    private String responsibleMan;

    @ApiModelProperty("负责人手机号码")
    private String responsibleManMobile;

    @ApiModelProperty("项目联系人")
    private String contactName;

    @ApiModelProperty("项目联系人手机号码")
    private String contactPhone;

    @ApiModelProperty("建设单位名称")
    private String buildOrg;

    @ApiModelProperty("建设单位统一社会信用代码")
    private String orgCreditCode;

    @ApiModelProperty("公司编码code")
    private String buildOrgCode;

    @ApiModelProperty("项目类型 1:建设 2:运维")
    private Integer projectType;

    @ApiModelProperty("建设类型 1软件，2硬件，3服务")
    private Integer constructionType;

    @ApiModelProperty("预算来源")
    private Integer budgetSource;

    @ApiModelProperty("是否首次新建 0:否 1:是")
    private Integer isFirst;

    @ApiModelProperty("项目预算年度")
    private Integer projectYear;

    @ApiModelProperty("建设层级 1:国家级 2:省级 3:省本级 4:市级 5:市本级 6:区县 7乡镇")
    private Integer buildLevel;

    @ApiModelProperty("发改编码")
    private String developCode;

    @ApiModelProperty("财政编码")
    private String financialCode;

    @ApiModelProperty("项目简介")
    private String projectIntroduction;

    @ApiModelProperty("资金申报情况-申报金额(万元)")
    private BigDecimal declareAmount;

    @ApiModelProperty("立项批复资金(万元)")
    private BigDecimal approvalAmount;

    @ApiModelProperty("关联应用")
    private String applicationName;

    @ApiModelProperty("关联应用IRS编码")
    private String applicationIrsCode;

    private LocalDateTime createOn;
    private LocalDateTime updateOn;
    private String createBy;
    private String updateBy;

    @ApiModelProperty("可行性研究报告")
    private String feasibilityStudyReport;

    @ApiModelProperty("立项批复文件")
    private String approvedFile;

    @ApiModelProperty("采购文件")
    private String purchaseFile;

    @ApiModelProperty("中标通知书")
    private String acceptanceLetter;

    @ApiModelProperty("采购合同")
    private String purchaseContract;

    @ApiModelProperty("验收报告")
    private String acceptanceReport;

    @ApiModelProperty("变更批复文件")
    private String changeApprovalDoc;

    @ApiModelProperty("承建单位")
    private String constructionOrg;

    @ApiModelProperty("承建单位统一信用编码")
    private String constructionOrgCreditCode;

    @ApiModelProperty("监理单位")
    private String supervisorOrg;

    @ApiModelProperty("监理单位统一信用编码")
    private String supervisorOrgCreditCode;

    @ApiModelProperty("主管部门名称")
    private String superOrg;

    @ApiModelProperty("主管部门Code")
    private String superOrgCode;

    @ApiModelProperty("上级条线主管部门")
    private String higherSuperOrg;

    @ApiModelProperty("上级主管部门Code")
    private String higherSuperOrgCode;

    private String projectTypeName;

    public String getProjectTypeName() {
        if (Objects.nonNull(this.projectType)) {
            Optional.ofNullable(ProjectTypeEnum.getDesc(this.projectType))
                    .ifPresent(desc -> this.projectTypeName = desc);
        }
        return this.projectTypeName;
    }
}
