|
@@ -1221,3 +1221,247 @@ func (this *ReportController) ReportListByType() {
|
|
|
br.Msg = "获取成功"
|
|
|
br.Data = resp
|
|
|
}
|
|
|
+
|
|
|
+// @Title 获取报告精选详情
|
|
|
+// @Description 获取报告精选详情接口
|
|
|
+// @Param ArticleId query int true "报告ID"
|
|
|
+// @Success 200 {object} models.ReportSelectionLetailResp
|
|
|
+// @router /reportSelection/detail [get]
|
|
|
+func (this *ReportController) Detail() {
|
|
|
+ br := new(models.BaseResponse).Init()
|
|
|
+ defer func() {
|
|
|
+ this.Data["json"] = br
|
|
|
+ this.ServeJSON()
|
|
|
+ }()
|
|
|
+ user := this.User
|
|
|
+ if user == nil {
|
|
|
+ br.Msg = "请重新登录"
|
|
|
+ br.Ret = 408
|
|
|
+ return
|
|
|
+ }
|
|
|
+ uid := user.UserId
|
|
|
+ articleId, _ := this.GetInt("ArticleId")
|
|
|
+ if articleId < 0 {
|
|
|
+ br.Msg = "参数错误"
|
|
|
+ br.ErrMsg = "参数错误"
|
|
|
+ return
|
|
|
+ }
|
|
|
+ resp := new(models.ReportSelectionLetailResp)
|
|
|
+ detail, err := models.GetCygxReportSelectionInfoById(articleId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "报告不存在,Err:" + err.Error() + "articleId:" + strconv.Itoa(articleId)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ detail.PublishDate = utils.StrTimeToTime(detail.PublishDate).Format("2006-01-02")
|
|
|
+ existMap := make(map[int]int)
|
|
|
+ var items []*models.ReportSelectionChartPermission
|
|
|
+ listLog, err := models.GetReportSelectionlogListAll(articleId)
|
|
|
+
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取子类信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //var itemLogs []*models.CygxReportSelectionLogDetail
|
|
|
+ for _, v := range listLog {
|
|
|
+ item := new(models.ReportSelectionChartPermission)
|
|
|
+ if existMap[v.ChartPermissionId] == 0 {
|
|
|
+ item.PermissionName = v.PermissionName + "领域深度调研和报告"
|
|
|
+ listSonLog, err := models.GetReportSelectionlogSonListAll(articleId, v.ChartPermissionId)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for k2, v2 := range listSonLog {
|
|
|
+ if v2.IndustrialManagementId != "" {
|
|
|
+ listIndustrial, err := models.GetIndustrialByIds(v2.IndustrialManagementId)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ listSonLog[k2].List = listIndustrial
|
|
|
+ }
|
|
|
+ }
|
|
|
+ item.List = listSonLog
|
|
|
+ items = append(items, item)
|
|
|
+ //itemLogs = make([]*models.CygxReportSelectionLogDetail, 0)
|
|
|
+ }
|
|
|
+ existMap[v.ChartPermissionId] = v.ChartPermissionId
|
|
|
+ }
|
|
|
+ historyRecord := new(models.CygxReportHistoryRecord)
|
|
|
+ historyRecord.UserId = uid
|
|
|
+ historyRecord.ArticleId = articleId
|
|
|
+ historyRecord.CreateTime = time.Now()
|
|
|
+ historyRecord.Mobile = user.Mobile
|
|
|
+ historyRecord.Email = user.Email
|
|
|
+ historyRecord.CompanyId = user.CompanyId
|
|
|
+ historyRecord.CompanyName = user.CompanyName
|
|
|
+ historyRecord.ReportType = "bgjx"
|
|
|
+ go models.AddCygxReportHistoryRecord(historyRecord)
|
|
|
+ resp.List = items
|
|
|
+ resp.Detail = detail
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "获取成功"
|
|
|
+ br.Data = resp
|
|
|
+}
|
|
|
+
|
|
|
+// @Title 获取本周研究汇总详情
|
|
|
+// @Description 获取本周研究汇总详情接口
|
|
|
+// @Param ArticleId query int true "报告ID"
|
|
|
+// @Success 200 {object} models.ResearchSummaryLetailResp
|
|
|
+// @router /researchSummary/detail [get]
|
|
|
+func (this *ReportController) ResearchDetail() {
|
|
|
+ br := new(models.BaseResponse).Init()
|
|
|
+ defer func() {
|
|
|
+ this.Data["json"] = br
|
|
|
+ this.ServeJSON()
|
|
|
+ }()
|
|
|
+ user := this.User
|
|
|
+ if user == nil {
|
|
|
+ br.Msg = "请重新登录"
|
|
|
+ br.Ret = 408
|
|
|
+ return
|
|
|
+ }
|
|
|
+ uid := user.UserId
|
|
|
+ articleId, _ := this.GetInt("ArticleId")
|
|
|
+ if articleId < 0 {
|
|
|
+ br.Msg = "参数错误"
|
|
|
+ br.ErrMsg = "参数错误"
|
|
|
+ return
|
|
|
+ }
|
|
|
+ resp := new(models.ResearchSummaryLetailResp)
|
|
|
+ detail, err := models.GetCygxResearchSummaryInfoById(articleId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "报告不存在,Err:" + err.Error() + "articleId:" + strconv.Itoa(articleId)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ detail.PublishDate = utils.StrTimeToTime(detail.PublishDate).Format("2006-01-02")
|
|
|
+ listFirst, err := models.GetResearchSummarylogListFirst(articleId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取子类信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for k, v := range listFirst {
|
|
|
+ listSecond, err := models.GetResearchSummarylogSonListSecond(articleId, v.Type)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for k2, v2 := range listSecond {
|
|
|
+ listThird, err := models.GetResearchSummarylogSonListThird(articleId, v2.ChartPermissionId, v.Type)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ fmt.Println(listThird)
|
|
|
+ if len(listThird) > 0 {
|
|
|
+ listSecond[k2].List = listThird
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if len(listSecond) > 0 {
|
|
|
+ listFirst[k].List = listSecond
|
|
|
+ }
|
|
|
+ //`description:"类型'SDBG深度报告片篇,’CYDYJY:产业调研纪要’,’SJDP事件点评,’BZCHJH:本周晨会精华’"`
|
|
|
+ if v.Type == "SDBG" {
|
|
|
+ listFirst[k].ListName = "深度报告"
|
|
|
+ } else if v.Type == "BZCHJH" {
|
|
|
+ listFirst[k].ListName = "本周晨会精华"
|
|
|
+ } else if v.Type == "CYDYJY" {
|
|
|
+ listFirst[k].ListName = "产业调研纪要"
|
|
|
+ } else {
|
|
|
+ listFirst[k].ListName = "事件点评"
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ historyRecord := new(models.CygxReportHistoryRecord)
|
|
|
+ historyRecord.UserId = uid
|
|
|
+ historyRecord.ArticleId = articleId
|
|
|
+ historyRecord.CreateTime = time.Now()
|
|
|
+ historyRecord.Mobile = user.Mobile
|
|
|
+ historyRecord.Email = user.Email
|
|
|
+ historyRecord.CompanyId = user.CompanyId
|
|
|
+ historyRecord.CompanyName = user.CompanyName
|
|
|
+ historyRecord.ReportType = "bzyjhz"
|
|
|
+ go models.AddCygxReportHistoryRecord(historyRecord)
|
|
|
+ resp.List = listFirst
|
|
|
+ resp.Detail = detail
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "获取成功"
|
|
|
+ br.Data = resp
|
|
|
+}
|
|
|
+
|
|
|
+// @Title 上周纪要汇总内容详情
|
|
|
+// @Description 获取上周纪要汇总内容详情接口
|
|
|
+// @Param ArticleId query int true "报告ID"
|
|
|
+// @Success 200 {object} models.MinutesSummaryLetailResp
|
|
|
+// @router /minutesSummary/detail [get]
|
|
|
+func (this *ReportController) MinutesDetail() {
|
|
|
+ br := new(models.BaseResponse).Init()
|
|
|
+ defer func() {
|
|
|
+ this.Data["json"] = br
|
|
|
+ this.ServeJSON()
|
|
|
+ }()
|
|
|
+ user := this.User
|
|
|
+ if user == nil {
|
|
|
+ br.Msg = "请重新登录"
|
|
|
+ br.Ret = 408
|
|
|
+ return
|
|
|
+ }
|
|
|
+ uid := user.UserId
|
|
|
+ articleId, _ := this.GetInt("ArticleId")
|
|
|
+ if articleId < 0 {
|
|
|
+ br.Msg = "参数错误"
|
|
|
+ br.ErrMsg = "参数错误"
|
|
|
+ return
|
|
|
+ }
|
|
|
+ resp := new(models.MinutesSummaryLetailResp)
|
|
|
+ detail, err := models.GetCygxMinutesSummaryInfoById(articleId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "报告不存在,Err:" + err.Error() + "articleId:" + strconv.Itoa(articleId)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ detail.PublishDate = utils.StrTimeToTime(detail.PublishDate).Format("2006-01-02")
|
|
|
+ listLog, err := models.GetMinutesSummarylogListAll(articleId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取子类信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for k, v := range listLog {
|
|
|
+ listSonLog, err := models.GetMinutesSummarylogSonListAll(articleId, v.ChartPermissionId)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if len(listSonLog) > 0 {
|
|
|
+ listLog[k].List = listSonLog
|
|
|
+ }
|
|
|
+ }
|
|
|
+ historyRecord := new(models.CygxReportHistoryRecord)
|
|
|
+ historyRecord.UserId = uid
|
|
|
+ historyRecord.ArticleId = articleId
|
|
|
+ historyRecord.CreateTime = time.Now()
|
|
|
+ historyRecord.Mobile = user.Mobile
|
|
|
+ historyRecord.Email = user.Email
|
|
|
+ historyRecord.CompanyId = user.CompanyId
|
|
|
+ historyRecord.CompanyName = user.CompanyName
|
|
|
+ historyRecord.ReportType = "szjyhz"
|
|
|
+ go models.AddCygxReportHistoryRecord(historyRecord)
|
|
|
+ resp.List = listLog
|
|
|
+ resp.Detail = detail
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "获取成功"
|
|
|
+ br.Data = resp
|
|
|
+}
|