package com.yc.ship.module.trade.controller.app.otc.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yc.ship.framework.desensitize.core.slider.annotation.MobileDesensitize;
import com.yc.ship.framework.excel.core.annotations.DictFormat;
import com.yc.ship.framework.excel.core.convert.DictConvert;
import com.yc.ship.module.product.controller.admin.voyage.vo.VoyageRespVO;
import com.yc.ship.module.resource.dal.dataobject.route.ResourceRouteDO;
import com.yc.ship.module.trade.controller.admin.order.vo.order.*;
import com.yc.ship.module.trade.dal.dataobject.contract.ContractDO;
import com.yc.ship.module.trade.dal.dataobject.insurance.InsuranceDO;
import com.yc.ship.module.trade.dal.dataobject.order.TradeVisitorDO;
import com.yc.ship.module.trade.dal.dataobject.orderjz.OrderJzDO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

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

import static com.yc.ship.framework.common.util.date.DateUtils.*;

@Schema(description = "APP - 交易订单 Response VO")
@Data
@ExcelIgnoreUnannotated
public class AppTradeOrderDetailRespVO {

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

    @Schema(description = "销售员ID")
    private String sellerId;

    @Schema(description = "是否显示审核流程")
    private Integer isShowAudit;

    @Schema(description = "订单号")
    @ExcelProperty("订单号")
    private String orderNo;

    @Schema(description = "序号")
    private Integer orderSort;

    @Schema(description = "团号")
    @ExcelProperty("团号")
    private String groupNo;

    @Schema(description = "订单状态", example = "1")
    @ExcelProperty("订单号")
    private Integer orderStatus;

    @Schema(description = "支付状态", example = "1")
    private Integer payStatus;

    @Schema(description = "支付方式", example = "2")
    @ExcelProperty(value = "支付方式", converter = DictConvert.class)
    @DictFormat("payment_type")
    private Integer paymentType;

    @Schema(description = "支付方式", example = "2")
    private String paymentTypeName;

    @Schema(description = "支付时间")
//    @ExcelProperty("支付时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
    private LocalDateTime paymentDate;

    @Schema(description = "确认时间")
//    @ExcelProperty("支付时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
    private LocalDateTime confirmDate;

    @Schema(description = "游玩日期")
    @ExcelProperty("出行日期")
    @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = FORMAT_YEAR_MONTH_DAY, timezone = TIME_ZONE_DEFAULT)
    private Date travelDate;

    @Schema(description = "总人数")
    @ExcelProperty("人数")
    private Integer totalPerson;

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

    @Schema(description = "销售来源", example = "31758")
    private String sourceId;

    @Schema(description = "来源名称", example = "张三")
    @ExcelProperty("来源名称")
    private String sourceName;

    @Schema(description = "国籍数据")
    private List<TradeOrderCountryBaseVO> countryList;

    @Schema(description = "人员数据统计")
    private String personStat;

    @Schema(description = "订单汇总信息")
    private TradeOrderTotalVO summary;

    @Schema(description = "游轮ID")
    private Long shipId;

    @Schema(description = "游轮名称")
    @ExcelProperty("游轮名称")
    private String shipName;

    @Schema(description = "航次ID")
    private Long voyageId;

    @Schema(description = "拼房描述")
    private String shareDesc;

    @Schema(description = "游轮航次信息")
    private VoyageRespVO voyage;
    private ResourceRouteDO resourceRouteDO;

    /**
     * 订单金额
     */
    private BigDecimal amount;
    /**
     * 支付金额
     */
    private BigDecimal payAmount;

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

    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

    @Schema(description = "联系人姓名")
    @ExcelProperty("联系人姓名")
    private String contactName;

    @Schema(description = "手机号")
    @ExcelProperty("手机号")
    @MobileDesensitize
    private String mobile;

    @Schema(description = "门店ID")
    private Long storeId;

    @Schema(description = "门店名称")
    @ExcelProperty("门店名称")
    private String storeName;

    @Schema(description = "开票标识:0-未开票，1-开票成功，2-开票失败，3-已开票")
    private Integer isInvoice;

    @Schema(description = "发票下载")
    private String invoiceUrl;

    @Schema(description = "保险")
    private List<InsuranceDO> insuranceList;

    @Schema(description = "合同")
    private List<ContractDO> contractList;

    @Schema(description = "门票信息")
    private List<TradeDetailRespVO> tradeDetailList;

    @Schema(description = "游客信息")
    private List<AppTradeVisitorVO> tradeVisitorList;

    @Schema(description = "接站信息")
    private OrderJzDO orderJz;

    /**
     * 审核流程类型 1:1级别流程 2：2级流程 3：3级流程 4：4级流程
     */
    @Schema(description = "审核流程类型")
    private Integer auditType;
    /**
     * 审核状态 0、无需审核 1、提交审核中  2：审核中 3：审核通过 4：审核不通过
     */
    @Schema(description = "审核状态")
    private Integer auditStatus;

    @Schema(description = "游客信息")
    private List<TradeVisitorRespVO> visitors;

    @Schema(description = "房型信息")
    private List<TradeOrderRoomModelVO> roomModelList;

    @Schema(description = "房型信息")
    private String roomModelDetails;

    @Schema(description = "审核人")
    private String auditUser;

    @Schema(description = "审核角色名称")
    private String auditUserName;

    @Schema(description = "审核时间")
    @ExcelProperty("审核时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
    private LocalDateTime auditTime;

    @Schema(description = "是否审阅（0否 1是）")
    private Integer isRead;

    @Schema(description = "审阅人")
    private Long readUser;

    @Schema(description = "审阅人名称")
    private String readUserName;

    @Schema(description = "审阅时间")
    private LocalDateTime readTime;

    @Schema(description = "定金")
    private BigDecimal deposi;

    @Schema(description = "实付已经金额")
    private BigDecimal realPayAmount;

    @Schema(description = "政策优惠金额")
    private BigDecimal freeAmount;

    @Schema(description = "是否需要补缴费 1是 0 否")
    private Integer isSupplementary;

    @Schema(description = "受损金额")
    private BigDecimal damaged;

    @Schema(description = "补缴费金额")
    private BigDecimal  supplementAmount;

    @Schema(description = "取消状态 0：初始 1：已提交取消 2：取消成功")
    private Integer damagedStatus;

    @Schema(description = "取消提交时间")
    private LocalDateTime damagedTime;

    @Schema(description = "定金状态0：初始  1：待支付（审核通过）2：已支付")
    private Integer deposiStatus;

    @Schema(description = "定金支付时间")
    private LocalDateTime deposiPayTime;

    @Schema(description  = "联系人")
    private String linkMan;

    @Schema(description  = "联系人电话")
    private String linkMobile;

    @Schema(description  = "联系人邮箱")
    private String linkEmail;

    @Schema(description  = "客户名称")
    private String customerName;

    @Schema(description  = "待支付金额")
    private BigDecimal loadPayAmount;

    @Schema(description  = "支付超时时间")
    private Long payTimeout;




}