|
@@ -1600,26 +1600,29 @@ func (this *ReportController) Detail() {
|
|
|
mapBodyChartSummary := make(map[int]string)
|
|
|
mapLabel := make(map[int]string)
|
|
|
if lastPeriods > 0 {
|
|
|
- detailLast, err := models.GetCygxReportSelectionInfoById(articleId)
|
|
|
- if err != nil {
|
|
|
+ detailLast, err := models.GetCygxReportSelectionInfoByperiods(lastPeriods)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
br.Msg = "获取信息失败"
|
|
|
- br.ErrMsg = "报告不存在,Err:" + err.Error() + "articleId:" + strconv.Itoa(articleId)
|
|
|
- return
|
|
|
- }
|
|
|
- articleIdLast := detailLast.ArticleId
|
|
|
- listLogLast, err := models.GetReportSelectionlogListAll(articleIdLast)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "获取失败"
|
|
|
- br.ErrMsg = "获取子类信息失败,Err:" + err.Error()
|
|
|
+ br.ErrMsg = "报告不存在,Err:" + err.Error() + "Periods:" + strconv.Itoa(lastPeriods)
|
|
|
return
|
|
|
}
|
|
|
- for _, v := range listLogLast {
|
|
|
- mapBodyChartSummary[v.IndustrialSubjectId] = v.Body
|
|
|
- mapLabel[v.IndustrialSubjectId] = v.Label
|
|
|
+ if detailLast != nil {
|
|
|
+ articleIdLast := detailLast.ArticleId
|
|
|
+ listLogLast, err := models.GetReportSelectionlogListAll(articleIdLast)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取子类信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for _, v := range listLogLast {
|
|
|
+ mapBodyChartSummary[v.IndustrialSubjectId] = v.Body
|
|
|
+ mapLabel[v.IndustrialSubjectId] = v.Label
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
isAllNew = true
|
|
|
}
|
|
|
+ fmt.Println(mapLabel)
|
|
|
detail.PublishDate = utils.StrTimeToTime(detail.PublishDate).Format("2006-01-02")
|
|
|
existMap := make(map[int]int)
|
|
|
var items []*models.ReportSelectionChartPermission
|