فهرست منبع

fix:表格在应用层调整

Roc 1 ماه پیش
والد
کامیت
3551a1dde2
3فایلهای تغییر یافته به همراه6 افزوده شده و 5 حذف شده
  1. 3 3
      controllers/data_manage/excel/excel_info.go
  2. 1 1
      controllers/report_history.go
  3. 2 1
      utils/common.go

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

@@ -1695,7 +1695,7 @@ func (c *ExcelInfoController) GetExcelTableData() {
 
 	// 获取表格引用
 	reference, err := excel3.GetReferencedExcelConfig(referencedId, fromScene, uniqueCode, uuid)
-	if err != nil && err.Error() != utils.ErrNoRow() {
+	if err != nil && !utils.IsErrNoRow(err) {
 		br.Msg = "获取失败"
 		br.ErrMsg = "获取表格引用失败,Err:" + err.Error()
 		return
@@ -3268,7 +3268,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
@@ -3303,7 +3303,7 @@ func (c *ExcelInfoController) SaveExcelReference() {
 
 	if len(addList) > 0 {
 		err = excel3.AddReferencedExcelConfig(addList)
-		if err != nil && err.Error() != utils.ErrNoRow() {
+		if err != nil && !utils.IsErrNoRow(err) {
 			br.Msg = "添加引用失败"
 			br.ErrMsg = "添加引用失败,Err:" + err.Error()
 			return

+ 1 - 1
controllers/report_history.go

@@ -196,7 +196,7 @@ func (this *ReportHistoryController) Detail() {
 	if reportInfo.HasChapter == 1 && reportChapterId > 0 {
 		chapter, e := models.GetReportChapterInfoById(reportChapterId)
 		if e != nil {
-			if e.Error() == utils.ErrNoRow() {
+			if utils.IsErrNoRow(e) {
 				br.Msg = "章节已删除"
 				return
 			}

+ 2 - 1
utils/common.go

@@ -231,7 +231,8 @@ func StrListToString(strList []string) (str string) {
 
 // 数据没有记录
 func ErrNoRow() string {
-	return "<QuerySeter> no row found"
+	return gorm.ErrRecordNotFound.Error()
+	//return "<QuerySeter> no row found"
 }
 
 // IsErrNoRow