package cn.ezhizao.project.business.workOrder.domain;

import cn.ezhizao.framework.aspectj.lang.annotation.Excel;
import cn.ezhizao.framework.web.domain.BaseEntity;
import cn.ezhizao.project.business.entrust.domain.BizEntrust;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * 工单信息对象 biz_work_order
 *
 * @author ruoyi
 * @date 2023-10-16
 */
@Data
@TableName(value = "biz_work_order")
public class BizWorkOrder extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 合同外键
     */
    @ApiModelProperty(value = "${comment}")
    private Long contractId;

    /**
     * 客户外键
     */
    @ApiModelProperty(value = "${comment}")
    private Long companyId;

    @ApiModelProperty("客户名称")
    @Excel(name = "客户名称", sort = 1)
    @TableField(exist = false)
    private String companyName;

    @Excel(name = "税号", width = 30, sort = 2)
    @ApiModelProperty("税号")
    @TableField(exist = false)
    private String socialCreditCode;

    @ApiModelProperty("合同明细外键")
    private Long contractDetailId;

    @ApiModelProperty("合同流程外键")
    private Long contractDetailProcessId;

    /**
     * 工单类型 1循环 2代办
     */
//    @Excel(name = "工单类型 1循环 2代办")
    @ApiModelProperty(value = "工单类型 1循环 2代办")
    private Integer type;

    /**
     * 工单类型 1循环 2代办
     */
    @Excel(name = "工单类型", sort = 3)
    @ApiModelProperty(value = "工单类型 1循环 2代办")
    private String orderType;

    /**
     * 无合同
     */
    @ApiModelProperty(value = "无合同")
    private Integer noContract;

    /**
     * 编号
     */
    @ApiModelProperty(value = "编号")
    private String workOrderNo;

    /**
     * 任务类型 任务表外键 任务明细表
     */
    @ApiModelProperty(value = "任务外键")
    private Long taskTypeId;

    @TableField(exist = false)
    private String taskTypeName;

    @Excel(name = "项目", sort = 4)
    @TableField(exist = false)
    private String projectType;

    /**
     * 任务类型 任务表外键 任务明细表
     */
    @ApiModelProperty(value = "任务明细外键")
    private Long taskTypeDetailId;

    @TableField(exist = false)
    private String taskTypeDetailName;

    /**
     * 开始月
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
//    @Excel(name = "开始月", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "开始月")
    private Date startMonth;

    /**
     * 结束月
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
//    @Excel(name = "结束月", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "结束月")
    private Date endMonth;

    /**
     * 月数
     */
//    @Excel(name = "月数")
    @ApiModelProperty(value = "月数")
    private Integer monthNum;

    /**
     * 负责人
     */
    @ApiModelProperty(value = "月数")
    private Long managerId;

    /**
     * 主程序账套外键
     */
    @ApiModelProperty(value = "月数")
    private Long tenantId;

    /**
     * 停止任务
     */
//    @Excel(name = "停止任务")
    @ApiModelProperty(value = "停止任务")
    private Integer isStop;


    //    @Excel(name = "注册省份编码")
    @ApiModelProperty(value = "注册省份编码")
    private String provinceCode;

    /**
     * 省
     */
//    @Excel(name = "省")
    @ApiModelProperty(value = "省")
    private String province;

    /**
     * 注册城市编码
     */
//    @Excel(name = "注册城市编码")
    @ApiModelProperty(value = "注册城市编码")
    private String cityCode;

    /**
     * 市
     */
//    @Excel(name = "市")
    @ApiModelProperty(value = "市")
    private String city;

    /**
     * 注册行政区编码
     */
//    @Excel(name = "注册行政区编码")
    @ApiModelProperty(value = "注册行政区编码")
    private String districtCode;

    /**
     * 区
     */
//    @Excel(name = "区")
    @ApiModelProperty(value = "区")
    private String district;

    @TableField(exist = false)
    private List<BizWorkOrderRecord> records;
    @TableField(exist = false)
    private List<BizWorkOrderDetail> details;

    /**
     * 服务管理查询条件
     */
    @TableField(exist = false)
    private Integer status;

    @Excel(name = "状态", sort = 20)
    @TableField(exist = false)
    private String statusType;

    @TableField(exist = false)
    private String year;
    @TableField(exist = false)
    private String month;

    @ApiModelProperty("服务人员")
    private Long serviceId;

    @Excel(name = "执行人", sort = 6)
    @TableField(exist = false)
    private String serviceName;

    @TableField(exist = false)
    private List<Long> ids;

    @TableField(exist = false)
    private BizEntrust entrust;
    @TableField(exist = false)
    private BizWorkOrderRecord record;

    //是否为自己负责(当前登陆人Id)
    @TableField(exist = false)
    private Long principal;
    @TableField(exist = false)
    private String alterType;
    @TableField(exist = false)
    private Integer addressStyle;
    @TableField(exist = false)
    private Long fictionAddressId;
    @TableField(exist = false)
    private String inputProvince;
    @TableField(exist = false)
    private String inputCity;
    @TableField(exist = false)
    private String inputDistrict;
    @TableField(exist = false)
    private String explain;

    /**
     * 办理人时间
     */
    @Excel(name = "领取时间", sort = 8, dateFormat = "yyyy-MM-dd HH:mm")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    @TableField(exist = false)
    private Date handlerTime;
    @TableField(exist = false)
    @Excel(name = "领取人", sort = 7)
    private String handlerName;


    @TableField(exist = false)
    @Excel(name = "完成人", sort = 9)
    private String recorderName;
    /**
     * 委托时间
     */
    @TableField(exist = false)
    @Excel(name = "委托时间", sort = 5, dateFormat = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date entrustTime;

    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    @Excel(name = "完成时间", sort = 10, dateFormat = "yyyy-MM-dd HH:mm")
    private Date finishTime;

    @TableField(exist = false)
    private Integer recordStatus;

    @TableField(exist = false)
    private String accountName;
}
