From ef4bab511404249a3cd8decb1005ad6ac55d69c4 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Sat, 14 Dec 2024 17:46:11 +0800 Subject: [PATCH] update --- consume/egg_energy_platform_revenue_data_consume.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/consume/egg_energy_platform_revenue_data_consume.go b/consume/egg_energy_platform_revenue_data_consume.go index f5cd933..35a3bf3 100644 --- a/consume/egg_energy_platform_revenue_data_consume.go +++ b/consume/egg_energy_platform_revenue_data_consume.go @@ -61,9 +61,15 @@ func EggEnergyDealPlatformRevenueDataConsume(queue md.MqQueue) { func handleEggEnergyDealPlatformRevenueDataConsume(msgData []byte) error { time.Sleep(time.Duration(100) * time.Millisecond) //休眠100毫秒 + var msgStr string + err := json.Unmarshal(msgData, &msgStr) + if err != nil { + return err + } + // 1.解析mq中queue的数据结构体 var msg *md2.EggEnergyStructForPlatformRevenueData - err := json.Unmarshal(msgData, &msg) + err = json.Unmarshal([]byte(msgStr), &msg) if err != nil { return err } @@ -111,7 +117,7 @@ func handleEggEnergyDealPlatformRevenueDataConsume(msgData []byte) error { BeforeEnergyTotalNums: calcPriceIncreaseFormulaResp.BeforeEnergyTotalNums, AfterEnergyTotalNums: calcPriceIncreaseFormulaResp.AfterEnergyTotalNums, } - err4 := egg_energy.DealAvailableEggEnergyCoin(session, int(enum.CapitalInjection), eggEnergyCoreData, dealAvailableEggEnergyCoinReq) + err4 := egg_energy.DealAvailableEggEnergyCoin(session, int(enum.PlatformProfitability), eggEnergyCoreData, dealAvailableEggEnergyCoinReq) if err4 != nil { fmt.Println("ActivityCoinAutoExchangeEggPersonEnergy:::::err111:::", err4) _ = session.Rollback()