【修改获取设备逻辑】

This commit is contained in:
weizhihong 2023-09-28 09:29:04 +08:00
parent 810e1e61e1
commit 4aa811614d
2 changed files with 3 additions and 15 deletions

View File

@ -96,13 +96,7 @@ func QueryEcsLinkByDeviceInfo(repo *repository.Repository, mapId int32, id strin
// 根据物理区段上的偏移量基于区段A端找到所在link的linkId与偏移量 // 根据物理区段上的偏移量基于区段A端找到所在link的linkId与偏移量
func sectionMapToEcsLink(repo *repository.Repository, id string, offset int64, runDirection bool) (int32, int64, bool, bool, int64) { func sectionMapToEcsLink(repo *repository.Repository, id string, offset int64, runDirection bool) (int32, int64, bool, bool, int64) {
var section *repository.PhysicalSection section := repo.FindPhysicalSection(id)
for _, s := range repo.PhysicalSectionList() {
if s.Id() == id {
section = s
break
}
}
if section == nil { if section == nil {
panic(&dto.ErrorDto{Code: dto.DataNotExist, Message: fmt.Sprintf("地图不存在uid:%s缓存", id)}) 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与偏移量 // 根据道岔上的偏移量基于岔心位置找到所在link的linkId与偏移量
func turnoutMapToEcsLink(repo *repository.Repository, id string, port string, offset int64, runDirection bool) (int32, int64, bool, bool, int64) { func turnoutMapToEcsLink(repo *repository.Repository, id string, port string, offset int64, runDirection bool) (int32, int64, bool, bool, int64) {
var turnout *repository.Turnout turnout := repo.FindTurnout(id)
for _, t := range repo.TurnoutList() {
if t.Id() == id {
turnout = t
break
}
}
if turnout == nil { if turnout == nil {
panic(dto.ErrorDto{Code: dto.DataNotExist, Message: fmt.Sprintf("不存在道岔【uid:%s】", id)}) panic(dto.ErrorDto{Code: dto.DataNotExist, Message: fmt.Sprintf("不存在道岔【uid:%s】", id)})
} }

@ -1 +1 @@
Subproject commit 660b6a6797385aa494a49ffa80e9135ce964eceb Subproject commit d743f0be7c203172884bc07fa76e0c61e550386e