|
@@ -57,8 +57,16 @@ func (this *ReportController) Detail() {
|
|
|
}
|
|
|
report.ContentSub = html.UnescapeString(report.ContentSub)
|
|
|
report.Content = html.UnescapeString(report.Content)
|
|
|
- company, err := models.GetCompanyById(user.CompanyId)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+
|
|
|
+ productId := 0
|
|
|
+ if report.ClassifyNameSecond == "近期路演精华" {
|
|
|
+ productId = 2
|
|
|
+ } else {
|
|
|
+ productId = 1
|
|
|
+ }
|
|
|
+
|
|
|
+ company, err := models.GetCompanyProductById(user.CompanyId, productId)
|
|
|
+ if err != nil {
|
|
|
if err.Error() != utils.ErrNoRow() {
|
|
|
br.Msg = "获取报告详情失败"
|
|
|
br.ErrMsg = "获取用户管理企业信息失败,Err:" + err.Error()
|
|
@@ -81,47 +89,55 @@ func (this *ReportController) Detail() {
|
|
|
report.Content = report.ContentSub
|
|
|
}
|
|
|
}
|
|
|
- reportType := "rddp"
|
|
|
- reportPermissionList, err := models.GetReportVarietyListByUserIdExt(user.UserId, reportType)
|
|
|
- if err != nil {
|
|
|
- if err.Error() != utils.ErrNoRow() {
|
|
|
- br.Msg = "获取报告详情失败"
|
|
|
- br.ErrMsg = "获取用户管理企业信息失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- } else {
|
|
|
+ if productId==1 {
|
|
|
+ reportType := "rddp"
|
|
|
+ reportPermissionList, err := models.GetReportVarietyListByUserIdExt(user.UserId, reportType)
|
|
|
+ if err != nil {
|
|
|
+ if err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "获取报告详情失败"
|
|
|
+ br.ErrMsg = "获取用户管理企业信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ } else {
|
|
|
+ status = 2
|
|
|
+ msg = "您还未开通权限,如有需要请联系对口销售"
|
|
|
+ report.Content = report.ContentSub
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if len(reportPermissionList) == 0 {
|
|
|
status = 2
|
|
|
msg = "您还未开通权限,如有需要请联系对口销售"
|
|
|
report.Content = report.ContentSub
|
|
|
}
|
|
|
- }
|
|
|
- permissionMap := make(map[int]int)
|
|
|
- for _, v := range reportPermissionList {
|
|
|
- if _, ok := permissionMap[v.ReportChapterTypeId]; !ok {
|
|
|
- permissionMap[v.ReportChapterTypeId] = v.ReportChapterTypeId
|
|
|
+ permissionMap := make(map[int]int)
|
|
|
+ for _, v := range reportPermissionList {
|
|
|
+ if _, ok := permissionMap[v.ReportChapterTypeId]; !ok {
|
|
|
+ permissionMap[v.ReportChapterTypeId] = v.ReportChapterTypeId
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- if _, ok := permissionMap[reportId]; !ok {
|
|
|
- tips := ""
|
|
|
- status = 2
|
|
|
- report.Content = report.ContentSub
|
|
|
- classifyNameSecond := report.ClassifyNameSecond
|
|
|
- if strings.Contains(classifyNameSecond, "宏观商品复盘") ||
|
|
|
- strings.Contains(classifyNameSecond, "股债日评") ||
|
|
|
- strings.Contains(classifyNameSecond, "每日经济数据备忘录") {
|
|
|
- tips = "宏观"
|
|
|
- } else if strings.Contains(classifyNameSecond, "知白守黑日评") ||
|
|
|
- strings.Contains(classifyNameSecond, "动力煤数据点评") {
|
|
|
- tips = "黑色"
|
|
|
- } else if strings.Contains(classifyNameSecond, "化里化外日评") ||
|
|
|
- strings.Contains(classifyNameSecond, "EIA原油库存点评") ||
|
|
|
- strings.Contains(classifyNameSecond, "苯乙烯数据点评") ||
|
|
|
- strings.Contains(classifyNameSecond, "聚酯数据点评") {
|
|
|
- tips = "化工"
|
|
|
- } else if strings.Contains(classifyNameSecond, "有声有色日度闲篇") {
|
|
|
- tips = "有色"
|
|
|
+ if _, ok := permissionMap[reportId]; !ok {
|
|
|
+ tips := ""
|
|
|
+ status = 2
|
|
|
+ report.Content = report.ContentSub
|
|
|
+ classifyNameSecond := report.ClassifyNameSecond
|
|
|
+ if strings.Contains(classifyNameSecond, "宏观商品复盘") ||
|
|
|
+ strings.Contains(classifyNameSecond, "股债日评") ||
|
|
|
+ strings.Contains(classifyNameSecond, "每日经济数据备忘录") {
|
|
|
+ tips = "宏观"
|
|
|
+ } else if strings.Contains(classifyNameSecond, "知白守黑日评") ||
|
|
|
+ strings.Contains(classifyNameSecond, "动力煤数据点评") {
|
|
|
+ tips = "黑色"
|
|
|
+ } else if strings.Contains(classifyNameSecond, "化里化外日评") ||
|
|
|
+ strings.Contains(classifyNameSecond, "EIA原油库存点评") ||
|
|
|
+ strings.Contains(classifyNameSecond, "苯乙烯数据点评") ||
|
|
|
+ strings.Contains(classifyNameSecond, "聚酯数据点评") {
|
|
|
+ tips = "化工"
|
|
|
+ } else if strings.Contains(classifyNameSecond, "有声有色日度闲篇") {
|
|
|
+ tips = "有色"
|
|
|
+ }
|
|
|
+ msg = "您还未开通" + tips + "权限,如有需要请联系对口销售"
|
|
|
}
|
|
|
- msg = "您还未开通" + tips + "权限,如有需要请联系对口销售"
|
|
|
}
|
|
|
+
|
|
|
resp := new(models.ReportDetailResp)
|
|
|
resp.Status = status
|
|
|
resp.Msg = msg
|
|
@@ -380,3 +396,11 @@ func (this *ReportController) AddAudioRecord() {
|
|
|
br.Success = true
|
|
|
br.Msg = "新增成功"
|
|
|
}
|
|
|
+
|
|
|
+//func init() {
|
|
|
+// fmt.Println("start")
|
|
|
+// content:=`<p><strong><u>需要开始观察和警惕全球库存周期回摆对资产价格的压力</u></strong></p><p>从经济惊喜指数上看,8月以来欧美和新兴市场的走势出现了显著的背离,美国和欧洲的经济惊喜指数都在8月见顶,9月开始回落,而新兴市场的经济惊喜指数却在一路上行。新兴市场的走强不是中国带动的,因为中国的经济惊喜指数从8月开始就基本保持稳定。新兴市场的强势更多是由于自身的原因。</p><p><iframe src="https://vmp.hzinsights.com/element/750/citibank_economic_surprise_index/%7C%7C%7C%7C%7C/" width="100%" height="350" border="none" style="border-width:0px; min-height:350px;"></iframe></p><p>新兴市场经济强势的根本原因是什么?是因为疫情之后自身的经济比欧美恢复得更好么?显然不是。我们以巴西为例,看巴西的制造业PMI,已经到达突破历史的“逆天水平”。</p><p><iframe src="https://vmp.hzinsights.com/element/762/brazil_pmi_stock_market/%7C%7C%7C%7C%7C/" width="100%" height="350" border="none" style="border-width:0px; min-height:350px;"></iframe></p>`
|
|
|
+// newContent:=html.UnescapeString(content)
|
|
|
+// utils.FileLog.Info("%s",newContent)
|
|
|
+// fmt.Println("end")
|
|
|
+//}
|