Merge branch 'master' of http://192.168.1.14:10010/r/webserver
| | |
| | | } |
| | | } |
| | | |
| | | func UpdateDbPersonsOfDbTable(id string) (message string) { |
| | | url := "http://" + config.EsInfo.Masterip + ":" + config.EsInfo.Httpport + |
| | | "/" + config.EsInfo.EsIndex.Dbtablepersons.IndexName + "/_update_by_query?refresh" |
| | | jsonDSL := ` |
| | | { |
| | | "script": { |
| | | "lang": "painless", |
| | | "inline": "ctx._source.enable = 0" |
| | | }, |
| | | "query": { |
| | | "term": { |
| | | "tableId": "` + id + `" |
| | | } |
| | | } |
| | | } |
| | | ` |
| | | buf, err := esutil.EsReq("POST", url, []byte(jsonDSL)) |
| | | if err != nil { |
| | | logger.Debug("http request info is err!") |
| | | message = "修改失败" |
| | | } |
| | | var info interface{} |
| | | json.Unmarshal(buf, &info) |
| | | out, ok := info.(map[string]interface{}) |
| | | if !ok { |
| | | logger.Debug("http response interface can not change map[string]interface{}") |
| | | message = "修改失败" |
| | | } |
| | | middle, ok := out["updated"].(float64) |
| | | if !ok { |
| | | logger.Debug("first result change error!") |
| | | message = "修改失败" |
| | | } |
| | | if middle >= 0 { |
| | | logger.Debug("修改成功") |
| | | message = "修改成功,更新状态条数为" + strconv.Itoa(int(middle)) |
| | | } |
| | | return message |
| | | } |
| | | |
| | | // @Summary 删除底库人员 |
| | | // @Description 删除库人员 |
| | | // @Accept x-www-form-urlencoded |
| | |
| | | data := esutil.GetEsDataReq(url, params, false) |
| | | //c.JSON(200, changeEsRespData(data, "修改成功")) |
| | | result := changeEsRespData(data, "修改成功") |
| | | if dbtable.Enable == 0 { |
| | | res := UpdateDbPersonsOfDbTable(dbtable.Id) |
| | | //fmt.Println("同步修改人员状态成功----",res) |
| | | logger.Debug("同步修改人员状态成功----", res) |
| | | } |
| | | if result["success"].(bool) { |
| | | //code.Success.Message = "修改底库成功" |
| | | //if dbtable.Enable ==1 { |
| | |
| | | searchBody := make(map[string]interface{}, 0) |
| | | |
| | | c.BindJSON(&searchBody) |
| | | index := config.EsInfo.EsIndex.VideoPersons.IndexName |
| | | index := config.EsInfo.EsIndex.VideoPersons.IndexName + "," + config.EsInfo.EsIndex.Personaction.IndexName |
| | | cameraIdStr := "" |
| | | cameraId := searchBody["treeNodes"].([]interface{}) |
| | | if cameraId != nil && len(cameraId) > 0 { |
| | |
| | | "\"sort\":[{\"picDate\":{\"order\":\"desc\"}}]," + |
| | | "\"size\":\"1000\"," + |
| | | "\"_source\":[\"baseInfo\",\"alarmRules\",\"sex\",\"analyServerName\",\"sdkName\",\"ageDescription\",\"content\",\"id\",\"cameraAddr\",\"picMaxUrl\",\"picDate\",\"race\",\"videoUrl\",\"picSmUrl\",\"taskName\",\"personIsHub\",\"isAlarm\",\"analyServerIp\",\"cameraId\"]}" |
| | | //fmt.Println(prama) |
| | | fmt.Println(prama) |
| | | fmt.Println(url) |
| | | tokenRes := esutil.GetEsDataReq(url, prama, true) |
| | | /* for _, value := range tokenRes["datalist"].([]interface{}) { |
| | | if value.(map[string]interface{})["personId"] != nil { |