|
@@ -68,7 +68,7 @@ func (this *ChartInfoController) ChartInfoSave() {
|
|
|
|
|
|
chartItem, err := data_manage.GetChartInfoById(req.ChartInfoId)
|
|
|
if err != nil {
|
|
|
- if err.Error() == utils.ErrNoRow() {
|
|
|
+ if utils.IsErrNoRow(err) {
|
|
|
br.Msg = "图表已被删除,请刷新页面!"
|
|
|
br.ErrMsg = "图表已被删除,请刷新页面,ChartInfoId:" + strconv.Itoa(req.ChartInfoId)
|
|
|
return
|
|
@@ -336,7 +336,7 @@ func (this *ChartInfoController) ChartEnInfoEdit() {
|
|
|
//判断指标名称是否存在
|
|
|
chartItem, err := data_manage.GetChartInfoById(req.ChartInfoId)
|
|
|
if err != nil {
|
|
|
- if err.Error() == utils.ErrNoRow() {
|
|
|
+ if utils.IsErrNoRow(err) {
|
|
|
br.Msg = "图表已被删除,请刷新页面"
|
|
|
br.ErrMsg = "图表已被删除,请刷新页面"
|
|
|
return
|
|
@@ -359,7 +359,7 @@ func (this *ChartInfoController) ChartEnInfoEdit() {
|
|
|
edbInfoId := v.EdbInfoId
|
|
|
edbInfo, err := data_manage.GetEdbInfoById(edbInfoId)
|
|
|
if err != nil {
|
|
|
- if err.Error() == utils.ErrNoRow() {
|
|
|
+ if utils.IsErrNoRow(err) {
|
|
|
br.Msg = "图表不存在!"
|
|
|
br.ErrMsg = "图表指标不存在,ChartInfoId:" + strconv.Itoa(edbInfoId)
|
|
|
return
|
|
@@ -369,7 +369,7 @@ func (this *ChartInfoController) ChartEnInfoEdit() {
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
- if edbInfo == nil {
|
|
|
+ if edbInfo == nil || edbInfo.EdbInfoId <= 0 {
|
|
|
br.Msg = "指标不存在!"
|
|
|
br.ErrMsg = "指标不存在,ChartInfoId:" + strconv.Itoa(edbInfoId)
|
|
|
return
|
|
@@ -391,7 +391,7 @@ func (this *ChartInfoController) ChartEnInfoEdit() {
|
|
|
|
|
|
edbExist, err := data_manage.GetEdbInfoByCondition(edbCondition, edbPars)
|
|
|
if err != nil {
|
|
|
- if err.Error() != utils.ErrNoRow() {
|
|
|
+ if !utils.IsErrNoRow(err) {
|
|
|
br.Msg = "判断英文指标名称是否存在失败"
|
|
|
br.ErrMsg = "判断英文指标名称是否存在失败,Err:" + err.Error()
|
|
|
return
|
|
@@ -420,7 +420,7 @@ func (this *ChartInfoController) ChartEnInfoEdit() {
|
|
|
|
|
|
existItem, err := data_manage.GetChartInfoByCondition(condition, pars)
|
|
|
if err != nil {
|
|
|
- if err.Error() != utils.ErrNoRow() {
|
|
|
+ if !utils.IsErrNoRow(err) {
|
|
|
br.Msg = "判断英文图表名称是否存在失败"
|
|
|
br.ErrMsg = "判断英文图表名称是否存在失败,Err:" + err.Error()
|
|
|
return
|
|
@@ -449,7 +449,7 @@ func (this *ChartInfoController) ChartEnInfoEdit() {
|
|
|
edbInfoId := v.EdbInfoId
|
|
|
edbInfo, err := data_manage.GetEdbInfoById(edbInfoId)
|
|
|
if err != nil {
|
|
|
- if err.Error() == utils.ErrNoRow() {
|
|
|
+ if utils.IsErrNoRow(err) {
|
|
|
br.Msg = "图表不存在!"
|
|
|
br.ErrMsg = "图表指标不存在,ChartInfoId:" + strconv.Itoa(edbInfoId)
|
|
|
return
|
|
@@ -459,7 +459,7 @@ func (this *ChartInfoController) ChartEnInfoEdit() {
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
- if edbInfo != nil {
|
|
|
+ if edbInfo != nil && edbInfo.EdbInfoId > 0 {
|
|
|
go data.AddOrEditEdbInfoToEs(edbInfoId)
|
|
|
}
|
|
|
}
|
|
@@ -528,7 +528,7 @@ func (this *ChartInfoController) ChartInfoBaseEdit() {
|
|
|
//判断指标名称是否存在
|
|
|
chartItem, err := data_manage.GetChartInfoById(req.ChartInfoId)
|
|
|
if err != nil {
|
|
|
- if err.Error() == utils.ErrNoRow() {
|
|
|
+ if utils.IsErrNoRow(err) {
|
|
|
br.Msg = "图表已被删除,请刷新页面"
|
|
|
br.ErrMsg = "图表已被删除,请刷新页面"
|
|
|
return
|
|
@@ -551,7 +551,7 @@ func (this *ChartInfoController) ChartInfoBaseEdit() {
|
|
|
edbInfoId := v.EdbInfoId
|
|
|
edbInfo, err := data_manage.GetEdbInfoById(edbInfoId)
|
|
|
if err != nil {
|
|
|
- if err.Error() == utils.ErrNoRow() {
|
|
|
+ if utils.IsErrNoRow(err) {
|
|
|
br.Msg = "图表不存在!"
|
|
|
br.ErrMsg = "图表指标不存在,ChartInfoId:" + strconv.Itoa(edbInfoId)
|
|
|
return
|
|
@@ -586,7 +586,7 @@ func (this *ChartInfoController) ChartInfoBaseEdit() {
|
|
|
|
|
|
edbExist, err := data_manage.GetEdbInfoByCondition(edbCondition, edbPars)
|
|
|
if err != nil {
|
|
|
- if err.Error() != utils.ErrNoRow() {
|
|
|
+ if !utils.IsErrNoRow(err) {
|
|
|
br.Msg = "判断英文指标名称是否存在失败"
|
|
|
br.ErrMsg = "判断英文指标名称是否存在失败,Err:" + err.Error()
|
|
|
return
|
|
@@ -618,7 +618,7 @@ func (this *ChartInfoController) ChartInfoBaseEdit() {
|
|
|
|
|
|
existItem, err := data_manage.GetChartInfoByCondition(condition, pars)
|
|
|
if err != nil {
|
|
|
- if err.Error() != utils.ErrNoRow() {
|
|
|
+ if !utils.IsErrNoRow(err) {
|
|
|
br.Msg = "判断英文图表名称是否存在失败"
|
|
|
br.ErrMsg = "判断英文图表名称是否存在失败,Err:" + err.Error()
|
|
|
return
|
|
@@ -647,7 +647,7 @@ func (this *ChartInfoController) ChartInfoBaseEdit() {
|
|
|
edbInfoId := v.EdbInfoId
|
|
|
edbInfo, err := data_manage.GetEdbInfoById(edbInfoId)
|
|
|
if err != nil {
|
|
|
- if err.Error() == utils.ErrNoRow() {
|
|
|
+ if utils.IsErrNoRow(err) {
|
|
|
br.Msg = "图表不存在!"
|
|
|
br.ErrMsg = "图表指标不存在,ChartInfoId:" + strconv.Itoa(edbInfoId)
|
|
|
return
|
|
@@ -657,7 +657,7 @@ func (this *ChartInfoController) ChartInfoBaseEdit() {
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
- if edbInfo != nil {
|
|
|
+ if edbInfo != nil && edbInfo.EdbInfoId > 0 {
|
|
|
go data.AddOrEditEdbInfoToEs(edbInfoId)
|
|
|
}
|
|
|
}
|
|
@@ -700,7 +700,7 @@ func (this *ChartInfoController) ChartInfoNewest() {
|
|
|
this.ServeJSON()
|
|
|
}()
|
|
|
item, err := data_manage.GetChartInfoByNewest(1)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ if err != nil && !utils.IsErrNoRow(err) {
|
|
|
br.Msg = "获取最新图表失败"
|
|
|
br.ErrMsg = "获取最新图表失败,Err:" + err.Error()
|
|
|
return
|
|
@@ -788,12 +788,12 @@ func (this *ChartInfoController) ChartInfoMove() {
|
|
|
if chartInfo.ChartClassifyId != req.ChartClassifyId {
|
|
|
//查询需要修改的分类下是否存在同一个图表名称
|
|
|
tmpChartInfo, tmpErr := data_manage.GetChartInfoByClassifyIdAndName(req.ChartClassifyId, chartInfo.ChartName)
|
|
|
- if tmpErr != nil && tmpErr.Error() != utils.ErrNoRow() {
|
|
|
+ if tmpErr != nil && !utils.IsErrNoRow(tmpErr) {
|
|
|
br.Msg = "移动失败"
|
|
|
br.ErrMsg = "移动失败,Err:" + tmpErr.Error()
|
|
|
return
|
|
|
}
|
|
|
- if tmpChartInfo != nil {
|
|
|
+ if tmpChartInfo != nil && tmpChartInfo.ChartInfoId > 0 {
|
|
|
br.Msg = "移动失败,同一个分类下图表名称不允许重复"
|
|
|
br.ErrMsg = "移动失败,同一个分类下图表名称不允许重复"
|
|
|
return
|
|
@@ -847,14 +847,14 @@ func (this *ChartInfoController) ChartInfoMove() {
|
|
|
|
|
|
} else {
|
|
|
firstClassify, err := data_manage.GetFirstChartInfoByClassifyId(req.ChartClassifyId)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ if err != nil && !utils.IsErrNoRow(err) {
|
|
|
br.Msg = "移动失败"
|
|
|
br.ErrMsg = "获取获取当前父级分类下的排序第一条的分类信息失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
|
|
|
//如果该分类下存在其他分类,且第一个其他分类的排序等于0,那么需要调整排序
|
|
|
- if firstClassify != nil && firstClassify.Sort == 0 {
|
|
|
+ if firstClassify != nil && firstClassify.ChartClassifyId > 0 && firstClassify.Sort == 0 {
|
|
|
updateSortStr := ` sort + 1 `
|
|
|
_ = data_manage.UpdateChartInfoSortByClassifyId(firstClassify.ChartClassifyId, 0, firstClassify.ChartInfoId-1, []int{chartInfo.Source}, updateSortStr)
|
|
|
}
|
|
@@ -961,7 +961,7 @@ func (this *ChartInfoController) ChartInfoDetail() {
|
|
|
if chartInfoId > 0 {
|
|
|
chartInfo, err = data_manage.GetChartInfoViewById(chartInfoId)
|
|
|
if err != nil {
|
|
|
- if err.Error() == utils.ErrNoRow() {
|
|
|
+ if utils.IsErrNoRow(err) {
|
|
|
br.Msg = "该图表已删除,自动查看下一图表"
|
|
|
br.ErrMsg = "该图表已删除,自动查看下一图表,Err:" + err.Error()
|
|
|
br.Ret = 406
|
|
@@ -1030,7 +1030,7 @@ func (this *ChartInfoController) ChartInfoDetail() {
|
|
|
extraConfigStr := chartInfo.ExtraConfig
|
|
|
// 柱方图的一些配置
|
|
|
var barConfig data_manage.BarChartInfoReq
|
|
|
- if chartInfo != nil && chartInfo.ChartType == 7 {
|
|
|
+ if chartInfo != nil && chartInfo.ChartInfoId > 0 && chartInfo.ChartType == 7 {
|
|
|
if chartInfo.BarConfig == `` {
|
|
|
br.Msg = "柱方图未配置"
|
|
|
br.ErrMsg = "柱方图未配置"
|
|
@@ -1130,7 +1130,7 @@ func (this *ChartInfoController) ChartInfoDetail() {
|
|
|
if len(warnEdbList) > 0 {
|
|
|
chartInfo.WarnMsg = `图表引用指标异常,异常指标:` + strings.Join(warnEdbList, ",")
|
|
|
}
|
|
|
- if chartInfoId > 0 && chartInfo != nil {
|
|
|
+ if chartInfoId > 0 && chartInfo != nil && chartInfo.ChartInfoId > 0 {
|
|
|
//判断是否加入我的图库
|
|
|
{
|
|
|
var myChartCondition string
|
|
@@ -1141,7 +1141,7 @@ func (this *ChartInfoController) ChartInfoDetail() {
|
|
|
myChartPars = append(myChartPars, chartInfo.ChartInfoId)
|
|
|
|
|
|
myChartList, err := data_manage.GetMyChartByCondition(myChartCondition, myChartPars)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ if err != nil && !utils.IsErrNoRow(err) {
|
|
|
br.Msg = "获取失败"
|
|
|
br.ErrMsg = "获取我的图表信息失败,GetMyChartByCondition,Err:" + err.Error()
|
|
|
return
|
|
@@ -1361,7 +1361,7 @@ func (this *ChartInfoController) PreviewChartInfoDetail() {
|
|
|
extraConfigStr := chartInfo.ExtraConfig
|
|
|
// 柱方图的一些配置
|
|
|
var barConfig data_manage.BarChartInfoReq
|
|
|
- if chartInfo != nil && chartInfo.ChartType == 7 {
|
|
|
+ if chartInfo != nil && chartInfo.ChartInfoId > 0 && chartInfo.ChartType == 7 {
|
|
|
if chartInfo.BarConfig == `` {
|
|
|
br.Msg = "柱方图未配置"
|
|
|
br.ErrMsg = "柱方图未配置"
|
|
@@ -1374,9 +1374,9 @@ func (this *ChartInfoController) PreviewChartInfoDetail() {
|
|
|
return
|
|
|
}
|
|
|
extraConfigStr = chartInfo.BarConfig
|
|
|
- } else if chartInfo != nil && chartInfo.ChartType == utils.CHART_TYPE_SECTION_COMBINE {
|
|
|
+ } else if chartInfo != nil && chartInfo.ChartInfoId > 0 && chartInfo.ChartType == utils.CHART_TYPE_SECTION_COMBINE {
|
|
|
extraConfigStr = req.ExtraConfig
|
|
|
- } else if chartInfo != nil && chartInfo.ChartType == utils.CHART_TYPE_AREA {
|
|
|
+ } else if chartInfo != nil && chartInfo.ChartInfoId > 0 && chartInfo.ChartType == utils.CHART_TYPE_AREA {
|
|
|
extraConfigStr = req.ExtraConfig
|
|
|
}
|
|
|
|
|
@@ -1589,7 +1589,7 @@ func (this *ChartInfoController) ChartInfoDetailV2() {
|
|
|
}
|
|
|
chartInfo, err := data_manage.GetChartInfoViewById(chartInfoId)
|
|
|
if err != nil {
|
|
|
- if err.Error() == utils.ErrNoRow() {
|
|
|
+ if utils.IsErrNoRow(err) {
|
|
|
br.Msg = "该图表已删除,自动查看下一图表"
|
|
|
br.ErrMsg = "该图表已删除,自动查看下一图表,Err:" + err.Error()
|
|
|
br.Ret = 406
|
|
@@ -1700,7 +1700,7 @@ func (this *ChartInfoController) ChartInfoDetailV2() {
|
|
|
extraConfigStr := chartInfo.ExtraConfig
|
|
|
// 柱方图的一些配置
|
|
|
var barConfig data_manage.BarChartInfoReq
|
|
|
- if chartInfo != nil && chartInfo.ChartType == 7 {
|
|
|
+ if chartInfo != nil && chartInfo.ChartInfoId > 0 && chartInfo.ChartType == 7 {
|
|
|
if chartInfo.BarConfig == `` {
|
|
|
br.Msg = "柱方图未配置"
|
|
|
br.ErrMsg = "柱方图未配置"
|
|
@@ -1740,7 +1740,7 @@ func (this *ChartInfoController) ChartInfoDetailV2() {
|
|
|
if len(warnEdbList) > 0 {
|
|
|
chartInfo.WarnMsg = `图表引用指标异常,异常指标:` + strings.Join(warnEdbList, ",")
|
|
|
}
|
|
|
- if chartInfoId > 0 && chartInfo != nil {
|
|
|
+ if chartInfoId > 0 && chartInfo != nil && chartInfo.ChartInfoId > 0 {
|
|
|
//判断是否加入我的图库
|
|
|
{
|
|
|
var myChartCondition string
|
|
@@ -1751,7 +1751,7 @@ func (this *ChartInfoController) ChartInfoDetailV2() {
|
|
|
myChartPars = append(myChartPars, chartInfo.ChartInfoId)
|
|
|
|
|
|
myChartList, err := data_manage.GetMyChartByCondition(myChartCondition, myChartPars)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ if err != nil && !utils.IsErrNoRow(err) {
|
|
|
br.Msg = "获取失败"
|
|
|
br.ErrMsg = "获取我的图表信息失败,GetMyChartByCondition,Err:" + err.Error()
|
|
|
return
|
|
@@ -2184,7 +2184,7 @@ func (this *ChartInfoController) ChartInfoSearch() {
|
|
|
for _, v := range keyWordArr {
|
|
|
v = strings.Replace(v, " ", "%", -1)
|
|
|
newSearchList, err := data_manage.ChartInfoSearchByKeyWord(v, showSysId)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ if err != nil && !utils.IsErrNoRow(err) {
|
|
|
br.Msg = "获取失败"
|
|
|
br.ErrMsg = "获取图表信息失败,Err:" + err.Error()
|
|
|
return
|
|
@@ -2304,7 +2304,7 @@ func (this *ChartInfoController) ChartInfoSearchByEs() {
|
|
|
{
|
|
|
obj := data_manage.EdbInfoNoPermissionAdmin{}
|
|
|
confList, err := obj.GetAllChartListByAdminId(this.SysUser.AdminId)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ if err != nil && !utils.IsErrNoRow(err) {
|
|
|
br.Msg = "获取失败"
|
|
|
br.ErrMsg = "获取不可见指标配置数据失败,Err:" + err.Error()
|
|
|
return
|
|
@@ -2321,7 +2321,7 @@ func (this *ChartInfoController) ChartInfoSearchByEs() {
|
|
|
isEs = true
|
|
|
} else {
|
|
|
total, searchList, err = data_manage.ChartInfoSearchByEmptyKeyWord(showSysId, []int{utils.CHART_SOURCE_DEFAULT}, noPermissionChartIdList, startSize, pageSize)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ if err != nil && !utils.IsErrNoRow(err) {
|
|
|
br.Msg = "获取失败"
|
|
|
br.ErrMsg = "获取图表信息失败,Err:" + err.Error()
|
|
|
return
|
|
@@ -2475,7 +2475,7 @@ func (this *EdbInfoController) ChartInfoRefresh() {
|
|
|
chartInfo, err = data_manage.GetChartInfoByUniqueCode(uniqueCode)
|
|
|
}
|
|
|
if err != nil {
|
|
|
- if err.Error() == utils.ErrNoRow() {
|
|
|
+ if utils.IsErrNoRow(err) {
|
|
|
br.Msg = "图表已被删除,无需刷新"
|
|
|
br.ErrMsg = "获取指标信息失败,Err:" + err.Error()
|
|
|
return
|
|
@@ -2594,7 +2594,7 @@ func (this *ChartInfoController) ChartInfoDetailFromUniqueCode() {
|
|
|
status := true
|
|
|
chartInfo, err := data_manage.GetChartInfoViewByUniqueCode(uniqueCode)
|
|
|
if err != nil {
|
|
|
- if err.Error() == utils.ErrNoRow() {
|
|
|
+ if utils.IsErrNoRow(err) {
|
|
|
status = false
|
|
|
} else {
|
|
|
br.Msg = "获取失败"
|
|
@@ -2664,7 +2664,7 @@ func GetChartInfoDetailFromUniqueCode(chartInfo *data_manage.ChartInfoView, isCa
|
|
|
myChartPars = append(myChartPars, chartInfo.ChartInfoId)
|
|
|
|
|
|
myChartList, err := data_manage.GetMyChartByCondition(myChartCondition, myChartPars)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ if err != nil && !utils.IsErrNoRow(err) {
|
|
|
msg = "获取失败"
|
|
|
errMsg = "获取我的图表信息失败,GetMyChartByCondition,Err:" + err.Error()
|
|
|
return
|
|
@@ -2842,7 +2842,7 @@ func GetChartInfoDetailFromUniqueCode(chartInfo *data_manage.ChartInfoView, isCa
|
|
|
extraConfigStr := chartInfo.ExtraConfig //图表额外数据参数
|
|
|
var barConfig data_manage.BarChartInfoReq
|
|
|
// 柱方图的一些配置
|
|
|
- if chartInfo != nil && chartInfo.ChartType == 7 {
|
|
|
+ if chartInfo != nil && chartInfo.ChartInfoId > 0 && chartInfo.ChartType == 7 {
|
|
|
if chartInfo.BarConfig == `` {
|
|
|
msg = "柱方图未配置"
|
|
|
errMsg = "柱方图未配置"
|
|
@@ -2888,7 +2888,7 @@ func GetChartInfoDetailFromUniqueCode(chartInfo *data_manage.ChartInfoView, isCa
|
|
|
*/
|
|
|
|
|
|
chartViewClassify, _ := data_manage.GetChartClassifyViewById(chartInfo.ChartClassifyId)
|
|
|
- if chartViewClassify != nil {
|
|
|
+ if chartViewClassify != nil && chartViewClassify.ChartClassifyId > 0 {
|
|
|
chartClassifyParent, _ := data_manage.GetChartClassifyViewById(chartClassify.ParentId)
|
|
|
chartInfo.ChartClassify = append(chartInfo.ChartClassify, chartClassifyParent)
|
|
|
}
|
|
@@ -3188,7 +3188,7 @@ func (this *ChartInfoController) CopyChartInfo() {
|
|
|
}
|
|
|
chartClassify, err := data_manage.GetChartClassifyById(req.ChartClassifyId)
|
|
|
if err != nil {
|
|
|
- if err.Error() == utils.ErrNoRow() {
|
|
|
+ if utils.IsErrNoRow(err) {
|
|
|
br.Msg = "分类不存在"
|
|
|
br.ErrMsg = "分类不存在"
|
|
|
return
|
|
@@ -3317,7 +3317,7 @@ func (this *ChartInfoController) CopyChartInfo() {
|
|
|
ChartStyle: v.ChartStyle,
|
|
|
ChartColor: v.ChartColor,
|
|
|
ChartWidth: v.ChartWidth,
|
|
|
- Source: v.Source,
|
|
|
+ Source: oldChartInfo.Source,
|
|
|
EdbAliasName: v.EdbAliasName,
|
|
|
IsConvert: v.IsConvert,
|
|
|
ConvertType: v.ConvertType,
|
|
@@ -3854,10 +3854,6 @@ func (this *EdbInfoController) GetBatchChartRefreshResult() {
|
|
|
// fmt.Println("end")
|
|
|
//}
|
|
|
|
|
|
-//func init() {
|
|
|
-// data.AddAllChartInfo()
|
|
|
-//}
|
|
|
-
|
|
|
// 截面散点示例数据
|
|
|
//func init() {
|
|
|
//
|
|
@@ -4163,7 +4159,7 @@ func (this *ChartInfoController) ChartInfoConvertDetail() {
|
|
|
if chartInfoId > 0 {
|
|
|
chartInfo, err = data_manage.GetChartInfoViewById(chartInfoId)
|
|
|
if err != nil {
|
|
|
- if err.Error() == utils.ErrNoRow() {
|
|
|
+ if utils.IsErrNoRow(err) {
|
|
|
br.Msg = "该图表已删除,自动查看下一图表"
|
|
|
br.ErrMsg = "该图表已删除,自动查看下一图表,Err:" + err.Error()
|
|
|
br.Ret = 406
|
|
@@ -4251,7 +4247,7 @@ func (this *ChartInfoController) ChartInfoConvertDetail() {
|
|
|
extraConfigStr := chartInfo.ExtraConfig
|
|
|
// 柱方图的一些配置
|
|
|
var barConfig data_manage.BarChartInfoReq
|
|
|
- if chartInfo != nil && chartInfo.ChartType == 7 {
|
|
|
+ if chartInfo != nil && chartInfo.ChartInfoId > 0 && chartInfo.ChartType == 7 {
|
|
|
if chartInfo.BarConfig == `` {
|
|
|
br.Msg = "柱方图未配置"
|
|
|
br.ErrMsg = "柱方图未配置"
|
|
@@ -4312,7 +4308,7 @@ func (this *ChartInfoController) ChartInfoConvertDetail() {
|
|
|
if len(warnEdbList) > 0 {
|
|
|
chartInfo.WarnMsg = `图表引用指标异常,异常指标:` + strings.Join(warnEdbList, ",")
|
|
|
}
|
|
|
- if chartInfoId > 0 && chartInfo != nil {
|
|
|
+ if chartInfoId > 0 && chartInfo != nil && chartInfo.ChartInfoId > 0 {
|
|
|
//判断是否加入我的图库
|
|
|
{
|
|
|
var myChartCondition string
|
|
@@ -4323,7 +4319,7 @@ func (this *ChartInfoController) ChartInfoConvertDetail() {
|
|
|
myChartPars = append(myChartPars, chartInfo.ChartInfoId)
|
|
|
|
|
|
myChartList, err := data_manage.GetMyChartByCondition(myChartCondition, myChartPars)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ if err != nil && !utils.IsErrNoRow(err) {
|
|
|
br.Msg = "获取失败"
|
|
|
br.ErrMsg = "获取我的图表信息失败,GetMyChartByCondition,Err:" + err.Error()
|
|
|
return
|
|
@@ -4725,7 +4721,7 @@ func (this *ChartInfoController) ChartList() {
|
|
|
if len(chartClassifyIdsStr) > 0 {
|
|
|
if !subClassify {
|
|
|
chartClassifyId, err := data_manage.GetChartClassifyByIdsNoSubClassify(chartClassifyIds)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ if err != nil && !utils.IsErrNoRow(err) {
|
|
|
br.Msg = "获取图表信息失败"
|
|
|
br.ErrMsg = "获取信息失败,GetChartClassify,Err:" + err.Error()
|
|
|
return
|
|
@@ -4805,7 +4801,7 @@ func (this *ChartInfoController) ChartList() {
|
|
|
{
|
|
|
obj := data_manage.EdbInfoNoPermissionAdmin{}
|
|
|
confList, err := obj.GetAllChartListByAdminId(this.SysUser.AdminId)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ if err != nil && !utils.IsErrNoRow(err) {
|
|
|
br.Msg = "获取失败"
|
|
|
br.ErrMsg = "获取不可见指标配置数据失败,Err:" + err.Error()
|
|
|
return
|
|
@@ -4823,7 +4819,7 @@ func (this *ChartInfoController) ChartList() {
|
|
|
|
|
|
//获取图表信息
|
|
|
list, err := data_manage.GetChartListByCondition(condition, pars, startSize, pageSize)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ if err != nil && !utils.IsErrNoRow(err) {
|
|
|
br.Success = true
|
|
|
br.Msg = "获取图表信息失败"
|
|
|
br.ErrMsg = "获取图表信息失败,Err:" + err.Error()
|
|
@@ -4831,7 +4827,7 @@ func (this *ChartInfoController) ChartList() {
|
|
|
}
|
|
|
|
|
|
myChartList, err := data_manage.GetMyChartListByAdminId(sysUser.AdminId)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ if err != nil && !utils.IsErrNoRow(err) {
|
|
|
br.Msg = "获取图表信息失败"
|
|
|
br.ErrMsg = "获取我的图表信息失败,Err:" + err.Error()
|
|
|
return
|
|
@@ -4923,7 +4919,7 @@ func (this *ChartInfoController) ChartList() {
|
|
|
}
|
|
|
|
|
|
resp := new(data_manage.ChartListResp)
|
|
|
- if list == nil || len(list) <= 0 || (err != nil && err.Error() == utils.ErrNoRow()) {
|
|
|
+ if list == nil || len(list) <= 0 || (err != nil && utils.IsErrNoRow(err)) {
|
|
|
items := make([]*data_manage.ChartInfoView, 0)
|
|
|
resp.Paging = page
|
|
|
resp.List = items
|
|
@@ -4934,7 +4930,7 @@ func (this *ChartInfoController) ChartList() {
|
|
|
}
|
|
|
|
|
|
dataCount, err := data_manage.GetChartListCountByCondition(condition, pars)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ if err != nil && !utils.IsErrNoRow(err) {
|
|
|
br.Msg = "获取指标信息失败"
|
|
|
br.ErrMsg = "获取指标数据总数失败,Err:" + err.Error()
|
|
|
return
|
|
@@ -5002,7 +4998,7 @@ func (this *ChartInfoController) ModifyChartList() {
|
|
|
if len(chartClassifyIds) > 0 {
|
|
|
if !req.SubClassify {
|
|
|
chartClassifyId, err := data_manage.GetChartClassifyByIdsNoSubClassify(chartClassifyIds)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ if err != nil && !utils.IsErrNoRow(err) {
|
|
|
br.Msg = "获取图表信息失败"
|
|
|
br.ErrMsg = "获取信息失败,GetChartClassify,Err:" + err.Error()
|
|
|
return
|