|
@@ -711,7 +711,6 @@ func (this *ReportController) IndustryListByDepartment() {
|
|
|
} else {
|
|
|
artList[k2].IndustryName = "【纪要】" + artList[k2].IndustryName
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
list[k].List = artList
|
|
|
if v.FollowNum > 0 {
|
|
@@ -724,24 +723,44 @@ func (this *ReportController) IndustryListByDepartment() {
|
|
|
br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
if len(listnNew) > 0 {
|
|
|
for _, v := range listnNew {
|
|
|
+ total, err := models.GetIndustrialManagementSubjectCount(v.IndustrialManagementId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取关联标的总数失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
Management := new(models.IndustrialManagementIdInt)
|
|
|
- //fmt.Println(v)
|
|
|
- if v.SubjectNames != "" {
|
|
|
+ if total == 0 {
|
|
|
+ Management.IndustryName = v.IndustryName
|
|
|
+ } else {
|
|
|
+ listSub, err := models.GetIndustrialManagementSubjectList(v.IndustrialManagementId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取关联标的列表失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
var subjectNamesNew string
|
|
|
- slice := strings.Split(v.SubjectNames, ",")
|
|
|
- for k1, v1 := range slice {
|
|
|
- if k1 < 4 && k1 < len(slice)-1 {
|
|
|
- subjectNamesNew += v1 + "/"
|
|
|
- }
|
|
|
+ for _, v1 := range listSub {
|
|
|
+ subjectNamesNew += v1.SubjectName + "/"
|
|
|
}
|
|
|
subjectNamesNew = strings.TrimRight(subjectNamesNew, "/")
|
|
|
Management.IndustryName = subjectNamesNew
|
|
|
- } else {
|
|
|
- Management.IndustryName = v.IndustryName
|
|
|
}
|
|
|
+ //if v.SubjectNames != "" {
|
|
|
+ // var subjectNamesNew string
|
|
|
+ // slice := strings.Split(v.SubjectNames, ",")
|
|
|
+ // for k1, v1 := range slice {
|
|
|
+ // if k1 < 4 && k1 < len(slice)-1 {
|
|
|
+ // subjectNamesNew += v1 + "/"
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // subjectNamesNew = strings.TrimRight(subjectNamesNew, "/")
|
|
|
+ // Management.IndustryName = subjectNamesNew
|
|
|
+ //} else {
|
|
|
+ // Management.IndustryName = v.IndustryName
|
|
|
+ //}
|
|
|
Management.IndustrialManagementId = v.IndustrialManagementId
|
|
|
resp.ListnNew = append(resp.ListnNew, Management)
|
|
|
}
|