package com.zt.plat.module.contractorder.api.dto.contract;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

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

@Schema(description = "管理后台 - 合同详情 Response VO")
@Data
public class ContractRespDTO {

    @Schema(description = "主键")
    private Long id;

    @Schema(description = "模板实例主键")
    private Long instanceId;

    @Schema(description = "系统合同编号;自动生成，校验唯一")
    private String systemContractNumber;

    @Schema(description = "状态")
    private String status;

    @Schema(description = "合同名称;与ERP(HTMC)对应，校验唯一")
    private String contractName;

    @Schema(description = "合同编号;与ERP(HTBH)对应，校验唯一")
    private String contractPaperNumber;

    @Schema(description = "是否虚拟合同;与ERP(SFXNHT)对应")
    private String contractVirtual;

    @Schema(description = "是否先款后货")
    private String hasPayable;

    @Schema(description = "收支性质;与ERP(SZXZ)对应")
    private String direction;

    @Schema(description = "合同类型")
    private String contractType;

    @Schema(description = "签署日期;与ERP(HTQDRQ)对应")
    private LocalDateTime signDate;

    @Schema(description = "开始日期;与ERP(HTQSRQ)对应")
    private LocalDateTime startDate;

    @Schema(description = "结束日期;与ERP(HTZZRQ)对应")
    private LocalDateTime endDate;

    @Schema(description = "签署地")
    private String signPlace;

    @Schema(description = "甲方公司编号;如果是采购合同，查询组织机构自动带出，且与ERP(HTQDZTBH)对应，如果是销售合同，手动选择，且与ERP(WLDWBH)对应。")
    private String purchaseCompanyNumber;

    @Schema(description = "甲方公司名称")
    private String purchaseCompanyName;

    @Schema(description = "甲方地址")
    private String purchaseAddress;

    @Schema(description = "甲方法定代表人")
    private String purchaseLeader;

    @Schema(description = "乙方公司编号;如果是销售合同，查询组织机构自动带出，且与ERP(HTQDZTBH)对应，如果是采购合同，手动选择，且与ERP(WLDWBH)对应。")
    private String salesCompanyNumber;

    @Schema(description = "乙方公司名称")
    private String salesCompanyName;

    @Schema(description = "乙方地址")
    private String salesAddress;

    @Schema(description = "乙方企业负责人")
    private String salesPurchaseLeader;

    @Schema(description = "币种;与ERP(BZBH)对应")
    private String currency;

    @Schema(description = "原币金额;与ERP(HTYBZJE)对应，币种不是人民币时，显示并手动填写，如果是人民币，隐藏且等于本币金额")
    private BigDecimal cooAmount;

    @Schema(description = "本币金额;与ERP(HTBWBZJE)对应")
    private BigDecimal basicAmount;

    @Schema(description = "是否有履约保证金;为是，则保证金必填。")
    private String hasDeposit;

    @Schema(description = "原币履约保证金;与ERP(LYBZJBGQYB)对应，币种不是人民币时，显示并手动填写，如果是人民币，隐藏且等于本币金额")
    private BigDecimal cooAmountDeposit;

    @Schema(description = "本币履约保证金;与ERP(LYBZJBGQBWB)对应")
    private BigDecimal basicAmountDeposit;

    @Schema(description = "是否有预付款;与ERP(SFYYFK)对应")
    private String hasPrepayment;

    @Schema(description = "预付款比例;与ERP(YFKBL)对应")
    private BigDecimal prepaymentRatio;

    @Schema(description = "预付款金额;与ERP(YFKJE)对应")
    private BigDecimal prepaymentAmount;

    @Schema(description = "是否有质保金;与ERP(SFHZBJ)对应")
    private String hasQualityAmount;

    @Schema(description = "质保金比例;与ERP(ZBJBL)对应")
    private BigDecimal qualityRatio;

    @Schema(description = "质保金金额;与ERP(BZJJE)对应")
    private BigDecimal qualityAmount;

    @Schema(description = "补充协议类型;变更协议/增加条款")
    private String replenishAgreementType;

    @Schema(description = "备注;与ERP(BZXX)对应")
    private String remark;

    @Schema(description = "施工类型编号;与ERP(HTLXBH)对应，拓展信息")
    private String constructionTypeNumber;

    @Schema(description = "施工类型名称;与ERP(HTLXMC)对应，拓展信息")
    private String constructionTypeName;

    @Schema(description = "代理方;与ERP(ZLIFNR)对应，拓展信息")
    private String agent;

    @Schema(description = "类别;与ERP(HTLB)对应，拓展信息")
    private String category;

    @Schema(description = "原币金额-变更后;与ERP(BGHHTYBZJE)对应，拓展信息")
    private BigDecimal changeCooAmount;

