提交 85c1ea15 编写于 作者: S shi.zeyuan

1.修复bug .2.增加作废选项

上级 35a903c7
......@@ -14,4 +14,5 @@ bin
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
.idea/
\ No newline at end of file
.idea/
logs/
\ No newline at end of file
package main
import (
"tesou.io/platform/foot-parent/foot-api/common/base"
_ "tesou.io/platform/foot-parent/foot-core/common/fliters"
_ "tesou.io/platform/foot-parent/foot-core/common/routers"
"tesou.io/platform/foot-parent/foot-core/module/wechat/controller"
"time"
)
func main() {
materialController := new(controller.MaterialController)
materialController.ModifyNewsOnly()
base.Log.Info("--------发布公众号周期结束--------")
time.Sleep(10 * time.Minute)
}
......@@ -42,17 +42,7 @@
<td>
{{.MainTeamGoal}}:{{.GuestTeamGoal}}
</td>
<td
{{if eq .Result "正确"}}
style="background-color: red"
{{else if eq .Result "错误"}}
style="background-color: gray"
{{else if eq .Result "走盘"}}
style="background-color: greenyellow"
{{else}}
{{end}}
>
<td style="background-color: {{resultColor .Result}}">
{{preResultStr .PreResult .AlFlag}}
</td>
......
......@@ -44,17 +44,7 @@
<td>
{{.MainTeamGoal}}:{{.GuestTeamGoal}}
</td>
<td
{{if eq .Result "正确"}}
style="background-color: red"
{{else if eq .Result "错误"}}
style="background-color: gray"
{{else if eq .Result "走盘"}}
style="background-color: greenyellow"
{{else}}
{{end}}
>
<td style="background-color: {{resultColor .Result}}">
{{preResultStr .PreResult .AlFlag}}
</td>
......
......@@ -50,17 +50,7 @@
<td>
{{.MainTeamGoal}}:{{.GuestTeamGoal}}
</td>
<td
{{if eq .Result "正确"}}
style="background-color: red"
{{else if eq .Result "错误"}}
style="background-color: gray"
{{else if eq .Result "走盘"}}
style="background-color: greenyellow"
{{else}}
{{end}}
>
<td style="background-color: {{resultColor .Result}}">
{{preResultStr .PreResult .AlFlag}}
</td>
......
......@@ -47,18 +47,12 @@
<td>
{{.MainTeamGoal}}:{{.GuestTeamGoal}}
</td>
<td
{{if eq .Result "正确"}}
style="background-color: red"
{{else if eq .Result "错误"}}
style="background-color: gray"
{{else if eq .Result "走盘"}}
style="background-color: greenyellow"
{{else}}
{{end}}
>
{{preResultStr .PreResult .AlFlag}}
<td style="background-color: {{resultColor .Result}}">
{{if .TOVoid}}
<del>{{preResultStr .PreResult .AlFlag}}</del>
{{else}}
{{preResultStr .PreResult .AlFlag}}
{{end}}
</td>
</tr>
{{end}}
......
......@@ -48,18 +48,12 @@
<td>
{{.MainTeamGoal}}:{{.GuestTeamGoal}}
</td>
<td
{{if eq .Result "正确"}}
style="background-color: red"
{{else if eq .Result "错误"}}
style="background-color: gray"
{{else if eq .Result "走盘"}}
style="background-color: greenyellow"
{{else}}
{{end}}
>
{{preResultStr .PreResult .AlFlag}}
<td style="background-color: {{resultColor .Result}}">
{{if .TOVoid}}
<del>{{preResultStr .PreResult .AlFlag}}</del>
{{else}}
{{preResultStr .PreResult .AlFlag}}
{{end}}
</td>
</tr>
{{end}}
......
......@@ -47,18 +47,12 @@
<td>
{{.MainTeamGoal}}:{{.GuestTeamGoal}}
</td>
<td
{{if eq .Result "正确"}}
style="background-color: red"
{{else if eq .Result "错误"}}
style="background-color: gray"
{{else if eq .Result "走盘"}}
style="background-color: greenyellow"
{{else}}
{{end}}
>
{{preResultStr .PreResult .AlFlag}}
<td style="background-color: {{resultColor .Result}}">
{{if .TOVoid}}
<del>{{preResultStr .PreResult .AlFlag}}</del>
{{else}}
{{preResultStr .PreResult .AlFlag}}
{{end}}
</td>
</tr>
{{end}}
......
......@@ -42,17 +42,7 @@
<td>
{{.MainTeamGoal}}:{{.GuestTeamGoal}}
</td>
<td
{{if eq .Result "正确"}}
style="background-color: red"
{{else if eq .Result "错误"}}
style="background-color: gray"
{{else if eq .Result "走盘"}}
style="background-color: greenyellow"
{{else}}
{{end}}
>
<td style="background-color: {{resultColor .Result}}">
{{preResultStr .PreResult .AlFlag}}
</td>
......
[mysql]
#url=root:Meta.123@tcp(mysql.io:3306)/foot?charset=utf8
url=root:awe.FOG5188@tcp(39.108.212.245:3306)/foot?charset=utf8
url=root:Meta.123@tcp(mysql.io:3306)/foot?charset=utf8
#url=root:awe.FOG5188@tcp(39.108.212.245:3306)/foot?charset=utf8
maxIdle=10
maxConn=50
[cookies]
......
......@@ -30,6 +30,9 @@ type AnalyResult struct {
AlSeq string `xorm:" comment('算法批次') index"`
//C1模型计算出的合理让球
MyLetBall float64 `xorm:" comment('C1模型计算出的合理让球') index"`
//是否己经作废,因后续结果不符合要求
TOVoid bool `xorm:"bool notnull comment('是否己经作废') index"`
TOVoidDesc string `xorm:" comment('作废备注') index"`
pojo.BasePojo `xorm:"extends"`
}
......@@ -2,4 +2,27 @@ package constants
const (
SECTION_NAME = "analy"
/**
C1算法,参考的亚赔公司-- 澳门,Bet365,18Bet
*/
C1_REFER_ASIA = "Bet365"
)
const (
//胜
WIN = 3
//平
DRAW = 1
//负
LOST = 0
//命中
HIT = "命中"
HIT_1 = "正确"
//未命中
UNHIT = "错误"
//待定
UNCERTAIN = "待定"
//走盘
WALKING_PLATE = "走盘"
)
......@@ -43,16 +43,17 @@ func (this *A1Service) Analy_Near() {
}
func (this *A1Service) Analy_Process(matchList []*pojo.MatchLast) {
hit_count_str := utils.GetVal(constants.SECTION_NAME, "hit_count")
hit_count, _ := strconv.Atoi(hit_count_str)
data_list_slice := make([]interface{}, 0)
data_modify_list_slice := make([]interface{}, 0)
for _, v := range matchList {
stub, data := this.analyStub(v)
if stub == 0 || stub == 1 {
data.TOVoid = false
hours := v.MatchDate.Sub(time.Now()).Hours()
if hours > 0 {
hit_count_str := utils.GetVal(constants.SECTION_NAME, "hit_count")
hit_count, _ := strconv.Atoi(hit_count_str)
data.THitCount = hit_count
}else{
data.THitCount = 1
......@@ -65,10 +66,10 @@ func (this *A1Service) Analy_Process(matchList []*pojo.MatchLast) {
} else {
if stub != -2{
data = this.Find(v.Id, this.ModelName())
}else{
data.TOVoid = true
}
if len(data.Id) > 0 {
hit_count_str := utils.GetVal(constants.SECTION_NAME, "hit_count")
hit_count, _ := strconv.Atoi(hit_count_str)
if data.HitCount >= hit_count {
data.HitCount = (hit_count / 2) - 1
}else{
......
......@@ -10,6 +10,7 @@ import (
entity2 "tesou.io/platform/foot-parent/foot-api/module/match/pojo"
entity3 "tesou.io/platform/foot-parent/foot-api/module/odds/pojo"
"tesou.io/platform/foot-parent/foot-core/common/base/service/mysql"
"tesou.io/platform/foot-parent/foot-core/module/analy/constants"
service3 "tesou.io/platform/foot-parent/foot-core/module/elem/service"
service2 "tesou.io/platform/foot-parent/foot-core/module/match/service"
"tesou.io/platform/foot-parent/foot-core/module/odds/service"
......@@ -157,13 +158,13 @@ func (this *AnalyService) IsRight(v *entity2.MatchLast, analy *entity5.AnalyResu
globalResult := this.ActualResult(v, analy)
var resultFlag string
if globalResult == -1 {
resultFlag = "待定"
resultFlag = constants.UNCERTAIN
} else if globalResult == analy.PreResult {
resultFlag = "正确"
resultFlag = constants.HIT
} else if globalResult == 1 {
resultFlag = "走盘"
resultFlag = constants.WALKING_PLATE
} else {
resultFlag = "错误"
resultFlag = constants.UNHIT
}
//打印数据
......@@ -197,11 +198,11 @@ func (this *AnalyService) ActualResult(v *entity2.MatchLast, analy *entity5.Anal
// result = 1
//}
if mainTeamGoals > float64(v.GuestTeamGoals) {
result = 3
result = constants.WIN
} else if mainTeamGoals < float64(v.GuestTeamGoals) {
result = 0
result = constants.LOST
} else {
result = 1
result = constants.DRAW
}
return result
}
......
......@@ -50,16 +50,17 @@ func (this *C1Service) Analy_Near() {
}
func (this *C1Service) Analy_Process(matchList []*pojo.MatchLast) {
hit_count_str := utils.GetVal(constants.SECTION_NAME, "hit_count")
hit_count, _ := strconv.Atoi(hit_count_str)
data_list_slice := make([]interface{}, 0)
data_modify_list_slice := make([]interface{}, 0)
for _, v := range matchList {
stub, data := this.analyStub(v)
if stub == 0 || stub == 1 {
data.TOVoid = false
hours := v.MatchDate.Sub(time.Now()).Hours()
if hours > 0 {
hit_count_str := utils.GetVal(constants.SECTION_NAME, "hit_count")
hit_count, _ := strconv.Atoi(hit_count_str)
data.THitCount = hit_count
} else {
data.THitCount = 1
......@@ -72,10 +73,10 @@ func (this *C1Service) Analy_Process(matchList []*pojo.MatchLast) {
} else {
if stub != -2 {
data = this.Find(v.Id, this.ModelName())
}else{
data.TOVoid = true
}
if len(data.Id) > 0 {
hit_count_str := utils.GetVal(constants.SECTION_NAME, "hit_count")
hit_count, _ := strconv.Atoi(hit_count_str)
if data.HitCount >= hit_count {
data.HitCount = (hit_count / 2) - 1
} else {
......@@ -104,9 +105,7 @@ func (this *C1Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult)
//声明使用变量
var a18betData *entity3.AsiaHis
//亚赔
//aList := this.AsiaHisService.FindByMatchIdCompId(matchId, "澳门")
aList := this.AsiaHisService.FindByMatchIdCompId(matchId, "Bet365")
//aList := this.AsiaHisService.FindByMatchIdCompId(matchId, "18Bet")
aList := this.AsiaHisService.FindByMatchIdCompId(matchId, constants.C1_REFER_ASIA)
if len(aList) < 1 {
return -1, nil
}
......
......@@ -36,16 +36,17 @@ func (this *E1Service) Analy_Near() {
}
func (this *E1Service) Analy_Process(matchList []*pojo.MatchLast) {
hit_count_str := utils.GetVal(constants.SECTION_NAME, "hit_count")
hit_count, _ := strconv.Atoi(hit_count_str)
data_list_slice := make([]interface{}, 0)
data_modify_list_slice := make([]interface{}, 0)
for _, v := range matchList {
stub, data := this.analyStub(v)
if stub == 0 || stub == 1 {
data.TOVoid = false
hours := v.MatchDate.Sub(time.Now()).Hours()
if hours > 0 {
hit_count_str := utils.GetVal(constants.SECTION_NAME, "hit_count")
hit_count, _ := strconv.Atoi(hit_count_str)
data.THitCount = hit_count
} else {
data.THitCount = 1
......@@ -58,10 +59,10 @@ func (this *E1Service) Analy_Process(matchList []*pojo.MatchLast) {
} else {
if stub != -2{
data = this.Find(v.Id, this.ModelName())
}else{
data.TOVoid = true
}
if len(data.Id) > 0 {
hit_count_str := utils.GetVal(constants.SECTION_NAME, "hit_count")
hit_count, _ := strconv.Atoi(hit_count_str)
if data.HitCount >= hit_count {
data.HitCount = (hit_count / 2) - 1
} else {
......
......@@ -40,16 +40,17 @@ func (this *E2Service) Analy_Near() {
}
func (this *E2Service) Analy_Process(matchList []*pojo.MatchLast) {
hit_count_str := utils.GetVal(constants.SECTION_NAME, "hit_count")
hit_count, _ := strconv.Atoi(hit_count_str)
data_list_slice := make([]interface{}, 0)
data_modify_list_slice := make([]interface{}, 0)
for _, v := range matchList {
stub, data := this.analyStub(v)
if stub == 0 || stub == 1 {
data.TOVoid = false
hours := v.MatchDate.Sub(time.Now()).Hours()
if hours > 0 {
hit_count_str := utils.GetVal(constants.SECTION_NAME, "hit_count")
hit_count, _ := strconv.Atoi(hit_count_str)
data.THitCount = hit_count
} else {
data.THitCount = 1
......@@ -62,10 +63,10 @@ func (this *E2Service) Analy_Process(matchList []*pojo.MatchLast) {
} else {
if stub != -2{
data = this.Find(v.Id, this.ModelName())
}else{
data.TOVoid = true
}
if len(data.Id) > 0 {
hit_count_str := utils.GetVal(constants.SECTION_NAME, "hit_count")
hit_count, _ := strconv.Atoi(hit_count_str)
if data.HitCount >= hit_count {
data.HitCount = (hit_count / 2) - 1
} else {
......@@ -187,11 +188,11 @@ func (this *E2Service) IsRight(v *pojo.MatchLast, analy *entity5.AnalyResult) st
}
var resultFlag string
if globalResult == -1 {
resultFlag = "待定"
resultFlag = constants.UNCERTAIN
} else if globalResult == analy.PreResult || globalResult == 1 {
resultFlag = "正确"
resultFlag = constants.HIT
} else {
resultFlag = "错误"
resultFlag = constants.UNHIT
}
//打印数据
......
......@@ -35,16 +35,17 @@ func (this *Q1Service) Analy_Near() {
}
func (this *Q1Service) Analy_Process(matchList []*pojo.MatchLast) {
hit_count_str := utils.GetVal(constants.SECTION_NAME, "hit_count")
hit_count, _ := strconv.Atoi(hit_count_str)
data_list_slice := make([]interface{}, 0)
data_modify_list_slice := make([]interface{}, 0)
for _, v := range matchList {
stub, data := this.analyStub(v)
if stub == 0 || stub == 1 {
data.TOVoid = false
hours := v.MatchDate.Sub(time.Now()).Hours()
if hours > 0 {
hit_count_str := utils.GetVal(constants.SECTION_NAME, "hit_count")
hit_count, _ := strconv.Atoi(hit_count_str)
data.THitCount = hit_count
} else {
data.THitCount = 1
......@@ -57,10 +58,10 @@ func (this *Q1Service) Analy_Process(matchList []*pojo.MatchLast) {
} else {
if stub != -2 {
data = this.Find(v.Id, this.ModelName())
} else {
data.TOVoid = true
}
if len(data.Id) > 0 {
hit_count_str := utils.GetVal(constants.SECTION_NAME, "hit_count")
hit_count, _ := strconv.Atoi(hit_count_str)
if data.HitCount >= hit_count {
data.HitCount = (hit_count / 2) - 1
} else {
......
......@@ -11,11 +11,11 @@ type MaterialService struct {
}
func (this *MaterialService) ModifyNews(wcClient *core.Client) {
this.SuggestTodayService.ModifyToday(wcClient)
this.SuggestTodayService.ModifyTodayDetail(wcClient)
this.SuggestTodayService.ModifyTodayTbs(wcClient)
this.SuggestTodayService.ModifyTodayA1(wcClient)
this.SuggestTodayService.ModifyTodayC1(wcClient)
this.SuggestTodayService.ModifyToday(wcClient)
this.SuggestTodayService.ModifyTodayDetail(wcClient)
this.SuggestWeekService.ModifyWeek(wcClient)
this.SuggestMonthService.ModifyMonth(wcClient)
......
......@@ -12,6 +12,7 @@ import (
"tesou.io/platform/foot-parent/foot-api/module/suggest/vo"
"tesou.io/platform/foot-parent/foot-core/common/base/service/mysql"
"tesou.io/platform/foot-parent/foot-core/common/utils"
constants2 "tesou.io/platform/foot-parent/foot-core/module/analy/constants"
"tesou.io/platform/foot-parent/foot-core/module/analy/service"
"tesou.io/platform/foot-parent/foot-core/module/spider/constants"
service2 "tesou.io/platform/foot-parent/foot-core/module/suggest/service"
......@@ -75,11 +76,11 @@ func (this *SuggestMonthService) ModifyMonth(wcClient *core.Client) {
var redCount, walkCount, blackCount, linkRedCount, tempLinkRedCount, linkBlackCount, tempLinkBlackCount int64
temp.DataList = make([]vo.SuggestVO, len(tempList))
for i, e := range tempList {
if strings.EqualFold("正确", e.Result) {
if strings.EqualFold(constants2.HIT, e.Result) || strings.EqualFold(constants2.HIT_1, e.Result) {
redCount++
tempLinkRedCount++
tempLinkBlackCount = 0
} else if strings.EqualFold("错误", e.Result) {
} else if strings.EqualFold(constants2.UNHIT, e.Result) {
blackCount++
tempLinkBlackCount++
tempLinkRedCount = 0
......
......@@ -10,6 +10,7 @@ import (
"tesou.io/platform/foot-parent/foot-api/module/suggest/vo"
"tesou.io/platform/foot-parent/foot-core/common/base/service/mysql"
"tesou.io/platform/foot-parent/foot-core/common/utils"
constants2 "tesou.io/platform/foot-parent/foot-core/module/analy/constants"
"tesou.io/platform/foot-parent/foot-core/module/analy/service"
"tesou.io/platform/foot-parent/foot-core/module/spider/constants"
service2 "tesou.io/platform/foot-parent/foot-core/module/suggest/service"
......@@ -32,7 +33,7 @@ func preResultStr(val int, al_flag string) string {
} else if 0 == val {
result = "负平"
}
}else{
} else {
if 3 == val {
result = "主"
} else if 1 == val {
......@@ -47,7 +48,7 @@ func preResultStr(val int, al_flag string) string {
func color(str string) string {
if "A1" == str {
return "orange"
}else if "C1" == str {
} else if "C1" == str {
return "yellow"
} else if "E1" == str {
return "blue"
......@@ -59,10 +60,22 @@ func color(str string) string {
return "XX"
}
func resultColor(str string) string {
if str == constants2.HIT || str == constants2.HIT_1 {
return "red"
} else if str == constants2.UNHIT {
return "gray"
} else if str == constants2.WALKING_PLATE {
return "greenyellow"
}
return "XX"
}
func getFuncMap() map[string]interface{} {
funcMap := template.FuncMap{
"preResultStr": preResultStr,
"color": color,
"resultColor": resultColor,
}
return funcMap
}
......@@ -269,7 +282,7 @@ func (this *SuggestTodayService) ModifyTodayTbs(wcClient *core.Client) {
h12, _ = time.ParseDuration("24h")
endDate := now.Add(h12)
param.EndDateStr = endDate.Format("2006-01-02 15:04:05")
param.AlFlags = []string{"E1","E2","Q1"}
param.AlFlags = []string{"E1", "E2", "Q1"}
tempList := this.SuggestService.QueryTbs(param)
//更新推送
first := material.Article{}
......@@ -306,7 +319,6 @@ func (this *SuggestTodayService) ModifyTodayTbs(wcClient *core.Client) {
}
}
/**
今日A1待选池比赛
*/
......@@ -356,8 +368,6 @@ func (this *SuggestTodayService) ModifyTodayA1(wcClient *core.Client) {
}
}
/**
今日C1待选池比赛
*/
......@@ -405,4 +415,4 @@ func (this *SuggestTodayService) ModifyTodayC1(wcClient *core.Client) {
if err != nil {
base.Log.Error(err)
}
}
\ No newline at end of file
}
......@@ -12,6 +12,7 @@ import (
"tesou.io/platform/foot-parent/foot-api/module/suggest/vo"
"tesou.io/platform/foot-parent/foot-core/common/base/service/mysql"
"tesou.io/platform/foot-parent/foot-core/common/utils"
constants2 "tesou.io/platform/foot-parent/foot-core/module/analy/constants"
"tesou.io/platform/foot-parent/foot-core/module/analy/service"
"tesou.io/platform/foot-parent/foot-core/module/spider/constants"
service2 "tesou.io/platform/foot-parent/foot-core/module/suggest/service"
......@@ -75,11 +76,11 @@ func (this *SuggestWeekService) ModifyWeek(wcClient *core.Client) {
var redCount, walkCount, blackCount, linkRedCount, tempLinkRedCount, linkBlackCount, tempLinkBlackCount int64
temp.DataList = make([]vo.SuggestVO, len(tempList))
for i, e := range tempList {
if strings.EqualFold("正确", e.Result) {
if strings.EqualFold(constants2.HIT, e.Result) || strings.EqualFold(constants2.HIT_1, e.Result) {
redCount++
tempLinkRedCount++
tempLinkBlackCount = 0
} else if strings.EqualFold("错误", e.Result) {
} else if strings.EqualFold(constants2.UNHIT, e.Result) {
blackCount++
tempLinkBlackCount++
tempLinkRedCount = 0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册