xyxie 4 weeks ago
parent
commit
0c553dc61c

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

@@ -129,7 +129,7 @@ func (c *AiPredictModelFrameworkController) Add() {
 			br.ErrMsg = "获取重名框架失败, Err: " + e.Error()
 			return
 		}
-		if exist != nil {
+		if exist != nil && exist.AiPredictModelFrameworkId > 0 {
 			br.Msg = "框架名称已存在,请重新输入"
 			return
 		}
@@ -250,7 +250,7 @@ func (c *AiPredictModelFrameworkController) Edit() {
 			br.ErrMsg = "获取重名框架失败, Err: " + e.Error()
 			return
 		}
-		if exist != nil {
+		if exist != nil && exist.AiPredictModelFrameworkId > 0 {
 			br.Msg = "框架名称已存在,请重新输入"
 			return
 		}
@@ -432,7 +432,7 @@ func (c *AiPredictModelFrameworkController) Rename() {
 			br.ErrMsg = "获取重名框架失败, Err: " + e.Error()
 			return
 		}
-		if exist != nil {
+		if exist != nil && exist.AiPredictModelFrameworkId > 0 {
 			br.Msg = "框架名称已存在,请重新输入"
 			return
 		}

+ 1 - 1
controllers/english_report/english_company.go

@@ -298,7 +298,7 @@ func (this *EnglishCompanyController) Save() {
 			return
 		}
 	} else {
-		if exist != nil && exist.CompanyId != req.CompanyId {
+		if exist != nil && exist.CompanyId != req.CompanyId && exist.CompanyId > 0 {
 			br.Msg = "客户名称已存在"
 			return
 		}

+ 1 - 1
controllers/material/material.go

@@ -1648,7 +1648,7 @@ func (this *MaterialController) Rename() {
 		br.ErrMsg = "获取数据失败,Err:" + err.Error()
 		return
 	}
-	if err == nil && exist.MaterialId > 0 {
+	if err == nil {
 		br.Msg = "图片名称已存在"
 		return
 	}

+ 1 - 1
controllers/report_approve/report_approve_flow.go

@@ -271,7 +271,7 @@ func (this *ReportApproveFlowController) Add() {
 			br.ErrMsg = "获取审批流是否已存在失败, Err: " + e.Error()
 			return
 		}
-		if exist != nil {
+		if exist != nil && exist.ReportApproveFlowId > 0 {
 			br.Msg = "该分类已有审批流, 请勿重复添加"
 			return
 		}