ソースを参照

处理utils.ErrNoRow() {

xyxie 3 ヶ月 前
コミット
182ad0bf7b
100 ファイル変更343 行追加349 行削除
  1. 1 1
      controllers/ai/ai_summary.go
  2. 2 2
      controllers/business_conf.go
  3. 4 4
      controllers/cloud_disk.go
  4. 1 1
      controllers/company_seller.go
  5. 2 2
      controllers/data_manage/ai_predict_model/classify.go
  6. 9 9
      controllers/data_manage/ai_predict_model/framework.go
  7. 6 6
      controllers/data_manage/ai_predict_model/index.go
  8. 4 4
      controllers/data_manage/base_from_ths_hf.go
  9. 2 2
      controllers/data_manage/base_from_ths_hf_classify.go
  10. 1 1
      controllers/data_manage/ccf_data.go
  11. 1 1
      controllers/data_manage/chart_classify.go
  12. 9 9
      controllers/data_manage/chart_framework.go
  13. 7 7
      controllers/data_manage/correlation/correlation_chart_info.go
  14. 1 1
      controllers/data_manage/cross_variety/chart_info.go
  15. 2 2
      controllers/data_manage/data_manage_permission/message.go
  16. 4 4
      controllers/data_manage/edb_info.go
  17. 2 2
      controllers/data_manage/edb_info_refresh.go
  18. 2 2
      controllers/data_manage/excel/custom_analysis.go
  19. 2 2
      controllers/data_manage/excel/excel_classify.go
  20. 7 7
      controllers/data_manage/excel/excel_info.go
  21. 2 2
      controllers/data_manage/factor_edb_series.go
  22. 1 1
      controllers/data_manage/future_good/future_good_chart_info.go
  23. 2 2
      controllers/data_manage/future_good/future_good_profit_chart_info.go
  24. 2 2
      controllers/data_manage/my_chart.go
  25. 1 1
      controllers/data_manage/predict_edb_info.go
  26. 2 2
      controllers/data_manage/range_analysis/chart_classify.go
  27. 4 4
      controllers/data_manage/range_analysis/chart_info.go
  28. 3 3
      controllers/data_manage/wind_data.go
  29. 1 1
      controllers/data_source/data_source.go
  30. 2 2
      controllers/english_report/email.go
  31. 5 5
      controllers/english_report/en_permission.go
  32. 3 3
      controllers/english_report/english_classify.go
  33. 2 2
      controllers/english_report/english_company.go
  34. 2 2
      controllers/english_report/english_company_todo.go
  35. 6 6
      controllers/english_report/report.go
  36. 1 1
      controllers/eta_trial/questionnaire.go
  37. 1 1
      controllers/ppt_english.go
  38. 1 1
      controllers/ppt_v2.go
  39. 7 7
      controllers/report_approve/report_approve.go
  40. 6 6
      controllers/report_approve/report_approve_flow.go
  41. 1 1
      controllers/report_chapter.go
  42. 2 2
      controllers/report_chapter_type.go
  43. 4 4
      controllers/report_v2.go
  44. 6 6
      controllers/semantic_analysis/sa_compare.go
  45. 3 3
      controllers/semantic_analysis/sa_compare_classify.go
  46. 9 9
      controllers/semantic_analysis/sa_doc.go
  47. 4 4
      controllers/semantic_analysis/sa_doc_classify.go
  48. 6 6
      controllers/semantic_analysis/sa_label.go
  49. 12 12
      controllers/smart_report/smart_report.go
  50. 5 5
      controllers/smart_report/smart_resource.go
  51. 10 10
      controllers/speech_recognition/speech_recognition.go
  52. 5 5
      controllers/speech_recognition/speech_recognition_menu.go
  53. 5 5
      controllers/speech_recognition/speech_recognition_tag.go
  54. 5 5
      controllers/speech_recognition/speech_recognition_tag_menu.go
  55. 2 2
      controllers/sys_admin.go
  56. 2 2
      controllers/sys_role.go
  57. 7 7
      controllers/trade_analysis/trade_analysis_correlation.go
  58. 5 5
      controllers/trade_analysis/trade_analysis_table.go
  59. 6 6
      controllers/trade_analysis/warehouse.go
  60. 25 26
      controllers/user_login.go
  61. 1 1
      services/ai_predict_model_classify.go
  62. 2 2
      services/chart_permission.go
  63. 3 3
      services/classify.go
  64. 1 1
      services/data/base_from_baiinfo.go
  65. 2 2
      services/data/base_from_bloomberg.go
  66. 1 1
      services/data/base_from_business.go
  67. 1 1
      services/data/base_from_ccf.go
  68. 4 4
      services/data/base_from_clarksons.go
  69. 1 1
      services/data/base_from_eia_steo.go
  70. 2 2
      services/data/base_from_fenwei_index_service.go
  71. 1 1
      services/data/base_from_gpr_risk.go
  72. 2 6
      services/data/base_from_hisugar.go
  73. 2 2
      services/data/base_from_ly_index_service.go
  74. 1 2
      services/data/base_from_oilchem.go
  75. 2 2
      services/data/base_from_rzd_index_service.go
  76. 1 1
      services/data/base_from_sci.go
  77. 1 1
      services/data/base_from_sci_hq.go
  78. 1 1
      services/data/base_from_smm.go
  79. 1 1
      services/data/base_from_ths_hf_classify.go
  80. 1 1
      services/data/base_from_usda_fas.go
  81. 2 2
      services/data/chart_classify.go
  82. 2 2
      services/data/chart_info.go
  83. 1 1
      services/data/chart_info_excel_balance.go
  84. 11 11
      services/data/common_classify.go
  85. 4 4
      services/data/correlation/chart_info.go
  86. 8 8
      services/data/data_manage_permission/data_move.go
  87. 4 4
      services/data/edb_classify.go
  88. 2 2
      services/data/line_equation/chart_info.go
  89. 2 2
      services/data/manual.go
  90. 1 1
      services/data/my_chart.go
  91. 1 1
      services/data/mysteel_chemical.go
  92. 5 5
      services/data/range_analysis/chart_info.go
  93. 4 4
      services/data/stl/stl.go
  94. 1 1
      services/data/trade_analysis/trade_analysis_data.go
  95. 1 1
      services/data/yongyi.go
  96. 2 2
      services/data_stat/edb_terminal.go
  97. 4 4
      services/edb_monitor/edb_monitor.go
  98. 7 7
      services/edb_monitor/edb_monitor_classify.go
  99. 2 2
      services/english_video.go
  100. 1 1
      services/excel_info.go

+ 1 - 1
controllers/ai/ai_summary.go

@@ -948,7 +948,7 @@ func (this *AiController) AiSummaryDetail() {
 		item := new(saModel.SaDoc)
 		e := item.GetItemById(detail.SaDocId)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				br.Msg = "文档已被删除, 请刷新页面"
 				return
 			}

+ 2 - 2
controllers/business_conf.go

@@ -326,7 +326,7 @@ func (this *BusinessConfController) SingleSave() {
 	// 获取配置信息
 	confOb, e := models.GetBusinessConfByKey(req.ConfKey)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "配置不存在"
 			return
 		}
@@ -419,7 +419,7 @@ func (this *BusinessConfController) GetSingle() {
 	// 获取配置信息
 	confOb, e := models.GetBusinessConfByKey(confKey)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "配置不存在"
 			return
 		}

+ 4 - 4
controllers/cloud_disk.go

@@ -64,7 +64,7 @@ func (this *CloudDiskController) MenuCreate() {
 	existCond := ` AND menu_name = ? AND parent_id = ? `
 	existPars := make([]interface{}, 0)
 	existPars = append(existPars, req.MenuName, req.ParentId)
-	if e := existItem.GetItemByCondition(existCond, existPars); e != nil && e.Error() != utils.ErrNoRow() {
+	if e := existItem.GetItemByCondition(existCond, existPars); e != nil && !utils.IsErrNoRow(e) {
 		br.Msg = "操作失败"
 		br.ErrMsg = "获取重名目录失败, Err: " + e.Error()
 		return
@@ -144,7 +144,7 @@ func (this *CloudDiskController) MenuRename() {
 	existCond := ` AND menu_name = ? AND parent_id = ? AND menu_id <> ? `
 	existPars := make([]interface{}, 0)
 	existPars = append(existPars, req.MenuName, menuItem.ParentId, menuItem.MenuId)
-	if e := existItem.GetItemByCondition(existCond, existPars); e != nil && e.Error() != utils.ErrNoRow() {
+	if e := existItem.GetItemByCondition(existCond, existPars); e != nil && !utils.IsErrNoRow(e) {
 		br.Msg = "操作失败"
 		br.ErrMsg = "获取重名目录失败, Err: " + e.Error()
 		return
@@ -578,7 +578,7 @@ func (this *CloudDiskController) ResourceUpload() {
 	existCond := ` AND resource_name = ? AND menu_id = ? `
 	existPars := make([]interface{}, 0)
 	existPars = append(existPars, fileName, menuId)
-	if e := existItem.GetItemByCondition(existCond, existPars); e != nil && e.Error() != utils.ErrNoRow() {
+	if e := existItem.GetItemByCondition(existCond, existPars); e != nil && !utils.IsErrNoRow(e) {
 		br.Msg = "操作失败"
 		br.ErrMsg = "获取重名文件失败, Err: " + e.Error()
 		return
@@ -729,7 +729,7 @@ func (this *CloudDiskController) ResourceRename() {
 	existCond := ` AND resource_name = ? AND menu_id = ? AND resource_id <> ? `
 	existPars := make([]interface{}, 0)
 	existPars = append(existPars, req.ResourceName, resourceItem.MenuId, resourceItem.ResourceId)
-	if e := existItem.GetItemByCondition(existCond, existPars); e != nil && e.Error() != utils.ErrNoRow() {
+	if e := existItem.GetItemByCondition(existCond, existPars); e != nil && !utils.IsErrNoRow(e) {
 		br.Msg = "操作失败"
 		br.ErrMsg = "获取重名文件失败, Err: " + e.Error()
 		return

+ 1 - 1
controllers/company_seller.go

@@ -1726,7 +1726,7 @@ func (this *CompanySellerController) CheckListV2() {
 
 	// 海外销售部-目前无权限, 均可见
 	seaDepartment, e := system.GetSysDepartmentByName("海外销售部")
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		br.Msg = "获取失败"
 		br.ErrMsg = "获取海外销售部失败, Err: " + e.Error()
 		return

+ 2 - 2
controllers/data_manage/ai_predict_model/classify.go

@@ -269,7 +269,7 @@ func (this *AiPredictModelClassifyController) Edit() {
 	classifyOb := new(aiPredictModel.AiPredictModelClassify)
 	classifyItem, e := classifyOb.GetItemById(req.ClassifyId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "分类不存在, 请刷新页面"
 			return
 		}
@@ -434,7 +434,7 @@ func (this *AiPredictModelClassifyController) Remove() {
 		indexOb := new(aiPredictModel.AiPredictModelIndex)
 		aiIndex, e := indexOb.GetItemById(req.IndexId)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				br.Ret = 200
 				br.Msg = "删除成功"
 				br.Success = true

+ 9 - 9
controllers/data_manage/ai_predict_model/framework.go

@@ -124,7 +124,7 @@ func (c *AiPredictModelFrameworkController) Add() {
 		pars := make([]interface{}, 0)
 		pars = append(pars, req.FrameworkName, sysUser.AdminId)
 		exist, e := ob.GetItemByCondition(cond, pars)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "操作失败"
 			br.ErrMsg = "获取重名框架失败, Err: " + e.Error()
 			return
@@ -223,7 +223,7 @@ func (c *AiPredictModelFrameworkController) Edit() {
 	frameworkOb := new(aiPredictModel.AiPredictModelFramework)
 	item, e := frameworkOb.GetItemById(req.AiPredictModelFrameworkId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "框架不存在, 请刷新页面"
 			return
 		}
@@ -245,7 +245,7 @@ func (c *AiPredictModelFrameworkController) Edit() {
 		pars := make([]interface{}, 0)
 		pars = append(pars, req.AiPredictModelFrameworkId, req.FrameworkName, sysUser.AdminId)
 		exist, e := ob.GetItemByCondition(cond, pars)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "操作失败"
 			br.ErrMsg = "获取重名框架失败, Err: " + e.Error()
 			return
@@ -335,7 +335,7 @@ func (c *AiPredictModelFrameworkController) Remove() {
 	ob := new(aiPredictModel.AiPredictModelFramework)
 	item, e := ob.GetItemById(req.AiPredictModelFrameworkId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Ret = 200
 			br.Success = true
 			br.Msg = "操作成功"
@@ -405,7 +405,7 @@ func (c *AiPredictModelFrameworkController) Rename() {
 	frameworkOb := new(aiPredictModel.AiPredictModelFramework)
 	item, e := frameworkOb.GetItemById(req.AiPredictModelFrameworkId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "框架不存在, 请刷新页面"
 			return
 		}
@@ -427,7 +427,7 @@ func (c *AiPredictModelFrameworkController) Rename() {
 		pars := make([]interface{}, 0)
 		pars = append(pars, req.AiPredictModelFrameworkId, req.FrameworkName, sysUser.AdminId)
 		exist, e := ob.GetItemByCondition(cond, pars)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "操作失败"
 			br.ErrMsg = "获取重名框架失败, Err: " + e.Error()
 			return
@@ -491,7 +491,7 @@ func (c *AiPredictModelFrameworkController) Move() {
 	frameworkOb := new(aiPredictModel.AiPredictModelFramework)
 	item, e := frameworkOb.GetItemById(req.AiPredictModelFrameworkId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "框架不存在, 请刷新页面"
 			return
 		}
@@ -599,7 +599,7 @@ func (c *AiPredictModelFrameworkController) Detail() {
 	frameworkOb := new(aiPredictModel.AiPredictModelFramework)
 	item, e := frameworkOb.GetItemById(frameworkId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "框架不存在, 请刷新页面"
 			return
 		}
@@ -635,7 +635,7 @@ func (c *AiPredictModelFrameworkController) Detail() {
 			indexObj := aiPredictModel.AiPredictModelIndex{}
 			indexList, e := indexObj.GetItemsByCondition(` AND ai_predict_model_index_id in (`+utils.GetOrmInReplace(indexIdNum)+`)`, aiPredictModelIndexIdList, []string{}, "")
 			if e != nil {
-				if e.Error() == utils.ErrNoRow() {
+				if utils.IsErrNoRow(e) {
 					br.Msg = "框架不存在, 请刷新页面"
 					return
 				}

+ 6 - 6
controllers/data_manage/ai_predict_model/index.go

@@ -648,7 +648,7 @@ func (this *AiPredictModelIndexController) Detail() {
 	indexOb := new(aiPredictModel.AiPredictModelIndex)
 	indexItem, e := indexOb.GetItemById(indexId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "标的已被删除,请刷新页面"
 			return
 		}
@@ -756,7 +756,7 @@ func (this *AiPredictModelIndexController) Save() {
 	indexOb := new(aiPredictModel.AiPredictModelIndex)
 	indexItem, e := indexOb.GetItemById(req.IndexId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "标的已被删除,请刷新页面"
 			return
 		}
@@ -837,7 +837,7 @@ func (this *AiPredictModelIndexController) DashboardSave() {
 	indexOb := new(aiPredictModel.AiPredictModelIndex)
 	_, e := indexOb.GetItemById(req.IndexId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "标的已被删除,请刷新页面"
 			return
 		}
@@ -855,7 +855,7 @@ func (this *AiPredictModelIndexController) DashboardSave() {
 		pars := make([]interface{}, 0)
 		pars = append(pars, req.IndexId)
 		item, e := dashboardItem.GetItemByCondition(cond, pars, "")
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "操作失败"
 			br.ErrMsg = fmt.Sprintf("获取标的看板失败, %v", e)
 			return
@@ -930,7 +930,7 @@ func (this *AiPredictModelIndexController) DashboardDetail() {
 	indexOb := new(aiPredictModel.AiPredictModelIndex)
 	indexItem, e := indexOb.GetItemById(indexId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "标的已被删除,请刷新页面"
 			return
 		}
@@ -949,7 +949,7 @@ func (this *AiPredictModelIndexController) DashboardDetail() {
 		pars := make([]interface{}, 0)
 		pars = append(pars, indexId)
 		item, e := dashboardOb.GetItemByCondition(cond, pars, "")
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "操作失败"
 			br.ErrMsg = fmt.Sprintf("获取标的看板失败, %v", e)
 			return

+ 4 - 4
controllers/data_manage/base_from_ths_hf.go

@@ -728,7 +728,7 @@ func (this *BaseFromThsHfController) Edit() {
 	indexOb := new(data_manage.BaseFromThsHfIndex)
 	item, e := indexOb.GetItemById(params.IndexId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "指标不存在, 请刷新页面"
 			return
 		}
@@ -819,7 +819,7 @@ func (this *BaseFromThsHfController) Detail() {
 	indexOb := new(data_manage.BaseFromThsHfIndex)
 	item, e := indexOb.GetItemById(indexId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "指标不存在, 请刷新页面"
 			return
 		}
@@ -899,7 +899,7 @@ func (this *BaseFromThsHfController) Refresh() {
 	indexOb := new(data_manage.BaseFromThsHfIndex)
 	_, e := indexOb.GetItemById(params.IndexId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "指标不存在, 请刷新页面"
 			return
 		}
@@ -959,7 +959,7 @@ func (this *BaseFromThsHfController) Remove() {
 	indexOb := new(data_manage.BaseFromThsHfIndex)
 	item, e := indexOb.GetItemById(params.IndexId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Ret = 200
 			br.Success = true
 			br.Msg = "操作成功"

+ 2 - 2
controllers/data_manage/base_from_ths_hf_classify.go

@@ -301,7 +301,7 @@ func (this *BaseFromThsHfController) ClassifyEdit() {
 	classifyOb := new(data_manage.BaseFromThsHfClassify)
 	classifyItem, e := classifyOb.GetItemById(req.ClassifyId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "分类不存在, 请刷新页面"
 			return
 		}
@@ -382,7 +382,7 @@ func (this *BaseFromThsHfController) ClassifyRemove() {
 	classifyOb := new(data_manage.BaseFromThsHfClassify)
 	classifyItem, e := classifyOb.GetItemById(req.ClassifyId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Ret = 200
 			br.Success = true
 			br.Msg = "获取成功"

+ 1 - 1
controllers/data_manage/ccf_data.go

@@ -751,7 +751,7 @@ func (this *EdbInfoController) CCFStockTable() {
 	// 若无tableDate默认取最近的有数据的表格
 	item, e := excelOb.GetItemByCondition(cond, pars, fmt.Sprintf("%s DESC", excelOb.Cols().ExcelDate))
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Ret = 200
 			br.Success = true
 			br.Msg = "该日期暂无数据"

+ 1 - 1
controllers/data_manage/chart_classify.go

@@ -817,7 +817,7 @@ func (this *ChartClassifyController) ChartClassifyMove() {
 
 	// 校验移动的父级目录下是否有重名分类
 	exists, e := data_manage.GetChartClassifyByParentIdAndName(req.ParentClassifyId, chartClassifyInfo.ChartClassifyName, req.ClassifyId)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		br.Msg = "移动失败"
 		br.ErrMsg = "获取父级目录下的同名分类失败, Err: " + e.Error()
 		return

+ 9 - 9
controllers/data_manage/chart_framework.go

@@ -227,7 +227,7 @@ func (this *ChartFrameworkController) Add() {
 		pars := make([]interface{}, 0)
 		pars = append(pars, req.FrameworkName, sysUser.AdminId)
 		exist, e := ob.GetItemByCondition(cond, pars)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "操作失败"
 			br.ErrMsg = "获取重名框架失败, Err: " + e.Error()
 			return
@@ -337,7 +337,7 @@ func (this *ChartFrameworkController) Edit() {
 	frameworkOb := new(data_manage.ChartFramework)
 	item, e := frameworkOb.GetItemById(req.ChartFrameworkId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "框架不存在, 请刷新页面"
 			return
 		}
@@ -353,7 +353,7 @@ func (this *ChartFrameworkController) Edit() {
 		pars := make([]interface{}, 0)
 		pars = append(pars, req.ChartFrameworkId, req.FrameworkName, sysUser.AdminId)
 		exist, e := ob.GetItemByCondition(cond, pars)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "操作失败"
 			br.ErrMsg = "获取重名框架失败, Err: " + e.Error()
 			return
@@ -451,7 +451,7 @@ func (this *ChartFrameworkController) Remove() {
 	ob := new(data_manage.ChartFramework)
 	item, e := ob.GetItemById(req.ChartFrameworkId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Ret = 200
 			br.Success = true
 			br.Msg = "操作成功"
@@ -521,7 +521,7 @@ func (this *ChartFrameworkController) Rename() {
 	frameworkOb := new(data_manage.ChartFramework)
 	item, e := frameworkOb.GetItemById(req.ChartFrameworkId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "框架不存在, 请刷新页面"
 			return
 		}
@@ -537,7 +537,7 @@ func (this *ChartFrameworkController) Rename() {
 		pars := make([]interface{}, 0)
 		pars = append(pars, req.ChartFrameworkId, req.FrameworkName, sysUser.AdminId)
 		exist, e := ob.GetItemByCondition(cond, pars)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "操作失败"
 			br.ErrMsg = "获取重名框架失败, Err: " + e.Error()
 			return
@@ -606,7 +606,7 @@ func (this *ChartFrameworkController) EditPublic() {
 	frameworkOb := new(data_manage.ChartFramework)
 	item, e := frameworkOb.GetItemById(req.ChartFrameworkId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "框架不存在, 请刷新页面"
 			return
 		}
@@ -673,7 +673,7 @@ func (this *ChartFrameworkController) Move() {
 	frameworkOb := new(data_manage.ChartFramework)
 	item, e := frameworkOb.GetItemById(req.ChartFrameworkId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "框架不存在, 请刷新页面"
 			return
 		}
@@ -781,7 +781,7 @@ func (this *ChartFrameworkController) Detail() {
 	frameworkOb := new(data_manage.ChartFramework)
 	item, e := frameworkOb.GetItemById(frameworkId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "框架不存在, 请刷新页面"
 			return
 		}

+ 7 - 7
controllers/data_manage/correlation/correlation_chart_info.go

@@ -1191,7 +1191,7 @@ func (this *CorrelationChartInfoController) Copy() {
 
 		_, e = data_manage.GetChartClassifyById(req.ChartClassifyId)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				br.Msg = "分类不存在"
 				return
 			}
@@ -1204,7 +1204,7 @@ func (this *CorrelationChartInfoController) Copy() {
 	// 图表信息
 	originChart, e := data_manage.GetChartInfoById(req.ChartInfoId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "原图表不存在"
 			return
 		}
@@ -1221,7 +1221,7 @@ func (this *CorrelationChartInfoController) Copy() {
 	// 相关性图
 	originCorrelate := new(data_manage.ChartInfoCorrelation)
 	if e = originCorrelate.GetItemById(req.ChartInfoId); e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "原相关性图表不存在"
 			return
 		}
@@ -2307,7 +2307,7 @@ func (this *CorrelationChartInfoController) MultiFactorAdd() {
 
 		_, e = data_manage.GetChartClassifyById(req.ClassifyId)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				br.Msg = "分类不存在"
 				return
 			}
@@ -2663,7 +2663,7 @@ func (this *CorrelationChartInfoController) MultiFactorEdit() {
 
 	chartInfo, e := data_manage.GetChartInfoById(req.ChartInfoId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "图表已被删除, 请刷新页面"
 			return
 		}
@@ -2715,7 +2715,7 @@ func (this *CorrelationChartInfoController) MultiFactorEdit() {
 
 		_, e = data_manage.GetChartClassifyById(req.ClassifyId)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				br.Msg = "分类不存在"
 				return
 			}
@@ -2916,7 +2916,7 @@ func (this *CorrelationChartInfoController) MultiFactorDetail() {
 
 	chartInfo, e := data_manage.GetChartInfoByUniqueCode(uniqueCode)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "图表已被删除, 请刷新页面"
 			return
 		}

+ 1 - 1
controllers/data_manage/cross_variety/chart_info.go

@@ -1796,7 +1796,7 @@ func (c *ChartInfoController) Save() {
 
 	chartItem, e := data_manage.GetChartInfoById(req.ChartInfoId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "图表已被删除, 请刷新页面"
 			return
 		}

+ 2 - 2
controllers/data_manage/data_manage_permission/message.go

@@ -129,7 +129,7 @@ func (c *DataMangePermissionController) MessageRead() {
 	messageOb := new(data_manage_permission.DataPermissionMessage)
 	messageItem, e := messageOb.GetItemById(req.MessageId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "消息不存在, 请刷新页面"
 			return
 		}
@@ -221,7 +221,7 @@ func (c *DataMangePermissionController) MessageDetail() {
 	messageOb := new(data_manage_permission.DataPermissionMessage)
 	messageItem, e := messageOb.GetItemById(messageId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "消息不存在, 请刷新页面"
 			return
 		}

+ 4 - 4
controllers/data_manage/edb_info.go

@@ -1932,7 +1932,7 @@ func (this *EdbInfoController) EdbInfoSearch() {
 				searchItem.DataList = dataList
 				// 获取最大最小值
 				edbInfoMaxAndMinInfo, e := data_manage.GetEdbInfoMaxAndMinInfo(source, subSource, edbCode)
-				if e != nil && e.Error() != utils.ErrNoRow() {
+				if e != nil && !utils.IsErrNoRow(e) {
 					br.Msg = "获取失败"
 					br.ErrMsg = "获取数据失败, GetEdbInfoMaxAndMinInfo Err:" + e.Error()
 					return
@@ -5539,7 +5539,7 @@ func (this *EdbInfoController) EdbChartList() {
 	classifyId, _ := this.GetInt("ClassifyId")
 	if classifyId > 0 {
 		childClassify, e, _ := data.GetChildClassifyByClassifyId(classifyId)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "获取失败"
 			br.ErrMsg = "获取分类信息失败, GetEdbClassify,Err:" + e.Error()
 			return
@@ -5794,7 +5794,7 @@ func (this *EdbInfoController) ChartImageSet() {
 
 	edbInfo, e := data_manage.GetEdbInfoById(req.EdbInfoId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "找不到该指标"
 			return
 		}
@@ -6745,7 +6745,7 @@ func (this *EdbInfoController) ChartImageSetBySvg() {
 
 	edbInfo, e := data_manage.GetEdbInfoById(edbInfoId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "找不到该指标"
 			return
 		}

+ 2 - 2
controllers/data_manage/edb_info_refresh.go

@@ -538,7 +538,7 @@ func (c *EdbInfoController) SaveEdbRefreshStatus() {
 	if isStop == 1 {
 		fromEdbIdList := make([]int, 0)
 		edbList, e := data_manage.GetEdbInfoByIdList(edbIdList)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "获取失败"
 			br.ErrMsg = "获取数据失败,Err:" + e.Error()
 			return
@@ -727,7 +727,7 @@ func (c *EdbInfoController) SaveRelationEdbRefreshStatus() {
 	}
 	//查询指标信息
 	edbList, e := data_manage.GetEdbInfoByIdList(edbIdList)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		br.Msg = "获取失败"
 		br.ErrMsg = "获取数据失败,Err:" + e.Error()
 		return

+ 2 - 2
controllers/data_manage/excel/custom_analysis.go

@@ -966,7 +966,7 @@ func (c *CustomAnalysisController) List() {
 		}
 
 		childClassify, e, _ := excel2.GetChildClassifyByClassifyId(excelClassifyId, source)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "获取失败"
 			br.ErrMsg = "获取分类信息失败, GetEdbClassify,Err:" + e.Error()
 			return
@@ -1066,7 +1066,7 @@ func (c *CustomAnalysisController) Share() {
 
 	excelInfo, e := excelModel.GetExcelInfoById(req.ExcelInfoId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "表格不存在, 请刷新页面"
 			return
 		}

+ 2 - 2
controllers/data_manage/excel/excel_classify.go

@@ -607,7 +607,7 @@ func (this *ExcelClassifyController) DeleteExcelClassifyCheck() {
 			tipsMsg = "该分类下关联表格不可删除"
 		} else {
 			childClassify, e := excel.GetChildClassifyById(req.ExcelClassifyId)
-			if e != nil && e.Error() != utils.ErrNoRow() {
+			if e != nil && !utils.IsErrNoRow(e) {
 				br.Msg = "获取失败"
 				br.ErrMsg = "获取分类信息失败, GetEdbClassify,Err:" + e.Error()
 				return
@@ -713,7 +713,7 @@ func (this *ExcelClassifyController) DeleteExcelClassify() {
 			return
 		} else {
 			childClassify, e := excel.GetChildClassifyById(req.ExcelClassifyId)
-			if e != nil && e.Error() != utils.ErrNoRow() {
+			if e != nil && !utils.IsErrNoRow(e) {
 				br.Msg = "获取失败"
 				br.ErrMsg = "获取分类信息失败, GetEdbClassify,Err:" + e.Error()
 				return

+ 7 - 7
controllers/data_manage/excel/excel_info.go

@@ -91,7 +91,7 @@ func (c *ExcelInfoController) Add() {
 	if req.ExcelClassifyId > 0 {
 		excelClassify, e := excel3.GetExcelClassifyById(req.ExcelClassifyId)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				br.Msg = "分类不存在"
 				br.ErrMsg = "分类不存在"
 				br.IsSendEmail = false
@@ -112,7 +112,7 @@ func (c *ExcelInfoController) Add() {
 	if req.ParentId > 0 {
 		parentExcelInfo, e := excel3.GetExcelInfoById(req.ParentId)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				br.Msg = "父级ETA表格被删除,请刷新页面"
 				return
 			}
@@ -429,7 +429,7 @@ func (c *ExcelInfoController) List() {
 		}
 
 		childClassify, e, _ := excel2.GetChildClassifyByClassifyId(excelClassifyId, source)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "获取失败"
 			br.ErrMsg = "获取分类信息失败, GetEdbClassify,Err:" + e.Error()
 			return
@@ -507,7 +507,7 @@ func (c *ExcelInfoController) List() {
 
 			//获取表格信息
 			tmpList, e := excel3.GetNoContentExcelListByConditionNoPage(newCondition, newPars)
-			if e != nil && e.Error() != utils.ErrNoRow() {
+			if e != nil && !utils.IsErrNoRow(e) {
 				br.Success = true
 				br.Msg = "获取表格信息失败"
 				br.ErrMsg = "获取表格信息失败,Err:" + e.Error()
@@ -885,7 +885,7 @@ func (c *ExcelInfoController) Edit() {
 	if req.ExcelClassifyId > 0 {
 		excelClassify, e := excel3.GetExcelClassifyById(req.ExcelClassifyId)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				br.Msg = "分类不存在"
 				br.ErrMsg = "分类不存在"
 				br.IsSendEmail = false
@@ -905,7 +905,7 @@ func (c *ExcelInfoController) Edit() {
 	if excelInfo.ParentId > 0 {
 		parentExcelInfo, e := excel3.GetExcelInfoById(excelInfo.ParentId)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				br.Msg = "父级ETA表格被删除,请刷新页面"
 				return
 			}
@@ -3708,7 +3708,7 @@ func (c *ExcelInfoController) SaveExcelReference() {
 	addList := make([]*excel3.ReferencedExcelConfig, 0)
 
 	exist, e := excel3.GetReferencedExcelConfig(req.ReferencedId, req.FromScene, req.UniqueCode, req.Uuid)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		br.Msg = "查找引用失败"
 		br.ErrMsg = "查找引用失败,Err:" + e.Error()
 		return

+ 2 - 2
controllers/data_manage/factor_edb_series.go

@@ -328,7 +328,7 @@ func (this *FactorEdbSeriesController) Edit() {
 	seriesOb := new(data_manage.FactorEdbSeries)
 	seriesItem, e := seriesOb.GetItemById(req.SeriesId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "该因子指标系列不存在"
 			return
 		}
@@ -460,7 +460,7 @@ func (this *FactorEdbSeriesController) Detail() {
 	seriesOb := new(data_manage.FactorEdbSeries)
 	series, e := seriesOb.GetItemById(seriesId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "该因子指标系列不存在"
 			return
 		}

+ 1 - 1
controllers/data_manage/future_good/future_good_chart_info.go

@@ -3298,7 +3298,7 @@ func (this *FutureGoodChartInfoController) BaseInfoEdit() {
 
 			edbExist, e := data_manage.GetEdbInfoByCondition(edbCondition, edbPars)
 			if e != nil {
-				if e.Error() != utils.ErrNoRow() {
+				if !utils.IsErrNoRow(e) {
 					br.Msg = "判断英文指标名称是否存在失败"
 					br.ErrMsg = "判断英文指标名称是否存在失败,Err:" + e.Error()
 					return

+ 2 - 2
controllers/data_manage/future_good/future_good_profit_chart_info.go

@@ -165,7 +165,7 @@ func (this *FutureGoodChartInfoController) ProfitChartInfoAdd() {
 		edbInfoId := v.EdbInfoId
 		futureGoodEdbInfo, tmpErr := future_good.GetFutureGoodEdbInfo(edbInfoId)
 		if tmpErr != nil {
-			if tmpErr.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(tmpErr) {
 				br.Msg = "期货商品指标不存在!"
 				br.ErrMsg = "期货商品指标不存在,指标id:" + strconv.Itoa(edbInfoId)
 				return
@@ -520,7 +520,7 @@ func (this *FutureGoodChartInfoController) ProfitChartInfoEdit() {
 		edbInfoId := v.EdbInfoId
 		futureGoodEdbInfo, tmpErr := future_good.GetFutureGoodEdbInfo(edbInfoId)
 		if tmpErr != nil {
-			if tmpErr.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(tmpErr) {
 				br.Msg = "期货商品指标不存在!"
 				br.ErrMsg = "期货商品指标不存在,指标id:" + strconv.Itoa(edbInfoId)
 				return

+ 2 - 2
controllers/data_manage/my_chart.go

@@ -1275,7 +1275,7 @@ func (this *MyChartController) MyChartList() {
 		if isShared {
 			myClassify, e := data_manage.GetMyChartClassifyByClassifyId(myChartClassifyId)
 			if e != nil {
-				if e.Error() == utils.ErrNoRow() {
+				if utils.IsErrNoRow(e) {
 					br.Msg = "分类已被删除, 请刷新页面"
 					return
 				}
@@ -2328,7 +2328,7 @@ func (this *MyChartController) ClassifyFrameworkNodeList() {
 
 	_, e := data_manage.GetMyChartClassifyById(sysUser.AdminId, classifyId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "分类不存在, 请刷新页面"
 			return
 		}

+ 1 - 1
controllers/data_manage/predict_edb_info.go

@@ -80,7 +80,7 @@ func (this *PredictEdbInfoController) EdbChartList() {
 	// 筛选分类
 	if classifyId > 0 {
 		childClassify, e, _ := data.GetChildClassifyByClassifyId(classifyId)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "获取失败"
 			br.ErrMsg = "获取分类信息失败, GetEdbClassify,Err:" + e.Error()
 			return

+ 2 - 2
controllers/data_manage/range_analysis/chart_classify.go

@@ -503,7 +503,7 @@ func (this *RangeChartClassifyController) DeleteChartClassify() {
 		chartSeriesOb := new(data_manage.FactorEdbSeriesChartMapping)
 		seriesMappingItem, e := chartSeriesOb.GetItemByChartInfoId(chartInfo.ChartInfoId)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 			} else {
 				br.Msg = "删除失败"
 				br.ErrMsg = "获取图表关联失败, Err: " + e.Error()
@@ -527,7 +527,7 @@ func (this *RangeChartClassifyController) DeleteChartClassify() {
 		}
 		// 删除配置关联指标数据
 		multiConfig, e := data_manage.GetMultipleGraphConfigChartMappingByChartId(chartInfo.ChartInfoId)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "删除失败"
 			br.ErrMsg = "获取图表关联配置失败, Err: " + e.Error()
 			return

+ 4 - 4
controllers/data_manage/range_analysis/chart_info.go

@@ -73,7 +73,7 @@ func (this *RangeChartChartInfoController) Preview() {
 	for _, v := range req.ChartEdbInfoList {
 		edbInfoMapping, e := data_manage.GetChartEdbMappingByEdbInfoId(v.EdbInfoId)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				br.Msg = v.EdbAliasName + "指标不存在"
 				br.ErrMsg = v.EdbAliasName + "指标不存在"
 				return
@@ -1147,7 +1147,7 @@ func (this *RangeChartChartInfoController) Copy() {
 
 		_, e = data_manage.GetChartClassifyById(req.ChartClassifyId)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				br.Msg = "分类不存在"
 				return
 			}
@@ -1160,7 +1160,7 @@ func (this *RangeChartChartInfoController) Copy() {
 	// 图表信息
 	originChart, e := data_manage.GetChartInfoById(req.ChartInfoId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "原图表不存在"
 			return
 		}
@@ -1942,7 +1942,7 @@ func (this *RangeChartChartInfoController) BaseInfoEdit() {
 
 	chartItem, e := data_manage.GetChartInfoById(req.ChartInfoId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "图表已被删除, 请刷新页面"
 			return
 		}

+ 3 - 3
controllers/data_manage/wind_data.go

@@ -38,7 +38,7 @@ func (this *EdbInfoController) WindClassify() {
 	if parentId == 0 {
 		// 查询wind指标的所有一级分类
 		classifyIdList, e := data_manage.GetEdbClassifyIdListBySource(utils.DATA_SOURCE_WIND)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "获取失败"
 			br.ErrMsg = "获取分类列表失败,Err:" + e.Error()
 			return
@@ -53,7 +53,7 @@ func (this *EdbInfoController) WindClassify() {
 		}
 		// 查询wind指标的所有一级分类下的指标信息
 		rootIds, e := data_manage.GetEdbClassifyRootIdsByClassifyIds(classifyIdList)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "获取失败"
 			br.ErrMsg = "获取分类列表失败,Err:" + e.Error()
 			return
@@ -218,7 +218,7 @@ func (this *EdbInfoController) WindEdbInfoList() {
 	edbInfoId, _ := this.GetInt("EdbInfoId")
 	if classifyId > 0 {
 		childClassify, e, _ := data.GetChildClassifyByClassifyId(classifyId)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "获取失败"
 			br.ErrMsg = "获取分类信息失败, GetEdbClassify,Err:" + e.Error()
 			return

+ 1 - 1
controllers/data_source/data_source.go

@@ -124,7 +124,7 @@ func (c *DataSourceController) SearchByEs() {
 		var updateEs bool
 		if v.StartDate == "" || v.EndDate == "" || v.LatestValue == "" || v.LatestValue == "0" {
 			minMax, e := dataSourceModel.GetBaseIndexDataMinMax(v.Source, v.SubSource, v.IndexCode)
-			if e != nil && e.Error() != utils.ErrNoRow() {
+			if e != nil && !utils.IsErrNoRow(e) {
 				br.Msg = "获取失败"
 				br.ErrMsg = fmt.Sprintf("获取指标开始结束时间失败, %v", e)
 				return

+ 2 - 2
controllers/english_report/email.go

@@ -187,7 +187,7 @@ func (this *EnglishReportEmailController) Save() {
 
 	// 英文客户以邮箱为主, 邮箱去重, 手机号非必填, 此处不做手机号去重
 	exist, e := models.GetEnglishReportEmailByEmail(req.Email)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		br.Msg = "保存失败"
 		br.ErrMsg = "获取同名邮箱失败, Err:" + e.Error()
 		return
@@ -933,7 +933,7 @@ func (this *EnglishReportEmailController) ImportListMatch() {
 	}
 	companyItem, e := models.GetEnglishCompanyById(companyId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "客户已被删除, 请刷新页面"
 			return
 		}

+ 5 - 5
controllers/english_report/en_permission.go

@@ -62,7 +62,7 @@ func (this *EnPermissionController) Add() {
 	existPars := make([]interface{}, 0)
 	existPars = append(existPars, req.PermissionName, req.ParentId)
 	exist, e := existOB.GetItemByCondition(existCond, existPars)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		br.Msg = "操作失败"
 		br.ErrMsg = "获取重名品种权限失败, Err: " + e.Error()
 		return
@@ -143,7 +143,7 @@ func (this *EnPermissionController) Edit() {
 	existPars := make([]interface{}, 0)
 	existPars = append(existPars, req.PermissionName, req.ParentId, req.PermissionId)
 	exist, e := ob.GetItemByCondition(existCond, existPars)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		br.Msg = "操作失败"
 		br.ErrMsg = "获取重名品种权限失败, Err: " + e.Error()
 		return
@@ -155,7 +155,7 @@ func (this *EnPermissionController) Edit() {
 
 	item, e := ob.GetItemById(req.PermissionId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "品种不存在, 请刷新页面"
 			return
 		}
@@ -384,7 +384,7 @@ func (this *EnPermissionController) Remove() {
 	ob := new(models.EnPermission)
 	item, e := ob.GetItemById(req.PermissionId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "品种不存在, 请刷新页面"
 			return
 		}
@@ -522,7 +522,7 @@ func (this *EnPermissionController) SetEnabled() {
 
 	item, e := ob.GetItemById(req.PermissionId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "品种不存在, 请刷新页面"
 			return
 		}

+ 3 - 3
controllers/english_report/english_classify.go

@@ -377,7 +377,7 @@ func (this *EnglishReportController) EditClassify() {
 	//判断是否已存在同个名称的分类
 	existItem, e := models.GetEnglishClassifyByClassifyNameParentId(classifyName, parentId)
 	if e != nil {
-		if e.Error() != utils.ErrNoRow() {
+		if !utils.IsErrNoRow(e) {
 			br.Msg = "查询已存在的分类出错"
 			br.ErrMsg = "查询已存在的分类出错, Err:" + e.Error()
 			return
@@ -505,7 +505,7 @@ func (this *EnglishReportController) DelClassify() {
 	// 	return
 	// }
 	reportCount, e := models.GetEnglishReportCounts(classifyId, classifyInfo.ParentId)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		br.Msg = "获取信息失败"
 		br.ErrMsg = "获取失败,Err:" + e.Error()
 		return
@@ -517,7 +517,7 @@ func (this *EnglishReportController) DelClassify() {
 		return
 	}
 	videoCount, e := models.GetEnglishVideoCounts(classifyId, classifyInfo.ParentId)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		br.Msg = "获取信息失败"
 		br.ErrMsg = "获取失败,Err:" + e.Error()
 		return

+ 2 - 2
controllers/english_report/english_company.go

@@ -266,7 +266,7 @@ func (this *EnglishCompanyController) Save() {
 
 	// 重名校验
 	exist, e := models.GetEnglishCompanyByName(req.CompanyName)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		br.Msg = "保存失败"
 		br.ErrMsg = "获取客户信息失败, Err:" + e.Error()
 		return
@@ -721,7 +721,7 @@ func (this *EnglishCompanyController) SavePermission() {
 	nowTime := time.Now().Local()
 	item, e := models.GetEnglishCompanyById(req.CompanyId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "客户已被删除, 请刷新页面"
 			return
 		}

+ 2 - 2
controllers/english_report/english_company_todo.go

@@ -2,12 +2,12 @@ package english_report
 
 import (
 	"encoding/json"
-	"github.com/rdlucklib/rdluck_tools/paging"
 	"eta/eta_api/controllers"
 	"eta/eta_api/models"
 	"eta/eta_api/models/system"
 	"eta/eta_api/services"
 	"eta/eta_api/utils"
+	"github.com/rdlucklib/rdluck_tools/paging"
 	"html"
 	"time"
 )
@@ -524,7 +524,7 @@ func (this *EnglishCompanyTodoController) LastPublicTodo() {
 	}
 
 	item, e := models.GetLastEnglishCompanyTodoPublic()
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		br.Msg = "获取失败"
 		br.ErrMsg = "获取最新的公共TODO失败, Err: " + e.Error()
 		return

+ 6 - 6
controllers/english_report/report.go

@@ -94,7 +94,7 @@ func (this *EnglishReportController) Add() {
 	}
 	reportClassify, e := models.GetEnglishReportClassifyById(req.ClassifyIdFirst)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "报告所在分类异常"
 			return
 		}
@@ -250,7 +250,7 @@ func (this *EnglishReportController) Edit() {
 	var stage int
 	report, e := models.GetEnglishReportById(int(req.ReportId))
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "报告已被删除, 请刷新页面"
 			return
 		}
@@ -1333,7 +1333,7 @@ func (this *EnglishReportController) SubmitApprove() {
 	reportOb := new(models.EnglishReport)
 	reportItem, e := reportOb.GetItemById(reportId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "报告已被删除, 请刷新页面"
 			return
 		}
@@ -1343,7 +1343,7 @@ func (this *EnglishReportController) SubmitApprove() {
 	}
 	reportClassify, e := models.GetEnglishReportClassifyById(reportItem.ClassifyIdFirst)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "报告所在分类异常"
 			return
 		}
@@ -1434,7 +1434,7 @@ func (this *EnglishReportController) CancelApprove() {
 	reportOb := new(models.EnglishReport)
 	reportItem, e := reportOb.GetItemById(reportId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "报告已被删除, 请刷新页面"
 			return
 		}
@@ -1444,7 +1444,7 @@ func (this *EnglishReportController) CancelApprove() {
 	}
 	reportClassify, e := models.GetEnglishReportClassifyById(reportItem.ClassifyIdFirst)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "报告所在分类异常"
 			return
 		}

+ 1 - 1
controllers/eta_trial/questionnaire.go

@@ -56,7 +56,7 @@ func (this *EtaTrialController) QuestionnairePopUp() {
 	}
 
 	fillItem, e := eta_trial.GetQuestionnaireFillRecordCountByMobile(sysUser.Mobile)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		br.Msg = "获取失败"
 		br.ErrMsg = "获取数据失败失败,GetQuestionnaireFillRecordCountByMobile Err:" + e.Error()
 		return

+ 1 - 1
controllers/ppt_english.go

@@ -723,7 +723,7 @@ func (this *PptEnglishController) SaveLog() {
 	//变更ppt内容
 	pptItem, e := ppt_english.GetPptEnglishById(int(req.PptId))
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "PPT已被删除, 请刷新页面"
 			return
 		}

+ 1 - 1
controllers/ppt_v2.go

@@ -692,7 +692,7 @@ func (this *PptV2Controller) SaveLog() {
 	//变更ppt内容
 	pptItem, e := models.GetPptV2ById(int(req.PptId))
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "PPT已被删除, 请刷新页面"
 			return
 		}

+ 7 - 7
controllers/report_approve/report_approve.go

@@ -484,7 +484,7 @@ func (this *ReportApproveController) Detail() {
 	approveOb := new(report_approve.ReportApprove)
 	approveItem, e := approveOb.GetItemById(approveId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "审批已被删除, 请刷新页面"
 			return
 		}
@@ -718,7 +718,7 @@ func (this *ReportApproveController) Approve() {
 	approveOb := new(report_approve.ReportApprove)
 	approveItem, e := approveOb.GetItemById(req.ReportApproveId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "审批不存在, 请刷新页面"
 			return
 		}
@@ -739,7 +739,7 @@ func (this *ReportApproveController) Approve() {
 	recordPars = append(recordPars, approveItem.ReportApproveId, sysUser.AdminId, report_approve.ReportApproveStateApproving)
 	recordItem, e := recordOb.GetItemByCondition(recordCond, recordPars, "")
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "无权审批"
 			return
 		}
@@ -802,7 +802,7 @@ func (this *ReportApproveController) Refuse() {
 	approveOb := new(report_approve.ReportApprove)
 	approveItem, e := approveOb.GetItemById(req.ReportApproveId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "审批不存在, 请刷新页面"
 			return
 		}
@@ -823,7 +823,7 @@ func (this *ReportApproveController) Refuse() {
 	recordPars = append(recordPars, approveItem.ReportApproveId, sysUser.AdminId, report_approve.ReportApproveStateApproving)
 	recordItem, e := recordOb.GetItemByCondition(recordCond, recordPars, "")
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "无权审批"
 			return
 		}
@@ -881,7 +881,7 @@ func (this *ReportApproveController) Cancel() {
 	approveOb := new(report_approve.ReportApprove)
 	approveItem, e := approveOb.GetItemById(req.ReportApproveId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "审批已被删除, 请刷新页面"
 			return
 		}
@@ -1028,7 +1028,7 @@ func (this *ReportApproveController) MessageRead() {
 	messageOb := new(report_approve.ReportApproveMessage)
 	messageItem, e := messageOb.GetItemById(req.MessageId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "消息不存在, 请刷新页面"
 			return
 		}

+ 6 - 6
controllers/report_approve/report_approve_flow.go

@@ -266,7 +266,7 @@ func (this *ReportApproveFlowController) Add() {
 		existPars := make([]interface{}, 0)
 		existPars = append(existPars, req.ReportType, req.ClassifyFirstId, req.ClassifySecondId, req.ClassifyThirdId)
 		exist, e := flowOb.GetItemByCondition(existCond, existPars, "")
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "获取失败"
 			br.ErrMsg = "获取审批流是否已存在失败, Err: " + e.Error()
 			return
@@ -401,7 +401,7 @@ func (this *ReportApproveFlowController) Edit() {
 	flowOb := new(report_approve.ReportApproveFlow)
 	flowItem, e := flowOb.GetItemById(req.ReportApproveFlowId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "审批流已被删除, 请刷新页面"
 			return
 		}
@@ -416,7 +416,7 @@ func (this *ReportApproveFlowController) Edit() {
 		existPars := make([]interface{}, 0)
 		existPars = append(existPars, req.ReportType, req.ClassifyFirstId, req.ClassifySecondId, req.ClassifyThirdId, req.ReportApproveFlowId)
 		exist, e := flowOb.GetItemByCondition(existCond, existPars, "")
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "操作失败"
 			br.ErrMsg = "获取审批流是否已存在失败, Err: " + e.Error()
 			return
@@ -530,7 +530,7 @@ func (this *ReportApproveFlowController) Detail() {
 	flowOb := new(report_approve.ReportApproveFlow)
 	flowItem, e := flowOb.GetItemById(flowId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "审批流已被删除, 请刷新页面"
 			return
 		}
@@ -600,7 +600,7 @@ func (this *ReportApproveFlowController) Remove() {
 	flowOb := new(report_approve.ReportApproveFlow)
 	flowItem, e := flowOb.GetItemById(req.ReportApproveFlowId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "审批流已被删除, 请刷新页面"
 			return
 		}
@@ -668,7 +668,7 @@ func (this *ReportApproveFlowController) ReportClassifyTree() {
 		flowOb := new(report_approve.ReportApproveFlow)
 		flowItem, e := flowOb.GetItemById(flowId)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				br.Msg = "审批流已被删除, 请刷新页面"
 				return
 			}

+ 1 - 1
controllers/report_chapter.go

@@ -1681,7 +1681,7 @@ func checkOpPermission(sysUser *system.Admin, reportInfo *models.Report, reportC
 	//	chapterGrantObj := report.ReportChapterGrant{}
 	//	_, tmpErr := chapterGrantObj.GetGrantByIdAndAdmin(reportChapterInfo.ReportChapterId, sysUser.AdminId)
 	//	if tmpErr != nil {
-	//		if tmpErr.Error() == utils.ErrNoRow() {
+	//		if utils.IsErrNoRow(tmpErr) {
 	//			msg = "没有权限"
 	//			errMsg = "没有权限"
 	//			isSendEmail = false

+ 2 - 2
controllers/report_chapter_type.go

@@ -132,7 +132,7 @@ func (this *ReportChapterTypeController) Add() {
 	pars := make([]interface{}, 0)
 	pars = append(pars, req.ReportChapterTypeName, req.ClassifyId)
 	exists, e := models.GetReportChapterTypeByCondition(cond, pars)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		br.Msg = "操作失败"
 		br.ErrMsg = "获取重名报告章节失败, Err:" + e.Error()
 		return
@@ -263,7 +263,7 @@ func (this *ReportChapterTypeController) Edit() {
 	pars := make([]interface{}, 0)
 	pars = append(pars, req.ReportChapterTypeName, req.ClassifyId)
 	exists, e := models.GetReportChapterTypeByCondition(cond, pars)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		br.Msg = "操作失败"
 		br.ErrMsg = "获取重名报告章节失败, Err:" + e.Error()
 		return

+ 4 - 4
controllers/report_v2.go

@@ -574,7 +574,7 @@ func (this *ReportController) Edit() {
 
 	reportInfo, e := models.GetReportByReportId(int(req.ReportId))
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "报告已被删除, 请刷新页面"
 			return
 		}
@@ -1166,7 +1166,7 @@ func (this *ReportController) EditLayoutImg() {
 
 	reportInfo, e := models.GetReportByReportId(int(req.ReportId))
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "报告已被删除, 请刷新页面"
 			return
 		}
@@ -1508,7 +1508,7 @@ func (this *ReportController) SubmitApprove() {
 	reportOb := new(models.Report)
 	reportItem, e := reportOb.GetItemById(reportId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "报告已被删除, 请刷新页面"
 			return
 		}
@@ -1625,7 +1625,7 @@ func (this *ReportController) CancelApprove() {
 	reportOb := new(models.Report)
 	reportItem, e := reportOb.GetItemById(reportId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "报告已被删除, 请刷新页面"
 			return
 		}

+ 6 - 6
controllers/semantic_analysis/sa_compare.go

@@ -73,7 +73,7 @@ func (this *SaCompareController) Save() {
 	existPars := make([]interface{}, 0)
 	existPars = append(existPars, req.Title)
 	e := existItem.GetItemByCondition(existCond, existPars)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		br.Msg = "获取重名标题的比对失败"
 		br.ErrMsg = "获取重名标题比对失败, Err: " + e.Error()
 		return
@@ -476,7 +476,7 @@ func (this *SaCompareController) Del() {
 	item := new(saModel.SaCompare)
 	e := item.GetItemById(req.SaCompareId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "文档比对已被删除, 请刷新页面"
 			return
 		}
@@ -572,7 +572,7 @@ func (this *SaCompareController) Move() {
 	item := new(saModel.SaCompare)
 	e := item.GetItemById(req.SaCompareId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "比对已被删除, 请刷新页面"
 			return
 		}
@@ -593,7 +593,7 @@ func (this *SaCompareController) Move() {
 	if req.PrevSaCompareId > 0 {
 		prevCompare := new(saModel.SaCompare)
 		if e = prevCompare.GetItemById(req.PrevSaCompareId); e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				br.Msg = "上一个比对已被删除, 请刷新页面"
 				return
 			}
@@ -605,7 +605,7 @@ func (this *SaCompareController) Move() {
 		if req.NextSaCompareId > 0 {
 			nextCompare := new(saModel.SaCompare)
 			if e = nextCompare.GetItemById(req.NextSaCompareId); e != nil {
-				if e.Error() == utils.ErrNoRow() {
+				if utils.IsErrNoRow(e) {
 					br.Msg = "下一个比对已被删除, 请刷新页面"
 					return
 				}
@@ -625,7 +625,7 @@ func (this *SaCompareController) Move() {
 		item.Sort = prevCompare.Sort + 1
 	} else {
 		firstCompare, e := saModel.GetFirstSortSaCompare(req.SaCompareClassifyId)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "操作失败"
 			br.ErrMsg = "获取首个比对失败, Err: " + e.Error()
 			return

+ 3 - 3
controllers/semantic_analysis/sa_compare_classify.go

@@ -50,7 +50,7 @@ func (this *SaCompareClassifyController) Add() {
 	existCond = fmt.Sprintf(existCond, saModel.SaCompareClassifyColumns.ClassifyName)
 	existPars := make([]interface{}, 0)
 	existPars = append(existPars, req.ClassifyName)
-	if e := existItem.GetItemByCondition(existCond, existPars); e != nil && e.Error() != utils.ErrNoRow() {
+	if e := existItem.GetItemByCondition(existCond, existPars); e != nil && !utils.IsErrNoRow(e) {
 		br.Msg = "操作失败"
 		br.ErrMsg = "获取重名比对分类失败, Err: " + e.Error()
 		return
@@ -117,7 +117,7 @@ func (this *SaCompareClassifyController) Edit() {
 	existCond := fmt.Sprintf(` AND %s = ? AND %s <> ? `, saModel.SaCompareClassifyColumns.ClassifyName, saModel.SaCompareClassifyColumns.SaCompareClassifyId)
 	existPars := make([]interface{}, 0)
 	existPars = append(existPars, req.ClassifyName, req.SaCompareClassifyId)
-	if e := existItem.GetItemByCondition(existCond, existPars); e != nil && e.Error() != utils.ErrNoRow() {
+	if e := existItem.GetItemByCondition(existCond, existPars); e != nil && !utils.IsErrNoRow(e) {
 		br.Msg = "操作失败"
 		br.ErrMsg = "获取重名比对分类失败, Err: " + e.Error()
 		return
@@ -180,7 +180,7 @@ func (this *SaCompareClassifyController) Del() {
 	item := new(saModel.SaCompareClassify)
 	e := item.GetItemById(req.SaCompareClassifyId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "比对分类已被删除, 请刷新页面"
 			return
 		}

+ 9 - 9
controllers/semantic_analysis/sa_doc.go

@@ -65,7 +65,7 @@ func (this *SaDocController) Add() {
 	existCond = fmt.Sprintf(existCond, saModel.SaDocColumns.Title, saModel.SaDocColumns.ContentMd5)
 	existPars := make([]interface{}, 0)
 	existPars = append(existPars, req.Title, contentMd5)
-	if e := existItem.GetItemByCondition(existCond, existPars); e != nil && e.Error() != utils.ErrNoRow() {
+	if e := existItem.GetItemByCondition(existCond, existPars); e != nil && !utils.IsErrNoRow(e) {
 		br.Msg = "操作失败"
 		br.ErrMsg = "获取重复文档失败, Err: " + e.Error()
 		return
@@ -183,7 +183,7 @@ func (this *SaDocController) Edit() {
 	item := new(saModel.SaDoc)
 	e := item.GetItemById(req.SaDocId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "文档已被删除, 请刷新页面"
 			return
 		}
@@ -292,7 +292,7 @@ func (this *SaDocController) Del() {
 	item := new(saModel.SaDoc)
 	e := item.GetItemById(req.SaDocId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "文档已被删除, 请刷新页面"
 			return
 		}
@@ -372,7 +372,7 @@ func (this *SaDocController) Detail() {
 	item := new(saModel.SaDoc)
 	e := item.GetItemById(docId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "文档已被删除, 请刷新页面"
 			return
 		}
@@ -407,7 +407,7 @@ func (this *SaDocController) Detail() {
 		usePars := make([]interface{}, 0)
 		usePars = append(usePars, secIds)
 		countList, e := useOB.GetGroupCountByCondition(useCond, usePars, saModel.SaCompareLabelColumns.SectionId)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "获取失败"
 			br.ErrMsg = "获取标签段落引用数失败, Err: " + e.Error()
 			return
@@ -564,7 +564,7 @@ func (this *SaDocController) Move() {
 	item := new(saModel.SaDoc)
 	e := item.GetItemById(req.SaDocId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "文档已被删除, 请刷新页面"
 			return
 		}
@@ -586,7 +586,7 @@ func (this *SaDocController) Move() {
 	if req.PrevSaDocId > 0 {
 		prevDoc := new(saModel.SaDoc)
 		if e = prevDoc.GetItemById(req.PrevSaDocId); e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				br.Msg = "上一个文档已被删除, 请刷新页面"
 				return
 			}
@@ -598,7 +598,7 @@ func (this *SaDocController) Move() {
 		if req.NextSaDocId > 0 {
 			nextDoc := new(saModel.SaDoc)
 			if e = nextDoc.GetItemById(req.NextSaDocId); e != nil {
-				if e.Error() == utils.ErrNoRow() {
+				if utils.IsErrNoRow(e) {
 					br.Msg = "下一个文档已被删除, 请刷新页面"
 					return
 				}
@@ -618,7 +618,7 @@ func (this *SaDocController) Move() {
 		item.Sort = prevDoc.Sort + 1
 	} else {
 		firstDoc, e := saModel.GetFirstSortSaDoc(req.SaDocClassifyId)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "操作失败"
 			br.ErrMsg = "获取首个文档失败, Err: " + e.Error()
 			return

+ 4 - 4
controllers/semantic_analysis/sa_doc_classify.go

@@ -2,12 +2,12 @@ package semantic_analysis
 
 import (
 	"encoding/json"
-	"fmt"
 	"eta/eta_api/controllers"
 	"eta/eta_api/models"
 	saModel "eta/eta_api/models/semantic_analysis"
 	"eta/eta_api/services/alarm_msg"
 	"eta/eta_api/utils"
+	"fmt"
 	"strings"
 	"time"
 )
@@ -50,7 +50,7 @@ func (this *SaDocClassifyController) Add() {
 	existCond = fmt.Sprintf(existCond, saModel.SaDocClassifyColumns.ClassifyName)
 	existPars := make([]interface{}, 0)
 	existPars = append(existPars, req.ClassifyName)
-	if e := existItem.GetItemByCondition(existCond, existPars); e != nil && e.Error() != utils.ErrNoRow() {
+	if e := existItem.GetItemByCondition(existCond, existPars); e != nil && !utils.IsErrNoRow(e) {
 		br.Msg = "操作失败"
 		br.ErrMsg = "获取重名文档分类失败, Err: " + e.Error()
 		return
@@ -110,7 +110,7 @@ func (this *SaDocClassifyController) Edit() {
 	existCond := fmt.Sprintf(` AND %s = ? AND %s <> ? `, saModel.SaDocClassifyColumns.ClassifyName, saModel.SaDocClassifyColumns.SaDocClassifyId)
 	existPars := make([]interface{}, 0)
 	existPars = append(existPars, req.ClassifyName, req.SaDocClassifyId)
-	if e := existItem.GetItemByCondition(existCond, existPars); e != nil && e.Error() != utils.ErrNoRow() {
+	if e := existItem.GetItemByCondition(existCond, existPars); e != nil && !utils.IsErrNoRow(e) {
 		br.Msg = "操作失败"
 		br.ErrMsg = "获取重名文档分类失败, Err: " + e.Error()
 		return
@@ -181,7 +181,7 @@ func (this *SaDocClassifyController) Del() {
 	item := new(saModel.SaDocClassify)
 	e := item.GetItemById(req.SaDocClassifyId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "文档分类已被删除, 请刷新页面"
 			return
 		}

+ 6 - 6
controllers/semantic_analysis/sa_label.go

@@ -2,14 +2,14 @@ package semantic_analysis
 
 import (
 	"encoding/json"
-	"fmt"
-	"github.com/rdlucklib/rdluck_tools/paging"
 	"eta/eta_api/controllers"
 	"eta/eta_api/models"
 	saModel "eta/eta_api/models/semantic_analysis"
 	"eta/eta_api/services"
 	"eta/eta_api/services/alarm_msg"
 	"eta/eta_api/utils"
+	"fmt"
+	"github.com/rdlucklib/rdluck_tools/paging"
 	"strings"
 	"time"
 )
@@ -57,7 +57,7 @@ func (this *SaLabelController) Add() {
 	existCond = fmt.Sprintf(existCond, saModel.SaLabelColumns.LabelName)
 	existPars := make([]interface{}, 0)
 	existPars = append(existPars, req.LabelName)
-	if e := existItem.GetItemByCondition(existCond, existPars); e != nil && e.Error() != utils.ErrNoRow() {
+	if e := existItem.GetItemByCondition(existCond, existPars); e != nil && !utils.IsErrNoRow(e) {
 		br.Msg = "操作失败"
 		br.ErrMsg = "获取重名标签失败, Err: " + e.Error()
 		return
@@ -129,7 +129,7 @@ func (this *SaLabelController) Edit() {
 	existCond := fmt.Sprintf(` AND %s = ? AND %s <> ? `, saModel.SaLabelColumns.LabelName, saModel.SaLabelColumns.SaLabelId)
 	existPars := make([]interface{}, 0)
 	existPars = append(existPars, req.LabelName, req.SaLabelId)
-	if e := existItem.GetItemByCondition(existCond, existPars); e != nil && e.Error() != utils.ErrNoRow() {
+	if e := existItem.GetItemByCondition(existCond, existPars); e != nil && !utils.IsErrNoRow(e) {
 		br.Msg = "操作失败"
 		br.ErrMsg = "获取重名标签失败, Err: " + e.Error()
 		return
@@ -189,7 +189,7 @@ func (this *SaLabelController) Del() {
 	item := new(saModel.SaLabel)
 	e := item.GetItemById(req.SaLabelId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "标签已被删除, 请刷新页面"
 			return
 		}
@@ -280,7 +280,7 @@ func (this *SaLabelController) PageList() {
 		usePars := make([]interface{}, 0)
 		usePars = append(usePars, labelIds)
 		countList, e := useOB.GetGroupCountByCondition(useCond, usePars, saModel.SaCompareLabelColumns.LabelId)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "获取失败"
 			br.ErrMsg = "获取标签段落引用数失败, Err: " + e.Error()
 			return

+ 12 - 12
controllers/smart_report/smart_report.go

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

+ 5 - 5
controllers/smart_report/smart_resource.go

@@ -102,7 +102,7 @@ func (this *SmartReportResourceController) List() {
 	startSize = utils.StartIndex(params.CurrentIndex, params.PageSize)
 
 	fields := []string{
-		"resource_id",  "create_time", "img_name", "img_url", "type","style",
+		"resource_id", "create_time", "img_name", "img_url", "type", "style",
 	}
 	list, e := reportOB.GetPageItemsByCondition(condition, pars, fields, startSize, params.PageSize)
 	if e != nil {
@@ -158,7 +158,7 @@ func (this *SmartReportResourceController) Edit() {
 	ob := new(smart_report.SmartReportResource)
 	item, e := ob.GetItemById(req.ResourceId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "资源不存在, 请刷新页面"
 			return
 		}
@@ -167,7 +167,7 @@ func (this *SmartReportResourceController) Edit() {
 		return
 	}
 
-	cols := []string{"ImgName","Style"}
+	cols := []string{"ImgName", "Style"}
 	item.ImgName = req.ImgName
 	item.Style = req.Style
 
@@ -220,7 +220,7 @@ func (this *SmartReportResourceController) Remove() {
 	ids := strings.Split(req.ResourceIds, ",")
 	for _, idStr := range ids {
 		ob := new(smart_report.SmartReportResource)
-		id,err := strconv.Atoi(idStr)
+		id, err := strconv.Atoi(idStr)
 		if err != nil {
 			br.Msg = "参数解析异常!"
 			br.ErrMsg = "参数解析失败,Err:" + err.Error()
@@ -228,7 +228,7 @@ func (this *SmartReportResourceController) Remove() {
 		}
 		item, e := ob.GetItemById(id)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				br.Ret = 200
 				br.Success = true
 				br.Msg = "操作成功"

+ 10 - 10
controllers/speech_recognition/speech_recognition.go

@@ -321,7 +321,7 @@ func (this *SpeechRecognitionController) Save() {
 	speechOb := new(speech_recognition.SpeechRecognition)
 	speechItem, e := speechOb.GetItemById(req.SpeechRecognitionId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "转写文件不存在,请刷新页面"
 			return
 		}
@@ -336,7 +336,7 @@ func (this *SpeechRecognitionController) Save() {
 			pars := make([]interface{}, 0)
 			pars = append(pars, req.FileName, req.SpeechRecognitionId)
 			exists, e := speechOb.GetItemByCondition(cond, pars, "")
-			if e != nil && e.Error() != utils.ErrNoRow() {
+			if e != nil && !utils.IsErrNoRow(e) {
 				br.Msg = "操作失败"
 				br.ErrMsg = "获取同名转写文件失败, Err: " + e.Error()
 				return
@@ -420,7 +420,7 @@ func (this *SpeechRecognitionController) RemoveFile() {
 	speechOb := new(speech_recognition.SpeechRecognition)
 	speechItem, e := speechOb.GetItemById(req.SpeechRecognitionId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "转写文件不存在,请刷新页面"
 			return
 		}
@@ -485,7 +485,7 @@ func (this *SpeechRecognitionController) Rename() {
 	speechOb := new(speech_recognition.SpeechRecognition)
 	speechItem, e := speechOb.GetItemById(req.SpeechRecognitionId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "转写文件不存在,请刷新页面"
 			return
 		}
@@ -500,7 +500,7 @@ func (this *SpeechRecognitionController) Rename() {
 		pars := make([]interface{}, 0)
 		pars = append(pars, req.FileName, req.SpeechRecognitionId)
 		exists, e := speechOb.GetItemByCondition(cond, pars, "")
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "操作失败"
 			br.ErrMsg = "获取同名转写文件失败, Err: " + e.Error()
 			return
@@ -562,7 +562,7 @@ func (this *SpeechRecognitionController) Remove() {
 	speechOb := new(speech_recognition.SpeechRecognition)
 	speechItem, e := speechOb.GetItemById(req.SpeechRecognitionId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Ret = 200
 			br.Success = true
 			br.Msg = "操作成功"
@@ -629,7 +629,7 @@ func (this *SpeechRecognitionController) SaveTag() {
 	speechOb := new(speech_recognition.SpeechRecognition)
 	_, e := speechOb.GetItemById(req.SpeechRecognitionId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "转写文件不存在,请刷新页面"
 			return
 		}
@@ -935,7 +935,7 @@ func (this *SpeechRecognitionController) Detail() {
 	speechOb := new(speech_recognition.SpeechRecognition)
 	speechItem, e := speechOb.GetItemById(speechId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "转写文件不存在,请刷新页面"
 			return
 		}
@@ -1033,7 +1033,7 @@ func (this *SpeechRecognitionController) Export() {
 	speechOb := new(speech_recognition.SpeechRecognition)
 	speechItem, e := speechOb.GetItemById(req.SpeechRecognitionId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "转写文件不存在,请刷新页面"
 			return
 		}
@@ -1122,7 +1122,7 @@ func (this *SpeechRecognitionController) CheckFileName() {
 	pars := make([]interface{}, 0)
 	pars = append(pars, req.FileName)
 	exists, e := speechOb.GetItemByCondition(cond, pars, "")
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		br.Msg = "操作失败"
 		br.ErrMsg = "获取同名转写文件失败, Err: " + e.Error()
 		return

+ 5 - 5
controllers/speech_recognition/speech_recognition_menu.go

@@ -59,7 +59,7 @@ func (this *SpeechRecognitionMenuController) Add() {
 		pars := make([]interface{}, 0)
 		pars = append(pars, req.MenuName, req.ParentId)
 		exists, e := menuOb.GetItemByCondition(cond, pars, "")
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "操作失败"
 			br.ErrMsg = "获取同名目录失败, Err: " + e.Error()
 			return
@@ -154,7 +154,7 @@ func (this *SpeechRecognitionMenuController) Edit() {
 	menuOb := new(speech_recognition.SpeechRecognitionMenu)
 	menuItem, e := menuOb.GetItemById(req.MenuId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "目录不存在,请刷新页面"
 			return
 		}
@@ -169,7 +169,7 @@ func (this *SpeechRecognitionMenuController) Edit() {
 		pars := make([]interface{}, 0)
 		pars = append(pars, req.MenuName, menuItem.ParentId, req.MenuId)
 		exists, e := menuOb.GetItemByCondition(cond, pars, "")
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "操作失败"
 			br.ErrMsg = "获取同名目录失败, Err: " + e.Error()
 			return
@@ -231,7 +231,7 @@ func (this *SpeechRecognitionMenuController) Remove() {
 	menuOb := new(speech_recognition.SpeechRecognitionMenu)
 	menuItem, e := menuOb.GetItemById(req.MenuId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Ret = 200
 			br.Success = true
 			br.Msg = "操作成功"
@@ -313,7 +313,7 @@ func (this *SpeechRecognitionMenuController) RemoveCheck() {
 	menuOb := new(speech_recognition.SpeechRecognitionMenu)
 	menuItem, e := menuOb.GetItemById(req.MenuId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Ret = 200
 			br.Success = true
 			br.Msg = "操作成功"

+ 5 - 5
controllers/speech_recognition/speech_recognition_tag.go

@@ -62,7 +62,7 @@ func (this *SpeechRecognitionTagController) Add() {
 		pars := make([]interface{}, 0)
 		pars = append(pars, req.TagName)
 		exists, e := tagOb.GetItemByCondition(cond, pars, "")
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "操作失败"
 			br.ErrMsg = "获取同名标签失败, Err: " + e.Error()
 			return
@@ -140,7 +140,7 @@ func (this *SpeechRecognitionTagController) Edit() {
 	tagOb := new(speech_recognition.SpeechRecognitionTag)
 	tagItem, e := tagOb.GetItemById(req.TagId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "标签不存在,请刷新页面"
 			return
 		}
@@ -155,7 +155,7 @@ func (this *SpeechRecognitionTagController) Edit() {
 		pars := make([]interface{}, 0)
 		pars = append(pars, req.TagName, req.TagId)
 		exists, e := tagOb.GetItemByCondition(cond, pars, "")
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "操作失败"
 			br.ErrMsg = "获取同名标签失败, Err: " + e.Error()
 			return
@@ -218,7 +218,7 @@ func (this *SpeechRecognitionTagController) Remove() {
 	tagOb := new(speech_recognition.SpeechRecognitionTag)
 	tagItem, e := tagOb.GetItemById(req.TagId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Ret = 200
 			br.Success = true
 			br.Msg = "操作成功"
@@ -295,7 +295,7 @@ func (this *SpeechRecognitionTagController) RemoveCheck() {
 	tagOb := new(speech_recognition.SpeechRecognitionTag)
 	_, e := tagOb.GetItemById(req.TagId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Ret = 200
 			br.Success = true
 			br.Msg = "操作成功"

+ 5 - 5
controllers/speech_recognition/speech_recognition_tag_menu.go

@@ -60,7 +60,7 @@ func (this *SpeechRecognitionTagMenuController) Add() {
 		pars := make([]interface{}, 0)
 		pars = append(pars, req.MenuName, req.ParentId)
 		exists, e := menuOb.GetItemByCondition(cond, pars, "")
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "操作失败"
 			br.ErrMsg = "获取同名目录失败, Err: " + e.Error()
 			return
@@ -155,7 +155,7 @@ func (this *SpeechRecognitionTagMenuController) Edit() {
 	menuOb := new(speech_recognition.SpeechRecognitionTagMenu)
 	menuItem, e := menuOb.GetItemById(req.MenuId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "目录不存在,请刷新页面"
 			return
 		}
@@ -170,7 +170,7 @@ func (this *SpeechRecognitionTagMenuController) Edit() {
 		pars := make([]interface{}, 0)
 		pars = append(pars, req.MenuName, menuItem.ParentId, req.MenuId)
 		exists, e := menuOb.GetItemByCondition(cond, pars, "")
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "操作失败"
 			br.ErrMsg = "获取同名目录失败, Err: " + e.Error()
 			return
@@ -232,7 +232,7 @@ func (this *SpeechRecognitionTagMenuController) Remove() {
 	menuOb := new(speech_recognition.SpeechRecognitionTagMenu)
 	menuItem, e := menuOb.GetItemById(req.MenuId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Ret = 200
 			br.Success = true
 			br.Msg = "操作成功"
@@ -314,7 +314,7 @@ func (this *SpeechRecognitionTagMenuController) RemoveCheck() {
 	menuOb := new(speech_recognition.SpeechRecognitionTagMenu)
 	menuItem, e := menuOb.GetItemById(req.MenuId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Ret = 200
 			br.Success = true
 			br.Msg = "操作成功"

+ 2 - 2
controllers/sys_admin.go

@@ -387,7 +387,7 @@ func (this *SysAdminController) Add() {
 			return
 		}
 		emailUser, e := system.GetSysUserByEmail(req.Email)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "操作失败"
 			br.ErrMsg = "邮箱获取用户失败"
 			return
@@ -688,7 +688,7 @@ func (this *SysAdminController) Edit() {
 			return
 		}
 		emailUser, e := system.GetSysUserByEmail(req.Email)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "操作失败"
 			br.ErrMsg = "邮箱获取用户信息失败, Err: " + e.Error()
 			return

+ 2 - 2
controllers/sys_role.go

@@ -108,7 +108,7 @@ func (this *SysRoleController) Edit() {
 
 	item, e := system.GetSysRoleById(req.RoleId)
 	if e != nil {
-		if e.Error() != utils.ErrNoRow() {
+		if !utils.IsErrNoRow(e) {
 			br.Msg = "操作失败"
 			br.ErrMsg = "获取角色失败, Err: " + e.Error()
 			return
@@ -117,7 +117,7 @@ func (this *SysRoleController) Edit() {
 		return
 	}
 	exists, e := system.GetSysRoleByName(req.RoleName)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		br.Msg = "操作失败"
 		br.ErrMsg = "获取重名角色失败, Err: " + e.Error()
 		return

+ 7 - 7
controllers/trade_analysis/trade_analysis_correlation.go

@@ -72,7 +72,7 @@ func (this *TradeAnalysisCorrelationController) Preview() {
 	// 标的指标名称
 	if req.TableConfig.BaseEdbInfoId > 0 {
 		baseEdb, e := data_manage.GetEdbInfoById(req.TableConfig.BaseEdbInfoId)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "获取失败"
 			br.ErrMsg = fmt.Sprintf("获取标的指标失败, %v", e)
 			return
@@ -191,7 +191,7 @@ func (this *TradeAnalysisCorrelationController) Save() {
 	if req.ExcelInfoId > 0 {
 		excelItem, e := excel.GetExcelInfoById(req.ExcelInfoId)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				br.Msg = "表格不存在, 请刷新页面"
 				return
 			}
@@ -258,7 +258,7 @@ func (this *TradeAnalysisCorrelationController) Detail() {
 	// 获取表格信息
 	excelItem, e := excel.GetExcelInfoById(excelId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "表格不存在, 请刷新页面"
 			return
 		}
@@ -299,7 +299,7 @@ func (this *TradeAnalysisCorrelationController) Detail() {
 	// 标的指标名称
 	if tableConfig.BaseEdbInfoId > 0 {
 		baseEdb, e := data_manage.GetEdbInfoById(tableConfig.BaseEdbInfoId)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			br.Msg = "获取失败"
 			br.ErrMsg = fmt.Sprintf("获取标的指标失败, %v", e)
 			return
@@ -366,7 +366,7 @@ func (this *TradeAnalysisCorrelationController) SaveAs() {
 	// 原表格
 	excelItem, e := excel.GetExcelInfoById(req.ExcelInfoId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "原表格不存在, 请刷新页面"
 			return
 		}
@@ -453,7 +453,7 @@ func (this *TradeAnalysisCorrelationController) Refresh() {
 	// 获取表格信息
 	item, e := excel.GetExcelInfoById(req.ExcelInfoId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "表格不存在, 请刷新页面"
 			return
 		}
@@ -538,7 +538,7 @@ func (this *TradeAnalysisCorrelationController) Remove() {
 	// 获取表格信息
 	excelItem, e := excel.GetExcelInfoById(req.ExcelInfoId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Ret = 200
 			br.Success = true
 			br.Msg = "操作成功"

+ 5 - 5
controllers/trade_analysis/trade_analysis_table.go

@@ -197,7 +197,7 @@ func (this *TradeAnalysisTableController) Save() {
 	if req.ExcelInfoId > 0 {
 		excelItem, e := excel.GetExcelInfoById(req.ExcelInfoId)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				br.Msg = "表格不存在, 请刷新页面"
 				return
 			}
@@ -317,7 +317,7 @@ func (this *TradeAnalysisTableController) Detail() {
 	// 获取表格信息
 	excelItem, e := excel.GetExcelInfoById(excelId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "表格不存在, 请刷新页面"
 			return
 		}
@@ -439,7 +439,7 @@ func (this *TradeAnalysisTableController) SaveAs() {
 	// 原表格
 	excelItem, e := excel.GetExcelInfoById(req.ExcelInfoId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "原表格不存在, 请刷新页面"
 			return
 		}
@@ -571,7 +571,7 @@ func (this *TradeAnalysisTableController) Refresh() {
 	// 获取表格信息
 	item, e := excel.GetExcelInfoById(req.ExcelInfoId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "表格不存在, 请刷新页面"
 			return
 		}
@@ -656,7 +656,7 @@ func (this *TradeAnalysisTableController) Remove() {
 	// 获取表格信息
 	excelItem, e := excel.GetExcelInfoById(req.ExcelInfoId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Ret = 200
 			br.Success = true
 			br.Msg = "操作成功"

+ 6 - 6
controllers/trade_analysis/warehouse.go

@@ -82,7 +82,7 @@ func (this *WarehouseController) Preview() {
 	if req.ChartInfoId > 0 {
 		chartInfoView, e := data_manage.GetChartInfoViewById(req.ChartInfoId)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				br.Msg = "图表已被删除, 请刷新页面"
 				return
 			}
@@ -365,7 +365,7 @@ func (this *WarehouseController) Add() {
 	// 校验分类
 	_, e := data_manage.GetChartClassifyById(req.ChartClassifyId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "分类不存在, 请刷新页面"
 			return
 		}
@@ -492,7 +492,7 @@ func (this *WarehouseController) Edit() {
 	// 图表校验
 	chartItem, e := data_manage.GetChartInfoById(req.ChartInfoId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "图表不存在, 请刷新页面"
 			return
 		}
@@ -538,7 +538,7 @@ func (this *WarehouseController) Edit() {
 	// 校验分类
 	_, e = data_manage.GetChartClassifyById(req.ChartClassifyId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "分类不存在, 请刷新页面"
 			return
 		}
@@ -1121,7 +1121,7 @@ func (this *WarehouseController) Copy() {
 
 		_, e = data_manage.GetChartClassifyById(req.ChartClassifyId)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				br.Msg = "分类不存在"
 				return
 			}
@@ -1134,7 +1134,7 @@ func (this *WarehouseController) Copy() {
 	// 原图表
 	originChart, e := data_manage.GetChartInfoById(req.ChartInfoId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "原图表不存在"
 			return
 		}

+ 25 - 26
controllers/user_login.go

@@ -151,7 +151,7 @@ func (this *UserLoginController) GetVerifyCode() {
 		}
 		_, e := system.GetSysUserByMobile(req.Mobile)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				br.Msg = "您的手机号未绑定账号, 请检查"
 				return
 			}
@@ -171,7 +171,7 @@ func (this *UserLoginController) GetVerifyCode() {
 		}
 		_, e := system.GetSysUserByEmail(req.Email)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				br.Msg = "您的邮箱未绑定账号, 请检查"
 				return
 			}
@@ -418,7 +418,7 @@ func (this *UserLoginController) Login() {
 		recordOb := new(system.AdminVerifyCodeRecord)
 		_, e := recordOb.GetItemByCondition(recordCond, recordPars)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				br.Msg = "验证码错误, 请重新输入"
 				return
 			}
@@ -429,7 +429,7 @@ func (this *UserLoginController) Login() {
 
 		mobileUser, e := system.GetSysUserByMobile(req.Mobile)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				br.Msg = "您的手机号未绑定账号, 请检查"
 				return
 			}
@@ -466,7 +466,7 @@ func (this *UserLoginController) Login() {
 		recordOb := new(system.AdminVerifyCodeRecord)
 		_, e := recordOb.GetItemByCondition(recordCond, recordPars)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				br.Msg = "验证码错误, 请重新输入"
 				return
 			}
@@ -477,7 +477,7 @@ func (this *UserLoginController) Login() {
 
 		emailUser, e := system.GetSysUserByEmail(req.Email)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				br.Msg = "您的邮箱未绑定账号, 请检查"
 				return
 			}
@@ -649,7 +649,7 @@ func (this *UserLoginController) ForgetAccountGet() {
 
 	sysUser, e := system.GetSysUserByAdminName(req.UserName)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "用户不存在, 请检查"
 			return
 		}
@@ -735,7 +735,7 @@ func (this *UserLoginController) ForgetCodeVerify() {
 		recordOb := new(system.AdminVerifyCodeRecord)
 		_, e := recordOb.GetItemByCondition(recordCond, recordPars)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				br.Msg = "验证码错误, 请重新输入"
 				return
 			}
@@ -765,7 +765,7 @@ func (this *UserLoginController) ForgetCodeVerify() {
 		recordOb := new(system.AdminVerifyCodeRecord)
 		_, e := recordOb.GetItemByCondition(recordCond, recordPars)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				br.Msg = "验证码错误, 请重新输入"
 				return
 			}
@@ -847,7 +847,7 @@ func (this *UserLoginController) ForgetResetPass() {
 
 	sysUser, e := system.GetSysAdminByName(req.UserName)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Msg = "用户不存在, 请检查"
 			return
 		}
@@ -973,7 +973,7 @@ func (this *UserLoginController) CheckUserLdap() {
 	accountUser, e := system.GetSysUserByAdminName(req.UserName)
 	if e != nil {
 		// 无该用户视作普通用户
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			br.Ret = 200
 			br.Data = false
 			br.Success = true
@@ -1058,25 +1058,24 @@ func (this *UserLoginController) BaseInfo() {
 		return
 	}
 
-
 	type BaseInfoResp struct {
-		Icp      *models.BusinessConf `description:"Icp信息"`
-		ETATitle *models.BusinessConf `description:"eta系统名称"`
-		TabName  *models.BusinessConf `description:"tab页名称"`
-		LogoCn   *models.BusinessConf `description:"中文logo"`
-		LogoEn   *models.BusinessConf `description:"英文logo"`
-		LogoCnMini   *models.BusinessConf `description:"中文logoMini"`
-		LogoEnMini   *models.BusinessConf `description:"英文logoMini"`
+		Icp        *models.BusinessConf `description:"Icp信息"`
+		ETATitle   *models.BusinessConf `description:"eta系统名称"`
+		TabName    *models.BusinessConf `description:"tab页名称"`
+		LogoCn     *models.BusinessConf `description:"中文logo"`
+		LogoEn     *models.BusinessConf `description:"英文logo"`
+		LogoCnMini *models.BusinessConf `description:"中文logoMini"`
+		LogoEnMini *models.BusinessConf `description:"英文logoMini"`
 	}
 
 	resp := BaseInfoResp{
-		Icp:      icp,
-		ETATitle: title,
-		TabName:  tabName,
-		LogoCn:   logoCn,
-		LogoEn:   logoEn,
-		LogoCnMini:   logoCnMini,
-		LogoEnMini:   logoEnMini,
+		Icp:        icp,
+		ETATitle:   title,
+		TabName:    tabName,
+		LogoCn:     logoCn,
+		LogoEn:     logoEn,
+		LogoCnMini: logoCnMini,
+		LogoEnMini: logoEnMini,
 	}
 
 	br.Data = resp

+ 1 - 1
services/ai_predict_model_classify.go

@@ -72,7 +72,7 @@ func AiPredictModelMoveClassify(req aiPredictModel.AiPredictModelClassifyMoveReq
 		}
 		// 如果是移动目录, 那么校验一下父级目录下是否有重名目录
 		exists, e := data_manage.GetEdbClassifyByParentIdAndName(parentClassifyId, edbClassifyInfo.ClassifyName, classifyId)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			errMsg = "移动失败"
 			err = fmt.Errorf("获取父级分类下的同名分类失败, Err: %s", e.Error())
 			return

+ 2 - 2
services/chart_permission.go

@@ -28,7 +28,7 @@ func AddChartPermission(req models.PermissionAddReq) (err error, errMsg string)
 	existPars := make([]interface{}, 0)
 	existPars = append(existPars, req.PermissionName, req.ParentId)
 	exist, e := ob.GetItemByCondition(existCond, existPars)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		errMsg = "操作失败"
 		err = fmt.Errorf("获取重名品种权限失败, Err: " + e.Error())
 		return
@@ -129,7 +129,7 @@ func EditChartPermission(req models.PermissionEditReq) (err error, errMsg string
 		existPars := make([]interface{}, 0)
 		existPars = append(existPars, req.PermissionName, item.ParentId, req.PermissionId)
 		exist, e := ob.GetItemByCondition(existCond, existPars)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			errMsg = "操作失败"
 			err = fmt.Errorf("获取重名品种权限失败, Err: " + e.Error())
 			return

+ 3 - 3
services/classify.go

@@ -385,7 +385,7 @@ func checkClassifyApprove(currClassify *models.Classify) (err error, errMsg stri
 		if tmpErr != nil {
 			err = tmpErr
 			errMsg = "获取父级分类信息失败"
-			if tmpErr.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(tmpErr) {
 				errMsg = "父级分类不存在"
 			}
 			return
@@ -405,7 +405,7 @@ func checkClassifyApprove(currClassify *models.Classify) (err error, errMsg stri
 		flowItem, e := flowOb.GetItemByCondition(existCond, existPars, "")
 		if e != nil {
 			// 父级分类如果没有审批流,那么就正常进行就好了
-			if e.Error() != utils.ErrNoRow() {
+			if !utils.IsErrNoRow(e) {
 				err = errors.New("获取审批流是否已存在失败, Err: " + e.Error())
 				return
 			}
@@ -695,7 +695,7 @@ func EditReportClassify(classifyId int, classifyName string, chartPermissionIdLi
 
 	// 重名校验
 	existName, e := models.GetClassifyByName(classifyName, item.ParentId)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		errMsg = "获取信息失败"
 		err = errors.New("获取重名分类失败, Err: " + err.Error())
 		return

+ 1 - 1
services/data/base_from_baiinfo.go

@@ -34,7 +34,7 @@ func AddBaiinfoClassify(classifyName string, parentId, sysUserId int, sysUserNam
 	if parentId > 0 {
 		parentClassify, e := data_manage.GetBaseFromBaiinfoClassifyById(parentId)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				err = e
 				errMsg = `一级分类不存在`
 				return

+ 2 - 2
services/data/base_from_bloomberg.go

@@ -57,7 +57,7 @@ func BloombergIndexSource2Edb(req BloombergIndexSource2EdbReq, lang string) (edb
 
 	// 是否新增过指标
 	exist, e := data_manage.GetEdbInfoByEdbCode(source, req.EdbCode)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		err = fmt.Errorf("获取指标是否存在失败, err: %s", e.Error())
 		return
 	}
@@ -69,7 +69,7 @@ func BloombergIndexSource2Edb(req BloombergIndexSource2EdbReq, lang string) (edb
 	// 开始结束时间
 	var startDate, endDate string
 	minMax, e := data_manage.GetEdbInfoMaxAndMinInfo(source, utils.DATA_SUB_SOURCE_EDB, req.EdbCode)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		err = fmt.Errorf("MinMax: 获取指标极值失败, err: %s", e.Error())
 		return
 	}

+ 1 - 1
services/data/base_from_business.go

@@ -35,7 +35,7 @@ func BusinessIndexSource2Edb(req BusinessIndexSource2EdbReq, lang string) (edb *
 
 	// 是否新增过指标
 	exist, e := data_manage.GetEdbInfoByEdbCode(source, req.EdbCode)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		err = fmt.Errorf("获取指标是否存在失败, err: %s", e.Error())
 		return
 	}

+ 1 - 1
services/data/base_from_ccf.go

@@ -23,7 +23,7 @@ func CCFIndexSource2Edb(req data_manage.CCFIndexSource2EdbReq, lang string) (edb
 
 	// 是否新增过指标
 	exist, e := data_manage.GetEdbInfoByEdbCode(source, req.EdbCode)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		err = fmt.Errorf("获取指标是否存在失败, err: %s", e.Error())
 		return
 	}

+ 4 - 4
services/data/base_from_clarksons.go

@@ -273,7 +273,7 @@ func ClarksonsIndexSource2Edb(req ClarksonsIndexSource2EdbReq, lang string) (edb
 
 	// 是否新增过指标
 	exist, e := data_manage.GetEdbInfoByEdbCode(source, req.EdbCode)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		err = fmt.Errorf("获取指标是否存在失败, err: %s", e.Error())
 		return
 	}
@@ -314,7 +314,7 @@ func MoveClarksonsClassify(classifyId, parentClassifyId, prevClassifyId, nextCla
 	if classifyInfo.ParentId != parentClassifyId && parentClassifyId != 0 {
 		// 校验移动的父级目录下是否有重名分类
 		count, e := data_manage.GetBaseFromClarksonsClassifyCount(classifyInfo.ClassifyName, parentClassifyId)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			errMsg = "移动失败"
 			err = errors.New("获取父级目录下的同名分类失败, Err: " + e.Error())
 			return
@@ -658,7 +658,7 @@ func MoveClarksonsClassifyV2(classifyId, parentClassifyId, prevClassifyId, nextC
 	if classifyInfo.ParentId != parentClassifyId && parentClassifyId != 0 {
 		// 校验移动的父级目录下是否有重名分类
 		count, e := data_manage.GetBaseFromClarksonsClassifyCount(classifyInfo.ClassifyName, parentClassifyId)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			errMsg = "移动失败"
 			err = errors.New("获取父级目录下的同名分类失败, Err: " + e.Error())
 			return
@@ -726,7 +726,7 @@ func MoveClarksonsClassifyV2(classifyId, parentClassifyId, prevClassifyId, nextC
 		updateCol = append(updateCol, "Sort", "ModifyTime")
 	} else {
 		firstClassify, e := data_manage.GetFirstClarksonsClassifyByParentId(classifyInfo.ParentId)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			err = e
 			errMsg = "移动失败"
 			err = errors.New("获取获取当前父级分类下的排序第一条的分类信息失败,Err:" + err.Error())

+ 1 - 1
services/data/base_from_eia_steo.go

@@ -53,7 +53,7 @@ func EiaSteoIndexSource2Edb(req EiaSteoIndexSource2EdbReq, lang string) (edb *da
 
 	// 是否新增过指标
 	exist, e := data_manage.GetEdbInfoByEdbCode(source, req.EdbCode)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		err = fmt.Errorf("获取指标是否存在失败, err: %s", e.Error())
 		return
 	}

+ 2 - 2
services/data/base_from_fenwei_index_service.go

@@ -91,7 +91,7 @@ func FenWeiIndexAdd(req data_manage.FenWeiIndexAddReq, lang string) (edb *data_m
 
 	// 是否新增过指标
 	exist, e := data_manage.GetEdbInfoByEdbCode(source, req.EdbCode)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		err = fmt.Errorf("获取指标是否存在失败, err: %s", e.Error())
 		return
 	}
@@ -103,7 +103,7 @@ func FenWeiIndexAdd(req data_manage.FenWeiIndexAddReq, lang string) (edb *data_m
 	// 开始结束时间
 	var startDate, endDate string
 	minMax, e := data_manage.GetEdbInfoMaxAndMinInfo(source, utils.DATA_SUB_SOURCE_EDB, req.EdbCode)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		err = fmt.Errorf("MinMax: 获取指标极值失败, err: %s", e.Error())
 		return
 	}

+ 1 - 1
services/data/base_from_gpr_risk.go

@@ -23,7 +23,7 @@ func GprRiskIndexSource2Edb(req data_manage.GprRiskIndexSource2EdbReq, lang stri
 
 	// 是否新增过指标
 	exist, e := data_manage.GetEdbInfoByEdbCode(source, req.EdbCode)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		err = fmt.Errorf("获取指标是否存在失败, err: %s", e.Error())
 		return
 	}

+ 2 - 6
services/data/base_from_hisugar.go

@@ -17,8 +17,6 @@ type HisugarIndexSource2EdbReq struct {
 	AdminRealName string
 }
 
-
-
 // HisugarIndexSource2Edb 新增泛糖科技数据从数据源到指标库
 func HisugarIndexSource2Edb(req HisugarIndexSource2EdbReq, lang string) (edb *data_manage.EdbInfo, errMsg string, skip bool, err error) {
 	if req.EdbCode == "" {
@@ -36,7 +34,7 @@ func HisugarIndexSource2Edb(req HisugarIndexSource2EdbReq, lang string) (edb *da
 
 	// 是否新增过指标
 	exist, e := data_manage.GetEdbInfoByEdbCode(source, req.EdbCode)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		err = fmt.Errorf("获取指标是否存在失败, err: %s", e.Error())
 		return
 	}
@@ -61,8 +59,6 @@ func HisugarIndexSource2Edb(req HisugarIndexSource2EdbReq, lang string) (edb *da
 	return
 }
 
-
-
 // GethisugarIndexInfo 获取指标信息-分页
 func GethisugarIndexInfo(keyWord string, classifyIdList []string, frequencyList []string, currentIndex int, pageSize int) (baseFromHisugarIndexPage *data_manage.BaseFromHisugarIndexPage, err error) {
 
@@ -112,4 +108,4 @@ func GethisugarIndexInfo(keyWord string, classifyIdList []string, frequencyList
 		Paging: page,
 	}
 	return
-}
+}

+ 2 - 2
services/data/base_from_ly_index_service.go

@@ -205,7 +205,7 @@ func LyIndexAdd(req LyIndexAddReq, lang string) (edb *data_manage.EdbInfo, err e
 
 	// 是否新增过指标
 	exist, e := data_manage.GetEdbInfoByEdbCode(source, req.EdbCode)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		err = fmt.Errorf("获取指标是否存在失败, err: %s", e.Error())
 		return
 	}
@@ -217,7 +217,7 @@ func LyIndexAdd(req LyIndexAddReq, lang string) (edb *data_manage.EdbInfo, err e
 	// 开始结束时间
 	var startDate, endDate string
 	minMax, e := data_manage.GetEdbInfoMaxAndMinInfo(source, utils.DATA_SUB_SOURCE_EDB, req.EdbCode)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		err = fmt.Errorf("MinMax: 获取指标极值失败, err: %s", e.Error())
 		return
 	}

+ 1 - 2
services/data/base_from_oilchem.go

@@ -33,7 +33,7 @@ func OilchemIndexSource2Edb(req OilchemIndexSource2EdbReq, lang string) (edb *da
 
 	// 是否新增过指标
 	exist, e := data_manage.GetEdbInfoByEdbCode(source, req.EdbCode)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		err = fmt.Errorf("获取指标是否存在失败, err: %s", e.Error())
 		return
 	}
@@ -57,4 +57,3 @@ func OilchemIndexSource2Edb(req OilchemIndexSource2EdbReq, lang string) (edb *da
 
 	return
 }
-

+ 2 - 2
services/data/base_from_rzd_index_service.go

@@ -256,7 +256,7 @@ func RzdIndexAdd(req data_manage.RzdIndexAddReq, lang string) (edb *data_manage.
 
 	// 是否新增过指标
 	exist, e := data_manage.GetEdbInfoByEdbCode(source, req.EdbCode)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		err = fmt.Errorf("获取指标是否存在失败, err: %s", e.Error())
 		return
 	}
@@ -268,7 +268,7 @@ func RzdIndexAdd(req data_manage.RzdIndexAddReq, lang string) (edb *data_manage.
 	// 开始结束时间
 	var startDate, endDate string
 	minMax, e := data_manage.GetEdbInfoMaxAndMinInfo(source, utils.DATA_SUB_SOURCE_EDB, req.EdbCode)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		err = fmt.Errorf("MinMax: 获取指标极值失败, err: %s", e.Error())
 		return
 	}

+ 1 - 1
services/data/base_from_sci.go

@@ -33,7 +33,7 @@ func AddSciClassify(classifyName string, parentId, sysUserId int, sysUserName, l
 	if parentId > 0 {
 		parentClassify, e := data_manage.GetBaseFromSciClassifyById(parentId)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				err = e
 				errMsg = `一级分类不存在`
 				return

+ 1 - 1
services/data/base_from_sci_hq.go

@@ -317,7 +317,7 @@ func SciHqIndexSource2Edb(req SciHqIndexSource2EdbReq, lang string) (edb *data_m
 
 	// 是否新增过指标
 	exist, e := data_manage.GetEdbInfoByEdbCode(source, req.EdbCode)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		err = fmt.Errorf("获取指标是否存在失败, err: %s", e.Error())
 		return
 	}

+ 1 - 1
services/data/base_from_smm.go

@@ -404,7 +404,7 @@ func AddSmmClassify(classifyName string, parentId, sysUserId int, sysUserName, l
 	if parentId > 0 {
 		parentClassify, e := data_manage.GetBaseFromSmmClassifyById(parentId)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				err = e
 				errMsg = `一级分类不存在`
 				return

+ 1 - 1
services/data/base_from_ths_hf_classify.go

@@ -86,7 +86,7 @@ func ThsHfMoveClassify(req data_manage.BaseFromThsHfClassifyMoveReq, sysUser *sy
 		}
 		// 如果是移动目录, 那么校验一下父级目录下是否有重名目录
 		exists, e := data_manage.GetEdbClassifyByParentIdAndName(parentClassifyId, edbClassifyInfo.ClassifyName, classifyId)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			errMsg = "移动失败"
 			err = fmt.Errorf("获取父级分类下的同名分类失败, Err: %s", e.Error())
 			return

+ 1 - 1
services/data/base_from_usda_fas.go

@@ -23,7 +23,7 @@ func UsdaFasIndexSource2Edb(req data_manage.UsdaFasIndexSource2EdbReq, lang stri
 
 	// 是否新增过指标
 	exist, e := data_manage.GetEdbInfoByEdbCode(source, req.EdbCode)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		err = fmt.Errorf("获取指标是否存在失败, err: %s", e.Error())
 		return
 	}

+ 2 - 2
services/data/chart_classify.go

@@ -293,7 +293,7 @@ func AddChartClassify(chartClassifyName string, parentId, level, source int, lan
 	if parentId > 0 {
 		parentClassify, tErr := data_manage.GetChartClassifyById(parentId)
 		if tErr != nil {
-			if tErr.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(tErr) {
 				errMsg = "父级分类不存在"
 				err = errors.New(errMsg)
 				return
@@ -485,7 +485,7 @@ func MoveChartClassify(req data_manage.MoveChartClassifyReq, sysUser *system.Adm
 		}
 		// 如果是移动目录, 那么校验一下父级目录下是否有重名目录
 		exists, e := data_manage.GetChartClassifyByParentIdAndName(parentClassifyId, chartClassifyInfo.ChartClassifyName, classifyId)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			errMsg = "移动失败"
 			err = fmt.Errorf("获取父级分类下的同名分类失败, Err: %s", e.Error())
 			return

+ 2 - 2
services/data/chart_info.go

@@ -2332,7 +2332,7 @@ func AddChartInfo(req data_manage.AddChartInfoReq, sysUserId int, sysUserRealNam
 			edbInfoId := v.EdbInfoId
 			edbInfo, tmpErr := data_manage.GetEdbInfoById(edbInfoId)
 			if tmpErr != nil {
-				if tmpErr.Error() == utils.ErrNoRow() {
+				if utils.IsErrNoRow(tmpErr) {
 					errMsg = "指标不存在!"
 					err = errors.New("指标不存在,edbInfoId:" + strconv.Itoa(edbInfoId))
 					return
@@ -2726,7 +2726,7 @@ func EditChartInfo(req data_manage.EditChartInfoReq, sysUser *system.Admin, lang
 			edbInfoId := v.EdbInfoId
 			edbInfo, tmpErr := data_manage.GetEdbInfoById(edbInfoId)
 			if tmpErr != nil {
-				if tmpErr.Error() == utils.ErrNoRow() {
+				if utils.IsErrNoRow(tmpErr) {
 					errMsg = "指标不存在!"
 					err = errors.New("指标不存在,edbInfoId:" + strconv.Itoa(edbInfoId))
 					return

+ 1 - 1
services/data/chart_info_excel_balance.go

@@ -715,7 +715,7 @@ func GetBalanceExcelChartDetail(chartInfo *data_manage.ChartInfoView, mappingLis
 				myChartPars = append(myChartPars, chartInfo.ChartInfoId)
 
 				myChartList, e := data_manage.GetMyChartByCondition(myChartCondition, myChartPars)
-				if e != nil && e.Error() != utils.ErrNoRow() {
+				if e != nil && !utils.IsErrNoRow(e) {
 					errMsg = "获取失败"
 					err = fmt.Errorf("获取我的图表信息失败,GetMyChartByCondition,Err:" + e.Error())
 					return

+ 11 - 11
services/data/common_classify.go

@@ -38,7 +38,7 @@ func CommonClassifyMove(req common.CommonClassifyMoveReq, strategy CommonClassif
 	if req.PrevClassifyId > 0 {
 		c, e := ctx.GetCommonClassifyById(req.PrevClassifyId)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				tips = "上一个分类不存在, 请刷新页面"
 				return
 			}
@@ -50,7 +50,7 @@ func CommonClassifyMove(req common.CommonClassifyMoveReq, strategy CommonClassif
 	} else if req.PrevObjectId > 0 {
 		obj, e := ctx.GetObjectById(req.PrevObjectId)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				tips = "上一个移动对象不存在, 请刷新页面"
 				return
 			}
@@ -63,7 +63,7 @@ func CommonClassifyMove(req common.CommonClassifyMoveReq, strategy CommonClassif
 	if req.NextClassifyId > 0 {
 		c, e := ctx.GetCommonClassifyById(req.NextClassifyId)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				tips = "下一个分类不存在, 请刷新页面"
 				return
 			}
@@ -75,7 +75,7 @@ func CommonClassifyMove(req common.CommonClassifyMoveReq, strategy CommonClassif
 	} else if req.NextObjectId > 0 {
 		obj, e := ctx.GetObjectById(req.NextObjectId)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				tips = "下一个移动对象不存在, 请刷新页面"
 				return
 			}
@@ -90,7 +90,7 @@ func CommonClassifyMove(req common.CommonClassifyMoveReq, strategy CommonClassif
 	if req.ObjectId == 0 {
 		c, e := ctx.GetCommonClassifyById(req.ClassifyId)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				tips = "当前分类不存在, 请刷新页面"
 				return
 			}
@@ -105,7 +105,7 @@ func CommonClassifyMove(req common.CommonClassifyMoveReq, strategy CommonClassif
 	if req.ObjectId > 0 {
 		obj, e := ctx.GetObjectById(req.ObjectId)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				tips = "移动对象不存在, 请刷新页面"
 				return
 			}
@@ -132,7 +132,7 @@ func moveCommonClassify(ctx *CommonClassifyCtx, req common.CommonClassifyMoveReq
 		return
 	}
 	exists, e := ctx.GetClassifyByParentIdAndName(req.ParentClassifyId, classify.ClassifyName, classify.ClassifyId)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		err = fmt.Errorf("获取父级分类下的同名分类失败, %v", e)
 		return
 	}
@@ -255,7 +255,7 @@ func moveCommonClassify(ctx *CommonClassifyCtx, req common.CommonClassifyMoveReq
 	} else {
 		// 拖动到父级分类的第一位
 		firstClassify, e := ctx.GetFirstClassifyByParentId(req.ParentClassifyId)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			//tips = "移动失败"
 			err = fmt.Errorf("GetFirstClassifyByParentId, %v", e)
 			return
@@ -276,7 +276,7 @@ func moveCommonClassify(ctx *CommonClassifyCtx, req common.CommonClassifyMoveReq
 		} else {
 			// 如果该分类下存在指标, 且第一个指标的排序等于0, 那么需要调整排序
 			firstObject, e := ctx.GetFirstObjectByClassifyId(req.ParentClassifyId)
-			if e != nil && e.Error() != utils.ErrNoRow() {
+			if e != nil && !utils.IsErrNoRow(e) {
 				err = fmt.Errorf("GetFirstObjectByClassifyId, %v", e)
 				return
 			}
@@ -410,7 +410,7 @@ func moveCommonClassifyObj(ctx *CommonClassifyCtx, req common.CommonClassifyMove
 	} else {
 		// 拖动到父级分类的第一位
 		firstClassify, e := ctx.GetFirstClassifyByParentId(req.ParentClassifyId)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			err = fmt.Errorf("GetFirstClassifyByParentId, %v", e)
 			return
 		}
@@ -430,7 +430,7 @@ func moveCommonClassifyObj(ctx *CommonClassifyCtx, req common.CommonClassifyMove
 		} else {
 			// 如果该分类下存在对象, 且第一个对象的排序等于0, 那么需要调整排序
 			firstObject, e := ctx.GetFirstObjectByClassifyId(req.ParentClassifyId)
-			if e != nil && e.Error() != utils.ErrNoRow() {
+			if e != nil && !utils.IsErrNoRow(e) {
 				err = fmt.Errorf("GetFirstObjectByClassifyId, %v", e)
 				return
 			}

+ 4 - 4
services/data/correlation/chart_info.go

@@ -691,7 +691,7 @@ func ChartInfoRefresh(chartInfoId int, uniqueCode string) (isAsync bool, err err
 func GetChartAndCorrelationInfo(chartInfoId int) (chartInfo *data_manage.ChartInfo, correlationInfo *data_manage.ChartInfoCorrelation, tips string, err error) {
 	item, e := data_manage.GetChartInfoById(chartInfoId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			tips = "图表已被删除, 请刷新页面"
 			err = fmt.Errorf("图表已被删除, 请刷新页面")
 			return
@@ -794,7 +794,7 @@ func AddChartInfo(req data_manage.AddChartInfoReq, source int, sysUser *system.A
 		edbInfoId := v.EdbInfoId
 		edbInfo, tmpErr := data_manage.GetEdbInfoById(edbInfoId)
 		if tmpErr != nil {
-			if tmpErr.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(tmpErr) {
 				errMsg = "指标不存在!"
 				err = errors.New("指标不存在,edbInfoId:" + strconv.Itoa(edbInfoId))
 				return
@@ -1098,7 +1098,7 @@ func EditChartInfo(req data_manage.EditChartInfoReq, sysUser *system.Admin, lang
 		edbInfoId := v.EdbInfoId
 		edbInfo, tmpErr := data_manage.GetEdbInfoById(edbInfoId)
 		if tmpErr != nil {
-			if tmpErr.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(tmpErr) {
 				errMsg = "图表不存在!"
 				err = errors.New("图表指标不存在,ChartInfoId:" + strconv.Itoa(edbInfoId))
 				return
@@ -1558,7 +1558,7 @@ func RemoveCorrelationRelate(chartInfoId int) (err error) {
 	}
 	// 相关性图表
 	chartCorrelate := new(data_manage.ChartInfoCorrelation)
-	if e := chartCorrelate.GetItemById(chartInfoId); e != nil && e.Error() != utils.ErrNoRow() {
+	if e := chartCorrelate.GetItemById(chartInfoId); e != nil && !utils.IsErrNoRow(e) {
 		err = fmt.Errorf("获取相关性图表信息失败, %v", e)
 		return
 	}

+ 8 - 8
services/data/data_manage_permission/data_move.go

@@ -51,13 +51,13 @@ func GetEdbChartClassifyList(source, subSource int) (resp data_manage.EdbChartCl
 
 	case 2: //钢联化工数据库
 		rootList, e := data_manage.GetBaseFromMysteelChemicalClassifyByParentId(0)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			err = e
 			return
 		}
 
 		classifyAll, e := data_manage.GetAllBaseFromMysteelChemicalClassify()
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			err = e
 			return
 		}
@@ -98,14 +98,14 @@ func GetEdbChartClassifyList(source, subSource int) (resp data_manage.EdbChartCl
 	case 3:
 		//ETA指标库
 		//rootList, e := data_manage.GetEdbClassifyByParentId(0, 0)
-		//if e != nil && e.Error() != utils.ErrNoRow() {
+		//if e != nil && !utils.IsErrNoRow(e) {
 		//	err = e
 		//	return
 		//}
 
 		// 考虑到后面可以会迭代到10层, 这里直接用递归处理
 		classifyAll, e := data_manage.GetAllEdbClassifyByType(0)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			err = e
 			return
 		}
@@ -115,7 +115,7 @@ func GetEdbChartClassifyList(source, subSource int) (resp data_manage.EdbChartCl
 		//ETA预测指标
 		// 考虑到后面可以会迭代到10层, 这里直接用递归
 		classifyAll, e := data_manage.GetAllEdbClassifyByType(1)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			err = e
 			return
 		}
@@ -123,7 +123,7 @@ func GetEdbChartClassifyList(source, subSource int) (resp data_manage.EdbChartCl
 	case 5: //图库
 		// 考虑到后面可以会迭代到10层, 这里直接用递归处理
 		classifyAll, e := data_manage.GetAllChartClassifyItemsBySource(1)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			err = e
 			return
 		}
@@ -137,7 +137,7 @@ func GetEdbChartClassifyList(source, subSource int) (resp data_manage.EdbChartCl
 		// ETA表格
 		// 考虑到后面可以会迭代到10层, 这里直接用递归处理
 		classifyAll, e := excel.GetExcelClassifyBySourceOrderByLevel(subSource)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			err = e
 			return
 		}
@@ -1451,7 +1451,7 @@ func MoveCustomAnalysisExcel2DefaultClassify(excelIds []int, adminId int, realNa
 	pars := make([]interface{}, 0)
 	pars = append(pars, "未分类", adminId)
 	classify, e := excel.GetExcelClassifyByCondition(cond, pars)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		err = fmt.Errorf("获取默认分类失败, %v", e)
 		return
 	}

+ 4 - 4
services/data/edb_classify.go

@@ -341,7 +341,7 @@ func AddEdbClassify(classifyName string, parentId, level int, classifyType uint8
 	if parentId > 0 {
 		parentClassify, tErr := data_manage.GetEdbClassifyById(parentId)
 		if tErr != nil {
-			if tErr.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(tErr) {
 				errMsg = "父级分类不存在"
 				err = errors.New(errMsg)
 				return
@@ -588,7 +588,7 @@ func DeleteCheck(classifyId, edbInfoId int, sysUser *system.Admin) (deleteStatus
 	if edbInfoId > 0 {
 		edbInfo, tmpErr := data_manage.GetEdbInfoById(edbInfoId)
 		if tmpErr != nil {
-			if tmpErr.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(tmpErr) {
 				errMsg = "指标已删除,请刷新页面"
 				err = errors.New("指标不存在,Err:" + tmpErr.Error())
 				return
@@ -841,7 +841,7 @@ func Delete(classifyId, edbInfoId int, sysUser *system.Admin, requestBody, reque
 	if edbInfoId > 0 {
 		edbInfo, tmpErr := data_manage.GetEdbInfoById(edbInfoId)
 		if tmpErr != nil {
-			if tmpErr.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(tmpErr) {
 				errMsg = "指标已删除,请刷新页面"
 				err = errors.New("指标不存在,Err:" + tmpErr.Error())
 				return
@@ -1109,7 +1109,7 @@ func MoveEdbClassify(req data_manage.MoveEdbClassifyReq, sysUser *system.Admin,
 		}
 		// 如果是移动目录, 那么校验一下父级目录下是否有重名目录
 		exists, e := data_manage.GetEdbClassifyByParentIdAndName(parentClassifyId, edbClassifyInfo.ClassifyName, classifyId)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			errMsg = "移动失败"
 			err = fmt.Errorf("获取父级分类下的同名分类失败, Err: %s", e.Error())
 			return

+ 2 - 2
services/data/line_equation/chart_info.go

@@ -393,7 +393,7 @@ func BatchAddChartInfo(batchAddChartReq []request.AddChart, lineChartInfoConfig
 
 		chartClassify, tmpErr := data_manage.GetChartClassifyById(v.ChartClassifyId)
 		if tmpErr != nil {
-			if tmpErr.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(tmpErr) {
 				errMsg = "分类不存在"
 				err = errors.New(errMsg)
 				isSendEmail = false
@@ -616,7 +616,7 @@ func BatchSaveChartInfo(multipleGraphConfigId int, batchAddChartReq []request.Ad
 
 		chartClassify, tmpErr := data_manage.GetChartClassifyById(v.ChartClassifyId)
 		if tmpErr != nil {
-			if tmpErr.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(tmpErr) {
 				errMsg = "分类不存在"
 				err = errors.New(errMsg)
 				isSendEmail = false

+ 2 - 2
services/data/manual.go

@@ -180,7 +180,7 @@ func ManualIndexSource2Edb(req ManualIndexSource2EdbReq, lang string) (edb *data
 
 	// 是否新增过指标
 	exist, e := data_manage.GetEdbInfoByEdbCode(source, req.EdbCode)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		err = fmt.Errorf("获取指标是否存在失败, err: %s", e.Error())
 		return
 	}
@@ -192,7 +192,7 @@ func ManualIndexSource2Edb(req ManualIndexSource2EdbReq, lang string) (edb *data
 	// 开始结束时间
 	var startDate, endDate string
 	minMax, e := data_manage.GetEdbInfoMaxAndMinInfo(source, utils.DATA_SUB_SOURCE_EDB, req.EdbCode)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		err = fmt.Errorf("MinMax: 获取指标极值失败, err: %s", e.Error())
 		return
 	}

+ 1 - 1
services/data/my_chart.go

@@ -14,7 +14,7 @@ func GetMyChartClassifyIdNumMap(adminId int) (chartsNumMap map[int]int, err erro
 	chartIds := make([]int, 0)
 	obj := data_manage.EdbInfoNoPermissionAdmin{}
 	charts, e := obj.GetAllChartListByAdminId(adminId)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		err = fmt.Errorf("获取不可见指标配置数据失败, err: %s", e.Error())
 		return
 	}

+ 1 - 1
services/data/mysteel_chemical.go

@@ -408,7 +408,7 @@ func MysteelChemicalIndexSource2Edb(req MysteelChemicalIndexSource2EdbReq, lang
 
 	// 是否新增过指标
 	exist, e := data_manage.GetEdbInfoByEdbCode(source, req.EdbCode)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		err = fmt.Errorf("获取指标是否存在失败, err: %s", e.Error())
 		return
 	}

+ 5 - 5
services/data/range_analysis/chart_info.go

@@ -513,7 +513,7 @@ func GetChartDataByEdbInfoList(chartInfoId int, dateType, startYear int, startDa
 	if req.MultipleGraphConfigId > 0 {
 		//判断MultipleGraphConfigId和图表关系是否正确
 		multipleGraphConfigEdbMappingList, e := data_manage.GetMultipleGraphConfigEdbMappingListByIdAndSource(req.MultipleGraphConfigId, utils.CHART_SOURCE_RANGE_ANALYSIS)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			err = fmt.Errorf("获取区间计算图表, 指标信息失败, Err:" + e.Error())
 			return
 		}
@@ -662,7 +662,7 @@ func GetChartDataByEdbInfoListBySeries(chartInfoId int, dateType, startYear int,
 	// 查询配置关联关系
 	if req.MultipleGraphConfigId > 0 {
 		multipleGraphConfigEdbMappingList, e := data_manage.GetMultipleGraphConfigEdbMappingListByIdAndSource(req.MultipleGraphConfigId, utils.CHART_SOURCE_RANGE_ANALYSIS)
-		if e != nil && e.Error() != utils.ErrNoRow() {
+		if e != nil && !utils.IsErrNoRow(e) {
 			err = fmt.Errorf("获取区间计算图表, 指标信息失败, Err:" + e.Error())
 			return
 		}
@@ -1068,7 +1068,7 @@ func AddChartInfo(req data_manage.AddChartInfoReq, source int, sysUser *system.A
 		edbInfoId := v.EdbInfoId
 		edbInfo, tmpErr := data_manage.GetEdbInfoById(edbInfoId)
 		if tmpErr != nil {
-			if tmpErr.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(tmpErr) {
 				errMsg = "指标不存在!"
 				err = errors.New("指标不存在,edbInfoId:" + strconv.Itoa(edbInfoId))
 				return
@@ -1339,7 +1339,7 @@ func EditChartInfo(req data_manage.EditChartInfoReq, sysUser *system.Admin, lang
 		edbInfoId := v.EdbInfoId
 		edbInfo, tmpErr := data_manage.GetEdbInfoById(edbInfoId)
 		if tmpErr != nil {
-			if tmpErr.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(tmpErr) {
 				errMsg = "图表不存在!"
 				err = errors.New("图表指标不存在,ChartInfoId:" + strconv.Itoa(edbInfoId))
 				return
@@ -2047,7 +2047,7 @@ func EditSeries(seriesMapping *data_manage.FactorEdbSeriesChartMapping, edbInfoI
 	seriesOb := new(data_manage.FactorEdbSeries)
 	seriesItem, e := seriesOb.GetItemById(seriesMapping.FactorEdbSeriesId)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			err = fmt.Errorf("因子指标系列不存在, Err: " + e.Error())
 			return
 		}

+ 4 - 4
services/data/stl/stl.go

@@ -639,7 +639,7 @@ func SearchEdbInfoWithStl(adminId int, keyWord string, currentIndex, pageSize in
 	{
 		obj := data_manage.EdbInfoNoPermissionAdmin{}
 		confList, er := obj.GetAllListByAdminId(adminId)
-		if er != nil && er.Error() != utils.ErrNoRow() {
+		if er != nil && !utils.IsErrNoRow(er) {
 			msg = "获取失败"
 			err = fmt.Errorf("获取不可见指标配置数据失败,Err:" + er.Error())
 			return
@@ -898,7 +898,7 @@ func SaveStlEdbInfo(req *request.SaveStlEdbInfoReq, adminId int, adminRealName,
 		pars = append(pars, req.EdbName)
 
 		existEdbInfo, er := data_manage.GetEdbInfoByCondition(condition, pars)
-		if er != nil && er.Error() != utils.ErrNoRow() {
+		if er != nil && !utils.IsErrNoRow(er) {
 			msg = "获取失败"
 			return
 		}
@@ -920,7 +920,7 @@ func SaveStlEdbInfo(req *request.SaveStlEdbInfoReq, adminId int, adminRealName,
 		// 更新指标
 		edbInfo, er := data_manage.GetEdbInfoById(req.EdbInfoId)
 		if er != nil {
-			if er.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(er) {
 				msg = "未找到指标,请刷新后重试"
 				err = er
 				return
@@ -1123,7 +1123,7 @@ func SaveStlEdbInfo(req *request.SaveStlEdbInfoReq, adminId int, adminRealName,
 		{
 			fromEdbInfo, er := data_manage.GetEdbInfoById(stlConfig.EdbInfoId)
 			if er != nil {
-				if er.Error() == utils.ErrNoRow() {
+				if utils.IsErrNoRow(er) {
 					msg = "未找到指标,请刷新后重试"
 					err = fmt.Errorf("指标不存在,err:" + er.Error())
 					return

+ 1 - 1
services/data/trade_analysis/trade_analysis_data.go

@@ -1006,7 +1006,7 @@ func GetTradeClassifyNewestDataTime(exchange string, classifyNames []string) (da
 	}
 
 	d, e := tradeAnalysis.GetClassifyNewestDataTime(exchange, classifyNames)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		err = fmt.Errorf("获取品种最新数据日期失败, %v", e)
 		return
 	}

+ 1 - 1
services/data/yongyi.go

@@ -24,7 +24,7 @@ func YongyiIndexSource2Edb(req request.YongyiIndexSource2EdbReq, lang string) (e
 
 	// 是否新增过指标
 	exist, e := data_manage.GetEdbInfoByEdbCode(source, req.EdbCode)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		err = fmt.Errorf("获取指标是否存在失败, err: %s", e.Error())
 		return
 	}

+ 2 - 2
services/data_stat/edb_terminal.go

@@ -16,7 +16,7 @@ func SaveEdbTerminal(req *data_manage.AddEdbTerminalListReq) (errMsg string, err
 	if req.TerminalId > 0 {
 		item, e := data_manage.GetEdbTerminalById(req.TerminalId)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				errMsg = "终端不存在"
 				err = errors.New(errMsg)
 				return
@@ -70,7 +70,7 @@ func SetEdbTerminalStatus(id int, status int) (errMsg string, err error) {
 	// 更新
 	item, e := data_manage.GetEdbTerminalById(id)
 	if e != nil {
-		if e.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(e) {
 			errMsg = "终端不存在"
 			err = errors.New(errMsg)
 			return

+ 4 - 4
services/edb_monitor/edb_monitor.go

@@ -183,7 +183,7 @@ func GetMonitorList(classifyId, level, state, userId string, pageSize, currentIn
 func SaveEdbMonitorInfo(req request.EdbMonitorInfoSaveReq, adminId int) (msg string, err error) {
 	edb, er := data_manage.GetEdbInfoById(req.EdbInfoId)
 	if er != nil {
-		if er.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(er) {
 			msg = "指标不存在,请刷新重试"
 			err = er
 			return
@@ -208,7 +208,7 @@ func SaveEdbMonitorInfo(req request.EdbMonitorInfoSaveReq, adminId int) (msg str
 		}
 		edbMonitorInfo, er = edbmonitor.GetEdbMonitorInfoById(req.EdbMonitorId)
 		if er != nil {
-			if er.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(er) {
 				msg = "指标预警不存在,请刷新重试"
 				err = er
 				return
@@ -454,7 +454,7 @@ func GetEdbMonitorLevelList() (list []string, msg string, err error) {
 func CloseEdbMonitorInfo(req request.EdbMonitorInfoCloseReq, adminId int) (msg string, err error) {
 	edbMonitor, er := edbmonitor.GetEdbMonitorInfoById(req.EdbMonitorId)
 	if er != nil {
-		if er.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(er) {
 			msg = "指标预警不存在,请刷新重试"
 			err = er
 		}
@@ -491,7 +491,7 @@ func CloseEdbMonitorInfo(req request.EdbMonitorInfoCloseReq, adminId int) (msg s
 func RestartEdbMonitorInfo(req request.EdbMonitorInfoRestartReq, adminId int) (msg string, err error) {
 	edbMonitor, er := edbmonitor.GetEdbMonitorInfoById(req.EdbMonitorId)
 	if er != nil {
-		if er.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(er) {
 			msg = "指标预警不存在,请刷新重试"
 			err = er
 		}

+ 7 - 7
services/edb_monitor/edb_monitor_classify.go

@@ -31,7 +31,7 @@ func SaveEdbMonitorClassify(req request.EdbMonitorClassifySaveReq) (msg string,
 	if req.ParentId > 0 {
 		parentClassify, er = edbmonitor.GetEdbMonitorClassifyById(req.ParentId)
 		if er != nil {
-			if er.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(er) {
 				msg = "父级分类不存在"
 				err = errors.New("parent classify not exist")
 				return
@@ -55,7 +55,7 @@ func SaveEdbMonitorClassify(req request.EdbMonitorClassifySaveReq) (msg string,
 	if req.ClassifyId > 0 {
 		classifyInfo, er := edbmonitor.GetEdbMonitorClassifyById(req.ClassifyId)
 		if er != nil {
-			if er.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(er) {
 				msg = "分类不存在"
 				return
 			}
@@ -146,7 +146,7 @@ func SaveEdbMonitorClassify(req request.EdbMonitorClassifySaveReq) (msg string,
 func DeleteEdbMonitorClassify(req request.EdbMonitorClassifyDeleteReq) (msg string, err error) {
 	classifyInfo, er := edbmonitor.GetEdbMonitorClassifyById(req.ClassifyId)
 	if er != nil {
-		if er.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(er) {
 			msg = "分类不存在"
 			return
 		}
@@ -206,7 +206,7 @@ func MoveEdbMonitorClassify(req request.MoveEdbMonitorClassifyReq) (msg string,
 	classifyInfo, er := edbmonitor.GetEdbMonitorClassifyById(req.ClassifyId)
 	if er != nil {
 		err = er
-		if er.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(er) {
 			msg = "分类不存在,请刷新页面"
 			return
 		}
@@ -216,7 +216,7 @@ func MoveEdbMonitorClassify(req request.MoveEdbMonitorClassifyReq) (msg string,
 
 	// 校验移动的父级目录下是否有重名分类
 	exists, er := edbmonitor.GetEdbMonitorClassifyByParentIdAndName(req.ParentClassifyId, classifyInfo.ClassifyName, req.ClassifyId)
-	if er != nil && er.Error() != utils.ErrNoRow() {
+	if er != nil && !utils.IsErrNoRow(er) {
 		msg = "移动失败"
 		err = er
 		return
@@ -235,7 +235,7 @@ func MoveEdbMonitorClassify(req request.MoveEdbMonitorClassifyReq) (msg string,
 		parentClassify, er := edbmonitor.GetEdbMonitorClassifyById(req.ParentClassifyId)
 		if er != nil {
 			err = er
-			if er.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(er) {
 				msg = "父级分类不存在,请刷新页面"
 				return
 			}
@@ -296,7 +296,7 @@ func MoveEdbMonitorClassify(req request.MoveEdbMonitorClassifyReq) (msg string,
 
 	} else {
 		firstClassify, er := edbmonitor.GetFirstEdbMonitorClassifyByParentId(classifyInfo.ParentId)
-		if er != nil && er.Error() != utils.ErrNoRow() {
+		if er != nil && !utils.IsErrNoRow(er) {
 			msg = "移动失败"
 			err = fmt.Errorf("获取父级分类下的排序第一条的分类信息失败,Err:%w", er)
 			return

+ 2 - 2
services/english_video.go

@@ -45,7 +45,7 @@ func SaveEnglishVideoCover(coverId int, coverName, coverUrl string) (resp *model
 	if coverId > 0 {
 		item, e := models.GetEnglishVideoCoverById(coverId)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				errMsg = "封面不存在"
 				err = errors.New(errMsg)
 				return
@@ -148,7 +148,7 @@ func SaveEnglishVideo(req models.SaveEnglishVideoReq, adminInfo *system.Admin) (
 	if req.Id > 0 {
 		item, e := models.GetEnglishVideoItemById(req.Id)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				err = fmt.Errorf("路演视频不存在")
 				return
 			}

+ 1 - 1
services/excel_info.go

@@ -89,7 +89,7 @@ func GetBalanceExcelIdsByAdminId(adminId int, condition string, pars []interface
 
 	//获取表格信息
 	tmpList, e := excel3.GetNoContentExcelListByConditionNoPage(newCondition, newPars)
-	if e != nil && e.Error() != utils.ErrNoRow() {
+	if e != nil && !utils.IsErrNoRow(e) {
 		//br.Success = true
 		//br.Msg = "获取表格信息失败"
 		//br.ErrMsg = "获取表格信息失败,Err:" + e.Error()

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません