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_list_issue，
 * 包含下发对象、周期、状态、评分等执行相关字段。
 */
@Data
public class TaskListIssueE extends BaseE {
    private Long id;
    private String taskIssueId;
    private String taskListId;
    private Long executeCorpId;
    private Long executeDepartmentId;
    private Long executeUserId;
    private Integer issueStatus;
    private LocalDateTime issueTime;
    private Long issueCorpId;
    private Long issueDepartmentId;
    private Long issueUserId;
    private LocalDateTime periodStartTime;
    private LocalDateTime periodEndTime;
    private Integer status;
    private LocalDateTime closeTime;
    private BigDecimal ratingScore;
    private Long ratingUserId;
    private Long ratingDepartmentId;

    public void init() {
        if (ObjectUtils.isEmpty(this.taskIssueId)) {
            setTaskIssueId(UuidUtil.get32UUID());
        }
    }
}
