Преглед изворни кода

feat: 添加用户权限查询

2637309949 пре 4 година
родитељ
комит
31bb41a3c7

+ 195 - 0
internal/logic/get_data_permission_logic.go

@@ -0,0 +1,195 @@
+package logic
+
+import (
+	"context"
+	"fmt"
+	"strings"
+
+	"git.i2edu.net/i2/i2-bill-erp/internal/svc"
+	"git.i2edu.net/i2/i2-bill-erp/model"
+	"git.i2edu.net/i2/i2-bill-erp/transform"
+	"github.com/thoas/go-funk"
+
+	"git.i2edu.net/i2/go-zero/core/logx"
+)
+
+var roleMap = map[string]map[string]string{
+	// ##渠道一级
+	"one_level_channel": map[string]string{"市场": "1001", "网络": "1002", "老推": "1003", "品牌": "1004", "其他": "1005"},
+	// ##任务
+	// #目标计划
+	// 市场人员计划
+	"mkt_marketer_plan_target": map[string]string{"市场人员划分": "user", "校区划分": "os"}, //
+	// 校区市场计划
+	"mkt_sch_market_plan": map[string]string{"校区划分": "os"},
+	// 销售人员计划
+	"mkt_ec_user_targetplan": map[string]string{"销售人员划分": "user", "校区划分": "os"}, //
+	// 校区销售计划
+	"mkt_sch_targetsign_plan": map[string]string{"校区划分": "os"},
+	// 客服人员计划
+	"mkt_ta_target_plan": map[string]string{"客服人员划分": "user", "校区划分": "os"}, //
+	// 校区客服计划
+	"mkt_sch_ta_targetplan": map[string]string{"校区划分": "os"},
+	// 生日提醒
+	"remind_birthday": map[string]string{"跟进校区划分": "os", "班型客服划分": "ta"},
+	// ##营销
+	// #线索管理
+	// 线索学员
+	"mkt_resource": map[string]string{"资源销售划分": "ec", "资源收集人划分": "load_user", "资源收集校区划分": "os",
+		"网络渠道划分": "tmk", "市场渠道划分": "mkt", "品牌渠道划分": "prod", "老推渠道划分": "old", "其他渠道划分": "other",
+		"非网络渠道划分": "no_tmk", "分配tmk划分": "allot_tmk", "资源录入人划分": "create_by", "收集城市划分": "tmk_city",
+		"资源收集校区筛选": "load_sch", "资源跟进校区筛选": "stu_sch"},
+	// 市场活动管理
+	"mkt_activity": map[string]string{"活动创建人划分": "user", "活动校区划分": "os"},
+	// #潜在学员管理
+	// 潜在学员列表
+	"existing_students": map[string]string{"学员销售划分": "ec", "学员跟进校区划分": "os",
+		"网络渠道划分": "tmk", "市场渠道划分": "mkt", "品牌渠道划分": "prod", "老推渠道划分": "old", "其他渠道划分": "other",
+		"资源收集校区筛选": "load_sch", "资源跟进校区筛选": "stu_sch", "资源收集人划分": "load_user", "分配tmk划分": "allot_tmk"},
+	// 老推学员列表
+	"old_students": map[string]string{"资源收集人划分": "load_user", "学员跟进校区划分": "os"},
+	// 邀约上门学员列表
+	"mkt_invite_visit": map[string]string{"资源收集人划分": "load_user", "学员销售划分": "ec", "资源收集校区划分": "os"},
+	// 无效资源列表
+	"invalid_students": map[string]string{"学员销售划分": "ec", "学员跟进校区划分": "os"},
+	// #试听课管理
+	// 试听课列表
+	"mkt_trial_lesson": map[string]string{"试听课客服划分": "ta", "试听课教师划分": "tea", "试听课校区划分": "os"},
+	// 试听课学员列表
+	"mkt_trial_lesson_student": map[string]string{"学员销售划分": "ec", "试听课教师划分": "ta", "试听课校区划分": "os",
+		"网络渠道划分": "tmk", "市场渠道划分": "mkt", "品牌渠道划分": "prod", "老推渠道划分": "old", "其他渠道划分": "other",
+		"收集城市划分": "tmk_city", "分配tmk划分": "allot_tmk", "资源收集人划分": "load_user", "资源收集校区划分": "load_sch"},
+	// tmk待分配学员列表
+	"mkt_stu_unallot_tmk": map[string]string{"资源销售划分": "ec", "资源收集人划分": "load_user", "资源收集校区划分": "os",
+		"网络渠道划分": "tmk", "市场渠道划分": "mkt", "品牌渠道划分": "prod", "老推渠道划分": "old", "其他渠道划分": "other",
+		"非网络渠道划分": "no_tmk", "资源录入人划分": "create_by", "收集城市划分": "tmk_city"},
+	// tmk已分配学员列表
+	"mkt_stu_allot_tmk": map[string]string{"收集城市划分": "os", "资源收集人划分": "user", "分配tmk划分": "tmk_user",
+		"网络渠道划分": "tmk", "市场渠道划分": "mkt", "品牌渠道划分": "prod", "老推渠道划分": "old", "其他渠道划分": "other"},
+	// 学员回访列表
+	"mkt_student_visit": map[string]string{"学员销售划分": "ec", "学员跟进校区划分": "os"},
+	// ##教务
+	"stu_class":                   map[string]string{"班级客服划分": "kf", "学员跟进校区划分": "os"},
+	"edu_tea_leave_management":    map[string]string{"教师所属校区划分": "sys_os", "教师权限校区划分": "os", "教师划分": "tea"},
+	"crm_complaints_repair_order": map[string]string{"校区划分": "os"},
+	"order_student_class_type": map[string]string{"学员销售划分": "ec", "班型客服划分": "ta", "签单校区划分": "of_os",
+		"学员跟进校区划分": "os"},
+	"order_deposit_in":       map[string]string{"学员销售划分": "ec", "班型客服划分": "ta", "学员跟进校区划分": "os"},
+	"edu_sc_class_tea":       map[string]string{"班级所在校区划分": "os", "班级客服划分": "ta"},
+	"stu_tea_class_schedule": map[string]string{"班级所在校区划分": "os", "班级客服划分": "ta"},
+	// ##财务
+	"order_form": map[string]string{"学员跟进校区划分": "os", "签单校区划分": "of_os", "学员销售划分": "ec", "分配tmk划分": "allot_tmk",
+		"网络渠道划分": "tmk", "市场渠道划分": "mkt", "品牌渠道划分": "prod", "老推渠道划分": "old", "其他渠道划分": "other",
+		"学员收集人划分": "load_user", "学员班型客服划分": "ta", "收集城市划分": "tmk_city", "资源收集校区划分": "load_sch"},
+	"order_tb_form": map[string]string{"学员跟进校区划分": "os", "签单校区划分": "of_os", "学员销售划分": "ec", "分配tmk划分": "allot_tmk",
+		"网络渠道划分": "tmk", "市场渠道划分": "mkt", "品牌渠道划分": "prod", "老推渠道划分": "old", "其他渠道划分": "other",
+		"学员收集人划分": "load_user", "学员班型客服划分": "ta", "收集城市划分": "tmk_city", "资源收集校区划分": "load_sch"},
+	"order_refund": map[string]string{"学员跟进校区划分": "os", "签单校区划分": "of_os", "学员销售划分": "ec",
+		"学员收集人划分": "load_user", "班型分配班级客服划分": "ta"},
+	"fin_temp_storage_cz":               map[string]string{"学员销售划分": "ec", "班型客服划分": "ta", "学员跟进校区划分": "os"},
+	"fn_student_account":                map[string]string{"学员销售划分": "ec", "班型客服划分": "ta", "学员跟进校区划分": "os"},
+	"fin_stu_account_flow":              map[string]string{"学员销售划分": "ec", "班型客服划分": "ta", "学员跟进校区划分": "os"},
+	"fin_invoice":                       map[string]string{"学员销售划分": "ec", "班型客服划分": "ta", "签单校区划分": "os"},
+	"fin_stu_integral_flow":             map[string]string{"学员跟进校区划分": "os"},
+	"fin_yb_pay_flowing":                map[string]string{"支付校区划分": "os"},
+	"fin_yeepay_reconciliations_record": map[string]string{"流水支付校区划分": "os"},
+	"base_class_manage":                 map[string]string{"班级客服划分": "ta", "班级校区划分": "os"},
+	"student":                           map[string]string{"学员跟进校区划分": "os", "学员销售划分": "ec", "学员收集人划分": "load_user", "班型分配客服划分": "ta"},
+	"order_student_gift":                map[string]string{"学员跟进校区划分": "os", "班级客服划分": "ta"},
+	"edu_stu_ct_renew_log":              map[string]string{"班型客服划分": "ta", "学员跟进校区划分": "os"},
+	"attendance_list":                   map[string]string{"班级校区划分": "os", "教师划分": "tea", "班型客服划分": "ta"},
+	"role_trial_lesson":                 map[string]string{"班级校区划分": "os", "教师划分": "tea", "试听课销售划分": "ec"},
+	"sys_user":                          map[string]string{"所属校区划分": "sys_os", "权限校区划分": "base_os"},
+	// "base_on_sale":               map[string]string{"校区划分": "os"},
+	"stu_class_type_textbook":                map[string]string{"学员跟进校区划分": "os"},
+	"edu_class_schedule_student":             map[string]string{"班级客服划分": "ta", "学员跟进校区划分": "os"},
+	"edu_class_schedule_student_absenceList": map[string]string{"班型客服划分": "ta", "学员跟进校区划分": "os"},
+	"base_organ_school":                      map[string]string{"权限校区划分": "os"},
+	"ecs_stu":                                map[string]string{"班型客服划分": "ecs_ta", "班级状态修改权限": "manage"},
+	"encode":                                 map[string]string{"导出联系方式加密": "export_stu_phone", "显示联系方式不加密": "list_stu_phone"},
+	"order_exchange_gift_jfsc":               map[string]string{"积分兑换记录用户权限校区": "os"},
+	"task_pg":                                map[string]string{"批改作业权限": "os"},
+	"cmp_plan":                               map[string]string{"权限校区划分": "os", "班级客服划分": "ta"},
+	"eschool_stu_study_report":               map[string]string{"班级所在校区划分": "os", "班级客服划分": "ta"},
+	"order_sch_achievement_divide":           map[string]string{"所属校区划分": "base_os", "权限校区划分": "sys_os"},
+	"user_city":                              map[string]string{"所属校区划分": "base_os", "权限校区划分": "sys_os", "学员跟进校区划分": "os"},
+	"rl_hour_list":                           map[string]string{"权限校区划分": "os"},
+	"eschool_class_schedule_unit_pick":       map[string]string{"学员跟进校区划分": "os", "班型客服划分": "ta"},
+	"teacher_ft":                             map[string]string{"权限校区划分": "os"},
+	"teacher_oa":                             map[string]string{"权限校区划分": "os"},
+
+	"fin_pay_flowing":            map[string]string{"权限校区划分": "os"},
+	"fin_reconciliations_record": map[string]string{"权限校区划分": "os"},
+
+	// 兼职人员的数据
+	"acquirer_student": map[string]string{"本人及所管兼职划分": "self_acquirer", "本人及所管兼职和专员划分": "self_acquirer_market", "所管兼职和市场划分": "acquirer_market_mgn"},
+}
+
+type GetDataPermissionLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewGetDataPermissionLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetDataPermissionLogic {
+	return &GetDataPermissionLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// 获取数据权限
+func (l *GetDataPermissionLogic) GetDataPermission(in *transform.DataPermissionReq) (*transform.DataPermissionRes, error) {
+	rule_code, UserId, params := in.RuleCode, in.UserId, transform.DataPermissionRes{}
+	var channelMap = map[string]string{
+		"mkt": "1001", "tmk": "1002", "old": "1003", "other": "1005", "prod": "1004",
+	}
+	mainRoleCode := []string{"tmk", "mkt", "prod", "old", "other", "no_tmk"}
+	if roleM, ok := roleMap[rule_code]; ok {
+		var roleRules []model.SysRoleDataPermission
+		err := l.svcCtx.SqlConn.QueryRowsPartial(&roleRules, `SELECT
+			sys_data_permission_detail.*
+		FROM
+			sys_data_permission, sys_data_permission_detail,sys_user_role
+		WHERE
+			sys_data_permission.id = sys_data_permission_detail.data_permission_id
+			AND FIND_IN_SET(sys_user_role.role_id, sys_data_permission_detail.role_id)
+			AND sys_user_role.del_flag = 0
+			AND sys_data_permission_detail.del_flag = 0
+			AND sys_data_permission.code = ?
+			AND sys_user_role.user_id = ?`, rule_code, UserId)
+		if err == nil && len(roleRules) > 0 {
+			roles := funk.Get(roleRules, "Rule").([]string)
+			roleStr := strings.Join(roles, ",")
+			if rule_code == "one_level_channel" {
+				params.MapList["role_channel"] = roleStr
+			} else {
+				var role_channel []string
+				for _, code := range mainRoleCode {
+					if strings.Index(fmt.Sprintf(",%v,", roleStr), fmt.Sprintf(",%v,", code)) >= 0 {
+						if channel, ok := channelMap[code]; ok {
+							role_channel = append(role_channel, channel)
+						} else {
+							params.MapList[fmt.Sprintf("role_%v", code)] = "true"
+						}
+					}
+				}
+				if len(role_channel) > 0 {
+					params.MapList["role_channel"] = strings.Join(role_channel, ",")
+				}
+				// 并列权限,如果有了os的权限,其他的权限就不使用了,如果需要增加别的权限需要在此之前设置
+				if strings.Index(fmt.Sprintf(",%v,", roleStr), ",os,") >= 0 {
+					params.MapList["role_os"] = "true"
+				} else {
+					for _, v := range roleM {
+						if strings.Index(fmt.Sprintf(",%v,", roleStr), fmt.Sprintf(",%v,", v)) >= 0 {
+							params.MapList[fmt.Sprintf("role_%v", v)] = "true"
+						}
+					}
+				}
+			}
+		}
+	}
+	return &params, nil
+}

+ 6 - 0
internal/server/transform_server.go

@@ -63,6 +63,12 @@ func (s *TransformServer) GetErpOptionset(ctx context.Context, in *transform.Opt
 	return l.GetErpOptionset(in)
 }
 
+// 获取数据权限
+func (s *TransformServer) GetDataPermission(ctx context.Context, in *transform.DataPermissionReq) (*transform.DataPermissionRes, error) {
+	l := logic.NewGetDataPermissionLogic(ctx, s.svcCtx)
+	return l.GetDataPermission(in)
+}
+
 // 获取erp 渠道细分树
 func (s *TransformServer) GetErpMktNetWorkDetailTree(ctx context.Context, in *transform.Empty) (*transform.TreeNodes, error) {
 	l := logic.NewGetErpMktNetWorkDetailTreeLogic(ctx, s.svcCtx)

+ 11 - 0
model/sys_role_data_permission.sql

@@ -0,0 +1,11 @@
+CREATE TABLE `sys_role_data_permission` (
+  `id` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+  `data_permission_id` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+  `role_id` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+  `create_by` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+  `create_time` datetime NOT NULL,
+  `last_update_by` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+  `last_update_time` bigint NOT NULL,
+  `del_flag` int NOT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;

+ 107 - 0
model/sys_role_data_permission_model.go

@@ -0,0 +1,107 @@
+package model
+
+import (
+	"database/sql"
+	"fmt"
+	"strings"
+	"time"
+
+	"git.i2edu.net/i2/go-zero/core/stores/cache"
+	"git.i2edu.net/i2/go-zero/core/stores/sqlc"
+	"git.i2edu.net/i2/go-zero/core/stores/sqlx"
+	"git.i2edu.net/i2/go-zero/core/stringx"
+	"git.i2edu.net/i2/go-zero/tools/goctl/model/sql/builderx"
+)
+
+var (
+	sysRoleDataPermissionFieldNames          = builderx.RawFieldNames(&SysRoleDataPermission{})
+	sysRoleDataPermissionRows                = strings.Join(sysRoleDataPermissionFieldNames, ",")
+	sysRoleDataPermissionRowsExpectAutoSet   = strings.Join(stringx.Remove(sysRoleDataPermissionFieldNames, "`create_time`", "`update_time`"), ",")
+	sysRoleDataPermissionRowsWithPlaceHolder = strings.Join(stringx.Remove(sysRoleDataPermissionFieldNames, "`id`", "`create_time`", "`update_time`"), "=?,") + "=?"
+
+	cacheSysRoleDataPermissionIdPrefix = "cache:sysRoleDataPermission:id:"
+)
+
+type (
+	SysRoleDataPermissionModel interface {
+		Insert(data SysRoleDataPermission) (sql.Result, error)
+		FindOne(id string) (*SysRoleDataPermission, error)
+		Update(data SysRoleDataPermission) error
+		Delete(id string) error
+	}
+
+	defaultSysRoleDataPermissionModel struct {
+		sqlc.CachedConn
+		table string
+	}
+
+	SysRoleDataPermission struct {
+		RoleId           string    `db:"role_id"`
+		CreateBy         string    `db:"create_by"`
+		CreateTime       time.Time `db:"create_time"`
+		LastUpdateBy     string    `db:"last_update_by"`
+		LastUpdateTime   int64     `db:"last_update_time"`
+		DelFlag          int64     `db:"del_flag"`
+		Id               string    `db:"id"`
+		DataPermissionId string    `db:"data_permission_id"`
+	}
+)
+
+func NewSysRoleDataPermissionModel(conn sqlx.SqlConn, c cache.CacheConf) SysRoleDataPermissionModel {
+	return &defaultSysRoleDataPermissionModel{
+		CachedConn: sqlc.NewConn(conn, c),
+		table:      "`sys_role_data_permission`",
+	}
+}
+
+func (m *defaultSysRoleDataPermissionModel) Insert(data SysRoleDataPermission) (sql.Result, error) {
+	query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?)", m.table, sysRoleDataPermissionRowsExpectAutoSet)
+	ret, err := m.ExecNoCache(query, data.RoleId, data.CreateBy, data.LastUpdateBy, data.LastUpdateTime, data.DelFlag, data.Id, data.DataPermissionId)
+
+	return ret, err
+}
+
+func (m *defaultSysRoleDataPermissionModel) FindOne(id string) (*SysRoleDataPermission, error) {
+	sysRoleDataPermissionIdKey := fmt.Sprintf("%s%v", cacheSysRoleDataPermissionIdPrefix, id)
+	var resp SysRoleDataPermission
+	err := m.QueryRow(&resp, sysRoleDataPermissionIdKey, func(conn sqlx.SqlConn, v interface{}) error {
+		query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", sysRoleDataPermissionRows, m.table)
+		return conn.QueryRow(v, query, id)
+	})
+	switch err {
+	case nil:
+		return &resp, nil
+	case sqlc.ErrNotFound:
+		return nil, ErrNotFound
+	default:
+		return nil, err
+	}
+}
+
+func (m *defaultSysRoleDataPermissionModel) Update(data SysRoleDataPermission) error {
+	sysRoleDataPermissionIdKey := fmt.Sprintf("%s%v", cacheSysRoleDataPermissionIdPrefix, data.Id)
+	_, err := m.Exec(func(conn sqlx.SqlConn) (result sql.Result, err error) {
+		query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, sysRoleDataPermissionRowsWithPlaceHolder)
+		return conn.Exec(query, data.RoleId, data.CreateBy, data.LastUpdateBy, data.LastUpdateTime, data.DelFlag, data.DataPermissionId, data.Id)
+	}, sysRoleDataPermissionIdKey)
+	return err
+}
+
+func (m *defaultSysRoleDataPermissionModel) Delete(id string) error {
+
+	sysRoleDataPermissionIdKey := fmt.Sprintf("%s%v", cacheSysRoleDataPermissionIdPrefix, id)
+	_, err := m.Exec(func(conn sqlx.SqlConn) (result sql.Result, err error) {
+		query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
+		return conn.Exec(query, id)
+	}, sysRoleDataPermissionIdKey)
+	return err
+}
+
+func (m *defaultSysRoleDataPermissionModel) formatPrimary(primary interface{}) string {
+	return fmt.Sprintf("%s%v", cacheSysRoleDataPermissionIdPrefix, primary)
+}
+
+func (m *defaultSysRoleDataPermissionModel) queryPrimary(conn sqlx.SqlConn, v, primary interface{}) error {
+	query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", sysRoleDataPermissionRows, m.table)
+	return conn.QueryRow(v, query, primary)
+}

+ 12 - 0
transform.proto

@@ -158,6 +158,14 @@ message Active{
     string ma_name = 2;
 }
 
+message DataPermissionReq {
+  string rule_code = 1;
+  string user_id = 2;
+}
+
+message DataPermissionRes {
+  map<string, string> mapList=1;
+}
 
 service Transform {
   rpc GetUser(UserRequest) returns(UserResponse);
@@ -170,6 +178,10 @@ service Transform {
   rpc GetCityIds(CityIdsReq) returns(CityIdsRes);
   rpc PostExcelLog(ExcelLogReq) returns(ExcelLogRes);
   rpc GetErpOptionset(OptionCode) returns(Options);
+
+  //获取数据权限
+  rpc GetDataPermission(DataPermissionReq) returns(DataPermissionRes);
+
   //获取erp 渠道细分树
   rpc GetErpMktNetWorkDetailTree(Empty) returns(TreeNodes);
   //获取erp 用户校区权限

+ 206 - 75
transform/transform.pb.go

@@ -1481,6 +1481,92 @@ func (m *Active) GetMaName() string {
 	return ""
 }
 
+type DataPermissionReq struct {
+	RuleCode             string   `protobuf:"bytes,1,opt,name=rule_code,json=ruleCode,proto3" json:"rule_code,omitempty"`
+	UserId               string   `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
+	XXX_unrecognized     []byte   `json:"-"`
+	XXX_sizecache        int32    `json:"-"`
+}
+
+func (m *DataPermissionReq) Reset()         { *m = DataPermissionReq{} }
+func (m *DataPermissionReq) String() string { return proto.CompactTextString(m) }
+func (*DataPermissionReq) ProtoMessage()    {}
+func (*DataPermissionReq) Descriptor() ([]byte, []int) {
+	return fileDescriptor_cb4a498eeb2ba07d, []int{31}
+}
+
+func (m *DataPermissionReq) XXX_Unmarshal(b []byte) error {
+	return xxx_messageInfo_DataPermissionReq.Unmarshal(m, b)
+}
+func (m *DataPermissionReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+	return xxx_messageInfo_DataPermissionReq.Marshal(b, m, deterministic)
+}
+func (m *DataPermissionReq) XXX_Merge(src proto.Message) {
+	xxx_messageInfo_DataPermissionReq.Merge(m, src)
+}
+func (m *DataPermissionReq) XXX_Size() int {
+	return xxx_messageInfo_DataPermissionReq.Size(m)
+}
+func (m *DataPermissionReq) XXX_DiscardUnknown() {
+	xxx_messageInfo_DataPermissionReq.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_DataPermissionReq proto.InternalMessageInfo
+
+func (m *DataPermissionReq) GetRuleCode() string {
+	if m != nil {
+		return m.RuleCode
+	}
+	return ""
+}
+
+func (m *DataPermissionReq) GetUserId() string {
+	if m != nil {
+		return m.UserId
+	}
+	return ""
+}
+
+type DataPermissionRes struct {
+	MapList              map[string]string `protobuf:"bytes,1,rep,name=mapList,proto3" json:"mapList,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
+	XXX_unrecognized     []byte            `json:"-"`
+	XXX_sizecache        int32             `json:"-"`
+}
+
+func (m *DataPermissionRes) Reset()         { *m = DataPermissionRes{} }
+func (m *DataPermissionRes) String() string { return proto.CompactTextString(m) }
+func (*DataPermissionRes) ProtoMessage()    {}
+func (*DataPermissionRes) Descriptor() ([]byte, []int) {
+	return fileDescriptor_cb4a498eeb2ba07d, []int{32}
+}
+
+func (m *DataPermissionRes) XXX_Unmarshal(b []byte) error {
+	return xxx_messageInfo_DataPermissionRes.Unmarshal(m, b)
+}
+func (m *DataPermissionRes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+	return xxx_messageInfo_DataPermissionRes.Marshal(b, m, deterministic)
+}
+func (m *DataPermissionRes) XXX_Merge(src proto.Message) {
+	xxx_messageInfo_DataPermissionRes.Merge(m, src)
+}
+func (m *DataPermissionRes) XXX_Size() int {
+	return xxx_messageInfo_DataPermissionRes.Size(m)
+}
+func (m *DataPermissionRes) XXX_DiscardUnknown() {
+	xxx_messageInfo_DataPermissionRes.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_DataPermissionRes proto.InternalMessageInfo
+
+func (m *DataPermissionRes) GetMapList() map[string]string {
+	if m != nil {
+		return m.MapList
+	}
+	return nil
+}
+
 func init() {
 	proto.RegisterType((*UserRequest)(nil), "transform.UserRequest")
 	proto.RegisterType((*UserResponse)(nil), "transform.UserResponse")
@@ -1516,86 +1602,93 @@ func init() {
 	proto.RegisterType((*GetErpActiveReq)(nil), "transform.GetErpActiveReq")
 	proto.RegisterType((*GetErpActiveRes)(nil), "transform.GetErpActiveRes")
 	proto.RegisterType((*Active)(nil), "transform.Active")
+	proto.RegisterType((*DataPermissionReq)(nil), "transform.DataPermissionReq")
+	proto.RegisterType((*DataPermissionRes)(nil), "transform.DataPermissionRes")
+	proto.RegisterMapType((map[string]string)(nil), "transform.DataPermissionRes.MapListEntry")
 }
 
 func init() { proto.RegisterFile("transform.proto", fileDescriptor_cb4a498eeb2ba07d) }
 
 var fileDescriptor_cb4a498eeb2ba07d = []byte{
-	// 1174 bytes of a gzipped FileDescriptorProto
-	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x5b, 0x6f, 0xdb, 0xb6,
-	0x17, 0x87, 0xa2, 0x58, 0xb6, 0x8f, 0x9d, 0xb4, 0x7f, 0xfe, 0x73, 0x51, 0xb5, 0x6e, 0x33, 0x88,
-	0x6c, 0x4b, 0x5f, 0xf2, 0x90, 0x02, 0x5b, 0x11, 0x04, 0x5d, 0x73, 0x6b, 0x10, 0x20, 0x37, 0x28,
-	0x29, 0xf6, 0x18, 0xa8, 0x16, 0xeb, 0x08, 0x91, 0x45, 0x45, 0xa4, 0x83, 0xea, 0x0b, 0xec, 0x61,
-	0xaf, 0xfb, 0x6a, 0x7b, 0xdb, 0x77, 0xd9, 0x86, 0x43, 0x52, 0x16, 0x1d, 0x3b, 0x6d, 0x36, 0x6c,
-	0x6f, 0x3c, 0xf7, 0xc3, 0x1f, 0xcf, 0x45, 0x82, 0x27, 0xb2, 0x88, 0x32, 0xf1, 0x81, 0x17, 0xc3,
-	0x8d, 0xbc, 0xe0, 0x92, 0x93, 0xf6, 0x98, 0x41, 0x5f, 0x42, 0xe7, 0x9d, 0x60, 0x45, 0xc8, 0x6e,
-	0x47, 0x4c, 0x48, 0xb2, 0x08, 0x73, 0x49, 0xec, 0x3b, 0x3d, 0x67, 0xbd, 0x1d, 0xce, 0x25, 0x31,
-	0x59, 0x82, 0x46, 0x7e, 0xcd, 0x33, 0xe6, 0xcf, 0x29, 0x96, 0x26, 0xe8, 0x6f, 0x0e, 0x74, 0xb5,
-	0x95, 0xc8, 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,
+	0xac, 0x36, 0xf2, 0xe2, 0x9e, 0x42, 0xbc, 0x09, 0xee, 0x93, 0x4a, 0x72, 0x00, 0x81, 0x49, 0xe7,
+	0xf8, 0x5a, 0x9d, 0x70, 0xf5, 0xb3, 0xc8, 0xaf, 0x0f, 0xb8, 0x62, 0x71, 0xf2, 0xaf, 0x6e, 0xb5,
+	0x0f, 0xcf, 0xe7, 0x4e, 0x41, 0xf2, 0xbd, 0x63, 0x72, 0xdf, 0x90, 0x0d, 0x1e, 0xa8, 0x88, 0x15,
+	0x00, 0xe3, 0x79, 0x4f, 0x9a, 0x53, 0x66, 0x76, 0x0d, 0x04, 0xf3, 0x24, 0x78, 0x0b, 0x0d, 0x77,
+	0x30, 0xce, 0xf8, 0xd0, 0x60, 0xca, 0x76, 0x3c, 0x43, 0xdf, 0x16, 0xd6, 0x76, 0x62, 0x4d, 0xeb,
+	0x8e, 0x86, 0x65, 0x30, 0x5f, 0x26, 0xdf, 0x97, 0xf5, 0x0f, 0xe4, 0xcb, 0x7f, 0x02, 0x00, 0x00,
+	0xff, 0xff, 0x5f, 0x30, 0x8c, 0x56, 0x53, 0x0e, 0x00, 0x00,
 }
 
 // Reference imports to suppress errors if they are not otherwise used.
@@ -1620,6 +1713,8 @@ type TransformClient interface {
 	GetCityIds(ctx context.Context, in *CityIdsReq, opts ...grpc.CallOption) (*CityIdsRes, error)
 	PostExcelLog(ctx context.Context, in *ExcelLogReq, opts ...grpc.CallOption) (*ExcelLogRes, error)
 	GetErpOptionset(ctx context.Context, in *OptionCode, opts ...grpc.CallOption) (*Options, error)
+	//获取数据权限
+	GetDataPermission(ctx context.Context, in *DataPermissionReq, opts ...grpc.CallOption) (*DataPermissionRes, error)
 	//获取erp 渠道细分树
 	GetErpMktNetWorkDetailTree(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*TreeNodes, error)
 	//获取erp 用户校区权限
@@ -1712,6 +1807,15 @@ func (c *transformClient) GetErpOptionset(ctx context.Context, in *OptionCode, o
 	return out, nil
 }
 
+func (c *transformClient) GetDataPermission(ctx context.Context, in *DataPermissionReq, opts ...grpc.CallOption) (*DataPermissionRes, error) {
+	out := new(DataPermissionRes)
+	err := c.cc.Invoke(ctx, "/transform.Transform/GetDataPermission", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
 func (c *transformClient) GetErpMktNetWorkDetailTree(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*TreeNodes, error) {
 	out := new(TreeNodes)
 	err := c.cc.Invoke(ctx, "/transform.Transform/GetErpMktNetWorkDetailTree", in, out, opts...)
@@ -1769,6 +1873,8 @@ type TransformServer interface {
 	GetCityIds(context.Context, *CityIdsReq) (*CityIdsRes, error)
 	PostExcelLog(context.Context, *ExcelLogReq) (*ExcelLogRes, error)
 	GetErpOptionset(context.Context, *OptionCode) (*Options, error)
+	//获取数据权限
+	GetDataPermission(context.Context, *DataPermissionReq) (*DataPermissionRes, error)
 	//获取erp 渠道细分树
 	GetErpMktNetWorkDetailTree(context.Context, *Empty) (*TreeNodes, error)
 	//获取erp 用户校区权限
@@ -1809,6 +1915,9 @@ func (*UnimplementedTransformServer) PostExcelLog(ctx context.Context, req *Exce
 func (*UnimplementedTransformServer) GetErpOptionset(ctx context.Context, req *OptionCode) (*Options, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method GetErpOptionset not implemented")
 }
+func (*UnimplementedTransformServer) GetDataPermission(ctx context.Context, req *DataPermissionReq) (*DataPermissionRes, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method GetDataPermission not implemented")
+}
 func (*UnimplementedTransformServer) GetErpMktNetWorkDetailTree(ctx context.Context, req *Empty) (*TreeNodes, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method GetErpMktNetWorkDetailTree not implemented")
 }
@@ -1973,6 +2082,24 @@ func _Transform_GetErpOptionset_Handler(srv interface{}, ctx context.Context, de
 	return interceptor(ctx, in, info, handler)
 }
 
+func _Transform_GetDataPermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(DataPermissionReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(TransformServer).GetDataPermission(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/transform.Transform/GetDataPermission",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(TransformServer).GetDataPermission(ctx, req.(*DataPermissionReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
 func _Transform_GetErpMktNetWorkDetailTree_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 	in := new(Empty)
 	if err := dec(in); err != nil {
@@ -2099,6 +2226,10 @@ var _Transform_serviceDesc = grpc.ServiceDesc{
 			MethodName: "GetErpOptionset",
 			Handler:    _Transform_GetErpOptionset_Handler,
 		},
+		{
+			MethodName: "GetDataPermission",
+			Handler:    _Transform_GetDataPermission_Handler,
+		},
 		{
 			MethodName: "GetErpMktNetWorkDetailTree",
 			Handler:    _Transform_GetErpMktNetWorkDetailTree_Handler,

+ 31 - 21
transformclient/transform.go

@@ -14,37 +14,39 @@ import (
 )
 
 type (
+	TreeNode                     = transform.TreeNode
 	OptionCode                   = transform.OptionCode
-	Options                      = transform.Options
-	GetErpRoleRes                = transform.GetErpRoleRes
-	GetErpRoleReq                = transform.GetErpRoleReq
-	Active                       = transform.Active
-	UserRequest                  = transform.UserRequest
-	ListOfInt                    = transform.ListOfInt
-	BytesResp                    = transform.BytesResp
-	OrganSchool                  = transform.OrganSchool
-	GetErpOrganSchPerByUserIdRes = transform.GetErpOrganSchPerByUserIdRes
-	ResponseByte                 = transform.ResponseByte
-	ExcelLogReq                  = transform.ExcelLogReq
-	ExcelLogRes                  = transform.ExcelLogRes
 	SchoolIdsRes                 = transform.SchoolIdsRes
 	CityIdsRes                   = transform.CityIdsRes
-	OptionsetRes                 = transform.OptionsetRes
+	Empty                        = transform.Empty
 	SchoolIdsReq                 = transform.SchoolIdsReq
-	GetErpActiveReq              = transform.GetErpActiveReq
-	UserResponse                 = transform.UserResponse
+	ListOfInt                    = transform.ListOfInt
+	GetErpOrganSchPerByUserIdReq = transform.GetErpOrganSchPerByUserIdReq
+	DataPermissionReq            = transform.DataPermissionReq
+	DataPermissionRes            = transform.DataPermissionRes
+	ExcelLogReq                  = transform.ExcelLogReq
+	ExcelLogRes                  = transform.ExcelLogRes
+	GetErpOrganSchPerByUserIdRes = transform.GetErpOrganSchPerByUserIdRes
+	UserRequest                  = transform.UserRequest
+	TokenRequest                 = transform.TokenRequest
 	TokenResponse                = transform.TokenResponse
 	TreeNodes                    = transform.TreeNodes
+	OptionsetReq                 = transform.OptionsetReq
+	CityIdsReq                   = transform.CityIdsReq
 	BytesReq                     = transform.BytesReq
+	GetErpRoleRes                = transform.GetErpRoleRes
+	UserResponse                 = transform.UserResponse
+	OrganSchool                  = transform.OrganSchool
 	GetErpActiveRes              = transform.GetErpActiveRes
-	Empty                        = transform.Empty
-	GetErpOrganSchPerByUserIdReq = transform.GetErpOrganSchPerByUserIdReq
+	OptionsetRes                 = transform.OptionsetRes
 	GetErpSchoolRes              = transform.GetErpSchoolRes
-	TokenRequest                 = transform.TokenRequest
-	TreeNode                     = transform.TreeNode
+	Options                      = transform.Options
+	BytesResp                    = transform.BytesResp
+	GetErpRoleReq                = transform.GetErpRoleReq
+	GetErpActiveReq              = transform.GetErpActiveReq
 	Tag                          = transform.Tag
-	OptionsetReq                 = transform.OptionsetReq
-	CityIdsReq                   = transform.CityIdsReq
+	Active                       = transform.Active
+	ResponseByte                 = transform.ResponseByte
 
 	Transform interface {
 		GetUser(ctx context.Context, in *UserRequest) (*UserResponse, error)
@@ -57,6 +59,8 @@ type (
 		GetCityIds(ctx context.Context, in *CityIdsReq) (*CityIdsRes, error)
 		PostExcelLog(ctx context.Context, in *ExcelLogReq) (*ExcelLogRes, error)
 		GetErpOptionset(ctx context.Context, in *OptionCode) (*Options, error)
+		// 获取数据权限
+		GetDataPermission(ctx context.Context, in *DataPermissionReq) (*DataPermissionRes, error)
 		// 获取erp 渠道细分树
 		GetErpMktNetWorkDetailTree(ctx context.Context, in *Empty) (*TreeNodes, error)
 		// 获取erp 用户校区权限
@@ -122,6 +126,12 @@ func (m *defaultTransform) GetErpOptionset(ctx context.Context, in *OptionCode)
 	return client.GetErpOptionset(ctx, in)
 }
 
+// 获取数据权限
+func (m *defaultTransform) GetDataPermission(ctx context.Context, in *DataPermissionReq) (*DataPermissionRes, error) {
+	client := transform.NewTransformClient(m.cli.Conn())
+	return client.GetDataPermission(ctx, in)
+}
+
 // 获取erp 渠道细分树
 func (m *defaultTransform) GetErpMktNetWorkDetailTree(ctx context.Context, in *Empty) (*TreeNodes, error) {
 	client := transform.NewTransformClient(m.cli.Conn())