rabbitmq.go 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100
  1. package initialize
  2. import (
  3. "encoding/base64"
  4. "fmt"
  5. "mtp20access/client"
  6. "mtp20access/global"
  7. rsp "mtp20access/model/mq/response"
  8. "mtp20access/packet"
  9. "mtp20access/publish"
  10. "mtp20access/rabbitmq"
  11. "mtp20access/res/pb"
  12. accountSrv "mtp20access/service/account"
  13. "mtp20access/utils"
  14. "strconv"
  15. // "github.com/golang/protobuf/proto"
  16. "github.com/streadway/amqp"
  17. "go.uber.org/zap"
  18. "google.golang.org/protobuf/encoding/protojson"
  19. "google.golang.org/protobuf/proto"
  20. )
  21. func RabbitMQ() *global.RabbitMQ {
  22. url := global.M2A_CONFIG.Rabbitmq.Url
  23. connection, err := amqp.Dial(url)
  24. if err != nil {
  25. global.M2A_LOG.Error("rabbitmq connect failed, err:", zap.Error(err))
  26. return nil
  27. }
  28. channel, err := connection.Channel()
  29. if err != nil {
  30. global.M2A_LOG.Error("rabbitmq open channel failed, err:", zap.Error(err))
  31. return nil
  32. }
  33. global.M2A_LOG.Info("rabbitmq connect successed.")
  34. return &global.RabbitMQ{
  35. Connection: connection,
  36. Channel: channel,
  37. }
  38. }
  39. // MQProc 消息处理对象
  40. type MQProc struct{}
  41. // process 消息处理接口
  42. func (t *MQProc) Process(topic, queuename string, msg *[]byte) {
  43. info := fmt.Sprintf("rabbitmq receive message from: topic[%s] queue[%s] contentLen[%d]",
  44. topic,
  45. queuename,
  46. len(string(*msg)))
  47. global.M2A_LOG.Info(info)
  48. if funcode, sessionId, bytes, serialNumber, err := t.getRspProtobuf(msg); err == nil && bytes != nil {
  49. if sessionId == 0 || funcode == uint32(global.LogoutRsp) || funcode == uint32(global.LoginRsp) {
  50. // 通知类 或 特殊处理
  51. // t.onNtf(funcode, sessionId, bytes)
  52. } else {
  53. // 请求回复
  54. // 尝试获取对应异步任务
  55. if c, exists := client.Clients[int(sessionId)]; exists {
  56. key := fmt.Sprintf("%v_%v_%v", sessionId, funcode, serialNumber)
  57. // 银行服务相关的回复流水号是错误的,所以需要特殊处理
  58. if int(funcode) == global.T2bBankSignRsp ||
  59. int(funcode) == global.T2bBankCancelSignRsp ||
  60. int(funcode) == global.T2bBankWithdrawRsp ||
  61. int(funcode) == global.T2bBankDepositRsp {
  62. key = fmt.Sprintf("%v_%v", sessionId, funcode)
  63. }
  64. asyncTask := c.GetAsyncTask(key)
  65. if asyncTask != nil {
  66. rspData := string(*bytes)
  67. // 判断是否要加密
  68. if asyncTask.IsEncrypted {
  69. if b, err := packet.Encrypt(*bytes, packet.AESKey, true); err != nil {
  70. global.M2A_LOG.Error("总线回复数据加密失败", zap.Error(err))
  71. return
  72. } else {
  73. rspData = base64.StdEncoding.EncodeToString(b)
  74. }
  75. }
  76. // 给客户端回调
  77. global.M2A_LOG.Info("[S->C]", zap.Any("rsp", funcode), zap.Any("sessionId", sessionId), zap.Any("data", string(rspData)))
  78. r := rsp.MQBodyRsp{
  79. FunCode: funcode,
  80. IsEncrypted: asyncTask.IsEncrypted,
  81. Data: rspData,
  82. }
  83. asyncTask.Rsp <- r
  84. } else {
  85. global.M2A_LOG.Info("找不到对应KEY的异步任务", zap.Any("key", key), zap.Any("AsyncMap", c.GetAllAsyncTask()))
  86. global.M2A_LOG.Info("++++++++++++++ 当前的 Clients", zap.Any("client.Clients", client.Clients))
  87. global.M2A_LOG.Info("-------------- 当前的 AsyncTask", zap.Any("SessionId", c.SessionID), zap.Any("AsyncTask", c.GetAllAsyncTask()))
  88. }
  89. } else {
  90. global.M2A_LOG.Info("找不到对应的client", zap.Any("sessionId", sessionId))
  91. }
  92. }
  93. }
  94. }
  95. func (t *MQProc) onNtf(funcode uint32, sessionId uint32, bytes *[]byte) {
  96. var clients []*client.Client
  97. var err error
  98. var sendBytes *[]byte
  99. switch int(funcode) {
  100. case global.LoginRsp: // 用户登录应答 - 主要记录旧Token
  101. var p pb.LoginRsp
  102. if err = proto.Unmarshal(*bytes, &p); err != nil {
  103. global.M2A_LOG.Error("总线数据反序列化失败", zap.Error(err))
  104. return
  105. }
  106. // if bs, e := protojson.Marshal(&p); e != nil {
  107. // global.M2A_LOG.Error("总线数据反序列化失败", zap.Error(err))
  108. // return
  109. // } else {
  110. // sendBytes = &bs
  111. // }
  112. // 获取目标客户
  113. for i := range client.Clients {
  114. c := client.Clients[i]
  115. if strconv.Itoa(int(p.GetUserID())) == c.UserID &&
  116. strconv.Itoa(int(sessionId)) == c.SessionID {
  117. // 主要记录旧Token
  118. c.OldToken = p.GetToken()
  119. }
  120. }
  121. case global.LogoutRsp: // 用户登出应答 - 主要用于接收管理端踢上线
  122. var p pb.LogoutRsp
  123. if err = proto.Unmarshal(*bytes, &p); err != nil {
  124. global.M2A_LOG.Error("总线数据反序列化失败", zap.Error(err))
  125. return
  126. }
  127. if bs, e := protojson.Marshal(&p); e != nil {
  128. global.M2A_LOG.Error("总线数据序列化JSON失败", zap.Error(err))
  129. return
  130. } else {
  131. sendBytes = &bs
  132. }
  133. // 获取目标客户
  134. clients = make([]*client.Client, 0)
  135. for i := range client.Clients {
  136. c := client.Clients[i]
  137. if strconv.Itoa(int(p.GetHeader().GetUserID())) == c.UserID {
  138. clients = append(clients, c)
  139. }
  140. }
  141. case global.MoneyChangedNtf: // 资金变化通知
  142. var p pb.MoneyChangedNtf
  143. if err = proto.Unmarshal(*bytes, &p); err != nil {
  144. global.M2A_LOG.Error("总线数据反序列化失败", zap.Error(err))
  145. return
  146. }
  147. if bs, e := protojson.Marshal(&p); e != nil {
  148. global.M2A_LOG.Error("总线数据序列化JSON失败", zap.Error(err))
  149. return
  150. } else {
  151. sendBytes = &bs
  152. }
  153. // 获取目标客户
  154. clients, err = accountSrv.GetClientsByAccountID(*p.AccountID)
  155. if err != nil {
  156. return
  157. }
  158. case global.PosChangedNtf: // 头寸变化通知
  159. var p pb.PosChangedNtf
  160. if err = proto.Unmarshal(*bytes, &p); err != nil {
  161. global.M2A_LOG.Error("总线数据反序列化失败", zap.Error(err))
  162. return
  163. }
  164. if bs, e := protojson.Marshal(&p); e != nil {
  165. global.M2A_LOG.Error("总线数据序列化JSON失败", zap.Error(err))
  166. return
  167. } else {
  168. sendBytes = &bs
  169. }
  170. // global.M2A_LOG.Info("接收 PosChangedNtf", zap.Any("ntf", funcode), zap.Any("AccountID", *p.AccountID))
  171. // global.M2A_LOG.Info("当前的 Clients", zap.Any("ntf", funcode), zap.Any("client.Clients", client.Clients))
  172. // 获取目标客户
  173. clients, err = accountSrv.GetClientsByAccountID(*p.AccountID)
  174. global.M2A_LOG.Info("找到对应的clients", zap.Any("ntf", funcode), zap.Any("clients", clients))
  175. if err != nil {
  176. global.M2A_LOG.Info(fmt.Sprintf("接收头寸变化通知时获取不到对应Client,AccountID:%v", *p.AccountID))
  177. return
  178. }
  179. case global.OrderDealedNtf: // 委托单成交通知
  180. var p pb.OrderDealedNtf
  181. if err = proto.Unmarshal(*bytes, &p); err != nil {
  182. global.M2A_LOG.Error("总线数据反序列化失败", zap.Error(err))
  183. return
  184. }
  185. if bs, e := protojson.Marshal(&p); e != nil {
  186. global.M2A_LOG.Error("总线数据序列化JSON失败", zap.Error(err))
  187. return
  188. } else {
  189. sendBytes = &bs
  190. }
  191. // 获取目标客户
  192. clients, err = accountSrv.GetClientsByAccountID(*p.AccountID)
  193. if err != nil {
  194. return
  195. }
  196. case global.MarketStatusChangeNtf: // 市场状态变更通知
  197. var p pb.MarketStatusChangeNtf
  198. if err = proto.Unmarshal(*bytes, &p); err != nil {
  199. global.M2A_LOG.Error("总线数据反序列化失败", zap.Error(err))
  200. return
  201. }
  202. if bs, e := protojson.Marshal(&p); e != nil {
  203. global.M2A_LOG.Error("总线数据序列化JSON失败", zap.Error(err))
  204. return
  205. } else {
  206. sendBytes = &bs
  207. }
  208. // 获取目标客户
  209. clients = make([]*client.Client, 0)
  210. for i := range client.Clients {
  211. c := client.Clients[i]
  212. clients = append(clients, c)
  213. }
  214. case global.ListingOrderChangeNtf: // 挂牌委托变更广播通知
  215. var p pb.ListingOrderChangeNtf
  216. if err = proto.Unmarshal(*bytes, &p); err != nil {
  217. global.M2A_LOG.Error("总线数据反序列化失败", zap.Error(err))
  218. return
  219. }
  220. if bs, e := protojson.Marshal(&p); e != nil {
  221. global.M2A_LOG.Error("总线数据序列化JSON失败", zap.Error(err))
  222. return
  223. } else {
  224. sendBytes = &bs
  225. }
  226. // 获取目标客户
  227. clients = make([]*client.Client, 0)
  228. for i := range client.Clients {
  229. c := client.Clients[i]
  230. clients = append(clients, c)
  231. }
  232. }
  233. if err == nil && len(clients) > 0 {
  234. // 组装待发送给客户端的5.0报文包
  235. b, err := packet.BuildPacket(funcode, 0, 0, *sendBytes, true)
  236. if err != nil {
  237. global.M2A_LOG.Error("组装5.0报文失败", zap.Error(err))
  238. return
  239. }
  240. // 发送信息
  241. for _, item := range clients {
  242. // c := clients[i]
  243. sessionId, _ := strconv.Atoi(item.SessionID)
  244. c := client.Clients[sessionId]
  245. // c.WriteTradeWsBuf(b)
  246. // 给客户端通知
  247. global.M2A_LOG.Info("[S->C]给客户端通知", zap.Any("ntf", funcode), zap.Any("clients", c.LoginID), zap.Any("SessionID", c.SessionID), zap.Any("len", len(b)))
  248. // 分发给订阅者
  249. m := make(map[string][]byte)
  250. m[item.SessionID] = b
  251. global.M2A_Publish.Publish(publish.Topic_Trading, m)
  252. }
  253. }
  254. }
  255. // getRspProtobuf 将总线回复的数据反序列化为Protobuf
  256. func (t *MQProc) getRspProtobuf(msg *[]byte) (funcode uint32, sessionId uint32, bytes *[]byte, serialNumber uint32, err error) {
  257. // 分解总线包信息
  258. funcode = utils.BytesToUint32((*msg)[0:4])
  259. sessionId = utils.BytesToUint32((*msg)[4:8])
  260. b := (*msg)[8:]
  261. global.M2A_LOG.Info("收到总线消息", zap.Any("funcode", funcode), zap.Any("sessionId", sessionId), zap.Any("len", len(b)))
  262. switch int(funcode) {
  263. case global.PosChangedNtf,
  264. global.MoneyChangedNtf,
  265. global.OrderDealedNtf,
  266. global.MarketStatusChangeNtf,
  267. global.LoginRsp,
  268. global.LogoutRsp,
  269. global.ListingOrderChangeNtf: // 资金变化通知等
  270. // global.M2A_LOG.Info("进入通知逻辑----------", zap.Any("funcode", funcode), zap.Any("sessionId", sessionId))
  271. bytes = &b
  272. case global.ModifyPwdRsp: // 修改账户密码应答
  273. var p pb.ModifyPwdRsp
  274. if err = proto.Unmarshal(b, &p); err != nil {
  275. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  276. return
  277. }
  278. if bs, e := protojson.Marshal(&p); e != nil {
  279. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  280. return
  281. } else {
  282. bytes = &bs
  283. serialNumber = p.GetHeader().GetRequestID()
  284. }
  285. case global.UserReceiveInfoRsp: // 新增修改收货地址请求响应
  286. var p pb.UserReceiveInfoRsp
  287. if err = proto.Unmarshal(b, &p); err != nil {
  288. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  289. return
  290. }
  291. if bs, e := protojson.Marshal(&p); e != nil {
  292. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  293. return
  294. } else {
  295. bytes = &bs
  296. serialNumber = p.GetHeader().GetRequestID()
  297. }
  298. case global.DelUserReceiveInfoRsp: // 删除收货地址请求响应
  299. var p pb.DelUserReceiveInfoRsp
  300. if err = proto.Unmarshal(b, &p); err != nil {
  301. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  302. return
  303. }
  304. if bs, e := protojson.Marshal(&p); e != nil {
  305. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  306. return
  307. } else {
  308. bytes = &bs
  309. serialNumber = p.GetHeader().GetRequestID()
  310. }
  311. case global.UserReceiveIsDefaultRsp:
  312. var p pb.UserReceiveIsDefaultRsp
  313. if err = proto.Unmarshal(b, &p); err != nil {
  314. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  315. return
  316. }
  317. if bs, e := protojson.Marshal(&p); e != nil {
  318. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  319. return
  320. } else {
  321. bytes = &bs
  322. serialNumber = p.GetHeader().GetRequestID()
  323. }
  324. case global.UserReceiptInfoRsp: // 新增修改用户发票信息请求响应
  325. var p pb.UserReceiptInfoRsp
  326. if err = proto.Unmarshal(b, &p); err != nil {
  327. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  328. return
  329. }
  330. if bs, e := protojson.Marshal(&p); e != nil {
  331. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  332. return
  333. } else {
  334. bytes = &bs
  335. serialNumber = p.GetHeader().GetRequestID()
  336. }
  337. case global.DelUserReceiptInfoRsp: // 删除用户发票信息请求响应
  338. var p pb.DelUserReceiptInfoRsp
  339. if err = proto.Unmarshal(b, &p); err != nil {
  340. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  341. return
  342. }
  343. if bs, e := protojson.Marshal(&p); e != nil {
  344. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  345. return
  346. } else {
  347. bytes = &bs
  348. serialNumber = p.GetHeader().GetRequestID()
  349. }
  350. case global.T2bBankSignRsp: // 签约应答
  351. var p pb.T2BBankSignRsp
  352. if err = proto.Unmarshal(b, &p); err != nil {
  353. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  354. return
  355. }
  356. if bs, e := protojson.Marshal(&p); e != nil {
  357. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  358. return
  359. } else {
  360. bytes = &bs
  361. serialNumber = p.GetHeader().GetRequestID()
  362. }
  363. case global.T2bBankCancelSignRsp: // 解约应答
  364. var p pb.T2BBankCancelSignRsp
  365. if err = proto.Unmarshal(b, &p); err != nil {
  366. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  367. return
  368. }
  369. if bs, e := protojson.Marshal(&p); e != nil {
  370. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  371. return
  372. } else {
  373. bytes = &bs
  374. serialNumber = p.GetHeader().GetRequestID()
  375. }
  376. case global.T2bBankWithdrawRsp: // 出金应答
  377. var p pb.T2BBankWithdrawRsp
  378. if err = proto.Unmarshal(b, &p); err != nil {
  379. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  380. return
  381. }
  382. if bs, e := protojson.Marshal(&p); e != nil {
  383. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  384. return
  385. } else {
  386. bytes = &bs
  387. serialNumber = p.GetHeader().GetRequestID()
  388. }
  389. case global.T2bBankDepositRsp: // 入金应答
  390. var p pb.T2BBankDepositRsp
  391. if err = proto.Unmarshal(b, &p); err != nil {
  392. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  393. return
  394. }
  395. if bs, e := protojson.Marshal(&p); e != nil {
  396. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  397. return
  398. } else {
  399. bytes = &bs
  400. serialNumber = p.GetHeader().GetRequestID()
  401. }
  402. case global.WarehouseApplyRsp: // 仓库申请应答
  403. var p pb.WarehouseApplyRsp
  404. if err = proto.Unmarshal(b, &p); err != nil {
  405. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  406. return
  407. }
  408. if bs, e := protojson.Marshal(&p); e != nil {
  409. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  410. return
  411. } else {
  412. bytes = &bs
  413. serialNumber = p.GetHeader().GetRequestID()
  414. }
  415. case global.PerformanceContractedApplyRsp: // 违约申请应答
  416. var p pb.PerformanceContractedApplyRsp
  417. if err = proto.Unmarshal(b, &p); err != nil {
  418. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  419. return
  420. }
  421. if bs, e := protojson.Marshal(&p); e != nil {
  422. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  423. return
  424. } else {
  425. bytes = &bs
  426. serialNumber = p.GetHeader().GetRequestID()
  427. }
  428. case global.PerformanceDelayApplyRsp: // 延期申请应答
  429. var p pb.PerformanceDelayApplyRsp
  430. if err = proto.Unmarshal(b, &p); err != nil {
  431. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  432. return
  433. }
  434. if bs, e := protojson.Marshal(&p); e != nil {
  435. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  436. return
  437. } else {
  438. bytes = &bs
  439. serialNumber = p.GetHeader().GetRequestID()
  440. }
  441. case global.PerformanceManualConfirmRsp: // 履约手动确认应答
  442. var p pb.PerformanceManualConfirmRsp
  443. if err = proto.Unmarshal(b, &p); err != nil {
  444. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  445. return
  446. }
  447. if bs, e := protojson.Marshal(&p); e != nil {
  448. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  449. return
  450. } else {
  451. bytes = &bs
  452. serialNumber = p.GetHeader().GetRequestID()
  453. }
  454. case global.PerformanceModifyContactRsp: // 履约修改联络信息回应
  455. var p pb.PerformanceModifyContactRsp
  456. if err = proto.Unmarshal(b, &p); err != nil {
  457. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  458. return
  459. }
  460. if bs, e := protojson.Marshal(&p); e != nil {
  461. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  462. return
  463. } else {
  464. bytes = &bs
  465. serialNumber = p.GetHeader().GetRequestID()
  466. }
  467. case global.GoodsFavoriteOperateRsp: // 商品收藏操作接口应答
  468. var p pb.GoodsFavoriteOperateRsp
  469. if err = proto.Unmarshal(b, &p); err != nil {
  470. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  471. return
  472. }
  473. if bs, e := protojson.Marshal(&p); e != nil {
  474. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  475. return
  476. } else {
  477. bytes = &bs
  478. serialNumber = p.GetHeader().GetRequestID()
  479. }
  480. case global.ZSBuyOrderListingRsp: // 钻石买挂牌接口应答
  481. var p pb.ZSBuyOrderListingRsp
  482. if err = proto.Unmarshal(b, &p); err != nil {
  483. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  484. return
  485. }
  486. if bs, e := protojson.Marshal(&p); e != nil {
  487. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  488. return
  489. } else {
  490. bytes = &bs
  491. serialNumber = p.GetHeader().GetRequestID()
  492. }
  493. case global.ZSSellOrderListingRsp: // 钻石卖挂牌接口响应
  494. var p pb.ZSSellOrderListingRsp
  495. if err = proto.Unmarshal(b, &p); err != nil {
  496. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  497. return
  498. }
  499. if bs, e := protojson.Marshal(&p); e != nil {
  500. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  501. return
  502. } else {
  503. bytes = &bs
  504. serialNumber = p.GetHeader().GetRequestID()
  505. }
  506. case global.ZSBuyOrderDestingRsp: // 钻石卖摘牌申请接口响应
  507. var p pb.ZSBuyOrderDestingRsp
  508. if err = proto.Unmarshal(b, &p); err != nil {
  509. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  510. return
  511. }
  512. if bs, e := protojson.Marshal(&p); e != nil {
  513. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  514. return
  515. } else {
  516. bytes = &bs
  517. serialNumber = p.GetHeader().GetRequestID()
  518. }
  519. case global.ZSSellOrderDestingApplyOperateRsp: // 钻石卖摘牌申请操作接口应答
  520. var p pb.ZSSellOrderDestingApplyOperateRsp
  521. if err = proto.Unmarshal(b, &p); err != nil {
  522. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  523. return
  524. }
  525. if bs, e := protojson.Marshal(&p); e != nil {
  526. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  527. return
  528. } else {
  529. bytes = &bs
  530. serialNumber = p.GetHeader().GetRequestID()
  531. }
  532. case global.ZSBuyOrderDestingNegPriceRsp: // 买摘牌询价接口应答
  533. var p pb.ZSBuyOrderDestingNegPriceRsp
  534. if err = proto.Unmarshal(b, &p); err != nil {
  535. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  536. return
  537. }
  538. if bs, e := protojson.Marshal(&p); e != nil {
  539. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  540. return
  541. } else {
  542. bytes = &bs
  543. serialNumber = p.GetHeader().GetRequestID()
  544. }
  545. case global.ZSBuyOrderDestingNegPriceOperateRsp: // 买摘牌询价操作接口应答
  546. var p pb.ZSBuyOrderDestingNegPriceOperateRsp
  547. if err = proto.Unmarshal(b, &p); err != nil {
  548. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  549. return
  550. }
  551. if bs, e := protojson.Marshal(&p); e != nil {
  552. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  553. return
  554. } else {
  555. bytes = &bs
  556. serialNumber = p.GetHeader().GetRequestID()
  557. }
  558. case global.WRListingCancelOrderRsp: // 挂牌撤单应答
  559. var p pb.WRListingCancelOrderRsp
  560. if err = proto.Unmarshal(b, &p); err != nil {
  561. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  562. return
  563. }
  564. if bs, e := protojson.Marshal(&p); e != nil {
  565. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  566. return
  567. } else {
  568. bytes = &bs
  569. serialNumber = p.GetHeader().GetRequestID()
  570. }
  571. case global.HdWROrderRsp:
  572. var p pb.HdWROrderRsp
  573. if err = proto.Unmarshal(b, &p); err != nil {
  574. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  575. return
  576. }
  577. if bs, e := protojson.Marshal(&p); e != nil {
  578. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  579. return
  580. } else {
  581. bytes = &bs
  582. serialNumber = p.GetHeader().GetRequestID()
  583. }
  584. case global.WROutApplyRsp:
  585. var p pb.WROutApplyRsp
  586. if err = proto.Unmarshal(b, &p); err != nil {
  587. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  588. return
  589. }
  590. if bs, e := protojson.Marshal(&p); e != nil {
  591. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  592. return
  593. } else {
  594. bytes = &bs
  595. serialNumber = p.GetHeader().GetRequestID()
  596. }
  597. case global.ReceiptZSOutApplyRsp: // 钻石出库申请接口响应
  598. var p pb.ReceiptZSOutApplyRsp
  599. if err = proto.Unmarshal(b, &p); err != nil {
  600. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  601. return
  602. }
  603. if bs, e := protojson.Marshal(&p); e != nil {
  604. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  605. return
  606. } else {
  607. bytes = &bs
  608. serialNumber = p.GetHeader().GetRequestID()
  609. }
  610. case global.SpotPresaleListingOrderRsp: // 铁合金现货预售挂牌接口应答
  611. var p pb.SpotPresaleListingOrderRsp
  612. if err = proto.Unmarshal(b, &p); err != nil {
  613. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  614. return
  615. }
  616. if bs, e := protojson.Marshal(&p); e != nil {
  617. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  618. return
  619. } else {
  620. bytes = &bs
  621. serialNumber = p.GetHeader().GetRequestID()
  622. }
  623. case global.CJJCMemberOperateRsp: // 出境检测会员操作响应
  624. var p pb.CJJCMemberOperateRsp
  625. if err = proto.Unmarshal(b, &p); err != nil {
  626. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  627. return
  628. }
  629. if bs, e := protojson.Marshal(&p); e != nil {
  630. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  631. return
  632. } else {
  633. bytes = &bs
  634. serialNumber = p.GetHeader().GetRequestID()
  635. }
  636. case global.BSFWMemberOperateRsp: // 保税服务会员操作响应
  637. var p pb.BSFWMemberOperateRsp
  638. if err = proto.Unmarshal(b, &p); err != nil {
  639. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  640. return
  641. }
  642. if bs, e := protojson.Marshal(&p); e != nil {
  643. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  644. return
  645. } else {
  646. bytes = &bs
  647. serialNumber = p.GetHeader().GetRequestID()
  648. }
  649. case global.AccountFundInfoRsp: // 账户资金信息响应
  650. var p pb.AccountFundInfoRsp
  651. if err = proto.Unmarshal(b, &p); err != nil {
  652. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  653. return
  654. }
  655. if bs, e := protojson.Marshal(&p); e != nil {
  656. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  657. return
  658. } else {
  659. bytes = &bs
  660. serialNumber = p.GetHeader().GetRequestID()
  661. }
  662. case global.GZPresaleApplyRsp: // 广钻预售申请响应
  663. var p pb.GZPresaleApplyRsp
  664. if err = proto.Unmarshal(b, &p); err != nil {
  665. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  666. return
  667. }
  668. if bs, e := protojson.Marshal(&p); e != nil {
  669. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  670. return
  671. } else {
  672. bytes = &bs
  673. serialNumber = p.GetHeader().GetRequestID()
  674. }
  675. case global.GZPresaleOrderRsp: // 广钻预售认购下单响应
  676. var p pb.GZPresaleOrderRsp
  677. if err = proto.Unmarshal(b, &p); err != nil {
  678. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  679. return
  680. }
  681. if bs, e := protojson.Marshal(&p); e != nil {
  682. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  683. return
  684. } else {
  685. bytes = &bs
  686. serialNumber = p.GetHeader().GetRequestID()
  687. }
  688. case global.GZCenterPurchaseApplyRsp: // 广钻集采申请响应
  689. var p pb.GZCenterPurchaseApplyRsp
  690. if err = proto.Unmarshal(b, &p); err != nil {
  691. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  692. return
  693. }
  694. if bs, e := protojson.Marshal(&p); e != nil {
  695. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  696. return
  697. } else {
  698. bytes = &bs
  699. serialNumber = p.GetHeader().GetRequestID()
  700. }
  701. case global.GZCenterPurchaseOrderRsp: // 广钻集采认购下单响应
  702. var p pb.GZCenterPurchaseOrderRsp
  703. if err = proto.Unmarshal(b, &p); err != nil {
  704. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  705. return
  706. }
  707. if bs, e := protojson.Marshal(&p); e != nil {
  708. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  709. return
  710. } else {
  711. bytes = &bs
  712. serialNumber = p.GetHeader().GetRequestID()
  713. }
  714. case global.BSWMSReckonPayRsp: // WMS结算单支付接口响应
  715. var p pb.BSWMSReckonPayRsp
  716. if err = proto.Unmarshal(b, &p); err != nil {
  717. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  718. return
  719. }
  720. if bs, e := protojson.Marshal(&p); e != nil {
  721. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  722. return
  723. } else {
  724. bytes = &bs
  725. serialNumber = p.GetHeader().GetRequestID()
  726. }
  727. case global.OrderRsp:
  728. var p pb.OrderRsp
  729. if err = proto.Unmarshal(b, &p); err != nil {
  730. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  731. return
  732. }
  733. if bs, e := protojson.Marshal(&p); e != nil {
  734. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  735. return
  736. } else {
  737. bytes = &bs
  738. serialNumber = p.GetHeader().GetRequestID()
  739. }
  740. case global.CancelOrderRsp:
  741. var p pb.CancelOrderRsp
  742. if err = proto.Unmarshal(b, &p); err != nil {
  743. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  744. return
  745. }
  746. if bs, e := protojson.Marshal(&p); e != nil {
  747. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  748. return
  749. } else {
  750. bytes = &bs
  751. serialNumber = p.GetHeader().GetRequestID()
  752. }
  753. case global.HolderCloseRsp:
  754. var p pb.HolderCloseRsp
  755. if err = proto.Unmarshal(b, &p); err != nil {
  756. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  757. return
  758. }
  759. if bs, e := protojson.Marshal(&p); e != nil {
  760. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  761. return
  762. } else {
  763. bytes = &bs
  764. serialNumber = p.GetHeader().GetRequestID()
  765. }
  766. case global.DeliveryOrderRsp:
  767. var p pb.DeliveryOrderRsp
  768. if err = proto.Unmarshal(b, &p); err != nil {
  769. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  770. return
  771. }
  772. if bs, e := protojson.Marshal(&p); e != nil {
  773. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  774. return
  775. } else {
  776. bytes = &bs
  777. serialNumber = p.GetHeader().GetRequestID()
  778. }
  779. case global.MakeUpDepositRsp:
  780. var p pb.MakeUpDepositRsp
  781. if err = proto.Unmarshal(b, &p); err != nil {
  782. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  783. return
  784. }
  785. if bs, e := protojson.Marshal(&p); e != nil {
  786. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  787. return
  788. } else {
  789. bytes = &bs
  790. serialNumber = p.GetHeader().GetRequestID()
  791. }
  792. case global.HoldAppendDepositRsp:
  793. var p pb.HoldAppendDepositRsp
  794. if err = proto.Unmarshal(b, &p); err != nil {
  795. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  796. return
  797. }
  798. if bs, e := protojson.Marshal(&p); e != nil {
  799. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  800. return
  801. } else {
  802. bytes = &bs
  803. serialNumber = p.GetHeader().GetRequestID()
  804. }
  805. case global.OfflineDeliveryRsp:
  806. var p pb.OfflineDeliveryRsp
  807. if err = proto.Unmarshal(b, &p); err != nil {
  808. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  809. return
  810. }
  811. if bs, e := protojson.Marshal(&p); e != nil {
  812. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  813. return
  814. } else {
  815. bytes = &bs
  816. serialNumber = p.GetHeader().GetRequestID()
  817. }
  818. case global.HdWRDealOrderRsp:
  819. var p pb.HdWRDealOrderRsp
  820. if err = proto.Unmarshal(b, &p); err != nil {
  821. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  822. return
  823. }
  824. if bs, e := protojson.Marshal(&p); e != nil {
  825. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  826. return
  827. } else {
  828. bytes = &bs
  829. serialNumber = p.GetHeader().GetRequestID()
  830. }
  831. case global.SupplementDepositRsp:
  832. var p pb.SupplementDepositRsp
  833. if err = proto.Unmarshal(b, &p); err != nil {
  834. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  835. return
  836. }
  837. if bs, e := protojson.Marshal(&p); e != nil {
  838. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  839. return
  840. } else {
  841. bytes = &bs
  842. serialNumber = p.GetHeader().GetRequestID()
  843. }
  844. case global.RefundedDepositRsp:
  845. var p pb.RefundedDepositRsp
  846. if err = proto.Unmarshal(b, &p); err != nil {
  847. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  848. return
  849. }
  850. if bs, e := protojson.Marshal(&p); e != nil {
  851. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  852. return
  853. } else {
  854. bytes = &bs
  855. serialNumber = p.GetHeader().GetRequestID()
  856. }
  857. case global.MarketOrderDeliveryApplyRsp:
  858. var p pb.MarketOrderDeliveryApplyRsp
  859. if err = proto.Unmarshal(b, &p); err != nil {
  860. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  861. return
  862. }
  863. if bs, e := protojson.Marshal(&p); e != nil {
  864. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  865. return
  866. } else {
  867. bytes = &bs
  868. serialNumber = p.GetHeader().GetRequestID()
  869. }
  870. case global.DeliveryClientOperatorRsp:
  871. var p pb.DeliveryClientOperatorRsp
  872. if err = proto.Unmarshal(b, &p); err != nil {
  873. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  874. return
  875. }
  876. if bs, e := protojson.Marshal(&p); e != nil {
  877. global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
  878. return
  879. } else {
  880. bytes = &bs
  881. serialNumber = p.GetHeader().GetRequestID()
  882. }
  883. }
  884. return
  885. }
  886. // RabbitMQSubscribeTopic 订阅主题
  887. func RabbitMQSubscribeTopic() (err error) {
  888. // 订阅需要的总线响应主题
  889. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_USER); err != nil {
  890. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  891. return
  892. }
  893. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_NTF); err != nil {
  894. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  895. return
  896. }
  897. if err = rabbitmq.SubscribeTopic(global.TOPIC_CLIENT_NTF); err != nil {
  898. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  899. return
  900. }
  901. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_QKERNEL); err != nil {
  902. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  903. return
  904. }
  905. if err = rabbitmq.SubscribeTopic(global.TOPIC_MANAGE_RSP); err != nil {
  906. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  907. return
  908. }
  909. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_BANK); err != nil {
  910. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  911. return
  912. }
  913. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_MONEY); err != nil {
  914. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  915. return
  916. }
  917. if err = rabbitmq.SubscribeTopic(global.TOPIC_PERFORMANCE_RSP); err != nil {
  918. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  919. return
  920. }
  921. if err = rabbitmq.SubscribeTopic(global.TOPIC_WAREHOUSE_RECIEPT_RSP); err != nil {
  922. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  923. return
  924. }
  925. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_WAREHOUSE_TRADE); err != nil {
  926. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  927. return
  928. }
  929. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_WAREHOUSE_TRADE_GZ); err != nil {
  930. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  931. return
  932. }
  933. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_CJBS_TRADE_GZ); err != nil {
  934. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  935. return
  936. }
  937. // 铁合金
  938. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_WAREHOUSE_PRESALE_THJ); err != nil {
  939. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  940. return
  941. }
  942. if err = rabbitmq.SubscribeTopic(global.TOPIC_MANAGER_THJ_NTF); err != nil {
  943. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  944. return
  945. }
  946. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_WAREHOUSE_PRESALE_GZ); err != nil {
  947. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  948. return
  949. }
  950. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_WAREHOUSE_CENTERPURCHASE_GZ); err != nil {
  951. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  952. return
  953. }
  954. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_ORDER); err != nil {
  955. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  956. return
  957. }
  958. if err = rabbitmq.SubscribeTopic(global.TOPIC_RSP_DELIVERY_TRADE); err != nil {
  959. global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
  960. return
  961. }
  962. global.M2A_LOG.Info("rabbitmq subscribe topic successed.")
  963. return
  964. }
  965. // StartRabbitMQReceive 开始接收总线消息
  966. func StartRabbitMQReceive() {
  967. t := &MQProc{}
  968. go func() {
  969. for _, subinfo := range rabbitmq.SubInfos {
  970. rabbitmq.Receive(subinfo.Topic, subinfo.QueueName, t)
  971. }
  972. }()
  973. }
  974. // InitFuncodeTopic 初始化功能码主题MAP
  975. func InitFuncodeTopic() {
  976. if global.M2A_FuncodeTopic == nil {
  977. global.M2A_FuncodeTopic = make(map[string][]int)
  978. }
  979. global.M2A_FuncodeTopic[global.TOPIC_REQ_QKERNEL] = []int{
  980. global.ModifyPwdReq,
  981. }
  982. global.M2A_FuncodeTopic[global.TOPIC_MANAGE_REQ] = []int{
  983. global.UserReceiveInfoReq,
  984. global.DelUserReceiveInfoReq,
  985. global.UserReceiveIsDefaultReq,
  986. global.UserReceiptInfoReq,
  987. global.DelUserReceiptInfoReq,
  988. global.WarehouseApplyReq,
  989. global.WROutApplyReq,
  990. }
  991. global.M2A_FuncodeTopic[global.TOPIC_REQ_BANK] = []int{
  992. global.T2bBankSignReq,
  993. global.T2bBankCancelSignReq,
  994. global.T2bBankWithdrawReq,
  995. global.T2bBankDepositReq,
  996. }
  997. global.M2A_FuncodeTopic[global.TOPIC_REQ_MONEY] = []int{
  998. global.AccountFundInfoReq,
  999. }
  1000. global.M2A_FuncodeTopic[global.TOPIC_PERFORMANCE_REQ] = []int{
  1001. global.PerformanceContractedApplyReq,
  1002. global.PerformanceDelayApplyReq,
  1003. global.PerformanceManualConfirmReq,
  1004. global.PerformanceModifyContactReq,
  1005. }
  1006. global.M2A_FuncodeTopic[global.TOPIC_WAREHOUSE_RECIEPT] = []int{
  1007. global.ReceiptZSOutApplyReq,
  1008. }
  1009. global.M2A_FuncodeTopic[global.TOPIC_REQ_WAREHOUSE_TRADE] = []int{
  1010. global.WRListingCancelOrderReq,
  1011. global.HdWROrderReq,
  1012. global.HdWRDealOrderReq,
  1013. }
  1014. global.M2A_FuncodeTopic[global.TOPIC_REQ_WAREHOUSE_TRADE_GZ] = []int{
  1015. global.GoodsFavoriteOperateReq,
  1016. global.ZSBuyOrderListingReq,
  1017. global.ZSSellOrderListingReq,
  1018. global.ZSBuyOrderDestingReq,
  1019. global.ZSSellOrderDestingApplyReq,
  1020. global.ZSSellOrderDestingApplyOperateReq,
  1021. global.ZSBuyOrderDestingNegPriceReq,
  1022. global.ZSBuyOrderDestingNegPriceOperateReq,
  1023. }
  1024. global.M2A_FuncodeTopic[global.TOPIC_REQ_CJBS_TRADE_GZ] = []int{
  1025. global.CJJCMemberOperateReq,
  1026. global.BSFWMemberOperateReq,
  1027. global.BSWMSReckonPayReq,
  1028. }
  1029. // 铁合金
  1030. global.M2A_FuncodeTopic[global.TOPIC_REQ_WAREHOUSE_PRESALE_THJ] = []int{
  1031. global.SpotPresaleListingOrderReq,
  1032. }
  1033. global.M2A_FuncodeTopic[global.TOPIC_REQ_WAREHOUSE_PRESALE_GZ] = []int{
  1034. global.GZPresaleApplyReq,
  1035. global.GZPresaleOrderReq,
  1036. }
  1037. global.M2A_FuncodeTopic[global.TOPIC_REQ_WAREHOUSE_CENTERPURCHASE_GZ] = []int{
  1038. global.GZCenterPurchaseApplyReq,
  1039. global.GZCenterPurchaseOrderReq,
  1040. }
  1041. global.M2A_FuncodeTopic[global.TOPIC_REQ_ORDER] = []int{
  1042. global.OrderReq,
  1043. global.CancelOrderReq,
  1044. global.HolderCloseReq,
  1045. global.MakeUpDepositReq,
  1046. global.HoldAppendDepositReq,
  1047. global.OfflineDeliveryReq,
  1048. global.SupplementDepositReq,
  1049. global.RefundedDepositReq,
  1050. global.MarketOrderDeliveryApplyReq,
  1051. global.DeliveryClientOperatorReq,
  1052. }
  1053. global.M2A_FuncodeTopic[global.TOPIC_REQ_DELIVERY_TRADE] = []int{
  1054. global.DeliveryOrderReq,
  1055. }
  1056. global.M2A_FuncodeTopic[global.TOPIC_REQ_USER] = []int{
  1057. global.LoginReq,
  1058. }
  1059. }