228 lines
6.7 KiB
Protocol Buffer
228 lines
6.7 KiB
Protocol Buffer
syntax = "proto3";
|
||
|
||
package finance.api.inner;
|
||
|
||
import "buf/validate/validate.proto";
|
||
import "finance/financev1/model.proto";
|
||
import "finance/financev1/global.proto";
|
||
|
||
option go_package = "./finance/financev1;financev1";
|
||
|
||
service BankTransClaim {
|
||
rpc CreateBankTransClaim (CreateBankTransClaimRequest) returns (CreateBankTransClaimReply);
|
||
rpc CreateBulkBankTransClaimExternal (CreateBulkBankTransClaimRequest) returns (CreateBulkBankTransClaimReply);
|
||
// 认领单冲销
|
||
rpc ReverseBankTransClaim (ReverseBankTransClaimRequest) returns (ReverseBankTransClaimReply);
|
||
// 认领单列表
|
||
rpc ListBankTransClaim (ListBankTransClaimRequest) returns (ListBankTransClaimReply) {};
|
||
// 认领单详情
|
||
rpc GetBankTransClaim (GetBankTransClaimRequest) returns (GetBankTransClaimReply);
|
||
}
|
||
|
||
message ListBankTransClaimRequest {
|
||
PageReq page = 1 [(buf.validate.field).required = true];
|
||
// 认领单号
|
||
string claimNo = 2;
|
||
// 银行流水号
|
||
string bnkSrlnum = 3;
|
||
// 对方类型(1-上游渠道,2-分销商)
|
||
optional int32 counterpartyType = 4;
|
||
// 认领类型编码
|
||
string claimTypeCode = 5;
|
||
// 对方名称
|
||
string counterpartyName = 6;
|
||
// 认领主体code
|
||
int32 claimSubjectCode = 7;
|
||
// 认领方式(0-自动认领,1-手动认领)
|
||
optional int32 claimMethod = 8;
|
||
// 认领人
|
||
string createdBy = 9;
|
||
// 审批状态(10-无需审批,11-审批中,12-审批通过,13-审批拒绝,20-冲销无需审批,21-冲销审批中,22-冲销审批通过,23-冲销审批拒绝)
|
||
optional int32 approvalStatus = 10;
|
||
// 是否紧急认领(0-否,1-是)
|
||
optional int32 isUrgent = 11;
|
||
// 是否汇总
|
||
bool includeSummary = 12;
|
||
// 认领时间
|
||
optional TimeRange createdAt = 13;
|
||
// 对方ID(如分销商ID/上游渠道ID)
|
||
int32 counterpartyId = 14;
|
||
// 子账户ID
|
||
int32 accountId = 15;
|
||
// 认领单状态(0-正常,1-已冲销)
|
||
optional int32 claimStatus = 16;
|
||
}
|
||
|
||
|
||
message ListBankTransClaimReply {
|
||
repeated BankTransClaimItem list = 1;
|
||
PageReply page = 2;
|
||
optional BankTransClaimSummary summary = 3;
|
||
}
|
||
|
||
message CreateBulkBankTransClaimRequest {
|
||
repeated CreateBulkBankTransClaim claims = 1 [(buf.validate.field).cel = {
|
||
message: "批量认领至少包含1条流水"
|
||
expression: "this.size() > 0"
|
||
}, (buf.validate.field).cel = {
|
||
message: "批量认领不能超过20条流水"
|
||
expression: "this.size() <= 20"
|
||
}];
|
||
}
|
||
|
||
message CreateBulkBankTransClaim {
|
||
// 流水ID
|
||
int32 bankTransLogId = 1 [(buf.validate.field).required = true];
|
||
// 银行流水号
|
||
string bnkSrlnum = 2 [(buf.validate.field).required = true];
|
||
// 认领类型编码(如RL_001)
|
||
string claimTypeCode = 3 [(buf.validate.field).cel = {
|
||
expression: "this.size() > 0"
|
||
message: "必须选择认领类型"
|
||
}];
|
||
// 对方类型(1-上游渠道,2-分销商)
|
||
int32 counterpartyType = 4 [(buf.validate.field).cel = {
|
||
message: "必须选择对方类型"
|
||
expression: "this > 0"
|
||
}];
|
||
// 对方ID(如分销商ID/上游渠道ID)
|
||
int32 counterpartyId = 5 [(buf.validate.field).cel = {
|
||
message: "必须选择对方名称"
|
||
expression: "this > 0"
|
||
}];
|
||
// 来源系统(仅上游渠道支持)
|
||
int32 fromSystem = 6;
|
||
// 子账户ID
|
||
int32 accountId = 7 [(buf.validate.field).cel = {
|
||
message: "必须选择子账户"
|
||
expression: "this > 0"
|
||
}];
|
||
option (buf.validate.message).cel = {
|
||
message: "必须选择上游渠道来源系统"
|
||
expression: "!(this.counterpartyType == 1) || this.fromSystem > 0"
|
||
};
|
||
}
|
||
|
||
message CreateBulkBankTransClaimReply {
|
||
repeated string successBnkSrlnums = 1;
|
||
repeated string failedBnkSrlnums = 2;
|
||
}
|
||
|
||
message CreateBankTransClaimRequest {
|
||
// 流水ID
|
||
int32 bankTransLogId = 1 [(buf.validate.field).required = true];
|
||
// 认领类型编码(如RL_001)
|
||
string claimTypeCode = 2 [(buf.validate.field).cel = {
|
||
expression: "this.size() > 0"
|
||
message: "必须选择认领类型"
|
||
}];
|
||
// 对方类型(1-上游渠道,2-分销商)
|
||
int32 counterpartyType = 3 [(buf.validate.field).cel = {
|
||
message: "必须选择对方类型"
|
||
expression: "this > 0"
|
||
}];
|
||
// 对方ID(如分销商ID/上游渠道ID)
|
||
int32 counterpartyId = 4 [(buf.validate.field).cel = {
|
||
message: "必须选择对方名称"
|
||
expression: "this > 0"
|
||
}];
|
||
// 来源系统(仅上游渠道支持)
|
||
int32 fromSystem = 5;
|
||
// 子账户ID
|
||
int32 accountId = 6 [(buf.validate.field).cel = {
|
||
message: "必须选择子账户"
|
||
expression: "this > 0"
|
||
}];
|
||
option (buf.validate.message).cel = {
|
||
message: "必须选择上游渠道来源系统"
|
||
expression: "!(this.counterpartyType == 1) || this.fromSystem > 0"
|
||
};
|
||
}
|
||
|
||
message CreateBankTransClaimReply {
|
||
// 主键ID
|
||
int32 id = 1;
|
||
}
|
||
|
||
message ReverseBankTransClaimRequest {
|
||
// 主键ID
|
||
int32 id = 1 [(buf.validate.field).required = true];
|
||
// 冲销原因
|
||
string writeoffReason = 2 [(buf.validate.field).cel = {
|
||
expression: "this.size() > 0 && this.size() <= 200"
|
||
message: "冲销原因不能为空,最多支持200个字符"
|
||
}];
|
||
}
|
||
|
||
message ReverseBankTransClaimReply {
|
||
int32 id = 1;
|
||
}
|
||
|
||
message GetBankTransClaimRequest {
|
||
int32 id = 1;
|
||
}
|
||
|
||
message GetBankTransClaimReply {
|
||
// 认领单详情
|
||
BankTransClaimItem detail = 1;
|
||
// 流水详情
|
||
BankTransLogDetail transLog = 2;
|
||
// 冲销详情
|
||
BankTransClaimWriteoff writeoff = 3;
|
||
}
|
||
|
||
message BankTransLogDetail {
|
||
// ID
|
||
int32 id = 1;
|
||
// 交易时间
|
||
string tranDatetime = 2;
|
||
// 银行流水号
|
||
string bnkSrlnum = 3;
|
||
// 流水来源(0-银企直联,1-手动导入)
|
||
int32 tranSource = 4;
|
||
// 交易方向(2-支出,3-收入)'
|
||
int32 tranType = 5;
|
||
// 交易金额
|
||
double tranAmount = 6;
|
||
// 对方账户名称
|
||
string oppAccountName = 7;
|
||
// 对方账号
|
||
string oppAccountNo = 8;
|
||
// 对方开户行名
|
||
string oppOpenBankName = 9;
|
||
// 本方户名(公司账户名称)
|
||
string accountName = 10;
|
||
// 本方账号(公司银行账号)
|
||
string accountNo = 11;
|
||
// 本方开户行
|
||
string openBankName = 12;
|
||
// 本方所属银行
|
||
string bankName = 13;
|
||
// 附言
|
||
string lvmsg = 14;
|
||
// 认领状态(0-未认领,1-处理中,2-已认领)
|
||
int32 claimProgressStatus = 15;
|
||
// 创建人
|
||
string createdBy = 16;
|
||
// 创建时间
|
||
string createdAt = 17;
|
||
}
|
||
|
||
message BankTransClaimWriteoff {
|
||
// 主键ID
|
||
int32 id = 1;
|
||
// 认领单ID
|
||
int32 claimId = 2;
|
||
// 冲销单号
|
||
string writeoffNo = 3;
|
||
// 冲销原因
|
||
string writeoffReason = 4;
|
||
// 冲销审批状态(20-冲销无需审批,21-冲销审批中,22-冲销审批通过,23-冲销审批拒绝)
|
||
int32 approvalStatus = 5;
|
||
// 审批编号(如钉钉审批编号)
|
||
string approvalCode = 6;
|
||
// 冲销人
|
||
string createdBy = 7;
|
||
// 冲销时间
|
||
string createdAt = 8;
|
||
} |