| | |
| | | package service |
| | | |
| | | import ( |
| | | "basic.com/valib/logger.git" |
| | | "encoding/json" |
| | | "fmt" |
| | | "strconv" |
| | | "webserver/cache" |
| | | "webserver/extend/config" |
| | | "webserver/extend/esutil" |
| | | "webserver/models" |
| | |
| | | |
| | | // 地库人员数据 为 比对做准备 |
| | | func QueryDbPersonsForCompare(reqBody models.EsSearch) map[string]interface{} { |
| | | url := "http://" + config.EsInfo.Masterip + ":" + config.EsInfo.Httpport + |
| | | localConf, err2 := cache.GetServerInfo() |
| | | if err2 !=nil || localConf.AlarmIp == "" || localConf.ServerId == "" { |
| | | logger.Debug("localConfig is wrong!!!") |
| | | return nil |
| | | } |
| | | url := "http://" + localConf.AlarmIp + ":" + strconv.Itoa(int(localConf.AlarmPort)) + |
| | | "/" + config.EsInfo.EsIndex.Dbtablepersons.IndexName + "/_search" |
| | | tableIds := make([]string, 20) |
| | | if reqBody.DataBases != nil { |
| | |
| | | "basic.com/dbapi.git" |
| | | "basic.com/fileServer/WeedFSClient.git" |
| | | "basic.com/valib/capture.git" |
| | | "basic.com/valib/logger.git" |
| | | "errors" |
| | | "strconv" |
| | | "webserver/extend/config" |
| | | "webserver/cache" |
| | | ) |
| | | /*以下属于旧版本地摄像机获取截图(国标摄像机底图无法刷新) |
| | | func PostFormBufferData(uri string, filepath string, fileName string) (maps map[string]interface{}, err0 error) { |
| | |
| | | if camera.Type == 1{//国标摄像机 |
| | | m = capture.GB28181 |
| | | } |
| | | b,err := capture.Capture("./runtime/libcffmpeg.so",m,camera.Rtsp,capture.JPEGFileExt,1280,720,10) |
| | | b,err := capture.Capture("libcffmpeg.so",m,camera.Rtsp,capture.JPEGFileExt,1280,720,10) |
| | | if err == nil{ |
| | | var weedfsUri = "http://"+config.WeedFs.Ip+":"+strconv.Itoa(config.WeedFs.UploadPort)+"/submit" |
| | | localConf, err2 := cache.GetServerInfo() |
| | | if err2 !=nil || localConf.WebPicIp == "" { |
| | | logger.Debug("localConfig is wrong!!!") |
| | | return "",err2 |
| | | } |
| | | var weedfsUri = "http://"+localConf.WebPicIp+":"+strconv.Itoa(int(localConf.WebPicPort))+"/submit" |
| | | weedFilePath, err := WeedFSClient.UploadFile(weedfsUri, camera.Name+".jpg", b) |
| | | if err != nil { |
| | | return "",err |
| | |
| | | package service |
| | | |
| | | import ( |
| | | "basic.com/dbapi.git" |
| | | "basic.com/valib/logger.git" |
| | | "encoding/json" |
| | | "fmt" |
| | | "strconv" |
| | | "strings" |
| | | "time" |
| | | "webserver/cache" |
| | | "webserver/extend/config" |
| | | "webserver/extend/esutil" |
| | | "webserver/extend/logger" |
| | | ) |
| | | |
| | | func GetVerificationData() []map[string]interface{} { |
| | | url := "http://" + config.EsInfo.Masterip + ":" + config.EsInfo.Httpport + |
| | | localConf, err2 := cache.GetServerInfo() |
| | | if err2 !=nil || localConf.AlarmIp == "" || localConf.ServerId == "" { |
| | | logger.Debug("localConfig is wrong!!!") |
| | | return nil |
| | | } |
| | | url := "http://" + localConf.AlarmIp + ":" + strconv.Itoa(int(localConf.AlarmPort)) + |
| | | "/" + config.EsInfo.EsIndex.DbTables.IndexName + "/_search" |
| | | var setApi dbapi.SysSetApi |
| | | _, sysconf := setApi.GetServerInfo() |
| | | |
| | | jsonDSL := `{ |
| | | "query": { |
| | | "bool": { |
| | |
| | | }, |
| | | { |
| | | "terms": { |
| | | "analyServerId": ["` + sysconf.ServerId + `",""] |
| | | "analyServerId": ["` + localConf.ServerId + `",""] |
| | | } |
| | | } |
| | | ] |
| | |
| | | status = 1 |
| | | } |
| | | enable := strconv.Itoa(status) |
| | | url := "http://" + config.EsInfo.Masterip + ":" + config.EsInfo.Httpport + |
| | | localConf, err2 := cache.GetServerInfo() |
| | | if err2 !=nil || localConf.AlarmIp == "" || localConf.ServerId == "" { |
| | | logger.Debug("localConfig is wrong!!!") |
| | | return "localConf wrong" |
| | | } |
| | | url := "http://" + localConf.AlarmIp + ":" + strconv.Itoa(int(localConf.AlarmPort)) + |
| | | "/" + config.EsInfo.EsIndex.DbTables.IndexName + "/_update_by_query?refresh" |
| | | jsonDsl := ` |
| | | { |