package com.zt.plat.module.qms.resource.record.controller.admin.recordapply.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.module.infra.api.businessfile.dto.BusinessFileWithUrlRespDTO;
import com.zt.plat.module.qms.core.aspect.annotation.Dict;
import com.zt.plat.module.qms.resource.record.controller.admin.recordapplydetail.vo.RecordApplyDetailRespVO;
import com.zt.plat.module.qms.resource.record.controller.admin.recordassign.vo.RecordAssignRespVO;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

@Schema(description = "管理后台 - 文件记录通用申请 Response VO")
@Data
@ExcelIgnoreUnannotated
public class RecordApplyRespVO {

    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "9976")
    @ExcelProperty("主键")
    private Long id;

    @Schema(description = "申请标题,【字典】【jy_record_apply_bsn_type】分发、查看申请、作废、评审", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("申请标题,【字典】【jy_record_apply_bsn_type】分发、查看申请、作废、评审")
    private String title;

    @Schema(description = "业务类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @ExcelProperty("业务类型")
    @NotEmpty(message = "业务类型不能为空")
    private String businessType;

    @Schema(description = "申请人id", requiredMode = Schema.RequiredMode.REQUIRED, example = "15000")
    @ExcelProperty("申请人id")
    private Long applyUserId;

    @Schema(description = "申请人姓名", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
    @ExcelProperty("申请人姓名")
    private String applyUserName;

    @Schema(description = "部门id", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("部门id")
    private Long applyDepartmentId;

    @Schema(description = "部门名称", example = "研发部")
    @ExcelProperty("部门名称")
    private String applyDepartmentName;

    @Schema(description = "评审时间")
    @ExcelProperty("评审时间")
    private LocalDateTime reviewTime;

    @Schema(description = "评审范围")
    @ExcelProperty("评审范围")
    private String reviewRange;

    @Schema(description = "修改标识")
    private String modifyFlag;

    @Schema(description = "参加评审部门")
    @ExcelProperty("参加评审部门")
    private String targetDepartmentIds;

    @Schema(description = "参加评审人员id")
    @ExcelProperty("参加评审人员id")
    private String targetUserIds;

    @Schema(description = "表单数据")
    @ExcelProperty("表单数据")
    private String formData;

    @Schema(description = "申请事由")
    @ExcelProperty("申请事由")
    private String applyContent;

    @Schema(description = "更改前内容")
    @ExcelProperty("更改前内容")
    private String changeBefore;

    @Schema(description = "更改后内容")
    @ExcelProperty("更改后内容")
    private String changeAfter;

    @Schema(description = "是否长期有效")
    @ExcelProperty("是否长期有效")
    private String permanently;

    @Schema(description = "开始日期")
    @ExcelProperty("开始日期")
    private LocalDateTime applyStartDate;

    @Schema(description = "截止日期")
    @ExcelProperty("截止日期")
    private LocalDateTime applyEndDate;

    @Schema(description = "所属部门")
    @ExcelProperty("所属部门")
    private String systemDepartmentCode;

    @Schema(description = "备注")
    @ExcelProperty("备注")
    private String remark;

    @Schema(description = "流程实例ID")
    @ExcelProperty("流程实例ID")
    private String flowInstanceId;

    @Schema(description = "业务状态")
    @ExcelProperty("业务状态")
    @Dict(dicCode = "flow_status")
    private String businessStatus;

    @Schema(description = "创建时间")
    @ExcelProperty("创建时间")
    private LocalDateTime createTime;

    @Schema(description = "是否提交")
    private Integer isSubmit;

    //    ===================扩展字段=========================
    @Schema(description = "附件对象")
    private CommonResult<List<BusinessFileWithUrlRespDTO>> businessFileRet;

    @Schema(description = "附件上传code")
    @ExcelProperty("附件上传code")
    private String fileUploadBusinessCode = "qms_resource_record_apply";

    //    //    ===============临时字段=================》
    @Schema(description = "明细列表")
    private List<RecordApplyDetailRespVO> detailList;

    private List<RecordAssignRespVO> assignList;


//    ===============临时字段=================》

//    @Schema(description = "文件记录ID")
//    private Long recordId;

//    @Schema(description = "用户IDs")
//    private Long[] userIds;
//
//    @Schema(description = "用户IDs")
//    private Long[] deptIds;


}