zhangzengfei
2024-05-16 131945ff5bc769dbc1004e12a8afc832df275c96
service/nvcs.go
@@ -6,6 +6,7 @@
   "fmt"
   "io/ioutil"
   "net"
   "strings"
   "gat1400Exchange/config"
   "gat1400Exchange/models"
@@ -90,10 +91,19 @@
      }
      elevator := data.Elevator[0]
      // 程序部署在设备端, 字符叠加器上报的名称允许为空. 在云端, 名称必须与摄像机相同
      if !config.ClientConf.Enable {
         elevator.Name = strings.Trim(elevator.Name, " ")
         if elevator.Name == "" {
            continue
         }
      }
      var d = models.Device{
         Id:  elevator.Name,
         Pos: elevator.Status.FloorName,
         Ip:  elevator.IP,
         Id:    elevator.Name,
         Floor: elevator.Status.FloorName,
         Ip:    elevator.IP,
      }
      err = d.Upsert()