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.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 安全责任清单领域模型
 * <p>
 * 对应数据库表safety_accountability_task_list，
 * 包含清单的基本信息、状态、周期、下发信息等字段。
 */
@Data
public class TaskListE extends BaseE {
    private Long id;
    private String taskListId;
    private String taskListName;
    private Integer taskLevel;
    private String responsibilityPost;
    private Integer switchFlag;
    private Integer status;
    private LocalDateTime periodStartTime;
    private LocalDateTime periodEndTime;
    private BigDecimal ratingScore;
    private Long ratingUserId;
    private Long ratingDepartmentId;
    private Long createCorpId;
    private Long createDepartmentId;
    private Long createUserId;
    private Integer issueStatus;
    private LocalDateTime issueTime;
    private Long executeCorpId;
    private Long executeDepartmentId;
    private Long executeUserId;
    private LocalDateTime closeTime;

    public void init() {
        if (ObjectUtils.isEmpty(this.taskListId)) {
            setTaskListId(Tools.get32UUID());
        }
    }
}
