diff --git a/app/task/init.go b/app/task/init.go index 7f7cc51..c1633ef 100644 --- a/app/task/init.go +++ b/app/task/init.go @@ -91,4 +91,9 @@ func initTasks() { jobs[taskMd.CronEggEnergyDealPlatformRevenueData] = taskEggEnergyDealPlatformRevenueData jobs[taskMd.CronEggEnergyDealFundData] = taskEggEnergyDealFundData jobs[taskMd.CronEggEnergyUserEggScore] = taskCronEggEnergyUserEggScore + jobs[taskMd.CornEggEnergyAutoReleaseTeamEggEnergy] = taskEggEnergyAutoReleaseTeamEggEnergy // 蛋蛋能量-自动释放团队蛋蛋能量到个人能量 + jobs[taskMd.CornSettlementStarLevelDividends] = taskEggEnergySettlementStarLevelDividends // 蛋蛋能量-结算星级分红 + jobs[taskMd.CornEggEnergyDealUserPublicPlatoonPunish] = taskEggEnergyDealUserPublicPlatoonPunish // 蛋蛋能量-公排处罚 + jobs[taskMd.CornEggEnergyAutoAdjustPrice] = taskEggEnergyAutoAdjustPrice // 蛋蛋能量-自动调整价格 + jobs[taskMd.CornEggEnergyAutoCommunityDividends] = taskEggEnergyCommunityDividends // 蛋蛋能量-社区分红 } diff --git a/app/task/md/cron_key.go b/app/task/md/cron_key.go index c91f852..90739a9 100644 --- a/app/task/md/cron_key.go +++ b/app/task/md/cron_key.go @@ -1,8 +1,14 @@ package md const ( - CronEggEnergyAutoRecordPrices = "cron_egg_energy_auto_record_price" // 自动记录价格 - CronEggEnergyDealPlatformRevenueData = "cron_egg_energy_deal_platform_revenue_data" // 处理平台收益 - CronEggEnergyDealFundData = "cron_egg_energy_deal_fund_data" // 处理价值投入 - CronEggEnergyUserEggScore = "cron_egg_energy_user_egg_score" // 处理蛋蛋分 + CronEggEnergyAutoRecordPrices = "cron_egg_energy_auto_record_price" // 自动记录价格 + CronEggEnergyDealPlatformRevenueData = "cron_egg_energy_deal_platform_revenue_data" // 处理平台收益 + CronEggEnergyDealFundData = "cron_egg_energy_deal_fund_data" // 处理价值投入 + CronEggEnergyUserEggScore = "cron_egg_energy_user_egg_score" // 处理蛋蛋分 + CornEggEnergyAutoReleaseTeamEggEnergy = "cron_egg_energy_auto_release_team_egg_energy" // 处理团队蛋蛋能量释放到个人蛋蛋能量 + CornSettlementStarLevelDividends = "cron_egg_energy_settlement_star_level_dividends" // 结算星级分红 + CornEggEnergyDealUserPublicPlatoonPunish = "cron_egg_energy_deal_user_public_platoon_punish" // 公排处罚 + CornEggEnergyAutoAdjustPrice = "cron_egg_energy_auto_adjust_price" // 自动调整价格 + CornEggEnergyAutoCommunityDividends = "cron_egg_energy_community_dividends" // 社区分红 + ) diff --git a/app/task/svc/svc_egg_energy_auto_adjust_price.go b/app/task/svc/svc_egg_energy_auto_adjust_price.go new file mode 100644 index 0000000..19bd473 --- /dev/null +++ b/app/task/svc/svc_egg_energy_auto_adjust_price.go @@ -0,0 +1,21 @@ +package svc + +import ( + "applet/app/cfg" + rule "code.fnuoos.com/EggPlanet/egg_system_rules.git" + "code.fnuoos.com/EggPlanet/egg_system_rules.git/rule/egg_energy" + "fmt" + "xorm.io/xorm" +) + +func EggEnergyAutoAdjustPrice(engine *xorm.Engine) { + fmt.Println(">>>>>>>>>>>>>>>>>>EggEnergyAutoAdjustPrice<<<<<<<<<<<<<<<<<<<") + rule.Init(cfg.RedisAddr) + err := egg_energy.AutoAdjustPrice(engine) + if err != nil { + fmt.Println("err:::::11111", err.Error()) + return + } + fmt.Println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>EggEnergyAutoAdjustPrice----end<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<") + return +} diff --git a/app/task/svc/svc_egg_energy_auto_release_team_egg_energy.go b/app/task/svc/svc_egg_energy_auto_release_team_egg_energy.go new file mode 100644 index 0000000..441522f --- /dev/null +++ b/app/task/svc/svc_egg_energy_auto_release_team_egg_energy.go @@ -0,0 +1,20 @@ +package svc + +import ( + "applet/app/cfg" + rule "code.fnuoos.com/EggPlanet/egg_system_rules.git" + "code.fnuoos.com/EggPlanet/egg_system_rules.git/rule/egg_energy" + "fmt" + "xorm.io/xorm" +) + +func EggEnergyAutoReleaseTeamEggEnergy(engine *xorm.Engine) { + fmt.Println(">>>>>>>>>>>>>>>>>>EggEnergyAutoReleaseTeamEggEnergy-----<<<<<<<<<<<<<<<<<<<") + rule.Init(cfg.RedisAddr) + err := egg_energy.AutoReleaseExchangeTeamEggEnergy(engine) + if err != nil { + fmt.Println("err:::::11111", err.Error()) + return + } + fmt.Println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>EggEnergyAutoReleaseTeamEggEnergy----end<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<") +} diff --git a/app/task/svc/svc_egg_energy_community_dividends.go b/app/task/svc/svc_egg_energy_community_dividends.go new file mode 100644 index 0000000..b9349ab --- /dev/null +++ b/app/task/svc/svc_egg_energy_community_dividends.go @@ -0,0 +1,21 @@ +package svc + +import ( + "applet/app/cfg" + rule "code.fnuoos.com/EggPlanet/egg_system_rules.git" + "code.fnuoos.com/EggPlanet/egg_system_rules.git/rule/egg_energy" + "fmt" + "xorm.io/xorm" +) + +func EggEnergyCommunityDividends(engine *xorm.Engine) { + fmt.Println(">>>>>>>>>>>>>>>>>>EggEnergyCommunityDividends<<<<<<<<<<<<<<<<<<<") + rule.Init(cfg.RedisAddr) + err := egg_energy.StartCommunityDividends(engine) + if err != nil { + fmt.Println("err:::::00000", err.Error()) + return + } + fmt.Println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>OneCirclesCommunityDividends----end<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<") + return +} diff --git a/app/task/svc/svc_egg_energy_deal_user_public_platoon_punish.go b/app/task/svc/svc_egg_energy_deal_user_public_platoon_punish.go new file mode 100644 index 0000000..93d4581 --- /dev/null +++ b/app/task/svc/svc_egg_energy_deal_user_public_platoon_punish.go @@ -0,0 +1,22 @@ +package svc + +import ( + "applet/app/cfg" + rule1 "code.fnuoos.com/EggPlanet/egg_system_rules.git" + "code.fnuoos.com/EggPlanet/egg_system_rules.git/rule" + "fmt" + "xorm.io/xorm" +) + +func EggEnergyDealUserPublicPlatoonPunish(engine *xorm.Engine) { + + fmt.Println(">>>>>>>>>>>>>>>>>>EggEnergyDealUserPublicPlatoonPunish<<<<<<<<<<<<<<<<<<<") + rule1.Init(cfg.RedisAddr) + err := rule.DealUserPublicPlatoonPunish(engine) + if err != nil { + fmt.Println("err:::::11111", err.Error()) + return + } + fmt.Println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>EggEnergyDealUserPublicPlatoonPunish----end<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<") + return +} diff --git a/app/task/svc/svc_egg_energy_settlement_star_level_dividends.go b/app/task/svc/svc_egg_energy_settlement_star_level_dividends.go new file mode 100644 index 0000000..09bbda7 --- /dev/null +++ b/app/task/svc/svc_egg_energy_settlement_star_level_dividends.go @@ -0,0 +1,27 @@ +package svc + +import ( + "applet/app/cfg" + rule "code.fnuoos.com/EggPlanet/egg_system_rules.git" + "code.fnuoos.com/EggPlanet/egg_system_rules.git/rule/egg_energy" + "code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git/rabbit" + "fmt" + "xorm.io/xorm" +) + +func EggEnergySettlementStarLevelDividends(engine *xorm.Engine) { + fmt.Println(">>>>>>>>>>>>>>>>>>EggEnergySettlementStarLevelDividends<<<<<<<<<<<<<<<<<<<") + rule.Init(cfg.RedisAddr) + ch, err := rabbit.Cfg.Pool.GetChannel() + if err != nil { + return + } + defer ch.Release() + err = egg_energy.SettlementStarLevelDividends(engine, ch) + if err != nil { + fmt.Println("err:::::11111", err.Error()) + return + } + fmt.Println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>EggEnergySettlementStarLevelDividends----end<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<") + return +} diff --git a/app/task/task_egg_energy_auto_adjust_price.go b/app/task/task_egg_energy_auto_adjust_price.go new file mode 100644 index 0000000..3f81d20 --- /dev/null +++ b/app/task/task_egg_energy_auto_adjust_price.go @@ -0,0 +1,22 @@ +package task + +import ( + "applet/app/task/svc" + "math/rand" + "time" + "xorm.io/xorm" +) + +func taskEggEnergyAutoAdjustPrice(eg *xorm.Engine) { + for { + if len(ch) > workerNum { + time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000))) + } else { + goto START + } + } +START: + ch <- 1 + svc.EggEnergyAutoAdjustPrice(eg) + <-ch +} diff --git a/app/task/task_egg_energy_auto_release_team_egg_energy.go b/app/task/task_egg_energy_auto_release_team_egg_energy.go new file mode 100644 index 0000000..de77ac7 --- /dev/null +++ b/app/task/task_egg_energy_auto_release_team_egg_energy.go @@ -0,0 +1,22 @@ +package task + +import ( + "applet/app/task/svc" + "math/rand" + "time" + "xorm.io/xorm" +) + +func taskEggEnergyAutoReleaseTeamEggEnergy(eg *xorm.Engine) { + for { + if len(ch) > workerNum { + time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000))) + } else { + goto START + } + } +START: + ch <- 1 + svc.EggEnergyAutoReleaseTeamEggEnergy(eg) + <-ch +} diff --git a/app/task/task_egg_energy_community_dividends.go b/app/task/task_egg_energy_community_dividends.go new file mode 100644 index 0000000..21b5bd3 --- /dev/null +++ b/app/task/task_egg_energy_community_dividends.go @@ -0,0 +1,22 @@ +package task + +import ( + "applet/app/task/svc" + "math/rand" + "time" + "xorm.io/xorm" +) + +func taskEggEnergyCommunityDividends(eg *xorm.Engine) { + for { + if len(ch) > workerNum { + time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000))) + } else { + goto START + } + } +START: + ch <- 1 + svc.EggEnergyCommunityDividends(eg) + <-ch +} diff --git a/app/task/task_egg_energy_deal_user_public_platoon_punish.go b/app/task/task_egg_energy_deal_user_public_platoon_punish.go new file mode 100644 index 0000000..fe34cf2 --- /dev/null +++ b/app/task/task_egg_energy_deal_user_public_platoon_punish.go @@ -0,0 +1,22 @@ +package task + +import ( + "applet/app/task/svc" + "math/rand" + "time" + "xorm.io/xorm" +) + +func taskEggEnergyDealUserPublicPlatoonPunish(eg *xorm.Engine) { + for { + if len(ch) > workerNum { + time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000))) + } else { + goto START + } + } +START: + ch <- 1 + svc.EggEnergyDealUserPublicPlatoonPunish(eg) + <-ch +} diff --git a/app/task/task_egg_energy_settlement_star_level_dividends.go b/app/task/task_egg_energy_settlement_star_level_dividends.go new file mode 100644 index 0000000..78e4034 --- /dev/null +++ b/app/task/task_egg_energy_settlement_star_level_dividends.go @@ -0,0 +1,22 @@ +package task + +import ( + "applet/app/task/svc" + "math/rand" + "time" + "xorm.io/xorm" +) + +func taskEggEnergySettlementStarLevelDividends(eg *xorm.Engine) { + for { + if len(ch) > workerNum { + time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000))) + } else { + goto START + } + } +START: + ch <- 1 + svc.EggEnergySettlementStarLevelDividends(eg) + <-ch +} diff --git a/go.mod b/go.mod index cb6122b..4cc3c21 100644 --- a/go.mod +++ b/go.mod @@ -34,7 +34,7 @@ require ( require ( code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241205074100-eab6e9316de6 - code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241203080408-75cfef2c6334 + code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241205075006-9c0bf995c788 code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.1-0.20241118083738-0f22da9ba0be code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5 github.com/360EntSecGroup-Skylar/excelize v1.4.1