|
@@ -55,7 +55,7 @@ func EggFinWithdrawApplyDataConsume(queue md.MqQueue) { |
|
|
for { |
|
|
for { |
|
|
res, ok = <-delivery |
|
|
res, ok = <-delivery |
|
|
if ok == true { |
|
|
if ok == true { |
|
|
err = handleEggFinWithdrawApplyDataConsume(res.Body, client) |
|
|
|
|
|
|
|
|
err = handleEggFinWithdrawApplyDataConsume(res.Body, client, ch) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
fmt.Println("EggFinWithdrawApplyDataConsume:::::", err.Error()) |
|
|
fmt.Println("EggFinWithdrawApplyDataConsume:::::", err.Error()) |
|
|
utils2.FilePutContents("EggFinWithdrawApplyDataConsume", utils2.SerializeStr(map[string]interface{}{ |
|
|
utils2.FilePutContents("EggFinWithdrawApplyDataConsume", utils2.SerializeStr(map[string]interface{}{ |
|
@@ -89,7 +89,7 @@ func EggFinWithdrawApplyDataConsume(queue md.MqQueue) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func handleEggFinWithdrawApplyDataConsume(msgData []byte, client *alipay.Client) error { |
|
|
|
|
|
|
|
|
func handleEggFinWithdrawApplyDataConsume(msgData []byte, client *alipay.Client, ch *rabbit.Channel) error { |
|
|
time.Sleep(time.Duration(100) * time.Millisecond) //休眠100毫秒 |
|
|
time.Sleep(time.Duration(100) * time.Millisecond) //休眠100毫秒 |
|
|
// 1.解析mq中queue的数据结构体 |
|
|
// 1.解析mq中queue的数据结构体 |
|
|
var msg *md2.EggFinWithdrawApplyData |
|
|
var msg *md2.EggFinWithdrawApplyData |
|
@@ -148,6 +148,11 @@ func handleEggFinWithdrawApplyDataConsume(msgData []byte, client *alipay.Client) |
|
|
}) |
|
|
}) |
|
|
_, err = client.FundTransUniTransfer(context.Background(), bm) |
|
|
_, err = client.FundTransUniTransfer(context.Background(), bm) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
|
|
|
// 如果需要重试 推回队尾 |
|
|
|
|
|
if err.Error() == "Lock wait timeout exceeded; try restarting transaction" { |
|
|
|
|
|
ch.Publish(md2.EggAppExchange, msg, md2.EggFinWithdrawApply) |
|
|
|
|
|
return nil |
|
|
|
|
|
} |
|
|
//TODO::处理提现失败 |
|
|
//TODO::处理提现失败 |
|
|
err = dealFinWithdrawApplyStateForBad(apply) |
|
|
err = dealFinWithdrawApplyStateForBad(apply) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|