rabbitmq.go 35 KB

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