|
@@ -4,7 +4,6 @@ import (
|
|
|
"encoding/json"
|
|
|
"eta/eta_api/models"
|
|
|
"eta/eta_api/models/report_approve"
|
|
|
- "eta/eta_api/models/system"
|
|
|
"eta/eta_api/services"
|
|
|
"eta/eta_api/utils"
|
|
|
"fmt"
|
|
@@ -37,7 +36,7 @@ func (this *ClassifyController) Add() {
|
|
|
}
|
|
|
|
|
|
// 获取系统菜单, 如果没有对应的字段的特殊处理项, 则忽略必填
|
|
|
- menus, e := system.GetSysMenuItemsByCondition(` AND hidden = 0`, make([]interface{}, 0), []string{}, ``)
|
|
|
+ /*menus, e := system.GetSysMenuItemsByCondition(` AND hidden = 0`, make([]interface{}, 0), []string{}, ``)
|
|
|
if e != nil {
|
|
|
br.Msg = "保存失败"
|
|
|
br.ErrMsg = "获取菜单列表失败, Err: " + e.Error()
|
|
@@ -48,13 +47,13 @@ func (this *ClassifyController) Add() {
|
|
|
if m.ButtonCode != "" {
|
|
|
menuMap[m.ButtonCode] = true
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
if req.ClassifyName == "" {
|
|
|
br.Msg = "分类名称不可为空"
|
|
|
return
|
|
|
}
|
|
|
- if menuMap[system.MenuSpecialHandleClassifyShowType] && req.ParentId != 0 && req.ShowType == 0 {
|
|
|
+ /*if menuMap[system.MenuSpecialHandleClassifyShowType] && req.ParentId != 0 && req.ShowType == 0 {
|
|
|
br.Msg = "展示类型不可为空"
|
|
|
return
|
|
|
}
|
|
@@ -65,7 +64,7 @@ func (this *ClassifyController) Add() {
|
|
|
if menuMap[system.MenuSpecialHandleClassifyReportImgs] && (req.ShowType == 1 || req.ShowType == 3) && req.YbRightBanner == "" && req.ParentId == 0 { //当一级报告分类为列表、品种时,增加“报告合集配图”的配置项
|
|
|
br.Msg = "报告合集配图不可为空"
|
|
|
return
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
item, err := models.GetClassifyByName(req.ClassifyName, req.ParentId)
|
|
|
if err != nil && err.Error() != utils.ErrNoRow() {
|
|
@@ -91,7 +90,9 @@ func (this *ClassifyController) Add() {
|
|
|
classify.ParentId = req.ParentId
|
|
|
classify.CreateTime = nowTime
|
|
|
classify.ModifyTime = nowTime
|
|
|
- classify.Abstract = req.Abstract
|
|
|
+ classify.Sort = maxSort + 1
|
|
|
+
|
|
|
+ /*classify.Abstract = req.Abstract
|
|
|
classify.Descript = req.Descript
|
|
|
classify.Abstract = req.Abstract
|
|
|
classify.Descript = req.Descript
|
|
@@ -106,7 +107,7 @@ func (this *ClassifyController) Add() {
|
|
|
classify.ShowType = req.ShowType
|
|
|
classify.HasTeleconference = req.HasTeleconference
|
|
|
classify.VipTitle = req.VipTitle
|
|
|
- classify.Sort = maxSort + 1
|
|
|
+
|
|
|
classify.IsShow = req.IsShow
|
|
|
classify.YbFiccSort = req.YbFiccSort
|
|
|
classify.YbFiccIcon = req.YbFiccIcon
|
|
@@ -164,7 +165,7 @@ func (this *ClassifyController) Add() {
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
err = models.AddClassify(classify)
|
|
|
if err != nil {
|
|
|
br.Msg = "新增失败"
|
|
@@ -173,7 +174,7 @@ func (this *ClassifyController) Add() {
|
|
|
}
|
|
|
|
|
|
// 一级分类-新增子目录
|
|
|
- if classify.ParentId == 0 && len(req.MenuList) > 0 {
|
|
|
+ /*if classify.ParentId == 0 && len(req.MenuList) > 0 {
|
|
|
menus := make([]*models.ClassifyMenu, 0)
|
|
|
for i := range req.MenuList {
|
|
|
menus = append(menus, &models.ClassifyMenu{
|
|
@@ -198,7 +199,7 @@ func (this *ClassifyController) Add() {
|
|
|
br.ErrMsg = "新增子目录关联失败, Err:" + e.Error()
|
|
|
return
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
//获取报告分类权限列表
|
|
|
if classify.ParentId > 0 { //二级分类才能修改权限
|
|
|
req2 := services.EditClassifyPermissionReq{
|
|
@@ -408,7 +409,7 @@ func (this *ClassifyController) Edit() {
|
|
|
}
|
|
|
|
|
|
// 获取系统菜单, 如果没有对应的字段的特殊处理项, 则忽略必填
|
|
|
- menus, e := system.GetSysMenuItemsByCondition(` AND hidden = 0`, make([]interface{}, 0), []string{}, ``)
|
|
|
+ /*menus, e := system.GetSysMenuItemsByCondition(` AND hidden = 0`, make([]interface{}, 0), []string{}, ``)
|
|
|
if e != nil {
|
|
|
br.Msg = "保存失败"
|
|
|
br.ErrMsg = "获取菜单列表失败, Err: " + e.Error()
|
|
@@ -419,7 +420,7 @@ func (this *ClassifyController) Edit() {
|
|
|
if m.ButtonCode != "" {
|
|
|
menuMap[m.ButtonCode] = true
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
if req.ClassifyId <= 0 {
|
|
|
br.Msg = "参数错误"
|
|
@@ -429,7 +430,7 @@ func (this *ClassifyController) Edit() {
|
|
|
br.Msg = "分类名称不可为空"
|
|
|
return
|
|
|
}
|
|
|
- if menuMap[system.MenuSpecialHandleClassifyShowType] && req.ParentId != 0 && req.ShowType == 0 {
|
|
|
+ /*if menuMap[system.MenuSpecialHandleClassifyShowType] && req.ParentId != 0 && req.ShowType == 0 {
|
|
|
br.Msg = "展示类型不可为空"
|
|
|
return
|
|
|
}
|
|
@@ -440,7 +441,7 @@ func (this *ClassifyController) Edit() {
|
|
|
if menuMap[system.MenuSpecialHandleClassifyReportImgs] && (req.ShowType == 1 || req.ShowType == 3) && req.YbRightBanner == "" && req.ParentId == 0 { //当一级报告分类为列表、品种时,增加“报告合集配图”的配置项
|
|
|
br.Msg = "报告合集配图不可为空"
|
|
|
return
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
item, err := models.GetClassifyById(req.ClassifyId)
|
|
|
if err != nil {
|
|
@@ -470,52 +471,62 @@ func (this *ClassifyController) Edit() {
|
|
|
}
|
|
|
oldClassifyName := item.ClassifyName
|
|
|
item.ClassifyName = req.ClassifyName
|
|
|
- item.Abstract = req.Abstract
|
|
|
item.ParentId = req.ParentId
|
|
|
- item.Descript = req.Descript
|
|
|
- item.ReportAuthor = req.ReportAuthor
|
|
|
- item.AuthorDescript = req.AuthorDescript
|
|
|
- item.ColumnImgUrl = req.ColumnImgUrl
|
|
|
- item.HeadImgUrl = req.HeadImgUrl
|
|
|
- item.AvatarImgUrl = req.AvatarImgUrl
|
|
|
- item.ReportImgUrl = req.ReportImgUrl
|
|
|
- item.HomeImgUrl = req.HomeImgUrl
|
|
|
- item.ClassifyLabel = req.ClassifyLabel
|
|
|
- item.ShowType = req.ShowType
|
|
|
- item.HasTeleconference = req.HasTeleconference
|
|
|
- item.VipTitle = req.VipTitle
|
|
|
- // item.Sort = req.Sort
|
|
|
- item.IsShow = req.IsShow
|
|
|
- item.YbFiccSort = req.YbFiccSort
|
|
|
- item.YbFiccIcon = req.YbFiccIcon
|
|
|
- item.YbFiccPcIcon = req.YbFiccPcIcon
|
|
|
- item.YbIconUrl = req.YbIconUrl
|
|
|
- item.YbBgUrl = req.YbBgUrl
|
|
|
- item.YbListImg = req.YbListImg
|
|
|
- item.YbShareBgImg = req.YbShareBgImg
|
|
|
- item.YbRightBanner = req.YbRightBanner
|
|
|
- item.RelateTel = req.RelateTel
|
|
|
- item.RelateVideo = req.RelateVideo
|
|
|
item.ModifyTime = time.Now().Local()
|
|
|
cols := make([]string, 0)
|
|
|
- cols = append(cols, "ClassifyName", "Abstract", "ParentId", "Descript", "ReportAuthor", "AuthorDescript", "ColumnImgUrl",
|
|
|
- "HeadImgUrl", "AvatarImgUrl", "ReportImgUrl", "HomeImgUrl", "ClassifyLabel", "ShowType", "HasTeleconference", "VipTitle", "Sort",
|
|
|
- "IsShow", "YbFiccSort", "YbFiccIcon", "YbFiccPcIcon", "YbIconUrl", "YbBgUrl", "YbListImg", "YbShareBgImg", "YbRightBanner",
|
|
|
- "RelateTel", "RelateVideo", "ModifyTime")
|
|
|
+ cols = append(cols, "ClassifyName", "ParentId", "ModifyTime")
|
|
|
if e := item.UpdateClassify(cols); e != nil {
|
|
|
br.Msg = "修改失败"
|
|
|
br.ErrMsg = "修改失败,Err:" + e.Error()
|
|
|
return
|
|
|
}
|
|
|
- // 一级分类关联设置会强制修改二级分类的所有关联设置
|
|
|
- if item.ParentId == 0 {
|
|
|
- if e = models.UpdateChildClassifyRelateSetting(item.Id, req.RelateTel, req.RelateVideo); e != nil {
|
|
|
- br.Msg = "更新二级分类关联设置失败"
|
|
|
- br.ErrMsg = "更新二级分类关联设置失败, Err: " + e.Error()
|
|
|
+
|
|
|
+ /*
|
|
|
+ item.Abstract = req.Abstract
|
|
|
+ item.Descript = req.Descript
|
|
|
+ item.ReportAuthor = req.ReportAuthor
|
|
|
+ item.AuthorDescript = req.AuthorDescript
|
|
|
+ item.ColumnImgUrl = req.ColumnImgUrl
|
|
|
+ item.HeadImgUrl = req.HeadImgUrl
|
|
|
+ item.AvatarImgUrl = req.AvatarImgUrl
|
|
|
+ item.ReportImgUrl = req.ReportImgUrl
|
|
|
+ item.HomeImgUrl = req.HomeImgUrl
|
|
|
+ item.ClassifyLabel = req.ClassifyLabel
|
|
|
+ item.ShowType = req.ShowType
|
|
|
+ item.HasTeleconference = req.HasTeleconference
|
|
|
+ item.VipTitle = req.VipTitle
|
|
|
+ // item.Sort = req.Sort
|
|
|
+ item.IsShow = req.IsShow
|
|
|
+ item.YbFiccSort = req.YbFiccSort
|
|
|
+ item.YbFiccIcon = req.YbFiccIcon
|
|
|
+ item.YbFiccPcIcon = req.YbFiccPcIcon
|
|
|
+ item.YbIconUrl = req.YbIconUrl
|
|
|
+ item.YbBgUrl = req.YbBgUrl
|
|
|
+ item.YbListImg = req.YbListImg
|
|
|
+ item.YbShareBgImg = req.YbShareBgImg
|
|
|
+ item.YbRightBanner = req.YbRightBanner
|
|
|
+ item.RelateTel = req.RelateTel
|
|
|
+ item.RelateVideo = req.RelateVideo
|
|
|
+ item.ModifyTime = time.Now().Local()
|
|
|
+ cols := make([]string, 0)
|
|
|
+ cols = append(cols, "ClassifyName", "Abstract", "ParentId", "Descript", "ReportAuthor", "AuthorDescript", "ColumnImgUrl",
|
|
|
+ "HeadImgUrl", "AvatarImgUrl", "ReportImgUrl", "HomeImgUrl", "ClassifyLabel", "ShowType", "HasTeleconference", "VipTitle", "Sort",
|
|
|
+ "IsShow", "YbFiccSort", "YbFiccIcon", "YbFiccPcIcon", "YbIconUrl", "YbBgUrl", "YbListImg", "YbShareBgImg", "YbRightBanner",
|
|
|
+ "RelateTel", "RelateVideo", "ModifyTime")
|
|
|
+ if e := item.UpdateClassify(cols); e != nil {
|
|
|
+ br.Msg = "修改失败"
|
|
|
+ br.ErrMsg = "修改失败,Err:" + e.Error()
|
|
|
return
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
+ // 一级分类关联设置会强制修改二级分类的所有关联设置
|
|
|
+ if item.ParentId == 0 {
|
|
|
+ if e = models.UpdateChildClassifyRelateSetting(item.Id, req.RelateTel, req.RelateVideo); e != nil {
|
|
|
+ br.Msg = "更新二级分类关联设置失败"
|
|
|
+ br.ErrMsg = "更新二级分类关联设置失败, Err: " + e.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ */
|
|
|
// 为二级分类时, 更新父级分类是否含电话会字段
|
|
|
if req.ParentId > 0 {
|
|
|
//二级分类才能修改权限
|
|
@@ -530,9 +541,9 @@ func (this *ClassifyController) Edit() {
|
|
|
br.ErrMsg = "修改分类权限失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- go func() {
|
|
|
+ /*go func() {
|
|
|
_ = services.UpdateParentClassifyHasTel(req.ClassifyId, req.ParentId, req.HasTeleconference)
|
|
|
- }()
|
|
|
+ }()*/
|
|
|
}
|
|
|
|
|
|
// 更新报告分类名称/父级分类后
|
|
@@ -541,7 +552,7 @@ func (this *ClassifyController) Edit() {
|
|
|
}()
|
|
|
|
|
|
// 获取编辑前子目录列表
|
|
|
- classifyId := item.Id
|
|
|
+ /*classifyId := item.Id
|
|
|
var menuCond string
|
|
|
var menuPars []interface{}
|
|
|
menuCond += ` AND classify_id = ?`
|
|
@@ -601,7 +612,7 @@ func (this *ClassifyController) Edit() {
|
|
|
br.ErrMsg = "新增子目录关联失败, Err:" + e.Error()
|
|
|
return
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
// 关联电话会选项被更改时, 同步FICC活动分类
|
|
|
//if originRelateTel != req.RelateTel {
|