|
@@ -57,13 +57,14 @@ func Tick(c *gin.Context) {
|
|
|
stage = "决赛"
|
|
|
}
|
|
|
competitionBegin := time.Now()
|
|
|
+ cacheTeamName[teamName] = competitionBegin
|
|
|
c_log.GlobalLogger.Infof("当前比赛阶段为 %v ,队伍 %v 在起始点范围内第一次启动,保存新一条比赛记录的开始时间 %v", stage, teamName, competitionBegin)
|
|
|
if err := c_db.DoTx(sqlTemplate, []any{param.TeamName, stage, competitionBegin}); err != nil {
|
|
|
c_log.GlobalLogger.Error("保存比赛开始时间报错:", err)
|
|
|
c.JSON(http.StatusBadRequest, commonEntity.Response{Code: 500, Msg: "保存比赛开始时间报错。"})
|
|
|
return
|
|
|
}
|
|
|
- } else if !util.ContainsKey(cacheTeamName, teamName) && math.Abs(positionX-InitialPositionX) < 5.00 && math.Abs(positionY-InitialPositionY) < 5.00 { // 不在起点(开始)
|
|
|
+ } else if !util.ContainsKey(cacheTeamName, teamName) && math.Abs(positionX-InitialPositionX) > 5.00 || math.Abs(positionY-InitialPositionY) > 5.00 { // 不在起点(开始)
|
|
|
// 车辆不是在起点启动的自动驾驶模式
|
|
|
selectSql, err := util.ReadFile(c_db.SqlFilesMap["exam-select-latest-by-team_name.sql"])
|
|
|
if err != nil {
|