修改应答器移位操作的报错提示信息

This commit is contained in:
joylink_zhangsai 2024-01-18 10:08:55 +08:00
parent 9595fe9f6f
commit 66d31f80f2
3 changed files with 4 additions and 4 deletions

View File

@ -638,9 +638,9 @@ func balisePositionModify(c *gin.Context) {
}
simulation := checkDeviceDataAndReturn(req.SimulationId)
slog.Info("传入状态参数", req)
err := memory.BalisePositionModify(simulation, req)
var err *sys_error.BusinessError = memory.BalisePositionModify(simulation, req)
if err != nil {
panic(sys_error.New(fmt.Sprintf("应答器移位操作失败,%s", err.Error()), err))
panic(err)
}
c.JSON(http.StatusOK, "ok")
}

@ -1 +1 @@
Subproject commit 0203bbcefa0797f2efae50bbaa5e9c6d0f30a84e
Subproject commit 8cd0f61fb0aa36fe69bc55ada1ffb4397626b365

View File

@ -90,7 +90,7 @@ func BalisePositionModify(simulation *VerifySimulation, req *dto.BaliseMoveReqDt
//更新应答器公里标和Link位置
entry, _ := entity.GetEntityByUid(simulation.World, uid)
if km.Value <= minKm.Value || km.Value >= maxKm.Value {
return sys_error.New(fmt.Sprintf("超出可设置范围(%d:%d)", minKm.Value, maxKm.Value))
return sys_error.New("位置设置错误,必须在相邻的应答器/道岔/轨道边界之间")
}
component.KmType.Set(entry, km)
offset := number.Abs(km.Value - akm.Value)