    @Schema(description = "本币金额-变更后;与ERP(BGHHTBWBZJE)对应，拓展信息")
    private BigDecimal changeBasicAmount;

    @Schema(description = "原币履约保证金-变更后;与ERP(LYBZJBGHYB)对应，拓展信息")
    private BigDecimal changeCooAmountDeposit;

    @Schema(description = "本币履约保证金-变更后;与ERP(LYBZJBGHBWB)对应，拓展信息")
    private BigDecimal changeBasicAmountDeposit;

    @Schema(description = "是否框架合同;与ERP(SFKJHT)对应，拓展信息")
    private String isFramework;

    @Schema(description = "境内/境外;与ERP(JNJW)对应，拓展信息")
    private String isDomestic;

    @Schema(description = "建筑服务发生地;与ERP(JZFWFSD)对应，拓展信息，销售合同，且类型为SAP02COSR必填")
    private String architectureServicePlace;

    @Schema(description = "达到收款条件金额;与ERP(DDSKJE)对应，拓展信息，销售合同，且类型为SAP02COSR必填")
    private BigDecimal payeeConditionAmount;

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

    @Schema(description = "步骤")
    private Integer step;

    @Schema(description = "ERP请求状态")
    private String erpStatus;

    @Schema(description = "ERP请求失败原因")
    private String cause;

    @Schema(description = "流程实例编号")
    private String processInstanceId;

    @Schema(description = "审批意见")
    private String reviewOpinion;

    @Schema(description = "任务节点主键")
    private String taskNodeId;

    @Schema(description = "模板附件对象存储")
    private String fileObject;

    @Schema(description = "其它附件对象存储")
    private String fileObjectOther;

    @Schema(description = "交货地点")
    private String deliveryAddress;

    @Schema(description = "交货方式(字典:FRCST_ASN)")
    private String deliveryWay;

    @Schema(description = "甲方联系人")
    private String purchaseHuman;

    @Schema(description = "甲方电话")
    private String purchaseTel;

    @Schema(description = "甲方邮箱")
    private String purchaseEmail;

    @Schema(description = "甲方传真")
    private String purchaseFax;

    @Schema(description = "甲方联系地址")
    private String purchaseContactAddress;

    @Schema(description = "乙方联系人")
    private String salesHuman;

    @Schema(description = "乙方电话")
    private String salesTel;

    @Schema(description = "乙方邮箱")
    private String salesEmail;

    @Schema(description = "乙方传真")
    private String salesFax;

    @Schema(description = "乙方联系地址")
    private String salesContactAddress;

    @Schema(description = "ERP甲方公司编号")
    private String erpPurchaseCompanyNumber;

    @Schema(description = "ERP甲方公司名称")
    private String erpPurchaseCompanyName;

    @Schema(description = "ERP乙方公司编码")
    private String erpSalesCompanyNumber;

    @Schema(description = "ERP乙方公司名称")
    private String erpSalesCompanyName;

    @Schema(description = "合同分类(字典：SPLY_BSN_TP)")
    private String businessType;

    @Schema(description = "代理方名称")
    private String agentName;

    @Schema(description = "货权转移类型(字典：ASY_MTNG_TP)")
    private String meteringType;

    @Schema(description = "模板中间表ID")
    private Long businessId;

    @Schema(description = "甲方户名")
    private String purchaseAccountName;

    @Schema(description = "甲方开户行")
    private String purchaseBankAccount;

    @Schema(description = "甲方户号")
    private String purchaseAccountNumber;

    @Schema(description = "甲方税号/社会信用代码")
    private String purchaseTaxNumber;

    @Schema(description = "乙方户名")
    private String salesAccountName;

    @Schema(description = "乙方开户行")
    private String salesBankAccount;

    @Schema(description = "乙方户号")
    private String salesAccountNumber;

    @Schema(description = "乙方税号/社会信用代码")
    private String salesTaxNumber;

    @Schema(description = "物料信息")
    private List<DetailRespDTO> detail;

    //@Schema(description = "合同动态表单")
    // private List<TemplateInstanceDataRespDTO> dynamicsFields;

    //@Schema(description = "合同动态条款")
    // private List<TemplateInstanceItemRespDTO> dynamicsItems;

    @Schema(description = "价款结算条款")
    private List<FormulaRespDTO> formulas;

    @Schema(description = "参数降级规则")
    private List<DemoteRespDTO> demotes;

    @Schema(description = "品位不计价规则")
    private List<NotRespDTO> nots;

    @Schema(description = "收发货规则")
    private List<ContractReceiveSendRespDTO> contractReceiveSends;

    @Schema(description = "金额拆分")
    private List<AmountSplitRespDTO> amountSplits;
}
