Преглед на файлове

增加DeliveryOrderReq总线接口支持

zhou.xiaoning преди 2 години
родител
ревизия
1c83f75ae4
променени са 6 файла, в които са добавени 643 реда и са изтрити 8 реда
  1. 3 0
      global/funcode.go
  2. 3 0
      global/topic.go
  3. 21 0
      initialize/rabbitmq.go
  4. 18 0
      model/mq/request/mq.go
  5. 551 8
      res/pb/mtp2.pb.go
  6. 47 0
      res/pb/mtp2.proto

+ 3 - 0
global/funcode.go

@@ -92,6 +92,9 @@ var (
 	CancelOrderRsp = 196612 // 撤单应答
 	HolderCloseReq = 196713 // 按单平仓请求
 	HolderCloseRsp = 196714 // 按单平仓应答
+
+	DeliveryOrderReq = 393217 // 交割申报请求
+	DeliveryOrderRsp = 393218 // 交割申报应答
 )
 
 // 通过请求功能码获取对应主题的方法

+ 3 - 0
global/topic.go

@@ -42,4 +42,7 @@ var (
 
 	TOPIC_REQ_ORDER = "order_req" // 交易服务相关请求
 	TOPIC_RSP_ORDER = "order_rsp" // 交易服务相关回应
+
+	TOPIC_REQ_DELIVERY_TRADE = "delivery_trade_req" // 交割交易请求
+	TOPIC_RSP_DELIVERY_TRADE = "delivery_trade_rsp" // 交割交易响应
 )

+ 21 - 0
initialize/rabbitmq.go

@@ -600,6 +600,19 @@ func (t *MQProc) getRspProtobuf(msg *[]byte) (funcode uint32, sessionId uint32,
 			bytes = &bs
 			serialNumber = p.GetHeader().GetRequestID()
 		}
+	case global.DeliveryOrderRsp:
+		var p pb.DeliveryOrderRsp
+		if err = proto.Unmarshal(b, &p); err != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		}
+		if bs, e := protojson.Marshal(&p); e != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		} else {
+			bytes = &bs
+			serialNumber = p.GetHeader().GetRequestID()
+		}
 	}
 
 	return
@@ -671,6 +684,10 @@ func RabbitMQSubscribeTopic() (err error) {
 		global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
 		return
 	}
+	if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_DELIVERY_TRADE); err != nil {
+		global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
+		return
+	}
 
 	global.M2A_LOG.Info("rabbitmq subscribe topic successed.")
 
@@ -762,4 +779,8 @@ func InitFuncodeTopic() {
 		global.CancelOrderReq,
 		global.HolderCloseReq,
 	}
+
+	global.M2A_FuncodeTopic[global.TOPIC_REQ_DELIVERY_TRADE] = []int{
+		global.DeliveryOrderReq,
+	}
 }

+ 18 - 0
model/mq/request/mq.go

@@ -752,6 +752,24 @@ func (r *MQBodyReq) GetProtoBytes(serialNumber *uint32) (bytes *[]byte, err erro
 		} else {
 			bytes = &b
 		}
+	case global.DeliveryOrderReq:
+		m := pb.DeliveryOrderReq{}
+		if err = r.reflect(data, &m); err != nil {
+			return
+		}
+		if m.Header != nil {
+			m.Header.RequestID = serialNumber
+		} else {
+			err = errors.New("请求信息序列化失败")
+			return
+		}
+		if b, e := proto.Marshal(&m); e != nil {
+			global.M2A_LOG.Error(e.Error(), zap.Error(e))
+			err = errors.New("请求信息序列化失败")
+			return
+		} else {
+			bytes = &b
+		}
 	}
 
 	return

+ 551 - 8
res/pb/mtp2.pb.go

@@ -10833,6 +10833,422 @@ func (x *HolderCloseRsp) GetOrderTime() string {
 	return ""
 }
 
