浏览代码

权限校区,校区活动

icole 4 年之前
父节点
当前提交
55d5091c71

+ 2 - 2
etc/transform.yaml

@@ -1,9 +1,9 @@
 Name: transform.rpc
-ListenOn: 0.0.0.0:8080
+ListenOn: 172.16.11.5:8080
 Etcd:
   Hosts:
   - 47.103.219.158:30019
-  Key: transform.rpc
+  Key: icole.rpc
 DataSource: root:gSRGZqb121TlYIbJy0@tcp(47.103.202.94:3306)/i2erp_erp1?charset=utf8&loc=Local&parseTime=true
 Table:
 Cache:

+ 31 - 3
internal/logic/get_erp_active_logic.go

@@ -23,8 +23,36 @@ func NewGetErpActiveLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetE
 	}
 }
 
-func (l *GetErpActiveLogic) GetErpActive(in *transform.Empty) (*transform.ResponseByte, error) {
+func (l *GetErpActiveLogic) GetErpActive(in *transform.GetErpActiveReq) (*transform.GetErpActiveRes, error) {
 	// todo: add your logic here and delete this line
-
-	return &transform.ResponseByte{}, nil
+	type Active struct {
+		MaName   string `json:"ma_name"`
+		ActiveId int64  `json:"active_id"`
+	}
+	acts := new([]*Active)
+	actives := new([]*transform.Active)
+	sql := `
+		select
+    		act.id active_id,act.ma_name
+		from
+    		mkt_activity act
+		left join
+    		mkt_activities_school act_sch
+		on
+    		act.id = act_sch.ma_id
+		where
+    		act.del_flag = 0
+    		and act_sch.school_id = ?  `
+	err := l.svcCtx.DB.SQL(sql, in.SchId).Find(acts)
+	if err != nil {
+		logx.Error(err.Error())
+		return nil, err
+	}
+	for _, act := range *acts {
+		active := new(transform.Active)
+		active.MaName = act.MaName
+		active.ActiveId = act.ActiveId
+		*actives = append(*actives, active)
+	}
+	return &transform.GetErpActiveRes{Active: *actives}, nil
 }

+ 37 - 6
internal/logic/get_erp_organ_sch_per_by_user_id_logic.go

@@ -2,11 +2,10 @@ package logic
 
 import (
 	"context"
-
 	"git.i2edu.net/i2/i2-bill-erp/internal/svc"
 	"git.i2edu.net/i2/i2-bill-erp/transform"
 
-	"github.com/tal-tech/go-zero/core/logx"
+	"git.i2edu.net/i2/go-zero/core/logx"
 )
 
 type GetErpOrganSchPerByUserIdLogic struct {
@@ -24,9 +23,41 @@ func NewGetErpOrganSchPerByUserIdLogic(ctx context.Context, svcCtx *svc.ServiceC
 }
 
 // 获取erp 用户权限
-func (l *GetErpOrganSchPerByUserIdLogic) GetErpOrganSchPerByUserId(in *transform.GetErpOrganSchPerByUserIdReq) (*transform.GetErpOrganSchPerByUserIdResp, error) {
+func (l *GetErpOrganSchPerByUserIdLogic) GetErpOrganSchPerByUserId(in *transform.GetErpOrganSchPerByUserIdReq) (*transform.GetErpOrganSchPerByUserIdRes, error) {
 	// todo: add your logic here and delete this line
-
-	//l.svcCtx.DB
-	return &transform.GetErpOrganSchPerByUserIdResp{}, nil
+	type Sch struct {
+		Name    string `json:"name"`
+		OrganId int64  `json:"organ_id"`
+		Id      int64  `json:"id"`
+	}
+	sch := new([]*Sch)
+	schools := new([]*transform.OrganSchool)
+	sql := `
+		SELECT
+    		sch.name,sch.organ_id,sch.id
+		FROM
+    		base_organ_school sch
+		INNER JOIN
+    		base_user_organ_school user_sch
+		ON
+    		sch.id= user_sch.os_id
+		WHERE
+    		sch.del_flag = 0
+    		and user_sch.del_flag = 0
+		    and onoff =98
+    		and user_sch.user_id = ?
+	`
+	err := l.svcCtx.DB.SQL(sql, in.UserId).Find(sch)
+	if err != nil {
+		logx.Error(err.Error())
+		return nil, err
+	}
+	for _, s := range *sch {
+		school := new(transform.OrganSchool)
+		school.Id = s.Id
+		school.Name = s.Name
+		school.OrganId = s.OrganId
+		*schools = append(*schools, school)
+	}
+	return &transform.GetErpOrganSchPerByUserIdRes{School: *schools}, nil
 }

+ 52 - 0
internal/logic/get_erp_role_logic.go

@@ -0,0 +1,52 @@
+package logic
+
+import (
+	"context"
+	"errors"
+
+	"git.i2edu.net/i2/i2-bill-erp/internal/svc"
+	"git.i2edu.net/i2/i2-bill-erp/transform"
+
+	"github.com/tal-tech/go-zero/core/logx"
+)
+
+type GetErpRoleLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewGetErpRoleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetErpRoleLogic {
+	return &GetErpRoleLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// 获取 erp 用户角色
+func (l *GetErpRoleLogic) GetErpRole(in *transform.GetErpRoleReq) (*transform.GetErpRoleRes, error) {
+	// todo: add your logic here and delete this line
+	if in.Mobile == "" {
+		return nil, errors.New("mobile is empty")
+	}
+	sql := `select  
+			sys_user.id user_id,GROUP_CONCAT(sys_role.code)  role
+          from 
+			sys_user  
+		  LEFT JOIN 
+			sys_user_role on sys_user.id=sys_user_role.user_id  
+		  LEFT JOIN  sys_role on sys_user_role.role_id= sys_role.id   
+		  where 
+			 sys_user.mobile = ? GROUP BY sys_user.mobile`
+	result, err := l.svcCtx.DB.SQL(sql, in.Mobile).Query().List()
+	if err != nil {
+		return nil, err
+	}
+	if len(result) == 0 {
+		return nil, nil
+	}
+	user_id, _ := result[0]["user_id"].(string)
+	role, _ := result[0]["role"].(string)
+	return &transform.GetErpRoleRes{UserId: user_id, Role: role}, nil
+}

+ 27 - 3
internal/logic/get_erp_school_logic.go

@@ -23,8 +23,32 @@ func NewGetErpSchoolLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetE
 	}
 }
 
-func (l *GetErpSchoolLogic) GetErpSchool(in *transform.Empty) (*transform.ResponseByte, error) {
+func (l *GetErpSchoolLogic) GetErpSchool(in *transform.Empty) (*transform.GetErpSchoolRes, error) {
 	// todo: add your logic here and delete this line
-
-	return &transform.ResponseByte{}, nil
+	type Sch struct {
+		Name    string `json:"name"`
+		OrganId int64  `json:"organ_id"`
+		Id      int64  `json:"id"`
+	}
+	sch := new([]*Sch)
+	schools := new([]*transform.OrganSchool)
+	sql := `
+		SELECT
+    		sch.name,sch.organ_id,sch.id
+		FROM
+    		base_organ_school sch
+	`
+	err := l.svcCtx.DB.SQL(sql).Find(sch)
+	if err != nil {
+		logx.Error(err.Error())
+		return nil, err
+	}
+	for _, s := range *sch {
+		school := new(transform.OrganSchool)
+		school.Id = s.Id
+		school.Name = s.Name
+		school.OrganId = s.OrganId
+		*schools = append(*schools, school)
+	}
+	return &transform.GetErpSchoolRes{School: *schools}, nil
 }

+ 20 - 2
internal/server/transform_server.go

@@ -59,8 +59,26 @@ func (s *TransformServer) GetErpMktNetWorkDetailTree(ctx context.Context, in *tr
 	return l.GetErpMktNetWorkDetailTree(in)
 }
 
-// 获取erp 用户权限
-func (s *TransformServer) GetErpOrganSchPerByUserId(ctx context.Context, in *transform.GetErpOrganSchPerByUserIdReq) (*transform.GetErpOrganSchPerByUserIdResp, error) {
+// 获取erp 用户校区权限
+func (s *TransformServer) GetErpOrganSchPerByUserId(ctx context.Context, in *transform.GetErpOrganSchPerByUserIdReq) (*transform.GetErpOrganSchPerByUserIdRes, error) {
 	l := logic.NewGetErpOrganSchPerByUserIdLogic(ctx, s.svcCtx)
 	return l.GetErpOrganSchPerByUserId(in)
 }
+
+// 获取 erp 用户角色
+func (s *TransformServer) GetErpRole(ctx context.Context, in *transform.GetErpRoleReq) (*transform.GetErpRoleRes, error) {
+	l := logic.NewGetErpRoleLogic(ctx, s.svcCtx)
+	return l.GetErpRole(in)
+}
+
+// 获取 erp 全部校区
+func (s *TransformServer) GetErpSchool(ctx context.Context, in *transform.Empty) (*transform.GetErpSchoolRes, error) {
+	l := logic.NewGetErpSchoolLogic(ctx, s.svcCtx)
+	return l.GetErpSchool(in)
+}
+
+// 获取 erp 活动
+func (s *TransformServer) GetErpActive(ctx context.Context, in *transform.GetErpActiveReq) (*transform.GetErpActiveRes, error) {
+	l := logic.NewGetErpActiveLogic(ctx, s.svcCtx)
+	return l.GetErpActive(in)
+}

+ 0 - 16
proto/base_organ_school.proto

@@ -1,16 +0,0 @@
-syntax = "proto3";
-
-package transform;
-
-message GetErpOrganSchPerByUserIdReq{
-  string user_id = 1;
-}
-
-message GetErpOrganSchPerByUserIdResp{
-  repeated  ValueText data = 2;
-}
-
-message ValueText {
-  int64 value = 1;
-  string text = 2;
-}

+ 13 - 0
sqlconfig/mkt_activity_all.tpl

@@ -0,0 +1,13 @@
+select
+    *
+from
+    mkt_activity act
+left join
+    mkt_activities_school act_sch
+on
+    act.id = act_sch.ma_id
+where
+    act.del_flag = 0
+    {{if ne .school_id ""}}
+    act_sch.school_id = '{{.school_id}}'
+    {{end}}

+ 58 - 3
transform.proto

@@ -2,7 +2,6 @@ syntax = "proto3";
 
 package transform;
 
-import  "base_organ_school.proto";
 message UserRequest {
   string id = 1;
   string phone = 2;
@@ -90,6 +89,56 @@ message ExcelLogRes {
   int64 Status = 1;
 }
 
+message BytesReq{
+  bytes req = 1;
+}
+
+message BytesResp{
+  bytes resp = 1;
+}
+
+message GetErpRoleRes{
+  string user_id = 1;
+  string  role = 2;
+}
+
+message GetErpRoleReq{
+   string mobile = 1;
+   string user_id = 2;
+}
+
+message GetErpOrganSchPerByUserIdReq{
+  string user_id = 1;
+}
+
+message GetErpOrganSchPerByUserIdRes{
+  repeated  OrganSchool school = 1;
+}
+
+message OrganSchool {
+  int64  id =1;
+  string name = 2;
+  int64 organ_id = 3;
+}
+
+message GetErpSchoolRes{
+  repeated  OrganSchool school = 1;
+}
+
+message GetErpActiveReq{
+    uint64 sch_id = 1;
+}
+
+message GetErpActiveRes{
+  repeated Active active = 1;
+}
+
+message Active{
+    int64  active_id = 1;
+    string ma_name = 2;
+}
+
+
 service Transform {
   rpc GetUser(UserRequest) returns(UserResponse);
   rpc ParseToken(TokenRequest) returns(TokenResponse);
@@ -101,6 +150,12 @@ service Transform {
   rpc GetErpOptionset(OptionCode) returns(Options);
   //获取erp 渠道细分树
   rpc GetErpMktNetWorkDetailTree(Empty) returns(TreeNodes);
-  //获取erp 用户权限
-  rpc GetErpOrganSchPerByUserId(GetErpOrganSchPerByUserIdReq) returns(GetErpOrganSchPerByUserIdResp);
+  //获取erp 用户校区权限
+  rpc GetErpOrganSchPerByUserId(GetErpOrganSchPerByUserIdReq) returns(GetErpOrganSchPerByUserIdRes);
+  //获取 erp 用户角色
+  rpc GetErpRole(GetErpRoleReq)  returns(GetErpRoleRes);
+  //获取 erp 全部校区
+  rpc GetErpSchool(Empty)  returns(GetErpSchoolRes);
+  //获取 erp 活动
+  rpc GetErpActive(GetErpActiveReq) returns(GetErpActiveRes);
 }

+ 0 - 285
transform/base_organ_school.pb.go

@@ -1,285 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// versions:
-// 	protoc-gen-go v1.23.0
-// 	protoc        v3.12.3
-// source: base_organ_school.proto
-
-package transform
-
-import (
-	proto "github.com/golang/protobuf/proto"
-	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
-	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
-	reflect "reflect"
-	sync "sync"
-)
-
-const (
-	// Verify that this generated code is sufficiently up-to-date.
-	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
-	// Verify that runtime/protoimpl is sufficiently up-to-date.
-	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
-)
-
-// This is a compile-time assertion that a sufficiently up-to-date version
-// of the legacy proto package is being used.
-const _ = proto.ProtoPackageIsVersion4
-
-type GetErpOrganSchPerByUserIdReq struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-
-	UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
-}
-
-func (x *GetErpOrganSchPerByUserIdReq) Reset() {
-	*x = GetErpOrganSchPerByUserIdReq{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_base_organ_school_proto_msgTypes[0]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
-}
-
-func (x *GetErpOrganSchPerByUserIdReq) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*GetErpOrganSchPerByUserIdReq) ProtoMessage() {}
-
-func (x *GetErpOrganSchPerByUserIdReq) ProtoReflect() protoreflect.Message {
-	mi := &file_base_organ_school_proto_msgTypes[0]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
-	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use GetErpOrganSchPerByUserIdReq.ProtoReflect.Descriptor instead.
-func (*GetErpOrganSchPerByUserIdReq) Descriptor() ([]byte, []int) {
-	return file_base_organ_school_proto_rawDescGZIP(), []int{0}
-}
-
-func (x *GetErpOrganSchPerByUserIdReq) GetUserId() string {
-	if x != nil {
-		return x.UserId
-	}
-	return ""
-}
-
-type GetErpOrganSchPerByUserIdResp struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-
-	Data []*ValueText `protobuf:"bytes,2,rep,name=data,proto3" json:"data,omitempty"`
-}
-
-func (x *GetErpOrganSchPerByUserIdResp) Reset() {
-	*x = GetErpOrganSchPerByUserIdResp{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_base_organ_school_proto_msgTypes[1]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
-}
-
-func (x *GetErpOrganSchPerByUserIdResp) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*GetErpOrganSchPerByUserIdResp) ProtoMessage() {}
-
-func (x *GetErpOrganSchPerByUserIdResp) ProtoReflect() protoreflect.Message {
-	mi := &file_base_organ_school_proto_msgTypes[1]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
-	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use GetErpOrganSchPerByUserIdResp.ProtoReflect.Descriptor instead.
-func (*GetErpOrganSchPerByUserIdResp) Descriptor() ([]byte, []int) {
-	return file_base_organ_school_proto_rawDescGZIP(), []int{1}
-}
-
-func (x *GetErpOrganSchPerByUserIdResp) GetData() []*ValueText {
-	if x != nil {
-		return x.Data
-	}
-	return nil
-}
-
-type ValueText struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-
-	Value int64  `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
-	Text  string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
-}
-
-func (x *ValueText) Reset() {
-	*x = ValueText{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_base_organ_school_proto_msgTypes[2]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
-}
-
-func (x *ValueText) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*ValueText) ProtoMessage() {}
-
-func (x *ValueText) ProtoReflect() protoreflect.Message {
-	mi := &file_base_organ_school_proto_msgTypes[2]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
-	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use ValueText.ProtoReflect.Descriptor instead.
-func (*ValueText) Descriptor() ([]byte, []int) {
-	return file_base_organ_school_proto_rawDescGZIP(), []int{2}
-}
-
-func (x *ValueText) GetValue() int64 {
-	if x != nil {
-		return x.Value
-	}
-	return 0
-}
-
-func (x *ValueText) GetText() string {
-	if x != nil {
-		return x.Text
-	}
-	return ""
-}
-
-var File_base_organ_school_proto protoreflect.FileDescriptor
-
-var file_base_organ_school_proto_rawDesc = []byte{
-	0x0a, 0x17, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x5f, 0x73, 0x63, 0x68,
-	0x6f, 0x6f, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73,
-	0x66, 0x6f, 0x72, 0x6d, 0x22, 0x37, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x45, 0x72, 0x70, 0x4f, 0x72,
-	0x67, 0x61, 0x6e, 0x53, 0x63, 0x68, 0x50, 0x65, 0x72, 0x42, 0x79, 0x55, 0x73, 0x65, 0x72, 0x49,
-	0x64, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18,
-	0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x49, 0x0a,
-	0x1d, 0x47, 0x65, 0x74, 0x45, 0x72, 0x70, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x53, 0x63, 0x68, 0x50,
-	0x65, 0x72, 0x42, 0x79, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x28,
-	0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x74,
-	0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x54, 0x65,
-	0x78, 0x74, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x35, 0x0a, 0x09, 0x56, 0x61, 0x6c, 0x75,
-	0x65, 0x54, 0x65, 0x78, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01,
-	0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74,
-	0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x62,
-	0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
-}
-
-var (
-	file_base_organ_school_proto_rawDescOnce sync.Once
-	file_base_organ_school_proto_rawDescData = file_base_organ_school_proto_rawDesc
-)
-
-func file_base_organ_school_proto_rawDescGZIP() []byte {
-	file_base_organ_school_proto_rawDescOnce.Do(func() {
-		file_base_organ_school_proto_rawDescData = protoimpl.X.CompressGZIP(file_base_organ_school_proto_rawDescData)
-	})
-	return file_base_organ_school_proto_rawDescData
-}
-
-var file_base_organ_school_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
-var file_base_organ_school_proto_goTypes = []interface{}{
-	(*GetErpOrganSchPerByUserIdReq)(nil),  // 0: transform.GetErpOrganSchPerByUserIdReq
-	(*GetErpOrganSchPerByUserIdResp)(nil), // 1: transform.GetErpOrganSchPerByUserIdResp
-	(*ValueText)(nil),                     // 2: transform.ValueText
-}
-var file_base_organ_school_proto_depIdxs = []int32{
-	2, // 0: transform.GetErpOrganSchPerByUserIdResp.data:type_name -> transform.ValueText
-	1, // [1:1] is the sub-list for method output_type
-	1, // [1:1] is the sub-list for method input_type
-	1, // [1:1] is the sub-list for extension type_name
-	1, // [1:1] is the sub-list for extension extendee
-	0, // [0:1] is the sub-list for field type_name
-}
-
-func init() { file_base_organ_school_proto_init() }
-func file_base_organ_school_proto_init() {
-	if File_base_organ_school_proto != nil {
-		return
-	}
-	if !protoimpl.UnsafeEnabled {
-		file_base_organ_school_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*GetErpOrganSchPerByUserIdReq); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
-		file_base_organ_school_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*GetErpOrganSchPerByUserIdResp); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
-		file_base_organ_school_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*ValueText); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
-	}
-	type x struct{}
-	out := protoimpl.TypeBuilder{
-		File: protoimpl.DescBuilder{
-			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
-			RawDescriptor: file_base_organ_school_proto_rawDesc,
-			NumEnums:      0,
-			NumMessages:   3,
-			NumExtensions: 0,
-			NumServices:   0,
-		},
-		GoTypes:           file_base_organ_school_proto_goTypes,
-		DependencyIndexes: file_base_organ_school_proto_depIdxs,
-		MessageInfos:      file_base_organ_school_proto_msgTypes,
-	}.Build()
-	File_base_organ_school_proto = out.File
-	file_base_organ_school_proto_rawDesc = nil
-	file_base_organ_school_proto_goTypes = nil
-	file_base_organ_school_proto_depIdxs = nil
-}

文件差异内容过多而无法显示
+ 1326 - 239
transform/transform.pb.go


+ 55 - 15
transformclient/transform.go

@@ -14,30 +14,52 @@ import (
 )
 
 type (
-	UserResponse  = transform.UserResponse
-	TreeNodes     = transform.TreeNodes
-	OptionCode    = transform.OptionCode
-	Options       = transform.Options
-	UserRequest   = transform.UserRequest
-	TokenRequest  = transform.TokenRequest
-	TokenResponse = transform.TokenResponse
-	Empty         = transform.Empty
-	TreeNode      = transform.TreeNode
-	Tag           = transform.Tag
+	ExcelLogRes                  = transform.ExcelLogRes
+	GetErpActiveRes              = transform.GetErpActiveRes
+	UserRequest                  = transform.UserRequest
+	Tag                          = transform.Tag
+	OptionsetReq                 = transform.OptionsetReq
+	OptionCode                   = transform.OptionCode
+	ExcelLogReq                  = transform.ExcelLogReq
+	Options                      = transform.Options
+	ResponseByte                 = transform.ResponseByte
+	BytesReq                     = transform.BytesReq
+	GetErpRoleRes                = transform.GetErpRoleRes
+	OrganSchool                  = transform.OrganSchool
+	TokenRequest                 = transform.TokenRequest
+	TreeNodes                    = transform.TreeNodes
+	BytesResp                    = transform.BytesResp
+	GetErpOrganSchPerByUserIdReq = transform.GetErpOrganSchPerByUserIdReq
+	GetErpOrganSchPerByUserIdRes = transform.GetErpOrganSchPerByUserIdRes
+	GetErpRoleReq                = transform.GetErpRoleReq
+	GetErpSchoolRes              = transform.GetErpSchoolRes
+	GetErpActiveReq              = transform.GetErpActiveReq
+	UserResponse                 = transform.UserResponse
+	TokenResponse                = transform.TokenResponse
+	Empty                        = transform.Empty
+	TreeNode                     = transform.TreeNode
+	OptionsetRes                 = transform.OptionsetRes
+	Active                       = transform.Active
 
 	Transform interface {
 		GetUser(ctx context.Context, in *UserRequest) (*UserResponse, error)
 		ParseToken(ctx context.Context, in *TokenRequest) (*TokenResponse, error)
 		// 获取erp 省、城市树
 		GetErpCityTree(ctx context.Context, in *Empty) (*TreeNodes, error)
+		// 获取erp  字典
 		LoadOptionset(ctx context.Context, in *OptionsetReq) (*OptionsetRes, error)
 		PostExcelLog(ctx context.Context, in *ExcelLogReq) (*ExcelLogRes, error)
-		// 获取erp  字典
 		GetErpOptionset(ctx context.Context, in *OptionCode) (*Options, error)
 		// 获取erp 渠道细分树
 		GetErpMktNetWorkDetailTree(ctx context.Context, in *Empty) (*TreeNodes, error)
-		// 获取erp 用户权限
-		GetErpOrganSchPerByUserId(ctx context.Context, in *GetErpOrganSchPerByUserIdReq) (*GetErpOrganSchPerByUserIdResp, error)
+		// 获取erp 用户校区权限
+		GetErpOrganSchPerByUserId(ctx context.Context, in *GetErpOrganSchPerByUserIdReq) (*GetErpOrganSchPerByUserIdRes, error)
+		// 获取 erp 用户角色
+		GetErpRole(ctx context.Context, in *GetErpRoleReq) (*GetErpRoleRes, error)
+		// 获取 erp 全部校区
+		GetErpSchool(ctx context.Context, in *Empty) (*GetErpSchoolRes, error)
+		// 获取 erp 活动
+		GetErpActive(ctx context.Context, in *GetErpActiveReq) (*GetErpActiveRes, error)
 	}
 
 	defaultTransform struct {
@@ -89,8 +111,26 @@ func (m *defaultTransform) GetErpMktNetWorkDetailTree(ctx context.Context, in *E
 	return client.GetErpMktNetWorkDetailTree(ctx, in)
 }
 
-// 获取erp 用户权限
-func (m *defaultTransform) GetErpOrganSchPerByUserId(ctx context.Context, in *GetErpOrganSchPerByUserIdReq) (*GetErpOrganSchPerByUserIdResp, error) {
+// 获取erp 用户校区权限
+func (m *defaultTransform) GetErpOrganSchPerByUserId(ctx context.Context, in *GetErpOrganSchPerByUserIdReq) (*GetErpOrganSchPerByUserIdRes, error) {
 	client := transform.NewTransformClient(m.cli.Conn())
 	return client.GetErpOrganSchPerByUserId(ctx, in)
 }
+
+// 获取 erp 用户角色
+func (m *defaultTransform) GetErpRole(ctx context.Context, in *GetErpRoleReq) (*GetErpRoleRes, error) {
+	client := transform.NewTransformClient(m.cli.Conn())
+	return client.GetErpRole(ctx, in)
+}
+
+// 获取 erp 全部校区
+func (m *defaultTransform) GetErpSchool(ctx context.Context, in *Empty) (*GetErpSchoolRes, error) {
+	client := transform.NewTransformClient(m.cli.Conn())
+	return client.GetErpSchool(ctx, in)
+}
+
+// 获取 erp 活动
+func (m *defaultTransform) GetErpActive(ctx context.Context, in *GetErpActiveReq) (*GetErpActiveRes, error) {
+	client := transform.NewTransformClient(m.cli.Conn())
+	return client.GetErpActive(ctx, in)
+}

部分文件因为文件数量过多而无法显示