|
@@ -4,6 +4,7 @@ import (
|
|
|
"errors"
|
|
|
"eta/eta_api/models"
|
|
|
"eta/eta_api/models/data_manage"
|
|
|
+ "eta/eta_api/models/data_manage/excel"
|
|
|
"eta/eta_api/models/system"
|
|
|
"eta/eta_api/utils"
|
|
|
"fmt"
|
|
@@ -410,6 +411,20 @@ func Delete(classifyId, edbInfoId int, sysUser *system.Admin, requestBody, reque
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // 判断指标是否用作表格引用
|
|
|
+ {
|
|
|
+ calculateCount, tmpErr := excel.GetNoCustomAnalysisExcelEdbMappingCount(edbInfoId)
|
|
|
+ if tmpErr != nil && tmpErr.Error() != utils.ErrNoRow() {
|
|
|
+ errMsg = "删除失败"
|
|
|
+ err = errors.New("当前指标已添加到表格,GetNoCustomAnalysisExcelEdbMappingCount Err:" + tmpErr.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if calculateCount > 0 {
|
|
|
+ errMsg = "当前指标已添加到表格,不可删除"
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//真实删除
|
|
|
tmpErr = data_manage.DeleteEdbInfoAndData(edbInfo.EdbInfoId, edbInfo.Source)
|
|
|
if tmpErr != nil {
|