|
@@ -1751,7 +1751,7 @@ func (this *ReportController) IndustryAndArticleList() {
|
|
|
// @Param ChartPermissionId query int true "分类ID"
|
|
|
// @Param PageSize query int true "每页数据条数"
|
|
|
// @Param CurrentIndex query int true "当前页页码,从1开始"
|
|
|
-// @Success 200 {object} models.CygxArticleDepartmentList
|
|
|
+// @Success 200 {object} models.CygxArticleDepartmentListPc
|
|
|
// @router /industryListByDepartmentPc [get]
|
|
|
func (this *ReportController) IndustryListByDepartmentPc() {
|
|
|
br := new(models.BaseResponse).Init()
|
|
@@ -1768,11 +1768,11 @@ func (this *ReportController) IndustryListByDepartmentPc() {
|
|
|
uid := user.UserId
|
|
|
pageSize, _ := this.GetInt("PageSize")
|
|
|
currentIndex, _ := this.GetInt("CurrentIndex")
|
|
|
- //chartPermissionId, _ := this.GetInt("ChartPermissionId")
|
|
|
+ chartPermissionId, _ := this.GetInt("ChartPermissionId")
|
|
|
var startSize int
|
|
|
var condition string
|
|
|
- //condition = ` AND a.publish_status=1 AND m.chart_permission_id =` + strconv.Itoa(chartPermissionId)
|
|
|
- condition = ` AND a.publish_status=1 `
|
|
|
+ condition = ` AND a.publish_status=1 AND m.chart_permission_id =` + strconv.Itoa(chartPermissionId)
|
|
|
+ //condition = ` AND a.publish_status=1 `
|
|
|
if pageSize <= 0 {
|
|
|
pageSize = utils.PageSize20
|
|
|
}
|
|
@@ -1782,7 +1782,7 @@ func (this *ReportController) IndustryListByDepartmentPc() {
|
|
|
startSize = paging.StartIndex(currentIndex, pageSize)
|
|
|
total, err := models.GetArticleDepartmentCount(condition)
|
|
|
page := paging.GetPaging(currentIndex, pageSize, total)
|
|
|
- resp := new(models.CygxArticleDepartmentList)
|
|
|
+ resp := new(models.CygxArticleDepartmentListPc)
|
|
|
userType, _, err := services.GetUserType(user.CompanyId)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取信息失败"
|
|
@@ -1799,53 +1799,24 @@ func (this *ReportController) IndustryListByDepartmentPc() {
|
|
|
}
|
|
|
resp.HaveResearch = true
|
|
|
//获取作者信息,并排序
|
|
|
- list, err := models.GetCygxArticleDepartmentList(startSize, pageSize, condition, uid)
|
|
|
+ list, err := models.GetCygxArticleDepartmentListPc(startSize, pageSize, condition, uid)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取信息失败"
|
|
|
br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
for k, v := range list {
|
|
|
- artList, err := models.GetArticleByDepartmentId(v.DepartmentId)
|
|
|
+ artList, err := models.GetArticleByDepartmentIdPc(v.DepartmentId)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取信息失败"
|
|
|
br.ErrMsg = "获取文章信息失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
for k2, v2 := range artList {
|
|
|
- subjectNames, err := models.GetSubjectNames(v2.ArticleId)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "获取失败" + strconv.Itoa(v2.ArticleId)
|
|
|
- br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- var subjectNamesNew string
|
|
|
- if len(subjectNames) > 0 {
|
|
|
- slice := strings.Split(subjectNames, "/")
|
|
|
- for k3, v3 := range slice {
|
|
|
- if k3 < 4 {
|
|
|
- subjectNamesNew += v3 + "/"
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- industryName, err := models.GetIndustrialNames(v2.ArticleId)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
- br.Msg = "获取失败" + strconv.Itoa(v2.ArticleId)
|
|
|
- br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- subjectNamesNew = strings.TrimRight(subjectNamesNew, "/")
|
|
|
- artList[k2].SubjectName = subjectNamesNew
|
|
|
- artList[k2].DepartmentId = v.DepartmentId
|
|
|
- if subjectNamesNew == "" {
|
|
|
- artList[k2].IndustryName = industryName
|
|
|
- } else {
|
|
|
- artList[k2].IndustryName = industryName + "-" + subjectNamesNew
|
|
|
- }
|
|
|
if artList[k2].IsReport == "1" {
|
|
|
- artList[k2].IndustryName = "【观点】" + artList[k2].IndustryName
|
|
|
+ artList[k2].Title = "【研选观点】" + v2.Title
|
|
|
} else {
|
|
|
- artList[k2].IndustryName = "【纪要】" + artList[k2].IndustryName
|
|
|
+ artList[k2].Title = "【研选纪要】" + v2.Title
|
|
|
}
|
|
|
}
|
|
|
list[k].List = artList
|