Przeglądaj źródła

Merge branch 'bug/5782'

Roc 1 tydzień temu
rodzic
commit
8700e9b3aa

+ 1 - 1
controllers/base_from_business.go

@@ -313,7 +313,7 @@ func (c *BusinessIndexController) Edit() {
 	}
 
 	// 根据指标名称和指标ID校验库中是否还存在其他同名指标
-	existEdbName, err := logic.CheckExistByEdbNameAndEdbInfoId(0, req.EdbInfoId, req.EdbName, c.Lang)
+	existEdbName, err := logic.CheckExistByEdbNameAndEdbInfoId(utils.EDB_INFO_TYPE, req.EdbInfoId, req.EdbName, c.Lang)
 	if err != nil {
 		br.Msg = "判断指标名称是否存在失败"
 		br.ErrMsg = "判断指标名称是否存在失败,Err:" + err.Error()

+ 3 - 3
controllers/base_from_calculate.go

@@ -226,7 +226,7 @@ func (this *CalculateController) Edit() {
 	}
 
 	// 根据指标名称和指标ID校验库中是否还存在其他同名指标
-	existEdbName, err := logic.CheckExistByEdbNameAndEdbInfoId(0, req.EdbInfoId, req.EdbName, this.Lang)
+	existEdbName, err := logic.CheckExistByEdbNameAndEdbInfoId(utils.EDB_INFO_TYPE, req.EdbInfoId, req.EdbName, this.Lang)
 	if err != nil {
 		br.Msg = "判断指标名称是否存在失败"
 		br.ErrMsg = "判断指标名称是否存在失败,Err:" + err.Error()
@@ -514,7 +514,7 @@ func (this *CalculateController) BatchSave() {
 	//加入缓存机制,避免创建同一个名称的指标 end
 
 	// 根据指标名称和指标ID校验库中是否还存在其他同名指标
-	existEdbName, err := logic.CheckExistByEdbNameAndEdbInfoId(0, req.EdbInfoId, req.EdbName, this.Lang)
+	existEdbName, err := logic.CheckExistByEdbNameAndEdbInfoId(utils.EDB_INFO_TYPE, req.EdbInfoId, req.EdbName, this.Lang)
 	if err != nil {
 		br.Msg = "判断指标名称是否存在失败"
 		br.ErrMsg = "判断指标名称是否存在失败,Err:" + err.Error()
@@ -882,7 +882,7 @@ func (this *CalculateController) BatchEdit() {
 	}
 
 	// 根据指标名称和指标ID校验库中是否还存在其他同名指标
-	existEdbName, err := logic.CheckExistByEdbNameAndEdbInfoId(0, req.EdbInfoId, req.EdbName, this.Lang)
+	existEdbName, err := logic.CheckExistByEdbNameAndEdbInfoId(utils.EDB_INFO_TYPE, req.EdbInfoId, req.EdbName, this.Lang)
 	if err != nil {
 		br.Msg = "判断指标名称是否存在失败"
 		br.ErrMsg = "判断指标名称是否存在失败,Err:" + err.Error()

+ 1 - 1
logic/predict_edb.go

@@ -1123,7 +1123,7 @@ func AddStaticPredictEdbInfo(sourceEdbInfoId, classifyId int, edbName, frequency
 	edbCode := sourceEdbInfo.EdbCode + "_" + time.Now().Format(utils.FormatShortDateTimeUnSpace)
 
 	// 根据指标名称和指标ID校验库中是否还存在其他同名指标
-	existEdbName, err := CheckExistByEdbNameAndEdbInfoId(1, 0, edbName, lang)
+	existEdbName, err := CheckExistByEdbNameAndEdbInfoId(utils.PREDICT_EDB_INFO_TYPE, 0, edbName, lang)
 	if err != nil {
 		errMsg = "判断指标名称是否存在失败"
 		err = errors.New("判断指标名称是否存在失败,Err:" + err.Error())

+ 1 - 1
services/base_from_calculate.go

@@ -947,7 +947,7 @@ func EdbCalculateAdd(req models.EdbInfoCalculateSaveReq, lang string) (edbInfo *
 	}
 
 	// 校验指标名称是否存在
-	existEdbName, err := logic.CheckExistByEdbNameAndEdbInfoId(0, 0, req.EdbName, lang)
+	existEdbName, err := logic.CheckExistByEdbNameAndEdbInfoId(utils.EDB_INFO_TYPE, 0, req.EdbName, lang)
 	if err != nil {
 		errMsg = "判断指标名称是否存在失败,Err:" + err.Error()
 		err = fmt.Errorf("判断指标名称是否存在失败")