|
@@ -638,7 +638,7 @@ func (this *ReportController) IndustryListByDepartment() {
|
|
chartPermissionId, _ := this.GetInt("ChartPermissionId")
|
|
chartPermissionId, _ := this.GetInt("ChartPermissionId")
|
|
var startSize int
|
|
var startSize int
|
|
var condition string
|
|
var condition string
|
|
- condition = ` AND m.chart_permission_id =` + strconv.Itoa(chartPermissionId)
|
|
|
|
|
|
+ condition = ` AND a.publish_status=1 AND m.chart_permission_id =` + strconv.Itoa(chartPermissionId)
|
|
if pageSize <= 0 {
|
|
if pageSize <= 0 {
|
|
pageSize = utils.PageSize20
|
|
pageSize = utils.PageSize20
|
|
}
|
|
}
|
|
@@ -678,31 +678,37 @@ func (this *ReportController) IndustryListByDepartment() {
|
|
br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
|
|
br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- for k2, v2 := range listDepar {
|
|
|
|
- condition := ` AND mg.industrial_management_id = ` + strconv.Itoa(v2.IndustrialManagementId)
|
|
|
|
- listSubject, err := models.GetIndustrialSubjectNewList(condition)
|
|
|
|
|
|
+ var listSubject []*models.IndustrialManagementIdName
|
|
|
|
+ var listSubjects []*models.IndustrialManagementIdName
|
|
|
|
+ for _, v2 := range listDepar {
|
|
|
|
+ listSubject, err = models.GetIndustrialSubjectNewListByDepartmentId(v.DepartmentId, v2.IndustrialManagementId)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "获取失败" + strconv.Itoa(v2.IndustrialManagementId)
|
|
br.Msg = "获取失败" + strconv.Itoa(v2.IndustrialManagementId)
|
|
br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
if len(listSubject) > 0 {
|
|
if len(listSubject) > 0 {
|
|
- listDepar[k2].SubjectName = ""
|
|
|
|
- for _, v3 := range listSubject {
|
|
|
|
- listDepar[k2].SubjectName += v3.SubjectName + "/"
|
|
|
|
|
|
+ for k3, v3 := range listSubject {
|
|
|
|
+ listSubject[k3].IndustryName = v2.IndustryName + "—" + v3.SubjectName
|
|
|
|
+ listSubject[k3].DepartmentId = v.DepartmentId
|
|
|
|
+ haveSubject := true
|
|
|
|
+ for _, v4 := range listSubjects {
|
|
|
|
+ if v4.SubjectName == v3.SubjectName {
|
|
|
|
+ haveSubject = false
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //判断是否存在,如果没有那么合并
|
|
|
|
+ if len(listSubjects) < 4 && haveSubject {
|
|
|
|
+ listSubjects = append(listSubjects, listSubject[k3])
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- listDepar[k2].SubjectName = strings.TrimRight(listDepar[k2].SubjectName, "/")
|
|
|
|
- }
|
|
|
|
- if listDepar[k2].SubjectName != "" {
|
|
|
|
- listDepar[k2].IndustryName += "-" + listDepar[k2].SubjectName
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- list[k].List = listDepar
|
|
|
|
|
|
+ list[k].List = listSubjects
|
|
if v.FollowNum > 0 {
|
|
if v.FollowNum > 0 {
|
|
list[k].IsMyFollow = true
|
|
list[k].IsMyFollow = true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
resp.ListnNew, err = models.GetIndustrialSubjectByDepartmentNew(chartPermissionId)
|
|
resp.ListnNew, err = models.GetIndustrialSubjectByDepartmentNew(chartPermissionId)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "获取信息失败"
|
|
br.Msg = "获取信息失败"
|
|
@@ -817,6 +823,7 @@ func (this *ReportController) FllowDepartment() {
|
|
// @Description 获取研选文章列表接口
|
|
// @Description 获取研选文章列表接口
|
|
// @Param PageSize query int true "每页数据条数"
|
|
// @Param PageSize query int true "每页数据条数"
|
|
// @Param CurrentIndex query int true "当前页页码,从1开始"
|
|
// @Param CurrentIndex query int true "当前页页码,从1开始"
|
|
|
|
+// @Param ArticleId query int true "文章id"
|
|
// @Param DepartmentId query int true "作者ID"
|
|
// @Param DepartmentId query int true "作者ID"
|
|
// @Param IndustrialManagementId query int true "产业ID"
|
|
// @Param IndustrialManagementId query int true "产业ID"
|
|
// @Success 200 {object} models.ReportArticleWhichIndustrialRepList
|
|
// @Success 200 {object} models.ReportArticleWhichIndustrialRepList
|
|
@@ -838,6 +845,7 @@ func (this *ReportController) ReportList() {
|
|
currentIndex, _ := this.GetInt("CurrentIndex")
|
|
currentIndex, _ := this.GetInt("CurrentIndex")
|
|
departmentId, _ := this.GetInt("DepartmentId")
|
|
departmentId, _ := this.GetInt("DepartmentId")
|
|
industrialManagementId, _ := this.GetInt("IndustrialManagementId")
|
|
industrialManagementId, _ := this.GetInt("IndustrialManagementId")
|
|
|
|
+ articleId, _ := this.GetInt("ArticleId")
|
|
var condition string
|
|
var condition string
|
|
var startSize int
|
|
var startSize int
|
|
if pageSize <= 0 {
|
|
if pageSize <= 0 {
|
|
@@ -870,8 +878,19 @@ func (this *ReportController) ReportList() {
|
|
condition += ` AND art.department_id = ` + strconv.Itoa(departmentId)
|
|
condition += ` AND art.department_id = ` + strconv.Itoa(departmentId)
|
|
}
|
|
}
|
|
if industrialManagementId > 0 {
|
|
if industrialManagementId > 0 {
|
|
|
|
+
|
|
condition += ` AND m.industrial_management_id = ` + strconv.Itoa(industrialManagementId)
|
|
condition += ` AND m.industrial_management_id = ` + strconv.Itoa(industrialManagementId)
|
|
}
|
|
}
|
|
|
|
+ if articleId > 0 {
|
|
|
|
+ detail, err := models.GetArticleDetailById(articleId)
|
|
|
|
+ if err != nil {
|
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
|
+ br.ErrMsg = "获取信息失败,Err:" + err.Error()
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ condition += ` AND art.subject_ids = '` + detail.SubjectIds + `'`
|
|
|
|
+ }
|
|
|
|
+
|
|
total, err = models.GetWhichDepartmentCount(condition)
|
|
total, err = models.GetWhichDepartmentCount(condition)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "获取信息失败"
|
|
br.Msg = "获取信息失败"
|