package com.tuoheng.admin.request.cycle;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 添加周期任务
 *
 * @author wanjing
 * @team tuoheng
 * @date 2023-08-23
 */
@Data
@Accessors(chain = true)
public class AddInspectionCycleRequest {

    private static final long serialVersionUID = 1L;

    /**
     * 任务名称
     */
    private String name;

    /**
     * 任务描述
     */
    private String note;

    /**
     * 巡检公路id
     */
    private String roadId;

    /**
     * 巡检路段id
     */
    private String sectionId;

    /**
     * 机场任务ID
     */
    private Integer airportTaskId;

    /**
     * 巡检机场id
     */
    private Integer airportId;

    /**
     * 航线id
     */
    private Integer airportLineId;

    /**
     * 航线长度
     */
    private Double airportLineLength;

    /**
     * 巡检无人机id
     */
    private Integer droneId;

    /**
     * 执行类型：1,单次;2,每天; 5,每周;6,每月
     */
    private Integer type;

    /**
     * 单次执行时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(updateStrategy = FieldStrategy.IGNORED)//添加忽略判断，该字段值不论是什么，都进行更新
    private String singleTime;

    /**
     * 每天执行时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(updateStrategy = FieldStrategy.IGNORED)//添加忽略判断，该字段值不论是什么，都进行更新
    private String everydayTime;


    /**
     * 循环执行时间
     */
    @DateTimeFormat(pattern = "HH:mm:ss")
    @JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8")
    @TableField(updateStrategy = FieldStrategy.IGNORED)//添加忽略判断，该字段值不论是什么，都进行更新
    private String cycleTime;

    /**
     * 循环下次执行时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(updateStrategy = FieldStrategy.IGNORED)//添加忽略判断，该字段值不论是什么，都进行更新
    private String cycleNextTime;

    /**
     * 循环频率：1~7,每周；1~31,每月;多个以引文逗号分隔
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)//添加忽略判断，该字段值不论是什么，都进行更新
    private String cycleFrequency;

    /**
     * 循环开始时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @TableField(updateStrategy = FieldStrategy.IGNORED)//添加忽略判断，该字段值不论是什么，都进行更新
    private String cycleStartTime;

    /**
     * 循环结束时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @TableField(updateStrategy = FieldStrategy.IGNORED)//添加忽略判断，该字段值不论是什么，都进行更新
    private String cycleEndTime;

}
