| | |
| | | } |
| | | |
| | | m["resolutions"] = []models.Resolution{dRe0, dRe1, dRe2} |
| | | |
| | | //获取督查任务 |
| | | tasks := models.GetTasks() |
| | | //处理摄像机的状态 |
| | | var crApi bhomedbapi.CameraRuleApi |
| | | //var crApi bhomedbapi.CameraRuleApi |
| | | if cam.RunType == models.TYPE_RUNTYPE_POLL || cam.RunType == models.TYPE_RUNTYPE_REALTIME { |
| | | if crApi.ExistRunningTask(cam.Id) { |
| | | //if crApi.ExistRunningTask(cam.Id) { |
| | | if taskInfo, ok := tasks[cam.Id]; ok && taskInfo != nil && len(taskInfo) > 0 { |
| | | if cam.IsRunning { |
| | | m["status"] = models.Camera_Status_Doing |
| | | } else { |
| | |
| | | |
| | | sv := service.CameraService{} |
| | | if sv.ChangeRunType(ccrVo) { |
| | | cIds := strings.Join(ccrVo.CameraIds, ",") |
| | | cc.addDbChangeMsg(h.Bk, protomsg.TableChanged_T_Camera, cIds, protomsg.DbAction_Update, "") |
| | | _, _ = service2.DoBusReq("/data/api-v/saas/syncCamera", config.Server.AnalyServerId, aiot.RequestMethod_Post, aiot.RequestContentType_ApplicationJson, map[string]interface{}{}) |
| | | //cIds := strings.Join(ccrVo.CameraIds, ",") |
| | | //cc.addDbChangeMsg(h.Bk, protomsg.TableChanged_T_Camera, cIds, protomsg.DbAction_Update, "") |
| | | // _, _ = service2.DoBusReq("/data/api-v/saas/syncCamera", config.Server.AnalyServerId, aiot.RequestMethod_Post, aiot.RequestContentType_ApplicationJson, map[string]interface{}{}) |
| | | return &bhomeclient.Reply{Success: true, Msg: "更新成功"} |
| | | } else { |
| | | return &bhomeclient.Reply{Success: false, Msg: "更新失败"} |
| | |
| | | } |
| | | } |
| | | //根据id查询视频id |
| | | var vids []int |
| | | var vids []int64 |
| | | cameras, _ := models.GetCameraIds(videoIds) |
| | | for _, camera := range cameras { |
| | | if len(camera.Id) > 0 { |
| | |
| | | } |
| | | idStr := make([]string, len(vids)) |
| | | for i, id := range vids { |
| | | idStr[i] = strconv.Itoa(id) |
| | | idStr[i] = strconv.FormatInt(id, 10) |
| | | } |
| | | filter += fmt.Sprintf(" and %s in [%s]", "video_point_id", strings.Join(idStr, ",")) |
| | | } |