添加文件: intelligence_finance_v1_ga/types.go
This commit is contained in:
parent
5034e1cafc
commit
56ce54eadc
|
|
@ -0,0 +1,354 @@
|
||||||
|
package intelligence_finance_v1_ga
|
||||||
|
|
||||||
|
import "encoding/json"
|
||||||
|
|
||||||
|
// BaseResponse 是平台所有请求接口的通用响应结构。
|
||||||
|
// code 为业务状态码(0 或 200 表示成功),msg 为提示信息,data 为具体业务数据。
|
||||||
|
type BaseResponse struct {
|
||||||
|
Code int `json:"code"`
|
||||||
|
Msg string `json:"msg"`
|
||||||
|
Data json.RawMessage `json:"data"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// 发票类型枚举。
|
||||||
|
const (
|
||||||
|
InvoiceTypeSpecial = 1 // 专用发票
|
||||||
|
InvoiceTypeNormal = 2 // 普通发票
|
||||||
|
InvoiceTypeNormalElectronic = 3 // 普通发票(电子)
|
||||||
|
InvoiceTypeSpecialElectronic = 4 // 专用发票(电子)
|
||||||
|
InvoiceTypeDigitalSpecial = 8 // 数电专票
|
||||||
|
InvoiceTypeDigitalNormal = 9 // 数电普票
|
||||||
|
)
|
||||||
|
|
||||||
|
// 开票状态枚举。
|
||||||
|
const (
|
||||||
|
InvoiceStatusNotIssued = 0 // 未开票
|
||||||
|
InvoiceStatusIssuing = 1 // 开票中
|
||||||
|
InvoiceStatusPartialFailed = 2 // 部分失败
|
||||||
|
InvoiceStatusSuccess = 3 // 开票成功
|
||||||
|
InvoiceStatusFailed = 4 // 开票失败
|
||||||
|
InvoiceStatusPartialNotIssued = 5 // 部分未开
|
||||||
|
InvoiceStatusNoDigitalAccount = 6 // 未配置数电账号
|
||||||
|
InvoiceStatusNoAutoConfig = 7 // 未配置自动开票配置
|
||||||
|
)
|
||||||
|
|
||||||
|
// 支付状态枚举。
|
||||||
|
const (
|
||||||
|
PaymentStatusSuccess = "SUCCESS" // 支付成功
|
||||||
|
PaymentStatusFail = "FAIL" // 支付失败
|
||||||
|
PaymentStatusTerminate = "TERMINATE" // 支付取消
|
||||||
|
PaymentStatusWaitPay = "WAIT_PAY" // 待支付
|
||||||
|
PaymentStatusPaying = "PAYING" // 支付中
|
||||||
|
PaymentStatusPartSuccess = "PART_SUCCESS" // 部分支付成功
|
||||||
|
PaymentStatusRefund = "REFUND" // 退款
|
||||||
|
)
|
||||||
|
|
||||||
|
// 来源枚举。
|
||||||
|
const (
|
||||||
|
SourceApproval = "approval" // 审批单
|
||||||
|
SourceOpenAPI = "openapi" // 开发接口
|
||||||
|
)
|
||||||
|
|
||||||
|
// 账户类型枚举。
|
||||||
|
const (
|
||||||
|
AccountTypeAlipay = "ALIPAY" // 支付宝
|
||||||
|
AccountTypeBankCard = "BANKCARD" // 银行卡
|
||||||
|
AccountTypeCorpBankCard = "CORP_BANK_CARD" // 对公银行卡
|
||||||
|
AccountTypePersonalBankCard = "PERSONAL_BANK_CARD" // 对私银行卡
|
||||||
|
)
|
||||||
|
|
||||||
|
// 通知响应常量。
|
||||||
|
const (
|
||||||
|
NotifySuccess = "SUCCESS" // 通知处理成功
|
||||||
|
NotifyFailed = "FAILED" // 通知处理失败
|
||||||
|
)
|
||||||
|
|
||||||
|
// InvoiceOrderRequest 是订单开票请求参数。
|
||||||
|
type InvoiceOrderRequest struct {
|
||||||
|
CompanyCode string `json:"companyCode"` // 开票的企业主体编码,不传则默认主体开票
|
||||||
|
OrderID string `json:"orderId"` // 订单唯一标识(需保证在贵方系统内唯一)
|
||||||
|
InvoiceType int `json:"invoiceType"` // 发票类型枚举
|
||||||
|
Products []InvoiceProduct `json:"products"` // 货物/服务明细列表,至少一项
|
||||||
|
Remark string `json:"remark"` // 订单备注(非发票备注)
|
||||||
|
Purchaser string `json:"purchaser"` // 购方企业名称
|
||||||
|
TaxNum string `json:"taxnum"` // 购方纳税人识别号
|
||||||
|
PurchaserAddress string `json:"purchaserAddress"` // 购方地址
|
||||||
|
PurchaserTel string `json:"purchaserTel"` // 购方电话
|
||||||
|
BankName string `json:"bankName"` // 购方开户行名称
|
||||||
|
BankAccount string `json:"bankAccount"` // 购方银行账号
|
||||||
|
Phone string `json:"phone"` // 收票人手机号(用于接收电票短信)
|
||||||
|
Email string `json:"email"` // 收票人邮箱(用于接收电票邮件)
|
||||||
|
ApplyPerson string `json:"applyPerson"` // 开票申请人名称
|
||||||
|
Payee string `json:"payee"` // 收款人(发票票面)
|
||||||
|
Reviewer string `json:"reviewer"` // 复核人(发票票面)
|
||||||
|
InvoiceRemark string `json:"invoiceRemark"` // 发票备注栏内容
|
||||||
|
NaturalPerson string `json:"naturalPerson"` // 购买方自然人标识:Y-是,N-否(默认N)
|
||||||
|
AdditionInfo string `json:"additionInfo"` // 附加信息(JSON数组字符串)
|
||||||
|
}
|
||||||
|
|
||||||
|
// InvoiceProduct 是订单开票的货物/服务明细项。
|
||||||
|
type InvoiceProduct struct {
|
||||||
|
ProductName string `json:"productName"` // 货物或服务名称
|
||||||
|
RevenueCode string `json:"revenueCode"` // 19位税收分类编码
|
||||||
|
AmountIncludeTax float64 `json:"amountIncludeTax"` // 单条明细含税总金额(单位:元)
|
||||||
|
Specs string `json:"specs"` // 规格型号
|
||||||
|
Unit string `json:"unit"` // 计量单位(如:台、个、次)
|
||||||
|
Quantity float64 `json:"quantity"` // 数量
|
||||||
|
Discount float64 `json:"discount"` // 折扣金额(无折扣传0)
|
||||||
|
TaxSign int `json:"taxSign"` // 是否含税:0-不含税;1-含税(默认建议传1)
|
||||||
|
TaxRate float64 `json:"taxRate"` // 税率(小数形式,如0.13表示13%)
|
||||||
|
}
|
||||||
|
|
||||||
|
// InvoiceOrderData 是订单开票接口的响应数据。
|
||||||
|
type InvoiceOrderData struct {
|
||||||
|
Status int `json:"status"` // 开票状态
|
||||||
|
ErrorMsg string `json:"errorMsg"` // 错误信息(开票失败时返回原因)
|
||||||
|
DataList []InvoiceData `json:"dataList"` // 发票数据列表(一张订单可能对应多张发票)
|
||||||
|
}
|
||||||
|
|
||||||
|
// InvoiceData 是单张发票的详细数据。
|
||||||
|
type InvoiceData struct {
|
||||||
|
DeviceCode string `json:"deviceCode"` // 税控设备号
|
||||||
|
Drawer string `json:"drawer"` // 开票人
|
||||||
|
Email string `json:"email"` // 邮箱(购方邮箱)
|
||||||
|
InvoiceType string `json:"invoiceType"` // 发票类型
|
||||||
|
IssueType string `json:"issueType"` // 开票类型:0-正数票;1-负数票(红冲)
|
||||||
|
ListFlag string `json:"listFlag"` // 清单标识:0-无清单;1-有清单
|
||||||
|
Mobile string `json:"mobile"` // 手机号(购方手机)
|
||||||
|
OriginalInvCode string `json:"originalInvCode"` // 红冲时对应的原蓝票代码
|
||||||
|
OriginalInvNo string `json:"originalInvNo"` // 红冲时对应的原蓝票号码
|
||||||
|
AdditionInfo string `json:"additionInfo"` // 数电发票备注栏的附加信息部分
|
||||||
|
Payee string `json:"payee"` // 收款人
|
||||||
|
PurchaserAddress string `json:"purchaserAddress"` // 购方地址
|
||||||
|
PurchaserBankAccount string `json:"purchaserBankAccount"` // 购方银行账号
|
||||||
|
PurchaserBankName string `json:"purchaserBankName"` // 购方开户行
|
||||||
|
PurchaserName string `json:"purchaserName"` // 购方名称
|
||||||
|
PurchaserTaxNo string `json:"purchaserTaxNo"` // 购方税号
|
||||||
|
PurchaserTel string `json:"purchaserTel"` // 购方电话
|
||||||
|
NaturalPerson string `json:"naturalPerson"` // 购买方自然人标识:Y-是;N-否
|
||||||
|
Remark string `json:"remark"` // 备注
|
||||||
|
Reviewer string `json:"reviewer"` // 复核人
|
||||||
|
SellerAddress string `json:"sellerAddress"` // 销方地址
|
||||||
|
SellerBankAccount string `json:"sellerBankAccount"` // 销方开户账号
|
||||||
|
SellerBankName string `json:"sellerBankName"` // 销方开户行
|
||||||
|
SellerName string `json:"sellerName"` // 销方名称
|
||||||
|
CheckCode string `json:"checkCode"` // 校验码
|
||||||
|
CipherText string `json:"cipherText"` // 密码区
|
||||||
|
DrewDate string `json:"drewDate"` // 开票日期(格式:yyyy-MM-dd HH:mm:ss)
|
||||||
|
InvoiceCode string `json:"invoiceCode"` // 发票代码
|
||||||
|
InvoiceNo string `json:"invoiceNo"` // 发票号码
|
||||||
|
InvoiceStatus string `json:"invoiceStatus"` // 发票状态:1-正常;2-已红冲;3-已作废
|
||||||
|
LayoutFileURL string `json:"layoutFileUrl"` // 电子发票地址(PDF/OFD)
|
||||||
|
PDFURL string `json:"pdfUrl"` // 电子发票PDF地址
|
||||||
|
OFDURL string `json:"ofdUrl"` // 电子发票OFD地址
|
||||||
|
XMLURL string `json:"xmlUrl"` // 电子发票XML数据地址
|
||||||
|
TotalExcludeTax string `json:"totalExcludeTax"` // 合计金额(不含税)
|
||||||
|
TotalIncludeTax string `json:"totalIncludeTax"` // 合计金额(含税)
|
||||||
|
TotalTaxAmount string `json:"totalTaxAmount"` // 合计税额
|
||||||
|
LevyingType string `json:"levyingType"` // 征税方式
|
||||||
|
Details []InvoiceDetail `json:"details"` // 商品明细列表
|
||||||
|
}
|
||||||
|
|
||||||
|
// InvoiceDetail 是发票中的商品明细。
|
||||||
|
type InvoiceDetail struct {
|
||||||
|
Amount string `json:"amount"` // 金额
|
||||||
|
Quantity string `json:"quantity"` // 数量
|
||||||
|
DeductionAmount string `json:"deductionAmount"` // 扣除金额
|
||||||
|
TaxAmount string `json:"taxAmount"` // 税额
|
||||||
|
ItemTitle string `json:"itemTitle"` // 商品合并显示名称
|
||||||
|
TaxCode string `json:"taxCode"` // 税收分类编码(19位)
|
||||||
|
ItemType string `json:"itemType"` // 商品行性质:0-正常行;1-折扣行;2-被折扣行
|
||||||
|
ItemName string `json:"itemName"` // 商品简称
|
||||||
|
Specs string `json:"specs"` // 商品规格型号
|
||||||
|
TaxFreePolicy string `json:"taxFreePolicy"` // 免税政策:1-免税;2-不征税;3-普通零税率
|
||||||
|
PreferentialPolicy string `json:"preferentialPolicy"` // 优惠政策类型
|
||||||
|
TaxRate string `json:"taxRate"` // 税率(小数形式,如0.13)
|
||||||
|
TaxSign string `json:"taxSign"` // 是否含税:0-否;1-是
|
||||||
|
Unit string `json:"unit"` // 计量单位(如:台、个、次)
|
||||||
|
UnitPrice string `json:"unitPrice"` // 单价
|
||||||
|
}
|
||||||
|
|
||||||
|
// QueryInvoiceStatusRequest 是开票状态查询请求参数。
|
||||||
|
type QueryInvoiceStatusRequest struct {
|
||||||
|
OrderID string `json:"orderId"` // 订单唯一标识
|
||||||
|
}
|
||||||
|
|
||||||
|
// QueryInvoiceStatusData 是开票状态查询接口的响应数据。
|
||||||
|
type QueryInvoiceStatusData struct {
|
||||||
|
Status int `json:"status"` // 开票状态
|
||||||
|
Message string `json:"message"` // 状态描述(如"开票成功")
|
||||||
|
Data []InvoiceData `json:"data"` // 发票详细列表,结构与回调中的 data 字段一致
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreatePaymentRequest 是创建付款单据请求参数。
|
||||||
|
type CreatePaymentRequest struct {
|
||||||
|
Code string `json:"code"` // 单据编码
|
||||||
|
YidaAppType string `json:"yidaAppType"` // 宜搭应用类型
|
||||||
|
EmpAccountUserID string `json:"empAccountUserId"` // 员工账号用户ID
|
||||||
|
Department *Department `json:"department"` // 部门信息
|
||||||
|
Usage string `json:"usage"` // 用途
|
||||||
|
PaymentUserID string `json:"paymentUserId"` // 付款用户ID
|
||||||
|
Customer *Customer `json:"customer"` // 客户信息
|
||||||
|
PrincipalID string `json:"principalId"` // 负责人ID
|
||||||
|
Remark string `json:"remark"` // 备注
|
||||||
|
Supplier *Supplier `json:"supplier"` // 供应商信息
|
||||||
|
Title string `json:"title"` // 标题
|
||||||
|
Project *Project `json:"project"` // 项目信息
|
||||||
|
PaymentUserIDListStr string `json:"paymentUserIdListStr"` // 付款用户ID列表字符串
|
||||||
|
NeedPayment bool `json:"needPayment"` // 是否需要付款
|
||||||
|
PaymentDetailListJsonStr string `json:"paymentDetailListJsonStr"` // 付款明细列表JSON字符串
|
||||||
|
PaymentDetailList []PaymentDetail `json:"paymentDetailList"` // 付款明细列表
|
||||||
|
Company *Company `json:"company"` // 企业主体信息
|
||||||
|
Amount string `json:"amount"` // 金额
|
||||||
|
RecipientAccountInfo *RecipientAccount `json:"recipientAccountInfo"` // 收款账户信息
|
||||||
|
EnterpriseAccount *EnterpriseAccount `json:"enterpriseAccount"` // 企业账号信息
|
||||||
|
Category []Category `json:"category"` // 收支类别信息
|
||||||
|
UserID string `json:"userId"` // 用户ID
|
||||||
|
OccurDate int64 `json:"occurDate"` // 发生日期(时间戳)
|
||||||
|
Product *Product `json:"product"` // 商品信息
|
||||||
|
YidaFormUUID string `json:"yidaFormUuid"` // 宜搭表单UUID
|
||||||
|
CanEditPaymentInfo bool `json:"canEditPaymentInfo"` // 是否可编辑付款信息
|
||||||
|
PaymentUserIDList []string `json:"paymentUserIdList"` // 付款用户ID列表
|
||||||
|
YidaProcInsID string `json:"yidaProcInsId"` // 宜搭流程实例ID
|
||||||
|
SyncPaymentOrder bool `json:"syncPaymentOrder"` // 是否同步付款单据
|
||||||
|
}
|
||||||
|
|
||||||
|
// Department 是部门信息。
|
||||||
|
type Department struct {
|
||||||
|
Code string `json:"code"` // 部门编码
|
||||||
|
Name string `json:"name"` // 部门名称
|
||||||
|
}
|
||||||
|
|
||||||
|
// Customer 是客户信息。
|
||||||
|
type Customer struct {
|
||||||
|
Code string `json:"code"` // 客户编码
|
||||||
|
Name string `json:"name"` // 客户名称
|
||||||
|
}
|
||||||
|
|
||||||
|
// Supplier 是供应商信息。
|
||||||
|
type Supplier struct {
|
||||||
|
Code string `json:"code"` // 供应商编码
|
||||||
|
Name string `json:"name"` // 供应商名称
|
||||||
|
}
|
||||||
|
|
||||||
|
// Project 是项目信息。
|
||||||
|
type Project struct {
|
||||||
|
Code string `json:"code"` // 项目编码
|
||||||
|
Name string `json:"name"` // 项目名称
|
||||||
|
}
|
||||||
|
|
||||||
|
// Category 是收支类别信息。
|
||||||
|
type Category struct {
|
||||||
|
Code string `json:"code"` // 类别编码
|
||||||
|
Name string `json:"name"` // 类别名称
|
||||||
|
}
|
||||||
|
|
||||||
|
// Product 是商品信息。
|
||||||
|
type Product struct {
|
||||||
|
Code string `json:"code"` // 商品编码
|
||||||
|
Name string `json:"name"` // 商品名称
|
||||||
|
}
|
||||||
|
|
||||||
|
// Company 是企业主体信息。
|
||||||
|
type Company struct {
|
||||||
|
Code string `json:"code"` // 企业编码
|
||||||
|
Name string `json:"name"` // 企业名称
|
||||||
|
}
|
||||||
|
|
||||||
|
// EnterpriseAccount 是企业账号信息。
|
||||||
|
type EnterpriseAccount struct {
|
||||||
|
EnterpriseAccountCode string `json:"enterpriseAccountCode"` // 企业账号编码
|
||||||
|
AccountCategory string `json:"accountCategory"` // 账户类别
|
||||||
|
AccountType string `json:"accountType"` // 账户类型
|
||||||
|
CardNo string `json:"cardNo"` // 卡号
|
||||||
|
AccountName string `json:"accountName"` // 账户名称
|
||||||
|
OfficialNumber string `json:"officialNumber"` // 对公账号
|
||||||
|
OfficialName string `json:"officialName"` // 对公账户名称
|
||||||
|
Name string `json:"name"` // 名称
|
||||||
|
Code string `json:"code"` // 编码
|
||||||
|
City string `json:"city"` // 城市
|
||||||
|
Province string `json:"province"` // 省份
|
||||||
|
}
|
||||||
|
|
||||||
|
// RecipientAccount 是收款账户信息。
|
||||||
|
type RecipientAccount struct {
|
||||||
|
AccountCategory string `json:"accountCategory"` // 账户类别
|
||||||
|
AccountType string `json:"accountType"` // 账户类型
|
||||||
|
CardNo string `json:"cardNo"` // 卡号
|
||||||
|
AccountName string `json:"accountName"` // 账户名称
|
||||||
|
}
|
||||||
|
|
||||||
|
// PaymentDetail 是付款明细。
|
||||||
|
type PaymentDetail struct {
|
||||||
|
Amount string `json:"amount"` // 金额
|
||||||
|
InvoiceInfo *InvoiceInfo `json:"invoiceInfo"` // 发票信息
|
||||||
|
ProductCode string `json:"productCode"` // 商品编码
|
||||||
|
ProjectCode string `json:"projectCode"` // 项目编码
|
||||||
|
Remark string `json:"remark"` // 备注
|
||||||
|
PrincipalID string `json:"principalId"` // 负责人ID
|
||||||
|
Tax string `json:"tax"` // 税额
|
||||||
|
}
|
||||||
|
|
||||||
|
// InvoiceInfo 是付款明细中的发票信息。
|
||||||
|
type InvoiceInfo struct {
|
||||||
|
InvoiceNo string `json:"invoiceNo"` // 发票号码
|
||||||
|
InvoiceCode string `json:"invoiceCode"` // 发票代码
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreatePaymentData 是创建付款单据接口的响应数据。
|
||||||
|
type CreatePaymentData struct {
|
||||||
|
Code string `json:"code"` // 单据唯一编码
|
||||||
|
}
|
||||||
|
|
||||||
|
// QueryPaymentStatusRequest 是支付状态查询请求参数。
|
||||||
|
type QueryPaymentStatusRequest struct {
|
||||||
|
Code string `json:"code"` // 单据编码
|
||||||
|
UserID string `json:"userId"` // 用户ID
|
||||||
|
}
|
||||||
|
|
||||||
|
// PaymentInfo 是支付信息,用于支付完成通知和支付状态查询。
|
||||||
|
type PaymentInfo struct {
|
||||||
|
Code string `json:"code"` // 单据编码
|
||||||
|
InstanceID string `json:"instanceId"` // 实例ID
|
||||||
|
CorpID string `json:"corpId"` // 企业ID
|
||||||
|
PaymentStatus string `json:"paymentStatus"` // 支付状态
|
||||||
|
PaymentTime string `json:"paymentTime"` // 支付时间
|
||||||
|
UserID string `json:"userId"` // 用户ID
|
||||||
|
FailReason string `json:"failReason"` // 失败原因
|
||||||
|
PayerAccountInfo *PayerAccountInfo `json:"payerAccountInfo"` // 付款账户信息
|
||||||
|
PayeeAccountInfo *PayeeAccountInfo `json:"payeeAccountInfo"` // 收款账户信息
|
||||||
|
RelatedRowNumberList []string `json:"relatedRowNumberList"` // 关联行号列表
|
||||||
|
Source string `json:"source"` // 来源
|
||||||
|
Template string `json:"template"` // 模板
|
||||||
|
Amount string `json:"amount"` // 金额
|
||||||
|
}
|
||||||
|
|
||||||
|
// PayerAccountInfo 是付款账户信息。
|
||||||
|
type PayerAccountInfo struct {
|
||||||
|
BankOpenDTO *BankOpenDTO `json:"bankOpenDTO"` // 银行信息
|
||||||
|
EnterpriseAccountCode string `json:"enterpriseAccountCode"` // 企业账号编码
|
||||||
|
AccountType string `json:"accountType"` // 账户类型
|
||||||
|
}
|
||||||
|
|
||||||
|
// PayeeAccountInfo 是收款账户信息。
|
||||||
|
type PayeeAccountInfo struct {
|
||||||
|
BankOpenDTO *BankOpenDTO `json:"bankOpenDTO"` // 银行信息
|
||||||
|
}
|
||||||
|
|
||||||
|
// BankOpenDTO 是银行信息。
|
||||||
|
type BankOpenDTO struct {
|
||||||
|
BankCode string `json:"bankCode"` // 银行编码
|
||||||
|
BankName string `json:"bankName"` // 银行名称
|
||||||
|
BankBranchCode string `json:"bankBranchCode"` // 银行支行编码
|
||||||
|
BankBranchName string `json:"bankBranchName"` // 银行支行名称
|
||||||
|
AccountName string `json:"accountName"` // 账户名称
|
||||||
|
BankCardNo string `json:"bankCardNo"` // 银行卡号
|
||||||
|
Type string `json:"type"` // 账户类型
|
||||||
|
}
|
||||||
|
|
||||||
|
// NotifyRequest 是通用通知机制的通知数据。
|
||||||
|
type NotifyRequest struct {
|
||||||
|
BizType string `json:"bizType"` // 业务类型
|
||||||
|
BizID string `json:"bizId"` // 业务ID
|
||||||
|
Data string `json:"data"` // 业务数据
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue