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

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

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 任务执行记录领域模型
 * <p>
 * 对应数据库表safety_accountability_task_execution，
 * 包含任务执行状态、反馈状态、评分等执行相关字段。
 */
@Data
public class TaskExecutionE extends BaseE {
    private Long id;
    private String taskExecutionId;
    private String taskIssueId;
    private String taskDetailId;
    private String taskListId;
    private Integer taskStatus;
    private Integer feedbackStatus;
    private BigDecimal taskRating;
    private LocalDateTime ratingTime;
    private Long ratingDepartmentId;
    private Long ratingUserId;

    public void init() {
        if (ObjectUtils.isEmpty(this.taskExecutionId)) {
            setTaskExecutionId(UuidUtil.get32UUID());
        }
    }
}
