f
This commit is contained in:
@@ -752,6 +752,50 @@ func buildFinalResponse(enrichedCompanies []EnrichedCompanyInfo, allCompanies []
|
|||||||
companyMap["stockHolderItem"] = stockHolderItem
|
companyMap["stockHolderItem"] = stockHolderItem
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// staffList(仅高管关系时整理)
|
||||||
|
if hasRel("tm") {
|
||||||
|
staffList := map[string]interface{}{
|
||||||
|
"result": []interface{}{},
|
||||||
|
}
|
||||||
|
// 尝试从原始数据中提取职位信息
|
||||||
|
typeJoin := []string{}
|
||||||
|
// 常见职位字段名
|
||||||
|
if v := getVal("position", "post", "positionName", "postName"); v != nil {
|
||||||
|
if posStr, ok := v.(string); ok && posStr != "" {
|
||||||
|
typeJoin = append(typeJoin, posStr)
|
||||||
|
} else if posArr, ok := v.([]interface{}); ok {
|
||||||
|
for _, p := range posArr {
|
||||||
|
if pStr, ok := p.(string); ok && pStr != "" {
|
||||||
|
typeJoin = append(typeJoin, pStr)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 如果 typeJoin 为空,尝试从 typeJoin 字段直接获取
|
||||||
|
if len(typeJoin) == 0 {
|
||||||
|
if v := getVal("typeJoin"); v != nil {
|
||||||
|
if tjArr, ok := v.([]interface{}); ok {
|
||||||
|
for _, tj := range tjArr {
|
||||||
|
if tjStr, ok := tj.(string); ok && tjStr != "" {
|
||||||
|
typeJoin = append(typeJoin, tjStr)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if tjStr, ok := v.(string); ok && tjStr != "" {
|
||||||
|
typeJoin = append(typeJoin, tjStr)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 如果有职位信息,添加到 result
|
||||||
|
if len(typeJoin) > 0 {
|
||||||
|
staffList["result"] = []interface{}{
|
||||||
|
map[string]interface{}{
|
||||||
|
"typeJoin": typeJoin,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
companyMap["staffList"] = staffList
|
||||||
|
}
|
||||||
|
|
||||||
// 检查是否是已处理的企业(前3个)
|
// 检查是否是已处理的企业(前3个)
|
||||||
if enriched, exists := processedMap[company.Index]; exists {
|
if enriched, exists := processedMap[company.Index]; exists {
|
||||||
// 已处理的企业,添加详细信息
|
// 已处理的企业,添加详细信息
|
||||||
|
|||||||
Reference in New Issue
Block a user