提交 424ee60f 编写于 作者: M monomania

1.调试C3模型中...

上级 09276f31
package main package main
import ( import (
"fmt"
"math/rand"
"strconv"
"tesou.io/platform/foot-parent/foot-api/common/base" "tesou.io/platform/foot-parent/foot-api/common/base"
"tesou.io/platform/foot-parent/foot-core/common/base/service/mysql" "tesou.io/platform/foot-parent/foot-core/common/base/service/mysql"
"tesou.io/platform/foot-parent/foot-core/module/analy/service" "tesou.io/platform/foot-parent/foot-core/module/analy/service"
...@@ -12,14 +9,13 @@ import ( ...@@ -12,14 +9,13 @@ import (
func main() { func main() {
//关闭SQL输出 //关闭SQL输出
fmt.Println(strconv.FormatFloat(rand.Float64(), 'f', -1, 64))
mysql.ShowSQL(false) mysql.ShowSQL(false)
base.Log.Info("---------------------------------------------------------------") base.Log.Info("---------------------------------------------------------------")
base.Log.Info("---------------C1模型--------------") base.Log.Info("---------------C1模型--------------")
base.Log.Info("---------------------------------------------------------------") base.Log.Info("---------------------------------------------------------------")
c1 := new(service.C2Service) c1 := new(service.C3Service)
c1.MaxLetBall = 1 c1.MaxLetBall = 1
//c1.Analy(true) c1.AnalyTest()
base.Log.Info("---------------------------------------------------------------") base.Log.Info("---------------------------------------------------------------")
base.Log.Info("---------------E1模型--------------") base.Log.Info("---------------E1模型--------------")
base.Log.Info("---------------------------------------------------------------") base.Log.Info("---------------------------------------------------------------")
......
...@@ -23,6 +23,10 @@ func (this *A1Service) ModelName() string { ...@@ -23,6 +23,10 @@ func (this *A1Service) ModelName() string {
return "A1" return "A1"
} }
func (this *A1Service) AnalyTest() {
this.AnalyService.AnalyTest(this)
}
/** /**
分析比赛数据,, 结合亚赔 赔赔差异 分析比赛数据,, 结合亚赔 赔赔差异
( 1.欧赔降水,亚赔反之,以亚赔为准) ( 1.欧赔降水,亚赔反之,以亚赔为准)
......
...@@ -24,6 +24,10 @@ func (this *A2Service) ModelName() string { ...@@ -24,6 +24,10 @@ func (this *A2Service) ModelName() string {
return "A2" return "A2"
} }
func (this *A2Service) AnalyTest() {
this.AnalyService.AnalyTest(this)
}
/** /**
分析比赛数据,, 结合亚赔 赔赔差异 分析比赛数据,, 结合亚赔 赔赔差异
( 1.欧赔降水,亚赔反之,以亚赔为准) ( 1.欧赔降水,亚赔反之,以亚赔为准)
......
...@@ -27,6 +27,10 @@ func (this *A3Service) ModelName() string { ...@@ -27,6 +27,10 @@ func (this *A3Service) ModelName() string {
return "A3" return "A3"
} }
func (this *A3Service) AnalyTest() {
this.AnalyService.AnalyTest(this)
}
func (this *A3Service) Analy(analyAll bool) { func (this *A3Service) Analy(analyAll bool) {
this.AnalyService.Analy(analyAll,this) this.AnalyService.Analy(analyAll,this)
} }
...@@ -64,9 +68,7 @@ func (this *A3Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult) ...@@ -64,9 +68,7 @@ func (this *A3Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult)
} }
//限制初盘,即时盘让球在0.25以内 //限制初盘,即时盘让球在0.25以内
sLetBall := math.Abs(a18Bet.SLetBall) if math.Abs(a18Bet.SLetBall-a18Bet.ELetBall) > 0.25 {
eLetBall := math.Abs(a18Bet.ELetBall)
if math.Abs(sLetBall-eLetBall) > 0.25 {
//temp_data.Result ="" //temp_data.Result =""
//return -2, temp_data //return -2, temp_data
//return -2, nil //return -2, nil
......
...@@ -23,6 +23,8 @@ import ( ...@@ -23,6 +23,8 @@ import (
type AnalyInterface interface { type AnalyInterface interface {
ModelName() string ModelName() string
AnalyTest()
Analy_Near() Analy_Near()
Analy(analyAll bool) Analy(analyAll bool)
...@@ -54,10 +56,25 @@ func (this *AnalyService) FindAll() []*entity5.AnalyResult { ...@@ -54,10 +56,25 @@ func (this *AnalyService) FindAll() []*entity5.AnalyResult {
return dataList return dataList
} }
func (this *AnalyService) AnalyTest(thiz AnalyInterface) {
var currentPage, pageSize int64 = 1, 30000
var page *pojo.Page
page = new(pojo.Page)
page.PageSize = pageSize
page.CurPage = currentPage
matchList := make([]*entity2.MatchLast, 0)
err := this.MatchHisService.PageSql("SELECT mh.* FROM foot.t_match_his mh WHERE mh.`MatchDate` > '2020-03-01 00:00:00' ", page, &matchList)
if nil != err {
base.Log.Error(err)
return
}
this.Analy_Process(matchList, thiz, false)
}
func (this *AnalyService) Analy(analyAll bool, thiz AnalyInterface) { func (this *AnalyService) Analy(analyAll bool, thiz AnalyInterface) {
var matchList []*entity2.MatchLast var matchList []*entity2.MatchLast
if analyAll { if analyAll {
var currentPage,pageSize int64 = 1,1000 var currentPage, pageSize int64 = 1, 1000
var page *pojo.Page var page *pojo.Page
page = new(pojo.Page) page = new(pojo.Page)
page.PageSize = pageSize page.PageSize = pageSize
...@@ -68,7 +85,7 @@ func (this *AnalyService) Analy(analyAll bool, thiz AnalyInterface) { ...@@ -68,7 +85,7 @@ func (this *AnalyService) Analy(analyAll bool, thiz AnalyInterface) {
base.Log.Error(err) base.Log.Error(err)
return return
} }
go this.Analy_Process(matchList, thiz) go this.Analy_Process(matchList, thiz, true)
for currentPage <= page.TotalPage { for currentPage <= page.TotalPage {
currentPage++ currentPage++
page = new(pojo.Page) page = new(pojo.Page)
...@@ -80,24 +97,23 @@ func (this *AnalyService) Analy(analyAll bool, thiz AnalyInterface) { ...@@ -80,24 +97,23 @@ func (this *AnalyService) Analy(analyAll bool, thiz AnalyInterface) {
base.Log.Error(err) base.Log.Error(err)
continue continue
} }
go this.Analy_Process(matchList, thiz) go this.Analy_Process(matchList, thiz, true)
} }
} else { } else {
matchList = this.MatchLastService.FindNotFinished() matchList = this.MatchLastService.FindNotFinished()
this.Analy_Process(matchList, thiz) this.Analy_Process(matchList, thiz, true)
} }
} }
func (this *AnalyService) Analy_Near(thiz AnalyInterface) { func (this *AnalyService) Analy_Near(thiz AnalyInterface) {
matchList := this.MatchLastService.FindNear() matchList := this.MatchLastService.FindNear()
this.Analy_Process(matchList, thiz) this.Analy_Process(matchList, thiz, true)
} }
/** /**
汇总结果并输出,且持久化 汇总结果并输出,且持久化
*/ */
func (this *AnalyService) Analy_Process(matchList []*entity2.MatchLast, thiz AnalyInterface) { func (this *AnalyService) Analy_Process(matchList []*entity2.MatchLast, thiz AnalyInterface, persisted bool) {
hit_count_str := utils.GetVal(constants.SECTION_NAME, "hit_count") hit_count_str := utils.GetVal(constants.SECTION_NAME, "hit_count")
hit_count, _ := strconv.Atoi(hit_count_str) hit_count, _ := strconv.Atoi(hit_count_str)
data_list_slice := make([]interface{}, 0) data_list_slice := make([]interface{}, 0)
...@@ -108,15 +124,6 @@ func (this *AnalyService) Analy_Process(matchList []*entity2.MatchLast, thiz Ana ...@@ -108,15 +124,6 @@ func (this *AnalyService) Analy_Process(matchList []*entity2.MatchLast, thiz Ana
for _, v := range matchList { for _, v := range matchList {
stub, temp_data := thiz.analyStub(v) stub, temp_data := thiz.analyStub(v)
if nil != temp_data {
if strings.EqualFold(temp_data.Result, "命中") {
rightCount++
}
if strings.EqualFold(temp_data.Result, "错误") {
errorCount++
}
}
if stub == 0 || stub == 1 { if stub == 0 || stub == 1 {
temp_data.TOVoid = false temp_data.TOVoid = false
hours := v.MatchDate.Sub(time.Now()).Hours() hours := v.MatchDate.Sub(time.Now()).Hours()
...@@ -130,6 +137,14 @@ func (this *AnalyService) Analy_Process(matchList []*entity2.MatchLast, thiz Ana ...@@ -130,6 +137,14 @@ func (this *AnalyService) Analy_Process(matchList []*entity2.MatchLast, thiz Ana
} else if stub == 1 { } else if stub == 1 {
data_modify_list_slice = append(data_modify_list_slice, temp_data) data_modify_list_slice = append(data_modify_list_slice, temp_data)
} }
if strings.EqualFold(temp_data.Result, "命中") {
rightCount++
}
if strings.EqualFold(temp_data.Result, "错误") {
errorCount++
}
} else if nil != temp_data { } else if nil != temp_data {
temp_data.TOVoid = true temp_data.TOVoid = true
if len(temp_data.Id) > 0 { if len(temp_data.Id) > 0 {
...@@ -150,8 +165,10 @@ func (this *AnalyService) Analy_Process(matchList []*entity2.MatchLast, thiz Ana ...@@ -150,8 +165,10 @@ func (this *AnalyService) Analy_Process(matchList []*entity2.MatchLast, thiz Ana
base.Log.Info("X0000场次:", errorCount) base.Log.Info("X0000场次:", errorCount)
base.Log.Info("------------------") base.Log.Info("------------------")
this.SaveList(data_list_slice) if persisted {
this.ModifyList(data_modify_list_slice) this.SaveList(data_list_slice)
this.ModifyList(data_modify_list_slice)
}
} }
/** /**
...@@ -459,7 +476,6 @@ func (this *AnalyService) ActualResult(last *entity2.MatchLast, analy *entity5.A ...@@ -459,7 +476,6 @@ func (this *AnalyService) ActualResult(last *entity2.MatchLast, analy *entity5.A
return result return result
} }
/** /**
是否是主队让球,反之是客队让球 是否是主队让球,反之是客队让球
*/ */
......
...@@ -28,6 +28,10 @@ func (this *C1Service) ModelName() string { ...@@ -28,6 +28,10 @@ func (this *C1Service) ModelName() string {
return "C1" return "C1"
} }
func (this *C1Service) AnalyTest() {
this.AnalyService.AnalyTest(this)
}
func (this *C1Service) Analy(analyAll bool) { func (this *C1Service) Analy(analyAll bool) {
this.AnalyService.Analy(analyAll,this) this.AnalyService.Analy(analyAll,this)
...@@ -65,9 +69,7 @@ func (this *C1Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult) ...@@ -65,9 +69,7 @@ func (this *C1Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult)
} }
//限制初盘,即时盘让球在0.25以内 //限制初盘,即时盘让球在0.25以内
sLetBall := math.Abs(a18Bet.SLetBall) if math.Abs(a18Bet.SLetBall-a18Bet.ELetBall) > 0.25 {
eLetBall := math.Abs(a18Bet.ELetBall)
if math.Abs(sLetBall-eLetBall) > 0.25 {
//temp_data.Result = "" //temp_data.Result = ""
//return -2, temp_data //return -2, temp_data
} }
......
...@@ -27,9 +27,12 @@ func (this *C2Service) ModelName() string { ...@@ -27,9 +27,12 @@ func (this *C2Service) ModelName() string {
return "C2" return "C2"
} }
func (this *C2Service) Analy(analyAll bool) { func (this *C2Service) AnalyTest() {
this.AnalyService.Analy(analyAll,this) this.AnalyService.AnalyTest(this)
}
func (this *C2Service) Analy(analyAll bool) {
this.AnalyService.Analy(analyAll, this)
} }
func (this *C2Service) Analy_Near() { func (this *C2Service) Analy_Near() {
...@@ -64,9 +67,7 @@ func (this *C2Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult) ...@@ -64,9 +67,7 @@ func (this *C2Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult)
} }
//限制初盘,即时盘让球在0.25以内 //限制初盘,即时盘让球在0.25以内
sLetBall := math.Abs(a18Bet.SLetBall) if math.Abs(a18Bet.SLetBall-a18Bet.ELetBall) > 0.25 {
eLetBall := math.Abs(a18Bet.ELetBall)
if math.Abs(sLetBall-eLetBall) > 0.25 {
//temp_data.Result ="" //temp_data.Result =""
//return -2, temp_data //return -2, temp_data
} }
...@@ -169,8 +170,8 @@ func (this *C2Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult) ...@@ -169,8 +170,8 @@ func (this *C2Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult)
letBall -= baseVal + float64(guestWin-mainWin)*baseVal*3 letBall -= baseVal + float64(guestWin-mainWin)*baseVal*3
} }
// //
bfj_main := this.BFJinService.FindNearByTeamName(v.MatchDate,v.MainTeamId, 4) bfj_main := this.BFJinService.FindNearByTeamName(v.MatchDate, v.MainTeamId, 4)
bfj_guest := this.BFJinService.FindNearByTeamName(v.MatchDate,v.GuestTeamId, 4) bfj_guest := this.BFJinService.FindNearByTeamName(v.MatchDate, v.GuestTeamId, 4)
bfj_mainWin := 0 bfj_mainWin := 0
bfj_guestWin := 0 bfj_guestWin := 0
for _, e := range bfj_main { for _, e := range bfj_main {
...@@ -201,7 +202,7 @@ func (this *C2Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult) ...@@ -201,7 +202,7 @@ func (this *C2Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult)
bffe_main := this.BFFutureEventService.FindNextBattle(matchId, v.MainTeamId) bffe_main := this.BFFutureEventService.FindNextBattle(matchId, v.MainTeamId)
bffe_guest := this.BFFutureEventService.FindNextBattle(matchId, v.GuestTeamId) bffe_guest := this.BFFutureEventService.FindNextBattle(matchId, v.GuestTeamId)
if this.IsCupMatch(bffe_main.EventLeagueId){ if this.IsCupMatch(bffe_main.EventLeagueId) {
//下一场打杯赛 //下一场打杯赛
return -3, temp_data return -3, temp_data
} else { } else {
...@@ -210,7 +211,7 @@ func (this *C2Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult) ...@@ -210,7 +211,7 @@ func (this *C2Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult)
letBall += (baseVal) letBall += (baseVal)
} }
} }
if this.IsCupMatch(bffe_guest.EventLeagueId){ if this.IsCupMatch(bffe_guest.EventLeagueId) {
//下一场打杯赛 //下一场打杯赛
return -3, temp_data return -3, temp_data
} else { } else {
...@@ -224,6 +225,8 @@ func (this *C2Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult) ...@@ -224,6 +225,8 @@ func (this *C2Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult)
mainLetball := this.AnalyService.mainLetball(a18Bet) mainLetball := this.AnalyService.mainLetball(a18Bet)
//2.0区间段 //2.0区间段
sLetBall := math.Abs(a18Bet.SLetBall)
eLetBall := math.Abs(a18Bet.ELetBall)
var sectionBlock1, sectionBlock2 int var sectionBlock1, sectionBlock2 int
tLetBall := math.Abs(letBall) tLetBall := math.Abs(letBall)
//maxLetBall := math.Max(sLetBall, eLetBall) //maxLetBall := math.Max(sLetBall, eLetBall)
...@@ -288,23 +291,23 @@ func (this *C2Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult) ...@@ -288,23 +291,23 @@ func (this *C2Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult)
} }
} }
temp_bfj_main := this.BFJinService.FindNearByTeamName(v.MatchDate,v.MainTeamId, 1) temp_bfj_main := this.BFJinService.FindNearByTeamName(v.MatchDate, v.MainTeamId, 1)
temp_bfj_guest := this.BFJinService.FindNearByTeamName(v.MatchDate,v.GuestTeamId, 1) temp_bfj_guest := this.BFJinService.FindNearByTeamName(v.MatchDate, v.GuestTeamId, 1)
for _, e := range temp_bfj_main { for _, e := range temp_bfj_main {
if e.HomeTeam == v.MainTeamId && e.HomeScore > e.GuestScore { if e.HomeTeam == v.MainTeamId && e.HomeScore > e.GuestScore {
continue continue
}else if e.GuestTeam == v.MainTeamId && e.GuestScore > e.HomeScore { } else if e.GuestTeam == v.MainTeamId && e.GuestScore > e.HomeScore {
continue continue
}else{ } else {
return -3, temp_data return -3, temp_data
} }
} }
for _, e := range temp_bfj_guest { for _, e := range temp_bfj_guest {
if e.HomeTeam == v.GuestTeamId && e.HomeScore > e.GuestScore { if e.HomeTeam == v.GuestTeamId && e.HomeScore > e.GuestScore {
return -3, temp_data return -3, temp_data
}else if e.GuestTeam == v.GuestTeamId && e.GuestScore > e.HomeScore { } else if e.GuestTeam == v.GuestTeamId && e.GuestScore > e.HomeScore {
return -3, temp_data return -3, temp_data
}else{ } else {
continue continue
} }
} }
......
...@@ -26,9 +26,12 @@ func (this *C3Service) ModelName() string { ...@@ -26,9 +26,12 @@ func (this *C3Service) ModelName() string {
return "C3" return "C3"
} }
func (this *C3Service) AnalyTest() {
this.AnalyService.AnalyTest(this)
}
func (this *C3Service) Analy(analyAll bool) { func (this *C3Service) Analy(analyAll bool) {
this.AnalyService.Analy(analyAll, this) this.AnalyService.Analy(analyAll, this)
} }
func (this *C3Service) Analy_Near() { func (this *C3Service) Analy_Near() {
...@@ -60,27 +63,25 @@ func (this *C3Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult) ...@@ -60,27 +63,25 @@ func (this *C3Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult)
} }
//限制初盘,即时盘让球在0.25以内 //限制初盘,即时盘让球在0.25以内
sLetBall := math.Abs(a18Bet.SLetBall) if math.Abs(a18Bet.SLetBall-a18Bet.ELetBall) > 0.25 {
eLetBall := math.Abs(a18Bet.ELetBall)
if math.Abs(sLetBall-eLetBall) > 0.25 {
//temp_data.Result ="" //temp_data.Result =""
//return -2, temp_data return -2, temp_data
} }
//得出结果 //得出结果
preResult := -1 preResult := -1
letBall := 0.00
//------ //------
bfs_arr := this.BFScoreService.FindByMatchId(matchId) bfs_arr := this.BFScoreService.FindByMatchId(matchId)
if len(bfs_arr) < 1 { if len(bfs_arr) < 1 {
return -1, temp_data return -1, temp_data
} }
var temp_val float64
var mainZongBfs *pojo.BFScore var mainZongBfs *pojo.BFScore
var mainZhuBfs *pojo.BFScore var mainZhuBfs *pojo.BFScore
var mainZhuJinBfs *pojo.BFScore
var guestZongBfs *pojo.BFScore var guestZongBfs *pojo.BFScore
var guestKeBfs *pojo.BFScore var guestKeBfs *pojo.BFScore
var guestKeJinBfs *pojo.BFScore
for _, e := range bfs_arr { //bfs_arr有多语言版本,条数很多 for _, e := range bfs_arr { //bfs_arr有多语言版本,条数很多
if e.TeamId == v.MainTeamId { if e.TeamId == v.MainTeamId {
if e.Type == "总" { if e.Type == "总" {
...@@ -89,6 +90,9 @@ func (this *C3Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult) ...@@ -89,6 +90,9 @@ func (this *C3Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult)
if e.Type == "主" { if e.Type == "主" {
mainZhuBfs = e mainZhuBfs = e
} }
if e.Type == "近" {
mainZhuJinBfs = e
}
} else if e.TeamId == v.GuestTeamId { } else if e.TeamId == v.GuestTeamId {
if e.Type == "总" { if e.Type == "总" {
guestZongBfs = e guestZongBfs = e
...@@ -96,140 +100,133 @@ func (this *C3Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult) ...@@ -96,140 +100,133 @@ func (this *C3Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult)
if e.Type == "客" { if e.Type == "客" {
guestKeBfs = e guestKeBfs = e
} }
if e.Type == "近" {
guestKeJinBfs = e
}
} }
} }
if mainZongBfs == nil || guestZongBfs == nil || mainZhuBfs == nil || guestKeBfs == nil { if mainZongBfs == nil || mainZhuBfs == nil || mainZhuJinBfs == nil || guestZongBfs == nil || guestKeBfs == nil || guestKeJinBfs == nil {
return -1, temp_data return -1, temp_data
} }
baseVal := 0.068
rankDiff := 3.0 var temp_zong_val_1, temp_zong_val_2 float64 = 0, 0
var temp_jin_val_1, temp_jin_val_2 float64 = 0, 0
if mainZongBfs.MatchCount >= 8 && guestZongBfs.MatchCount >= 8 { if mainZongBfs.MatchCount >= 8 && guestZongBfs.MatchCount >= 8 {
//排名越小越好 //排名越小越好
temp_val = float64(mainZongBfs.Ranking - guestZongBfs.Ranking) temp_zong_val_1 = float64(mainZongBfs.Ranking - guestZongBfs.Ranking)
if temp_val >= rankDiff { temp_zong_val_2 = float64(mainZongBfs.GetGoal - guestZongBfs.GetGoal)
xishu := 1.0
if temp_val > 11 { temp_jin_val_1 = float64(mainZhuJinBfs.Score - guestKeJinBfs.Score)
xishu = 3.0 temp_jin_val_2 = float64(mainZhuJinBfs.GetGoal - guestKeJinBfs.GetGoal)
} else if temp_val > 5 {
xishu = 2.0
}
letBall -= (temp_val / rankDiff) * baseVal * xishu
}
temp_val = float64(guestZongBfs.Ranking - mainZongBfs.Ranking)
if temp_val >= rankDiff {
xishu := 1.0
if temp_val > 11 {
xishu = 3.0
} else if temp_val > 5 {
xishu = 2.0
}
letBall += (temp_val / rankDiff) * baseVal * xishu
}
temp_val = float64(mainZhuBfs.Ranking - guestKeBfs.Ranking)
if temp_val >= rankDiff {
xishu := 1.0
letBall -= (temp_val / rankDiff / 2) * baseVal * xishu
}
temp_val = float64(guestKeBfs.Ranking - mainZhuBfs.Ranking)
if temp_val >= rankDiff {
xishu := 1.0
letBall += (temp_val / rankDiff / 2) * baseVal * xishu
}
} else { } else {
//return -1, temp_data return -1, temp_data
} }
//------ //保证积分榜上,进球能力有支持
bffe_main := this.BFFutureEventService.FindNextBattle(matchId, v.MainTeamId) if (temp_zong_val_1 > 0 && temp_zong_val_2 < 0) || (temp_zong_val_1 < 0 && temp_zong_val_2 > 0) {
bffe_guest := this.BFFutureEventService.FindNextBattle(matchId, v.GuestTeamId) return -2, temp_data
}
if this.IsCupMatch(bffe_main.EventLeagueId) { //2.0区间段
//下一场打杯赛 var sectionBlock1, sectionBlock2 int = -1, -1
//return -3, temp_data
} else { var sectionValArr = []float64{0.0, 0.25, 0.50, 0.75, 1, 1.25, 1.5, 1.75, 2}
//如果主队下一场打客场,战意充足 //总积分的让球值
if v.MainTeamId == bffe_main.EventGuestTeamId { tempLetball1 := math.Abs(temp_zong_val_1) / 10
letBall += (baseVal) for i, e := range sectionValArr {
if tempLetball1 <= e {
sectionBlock1 = i
break;
} }
} }
if this.IsCupMatch(bffe_guest.EventLeagueId) { tempLetball2 := math.Abs(temp_zong_val_2) / 10
//下一场打杯赛 for i, e := range sectionValArr {
//return -3, temp_data if tempLetball2 <= e {
} else { sectionBlock2 = i
//如果客队下一场打主场,战意懈怠 break;
if v.GuestTeamId == bffe_guest.EventMainTeamId {
letBall += (baseVal)
} }
} }
//1.0判断主队是否是让球方 if sectionBlock1 == -1 || sectionBlock2 == -1 {
mainLetball := this.AnalyService.mainLetball(a18Bet) return -3, temp_data
//2.0区间段
var sectionBlock1, sectionBlock2 int
tLetBall := math.Abs(letBall)
//maxLetBall := math.Max(sLetBall, eLetBall)
tempLetball1 := math.Abs(sLetBall - tLetBall)
if tempLetball1 < 0.0 {
sectionBlock1 = 1
} else if tempLetball1 < 0.256 {
sectionBlock1 = 2
} else if tempLetball1 < 0.51 {
sectionBlock1 = 3
} else if tempLetball1 < 0.76 {
sectionBlock1 = 4
} else {
sectionBlock1 = 10000
}
tempLetball2 := math.Abs(eLetBall - tLetBall)
if tempLetball2 < 0.0 {
sectionBlock2 = 1
} else if tempLetball2 < 0.256 {
sectionBlock2 = 2
} else if tempLetball2 < 0.51 {
sectionBlock2 = 3
} else if tempLetball2 < 0.76 {
sectionBlock2 = 4
} else {
sectionBlock2 = 10000
} }
//3.0即时盘赔率大于等于初盘赔率 //3.0即时盘赔率大于等于初盘赔率
sLetBall := math.Abs(a18Bet.SLetBall)
eLetBall := math.Abs(a18Bet.ELetBall)
endUp := eLetBall >= sLetBall endUp := eLetBall >= sLetBall
//3.1即时盘初盘 if !endUp {
notZero := tLetBall >= eLetBall && tLetBall >= sLetBall return -3, temp_data
}
//看两个区间是否属于同一个区间
//if sectionBlock1 == 1 && sectionBlock2 == 1 { if matchId == "1721267" {
if sectionBlock1 <= 2 && sectionBlock2 <= 2 { fmt.Println("")
if mainLetball && letBall > 0.1 && endUp && notZero { }
preResult = 3
} else if !mainLetball && letBall < -0.1 && endUp && notZero { //
//preResult = 0 var bf_begin, bf_end float64
if sectionBlock1 == sectionBlock2 {
if sectionBlock1 == 0 {
return -3, temp_data
}
bf_begin = sectionValArr[sectionBlock1] - 0.25
bf_end = sectionValArr[sectionBlock1] + 0.25
} else if sectionBlock1-sectionBlock2 == 1 || sectionBlock1-sectionBlock2 == -1 {
if sectionBlock1 < sectionBlock2 {
bf_begin = sectionValArr[sectionBlock1] - 0.25
bf_end = sectionValArr[sectionBlock2] + 0.25
} else {
bf_begin = sectionValArr[sectionBlock2] - 0.25
bf_end = sectionValArr[sectionBlock1] + 0.25
} }
} }
if preResult < 0 { //存在合理区间里
var smallLetBall float64
if eLetBall-sLetBall >= 0 {
smallLetBall = sLetBall
} else {
smallLetBall = eLetBall
}
if bf_end-smallLetBall >= 0.5 {
return -3, temp_data return -3, temp_data
} }
var reasonable = false
if bf_begin <= eLetBall && eLetBall <= bf_end {
reasonable = true
}
if preResult == 3 && this.IsCupMatch(bffe_main.EventLeagueId) { //1.0判断主队是否是让球方
//下一场打杯赛 mainLetball := this.AnalyService.mainLetball(a18Bet)
return -3, temp_data if reasonable {
} else if preResult == 0 && this.IsCupMatch(bffe_guest.EventLeagueId) { if mainLetball {
//下一场打杯赛 preResult = 3
} else {
preResult = 0
}
} else {
}
if preResult == 3 && (temp_jin_val_1 < 0 || temp_jin_val_2 < 0) {
preResult = -1
}
if preResult == 3 && (temp_jin_val_1 > 0 || temp_jin_val_2 > 0) {
preResult = -1
}
if preResult < 0 {
return -3, temp_data return -3, temp_data
} }
base.Log.Info("所属于区间:", sectionBlock1, "-", sectionBlock2, ",对阵", v.MainTeamId+":"+v.GuestTeamId, ",计算得出让球为:", letBall, ",初盘让球:", a18Bet.SLetBall, ",即时盘让球:", a18Bet.ELetBall) base.Log.Info("所属于区间: ", bf_begin, " - ", bf_end, " ,对阵", v.MainTeamId+":"+v.GuestTeamId, ",初盘让球:", a18Bet.SLetBall, ",即时盘让球:", a18Bet.ELetBall)
var data *entity5.AnalyResult var data *entity5.AnalyResult
if len(temp_data.Id) > 0 { if len(temp_data.Id) > 0 {
temp_data.PreResult = preResult temp_data.PreResult = preResult
temp_data.HitCount = temp_data.HitCount + 1 temp_data.HitCount = temp_data.HitCount + 1
temp_data.LetBall = a18Bet.ELetBall temp_data.LetBall = a18Bet.ELetBall
temp_data.MyLetBall = Decimal(letBall)
data = temp_data data = temp_data
//比赛结果 //比赛结果
data.Result = this.IsRight(v, data) data.Result = this.IsRight(v, data)
...@@ -245,11 +242,8 @@ func (this *C3Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult) ...@@ -245,11 +242,8 @@ func (this *C3Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult)
data.AlSeq = format data.AlSeq = format
data.PreResult = preResult data.PreResult = preResult
data.HitCount = 3 data.HitCount = 3
data.MyLetBall = Decimal(letBall)
//比赛结果 //比赛结果
data.Result = this.IsRight(v, data) data.Result = this.IsRight(v, data)
return 0, data return 0, data
} }
} }
...@@ -19,6 +19,10 @@ func (this *E1Service) ModelName() string { ...@@ -19,6 +19,10 @@ func (this *E1Service) ModelName() string {
return "E1" return "E1"
} }
func (this *E1Service) AnalyTest() {
this.AnalyService.AnalyTest(this)
}
/** /**
计算欧赔81 616的即时盘,和初盘的差异 计算欧赔81 616的即时盘,和初盘的差异
*/ */
......
...@@ -19,6 +19,10 @@ func (this *E2Service) ModelName() string { ...@@ -19,6 +19,10 @@ func (this *E2Service) ModelName() string {
return "E2" return "E2"
} }
func (this *E2Service) AnalyTest() {
this.AnalyService.AnalyTest(this)
}
/** /**
计算欧赔81 616的即时盘,和初盘的差异 计算欧赔81 616的即时盘,和初盘的差异
*/ */
......
...@@ -23,6 +23,10 @@ func (this *E3Service) ModelName() string { ...@@ -23,6 +23,10 @@ func (this *E3Service) ModelName() string {
return "E3" return "E3"
} }
func (this *E3Service) AnalyTest() {
this.AnalyService.AnalyTest(this)
}
/** /**
计算欧赔81 616的即时盘,和初盘的差异 计算欧赔81 616的即时盘,和初盘的差异
*/ */
...@@ -83,7 +87,7 @@ func (this *E3Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult) ...@@ -83,7 +87,7 @@ func (this *E3Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult)
//得出结果 //得出结果
//1.0判断主队是否是让球方 //1.0判断主队是否是让球方
mainLetball := this.AnalyService.mainLetball(a18Bet) mainLetball := this.AnalyService.mainLetball(aBet365)
preResult := -1 preResult := -1
if mainLetball{ if mainLetball{
......
...@@ -19,6 +19,10 @@ func (this *Q1Service) ModelName() string { ...@@ -19,6 +19,10 @@ func (this *Q1Service) ModelName() string {
return "Q1" return "Q1"
} }
func (this *Q1Service) AnalyTest() {
this.AnalyService.AnalyTest(this)
}
func (this *Q1Service) Analy(analyAll bool) { func (this *Q1Service) Analy(analyAll bool) {
this.AnalyService.Analy(analyAll,this) this.AnalyService.Analy(analyAll,this)
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册