package com.njcn.rdms.module.project.dal.dataobject.workreport.project;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.njcn.rdms.framework.mybatis.core.dataobject.BaseDO;
import com.njcn.rdms.module.project.dal.dataobject.workreport.common.WorkReportMemberSnapshotItem;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 工作报告-项目半月报主表。
 */
@TableName(value = "rdms_work_report_project_report", autoResultMap = true)
@Data
@EqualsAndHashCode(callSuper = true)
public class ProjectReportDO extends BaseDO {

    @TableId
    private Long id;

    private Long projectId;

    private String projectName;

    private Long projectOwnerId;

    private String projectOwnerName;

    @TableField(updateStrategy = FieldStrategy.ALWAYS)
    private String technicalOwnerName;

    @TableField(typeHandler = JacksonTypeHandler.class, updateStrategy = FieldStrategy.ALWAYS)
    private List<WorkReportMemberSnapshotItem> projectMemberSnapshot;

    private Long supervisorUserId;

    private String supervisorName;

    private String periodKey;

    private String periodLabel;

    private LocalDate periodStartDate;

    private LocalDate periodEndDate;

    private Integer flag;

    private String statusCode;

    @TableField(updateStrategy = FieldStrategy.ALWAYS)
    private String projectStatusDesc;

    @TableField(updateStrategy = FieldStrategy.ALWAYS)
    private String projectProgressPlan;

    @TableField(updateStrategy = FieldStrategy.ALWAYS)
    private String projectKeyPoints;

    @TableField(updateStrategy = FieldStrategy.ALWAYS)
    private String projectProblems;

    @TableField(updateStrategy = FieldStrategy.ALWAYS)
    private BigDecimal totalWorkHours;

    @TableField(updateStrategy = FieldStrategy.ALWAYS)
    private LocalDateTime submitTime;

    @TableField(updateStrategy = FieldStrategy.ALWAYS)
    private LocalDateTime approvalTime;

    @TableField(updateStrategy = FieldStrategy.ALWAYS)
    private String approvalComment;

    @TableField(updateStrategy = FieldStrategy.ALWAYS)
    private String lastStatusReason;
}
