Эх сурвалжийг харах

Merge branch 'feature/v4.8.83_wky' of qmx/jy into feature/v4.8.83

wangkaiyue 1 жил өмнө
parent
commit
5de7ce137e
2 өөрчлөгдсөн 89 нэмэгдсэн , 65 устгасан
  1. 9 9
      src/index.yaml
  2. 80 56
      src/jfw/front/index.go

+ 9 - 9
src/index.yaml

@@ -50,21 +50,21 @@ topMenu:
       - name: 企业数据
         href: /datasmt/qygssj_1
       - name: 业主数据
-        href: /datasmt/qygssj_1
+        href: /datasmt/cgdwsj_1
   - title: 营销分析
     child:
       - name: 企业分析
         href: /jylab/entSearch/index.html?searchvalue=&searchvalue=&selectType=title%2Ccontent
       - name: 市场分析
-        href: /big/page/sc
+        href: /front/routerRelay/scfx
         class: red
       - name: 业主分析
         href: /jylab/purSearch/index.html
       - name: 渠道扩展
-        href: /big/page/yw
+        href: /front/routerRelay/qdkz
         class: red
       - name: 投标决策分析
-        href: /big/page/tb
+        href: /front/routerRelay/tbjc
   - title: 专属服务
     child:
       - name: 标书代写
@@ -86,16 +86,16 @@ topMenu:
   - title: 企业服务
     child:
       - name: 数字化营销
-        href: /front/entServerTransfer/yxgl
+        href: /front/routerRelay/yxgl
         class: red
       - name: 医械通
-        href: /front/entServerTransfer/yxt
+        href: /front/routerRelay/yxt
       - name: 客户管理
-        href: /front/entServerTransfer/khgl
+        href: /front/routerRelay/khgl
       - name: 年终报告
-        href: /front/entServerTransfer/nzbg
+        href: /front/routerRelay/nzbg
       - name: 投标项目管理
-        href: /front/entServerTransfer/tbxmgl
+        href: /front/routerRelay/tbxmgl
 
 # 区位配置
 areaLocation:

+ 80 - 56
src/jfw/front/index.go

