package com.zcloud.personnel.positioning.dto;

import com.alibaba.cola.dto.PageQuery;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;

/**
 * web-client
 *
 * @Author fangjiakai
 * @Date 2026-07-07
 */
@Data
public class SyncTaskPageQry extends PageQuery {
    @ApiModelProperty(value = "主键", name = "eqId")
    private Long eqId;

    @ApiModelProperty(value = "任务编码", name = "eqTaskCode")
    private String eqTaskCode;

    @ApiModelProperty(value = "任务名称", name = "likeTaskName")
    private String likeTaskName;

    @ApiModelProperty(value = "业务类型 ORG/STAFF/TERMINAL/FENCE/ALARM_RULE/ALARM/CALLBACK", name = "eqBizType")
    private String eqBizType;

    @ApiModelProperty(value = "企业id/公司id（公司及子公司数据隔离）", name = "eqCorpinfoId")
    private String eqCorpinfoId;

    @ApiModelProperty(value = "企业名称/公司名称", name = "likeCorpinfoName")
    private String likeCorpinfoName;

    @ApiModelProperty(value = "同步方向 PUSH推送 PULL拉取", name = "eqSyncDirection")
    private String eqSyncDirection;

    @ApiModelProperty(value = "定时表达式", name = "eqCronExpr")
    private String eqCronExpr;

    @ApiModelProperty(value = "是否启用", name = "eqEnabled")
    private Integer eqEnabled;

    @ApiModelProperty(value = "上次执行时间", name = "geLastExecuteTime")
    private LocalDateTime geLastExecuteTime;

    @ApiModelProperty(value = "上次执行时间", name = "leLastExecuteTime")
    private LocalDateTime leLastExecuteTime;

    @ApiModelProperty(value = "下次执行时间", name = "geNextExecuteTime")
    private LocalDateTime geNextExecuteTime;

    @ApiModelProperty(value = "下次执行时间", name = "leNextExecuteTime")
    private LocalDateTime leNextExecuteTime;

    @ApiModelProperty(value = "上次执行状态", name = "eqLastStatus")
    private String eqLastStatus;

    @ApiModelProperty(value = "上次执行信息", name = "eqLastMessage")
    private String eqLastMessage;

    @ApiModelProperty(value = "删除标识 TRUE/FALSE", name = "eqDeleteEnum")
    private String eqDeleteEnum;

    @ApiModelProperty(value = "备注", name = "eqRemarks")
    private String eqRemarks;

    @ApiModelProperty(value = "创建人姓名", name = "likeCreateName")
    private String likeCreateName;

    @ApiModelProperty(value = "更新人姓名", name = "likeUpdateName")
    private String likeUpdateName;

    @ApiModelProperty(value = "租户id", name = "eqTenantId")
    private Long eqTenantId;

    @ApiModelProperty(value = "单位id", name = "eqOrgId")
    private Long eqOrgId;

    @ApiModelProperty(value = "环境", name = "eqEnv")
    private String eqEnv;

    @ApiModelProperty(value = "版本", name = "eqVersion")
    private Integer eqVersion;

    @ApiModelProperty(value = "创建时间", name = "geCreateTime")
    private LocalDateTime geCreateTime;

    @ApiModelProperty(value = "创建时间", name = "leCreateTime")
    private LocalDateTime leCreateTime;

    @ApiModelProperty(value = "修改时间", name = "geUpdateTime")
    private LocalDateTime geUpdateTime;

    @ApiModelProperty(value = "修改时间", name = "leUpdateTime")
    private LocalDateTime leUpdateTime;

    @ApiModelProperty(value = "创建人id", name = "eqCreateId")
    private Long eqCreateId;

    @ApiModelProperty(value = "更新人id", name = "eqUpdateId")
    private Long eqUpdateId;

    public Map<String, Object> toHashMap() {
        Map<String, Object> map = new HashMap<>();
        Class<?> clazz = this.getClass();
        while (clazz != null) {
            Field[] fields = clazz.getDeclaredFields();
            for (Field field : fields) {
                try {
                    field.setAccessible(true);
                    map.put(field.getName(), field.get(this));
                } catch (IllegalAccessException e) {
                    throw new IllegalStateException(e);
                }
            }
            clazz = clazz.getSuperclass();
        }
        return map;
    }
}
