Prechádzať zdrojové kódy

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

wangkaiyue 1 rok pred
rodič
commit
ca3b0197a5
3 zmenil súbory, kde vykonal 82 pridanie a 11 odobranie
  1. 1 1
      src/config.yaml
  2. 9 9
      src/index.yaml
  3. 72 1
      src/jfw/front/index.go

+ 1 - 1
src/config.yaml

@@ -11,5 +11,5 @@ publicserviceKey: "publicservice.rpc"
 
 database:
   clickhouse:
-    link: "clickhouse:jianyu_appl:Cli3#fkh4ouSe@tcp(cc-2zelp3xmkmsrtjhgp.public.clickhouse.ads.aliyuncs.com:9000)/jyseo?dial_timeout=2000ms&max_execution_time=60"
+    link: "clickhouse:jianyu_appl:Cli3#fkh4ouSe@tcp(cc-2zelp3xmkmsrtjhgp.public.clickhouse.ads.aliyuncs.com:9000)/jyseo_test?dial_timeout=2000ms&max_execution_time=60"
     debug: true

+ 9 - 9
src/index.yaml

@@ -10,11 +10,11 @@ topMenu:
       - name: 招标信用
         href: /list/stype/ZBYG.html
       - name: 采购意向
-        href:
+        href: /list/stype/CGYX.html
       - name: 企业直采
-        href:
+        href: /list/stype/QYZC.html
       - name: 政府采购
-        href:
+        href: /list/stype/ZFCG.html
   - title: 项目专区
     child:
       - name: 拟在建项目
@@ -68,7 +68,7 @@ topMenu:
       - name: 企业认证
         href: /swordfish/frontPage/enterpriseCertificatio/free/index
       - name: 展会报名
-        href: /exhibition/list/pc/index.html
+        href: /exhibition/list/pc/index.htmlSDq1d
       - name: 商务合作
         href:
       - name: 合作招募
@@ -78,12 +78,12 @@ topMenu:
   - title: 企业服务
     child:
       - name: 营销管理
-        href:
+        href: /front/entServerTransfer/yxgl
       - name: 医械通
-        href: http://clpages.cn/yxtsjgwyxy
+        href: /front/entServerTransfer/yxt
       - name: 客户管理
-        href:
+        href: /front/entServerTransfer/khgl
       - name: 年终报告
-        href:
+        href: /front/entServerTransfer/nzbg
       - name: 招标项目管理
-        href:
+        href: /front/entServerTransfer/tbxmgl

+ 72 - 1
src/jfw/front/index.go

@@ -1,18 +1,46 @@
 package front
 
 import (
+	"app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
 	"context"
+	"fmt"
 	"github.com/gogf/gf/v2/frame/g"
+	"jy/src/jfw/config"
 )
 
 type NewIndex struct {
 	*xweb.Action
-	newIndex xweb.Mapper `xweb:"/"` //首页改版
+	newIndex          xweb.Mapper `xweb:"/"`                             //首页改版
+	entServerTransfer xweb.Mapper `xweb:"/front/entServerTransfer/(.*)"` //企业服务中转
 }
 
+var entServerTransferMap map[string]map[bool]string
+
 func init() {
 	xweb.AddAction(&NewIndex{})
+	entServerTransferMap = map[string]map[bool]string{
+		"yxgl": map[bool]string{ //【营销管理】根据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: "",
+		},
+		"yxt": map[bool]string{ //【医械通】根据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
+			true:  fmt.Sprintf("/page_workDesktop/work-bench/page?link=%s/succbi/crm_system/app/crm.app/sales_clues.spg", config.Sysconfig["webdomain"].(string)),
+			false: "",
+		},
+		"tbxmgl": map[bool]string{ //【投标项目管理】根据code判断是否有权限 cb_zy_code
+			true:  "/big/attend_bidding/mine",
+			false: "",
+		},
+		"nzbg": map[bool]string{ //【年终报告】根据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: "",
+		},
+	}
 }
 
 // NewIndex 新版首页改版
@@ -21,3 +49,46 @@ func (nIndex *NewIndex) NewIndex() error {
 	nIndex.T["topMenu"] = g.Cfg("index").MustGet(context.Background(), "topMenu").Maps()
 	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" {
+			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)
+}