package com.yccrc.kede.vo;

import com.yccrc.common.utils.StringUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;


@Data
@ApiModel(value = "项目查询")
public class ProjectQueryVO {

    @ApiModelProperty(value = "企业ID")
    private Integer entId;

    @ApiModelProperty(value = "省ID")
    private String provinceId;

    /**
     * 地ID
     */
    @ApiModelProperty(value = "地ID")
    private String cityId;

    /**
     * 区域ID
     */
    @ApiModelProperty(value = "区域ID")
    private String districtId;

    /**
     * 支持多个年份查询
     */
    @ApiModelProperty(value = "支持多个年份逗号分割")
    private String year;

    private String entName;

    private String license;

    private String projectNo;

    private String projectName;

    private List<Integer> yearList = new ArrayList<>();

    private Integer reportState;

    /**
     * 转换为List数组查询
     *
     * @param year
     */
    public void setYear(String year) {
        if (StringUtils.isNotEmpty(year)) {
            String[] split = year.split(",");
            for (String s : split) {
                yearList.add(Integer.parseInt(s));
            }
        }
    }
}
