|
@@ -32,12 +32,12 @@ func AddClarksonsClassify(classifyName string, parentId int) (ok bool, msg strin
|
|
return false, "", errors.New("父分类不存在")
|
|
return false, "", errors.New("父分类不存在")
|
|
}
|
|
}
|
|
clarksonsClassify := &data_manage.BaseFromClarksonsClassify{
|
|
clarksonsClassify := &data_manage.BaseFromClarksonsClassify{
|
|
- ClassifyName: classifyName,
|
|
|
|
- ParentId: parentId,
|
|
|
|
- Level: 2,
|
|
|
|
- Sort: sort + 1,
|
|
|
|
- ModifyTime: time.Now(),
|
|
|
|
- CreateTime: time.Now(),
|
|
|
|
|
|
+ ClassifyName: classifyName,
|
|
|
|
+ ParentId: parentId,
|
|
|
|
+ Level: 2,
|
|
|
|
+ Sort: sort + 1,
|
|
|
|
+ ModifyTime: time.Now(),
|
|
|
|
+ CreateTime: time.Now(),
|
|
}
|
|
}
|
|
_, err = clarksonsClassify.Add()
|
|
_, err = clarksonsClassify.Add()
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -45,12 +45,12 @@ func AddClarksonsClassify(classifyName string, parentId int) (ok bool, msg strin
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
clarksonsClassify := &data_manage.BaseFromClarksonsClassify{
|
|
clarksonsClassify := &data_manage.BaseFromClarksonsClassify{
|
|
- ClassifyName: classifyName,
|
|
|
|
- ParentId: 0,
|
|
|
|
- Level: 1,
|
|
|
|
- Sort: sort + 1,
|
|
|
|
- ModifyTime: time.Now(),
|
|
|
|
- CreateTime: time.Now(),
|
|
|
|
|
|
+ ClassifyName: classifyName,
|
|
|
|
+ ParentId: 0,
|
|
|
|
+ Level: 1,
|
|
|
|
+ Sort: sort + 1,
|
|
|
|
+ ModifyTime: time.Now(),
|
|
|
|
+ CreateTime: time.Now(),
|
|
}
|
|
}
|
|
_, er := clarksonsClassify.Add()
|
|
_, er := clarksonsClassify.Add()
|
|
if er != nil {
|
|
if er != nil {
|
|
@@ -136,7 +136,7 @@ func ResetClarksonsIndex(indexId int) (err error) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
-// 批量删除卓创红期指标
|
|
|
|
|
|
+// 批量删除克拉克森指标
|
|
func BatchDelClarksonsData(indexIds []int) (existIndex []*data_manage.BaseFromClarksonsIndex, err error) {
|
|
func BatchDelClarksonsData(indexIds []int) (existIndex []*data_manage.BaseFromClarksonsIndex, err error) {
|
|
clarksonsIndexList, err := data_manage.GetClarksonsIndexListByIndexIds(indexIds)
|
|
clarksonsIndexList, err := data_manage.GetClarksonsIndexListByIndexIds(indexIds)
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -173,7 +173,7 @@ func BatchDelClarksonsData(indexIds []int) (existIndex []*data_manage.BaseFromCl
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
-// DelClarksonsData 删除卓创红期指标
|
|
|
|
|
|
+// DelClarksonsData 删除克拉克森指标
|
|
func DelClarksonsData(indexId int) (err error, errMsg string) {
|
|
func DelClarksonsData(indexId int) (err error, errMsg string) {
|
|
baseFromClarksonsIndex, err := data_manage.GetClarksonsIndexByIndexId(indexId)
|
|
baseFromClarksonsIndex, err := data_manage.GetClarksonsIndexByIndexId(indexId)
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -207,7 +207,7 @@ func DelClarksonsData(indexId int) (err error, errMsg string) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
-// EditClarksonsIndex 编辑卓创红期指标
|
|
|
|
|
|
+// EditClarksonsIndex 编辑克拉克森指标
|
|
func EditClarksonsIndex(indexId, classifyId int) (baseFromClarksonsIndex *data_manage.BaseFromClarksonsIndex, errMsg string, err error) {
|
|
func EditClarksonsIndex(indexId, classifyId int) (baseFromClarksonsIndex *data_manage.BaseFromClarksonsIndex, errMsg string, err error) {
|
|
baseFromClarksonsIndex, err = data_manage.GetClarksonsIndexByIndexId(indexId)
|
|
baseFromClarksonsIndex, err = data_manage.GetClarksonsIndexByIndexId(indexId)
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -252,7 +252,7 @@ type ClarksonsIndexSource2EdbReq struct {
|
|
AdminRealName string
|
|
AdminRealName string
|
|
}
|
|
}
|
|
|
|
|
|
-// ClarksonsIndexSource2Edb 新增卓创红期数据从数据源到指标库
|
|
|
|
|
|
+// ClarksonsIndexSource2Edb 新增克拉克森数据从数据源到指标库
|
|
func ClarksonsIndexSource2Edb(req ClarksonsIndexSource2EdbReq, lang string) (edb *data_manage.EdbInfo, errMsg string, skip bool, err error) {
|
|
func ClarksonsIndexSource2Edb(req ClarksonsIndexSource2EdbReq, lang string) (edb *data_manage.EdbInfo, errMsg string, skip bool, err error) {
|
|
if req.EdbCode == "" {
|
|
if req.EdbCode == "" {
|
|
err = fmt.Errorf("指标ID为空")
|
|
err = fmt.Errorf("指标ID为空")
|
|
@@ -294,7 +294,7 @@ func ClarksonsIndexSource2Edb(req ClarksonsIndexSource2EdbReq, lang string) (edb
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
-// MoveClarksonsClassify 移动卓创红期分类
|
|
|
|
|
|
+// MoveClarksonsClassify 移动克拉克森分类
|
|
func MoveClarksonsClassify(classifyId, parentClassifyId, prevClassifyId, nextClassifyId int) (err error, errMsg string) {
|
|
func MoveClarksonsClassify(classifyId, parentClassifyId, prevClassifyId, nextClassifyId int) (err error, errMsg string) {
|
|
//判断分类是否存在
|
|
//判断分类是否存在
|
|
classifyInfo, err := data_manage.GetClarksonsClassifyById(classifyId)
|
|
classifyInfo, err := data_manage.GetClarksonsClassifyById(classifyId)
|
|
@@ -304,6 +304,19 @@ func MoveClarksonsClassify(classifyId, parentClassifyId, prevClassifyId, nextCla
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // 校验移动的父级目录下是否有重名分类
|
|
|
|
+ count, e := data_manage.GetBaseFromClarksonsClassifyCount(classifyInfo.ClassifyName, parentClassifyId)
|
|
|
|
+ if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
|
+ errMsg = "移动失败"
|
|
|
|
+ err = errors.New("获取父级目录下的同名分类失败, Err: " + e.Error())
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if count > 0 {
|
|
|
|
+ errMsg = "移动失败,分类名称已存在"
|
|
|
|
+ err = errors.New("该父级目录下已存在同名分类,请重新命名")
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
updateCol := make([]string, 0)
|
|
updateCol := make([]string, 0)
|
|
|
|
|
|
//判断上级id是否一致,如果不一致的话,那么需要移动该分类层级
|
|
//判断上级id是否一致,如果不一致的话,那么需要移动该分类层级
|
|
@@ -405,7 +418,7 @@ func MoveClarksonsClassify(classifyId, parentClassifyId, prevClassifyId, nextCla
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
-// MoveClarksonsData 移动卓创红期指标
|
|
|
|
|
|
+// MoveClarksonsData 移动克拉克森指标
|
|
func MoveClarksonsData(indexId, classifyId, prevIndexId, nextIndexId int) (err error, errMsg string) {
|
|
func MoveClarksonsData(indexId, classifyId, prevIndexId, nextIndexId int) (err error, errMsg string) {
|
|
//分类信息
|
|
//分类信息
|
|
clarksonsIndex, err := data_manage.GetClarksonsIndexByIndexId(indexId)
|
|
clarksonsIndex, err := data_manage.GetClarksonsIndexByIndexId(indexId)
|
|
@@ -607,7 +620,6 @@ func GetClarksonsIndexInfo(keyWord string, classifyIdList []string, frequencyLis
|
|
return &indexPage, nil
|
|
return &indexPage, nil
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
// GetClarkssonsIndexList 获取指标列表
|
|
// GetClarkssonsIndexList 获取指标列表
|
|
func GetClarkssonsIndexList(searchParams string) (rzdIndexInfoList []*data_manage.BaseFromRzdIndexList, err error) {
|
|
func GetClarkssonsIndexList(searchParams string) (rzdIndexInfoList []*data_manage.BaseFromRzdIndexList, err error) {
|
|
|
|
|
|
@@ -624,4 +636,4 @@ func GetClarkssonsIndexList(searchParams string) (rzdIndexInfoList []*data_manag
|
|
}
|
|
}
|
|
|
|
|
|
return rzdIndexList, nil
|
|
return rzdIndexList, nil
|
|
-}
|
|
|
|
|
|
+}
|