|
@@ -5,8 +5,11 @@ import (
|
|
"github.com/go-playground/validator/v10"
|
|
"github.com/go-playground/validator/v10"
|
|
"hongze/fms_api/controller/resp"
|
|
"hongze/fms_api/controller/resp"
|
|
"hongze/fms_api/global"
|
|
"hongze/fms_api/global"
|
|
|
|
+ "hongze/fms_api/models/crm"
|
|
"hongze/fms_api/models/fms"
|
|
"hongze/fms_api/models/fms"
|
|
|
|
+ "hongze/fms_api/models/system"
|
|
"strconv"
|
|
"strconv"
|
|
|
|
+ "strings"
|
|
)
|
|
)
|
|
|
|
|
|
// ServiceController 合同套餐
|
|
// ServiceController 合同套餐
|
|
@@ -92,6 +95,62 @@ func (sr *ServiceController) List(c *gin.Context) {
|
|
}
|
|
}
|
|
v.Detail = detail
|
|
v.Detail = detail
|
|
v.Children = secFormatList
|
|
v.Children = secFormatList
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ if v.Title == "FICC小套餐" {
|
|
|
|
+ //获取ficc小套餐品种
|
|
|
|
+ sysConf := new(system.SysConfig)
|
|
|
|
+ confCond := `config_code = ?`
|
|
|
|
+ confPars := make([]interface{}, 0)
|
|
|
|
+ confPars = append(confPars, system.ConfigKeyCrmPermissionFiccClassify)
|
|
|
|
+ confItem, e := sysConf.FetchByCondition(confCond, confPars)
|
|
|
|
+ if e != nil {
|
|
|
|
+ resp.FailData("获取失败", "Err:"+e.Error(), c)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if confItem.ConfigValue == "" {
|
|
|
|
+ resp.FailData("获取失败", "FICC品种分类配置为空", c)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ classifyArr := strings.Split(confItem.ConfigValue, ",")
|
|
|
|
+ if len(classifyArr) == 0 {
|
|
|
|
+ resp.FailData("获取失败", "FICC品种分类配置为空", c)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 获取FICC权限
|
|
|
|
+ ficcCond := `enabled = 1 AND permission_type = 0 AND product_id = ? AND classify_name IN ?`
|
|
|
|
+ ficcPars := make([]interface{}, 0)
|
|
|
|
+ ficcPars = append(ficcPars, 1, classifyArr)
|
|
|
|
+ items, e := crm.GetPermissionSetItemsByCondition(ficcCond, ficcPars)
|
|
|
|
+ if e != nil {
|
|
|
|
+ resp.FailData("获取失败", "获取FICC权限信息失败, Err: "+e.Error(), c)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ ficcItemMap := make(map[string][]*crm.PermissionSetItem, 0)
|
|
|
|
+ for i := range items {
|
|
|
|
+ if ficcItemMap[items[i].ClassifyName] == nil {
|
|
|
|
+ ficcItemMap[items[i].ClassifyName] = make([]*crm.PermissionSetItem, 0)
|
|
|
|
+ }
|
|
|
|
+ ficcItemMap[items[i].ClassifyName] = append(ficcItemMap[items[i].ClassifyName], items[i])
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for i := range classifyArr {
|
|
|
|
+ if classifyArr[i] == "市场策略" {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+ checkList := make([]int, 0)
|
|
|
|
+ if classifyArr[i] == "宏观经济" {
|
|
|
|
+ checkList = append(checkList, 1)
|
|
|
|
+ }
|
|
|
|
+ p := new(crm.PermissionSetList)
|
|
|
|
+ p.ClassifyName = classifyArr[i]
|
|
|
|
+ p.Items = ficcItemMap[classifyArr[i]]
|
|
|
|
+ p.CheckList = make([]int, 0)
|
|
|
|
+ v.Items = append(v.Items, p)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
allMap[item.ProductId] = append(allMap[item.ProductId], v)
|
|
allMap[item.ProductId] = append(allMap[item.ProductId], v)
|
|
}
|
|
}
|
|
allTitleMap := map[int]string{
|
|
allTitleMap := map[int]string{
|