package com.ruoyi.ibs.grid.domain.excel;

import com.ruoyi.common.annotation.Excel;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.util.Objects;

/**
 * @Author 吴凯程
 * @Date 2025/2/21
 **/
@Data
public class RegionTopGridExcelDTO {

    @Excel(name = "网格名")
    @NotNull(message = "网格名不能为空！")
    private String gridName;

    @Excel(name = "网格责任类型", readConverterExp = "1=责任网格,2=竞争网格", combo = "责任网格,竞争网格")
    @NotNull(message = "责任类型不能为空！")
    private String gridDutyType;

    @Excel(name = "关联行政区划（行政区县-行政街道-行政村）")
    @NotNull(message = "关联行政区划不能为空！")
    private String adminDivisionList;

    @Excel(name = "关联机构")
    @NotNull(message = "关联机构不能为空！")
    private String deptList;

    public Boolean isValid() {
        if (Objects.isNull(gridName) || Objects.isNull(gridDutyType) || Objects.isNull(adminDivisionList) || Objects.isNull(deptList)){
            return false;
        }
        if (gridName.isEmpty() || gridDutyType.isEmpty() || adminDivisionList.isEmpty() || deptList.isEmpty()){
            return false;
        }
        return true;
    }


}
