|
|
@@ -3,7 +3,6 @@ package svc |
|
|
|
import ( |
|
|
|
"applet/app/utils" |
|
|
|
"applet/app/utils/cache" |
|
|
|
"applet/app/utils/logx" |
|
|
|
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement" |
|
|
|
md2 "code.fnuoos.com/EggPlanet/egg_system_rules.git/rule/egg_energy/md" |
|
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git/rabbit" |
|
|
@@ -36,7 +35,7 @@ func DealPlatformRevenueData(eg *xorm.Engine, dbName string, ch *rabbit.Channel) |
|
|
|
platformRevenueDataDb := implement.NewPlatformRevenueDataDb(eg) |
|
|
|
platformRevenueDataList, err := platformRevenueDataDb.PlatformRevenueDataFindNotFinish() |
|
|
|
if err != nil { |
|
|
|
_ = logx.Error(err) |
|
|
|
fmt.Println("DealPlatformRevenueData_ERR:::::", err.Error()) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
@@ -46,7 +45,7 @@ func DealPlatformRevenueData(eg *xorm.Engine, dbName string, ch *rabbit.Channel) |
|
|
|
// 1、判断是否是第一次执行 |
|
|
|
lastRecord, err1 := recordsDb.PlatformRevenueDataRecordsGetLast(data.Id) |
|
|
|
if err1 != nil { |
|
|
|
_ = logx.Error(err1) |
|
|
|
fmt.Println("DealPlatformRevenueData_ERR:::::", err1.Error()) |
|
|
|
continue |
|
|
|
} |
|
|
|
if lastRecord == nil { |
|
|
@@ -66,7 +65,7 @@ func DealPlatformRevenueData(eg *xorm.Engine, dbName string, ch *rabbit.Channel) |
|
|
|
times := decimal.NewFromInt(int64(data.Hours * 60)).Div(frequency).RoundFloor(8) |
|
|
|
totalAmount, err2 := decimal.NewFromString(data.TotalAmount) |
|
|
|
if err2 != nil { |
|
|
|
fmt.Println(err2) |
|
|
|
fmt.Println("DealPlatformRevenueData_ERR:::::", err2.Error()) |
|
|
|
continue |
|
|
|
} |
|
|
|
amount := totalAmount.Div(times) |
|
|
|