package cn.superdesk.uniorder.dto.vo.invoice.customer;

import cn.superdesk.uniorder.common.numerical.AnStringUtils;
import cn.superdesk.uniorder.common.security.sensitive.annotion.Desensitized;
import cn.superdesk.uniorder.common.security.sensitive.constants.SensitiveTypeEnum;
import com.github.houbb.iexcel.annotation.ExcelField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Date;

/**
 * @Description: getScoreOrderReconciliationNotYe
 * 1. 积分结算2.0 未对账流水 列表
 * 2. 积分结算2.0 开票申请详情 Inner 列表
 * @Author: linjinyu
 * @CreateDate: 6/12/20 2:30 PM
 * @UpdateUser: linjinyu
 * @UpdateDate: 6/12/20 2:30 PM
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Data
public class InvoiceApplyDetailDimCreditItemVo implements Serializable {

    /****************************************** 非mapper产生 start ******************************************/

    @ApiModelProperty("")
    private Long   accountingOrderId;
    @ExcelField(headName = "积分流水快照ID", order = 1)
    @ApiModelProperty("")
    private String accountingOrderSn;

    /****************************************** 非mapper产生   end ******************************************/

    @ExcelField(headName = "结算中心流水ID", order = 0)
    @ApiModelProperty("uoc.id as unified_order_credit_id")
    private Long unifiedOrderCreditId;
    @ApiModelProperty("")
    private Long outSnapshotOrderCreditId;
    @ApiModelProperty("uoc.goods_id")
    private Long goodsId;

    @ApiModelProperty("uog.id as unified_order_goods_id")
    private Long unifiedOrderGoodsId;
    @ApiModelProperty("")
    private Long outSnapshotOrderGoodsId;

    @ApiModelProperty("uo.id as unified_order_id")
    private Long unifiedOrderId;


    @ApiModelProperty("积分类型id(如果是微信支付,显示0)")
    private Integer creditType;
    @ExcelField(headName = "积分类型", order = 14)
    @ApiModelProperty("uoc.credit_name")
    private String  creditName;
    @ApiModelProperty("积分变动类型(1充值 2消费 3退款)")
    private Integer dailyAccountType;

    @ExcelField(headName = "积分批次", order = 2)
    @ApiModelProperty("uoc.batchs")
    private String     batchs;
    @ExcelField(headName = "积分支付-结算金额", order = 15)
    @ApiModelProperty("积分支付-结算金额 - uoc.balance")
    private BigDecimal balance;


    @ExcelField(headName = "商品名称", order = 7)
    @ApiModelProperty("uog.goods_name")
    private String goodsName;

    /****************************************** 三级分类 20200904 by linjinyu 20200904_林志鹏_三极分类 ******************************************/

    @ApiModelProperty("cateIdLv1")
    private Long   cateIdLv1;
    @ExcelField(headName = "一级分类", order = 8)
    @ApiModelProperty("一级分类")
    private String cateNameLv1;
    @ApiModelProperty("cateIdLv2")
    private Long   cateIdLv2;
    @ExcelField(headName = "二级分类", order = 9)
    @ApiModelProperty("二级分类")
    private String cateNameLv2;
    @ApiModelProperty("cateIdLv3")
    private Long   cateIdLv3;
    @ExcelField(headName = "三级分类", order = 10)
    @ApiModelProperty("三级分类")
    private String cateNameLv3;
    @ApiModelProperty("三级分类 xxx/xxx/xxx")
    private String cateNameLvAll;

    public String getCateNameLvAll() {
        return AnStringUtils.stringArraySugarUpString(Arrays.asList(cateNameLv1, cateNameLv2, cateNameLv3), "/");
    }

    @ApiModelProperty("规格 - uog.self_option")
    private String selfOption;

    /****************************************** 三级分类  20200904 by linjinyu ******************************************/

    @ExcelField(headName = "订单编号", order = 3)
    @ApiModelProperty("订单编号 - uoc.order_sn")
    private String orderSn;


    @ApiModelProperty("uoc.accounting_state_customer 客户对账:1-已对账;2-未对账")
    private Integer accountingStateCustomer;
    @ExcelField(headName = "对账状态", order = 25)
    @ApiModelProperty("对账状态-客户对账")
    private String  accountingStateCustomerName;

    @ApiModelProperty("uoc.accounting_state_supplier 供应商对账:1-已对账;2-未对账")
    private Integer accountingStateSupplier;
    @ApiModelProperty("对账状态-供应商对账")
    private String  accountingStateSupplierName;

    @ApiModelProperty("发票申请状态 是否已申请 0-未申请;1-已申请; - uoc.invoice_apply_status")
    private Integer invoiceApplyStatus;
    @ExcelField(headName = "发票申请", order = 26)
    @ApiModelProperty("发票申请状态 是否已申请 0-未申请;1-已申请;")
    private String  invoiceApplyStatusName;

    @ApiModelProperty("开票状态 是否已登记开票 0-未登记;1-已登记; - uoc.invoice_make_status")
    private Integer invoiceMakeStatus;
    @ExcelField(headName = "开票状态", order = 27)
    @ApiModelProperty("开票状态")
    private String  invoiceMakeStatusName;

    @ApiModelProperty("回款状态 是否回款 0-未回款;1-已回款; - uoc.back_status")
    private Integer backStatus;
    @ExcelField(headName = "回款状态", order = 28)
    @ApiModelProperty("回款状态")
    private String  backStatusName;


    @ExcelField(headName = "销售单价", order = 11)
    @ApiModelProperty("uog.price")
    private BigDecimal price;
    @ApiModelProperty("uog.cost_price")
    private BigDecimal costPrice;

    @ExcelField(headName = "数量", order = 12)
    @ApiModelProperty("uog.quantity")
    private Integer quantity;

    @ExcelField(headName = "销售总价", order = 13)
    @ApiModelProperty("销售总价 - uog.price*uog.quantity as total_price")
    private BigDecimal totalPrice;

    @ApiModelProperty("销售总价 - uog.cost_price * uog.quantity as total_price")
    private BigDecimal totalCostPrice;

    @ApiModelProperty("uog.unit")
    private String unit;

    @ExcelField(headName = "税率%", order = 18)
    @ApiModelProperty("税率% - uog.tax_rate")
    private BigDecimal taxRate;
    @ExcelField(headName = "税务编码", order = 17)
    @ApiModelProperty("税务编码 - uog.tax_code")
    private String     taxCode;
    @ExcelField(headName = "财务编码", order = 16)
    @ApiModelProperty("财务编码 - uog.fiscal_code")
    private String     fiscalCode;


    @ApiModelProperty("商户税率ID-20210413-添加")
    private Long       merchTaxId;
    @ApiModelProperty("商户税率编码-20210413-添加")
    private String     merchTaxCode;
    @ApiModelProperty("商户税率-20210413-添加")
    private BigDecimal merchTaxRate;

    @ApiModelProperty("平台税率ID-20210413-添加")
    private Long       operationTaxId;
    @ApiModelProperty("平台税率编码-20210413-添加")
    private String     operationTaxCode;
    @ApiModelProperty("平台税率-20210413-添加")
    private BigDecimal operationTaxRate;


    @ApiModelProperty("uo.amount")
    private BigDecimal amount;
    @ApiModelProperty("uo.cost_amount")
    private BigDecimal costAmount;
    @ApiModelProperty("uo.transport_amount")
    private BigDecimal transportAmount;


    @ApiModelProperty("uo.purchase_virt_id")
    private Long   purchaseVirtId;
    @ExcelField(headName = "企业名称", order = 4)
    @ApiModelProperty("uo.purchase_virt_name")
    private String purchaseVirtName;

    @ApiModelProperty("下单人信息 部门")
    private String purchaseDepartmentName;

    @ApiModelProperty("uo.purchase_user_id")
    private Long   purchaseUserId;
    @Desensitized(type = SensitiveTypeEnum.CHINESE_NAME_MODE_3)
    @ExcelField(headName = "用户姓名", order = 5)
    @ApiModelProperty("uo.purchase_user_name")
    private String purchaseUserName;
    @Desensitized(type = SensitiveTypeEnum.MOBILE_PHONE)
    @ExcelField(headName = "手机号", order = 6)
    @ApiModelProperty("uo.purchase_phone")
    private String purchasePhone;

    @ExcelField(headName = "快递单号", order = 23)
    @ApiModelProperty("uo.express_sn")
    private String expressSn;
    @ApiModelProperty("uo.express")
    private String express;
    @ExcelField(headName = "快递公司", order = 22)
    @ApiModelProperty("uo.express_company")
    private String expressCompany;


    @ExcelField(headName = "下单时间", order = 19)
    @ApiModelProperty("下单时间 - uo.create_time")
    private Date createTime;
    @ApiModelProperty("订单 支付时间")
    private Date payTime;
    @ApiModelProperty("订单 发货时间")
    private Date sendTime;
    @ApiModelProperty("订单 完成时间")
    private Date finishTime;
    @ApiModelProperty("订单 结算时间")
    private Date accountingTime;
    // <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
    @ExcelField(headName = "更新时间", order = 24)
    @ApiModelProperty("订单 更新时间 - uo.update_time")
    private Date updateTime;

    @ApiModelProperty("订单 完成状态 - 归一后的状态- uo.complet_state")
    private Integer completState;

    //	<!-- add 20200723 附件1:对账单导出格式与字段.xls "订单状态","供货方","快递公司","快递单号","更新时间"-->

    // <result column="order_state" property="orderState" jdbcType="INTEGER"/>
    @ApiModelProperty("订单状态 - uo.order_state")
    private Integer orderState;
    // <result column="order_state_name" property="orderStateName" jdbcType="VARCHAR"/>
    @ExcelField(headName = "订单状态", order = 20)
    @ApiModelProperty("订单状态 - uo.order_state_name")
    private String  orderStateName;

    // <result column="sale_id" property="saleId" jdbcType="BIGINT"/>
    @ApiModelProperty("供货方 - uo.sale_id")
    private Long   saleId;
    // <result column="sale_name" property="saleName" jdbcType="VARCHAR"/>
    @ExcelField(headName = "供货方", order = 21)
    @ApiModelProperty("供货方 - uo.sale_name")
    private String saleName;


