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 RegionSecGridExcelImportVO {

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

    @Excel(name = "一级网格名称")
    @NotNull(message = "网格编码不能为空！")
    private String topGridName;

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

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

    @Excel(name = "关联柜员号")
    @NotNull(message = "关联柜员不能为空！")
    private String userList;

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


}
