From ad250a8998c518d3103fe3fabe9397e7650b0179 Mon Sep 17 00:00:00 2001 From: wangshuai Date: Mon, 21 Sep 2020 10:25:42 +0800 Subject: [PATCH] 'commit' --- .../MyService/DataEX/DataexDAO/DataexDAO.go | 41 ++++++++++++++- .../Utils/ValidationUtil/ValidationUtil.go | 50 +++++++++++++++---- .../DataAccess/DataaccessDAO/DataaccessDAO.go | 16 ++++++ .../DataaccessService/DataaccessService.go | 30 +++++++---- .../DataSource/DatasourceDAO/DatasourceDAO.go | 10 ++-- .../DatasourceOpenAPI/DatasourceOpenAPI.go | 5 ++ .../DatasourceService/DatasourceService.go | 46 +++++++++++------ .../MetaData/MetadataDAO/MetadataDAO.go | 12 ++--- .../MetadataService/MetadataService.go | 28 ++++++----- .../OrgTree/OrgtreeService/OrgtreeService.go | 27 ++++++---- 10 files changed, 193 insertions(+), 72 deletions(-) diff --git a/dsDataex/MyService/DataEX/DataexDAO/DataexDAO.go b/dsDataex/MyService/DataEX/DataexDAO/DataexDAO.go index fd89d439..ca4bb6ff 100644 --- a/dsDataex/MyService/DataEX/DataexDAO/DataexDAO.go +++ b/dsDataex/MyService/DataEX/DataexDAO/DataexDAO.go @@ -399,7 +399,20 @@ func SaveDataError2(fails []MySwagger.FailResult,datas []MySwagger.Data ,SystemI * @Return error 错误信息 */ func GetMetadataResults(conditions string) (bool, string, int, []map[string]interface{}, error) { - sql := "SELECT * FROM t_dataex_metadata WHERE 1 = 1" + conditions + " ORDER BY create_time DESC, change_time DESC" + sql := "SELECT * FROM t_dataex_metadata WHERE 1 = 1 AND " + conditions + " AND eneble_flag = 1 ORDER BY create_time DESC, change_time DESC" + //数据条数 + count, _ := DbUtil.Engine.SQL(sql).Query().Count() + //分页数据 + list, err := DbUtil.Engine.SQL(sql).Query().List() + if list != nil { + return true, "数据获取成功", count, list, err + } else { + return false, "数据获取失败,数据源不存在", count, nil, nil + } +} + +func GetDicIdsFromMetadata(conditions string) (bool, string, int, []map[string]interface{}, error) { + sql := "SELECT dic_id FROM t_dataex_metadata WHERE 1 = 1 AND " + conditions + " AND dic_id != '' AND eneble_flag = 1 ORDER BY create_time DESC, change_time DESC" //数据条数 count, _ := DbUtil.Engine.SQL(sql).Query().Count() //分页数据 @@ -427,4 +440,30 @@ func GetJyt2012CountByParentIdAndDicValue(parentId string, dicValue string) int6 LogUtil.Error(ErrorConst.SqlQueryError, "数据库操作错误:"+err.Error()) } return total +} + +func GetJyt2012ResultsByParentId(parentId string) (bool, string, int, []map[string]interface{}, error) { + sql := "SELECT * FROM t_dataex_jyt2012 WHERE parent_id ='" + parentId + "' ORDER BY create_time DESC, change_time DESC" + //数据条数 + count, _ := DbUtil.Engine.SQL(sql).Query().Count() + if count > 0 { + //分页数据 + list, err := DbUtil.Engine.SQL(sql).Query().List() + return true, "数据获取成功", count, list, err + } else { + return false, "数据获取失败,数据源不存在", count, nil, nil + } +} + +func GetJyt2012ResultsByParentIds(parentIds string) (bool, string, int, []map[string]interface{}, error) { + sql := "SELECT * FROM t_dataex_jyt2012 WHERE parent_id IN " + parentIds + " ORDER BY create_time DESC, change_time DESC" + //数据条数 + count, _ := DbUtil.Engine.SQL(sql).Query().Count() + if count > 0 { + //分页数据 + list, err := DbUtil.Engine.SQL(sql).Query().List() + return true, "数据获取成功", count, list, err + } else { + return false, "数据获取失败,数据源不存在", count, nil, nil + } } \ No newline at end of file diff --git a/dsDataex/Utils/ValidationUtil/ValidationUtil.go b/dsDataex/Utils/ValidationUtil/ValidationUtil.go index 08fcb598..de7585c2 100644 --- a/dsDataex/Utils/ValidationUtil/ValidationUtil.go +++ b/dsDataex/Utils/ValidationUtil/ValidationUtil.go @@ -9,6 +9,12 @@ import ( "strings" ) +// +//type dictionary struct { +// dics map[string]map[string]interface{} // 机构名称 +//} +var dics []map[string]interface{} + /** * @title ValidESDataContent * @Description 校验ESDataContent @@ -29,11 +35,25 @@ func ValidESDataContent(datasourceCode string, datas []MySwagger.Data) (bool, st var conditions string var esData DataEX.ESData var r bool + var dicIds []string + var dicIdsStr string - conditions = " AND datasource_id='" + datasourceCode + "'" + conditions = "datasource_id='" + datasourceCode + "'" + // 从元数据集合获取该数据源对应的含有字典ID的字典ID集合 + //res, _, _, metadataDicIds, _ := DataexDAO.GetMetadataResults(conditions) + //if res == true { + // + //} // 获取该数据源对应的元数据集合 result, _, _, metadatas, _ := DataexDAO.GetMetadataResults(conditions) if result == true { + //dic := make(map[string]interface{}) + for _, vv := range metadatas { + dicIds = append(dicIds, "'" + vv["dic_id"].(string) + "'") + } + dicIdsStr = strings.Join(dicIds, ", ") + _, _, _, dics, _ = DataexDAO.GetJyt2012ResultsByParentIds(dicIdsStr) + for no := 0; no < len(datas) && no < 1000; no++ { r = true var jsonData map[string]interface{} @@ -81,7 +101,7 @@ func ValidESDataContent(datasourceCode string, datas []MySwagger.Data) (bool, st */ func ValidESDataContentItem(dataContentItem map[string]interface{}, itemName string, itemValue interface{}) (bool, string, error) { if dataContentItem != nil { - dicId := dataContentItem["dic_id"] + dicId := dataContentItem["dic_id"].(string) itemLength := dataContentItem["item_length"].(int64) checkName := dataContentItem["check_name"].(int64) checkDic := dataContentItem["check_dic"].(int64) @@ -98,7 +118,7 @@ func ValidESDataContentItem(dataContentItem map[string]interface{}, itemName str } else if checkName > 0 { // 校验名称 return true, "ok", nil } else if checkDic > 0 { // 校验字典 - if CheckDic(dicId.(string), itemValue) == false { + if CheckDic(itemValue, dicId, dics) == false { return false, "字典检测不通过", nil } else { return true, "ok", nil @@ -130,13 +150,15 @@ func ValidESDataContentItem(dataContentItem map[string]interface{}, itemName str * @Param itemValue interface{} 字典项值 * @Return bool 校验是否通过 */ -func CheckDic(dicId string, itemValue interface{}) bool { - total := DataexDAO.GetJyt2012CountByParentIdAndDicValue(dicId, itemValue.(string)) - if total > 0 { - return true - } else { - return false +func CheckDic(itemValue interface{}, dicId string, dics []map[string]interface{}) bool { + flag := false + for _, v := range dics { + if v["dic_value"] == itemValue && v["parent_id"] == dicId { + flag = true + } } + + return flag } // 暂时作废 2020-09-16 @@ -165,3 +187,13 @@ func ValidESDataContentBak(datasourceCode string, dataContent map[string]interfa return r, fails } + +// 暂时作废 2020-09-18 +func CheckDicBak(dicId string, itemValue interface{}) bool { + total := DataexDAO.GetJyt2012CountByParentIdAndDicValue(dicId, itemValue.(string)) + if total > 0 { + return true + } else { + return false + } +} diff --git a/dsSupport/MyModel/DataAccess/DataaccessDAO/DataaccessDAO.go b/dsSupport/MyModel/DataAccess/DataaccessDAO/DataaccessDAO.go index 377d48e0..a41818c3 100644 --- a/dsSupport/MyModel/DataAccess/DataaccessDAO/DataaccessDAO.go +++ b/dsSupport/MyModel/DataAccess/DataaccessDAO/DataaccessDAO.go @@ -133,3 +133,19 @@ func RemoveDataaccess(id string, model *models.TDataexDataaccess) (bool, string, } return true, "删除成功!", nil } + +func GetDataaccessCountByDatasourceCodeAndConsumeSystemId(datasourceCode string, consumeSystemId string) int64 { + business := new(models.TDataexDataaccess) + total, err := db.Where("datasource_code =? and consume_systemid =?", datasourceCode, consumeSystemId).Count(business) + if err != nil { + LogUtil.Error(ErrorConst.SqlQueryError, "数据库操作发生严重错误:"+err.Error()) + } + return total +} + +func IsDataaccessExistsByDatasourceCodeAndConsumeSystemId(datasourceCode string, consumeSystemId string) bool { + if GetDataaccessCountByDatasourceCodeAndConsumeSystemId(datasourceCode, consumeSystemId) > 0 { + return true + } + return false +} diff --git a/dsSupport/MyModel/DataAccess/DataaccessService/DataaccessService.go b/dsSupport/MyModel/DataAccess/DataaccessService/DataaccessService.go index 8a7b12c5..67ef60a1 100644 --- a/dsSupport/MyModel/DataAccess/DataaccessService/DataaccessService.go +++ b/dsSupport/MyModel/DataAccess/DataaccessService/DataaccessService.go @@ -4,9 +4,8 @@ import ( "dsSupport/MyModel/AccessSystem/AccessSystemDao" "dsSupport/MyModel/DataAccess/DataaccessDAO" "dsSupport/MyModel/DataSource/DatasourceDAO" - "dsSupport/MyModel/DataSource/DatasourceService" "dsSupport/MyModel/MySwagger" - "dsSupport/MyModel/OrgTree/OrgtreeService" + "dsSupport/MyModel/OrgTree/OrgtreeDAO" "dsSupport/Utils/CacheUtil" "dsSupport/Utils/CommonUtil" "dsSupport/models" @@ -104,15 +103,22 @@ func GetDataaccessResults(swag MySwagger.DataaccessSwag) (bool, string, int, []m * @Return error 错误信息 */ func CreateDataaccess(model models.TDataexDataaccess) (bool, string, error) { - if !DatasourceService.IsDatasourceExistsById(model.DatasourceId) { - return false, "DatasourceId不存在", nil + // 校验数据源编码是否存在 + if !DatasourceDAO.IsDatasourceExistsByCode(html.EscapeString(model.DatasourceCode)) { + return false, "数据源编码不存在", nil } + // 校验数据使用系统是否存在 _, e := AccessSystemDao.GetApp(model.ConsumeSystemid) if e != nil { - return false, "SystemId不存在", nil + return false, "数据使用系统不存在", nil + } + // 校验数据源订阅是否存在 + if DataaccessDAO.IsDataaccessExistsByDatasourceCodeAndConsumeSystemId(html.EscapeString(model.DatasourceCode), html.EscapeString(model.ConsumeSystemid)) { + return false, "数据源订阅已存在", nil } - if !OrgtreeService.IsOrgtreeExistsById(model.ConsumeOrgid) { - return false, "OrgId不存在", nil + // 校验机构是否存在 + if !OrgtreeDAO.IsOrgtreeExistsById(model.ConsumeOrgid) { + return false, "机构不存在", nil } business := new(models.TDataexDataaccess) @@ -145,15 +151,17 @@ func CreateDataaccess(model models.TDataexDataaccess) (bool, string, error) { * @Return error 错误信息 */ func UpdateDataaccess(id string, model models.TDataexDataaccess) (bool, string, error) { - if !DatasourceService.IsDatasourceExistsById(model.DatasourceId) { - return false, "DatasourceId不存在", nil + // 校验数据源编码是否存在 + if !DatasourceDAO.IsDatasourceExistsByCode(html.EscapeString(model.DatasourceCode)) { + return false, "数据源编码不存在", nil } _, e := AccessSystemDao.GetApp(model.ConsumeSystemid) if e != nil { return false, "SystemId不存在", nil } - if !OrgtreeService.IsOrgtreeExistsById(model.ConsumeOrgid) { - return false, "OrgId不存在", nil + // 校验机构是否存在 + if !OrgtreeDAO.IsOrgtreeExistsById(model.ConsumeOrgid) { + return false, "机构不存在", nil } business := new(models.TDataexDataaccess) diff --git a/dsSupport/MyModel/DataSource/DatasourceDAO/DatasourceDAO.go b/dsSupport/MyModel/DataSource/DatasourceDAO/DatasourceDAO.go index 07fb7c7c..b97567b5 100644 --- a/dsSupport/MyModel/DataSource/DatasourceDAO/DatasourceDAO.go +++ b/dsSupport/MyModel/DataSource/DatasourceDAO/DatasourceDAO.go @@ -79,17 +79,17 @@ func RemoveDatasource(id string, model *models.TDataexDatasource) (bool, string, return true, "删除成功!", nil } -func GetDatasourceCountById(id string) int64 { +func GetDatasourceCountByCode(code string) int64 { business := new(models.TDataexDatasource) - total, err := db.Where("id =?", id).Count(business) + total, err := db.Where("code =?", code).Count(business) if err != nil { - LogUtil.Error(ErrorConst.SqlUpdateError, "接入系统authToken Update,数据库操作发生严重错误:"+err.Error()) + LogUtil.Error(ErrorConst.SqlQueryError, "数据库操作发生严重错误:"+err.Error()) } return total } -func IsDatasourceExistsById(id string) bool { - if GetDatasourceCountById(id) > 0 { +func IsDatasourceExistsByCode(code string) bool { + if GetDatasourceCountByCode(code) > 0 { return true } return false diff --git a/dsSupport/MyModel/DataSource/DatasourceOpenAPI/DatasourceOpenAPI.go b/dsSupport/MyModel/DataSource/DatasourceOpenAPI/DatasourceOpenAPI.go index 689b5402..2027cc77 100644 --- a/dsSupport/MyModel/DataSource/DatasourceOpenAPI/DatasourceOpenAPI.go +++ b/dsSupport/MyModel/DataSource/DatasourceOpenAPI/DatasourceOpenAPI.go @@ -100,6 +100,11 @@ func CreateDatasource(c *gin.Context) { return } + if raw.DatasourceCode == "" { + c.JSON(http.StatusBadRequest, MySwagger.Result{Success: false, Message: "数据源编码必填"}) + return + } + success, message, _ := DatasourceService.CreateDatasource(raw) if success { c.JSON(http.StatusOK, MySwagger.Result{ diff --git a/dsSupport/MyModel/DataSource/DatasourceService/DatasourceService.go b/dsSupport/MyModel/DataSource/DatasourceService/DatasourceService.go index 9f3c1798..9bd9e913 100644 --- a/dsSupport/MyModel/DataSource/DatasourceService/DatasourceService.go +++ b/dsSupport/MyModel/DataSource/DatasourceService/DatasourceService.go @@ -4,7 +4,7 @@ import ( "dsSupport/MyModel/AccessSystem/AccessSystemDao" "dsSupport/MyModel/DataSource/DatasourceDAO" "dsSupport/MyModel/MySwagger" - "dsSupport/MyModel/OrgTree/OrgtreeService" + "dsSupport/MyModel/OrgTree/OrgtreeDAO" "dsSupport/Utils/CacheUtil" "dsSupport/Utils/CommonUtil" "dsSupport/Utils/ES7Util" @@ -111,12 +111,18 @@ func GetDatasourceResults(swag MySwagger.DatasourceSwag) (bool, string, int, []m * @Return error 错误信息 */ func CreateDatasource(model models.TDataexDatasource) (bool, string, error) { + // 校验数据提供系统是否存在 _, e := AccessSystemDao.GetApp(model.SystemId) if e != nil { - return false, "SystemId不存在", nil + return false, "数据提供系统不存在", nil } - if !OrgtreeService.IsOrgtreeExistsById(model.ProvideOrgid) { - return false, "OrgId不存在", nil + // 校验机构是否存在 + if !OrgtreeDAO.IsOrgtreeExistsById(model.ProvideOrgid) { + return false, "机构不存在", nil + } + // 校验数据源编码是否存在 + if DatasourceDAO.IsDatasourceExistsByCode(html.EscapeString(model.DatasourceCode)) { + return false, "数据源编码已存在", nil } business := new(models.TDataexDatasource) business.Id = CommonUtil.GetUUID() @@ -140,8 +146,16 @@ func CreateDatasource(model models.TDataexDatasource) (bool, string, error) { } func UpdateDatasource(id string, model models.TDataexDatasource) (bool, string, error) { + // 校验数据提供系统是否存在 + _, e := AccessSystemDao.GetApp(model.SystemId) + if e != nil { + return false, "数据提供系统不存在", nil + } + // 校验机构是否存在 + if !OrgtreeDAO.IsOrgtreeExistsById(model.ProvideOrgid) { + return false, "机构不存在", nil + } business := new(models.TDataexDatasource) - //清除Redis缓存 var ids = []string{id} var selector = CacheUtil.GetBean("t_dataex_datasource") @@ -227,14 +241,14 @@ func ReadESDoc(datasourceCode string, orgIDs []string, page int, begin string, c return result, message, count, esDatas } -func IsDatasourceExistsById(id string) bool { - result := DatasourceDAO.IsDatasourceExistsById(id) - - return result -} - -func GetDatasourceIdByCode(code string) (bool, string, interface{}, error) { - result, message, data, err := DatasourceDAO.GetDatasourceIdByCode(code) - - return result, message, data, err -} +//func IsDatasourceExistsByCode(code string) bool { +// result := DatasourceDAO.IsDatasourceExistsByCode(code) +// +// return result +//} +// +//func GetDatasourceIdByCode(code string) (bool, string, interface{}, error) { +// result, message, data, err := DatasourceDAO.GetDatasourceIdByCode(code) +// +// return result, message, data, err +//} diff --git a/dsSupport/MyModel/MetaData/MetadataDAO/MetadataDAO.go b/dsSupport/MyModel/MetaData/MetadataDAO/MetadataDAO.go index a504b63b..2090ec12 100644 --- a/dsSupport/MyModel/MetaData/MetadataDAO/MetadataDAO.go +++ b/dsSupport/MyModel/MetaData/MetadataDAO/MetadataDAO.go @@ -71,24 +71,24 @@ func RemoveMetadata(id string, model *models.TDataexMetadata) (bool, string, err return true, "删除成功!", nil } -func GetMetadataCountByDatasourceId(datasourceId string) int64 { +func GetMetadataCountByDatasourceCode(datasourceCode string) int64 { business := new(models.TDataexMetadata) - total, err := db.Where("datasource_id =?", datasourceId).Count(business) + total, err := db.Where("datasource_id =?", datasourceCode).Count(business) if err != nil { LogUtil.Error(ErrorConst.SqlQueryError, "数据库操作发生严重错误:"+err.Error()) } return total } -func IsMetadataExistsByDatasourceId(datasourceId string) bool { - if GetMetadataCountByDatasourceId(datasourceId) > 0 { +func IsMetadataExistsByDatasourceCode(datasourceCode string) bool { + if GetMetadataCountByDatasourceCode(datasourceCode) > 0 { return true } return false } -func DeleteMetadataByDatasourceId(datasourceId string) (bool, string, error) { - _, err := db.Exec("DELETE FROM t_dataex_metadata WHERE datasource_id = ?", datasourceId) +func DeleteMetadataByDatasourceCode(datasourceCode string) (bool, string, error) { + _, err := db.Exec("DELETE FROM t_dataex_metadata WHERE datasource_id = ?", datasourceCode) if err != nil { LogUtil.Error(ErrorConst.SqlQueryError, "数据库操作发生严重错误:"+err.Error()) return false, "数据库操作失败", err diff --git a/dsSupport/MyModel/MetaData/MetadataService/MetadataService.go b/dsSupport/MyModel/MetaData/MetadataService/MetadataService.go index c2c299f0..86981f11 100644 --- a/dsSupport/MyModel/MetaData/MetadataService/MetadataService.go +++ b/dsSupport/MyModel/MetaData/MetadataService/MetadataService.go @@ -1,8 +1,8 @@ package MetadataService import ( - "dsSupport/MyModel/DataSource/DatasourceService" - "dsSupport/MyModel/JYT2012/Jyt2012Service" + "dsSupport/MyModel/DataSource/DatasourceDAO" + "dsSupport/MyModel/JYT2012/Jyt2012DAO" "dsSupport/MyModel/MetaData/MetadataDAO" "dsSupport/MyModel/MySwagger" "dsSupport/Utils/CacheUtil" @@ -81,11 +81,12 @@ func GetMetadataResults(swag MySwagger.MetadataSwag) (bool, string, int, []map[s } func CreateMetadata(model models.TDataexMetadata) (bool, string, error) { - if !DatasourceService.IsDatasourceExistsById(model.DatasourceId) { - return false, "DatasourceId不存在", nil + // 校验数据源编码是否存在 + if !DatasourceDAO.IsDatasourceExistsByCode(html.EscapeString(model.DatasourceId)) { + return false, "数据源编码不存在", nil } - if !Jyt2012Service.IsJyt2012ExistsById(model.DicId) { - return false, "DicId不存在", nil + if !Jyt2012DAO.IsJyt2012ExistsById(model.DicId) { + return false, "该字典不存在", nil } business := new(models.TDataexMetadata) business.Id = CommonUtil.GetUUID() @@ -110,11 +111,12 @@ func CreateMetadata(model models.TDataexMetadata) (bool, string, error) { } func UpdateMetadata(id string, model models.TDataexMetadata) (bool, string, error) { - if !DatasourceService.IsDatasourceExistsById(model.DatasourceId) { - return false, "DatasourceId不存在", nil + // 校验数据源编码是否存在 + if !DatasourceDAO.IsDatasourceExistsByCode(html.EscapeString(model.DatasourceId)) { + return false, "数据源编码不存在", nil } - if !Jyt2012Service.IsJyt2012ExistsById(model.DicId) { - return false, "DicId不存在", nil + if !Jyt2012DAO.IsJyt2012ExistsById(model.DicId) { + return false, "该字典不存在", nil } business := new(models.TDataexMetadata) @@ -162,10 +164,10 @@ func RemoveMetadata(id string) (bool, string, error) { } func CreateMetadataES(indexName string) (bool, string, error) { - res, _, datasourceId, _ := DatasourceService.GetDatasourceIdByCode(indexName) + res, _, datasourceId, _ := DatasourceDAO.GetDatasourceIdByCode(indexName) if res == true { - if MetadataDAO.IsMetadataExistsByDatasourceId(datasourceId.(string)) == true { - MetadataDAO.DeleteMetadataByDatasourceId(datasourceId.(string)) + if MetadataDAO.IsMetadataExistsByDatasourceCode(datasourceId.(string)) == true { + MetadataDAO.DeleteMetadataByDatasourceCode(datasourceId.(string)) } fmt.Println("datasourceId: ", datasourceId) result := ES7Util.IndexDataContentMapping(indexName) diff --git a/dsSupport/MyModel/OrgTree/OrgtreeService/OrgtreeService.go b/dsSupport/MyModel/OrgTree/OrgtreeService/OrgtreeService.go index b3007385..0bb8160f 100644 --- a/dsSupport/MyModel/OrgTree/OrgtreeService/OrgtreeService.go +++ b/dsSupport/MyModel/OrgTree/OrgtreeService/OrgtreeService.go @@ -1,6 +1,7 @@ package OrgtreeService import ( + "dsSupport/MyModel/AccessSystem/AccessSystemDao" //"dsSupport/MyModel/LinkSystem/LinksystemService" "dsSupport/MyModel/MySwagger" "dsSupport/MyModel/OrgTree/OrgtreeDAO" @@ -74,9 +75,11 @@ func GetOrgtreeResults(swag MySwagger.OrgtreeSwag) (bool, string, int, []map[str } func CreateOrgtree(model models.TDataexOrgtree) (bool, string, error) { - //if ! LinksystemService.IsLinksystemExistsById(model.LinksystemId) { - // return false, "SystemId不存在", nil - //} + // 校验源业务系统是否存在 + _, e := AccessSystemDao.GetApp(model.LinksystemId) + if e != nil { + return false, "源业务系统不存在", nil + } business := new(models.TDataexOrgtree) business.Id = CommonUtil.GetUUID() business.OrgName = html.EscapeString(model.OrgName) @@ -98,9 +101,11 @@ func CreateOrgtree(model models.TDataexOrgtree) (bool, string, error) { } func UpdateOrgtree(id string, model models.TDataexOrgtree) (bool, string, error) { - //if ! LinksystemService.IsLinksystemExistsById(model.LinksystemId) { - // return false, "SystemId不存在", nil - //} + // 校验源业务系统是否存在 + _, e := AccessSystemDao.GetApp(model.LinksystemId) + if e != nil { + return false, "源业务系统不存在", nil + } business := new(models.TDataexOrgtree) business.Id = html.EscapeString(id) business.OrgName = html.EscapeString(model.OrgName) @@ -139,8 +144,8 @@ func RemoveOrgtree(id string) (bool, string, error) { return result, message, error } -func IsOrgtreeExistsById(id string) bool { - result := OrgtreeDAO.IsOrgtreeExistsById(id) - - return result -} +//func IsOrgtreeExistsById(id string) bool { +// result := OrgtreeDAO.IsOrgtreeExistsById(id) +// +// return result +//}