|
@@ -113,6 +113,7 @@ func (this *ReportController) IndustryList() {
|
|
if currentIndex <= 0 {
|
|
if currentIndex <= 0 {
|
|
currentIndex = 1
|
|
currentIndex = 1
|
|
}
|
|
}
|
|
|
|
+
|
|
startSize = paging.StartIndex(currentIndex, pageSize)
|
|
startSize = paging.StartIndex(currentIndex, pageSize)
|
|
if isNewLabel == "1" {
|
|
if isNewLabel == "1" {
|
|
condition += ` AND is_new_label = ` + isNewLabel
|
|
condition += ` AND is_new_label = ` + isNewLabel
|
|
@@ -159,23 +160,28 @@ func (this *ReportController) IndustryList() {
|
|
condition += ` AND man.chart_permission_id IN (` + strconv.Itoa(ChartPermissionId) + `)`
|
|
condition += ` AND man.chart_permission_id IN (` + strconv.Itoa(ChartPermissionId) + `)`
|
|
}
|
|
}
|
|
|
|
|
|
- var total int
|
|
|
|
|
|
+ //var total int
|
|
var list []*models.IndustrialManagement
|
|
var list []*models.IndustrialManagement
|
|
- totalTopList, errTop := models.GetIndustrialManagemenCountTop(sqlChartPermissionId, uid, condition)
|
|
|
|
- totalTop := len(totalTopList)
|
|
|
|
- if errTop != nil {
|
|
|
|
- br.Msg = "获取信息失败"
|
|
|
|
- br.ErrMsg = "获取品种信息失败,Err:" + errTop.Error()
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- totalNoTopList, errNoTop := models.GetIndustrialManagemenCountNoTop(sqlChartPermissionId, uid, condition)
|
|
|
|
- totalNoTop := len(totalNoTopList)
|
|
|
|
- if errNoTop != nil {
|
|
|
|
|
|
+ //totalTopList, errTop := models.GetIndustrialManagemenCountTop(sqlChartPermissionId, uid, condition)
|
|
|
|
+ //totalTop := len(totalTopList)
|
|
|
|
+ //if errTop != nil {
|
|
|
|
+ // br.Msg = "获取信息失败"
|
|
|
|
+ // br.ErrMsg = "获取品种信息失败,Err:" + errTop.Error()
|
|
|
|
+ // return
|
|
|
|
+ //}
|
|
|
|
+ //totalNoTopList, errNoTop := models.GetIndustrialManagemenCountNoTop(sqlChartPermissionId, uid, condition)
|
|
|
|
+ //totalNoTop := len(totalNoTopList)
|
|
|
|
+ //if errNoTop != nil {
|
|
|
|
+ // br.Msg = "获取信息失败"
|
|
|
|
+ // br.ErrMsg = "获取品种信息失败,Err:" + errNoTop.Error()
|
|
|
|
+ // return
|
|
|
|
+ //}
|
|
|
|
+ total, err := models.GetIndustrialManagementAllCount(condition)
|
|
|
|
+ if err != nil {
|
|
br.Msg = "获取信息失败"
|
|
br.Msg = "获取信息失败"
|
|
- br.ErrMsg = "获取品种信息失败,Err:" + errNoTop.Error()
|
|
|
|
|
|
+ br.ErrMsg = "获取数量失败,Err:" + err.Error()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- total = totalTop + totalNoTop
|
|
|
|
page := paging.GetPaging(currentIndex, pageSize, total)
|
|
page := paging.GetPaging(currentIndex, pageSize, total)
|
|
if orderColumn == "" {
|
|
if orderColumn == "" {
|
|
orderColumn = "NewTime"
|
|
orderColumn = "NewTime"
|
|
@@ -224,6 +230,10 @@ func (this *ReportController) IndustryList() {
|
|
// }
|
|
// }
|
|
// list = append(listTop, listNoTop...)
|
|
// list = append(listTop, listNoTop...)
|
|
//}
|
|
//}
|
|
|
|
+
|
|
|
|
+ if ChartPermissionId == 0 {
|
|
|
|
+ ChartPermissionId = 20
|
|
|
|
+ }
|
|
detailHot3, err := models.GetIndustrialManagementHot3(ChartPermissionId)
|
|
detailHot3, err := models.GetIndustrialManagementHot3(ChartPermissionId)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "获取信息失败"
|
|
br.Msg = "获取信息失败"
|
|
@@ -657,15 +667,18 @@ func (this *ReportController) IndustryListByDepartment() {
|
|
br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
|
|
br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
-
|
|
|
|
for k2, v2 := range listDepar {
|
|
for k2, v2 := range listDepar {
|
|
- if v2.SubjectName != "" {
|
|
|
|
- slice := strings.Split(v2.SubjectName, "/")
|
|
|
|
|
|
+ condition := ` AND mg.industrial_management_id = ` + strconv.Itoa(v2.IndustrialManagementId)
|
|
|
|
+ listSubject, err := models.GetIndustrialSubjectNewList(condition)
|
|
|
|
+ if err != nil {
|
|
|
|
+ br.Msg = "获取失败" + strconv.Itoa(v2.IndustrialManagementId)
|
|
|
|
+ br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if len(listSubject) > 0 {
|
|
listDepar[k2].SubjectName = ""
|
|
listDepar[k2].SubjectName = ""
|
|
- for k3, v3 := range slice {
|
|
|
|
- if k3 < 4 {
|
|
|
|
- listDepar[k2].SubjectName += v3 + "/"
|
|
|
|
- }
|
|
|
|
|
|
+ for _, v3 := range listSubject {
|
|
|
|
+ listDepar[k2].SubjectName += v3.SubjectName + "/"
|
|
}
|
|
}
|
|
listDepar[k2].SubjectName = strings.TrimRight(listDepar[k2].SubjectName, "/")
|
|
listDepar[k2].SubjectName = strings.TrimRight(listDepar[k2].SubjectName, "/")
|
|
}
|
|
}
|
|
@@ -855,14 +868,21 @@ func (this *ReportController) ReportList() {
|
|
list[k].IsRed = true
|
|
list[k].IsRed = true
|
|
}
|
|
}
|
|
list[k].IsResearch = true
|
|
list[k].IsResearch = true
|
|
- slice := strings.Split(v.SubjectName, "/")
|
|
|
|
- list[k].SubjectName = ""
|
|
|
|
- for k2, v2 := range slice {
|
|
|
|
- if k2 < 4 {
|
|
|
|
- list[k].SubjectName += v2 + "/"
|
|
|
|
|
|
+ condition := ` AND art.article_id = ` + strconv.Itoa(v.ArticleId)
|
|
|
|
+ listSubject, err := models.GetIndustrialSubjectNewList(condition)
|
|
|
|
+ if err != nil {
|
|
|
|
+ br.Msg = "获取失败" + strconv.Itoa(v.ArticleId)
|
|
|
|
+ br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ fmt.Println(len(listSubject))
|
|
|
|
+ if len(listSubject) > 0 {
|
|
|
|
+ list[k].SubjectName = ""
|
|
|
|
+ for _, v3 := range listSubject {
|
|
|
|
+ list[k].SubjectName += v3.SubjectName + "/"
|
|
}
|
|
}
|
|
|
|
+ list[k].SubjectName = strings.TrimRight(list[k].SubjectName, "/")
|
|
}
|
|
}
|
|
- list[k].SubjectName = strings.TrimRight(list[k].SubjectName, "/")
|
|
|
|
if list[k].SubjectName != "" {
|
|
if list[k].SubjectName != "" {
|
|
list[k].IndustryName += "-" + list[k].SubjectName
|
|
list[k].IndustryName += "-" + list[k].SubjectName
|
|
}
|
|
}
|