|
|
@ -3,7 +3,6 @@ package DatasourceService
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"dsSupport/MyModel/AccessSystem/AccessSystemDao"
|
|
|
|
"dsSupport/MyModel/AccessSystem/AccessSystemDao"
|
|
|
|
"dsSupport/MyModel/DataSource/DatasourceDAO"
|
|
|
|
"dsSupport/MyModel/DataSource/DatasourceDAO"
|
|
|
|
"dsSupport/MyModel/JYT2012/Jyt2012Service"
|
|
|
|
|
|
|
|
"dsSupport/MyModel/MySwagger"
|
|
|
|
"dsSupport/MyModel/MySwagger"
|
|
|
|
"dsSupport/MyModel/OrgTree/OrgtreeService"
|
|
|
|
"dsSupport/MyModel/OrgTree/OrgtreeService"
|
|
|
|
"dsSupport/Utils/CacheUtil"
|
|
|
|
"dsSupport/Utils/CacheUtil"
|
|
|
@ -92,9 +91,6 @@ func CreateDatasource(model models.TDataexDatasource) (bool, string, error) {
|
|
|
|
if e != nil {
|
|
|
|
if e != nil {
|
|
|
|
return false, "SystemId不存在", nil
|
|
|
|
return false, "SystemId不存在", nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if !Jyt2012Service.IsJyt2012ExistsById(model.DicId) {
|
|
|
|
|
|
|
|
return false, "DicId不存在", nil
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if !OrgtreeService.IsOrgtreeExistsById(model.ProvideOrgid) {
|
|
|
|
if !OrgtreeService.IsOrgtreeExistsById(model.ProvideOrgid) {
|
|
|
|
return false, "OrgId不存在", nil
|
|
|
|
return false, "OrgId不存在", nil
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -164,6 +160,24 @@ func RemoveDatasource(id string) (bool, string, error) {
|
|
|
|
return result, message, error
|
|
|
|
return result, message, error
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func GetESDoc(datasourceCode string, dataId string) (bool, string, map[string]interface{}) {
|
|
|
|
|
|
|
|
result, message, esdata := ES7Util.IndexDocGet(datasourceCode, dataId)
|
|
|
|
|
|
|
|
var query = "AND datasource_code='" + datasourceCode + "'"
|
|
|
|
|
|
|
|
res, _, data, _ := DatasourceDAO.GetDatasourceRow(query)
|
|
|
|
|
|
|
|
var datasourceName interface{}
|
|
|
|
|
|
|
|
if res == true {
|
|
|
|
|
|
|
|
datasourceName = data["datasource_name"]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m := make(map[string]interface{})
|
|
|
|
|
|
|
|
j, _ := json.Marshal(esdata)
|
|
|
|
|
|
|
|
json.Unmarshal(j, &m)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m["datasource_name"] = datasourceName
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result, message, m
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func ReadESDoc(datasourceCode string, orgIDs []string, page int, begin string, conditions map[string]interface{}, sort map[string]interface{}) (bool, string, []map[string]interface{}) {
|
|
|
|
func ReadESDoc(datasourceCode string, orgIDs []string, page int, begin string, conditions map[string]interface{}, sort map[string]interface{}) (bool, string, []map[string]interface{}) {
|
|
|
|
result, message, esdata := ES7Util.SearchDocPage(datasourceCode, orgIDs, page, begin, conditions, sort)
|
|
|
|
result, message, esdata := ES7Util.SearchDocPage(datasourceCode, orgIDs, page, begin, conditions, sort)
|
|
|
|
var query = "AND datasource_code='" + datasourceCode + "'"
|
|
|
|
var query = "AND datasource_code='" + datasourceCode + "'"
|
|
|
|