package com.microservices.zone.project.domain;

import com.microservices.common.core.annotation.Excel;
import com.microservices.common.core.web.domain.BaseEntity;
import com.microservices.system.api.domain.SysDept;
import com.microservices.zone.project.domain.vo.ZoneProjectDataVo;
import lombok.Data;

/**
 * 特色专区项目聚合对象 zone_project
 *
 * @author otto
 * @date 2023-05-11
 */
@Data
public class ZoneProject extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 项目聚合主键
     */
    private Long id;

    /**
     * 项目名称
     */
    @Excel(name = "项目名称")
    private String name;
    /**
     * 排序
     */
    @Excel(name = "排序")
    private Integer sort;

    /**
     * gitlink项目完整路径
     */
    @Excel(name = "gitlink项目完整路径")
    private String fullName;

    /**
     * gitlink项目Id
     */
    @Excel(name = "gitlink项目Id")
    private Long gitlinkProjectId;


    /**
     * 聚合项目类型
     */
    @Excel(name = "聚合项目类型")
    private Long projectTypeId;

    /**
     * 所属组织Id
     */
    @Excel(name = "所属组织Id")
    private Long deptId;

    /**
     * 所属专区Id
     */
    @Excel(name = "所属专区Id")
    private Long zoneId;

    /**
     * 所属组织
     */
    private SysDept dept;

    /**
     * 项目聚合类型
     */
    private ZoneProjectType zoneProjectType;

    /**
     * 删除标志（0代表存在 2代表删除）
     */
    private String delFlag;

    /**
     * 是否首页展示（0代表不展示 1代表展示）
     */
    private String isHomepage;

    public ZoneProjectDataVo toZoneProjectDataVo() {
        ZoneProjectDataVo zoneProjectDataVo = new ZoneProjectDataVo();
        zoneProjectDataVo.setId(this.getId());
        zoneProjectDataVo.setDeptName(this.getDept().getDeptName());
        zoneProjectDataVo.setProjectType(this.getZoneProjectType().getName());
        zoneProjectDataVo.setProjectTypeId(this.getProjectTypeId());
        zoneProjectDataVo.setIsHomepage(this.getIsHomepage());
        zoneProjectDataVo.setZoneId(this.getZoneId());
        zoneProjectDataVo.setSort(this.getSort());
        zoneProjectDataVo.setGitlinkProjectId(this.getGitlinkProjectId());
        return zoneProjectDataVo;
    }
}
