diff --git a/conf/app.ini b/conf/app.ini index d8e5824b2325234870ba4edc422e3dc98bc3edad..f56aa5f4ec2a757ba19601085daf9ee79b2d4b7c 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -20,9 +20,9 @@ cycle_time=88 #时间只支持设置小时数 #3 只推送主队, 1 只推送平局, 0 只推送客队,-1 全部推送 #示例0-3:-1,4-18:3,19-23:-1,未设置时间段为默认只推送3 -team_option=0-3:-1,4-18:-1,19-23:-1 +team_option=0-3:-1,4-18:3,19-23:3 ###使用的算法 -al_flag=Euro81_616_104Service +al_flag=Euro616_104Service ###处法命中次数 hit_count=3 ###标题模板,为空则使用默认模板.支持格式如下: diff --git a/foot-core/launch/FC200AnalyApplication.go b/foot-core/launch/FC200AnalyApplication.go index 8aa04bbc0617311db59c9b00d492dbe64bb3876f..53257694d7497963912252b612561ddbbd78d655 100644 --- a/foot-core/launch/FC200AnalyApplication.go +++ b/foot-core/launch/FC200AnalyApplication.go @@ -11,14 +11,21 @@ func Analy() { //关闭SQL输出 mysql.ShowSQL(false) base.Log.Info("---------------------------------------------------------------") - base.Log.Info("----------------计算欧AnalyEuro_81_616Service-------------------") + base.Log.Info("----------------Euro616_104Service-------------------") + base.Log.Info("---------------------------------------------------------------") + euro616_104Service := new(service.Euro616_104Service) + euro616_104Service.MaxLetBall = 0.5 + euro616_104Service.PrintOddData = false + euro616_104Service.Analy() + base.Log.Info("---------------------------------------------------------------") + base.Log.Info("----------------Euro81_616_104Service-------------------") base.Log.Info("---------------------------------------------------------------") euro_81_616Service := new(service.Euro81_616_104Service) euro_81_616Service.MaxLetBall = 0.75 euro_81_616Service.PrintOddData = false euro_81_616Service.Analy() base.Log.Info("---------------------------------------------------------------") - base.Log.Info("---------------计算AnalyAsia_18_Euro_81_616Service--------------") + base.Log.Info("---------------Asia18EuroUDReverseService--------------") base.Log.Info("---------------------------------------------------------------") euro81616Service := new(service.Asia18EuroUDReverseService) euro81616Service.Analy() diff --git a/foot-core/module/analy/service/AnalyService.go b/foot-core/module/analy/service/AnalyService.go index 9debdd834ef8ef4d51077505d2d40aaa4ea9c3fe..61e55b30c7a721f4acff2572abe4a7c061078bd4 100644 --- a/foot-core/module/analy/service/AnalyService.go +++ b/foot-core/module/analy/service/AnalyService.go @@ -120,10 +120,11 @@ func (this *AnalyService) ActualResult(last *entity3.AsiaLast, v *entity2.MatchL } else { mainTeamGoals = float64(v.MainTeamGoals) + math.Abs(elb_sum) } - diff_goals := float64(v.MainTeamGoals-v.GuestTeamGoals) - elb_sum - if diff_goals <= 0.25 && diff_goals >= -0.25 { - result = 1 - } else if mainTeamGoals > float64(v.GuestTeamGoals) { + //diff_goals := float64(v.MainTeamGoals-v.GuestTeamGoals) - elb_sum + //if diff_goals <= 0.25 && diff_goals >= -0.25 { + // result = 1 + //} + if mainTeamGoals > float64(v.GuestTeamGoals) { result = 3 } else if mainTeamGoals < float64(v.GuestTeamGoals) { result = 0 diff --git a/foot-core/module/analy/service/Euro616_104Service.go b/foot-core/module/analy/service/Euro616_104Service.go new file mode 100644 index 0000000000000000000000000000000000000000..60a5467c01c7adffd360ecbbc0f2be0a4d747048 --- /dev/null +++ b/foot-core/module/analy/service/Euro616_104Service.go @@ -0,0 +1,126 @@ +package service + +import ( + "math" + "reflect" + "strings" + entity5 "tesou.io/platform/foot-parent/foot-api/module/analy/pojo" + "tesou.io/platform/foot-parent/foot-api/module/match/pojo" + entity3 "tesou.io/platform/foot-parent/foot-api/module/odds/pojo" + "time" +) + +type Euro616_104Service struct { + AnalyService + //最大让球数据 + MaxLetBall float64 +} + +/** +计算欧赔81 616的即时盘,和初盘的差异 +*/ +func (this *Euro616_104Service) Analy() { + matchList := this.MatchLastService.FindAll() + data_list_slice := make([]interface{}, 0) + data_modify_list_slice := make([]interface{}, 0) + for _, v := range matchList { + stub, result := this.analyStub(v) + if nil == result { + continue + } + + if stub == 0 { + data_list_slice = append(data_list_slice, result) + } else if stub == 1 { + data_modify_list_slice = append(data_modify_list_slice, result) + } else { + temp_data := this.Find(v.Id, result.AlFlag) + if len(temp_data.Id) > 0 { + this.AnalyService.Del(temp_data) + } + } + } + this.AnalyService.SaveList(data_list_slice) + this.AnalyService.ModifyList(data_modify_list_slice) + +} + +func (this *Euro616_104Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult) { + matchId := v.Id + //声明使用变量 + var e616data *entity3.EuroLast + var e104data *entity3.EuroLast + var a18betData *entity3.AsiaLast + //81 -- 伟德 + eList := this.EuroLastService.FindByMatchIdCompId(matchId, "616", "104") + if len(eList) < 2 { + return -1, nil + } + for _, ev := range eList { + if strings.EqualFold(ev.CompId, "616") { + e616data = ev + continue + } + if strings.EqualFold(ev.CompId, "104") { + e104data = ev + continue + } + } + //0.没有变化则跳过 + if e104data.Ep3 == e104data.Sp3 || e104data.Ep0 == e104data.Sp0 { + return -3, nil + } + if e616data.Ep3 == e616data.Sp3 || e616data.Ep0 == e616data.Sp0 { + return -3, nil + } + + //1.有变化,进行以下逻辑 + //亚赔 + aList := this.AsiaLastService.FindByMatchIdCompId(matchId, "18Bet") + if len(aList) < 1 { + return -1, nil + } + a18betData = aList[0] + if math.Abs(a18betData.ELetBall) > this.MaxLetBall { + return -2, nil + } + + //得出结果 + if e616data.Ep0 < e616data.Sp0 && e616data.Ep0 < e104data.Sp0 { + return -3, nil + } + var preResult int + if e616data.Ep3 > (e616data.Sp3 + 0.01) && e104data.Ep3 < e104data.Sp3 { + preResult = 3 + }else if e616data.Ep3 < e616data.Sp3 && e104data.Ep3 < e104data.Sp3 && e616data.Ep3 < e104data.Ep3 { + preResult = 3 + }else{ + return -3, nil + } + + + + alFlag := reflect.TypeOf(*this).Name() + var data *entity5.AnalyResult + temp_data := this.Find(v.Id, alFlag) + if len(temp_data.Id) > 0 { + temp_data.PreResult = preResult + temp_data.HitCount = temp_data.HitCount + 1 + data = temp_data + //比赛结果 + data.Result = this.IsRight(a18betData, v, preResult) + return 1, data + } else { + data = new(entity5.AnalyResult) + data.MatchId = v.Id + data.MatchDate = v.MatchDate + data.AlFlag = alFlag + format := time.Now().Format("0102150405") + data.AlSeq = format + data.PreResult = preResult + data.HitCount = 1 + //比赛结果 + data.Result = this.IsRight(a18betData, v, preResult) + return 0, data + } +}