wangshan 2 жил өмнө
parent
commit
b3f481a6d7

+ 1 - 0
api/internal/logic/workdesktopmenuinfologic.go

@@ -41,6 +41,7 @@ func (l *WorkDesktopMenuInfoLogic) WorkDesktopMenuInfo(req *types.WorkDesktopMen
 		EntId:        req.EntId,
 		EntUserId:    req.EntUserId,
 		IntranetBool: MC.If(config.C.IntranetName != "" && strings.Contains(l.r.Referer(), config.C.IntranetName), true, false).(bool),
+		WorkStatus:   req.WorkStatus,
 	})
 	return &types.CommonResp{
 		Error_code: res.ErrorCode,

+ 8 - 7
api/internal/types/types.go

@@ -233,13 +233,14 @@ type UserDelReq struct {
 }
 
 type WorkDesktopMenuInfoReq struct {
-	Platform  string `json:"platform,default=PC,options=PC|WX|APP"`
-	UserId    string `header:"userId"`
-	AppId     string `header:"appId"`
-	Phone     string `header:"phone,optional"`
-	NewUserId string `header:"newUserId"` //base_user_id<---base_user
-	EntId     int64  `header:"entId,optional"`
-	EntUserId int64  `header:"entUserId,optional"`
+	Platform   string `json:"platform,default=PC,options=PC|WX|APP"`
+	UserId     string `header:"userId"`
+	AppId      string `header:"appId"`
+	Phone      string `header:"phone,optional"`
+	NewUserId  string `header:"newUserId"` //base_user_id<---base_user
+	EntId      int64  `header:"entId,optional"`
+	EntUserId  int64  `header:"entUserId,optional"`
+	WorkStatus int64  `header:"workStatus,optional"`
 }
 
 type WorkDesktopComprehensiveReq struct {

+ 8 - 7
api/userCenter.api

@@ -247,13 +247,14 @@ type (
 
 	//工作桌面 -- 菜单
 	WorkDesktopMenuInfoReq {
-		Platform  string `json:"platform,default=PC,options=PC|WX|APP"`
-		UserId    string `header:"userId"`
-		AppId     string `header:"appId"`
-		Phone     string `header:"phone,optional"`
-		NewUserId string `header:"newUserId"` //base_user_id<---base_user
-		EntId     int64  `header:"entId,optional"`
-		EntUserId int64  `header:"entUserId,optional"`
+		Platform   string `json:"platform,default=PC,options=PC|WX|APP"`
+		UserId     string `header:"userId"`
+		AppId      string `header:"appId"`
+		Phone      string `header:"phone,optional"`
+		NewUserId  string `header:"newUserId"` //base_user_id<---base_user
+		EntId      int64  `header:"entId,optional"`
+		EntUserId  int64  `header:"entUserId,optional"`
+		WorkStatus int64  `header:"workStatus,optional"`
 	}
 	//工作桌面-- 菜单模式:全部/可用选择记录
 	//工作桌面--常用功能更新

+ 6 - 1
entity/workDesktop.go

@@ -7,6 +7,7 @@ import (
 	"database/sql"
 	"encoding/json"
 	"errors"
+	"fmt"
 	"github.com/zeromicro/go-zero/core/logx"
 	"sort"
 	"strconv"
@@ -23,6 +24,7 @@ type WorkDesktopMenu struct {
 	AppId        string    //appid 剑鱼:10000
 	IntranetBool bool      //是否开启内网访问模式
 	Platform     string    //平台来源
+	WorkStatus   int64     //菜单分组
 }
 
 // JYMenu 工作桌面菜单内容
@@ -61,7 +63,10 @@ type Additional struct {
 // 获取有效菜单数据
 func (m *WorkDesktopMenu) GetMenuTreeData() error {
 	//tidb数据
-	query := `SELECT * FROM ` + ConfigJson.WorkTableOut + ` WHERE  appid=? AND status=0 ORDER BY id ASC`
+	//query := `SELECT * FROM ` + ConfigJson.WorkTableOut + ` WHERE  appid=? AND status=0 ORDER BY id ASC`
+	//if m.WorkStatus > 0 {
+	query := fmt.Sprintf(`SELECT * FROM `+ConfigJson.WorkTableOut+` WHERE  appid=? AND status=%d ORDER BY id ASC`, m.WorkStatus)
+	//}
 	//是否开启内网访问数据权限---对应 api 配置文件
 	if m.IntranetBool {
 		query = `SELECT * FROM ` + ConfigJson.WorkTableInside + ` WHERE  appid=? AND status>=0 ORDER BY id ASC`

+ 12 - 2
rpc/pb/userCenter.pb.go

@@ -3217,6 +3217,7 @@ type WorkDesktopMenuInfoReq struct {
 	EntId        int64  `protobuf:"varint,6,opt,name=entId,proto3" json:"entId,omitempty"`
 	EntUserId    int64  `protobuf:"varint,7,opt,name=entUserId,proto3" json:"entUserId,omitempty"`
 	IntranetBool bool   `protobuf:"varint,8,opt,name=intranetBool,proto3" json:"intranetBool,omitempty"`
+	WorkStatus   int64  `protobuf:"varint,9,opt,name=workStatus,proto3" json:"workStatus,omitempty"`
 }
 
 func (x *WorkDesktopMenuInfoReq) Reset() {
@@ -3307,6 +3308,13 @@ func (x *WorkDesktopMenuInfoReq) GetIntranetBool() bool {
 	return false
 }
 
+func (x *WorkDesktopMenuInfoReq) GetWorkStatus() int64 {
+	if x != nil {
+		return x.WorkStatus
+	}
+	return 0
+}
+
 //工作桌面-返回数据
 type WorkDesktopMenuInfoResp struct {
 	state         protoimpl.MessageState
@@ -4536,7 +4544,7 @@ var file_userCenter_proto_rawDesc = []byte{
 	0x64, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x64, 0x18, 0x0a, 0x20,
 	0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x4f, 0x70, 0x65, 0x6e, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07,
 	0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x69, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x75,
-	0x6e, 0x69, 0x6f, 0x6e, 0x69, 0x64, 0x22, 0xee, 0x01, 0x0a, 0x16, 0x57, 0x6f, 0x72, 0x6b, 0x44,
+	0x6e, 0x69, 0x6f, 0x6e, 0x69, 0x64, 0x22, 0x8e, 0x02, 0x0a, 0x16, 0x57, 0x6f, 0x72, 0x6b, 0x44,
 	0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x4d, 0x65, 0x6e, 0x75, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65,
 	0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
 	0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70,
@@ -4551,7 +4559,9 @@ var file_userCenter_proto_rawDesc = []byte{
 	0x49, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65,
 	0x72, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x69, 0x6e, 0x74, 0x72, 0x61, 0x6e, 0x65, 0x74, 0x42,
 	0x6f, 0x6f, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x6e, 0x74, 0x72, 0x61,
-	0x6e, 0x65, 0x74, 0x42, 0x6f, 0x6f, 0x6c, 0x22, 0x74, 0x0a, 0x17, 0x57, 0x6f, 0x72, 0x6b, 0x44,
+	0x6e, 0x65, 0x74, 0x42, 0x6f, 0x6f, 0x6c, 0x12, 0x1e, 0x0a, 0x0a, 0x77, 0x6f, 0x72, 0x6b, 0x53,
+	0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x77, 0x6f, 0x72,
+	0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x74, 0x0a, 0x17, 0x57, 0x6f, 0x72, 0x6b, 0x44,
 	0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x4d, 0x65, 0x6e, 0x75, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65,
 	0x73, 0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65,
 	0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64,

+ 1 - 0
rpc/userCenter.proto

@@ -348,6 +348,7 @@ message WorkDesktopMenuInfoReq{
   int64 entId = 6;
   int64 entUserId = 7;
   bool intranetBool = 8;
+  int64 workStatus = 9;
 }
 
 //工作桌面-返回数据

+ 1 - 0
service/workDesktop.go

@@ -237,6 +237,7 @@ func GetWordDesktopMenuTree(in *WorkDesktopMenuInfoReq) ([]*pb.MenuList, error)
 		EntUserId:    in.EntUserId,
 		Platform:     in.Platform,
 		IntranetBool: in.IntranetBool,
+		WorkStatus:   in.WorkStatus,
 	}
 	//获取菜单树的数据
 	if err := wdm.GetMenuTreeData(); err != nil {