package com.bohuikeji.delivery.backstage.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bohuikeji.frame.module.admin.annotation.TableKeyField;
import com.bohuikeji.frame.module.admin.annotation.TableNewField;
import com.bohuikeji.frame.module.admin.annotation.TableQueryField;
import com.bohuikeji.frame.module.admin.annotation.TableShowField;
import com.bohuikeji.frame.module.admin.base.EntityBase;
import com.bohuikeji.frame.module.admin.entity.sys.SysUser;
import com.bohuikeji.frame.module.admin.entity.web.block.FileBlock;
import com.bohuikeji.frame.module.admin.entity.web.block.SelectBlock;
import com.bohuikeji.frame.module.admin.entity.web.block.TextBlock;
import com.bohuikeji.frame.module.admin.enums.ColumnTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * 订单异常记录表实体类
 */
@Data
@Accessors(chain = true)
@ApiModel(value="tOrderExceptionEntity对象", description="订单异常记录表")
@TableName("t_order_exception")
public class TOrderExceptionEntity extends EntityBase<TOrderExceptionEntity> {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "订单异常id")
    @TableId(value = "exception_id", type = IdType.AUTO)
    @TableShowField(value = "ID",id = true)
    @TableNewField(show = false)
    private Integer exceptionId;

    @TableField("exception_types")
    @TableShowField("异常原因")
    @TableQueryField(like = false)
    @TableNewField(edit = false)
    private String exceptionTypes;

    @TableField("config_id")
    @TableShowField(value = "字典ID",show = false)
    private Integer configId;

    @TableField("content")
    @TableShowField("详情描述")
    @TableNewField(edit = false,block = TextBlock.class)
    private String content;

    @TableField("order_id")
    @TableShowField(value = "订单id",show = false)
    private Integer orderId;

    @TableField("order_num")
    @TableShowField("订单编号")
    @TableQueryField(show = false)
    @TableNewField(edit = false)
    private String orderNum;

    @TableField("logistics_num")
    @TableShowField(value = "物流单号",show = false)
    @TableQueryField(show = false)
    @TableNewField(edit = false)
    private String logisticsNum;

    @TableField("courier_id")
    @TableShowField("上报派送员")
    @TableQueryField(like = false)
    @TableKeyField(table = "t_courier",keyShowFields = {"courier_name"},keyLikeFields = {"courier_name"},key = TCourier.class)
    @TableNewField(edit = false,block = SelectBlock.class)
    private Integer courierId;

    @TableField("create_date")
    @TableShowField("提交时间")
    @TableQueryField(sort = 0,like = false)
    @TableNewField(edit = false)
    private LocalDateTime createDate=LocalDateTime.now();

    @TableField("photo")
    @TableShowField(value = "照片",type = ColumnTypeEnum.IMAGE)
    @TableNewField(block = FileBlock.class)
    private String photo;

    @TableField("rmk")
    @TableShowField(value = "管理员备注",show = false)
    @TableNewField(block = TextBlock.class)
    private String rmk;

    @TableField("end_way")
    @TableShowField(value = "处理方式",show = false)
    @TableNewField(block = TextBlock.class,edit = false)
    private String endWay;

    @TableField("end_time")
    @TableShowField(value = "处理时间",show = false)
    @TableNewField(edit = false)
    private LocalDateTime endTime;

    @TableField("end_user")
    @TableShowField(value = "处理人")
    @TableKeyField(table = "sys_user",keyShowFields = {"user_name"},keyLikeFields = {"user_name"},key = SysUser.class)
    @TableNewField(edit = false)
    private Integer endUser;

    @TableField("exception_status")
    @TableShowField("处理状态")
    @TableQueryField(like = false)
    @TableNewField(options = {"待处理","处理完成"},edit = false)
    private String status="待处理";
}
