提交 0d562acb 编写于 作者: M monomania

1.将不符合要求清除掉

上级 b1a6d823
......@@ -4,6 +4,7 @@ import (
"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"
)
......@@ -27,6 +28,23 @@ func (this *Asia18EuroUDReverseService) Analy() {
data_list_slice := make([]interface{}, 0)
data_modify_list_slice := make([]interface{}, 0)
for _, v := range matchList {
stub, result := this.analyStub(v)
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)
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 *Asia18EuroUDReverseService) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult) {
matchId := v.Id
//声明使用变量
var e81data *entity3.EuroLast
......@@ -34,9 +52,9 @@ func (this *Asia18EuroUDReverseService) Analy() {
var e104data *entity3.EuroLast
var a18betData *entity3.AsiaLast
//81 -- 伟德
eList := this.EuroLastService.FindByMatchIdCompId(matchId, "81", "616","104")
eList := this.EuroLastService.FindByMatchIdCompId(matchId, "81", "616", "104")
if len(eList) < 3 {
continue
return -1, nil
}
for _, ev := range eList {
if strings.EqualFold(ev.CompId, "81") {
......@@ -56,11 +74,11 @@ func (this *Asia18EuroUDReverseService) Analy() {
//亚赔
aList := this.AsiaLastService.FindByMatchIdCompId(matchId, "18Bet")
if len(aList) < 1 {
continue
return -1, nil
}
a18betData = aList[0]
if a18betData.ELetBall > this.MaxLetBall {
continue
return -2, nil
}
//判断分析logic
......@@ -75,25 +93,26 @@ func (this *Asia18EuroUDReverseService) Analy() {
} else if euroMainDown == 0 && asiaMainDown {
preResult = 3
} else {
continue
return -3, nil
}
//增加104 --Interwetten过滤
if preResult == 3 && (e616data.Ep3 > e104data.Ep3 || e104data.Ep0 < e104data.Sp0){
continue
if preResult == 3 && (e616data.Ep3 > e104data.Ep3 || e104data.Ep0 < e104data.Sp0) {
return -3, nil
}
if preResult == 0 && (e616data.Ep0 > e104data.Ep0 || e104data.Ep3 < e104data.Sp3){
continue
if preResult == 0 && (e616data.Ep0 > e104data.Ep0 || e104data.Ep3 < e104data.Sp3) {
return -3, nil
}
var data *entity5.AnalyResult
temp_data := this.Find(v.Id)
if len(temp_data.Id) > 0 {
temp_data.PreResult = preResult
temp_data.HitCount = temp_data.HitCount + 1
data = temp_data
data_modify_list_slice = append(data_modify_list_slice, data)
//比赛结果
data.Result = this.IsRight(a18betData, v, preResult)
return 1, data
} else {
data = new(entity5.AnalyResult)
data.MatchId = v.Id
......@@ -103,12 +122,9 @@ func (this *Asia18EuroUDReverseService) Analy() {
data.AlSeq = format
data.PreResult = preResult
data.HitCount = 1
data_list_slice = append(data_list_slice, data)
}
//比赛结果
data.Result = this.IsRight(a18betData, v, preResult)
return 0, data
}
this.AnalyService.SaveList(data_list_slice)
this.AnalyService.ModifyList(data_modify_list_slice)
}
......@@ -5,6 +5,7 @@ import (
"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"
)
......@@ -23,6 +24,24 @@ func (this *Euro81_616_104Service) Analy() {
data_list_slice := make([]interface{}, 0)
data_modify_list_slice := make([]interface{}, 0)
for _, v := range matchList {
stub, result := this.analyStub(v)
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)
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 *Euro81_616_104Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult) {
matchId := v.Id
//声明使用变量
var e81data *entity3.EuroLast
......@@ -32,7 +51,7 @@ func (this *Euro81_616_104Service) Analy() {
//81 -- 伟德
eList := this.EuroLastService.FindByMatchIdCompId(matchId, "81", "616", "104")
if len(eList) < 3 {
continue
return -1,nil
}
for _, ev := range eList {
if strings.EqualFold(ev.CompId, "81") {
......@@ -50,21 +69,21 @@ func (this *Euro81_616_104Service) Analy() {
}
//0.没有变化则跳过
if e81data.Ep3 == e81data.Sp3 || e81data.Ep0 == e81data.Sp0 {
continue
return -3,nil
}
if e616data.Ep3 == e616data.Sp3 || e616data.Ep0 == e616data.Sp0 {
continue
return -3,nil
}
//1.有变化,进行以下逻辑
//亚赔
aList := this.AsiaLastService.FindByMatchIdCompId(matchId, "18Bet")
if len(aList) < 1 {
continue
return -1,nil
}
a18betData = aList[0]
if math.Abs(a18betData.ELetBall) > this.MaxLetBall {
continue
return -2,nil
}
//2.亚赔是主降还是主升 主降为true
//得出结果
......@@ -77,7 +96,7 @@ func (this *Euro81_616_104Service) Analy() {
preResult = 3
} else {
//主队希望不大
continue
return -3,nil
}
} else {
//主升
......@@ -86,16 +105,16 @@ func (this *Euro81_616_104Service) Analy() {
preResult = 0
} else {
//客队希望不大
continue
return -3,nil
}
}
//增加104 --Interwetten过滤
if preResult == 3 && (e616data.Ep3 > e104data.Ep3 || e104data.Ep0 < e104data.Sp0){
continue
if preResult == 3 && (e616data.Ep3 > e104data.Ep3 || e104data.Ep0 < e104data.Sp0) {
return -3,nil
}
if preResult == 0 && (e616data.Ep0 > e104data.Ep0 || e104data.Ep3 < e104data.Sp3){
continue
if preResult == 0 && (e616data.Ep0 > e104data.Ep0 || e104data.Ep3 < e104data.Sp3) {
return -3,nil
}
var data *entity5.AnalyResult
......@@ -104,7 +123,9 @@ func (this *Euro81_616_104Service) Analy() {
temp_data.PreResult = preResult
temp_data.HitCount = temp_data.HitCount + 1
data = temp_data
data_modify_list_slice = append(data_modify_list_slice,data)
//比赛结果
data.Result = this.IsRight(a18betData, v, preResult)
return 1, data
} else {
data = new(entity5.AnalyResult)
data.MatchId = v.Id
......@@ -114,12 +135,8 @@ func (this *Euro81_616_104Service) Analy() {
data.AlSeq = format
data.PreResult = preResult
data.HitCount = 1
data_list_slice = append(data_list_slice, data)
}
//比赛结果
data.Result = this.IsRight(a18betData, v, preResult)
return 0, data
}
this.AnalyService.SaveList(data_list_slice)
this.AnalyService.ModifyList(data_modify_list_slice)
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册