zhou.xiaoning 2 vuotta sitten
vanhempi
commit
8523650cc1
2 muutettua tiedostoa jossa 6 lisäystä ja 3 poistoa
  1. 5 3
      initialize/rabbitmq.go
  2. 1 0
      service/mq/mq.go

+ 5 - 3
initialize/rabbitmq.go

@@ -59,7 +59,7 @@ func (t *MQProc) Process(topic, queuename string, msg *[]byte) {
 		} else {
 			// 请求回复W
 			// 尝试获取对应异步任务
-			if client, exists := client.Clients[int(sessionId)]; exists {
+			if c, exists := client.Clients[int(sessionId)]; exists {
 				key := fmt.Sprintf("%v_%v_%v", sessionId, funcode, serialNumber)
 				// 银行服务相关的回复流水号是错误的,所以需要特殊处理
 				if int(funcode) == global.T2bBankSignRsp ||
@@ -68,7 +68,7 @@ func (t *MQProc) Process(topic, queuename string, msg *[]byte) {
 					int(funcode) == global.T2bBankDepositRsp {
 					key = fmt.Sprintf("%v_%v", sessionId, funcode)
 				}
-				asyncTask := client.GetAsyncTask(key)
+				asyncTask := c.GetAsyncTask(key)
 				if asyncTask != nil {
 					rspData := string(*bytes)
 					// 判断是否要加密
@@ -89,7 +89,9 @@ func (t *MQProc) Process(topic, queuename string, msg *[]byte) {
 					}
 					asyncTask.Rsp <- r
 				} else {
-					global.M2A_LOG.Info("找不到对应KEY的异步任务", zap.Any("key", key), zap.Any("AsyncMap", client.GetAllAsyncTask()))
+					global.M2A_LOG.Info("找不到对应KEY的异步任务", zap.Any("key", key), zap.Any("AsyncMap", c.GetAllAsyncTask()))
+					global.M2A_LOG.Info("++++++++++++++ 当前的 Clients", zap.Any("client.Clients", client.Clients))
+					global.M2A_LOG.Info("-------------- 当前的 AsyncTask", zap.Any("SessionId", c.SessionID), zap.Any("AsyncTask", c.GetAllAsyncTask()))
 				}
 			} else {
 				global.M2A_LOG.Info("找不到对应的client", zap.Any("sessionId", sessionId))

+ 1 - 0
service/mq/mq.go

@@ -48,6 +48,7 @@ func SendMQ(c *gin.Context, req *request.MQBodyReq) (err error) {
 
 	// 创建异步任务
 	key := fmt.Sprintf("%v_%v_%v", t.SessionID, req.FunCodeRsp, serialNumber)
+	global.M2A_LOG.Info("创建异步任务", zap.Any("SessionID", t.SessionID), zap.Any("serialNumber", serialNumber))
 	// 银行服务相关的回复流水号是错误的,所以需要特殊处理
 	if int(req.FunCodeReq) == global.T2bBankSignReq ||
 		int(req.FunCodeReq) == global.T2bBankCancelSignReq ||