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