LingxinMeng 1 рік тому
батько
коміт
292769bb63
1 змінених файлів з 2 додано та 1 видалено
  1. 2 1
      amd64/web_server/handler/h_exam.go

+ 2 - 1
amd64/web_server/handler/h_exam.go

@@ -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 {