|
@@ -123,6 +123,10 @@ func (this *ReportSelectionController) PreserveAndPublish() {
|
|
item.IndustrialSubjectId = v.IndustrialSubjectId
|
|
item.IndustrialSubjectId = v.IndustrialSubjectId
|
|
item.SubjectName = v.IndustrialSubjectName
|
|
item.SubjectName = v.IndustrialSubjectName
|
|
item.IndustrialManagementId = v.IndustrialManagementId
|
|
item.IndustrialManagementId = v.IndustrialManagementId
|
|
|
|
+ item.IndustrialManagementNames = v.IndustrialManagementName
|
|
|
|
+ if v.IndustrialManagementNames != "" {
|
|
|
|
+ item.IndustrialManagementNames = v.IndustrialManagementNames
|
|
|
|
+ }
|
|
item.OverviewArticleId = v.OverviewArticleId
|
|
item.OverviewArticleId = v.OverviewArticleId
|
|
item.IsNew = v.IsNew
|
|
item.IsNew = v.IsNew
|
|
item.IsShowOverviewArticle = v.IsShowOverviewArticle
|
|
item.IsShowOverviewArticle = v.IsShowOverviewArticle
|
|
@@ -394,23 +398,35 @@ func (this *ReportSelectionController) Detail() {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
for kIndustrial, vIndustrial := range listSon {
|
|
for kIndustrial, vIndustrial := range listSon {
|
|
|
|
+ var industrialNames string
|
|
//如果报告精选关联的产业被删除了 则做以下处理
|
|
//如果报告精选关联的产业被删除了 则做以下处理
|
|
- //if vIndustrial.IndustrialManagementName == "" {
|
|
|
|
- industrialNames, err := cygx.GetindustrialManagementNamesBySubjectName(vIndustrial.IndustrialSubjectName, vIndustrial.ChartPermissionId)
|
|
|
|
- if err != nil {
|
|
|
|
- br.Msg = "获取失败!"
|
|
|
|
- br.ErrMsg = "获取删除删除之后的产业失败,Err:" + err.Error() + vIndustrial.IndustrialSubjectId
|
|
|
|
- return
|
|
|
|
|
|
+ if vIndustrial.IndustrialSubjectName == "" {
|
|
|
|
+ industrialNames = vIndustrial.IndustrialManagementNames
|
|
|
|
+ } else {
|
|
|
|
+ industrialNames, err = cygx.GetindustrialManagementNamesBySubjectName(vIndustrial.IndustrialSubjectName, vIndustrial.ChartPermissionId)
|
|
|
|
+ if err != nil {
|
|
|
|
+ br.Msg = "获取失败!"
|
|
|
|
+ br.ErrMsg = "获取删除删除之后的产业失败,Err:" + err.Error() + vIndustrial.IndustrialSubjectId
|
|
|
|
+ return
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
if vIndustrial.Label != "" {
|
|
if vIndustrial.Label != "" {
|
|
vIndustrial.CompanyLabel = strings.Split(vIndustrial.Label, "{|}")
|
|
vIndustrial.CompanyLabel = strings.Split(vIndustrial.Label, "{|}")
|
|
}
|
|
}
|
|
listSon[kIndustrial].IndustrialManagementName = industrialNames
|
|
listSon[kIndustrial].IndustrialManagementName = industrialNames
|
|
|
|
+ listSon[kIndustrial].IndustrialManagementNames = industrialNames
|
|
listSon[kIndustrial].OverviewArticleId = articleStockMap[vIndustrial.IndustrialSubjectName]
|
|
listSon[kIndustrial].OverviewArticleId = articleStockMap[vIndustrial.IndustrialSubjectName]
|
|
listSon[kIndustrial].OverviewArticleTitle = mapArticle[listSon[kIndustrial].OverviewArticleId]
|
|
listSon[kIndustrial].OverviewArticleTitle = mapArticle[listSon[kIndustrial].OverviewArticleId]
|
|
if periods != "" {
|
|
if periods != "" {
|
|
listSon[kIndustrial].IsNew = 0
|
|
listSon[kIndustrial].IsNew = 0
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if vIndustrial.SubjectName == "" {
|
|
|
|
+ listSon[kIndustrial].ShowName = vIndustrial.IndustrialManagementNames
|
|
|
|
+ } else {
|
|
|
|
+ listSon[kIndustrial].ShowName = vIndustrial.SubjectName
|
|
|
|
+ }
|
|
}
|
|
}
|
|
list[k].List = listSon
|
|
list[k].List = listSon
|
|
list[k].BodyChartSummary = mapChartLog[v.ChartPermissionName]
|
|
list[k].BodyChartSummary = mapChartLog[v.ChartPermissionName]
|
|
@@ -849,41 +865,40 @@ func (this *ReportSelectionController) GetArticle() {
|
|
br.ErrMsg = "请登录,SysUser Is Empty"
|
|
br.ErrMsg = "请登录,SysUser Is Empty"
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- industrialSubjectId, _ := this.GetInt("IndustrialSubjectId")
|
|
|
|
- if industrialSubjectId < 1 {
|
|
|
|
- br.Msg = "请输入标的ID"
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- detailSubjecj, err := cygx.GetIndustrialSubjectDetailById(industrialSubjectId)
|
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
|
- br.Msg = "获取信息失败"
|
|
|
|
- br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
resp := new(cygx.OverviewArticle)
|
|
resp := new(cygx.OverviewArticle)
|
|
- if detailSubjecj != nil {
|
|
|
|
- var pars []interface{}
|
|
|
|
- conditionArticle := ` AND type_name = '综述报告' AND stock LIKE ? `
|
|
|
|
- subjectName := "%" + detailSubjecj.SubjectName + "%"
|
|
|
|
- pars = append(pars, subjectName)
|
|
|
|
- articleList, err := cygx.GetCygxArticleList(conditionArticle, pars, 0, 10)
|
|
|
|
- if err != nil {
|
|
|
|
- br.Msg = "获取失败"
|
|
|
|
- br.ErrMsg = "GetCygxArticleList,Err:" + err.Error()
|
|
|
|
|
|
+ industrialSubjectId, _ := this.GetInt("IndustrialSubjectId")
|
|
|
|
+ if industrialSubjectId > 0 {
|
|
|
|
+ detailSubjecj, err := cygx.GetIndustrialSubjectDetailById(industrialSubjectId)
|
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
|
+ br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- //一对一精准匹配
|
|
|
|
- for _, v := range articleList {
|
|
|
|
- sliceSubjects := strings.Split(v.Stock, "/")
|
|
|
|
- if len(sliceSubjects) > 0 {
|
|
|
|
- for _, vSubject := range sliceSubjects {
|
|
|
|
- sliceKuohao := strings.Split(vSubject, "(") //过滤括号
|
|
|
|
- sliceXiahuaxian := strings.Split(sliceKuohao[0], "-") //过滤下划线
|
|
|
|
- subject := sliceXiahuaxian[0]
|
|
|
|
- if subject == detailSubjecj.SubjectName {
|
|
|
|
- resp.ArticleId = v.ArticleId
|
|
|
|
- resp.Title = v.Title
|
|
|
|
- continue
|
|
|
|
|
|
+
|
|
|
|
+ if detailSubjecj != nil {
|
|
|
|
+ var pars []interface{}
|
|
|
|
+ conditionArticle := ` AND type_name = '综述报告' AND stock LIKE ? `
|
|
|
|
+ subjectName := "%" + detailSubjecj.SubjectName + "%"
|
|
|
|
+ pars = append(pars, subjectName)
|
|
|
|
+ articleList, err := cygx.GetCygxArticleList(conditionArticle, pars, 0, 10)
|
|
|
|
+ if err != nil {
|
|
|
|
+ br.Msg = "获取失败"
|
|
|
|
+ br.ErrMsg = "GetCygxArticleList,Err:" + err.Error()
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ //一对一精准匹配
|
|
|
|
+ for _, v := range articleList {
|
|
|
|
+ sliceSubjects := strings.Split(v.Stock, "/")
|
|
|
|
+ if len(sliceSubjects) > 0 {
|
|
|
|
+ for _, vSubject := range sliceSubjects {
|
|
|
|
+ sliceKuohao := strings.Split(vSubject, "(") //过滤括号
|
|
|
|
+ sliceXiahuaxian := strings.Split(sliceKuohao[0], "-") //过滤下划线
|
|
|
|
+ subject := sliceXiahuaxian[0]
|
|
|
|
+ if subject == detailSubjecj.SubjectName {
|
|
|
|
+ resp.ArticleId = v.ArticleId
|
|
|
|
+ resp.Title = v.Title
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1009,9 +1024,13 @@ func (this *ReportSelectionController) History() {
|
|
br.ErrMsg = "GetCygxReportSelectionSubjectHistoryList,Err:" + err.Error()
|
|
br.ErrMsg = "GetCygxReportSelectionSubjectHistoryList,Err:" + err.Error()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- mapSubjectHistory := make(map[string]int)
|
|
|
|
|
|
+ mapSubjectHistory := make(map[string]int) // 标的点击数量
|
|
|
|
+ mapIndustrialHistory := make(map[string]int) // 产业点击数量
|
|
for _, v := range listSelectionSubjectHistory {
|
|
for _, v := range listSelectionSubjectHistory {
|
|
mapSubjectHistory[v.IndustrialSubjectId]++
|
|
mapSubjectHistory[v.IndustrialSubjectId]++
|
|
|
|
+ if v.IndustrialSubjectId == "0" && v.IndustrialManagementId > 0 {
|
|
|
|
+ mapIndustrialHistory[strconv.Itoa(v.IndustrialManagementId)]++
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
//排序方式修改
|
|
//排序方式修改
|
|
@@ -1021,10 +1040,15 @@ func (this *ReportSelectionController) History() {
|
|
for _, v2 := range listSelectionLog {
|
|
for _, v2 := range listSelectionLog {
|
|
if v.ChartPermissionName == v2.PermissionName {
|
|
if v.ChartPermissionName == v2.PermissionName {
|
|
item := new(cygx.HistoryReportSelectionLogResp)
|
|
item := new(cygx.HistoryReportSelectionLogResp)
|
|
- item.SubjectName = v2.SubjectName
|
|
|
|
- item.IndustrialSubjectId = v2.IndustrialSubjectId
|
|
|
|
|
|
+ if (v2.IndustrialSubjectId == "" || v2.IndustrialSubjectId == "0") && v2.IndustrialManagementId != "" {
|
|
|
|
+ item.SubjectName = v2.IndustrialManagementNames
|
|
|
|
+ item.Count = mapIndustrialHistory[v2.IndustrialManagementId]
|
|
|
|
+ } else {
|
|
|
|
+ item.SubjectName = v2.SubjectName
|
|
|
|
+ item.IndustrialSubjectId = v2.IndustrialSubjectId
|
|
|
|
+ item.Count = mapSubjectHistory[v2.IndustrialSubjectId]
|
|
|
|
+ }
|
|
item.IsNew = v2.IsNew
|
|
item.IsNew = v2.IsNew
|
|
- item.Count = mapSubjectHistory[v2.IndustrialSubjectId]
|
|
|
|
resp.Count += item.Count
|
|
resp.Count += item.Count
|
|
v.List = append(v.List, item)
|
|
v.List = append(v.List, item)
|
|
}
|
|
}
|