@@ -23,14 +23,14 @@ import (
 
 type NewIndex struct {
 	*xweb.Action
-	newIndex          xweb.Mapper `xweb:"/"`                             //首页改版
-	entServerTransfer xweb.Mapper `xweb:"/front/entServerTransfer/(.*)"` //企业服务中转
-	appDownload       xweb.Mapper `xweb:"/front/appDownload"`            //新app下载页面
+	newIndex    xweb.Mapper `xweb:"/"`                       //首页改版
+	routerRelay xweb.Mapper `xweb:"/front/routerRelay/(.*)"` //企业服务中转
+	appDownload xweb.Mapper `xweb:"/front/appDownload"`      //新app下载页面
 }
 
 var (
-	entServerTransferMap map[string]map[bool]string
-	BiddingTypeUrl       = map[int]string{
+	routerRelayMap map[string]map[bool]string
+	BiddingTypeUrl = map[int]string{
 		1:  "/list/stype/ZBYG.html",
 		2:  "/list/stype/ZBJG.html",
 		3:  "/list/stype/CGYX.html",
@@ -44,33 +44,100 @@ var (
 
 func init() {
 	xweb.AddAction(&NewIndex{})
-	entServerTransferMap = map[string]map[bool]string{
-		"yxgl": map[bool]string{ //【营销管理】根据code判断是否有权限 bi_yx
+	routerRelayMap = map[string]map[bool]string{
+		"yxgl": { //【营销管理】根据code判断是否有权限 bi_yx
 			true:  fmt.Sprintf("/page_workDesktop/work-bench/page?link=%s/succbi/crm_system/app/crm.app/sales_clues.spg", config.Sysconfig["webdomain"].(string)),
 			false: "/swordfish/frontPage/digitalMarketing/free/index",
 		},
-		"yxt": map[bool]string{ //【医械通】根据code判断是否有权限  lyh_yl_yldy
+		"yxt": { //【医械通】根据code判断是否有权限  lyh_yl_yldy
 			true:  "/page_workDesktop/work-bench/app/big/medical/Credentials",
 			false: "http://clpages.cn/yxtsjgwyxy",
 		},
-		"khgl": map[bool]string{ //【客户管理】根据code判断是否有权限 bi_yx
+		"khgl": { //【客户管理】根据code判断是否有权限 bi_yx
 			true:  fmt.Sprintf("/page_workDesktop/work-bench/page?link=%s/succbi/crm_system/app/crm.app/sales_clues.spg", config.Sysconfig["webdomain"].(string)),
 			false: "/swordfish/frontPage/customanage/free/index",
 		},
-		"tbxmgl": map[bool]string{ //【投标项目管理】根据code判断是否有权限 cb_zy_code
-			true:  "/big/attend_bidding/mine",
+		"tbxmgl": { //【投标项目管理】根据code判断是否有权限 cb_zy_code
+			true:  "/page_workDesktop/work-bench/app/big/attend_bidding/mine",
 			false: "/swordfish/frontPage/biddingProject/free/index",
 		},
-		"nzbg": map[bool]string{ //【年终报告】根据code判断是否有权限
+		"nzbg": { //【年终报告】根据code判断是否有权限
 			true:  fmt.Sprintf("/page_workDesktop/work-bench/page?link=%s/succbi/nzbg/app/nzbg.app/nzbg_entrance_pc.spg", config.Sysconfig["webdomain"].(string)),
 			false: "http://clpages.cn/nzbg",
 		},
-		"xxfb": map[bool]string{ //【年终报告】根据code判断是否有权限
+		"xxfb": { //【信息发布】根据登录否判断
 			true:  fmt.Sprintf("/page_workDesktop/work-bench/page?link=%s/swordfish/page_web_pc/issued/info", config.Sysconfig["webdomain"].(string)),
 			false: "/swordfish/frontPage/InformationDistribution/free/index",
 		},
+		"scfx": { //【市场分析报告】 根据登录否判断
+			true:  "/page_workDesktop/work-bench/app/big/desktop/report_analysis",
+			false: "/big/page/sc",
+		},
+		"qdkz": { //【渠道扩展】 根据大会员权益7判断
+			true:  "/swordfish/page_big_pc/potential_cor_list/c",
+			false: "/big/page/yw",
+		},
+		"tbjc": { //【投标决策分析】 根据大会员权益6判断
+			true:  "/page_workDesktop/work-bench/app/big/analysis_result",
+			false: "/big/page/tb",
+		},
 	}
 }
+func (nIndex *NewIndex) RouterRelay(code string) {
+	toUrl := func() string {
+		sessVal := nIndex.Session().GetMultiple()
+		accountId := common.Int64All(sessVal["accountId"])
+		if accountId <= 0 { //未登录
+			return routerRelayMap[code][false]
+		}
+		if code == "nzbg" || code == "xxfb" || code == "scfx" {
+			return routerRelayMap[code][true]
+		}
+		entAccountId := common.Int64All(sessVal["entAccountId"])
+		entId := common.Int64All(sessVal["entId"])
+		entUserId := common.Int64All(sessVal["entUserId"])
+		res := config.Middleground.ResourceCenter.Haspowers(accountId, entAccountId, entId, entUserId)
+
+		powerPass := false
+		switch code {
+		case "yxgl", "khgl":
+			for _, pCode := range res.Powers {
+				if pCode == "bi_yx" {
+					powerPass = true
+					break
+				}
+			}
+		case "yxt":
+			for _, pCode := range res.Powers {
+				if pCode == "lyh_yl_yldy" {
+					powerPass = true
+					break
+				}
+			}
+		case "tbxmgl":
+			for _, pCode := range res.Powers {
+				if pCode == "cb_zy_code" {
+					powerPass = true
+					break
+				}
+			}
+		case "tbjc", "qdkz": //大会员权益判断
+			powerRes := config.Middleground.PowerCheckCenter.Check("10000", gconv.String(sessVal["mgoUserId"]), gconv.Int64(sessVal["base_user_id"]), gconv.Int64(sessVal["accountId"]), gconv.Int64(sessVal["entId"]), gconv.Int64(sessVal["positionType"]), gconv.Int64(sessVal["positionId"]))
+			for _, pInt := range powerRes.Member.MemberPowerList {
+				if code == "tbjc" && pInt == 6 {
+					powerPass = true
+					break
+				}
+				if code == "qdkz" && pInt == 7 {
+					powerPass = true
+					break
+				}
+			}
+		}
+		return routerRelayMap[code][powerPass]
+	}()
+	_ = nIndex.Redirect(toUrl)
+}
 
 // NewIndex 新版首页改版
 func (nIndex *NewIndex) NewIndex() error {
@@ -177,49 +244,6 @@ func (nIndex *NewIndex) NewIndex() error {
 	return nIndex.Render("/pc/newIndex.html", &nIndex.T)
 }
 
-func (nIndex *NewIndex) EntServerTransfer(code string) {
-	toUrl := func() string {
-		sessVal := nIndex.Session().GetMultiple()
-		accountId := common.Int64All(sessVal["accountId"])
-		if accountId <= 0 { //未登录
-			return entServerTransferMap[code][false]
-		}
-		if code == "nzbg" || code == "xxfb" {
-			return entServerTransferMap[code][true]
-		}
-		entAccountId := common.Int64All(sessVal["entAccountId"])
-		entId := common.Int64All(sessVal["entId"])
-		entUserId := common.Int64All(sessVal["entUserId"])
-		res := config.Middleground.ResourceCenter.Haspowers(accountId, entAccountId, entId, entUserId)
-		powerPass := false
-		switch code {
-		case "yxgl", "khgl":
-			for _, pCode := range res.Powers {
-				if pCode == "bi_yx" {
-					powerPass = true
-					break
-				}
-			}
-		case "yxt":
-			for _, pCode := range res.Powers {
-				if pCode == "lyh_yl_yldy" {
-					powerPass = true
-					break
-				}
-			}
-		case "tbxmgl":
-			for _, pCode := range res.Powers {
-				if pCode == "cb_zy_code" {
-					powerPass = true
-					break
-				}
-			}
-		}
-		return entServerTransferMap[code][powerPass]
-	}()
-	_ = nIndex.Redirect(toUrl)
-}
-
 func (nIndex *NewIndex) AppDownload() {
 	nIndex.T["includedInfo"] = GetIncludedInfo()
 	nIndex.Render("/frontRouter/pc/AppDownload/free/index.html", &nIndex.T)