+// 交割申报单明细
+type DeliveryOrderDetail struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	AccountID       *uint64 `protobuf:"varint,1,opt,name=AccountID" json:"AccountID,omitempty"`             // 对手方账号
+	Qty             *uint64 `protobuf:"varint,2,opt,name=Qty" json:"Qty,omitempty"`                         // 点选数量
+	BrandID         *uint32 `protobuf:"varint,3,opt,name=BrandID" json:"BrandID,omitempty"`                 // 品牌
+	QualityID       *uint32 `protobuf:"varint,4,opt,name=QualityID" json:"QualityID,omitempty"`             // 品质
+	StandardID      *uint32 `protobuf:"varint,5,opt,name=StandardID" json:"StandardID,omitempty"`           // 规格
+	WarehouseID     *uint32 `protobuf:"varint,6,opt,name=WarehouseID" json:"WarehouseID,omitempty"`         // 仓库
+	DeliveryMonthID *uint32 `protobuf:"varint,7,opt,name=DeliveryMonthID" json:"DeliveryMonthID,omitempty"` // 月份
+	ReceiverAddress *string `protobuf:"bytes,8,opt,name=ReceiverAddress" json:"ReceiverAddress,omitempty"`  // 提货地址
+	TakeMode        *uint32 `protobuf:"varint,9,opt,name=TakeMode" json:"TakeMode,omitempty"`               // 提货方式
+	LadingBillID    *uint64 `protobuf:"varint,10,opt,name=LadingBillID" json:"LadingBillID,omitempty"`      // 提单ID
+	SubNum          *uint64 `protobuf:"varint,11,opt,name=SubNum" json:"SubNum,omitempty"`                  // 提单子单号
+	WRFactorTypeID  *uint64 `protobuf:"varint,12,opt,name=WRFactorTypeID" json:"WRFactorTypeID,omitempty"`  // 仓单要素类型ID
+}
+
+func (x *DeliveryOrderDetail) Reset() {
+	*x = DeliveryOrderDetail{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_mtp2_proto_msgTypes[93]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *DeliveryOrderDetail) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*DeliveryOrderDetail) ProtoMessage() {}
+
+func (x *DeliveryOrderDetail) ProtoReflect() protoreflect.Message {
+	mi := &file_mtp2_proto_msgTypes[93]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use DeliveryOrderDetail.ProtoReflect.Descriptor instead.
+func (*DeliveryOrderDetail) Descriptor() ([]byte, []int) {
+	return file_mtp2_proto_rawDescGZIP(), []int{93}
+}
+
+func (x *DeliveryOrderDetail) GetAccountID() uint64 {
+	if x != nil && x.AccountID != nil {
+		return *x.AccountID
+	}
+	return 0
+}
+
+func (x *DeliveryOrderDetail) GetQty() uint64 {
+	if x != nil && x.Qty != nil {
+		return *x.Qty
+	}
+	return 0
+}
+
+func (x *DeliveryOrderDetail) GetBrandID() uint32 {
+	if x != nil && x.BrandID != nil {
+		return *x.BrandID
+	}
+	return 0
+}
+
+func (x *DeliveryOrderDetail) GetQualityID() uint32 {
+	if x != nil && x.QualityID != nil {
+		return *x.QualityID
+	}
+	return 0
+}
+
+func (x *DeliveryOrderDetail) GetStandardID() uint32 {
+	if x != nil && x.StandardID != nil {
+		return *x.StandardID
+	}
+	return 0
+}
+
+func (x *DeliveryOrderDetail) GetWarehouseID() uint32 {
+	if x != nil && x.WarehouseID != nil {
+		return *x.WarehouseID
+	}
+	return 0
+}
+
+func (x *DeliveryOrderDetail) GetDeliveryMonthID() uint32 {
+	if x != nil && x.DeliveryMonthID != nil {
+		return *x.DeliveryMonthID
+	}
+	return 0
+}
+
+func (x *DeliveryOrderDetail) GetReceiverAddress() string {
+	if x != nil && x.ReceiverAddress != nil {
+		return *x.ReceiverAddress
+	}
+	return ""
+}
+
+func (x *DeliveryOrderDetail) GetTakeMode() uint32 {
+	if x != nil && x.TakeMode != nil {
+		return *x.TakeMode
+	}
+	return 0
+}
+
+func (x *DeliveryOrderDetail) GetLadingBillID() uint64 {
+	if x != nil && x.LadingBillID != nil {
+		return *x.LadingBillID
+	}
+	return 0
+}
+
+func (x *DeliveryOrderDetail) GetSubNum() uint64 {
+	if x != nil && x.SubNum != nil {
+		return *x.SubNum
+	}
+	return 0
+}
+
+func (x *DeliveryOrderDetail) GetWRFactorTypeID() uint64 {
+	if x != nil && x.WRFactorTypeID != nil {
+		return *x.WRFactorTypeID
+	}
+	return 0
+}
+
+// 交割申报请求
+type DeliveryOrderReq struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Header              *MessageHead         `protobuf:"bytes,1,opt,name=Header" json:"Header,omitempty"`
+	ClientSerialNo      *string              `protobuf:"bytes,2,opt,name=ClientSerialNo" json:"ClientSerialNo,omitempty"`            // 客户端流水号
+	ClientOrderTime     *string              `protobuf:"bytes,3,opt,name=ClientOrderTime" json:"ClientOrderTime,omitempty"`          // 客户端委托时间
+	ClientType          *uint32              `protobuf:"varint,4,opt,name=ClientType" json:"ClientType,omitempty"`                   // 终端类型
+	AccountID           *uint64              `protobuf:"varint,5,opt,name=AccountID" json:"AccountID,omitempty"`                     // 交易账号
+	XGoodsID            *uint32              `protobuf:"varint,6,opt,name=XGoodsID" json:"XGoodsID,omitempty"`                       // 主商品ID(交割合约)
+	PGoodsID            *uint32              `protobuf:"varint,7,opt,name=PGoodsID" json:"PGoodsID,omitempty"`                       // 辅助商品ID(辅助合约)
+	P2GoodsID           *uint32              `protobuf:"varint,8,opt,name=P2GoodsID" json:"P2GoodsID,omitempty"`                     // 辅助商品ID(辅助合约2)
+	DeliveryGoodsID     *uint32              `protobuf:"varint,9,opt,name=DeliveryGoodsID" json:"DeliveryGoodsID,omitempty"`         // 交割商品ID
+	XQty                *uint64              `protobuf:"varint,10,opt,name=XQty" json:"XQty,omitempty"`                              // 交割合约数量
+	PQty                *uint64              `protobuf:"varint,11,opt,name=PQty" json:"PQty,omitempty"`                              // 辅助合约数量
+	P2Qty               *uint64              `protobuf:"varint,12,opt,name=P2Qty" json:"P2Qty,omitempty"`                            // 辅助合约2数量
+	DeliveryQty         *uint64              `protobuf:"varint,13,opt,name=DeliveryQty" json:"DeliveryQty,omitempty"`                // 交割商品仓单数量
+	OperateType         *uint32              `protobuf:"varint,14,opt,name=OperateType" json:"OperateType,omitempty"`                // 操作类型:
+	OrderSrc            *uint32              `protobuf:"varint,15,opt,name=OrderSrc" json:"OrderSrc,omitempty"`                      // 单据来源
+	OperatorID          *uint32              `protobuf:"varint,16,opt,name=OperatorID" json:"OperatorID,omitempty"`                  // 操作员账号ID
+	DeliveryOrderDetail *DeliveryOrderDetail `protobuf:"bytes,17,opt,name=DeliveryOrderDetail" json:"DeliveryOrderDetail,omitempty"` // 关联仓单头寸
+	TakeMode            *uint32              `protobuf:"varint,18,opt,name=TakeMode" json:"TakeMode,omitempty"`                      // 提货方式
+	ReceiverAddress     *string              `protobuf:"bytes,19,opt,name=ReceiverAddress" json:"ReceiverAddress,omitempty"`         // 提货地址
+}
+
+func (x *DeliveryOrderReq) Reset() {
+	*x = DeliveryOrderReq{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_mtp2_proto_msgTypes[94]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *DeliveryOrderReq) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*DeliveryOrderReq) ProtoMessage() {}
+
+func (x *DeliveryOrderReq) ProtoReflect() protoreflect.Message {
+	mi := &file_mtp2_proto_msgTypes[94]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use DeliveryOrderReq.ProtoReflect.Descriptor instead.
+func (*DeliveryOrderReq) Descriptor() ([]byte, []int) {
+	return file_mtp2_proto_rawDescGZIP(), []int{94}
+}
+
+func (x *DeliveryOrderReq) GetHeader() *MessageHead {
+	if x != nil {
+		return x.Header
+	}
+	return nil
+}
+
+func (x *DeliveryOrderReq) GetClientSerialNo() string {
+	if x != nil && x.ClientSerialNo != nil {
+		return *x.ClientSerialNo
+	}
+	return ""
+}
+
+func (x *DeliveryOrderReq) GetClientOrderTime() string {
+	if x != nil && x.ClientOrderTime != nil {
+		return *x.ClientOrderTime
+	}
+	return ""
+}
+
+func (x *DeliveryOrderReq) GetClientType() uint32 {
+	if x != nil && x.ClientType != nil {
+		return *x.ClientType
+	}
+	return 0
+}
+
+func (x *DeliveryOrderReq) GetAccountID() uint64 {
+	if x != nil && x.AccountID != nil {
+		return *x.AccountID
+	}
+	return 0
+}
+
+func (x *DeliveryOrderReq) GetXGoodsID() uint32 {
+	if x != nil && x.XGoodsID != nil {
+		return *x.XGoodsID
+	}
+	return 0
+}
+
+func (x *DeliveryOrderReq) GetPGoodsID() uint32 {
+	if x != nil && x.PGoodsID != nil {
+		return *x.PGoodsID
+	}
+	return 0
+}
+
+func (x *DeliveryOrderReq) GetP2GoodsID() uint32 {
+	if x != nil && x.P2GoodsID != nil {
+		return *x.P2GoodsID
+	}
+	return 0
+}
+
+func (x *DeliveryOrderReq) GetDeliveryGoodsID() uint32 {
+	if x != nil && x.DeliveryGoodsID != nil {
+		return *x.DeliveryGoodsID
+	}
+	return 0
+}
+
+func (x *DeliveryOrderReq) GetXQty() uint64 {
+	if x != nil && x.XQty != nil {
+		return *x.XQty
+	}
+	return 0
+}
+
+func (x *DeliveryOrderReq) GetPQty() uint64 {
+	if x != nil && x.PQty != nil {
+		return *x.PQty
+	}
+	return 0
+}
+
+func (x *DeliveryOrderReq) GetP2Qty() uint64 {
+	if x != nil && x.P2Qty != nil {
+		return *x.P2Qty
+	}
+	return 0
+}
+
+func (x *DeliveryOrderReq) GetDeliveryQty() uint64 {
+	if x != nil && x.DeliveryQty != nil {
+		return *x.DeliveryQty
+	}
+	return 0
+}
+
+func (x *DeliveryOrderReq) GetOperateType() uint32 {
+	if x != nil && x.OperateType != nil {
+		return *x.OperateType
+	}
+	return 0
+}
+
+func (x *DeliveryOrderReq) GetOrderSrc() uint32 {
+	if x != nil && x.OrderSrc != nil {
+		return *x.OrderSrc
+	}
+	return 0
+}
+
+func (x *DeliveryOrderReq) GetOperatorID() uint32 {
+	if x != nil && x.OperatorID != nil {
+		return *x.OperatorID
+	}
+	return 0
+}
+
+func (x *DeliveryOrderReq) GetDeliveryOrderDetail() *DeliveryOrderDetail {
+	if x != nil {
+		return x.DeliveryOrderDetail
+	}
+	return nil
+}
+
+func (x *DeliveryOrderReq) GetTakeMode() uint32 {
+	if x != nil && x.TakeMode != nil {
+		return *x.TakeMode
+	}
+	return 0
+}
+
+func (x *DeliveryOrderReq) GetReceiverAddress() string {
+	if x != nil && x.ReceiverAddress != nil {
+		return *x.ReceiverAddress
+	}
+	return ""
+}
+
+// 交割申报应答
+type DeliveryOrderRsp struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Header               *MessageHead           `protobuf:"bytes,1,opt,name=Header" json:"Header,omitempty"`                             // 消息头
+	RetCode              *int32                 `protobuf:"varint,2,opt,name=RetCode" json:"RetCode,omitempty"`                          // 返回码
+	RetDesc              *string                `protobuf:"bytes,3,opt,name=RetDesc" json:"RetDesc,omitempty"`                           // 描述信息
+	ClientSerialNo       *string                `protobuf:"bytes,4,opt,name=ClientSerialNo" json:"ClientSerialNo,omitempty"`             // 客户端流水号
+	DeliveryOrderDetails []*DeliveryOrderDetail `protobuf:"bytes,5,rep,name=DeliveryOrderDetails" json:"DeliveryOrderDetails,omitempty"` // 一级生成的订单号
+	OrderTime            *string                `protobuf:"bytes,6,opt,name=OrderTime" json:"OrderTime,omitempty"`                       // 接收委托交易的时间
+}
+
+func (x *DeliveryOrderRsp) Reset() {
+	*x = DeliveryOrderRsp{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_mtp2_proto_msgTypes[95]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *DeliveryOrderRsp) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*DeliveryOrderRsp) ProtoMessage() {}
+
+func (x *DeliveryOrderRsp) ProtoReflect() protoreflect.Message {
+	mi := &file_mtp2_proto_msgTypes[95]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use DeliveryOrderRsp.ProtoReflect.Descriptor instead.
+func (*DeliveryOrderRsp) Descriptor() ([]byte, []int) {
+	return file_mtp2_proto_rawDescGZIP(), []int{95}
+}
+
+func (x *DeliveryOrderRsp) GetHeader() *MessageHead {
+	if x != nil {
+		return x.Header
+	}
+	return nil
+}
+
+func (x *DeliveryOrderRsp) GetRetCode() int32 {
+	if x != nil && x.RetCode != nil {
+		return *x.RetCode
+	}
+	return 0
+}
+
+func (x *DeliveryOrderRsp) GetRetDesc() string {
+	if x != nil && x.RetDesc != nil {
+		return *x.RetDesc
+	}
+	return ""
+}
+
+func (x *DeliveryOrderRsp) GetClientSerialNo() string {
+	if x != nil && x.ClientSerialNo != nil {
+		return *x.ClientSerialNo
+	}
+	return ""
+}
+
+func (x *DeliveryOrderRsp) GetDeliveryOrderDetails() []*DeliveryOrderDetail {
+	if x != nil {
+		return x.DeliveryOrderDetails
+	}
+	return nil
+}
+
+func (x *DeliveryOrderRsp) GetOrderTime() string {
+	if x != nil && x.OrderTime != nil {
+		return *x.OrderTime
+	}
+	return ""
+}
+
 var File_mtp2_proto protoreflect.FileDescriptor
 
 var file_mtp2_proto_rawDesc = []byte{
@@ -12846,7 +13262,91 @@ var file_mtp2_proto_rawDesc = []byte{
 	0x65, 0x73, 0x63, 0x12, 0x18, 0x0a, 0x07, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x44, 0x18, 0x04,
 	0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1c, 0x0a,
 	0x09, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09,
-	0x52, 0x09, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65,
+	0x52, 0x09, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x93, 0x03, 0x0a, 0x13,
+	0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x44, 0x65, 0x74,
+	0x61, 0x69, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x44,
+	0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49,
+	0x44, 0x12, 0x10, 0x0a, 0x03, 0x51, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03,
+	0x51, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x49, 0x44, 0x18, 0x03,
+	0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x42, 0x72, 0x61, 0x6e, 0x64, 0x49, 0x44, 0x12, 0x1c, 0x0a,
+	0x09, 0x51, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d,
+	0x52, 0x09, 0x51, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x53,
+	0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x49, 0x44, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52,
+	0x0a, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x57,
+	0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x49, 0x44, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d,
+	0x52, 0x0b, 0x57, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x49, 0x44, 0x12, 0x28, 0x0a,
+	0x0f, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x49, 0x44,
+	0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79,
+	0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x49, 0x44, 0x12, 0x28, 0x0a, 0x0f, 0x52, 0x65, 0x63, 0x65, 0x69,
+	0x76, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x0f, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73,
+	0x73, 0x12, 0x1a, 0x0a, 0x08, 0x54, 0x61, 0x6b, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x18, 0x09, 0x20,
+	0x01, 0x28, 0x0d, 0x52, 0x08, 0x54, 0x61, 0x6b, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x22, 0x0a,
+	0x0c, 0x4c, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x69, 0x6c, 0x6c, 0x49, 0x44, 0x18, 0x0a, 0x20,
+	0x01, 0x28, 0x04, 0x52, 0x0c, 0x4c, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x69, 0x6c, 0x6c, 0x49,
+	0x44, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x75, 0x62, 0x4e, 0x75, 0x6d, 0x18, 0x0b, 0x20, 0x01, 0x28,
+	0x04, 0x52, 0x06, 0x53, 0x75, 0x62, 0x4e, 0x75, 0x6d, 0x12, 0x26, 0x0a, 0x0e, 0x57, 0x52, 0x46,
+	0x61, 0x63, 0x74, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x49, 0x44, 0x18, 0x0c, 0x20, 0x01, 0x28,
+	0x04, 0x52, 0x0e, 0x57, 0x52, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x49,
+	0x44, 0x22, 0x9a, 0x05, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x4f, 0x72,
+	0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x27, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72,
+	0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73,
+	0x61, 0x67, 0x65, 0x48, 0x65, 0x61, 0x64, 0x52, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12,
+	0x26, 0x0a, 0x0e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x4e,
+	0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53,
+	0x65, 0x72, 0x69, 0x61, 0x6c, 0x4e, 0x6f, 0x12, 0x28, 0x0a, 0x0f, 0x43, 0x6c, 0x69, 0x65, 0x6e,
+	0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x0f, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x54, 0x69, 0x6d,
+	0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18,
+	0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70,
+	0x65, 0x12, 0x1c, 0x0a, 0x09, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x44, 0x18, 0x05,
+	0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x44, 0x12,
+	0x1a, 0x0a, 0x08, 0x58, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x44, 0x18, 0x06, 0x20, 0x01, 0x28,
+	0x0d, 0x52, 0x08, 0x58, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x50,
+	0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x44, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x50,
+	0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x50, 0x32, 0x47, 0x6f, 0x6f,
+	0x64, 0x73, 0x49, 0x44, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x50, 0x32, 0x47, 0x6f,
+	0x6f, 0x64, 0x73, 0x49, 0x44, 0x12, 0x28, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72,
+	0x79, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x44, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f,
+	0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x44, 0x12,
+	0x12, 0x0a, 0x04, 0x58, 0x51, 0x74, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x58,
+	0x51, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x50, 0x51, 0x74, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28,
+	0x04, 0x52, 0x04, 0x50, 0x51, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x50, 0x32, 0x51, 0x74, 0x79,
+	0x18, 0x0c, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x50, 0x32, 0x51, 0x74, 0x79, 0x12, 0x20, 0x0a,
+	0x0b, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x51, 0x74, 0x79, 0x18, 0x0d, 0x20, 0x01,
+	0x28, 0x04, 0x52, 0x0b, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x51, 0x74, 0x79, 0x12,
+	0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0e,
+	0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x65, 0x54, 0x79, 0x70,
+	0x65, 0x12, 0x1a, 0x0a, 0x08, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x53, 0x72, 0x63, 0x18, 0x0f, 0x20,
+	0x01, 0x28, 0x0d, 0x52, 0x08, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x53, 0x72, 0x63, 0x12, 0x1e, 0x0a,
+	0x0a, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x44, 0x18, 0x10, 0x20, 0x01, 0x28,
+	0x0d, 0x52, 0x0a, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x44, 0x12, 0x49, 0x0a,
+	0x13, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x44, 0x65,
+	0x74, 0x61, 0x69, 0x6c, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x62, 0x2e,
+	0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x44, 0x65, 0x74,
+	0x61, 0x69, 0x6c, 0x52, 0x13, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x4f, 0x72, 0x64,
+	0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x54, 0x61, 0x6b, 0x65,
+	0x4d, 0x6f, 0x64, 0x65, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x54, 0x61, 0x6b, 0x65,
+	0x4d, 0x6f, 0x64, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72,
+	0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x52,
+	0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x82,
+	0x02, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72,
+	0x52, 0x73, 0x70, 0x12, 0x27, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20,
+	0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
+	0x48, 0x65, 0x61, 0x64, 0x52, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07,
+	0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x52,
+	0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x52, 0x65, 0x74, 0x44, 0x65, 0x73,
+	0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x52, 0x65, 0x74, 0x44, 0x65, 0x73, 0x63,
+	0x12, 0x26, 0x0a, 0x0e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c,
+	0x4e, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74,
+	0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x4e, 0x6f, 0x12, 0x4b, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x69,
+	0x76, 0x65, 0x72, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73,
+	0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x69,
+	0x76, 0x65, 0x72, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52,
+	0x14, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x44, 0x65,
+	0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x54, 0x69,
+	0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x54,
+	0x69, 0x6d, 0x65,
 }
 
 var (
@@ -12861,7 +13361,7 @@ func file_mtp2_proto_rawDescGZIP() []byte {
 	return file_mtp2_proto_rawDescData
 }
 
-var file_mtp2_proto_msgTypes = make([]protoimpl.MessageInfo, 93)
+var file_mtp2_proto_msgTypes = make([]protoimpl.MessageInfo, 96)
 var file_mtp2_proto_goTypes = []interface{}{
 	(*MessageHead)(nil),                         // 0: pb.MessageHead
 	(*NotifyHead)(nil),                          // 1: pb.NotifyHead
@@ -12956,6 +13456,9 @@ var file_mtp2_proto_goTypes = []interface{}{
 	(*CancelOrderRsp)(nil),                      // 90: pb.CancelOrderRsp
 	(*HolderCloseReq)(nil),                      // 91: pb.HolderCloseReq
 	(*HolderCloseRsp)(nil),                      // 92: pb.HolderCloseRsp
+	(*DeliveryOrderDetail)(nil),                 // 93: pb.DeliveryOrderDetail
+	(*DeliveryOrderReq)(nil),                    // 94: pb.DeliveryOrderReq
+	(*DeliveryOrderRsp)(nil),                    // 95: pb.DeliveryOrderRsp
 }
 var file_mtp2_proto_depIdxs = []int32{
 	0,  // 0: pb.MoneyChangedNtf.Header:type_name -> pb.MessageHead
@@ -13052,11 +13555,15 @@ var file_mtp2_proto_depIdxs = []int32{
 	0,  // 91: pb.CancelOrderRsp.Header:type_name -> pb.MessageHead
 	0,  // 92: pb.HolderCloseReq.Header:type_name -> pb.MessageHead
 	0,  // 93: pb.HolderCloseRsp.Header:type_name -> pb.MessageHead
-	94, // [94:94] is the sub-list for method output_type
-	94, // [94:94] is the sub-list for method input_type
-	94, // [94:94] is the sub-list for extension type_name
-	94, // [94:94] is the sub-list for extension extendee
-	0,  // [0:94] is the sub-list for field type_name
+	0,  // 94: pb.DeliveryOrderReq.Header:type_name -> pb.MessageHead
+	93, // 95: pb.DeliveryOrderReq.DeliveryOrderDetail:type_name -> pb.DeliveryOrderDetail
+	0,  // 96: pb.DeliveryOrderRsp.Header:type_name -> pb.MessageHead
+	93, // 97: pb.DeliveryOrderRsp.DeliveryOrderDetails:type_name -> pb.DeliveryOrderDetail
+	98, // [98:98] is the sub-list for method output_type
+	98, // [98:98] is the sub-list for method input_type
+	98, // [98:98] is the sub-list for extension type_name
+	98, // [98:98] is the sub-list for extension extendee
+	0,  // [0:98] is the sub-list for field type_name
 }
 
 func init() { file_mtp2_proto_init() }
@@ -14181,6 +14688,42 @@ func file_mtp2_proto_init() {
 				return nil
 			}
 		}
+		file_mtp2_proto_msgTypes[93].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*DeliveryOrderDetail); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_mtp2_proto_msgTypes[94].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*DeliveryOrderReq); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_mtp2_proto_msgTypes[95].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*DeliveryOrderRsp); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
 	}
 	type x struct{}
 	out := protoimpl.TypeBuilder{
@@ -14188,7 +14731,7 @@ func file_mtp2_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_mtp2_proto_rawDesc,
 			NumEnums:      0,
-			NumMessages:   93,
+			NumMessages:   96,
 			NumExtensions: 0,
 			NumServices:   0,
 		},

