|
@@ -2356,40 +2356,43 @@ func (this *ReportController) SearchResource() {
|
|
|
br.ErrMsg = "获取标的信息失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+ industrialIdArr := make([]int, 0)
|
|
|
for k, v := range listHz {
|
|
|
listHz[k].Source = 1
|
|
|
- for _, v2 := range listSubjcet {
|
|
|
- if v2.IndustrialManagementId == v.IndustrialManagementId {
|
|
|
- listHz[k].IndustrialSubjectList = append(listHz[k].IndustrialSubjectList, v2)
|
|
|
- }
|
|
|
- }
|
|
|
if fllowMap[v.IndustrialManagementId] > 0 {
|
|
|
listHz[k].IsFollw = true
|
|
|
}
|
|
|
+ industrialIdArr = append(industrialIdArr, v.IndustrialManagementId)
|
|
|
}
|
|
|
- var IndustrialManagementIdStr string
|
|
|
+
|
|
|
for k, v := range listYx {
|
|
|
listYx[k].Source = 2
|
|
|
- IndustrialManagementIdStr += "," + strconv.Itoa(v.IndustrialManagementId)
|
|
|
if fllowMap[v.IndustrialManagementId] > 0 {
|
|
|
listYx[k].IsFollw = true
|
|
|
}
|
|
|
+ industrialIdArr = append(industrialIdArr, v.IndustrialManagementId)
|
|
|
}
|
|
|
- IndustrialManagementIdStr = strings.TrimLeft(IndustrialManagementIdStr, ",")
|
|
|
- if IndustrialManagementIdStr != "" {
|
|
|
+
|
|
|
+ if len(industrialIdArr) > 0 {
|
|
|
//合并产业关联的标的
|
|
|
- condition = ` AND mg.article_id IN (SELECT mg.article_id FROM cygx_industrial_article_group_management as mg
|
|
|
- INNER JOIN cygx_article as a ON a.article_id = mg.article_id AND article_type != 'lyjh' WHERE mg.industrial_management_id IN (` + IndustrialManagementIdStr + `) AND mg.article_id >= ` + strconv.Itoa(utils.SummaryArticleId) + ` )`
|
|
|
- listSubjcet, err = models.GetThemeHeatSubjectList(condition)
|
|
|
+ listSubjcet, err = models.GetIndustrialSubjectAllByIndustrialId(industrialIdArr)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取信息失败"
|
|
|
br.ErrMsg = "获取标的信息失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- for k, v := range listYx {
|
|
|
- for _, v2 := range listSubjcet {
|
|
|
- if v2.IndustrialManagementId == v.IndustrialManagementId {
|
|
|
- listYx[k].IndustrialSubjectList = append(listYx[k].IndustrialSubjectList, v2)
|
|
|
+ mapIndustrial := make(map[string]int)
|
|
|
+ for _, v := range listSubjcet {
|
|
|
+ for k2, v2 := range listYx {
|
|
|
+ if v2.IndustrialManagementId == v.IndustrialManagementId && mapIndustrial[fmt.Sprint(v2.IndustrialManagementId, "Yx", v.SubjectName)] == 0 {
|
|
|
+ listYx[k2].IndustrialSubjectList = append(listYx[k2].IndustrialSubjectList, v)
|
|
|
+ mapIndustrial[fmt.Sprint(v2.IndustrialManagementId, "Yx", v.SubjectName)] = v2.IndustrialManagementId
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for k2, v2 := range listHz {
|
|
|
+ if v2.IndustrialManagementId == v.IndustrialManagementId && mapIndustrial[fmt.Sprint(v2.IndustrialManagementId, "Hz", v.SubjectName)] == 0 {
|
|
|
+ listHz[k2].IndustrialSubjectList = append(listHz[k2].IndustrialSubjectList, v)
|
|
|
+ mapIndustrial[fmt.Sprint(v2.IndustrialManagementId, "Hz", v.SubjectName)] = v2.IndustrialManagementId
|
|
|
}
|
|
|
}
|
|
|
}
|