package com.zcloud.safetyDutyList.domain.model.tasklist;

import com.jjb.saas.framework.domain.model.BaseE;
import com.zcloud.gbscommon.utils.Tools;
import lombok.Data;
import org.springframework.util.ObjectUtils;

import java.time.LocalDateTime;

/**
 * 反馈异常领域模型
 * <p>
 * 对应数据库表safety_accountability_feedback_exception，
 * 包含异常周期标识、异常类型、异常时间等字段。
 * 由定时任务2（反馈异常检测）自动创建。
 */
@Data
public class FeedbackExceptionE extends BaseE {
    private Long id;
    private String feedbackExceptionId;
    private String taskDetailId;
    private String taskExecutionId;
    private String taskListId;
    private String taskIssueId;
    private String exceptionPeriodFlag;
    private LocalDateTime exceptionPeriodStartTime;
    private LocalDateTime exceptionPeriodEndTime;
    private Integer exceptionType;
    private String exceptionContent;
    private LocalDateTime exceptionTime;

    public void init() {
        if (ObjectUtils.isEmpty(this.feedbackExceptionId)) {
            setFeedbackExceptionId(Tools.get32UUID());
        }
    }
}
