|
@@ -217,7 +217,10 @@ func (c *DataSourceController) SearchByEs() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- // 分类的唯一编码(前端定位用)
|
|
|
|
|
|
+ // 个别数据源需要统一唯一编码前端定位用
|
|
|
|
+ if primaryIdKey == "" {
|
|
|
|
+ primaryIdKey = "Id"
|
|
|
|
+ }
|
|
if classifyIdKey == "" {
|
|
if classifyIdKey == "" {
|
|
classifyIdKey = "ClassifyId"
|
|
classifyIdKey = "ClassifyId"
|
|
}
|
|
}
|
|
@@ -228,10 +231,14 @@ func (c *DataSourceController) SearchByEs() {
|
|
for _, v := range listMap {
|
|
for _, v := range listMap {
|
|
classifyId, ok := v[classifyIdKey].(int)
|
|
classifyId, ok := v[classifyIdKey].(int)
|
|
if !ok {
|
|
if !ok {
|
|
- v["ClassifyUniqueCode"] = ""
|
|
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+ id, ok := v[primaryIdKey].(int)
|
|
|
|
+ if !ok {
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
v["ClassifyUniqueCode"] = strconv.Itoa(classifyId)
|
|
v["ClassifyUniqueCode"] = strconv.Itoa(classifyId)
|
|
|
|
+ v["UniqueCode"] = fmt.Sprintf("%d_%d", classifyId, id)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//if source == utils.DATA_SOURCE_MANUAL {
|
|
//if source == utils.DATA_SOURCE_MANUAL {
|