+ 47 - 0
res/pb/mtp2.proto

@@ -1247,4 +1247,51 @@ message HolderCloseRsp {
 	optional string RetDesc = 3; // 描述信息
 		optional uint64 OrderID = 4; // 一级生成的订单号
 		optional string OrderTime = 5; // 接收委托交易的时间
+}
+
+// 交割申报单明细
+message DeliveryOrderDetail {
+		optional uint64 AccountID = 1; // 对手方账号
+		optional uint64 Qty = 2; // 点选数量
+		optional uint32 BrandID = 3; // 品牌
+		optional uint32 QualityID = 4; // 品质
+		optional uint32 StandardID = 5; // 规格
+		optional uint32 WarehouseID = 6; // 仓库
+		optional uint32 DeliveryMonthID = 7; // 月份
+		optional string ReceiverAddress = 8; // 提货地址
+		optional uint32 TakeMode = 9; // 提货方式
+		optional uint64 LadingBillID = 10; // 提单ID
+		optional uint64 SubNum = 11; // 提单子单号
+		optional uint64 WRFactorTypeID = 12; // 仓单要素类型ID
+}
+// 交割申报请求
+message DeliveryOrderReq {
+	optional MessageHead Header = 1;
+		optional string ClientSerialNo = 2; // 客户端流水号
+		optional string ClientOrderTime = 3; // 客户端委托时间
+		optional uint32 ClientType = 4; // 终端类型
+		optional uint64 AccountID = 5; // 交易账号
+		optional uint32 XGoodsID = 6; // 主商品ID(交割合约)
+		optional uint32 PGoodsID = 7; // 辅助商品ID(辅助合约)
+		optional uint32 P2GoodsID = 8; // 辅助商品ID(辅助合约2)
+		optional uint32 DeliveryGoodsID = 9; // 交割商品ID
+		optional uint64 XQty = 10; // 交割合约数量
+		optional uint64 PQty = 11; // 辅助合约数量
+		optional uint64 P2Qty = 12; // 辅助合约2数量
+		optional uint64 DeliveryQty = 13; // 交割商品仓单数量
+		optional uint32 OperateType = 14; // 操作类型:
+		optional uint32 OrderSrc = 15; // 单据来源
+		optional uint32 OperatorID = 16; // 操作员账号ID
+		optional DeliveryOrderDetail DeliveryOrderDetail = 17; // 关联仓单头寸
+		optional uint32 TakeMode = 18; // 提货方式
+		optional string ReceiverAddress = 19; // 提货地址
+}
+// 交割申报应答
+message DeliveryOrderRsp {
+	optional MessageHead Header = 1; // 消息头
+	optional int32 RetCode = 2; // 返回码
+	optional string RetDesc = 3; // 描述信息
+		optional string ClientSerialNo = 4; // 客户端流水号
+		repeated DeliveryOrderDetail DeliveryOrderDetails = 5; // 一级生成的订单号
+		optional string OrderTime = 6; // 接收委托交易的时间
 }