//	<!-- add 20200723 附件1:对账单导出格式与字段.xls "订单状态","供货方","快递公司","快递单号","更新时间"-->


    //	<!-- 20200810 start -->

    @ApiModelProperty("uo.pay_type")
    private Integer payType;
    @ApiModelProperty("uo.pay_state")
    private Integer payState;

    @ApiModelProperty("!!!弃用!!! 改用定义 mark by linjinyu at 20220624")
    private String serviceName;
    @ApiModelProperty("uo.service_no")
    private String serviceNo;
    private String serviceNoName;

    @ApiModelProperty("uo.rec_user_id")
    private Long   recUserId;
    @ApiModelProperty("uo.rec_user_name")
    private String recUserName;
    @ApiModelProperty("uo.rec_user_phone")
    private String recUserPhone;
    @ApiModelProperty("uo.rec_address")
    private String recAddress;

    //	<!-- 20200810   end  -->

    @ApiModelProperty("客户对账锁定:0-正常;1-销定")
    private Integer orderLockingCustomer;
    @ApiModelProperty("供应商对账锁定:0-正常;1-销定")
    private Integer orderLockingSupplier;
    @ApiModelProperty("客户对账锁定:0-正常;1-销定")
    private Integer goodsLockingCustomer;
    @ApiModelProperty("供应商对账锁定:0-正常;1-销定")
    private Integer goodsLockingSupplier;

    @ExcelField(headName = "备注", order = 29)
    @ApiModelProperty("uo.remarks")
    private String remarks;
}
