184 lines
10 KiB
Go
184 lines
10 KiB
Go
package model
|
||
|
||
import "time"
|
||
|
||
const (
|
||
ThingTypeSeparate = 1 // 商户分账
|
||
ThingTypeReceive = 2 // 分账接收方
|
||
OperateTypeCreate = "create" // 创建
|
||
OperateTypeUpdate = "update" // 修改
|
||
OperateTypeBind = "bind" // 绑定
|
||
OperateTypeUnBind = "unbind" // 解绑
|
||
OperateStatusReview = "review" // 审核中
|
||
OperateStatusSuccess = "success" // 审核通过
|
||
OperateStatusFail = "fail" // 审核失败
|
||
|
||
ReceiverStatusValid = "VALID" // 有效
|
||
ReceiverStatusInValid = "INVALID" // 无效
|
||
)
|
||
|
||
// 分账状态说明
|
||
const (
|
||
SeparateAmtAccepted = "ACCEPTED" // 已受理
|
||
SeparateAmtProcessing = "PROCESSING" // 处理中
|
||
SeparateAmtFail = "FAIL" // 失败
|
||
SeparateAmtSuccess = "SUCCESS" // 成功
|
||
SeparateAmtCanceling = "CANCELING" // 撤销中
|
||
SeparateAmtCanceled = "CANCELED" // 撤销成功
|
||
SeparateAmtCancelFail = "CANCEL_FAIL" // 撤销失败
|
||
SeparateAmtFallBacking = "FALLBACKING" // 回退中
|
||
SeparateAmtFallBackEnd = "FALLBACK_END" // 回退失败
|
||
)
|
||
|
||
// 分账指令类型
|
||
const (
|
||
CmdTypeSeparate = "SEPARATE" // 分账
|
||
CmdTypeCancel = "CANCEL" // 分账撤销
|
||
CmdTypeFallBack = "FALLBACK" // 分账退回
|
||
)
|
||
|
||
type LakalaContract struct {
|
||
ModelIDCUL
|
||
ContractId string `orm:"column(contract_id);size(32)" json:"contractId"` // 订单编号
|
||
ContractApplyId string `orm:"column(contract_apply_id);size(20)" json:"contractApplyId"` // 电子合同编号
|
||
ContractStatus string `orm:"column(contract_status);size(20)" json:"ContractStatus"` // 合同状态
|
||
StoreId int `orm:"column(store_id);size(16)" json:"storeId"` // 京西门店ID
|
||
ApplyType string `orm:"column(apply_type);size(16)" json:"applyType"` // 申请类型
|
||
Desc string `orm:"column(desc);size(512)" json:"desc"` // 说明
|
||
}
|
||
|
||
func (o *LakalaContract) TableUnique() [][]string {
|
||
return [][]string{
|
||
[]string{"contract_id"},
|
||
}
|
||
}
|
||
|
||
// LakalaIncoming 进件账户状态,分账状态
|
||
type LakalaIncoming struct {
|
||
ModelIDCUL
|
||
StoreId int `orm:"column(store_id);size(16)" json:"storeId"` // 京西门店ID
|
||
MerchantNo string `orm:"column(merchant_no);size(20)" json:"merchantNo"` // 拉卡拉进件商户号
|
||
MerchantNo2 string `orm:"column(merchant_no2);size(20)" json:"merchantNo2"` // 银联商户号
|
||
TermNo string `orm:"column(term_no);size(256)" json:"termNo"` // 终端号 M String(32) 拉卡拉分配的业务终端号
|
||
MerchantStatus string `orm:"column(merchant_status);size(80)" json:"merchantStatus"` // 拉卡拉进件状态
|
||
FeeId string `orm:"column(fee_id);size(80)" json:"feeId"` // 拉卡拉费率变更ID
|
||
FeeStatus string `orm:"column(fee_status);size(80)" json:"feelStatus"` // 拉卡拉费率变更状态
|
||
SettleId string `orm:"column(settle_id);size(80)" json:"settleId"` // 结算变更id
|
||
SettleStatus string `orm:"column(settle_status);size(80)" json:"settleStatus"` // 结算变更状态
|
||
BasicId string `orm:"column(basic_id);size(80)" json:"basicId"` // 基本信息变更ID
|
||
BasicStatus string `orm:"column(basic_status);size(80)" json:"basicStatus"` // 基本信息变更状态
|
||
LicenseId string `orm:"column(license_id);size(80)" json:"licenseId"` // 营业执照变更ID
|
||
LicenseStatus string `orm:"column(license_status);size(80)" json:"licenseStatus"` // 营业执照变更状态
|
||
// 分账
|
||
OrderID string `orm:"column(order_id);size(32)" json:"orderId"` // 当前事件ID
|
||
ApplyID string `orm:"column(apply_id);size(32)" json:"applyId"` // 申请id
|
||
ThingType int `orm:"column(thing_type);size(2)" json:"thingType"` // 事件类型[1-分账门店/2-分账接收方]
|
||
Operate string `orm:"column(operate);size(16)" json:"operate"` // 操作类型[创建/修改/绑定/解绑]
|
||
OperateStatus string `orm:"column(operate_status);size(16)" json:"operateStatus"` // 操作所处状态
|
||
TotalAmt string `orm:"column(total_amt);size(10)" json:"totalAmt"` // 总分账金额
|
||
CanAmt string `orm:"column(can_amt);size(10)" json:"canAmt"` // 可分账金额
|
||
BindAccount string `orm:"column(bind_account);type(text)" json:"bindAccount"` // 绑定的分账账户map["receiverNo"]"1"
|
||
Remark string `orm:"column(remark);size(512)" json:"remark"` // 备注说明
|
||
}
|
||
|
||
type BindAccountObj struct {
|
||
ApplyId string `json:"applyId"` // 申请编号
|
||
Status string `json:"status"` // 审核状态
|
||
Remark string `json:"remark"` // 备注说明
|
||
}
|
||
|
||
func (o *LakalaIncoming) TableUnique() [][]string {
|
||
return [][]string{
|
||
[]string{"MerchantNo"},
|
||
}
|
||
}
|
||
func (o *LakalaIncoming) TableIndex() [][]string {
|
||
return [][]string{
|
||
[]string{"ApplyID"},
|
||
[]string{"StoreId"},
|
||
}
|
||
}
|
||
|
||
// LakalaRecipient 拉卡拉接收分账账户
|
||
type LakalaRecipient struct {
|
||
ModelIDCUL
|
||
OrgCode string `orm:"column(org_code);size(20)" json:"orgCode"` // 申请机构代码(回传)
|
||
OrgID string `orm:"column(org_id);size(20)" json:"orgId"` // 接收方所属机构
|
||
ReceiverNo string `orm:"column(receiver_no);size(20)" json:"receiverNo"` // 接收方编号
|
||
ReceiverName string `orm:"column(receiver_name);size(20)" json:"receiverName"` // 接收方名称
|
||
Status string `orm:"column(status);size(16)" json:"status"` // 分账账户状态 有效:VALID 无效:INVALID
|
||
Remark string `orm:"column(remark);size(512)" json:"remark"` // 备注说明
|
||
}
|
||
|
||
func (o *LakalaRecipient) TableUnique() [][]string {
|
||
return [][]string{
|
||
[]string{"ReceiverNo"},
|
||
}
|
||
}
|
||
func (o *LakalaRecipient) TableIndex() [][]string {
|
||
return [][]string{
|
||
[]string{"CreatedAt"},
|
||
}
|
||
}
|
||
|
||
// LakalaSeparateAmt 分账记录
|
||
type LakalaSeparateAmt struct {
|
||
ModelIDCUL
|
||
MerchantNo string `orm:"column(merchant_no);size(20)" json:"merchantNo"` // 分账发起商户
|
||
VendorOrderID string `orm:"column(vendor_order_id);size(32)" json:"vendorOrderID"` // 京西订单ID
|
||
StoreId int `orm:"column(store_id);size(16)" json:"storeId"` // 门店ID
|
||
CmdType string `orm:"column(cmd_type);size(32)" json:"cmdType"` // SEPARATE:分账 CANCEL:分账撤销FALLBACK:分账回退
|
||
Status string `orm:"column(status);size(32)" json:"status"` // 分账状态 1-未分账
|
||
LogNo string `orm:"column(log_no);size(32)" json:"logNo"` // 交易流水号(订单)
|
||
LogDate time.Time `orm:"column(log_date);type(datetime)" json:"logDate"` // 交易日期
|
||
OutSeparateNo string `orm:"column(out_separate_no);size(32)" json:"outSeparateNo"` // 商户分账指令流水号
|
||
SeparateNo string `orm:"column(separate_no);size(32)" json:"separateNo"` // 分账系统生成唯一流水
|
||
CalType string `orm:"column(cal_type);size(2)" json:"calType"` // 分账计算类型
|
||
FinishDate string `orm:"column(finish_date);size(20)" json:"finishDate"` // 完成日期 yyyyMMdd
|
||
TotalAmt string `orm:"column(total_amt);size(15)" json:"totalAmt"` // 发生总金额
|
||
CanAmt string `orm:"column(can_amt);size(15)" json:"canAmt"` // 可分金额
|
||
ActualSeparateAmt string `orm:"column(actual_separate_amt);size(15)" json:"actualSeparateAmt"` // 实分金额
|
||
TotalFeeAmt string `orm:"column(total_fee_amt);size(15)" json:"totalFeeAmt"` // 手续费金额
|
||
FinalStatus string `orm:"column(final_status);size(32)" json:"finalStatus"` // 处理状态
|
||
DetailData string `orm:"column(detail_data);type(text)" json:"detailData"` // 细节数据
|
||
Remark string `orm:"column(remark);size(256)" json:"remark"` // 备注说明记录订单流程变化
|
||
}
|
||
|
||
func (o *LakalaSeparateAmt) TableIndex() [][]string {
|
||
return [][]string{
|
||
[]string{"MerchantNo"},
|
||
[]string{"VendorOrderID"},
|
||
[]string{"LogNo"},
|
||
[]string{"CreatedAt"},
|
||
}
|
||
}
|
||
|
||
// LakalaWithdrawal 拉卡拉提现记录
|
||
type LakalaWithdrawal struct {
|
||
ModelIDCUL
|
||
CreatedTime time.Time `orm:"column(created_time);type(datetime)" json:"createdTime"` // 创建时间
|
||
CompleteTime time.Time `orm:"column(complete_time);type(datetime)" json:"completeTime"` // 完成时间
|
||
MercId string `orm:"column(merc_id);size(32)" json:"mercId"` // 商户号
|
||
DrawJnl string `orm:"column(draw_jnl);size(32)" json:"drawJnl"` // 提款流水号
|
||
ReqDate string `orm:"column(req_date);size(32)" json:"reqDate"` // 请求日期
|
||
AcctName string `orm:"column(acct_name);size(32)" json:"acctName"` // 结算账户名
|
||
AcctNo string `orm:"column(acct_no);size(32)" json:"acctNo"` // 结算账户号
|
||
DrawAmt string `orm:"column(draw_amt);size(32)" json:"drawAmt"` // 提款金额(元):含手续费
|
||
DrawFee string `orm:"column(draw_fee);size(32)" json:"drawFee"` // 手续费(元)
|
||
BatchAutoSettle string `orm:"column(batch_auto_settle);size(2)" json:"batchAutoSettle"` // 结算模式(01主动提款 02余额自动结算 03 交易自动结算)
|
||
DrawState string `orm:"column(draw_state);size(16)" json:"drawState"` // 提款状态 DRAW.ACCEPTED 提款已受理 DRAW.FREEZE 提款冻结DRAW.PROCESSING 提款处理中DRAW.SUCCESS 提款成功DRAW.FAILED 提款失败
|
||
DrawMode string `orm:"column(draw_mode);size(4)" json:"drawMode"` // 提款模式(D0/D1)
|
||
Memo string `orm:"column(memo);size(256)" json:"memo"` // 结果信息
|
||
}
|
||
|
||
func (o *LakalaWithdrawal) TableUnique() [][]string {
|
||
return [][]string{
|
||
[]string{"DrawJnl"},
|
||
}
|
||
}
|
||
func (o *LakalaWithdrawal) TableIndex() [][]string {
|
||
return [][]string{
|
||
[]string{"CreatedTime"},
|
||
}
|
||
}
|