|
@@ -119,7 +119,7 @@ func (this *SmartReportController) Add() {
|
|
pars := make([]interface{}, 0)
|
|
pars := make([]interface{}, 0)
|
|
pars = append(pars, req.ClassifyIdFirst, req.ClassifyIdSecond)
|
|
pars = append(pars, req.ClassifyIdFirst, req.ClassifyIdSecond)
|
|
lastReport, e := ob.GetItemByCondition(cond, pars, "stage DESC")
|
|
lastReport, e := ob.GetItemByCondition(cond, pars, "stage DESC")
|
|
- if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
|
|
|
+ if e != nil && !utils.IsErrNoRow(e) {
|
|
br.Msg = "获取失败"
|
|
br.Msg = "获取失败"
|
|
br.ErrMsg = "获取往期研报失败, Err: " + e.Error()
|
|
br.ErrMsg = "获取往期研报失败, Err: " + e.Error()
|
|
return
|
|
return
|
|
@@ -222,7 +222,7 @@ func (this *SmartReportController) Edit() {
|
|
ob := new(smart_report.SmartReport)
|
|
ob := new(smart_report.SmartReport)
|
|
item, e := ob.GetItemById(req.SmartReportId)
|
|
item, e := ob.GetItemById(req.SmartReportId)
|
|
if e != nil {
|
|
if e != nil {
|
|
- if e.Error() == utils.ErrNoRow() {
|
|
|
|
|
|
+ if utils.IsErrNoRow(e) {
|
|
br.Msg = "报告不存在, 请刷新页面"
|
|
br.Msg = "报告不存在, 请刷新页面"
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -322,7 +322,7 @@ func (this *SmartReportController) Remove() {
|
|
ob := new(smart_report.SmartReport)
|
|
ob := new(smart_report.SmartReport)
|
|
item, e := ob.GetItemById(req.SmartReportId)
|
|
item, e := ob.GetItemById(req.SmartReportId)
|
|
if e != nil {
|
|
if e != nil {
|
|
- if e.Error() == utils.ErrNoRow() {
|
|
|
|
|
|
+ if utils.IsErrNoRow(e) {
|
|
br.Ret = 200
|
|
br.Ret = 200
|
|
br.Success = true
|
|
br.Success = true
|
|
br.Msg = "操作成功"
|
|
br.Msg = "操作成功"
|
|
@@ -380,7 +380,7 @@ func (this *SmartReportController) Detail() {
|
|
ob := new(smart_report.SmartReport)
|
|
ob := new(smart_report.SmartReport)
|
|
item, e := ob.GetItemById(reportId)
|
|
item, e := ob.GetItemById(reportId)
|
|
if e != nil {
|
|
if e != nil {
|
|
- if e.Error() == utils.ErrNoRow() {
|
|
|
|
|
|
+ if utils.IsErrNoRow(e) {
|
|
br.Msg = "报告不存在, 请刷新页面"
|
|
br.Msg = "报告不存在, 请刷新页面"
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -465,7 +465,7 @@ func (this *SmartReportController) Publish() {
|
|
ob := new(smart_report.SmartReport)
|
|
ob := new(smart_report.SmartReport)
|
|
item, e := ob.GetItemById(req.SmartReportId)
|
|
item, e := ob.GetItemById(req.SmartReportId)
|
|
if e != nil {
|
|
if e != nil {
|
|
- if e.Error() == utils.ErrNoRow() {
|
|
|
|
|
|
+ if utils.IsErrNoRow(e) {
|
|
br.Msg = "报告不存在, 请刷新页面"
|
|
br.Msg = "报告不存在, 请刷新页面"
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -623,7 +623,7 @@ func (this *SmartReportController) PrePublish() {
|
|
reportOB := new(smart_report.SmartReport)
|
|
reportOB := new(smart_report.SmartReport)
|
|
item, e := reportOB.GetItemById(reportId)
|
|
item, e := reportOB.GetItemById(reportId)
|
|
if e != nil {
|
|
if e != nil {
|
|
- if e.Error() == utils.ErrNoRow() {
|
|
|
|
|
|
+ if utils.IsErrNoRow(e) {
|
|
br.Msg = "报告不存在, 请刷新页面"
|
|
br.Msg = "报告不存在, 请刷新页面"
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -722,7 +722,7 @@ func (this *SmartReportController) SendMsg() {
|
|
reportOB := new(smart_report.SmartReport)
|
|
reportOB := new(smart_report.SmartReport)
|
|
item, e := reportOB.GetItemById(req.SmartReportId)
|
|
item, e := reportOB.GetItemById(req.SmartReportId)
|
|
if e != nil {
|
|
if e != nil {
|
|
- if e.Error() == utils.ErrNoRow() {
|
|
|
|
|
|
+ if utils.IsErrNoRow(e) {
|
|
br.Msg = "报告不存在, 请刷新页面"
|
|
br.Msg = "报告不存在, 请刷新页面"
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -1145,7 +1145,7 @@ func (this *SmartReportController) DetailImg() {
|
|
reportOB := new(smart_report.SmartReport)
|
|
reportOB := new(smart_report.SmartReport)
|
|
item, e := reportOB.GetItemById(reportId)
|
|
item, e := reportOB.GetItemById(reportId)
|
|
if e != nil {
|
|
if e != nil {
|
|
- if e.Error() == utils.ErrNoRow() {
|
|
|
|
|
|
+ if utils.IsErrNoRow(e) {
|
|
br.Msg = "报告不存在, 请刷新页面"
|
|
br.Msg = "报告不存在, 请刷新页面"
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -1202,7 +1202,7 @@ func (this *SmartReportController) LastPublishedReport() {
|
|
pars := make([]interface{}, 0)
|
|
pars := make([]interface{}, 0)
|
|
pars = append(pars, firstId, secondId)
|
|
pars = append(pars, firstId, secondId)
|
|
item, e := ob.GetItemByCondition(cond, pars, "stage DESC")
|
|
item, e := ob.GetItemByCondition(cond, pars, "stage DESC")
|
|
- if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
|
|
|
+ if e != nil && !utils.IsErrNoRow(e) {
|
|
br.Msg = "获取失败"
|
|
br.Msg = "获取失败"
|
|
br.ErrMsg = "获取研报失败, Err: " + e.Error()
|
|
br.ErrMsg = "获取研报失败, Err: " + e.Error()
|
|
return
|
|
return
|
|
@@ -1250,7 +1250,7 @@ func (this *SmartReportController) VoiceUpload() {
|
|
reportOb := new(smart_report.SmartReport)
|
|
reportOb := new(smart_report.SmartReport)
|
|
item, e := reportOb.GetItemById(reportId)
|
|
item, e := reportOb.GetItemById(reportId)
|
|
if e != nil {
|
|
if e != nil {
|
|
- if e.Error() == utils.ErrNoRow() {
|
|
|
|
|
|
+ if utils.IsErrNoRow(e) {
|
|
br.Msg = "报告不存在, 请刷新页面"
|
|
br.Msg = "报告不存在, 请刷新页面"
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -1394,7 +1394,7 @@ func (this *SmartReportController) SubmitApprove() {
|
|
reportOb := new(smart_report.SmartReport)
|
|
reportOb := new(smart_report.SmartReport)
|
|
reportItem, e := reportOb.GetItemById(reportId)
|
|
reportItem, e := reportOb.GetItemById(reportId)
|
|
if e != nil {
|
|
if e != nil {
|
|
- if e.Error() == utils.ErrNoRow() {
|
|
|
|
|
|
+ if utils.IsErrNoRow(e) {
|
|
br.Msg = "报告已被删除, 请刷新页面"
|
|
br.Msg = "报告已被删除, 请刷新页面"
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -1485,7 +1485,7 @@ func (this *SmartReportController) CancelApprove() {
|
|
reportOb := new(smart_report.SmartReport)
|
|
reportOb := new(smart_report.SmartReport)
|
|
reportItem, e := reportOb.GetItemById(reportId)
|
|
reportItem, e := reportOb.GetItemById(reportId)
|
|
if e != nil {
|
|
if e != nil {
|
|
- if e.Error() == utils.ErrNoRow() {
|
|
|
|
|
|
+ if utils.IsErrNoRow(e) {
|
|
br.Msg = "报告已被删除, 请刷新页面"
|
|
br.Msg = "报告已被删除, 请刷新页面"
|
|
return
|
|
return
|
|
}
|
|
}
|