|
@@ -251,10 +251,10 @@ func (this *UserAuthController) AddReportRecord() {
|
|
|
br.ErrMsg = "参数错误,报告id小于等于0"
|
|
|
return
|
|
|
}
|
|
|
- reportResp, err := services.GetReportChartPermissionList(req.ReportId)
|
|
|
+ reportResp, err := services.GetReportDetail(req.ReportId, user.UserId)
|
|
|
if err != nil {
|
|
|
br.Msg = "添加阅读记录失败"
|
|
|
- br.ErrMsg = "获取研报品种错误,Err:" + err.Error()
|
|
|
+ br.ErrMsg = "获取研报错误,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
if reportResp.Ret != 200 {
|
|
@@ -262,7 +262,19 @@ func (this *UserAuthController) AddReportRecord() {
|
|
|
br.ErrMsg = reportResp.ErrMsg
|
|
|
return
|
|
|
}
|
|
|
- reportPermissionList := reportResp.Data
|
|
|
+ reportDetail := reportResp.Data.Report
|
|
|
+ reportPermissionResp, err := services.GetReportChartPermissionList(req.ReportId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "添加阅读记录失败"
|
|
|
+ br.ErrMsg = "获取研报品种错误,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if reportPermissionResp.Ret != 200 {
|
|
|
+ br.Msg = reportPermissionResp.Msg
|
|
|
+ br.ErrMsg = reportPermissionResp.ErrMsg
|
|
|
+ return
|
|
|
+ }
|
|
|
+ reportPermissionList := reportPermissionResp.Data
|
|
|
chartPermissionList, err := services.GetChartPermissionAllList()
|
|
|
if err != nil {
|
|
|
br.Msg = "添加阅读记录失败"
|
|
@@ -292,12 +304,12 @@ func (this *UserAuthController) AddReportRecord() {
|
|
|
userReadRecord := &models.UserReadRecord{
|
|
|
UserId: user.UserId,
|
|
|
ReportId: req.ReportId,
|
|
|
- ReportTitle: req.ReportTitle,
|
|
|
+ ReportTitle: reportDetail.Title,
|
|
|
ChartPermissionName: strings.Join(permissionNames, ","),
|
|
|
- ClassifyId1: req.ClassifyIdFirst,
|
|
|
- ClassifyName1: req.ClassifyNameFirst,
|
|
|
- ClassifyId2: req.ClassifyIdSecond,
|
|
|
- ClassifyName2: req.ClassifyNameSecond,
|
|
|
+ ClassifyId1: reportDetail.ClassifyIdFirst,
|
|
|
+ ClassifyName1: reportDetail.ClassifyNameFirst,
|
|
|
+ ClassifyId2: reportDetail.ClassifyIdSecond,
|
|
|
+ ClassifyName2: reportDetail.ClassifyNameSecond,
|
|
|
Timestamp: int(curTime.Unix()),
|
|
|
CreateTime: curTime,
|
|
|
CreateDate: curTime.Format(utils.FormatDate),
|