【修改获取设备逻辑】
This commit is contained in:
parent
810e1e61e1
commit
4aa811614d
@ -96,13 +96,7 @@ func QueryEcsLinkByDeviceInfo(repo *repository.Repository, mapId int32, id strin
|
||||
|
||||
// 根据物理区段上的偏移量(基于区段A端),找到所在link的linkId与偏移量
|
||||
func sectionMapToEcsLink(repo *repository.Repository, id string, offset int64, runDirection bool) (int32, int64, bool, bool, int64) {
|
||||
var section *repository.PhysicalSection
|
||||
for _, s := range repo.PhysicalSectionList() {
|
||||
if s.Id() == id {
|
||||
section = s
|
||||
break
|
||||
}
|
||||
}
|
||||
section := repo.FindPhysicalSection(id)
|
||||
if section == nil {
|
||||
panic(&dto.ErrorDto{Code: dto.DataNotExist, Message: fmt.Sprintf("地图不存在uid:%s缓存", id)})
|
||||
}
|
||||
@ -129,13 +123,7 @@ func sectionMapToEcsLink(repo *repository.Repository, id string, offset int64, r
|
||||
|
||||
// 根据道岔上的偏移量(基于岔心位置),找到所在link的linkId与偏移量
|
||||
func turnoutMapToEcsLink(repo *repository.Repository, id string, port string, offset int64, runDirection bool) (int32, int64, bool, bool, int64) {
|
||||
var turnout *repository.Turnout
|
||||
for _, t := range repo.TurnoutList() {
|
||||
if t.Id() == id {
|
||||
turnout = t
|
||||
break
|
||||
}
|
||||
}
|
||||
turnout := repo.FindTurnout(id)
|
||||
if turnout == nil {
|
||||
panic(dto.ErrorDto{Code: dto.DataNotExist, Message: fmt.Sprintf("不存在道岔【uid:%s】", id)})
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 660b6a6797385aa494a49ffa80e9135ce964eceb
|
||||
Subproject commit d743f0be7c203172884bc07fa76e0c61e550386e
|
Loading…
Reference in New Issue
Block a user