|
|
|
@ -5,6 +5,7 @@ import (
|
|
|
|
|
"dsBaseWeb/Business/BaseOrganization/BaseOrganizationProto"
|
|
|
|
|
"dsBaseWeb/Utils/GRpcUtil"
|
|
|
|
|
"dsBaseWeb/Utils/LogUtil"
|
|
|
|
|
"errors"
|
|
|
|
|
"time"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
@ -18,6 +19,9 @@ func PageBaseOrganization(queryArg BaseOrganizationProto.QueryArg) (*BaseOrganiz
|
|
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
|
|
|
|
defer cancel()
|
|
|
|
|
conn := GRpcUtil.GetConnection()
|
|
|
|
|
if conn == nil {
|
|
|
|
|
return nil, errors.New("RPC服务未启动!")
|
|
|
|
|
}
|
|
|
|
|
//2、业务传参
|
|
|
|
|
c := BaseOrganizationProto.NewBaseOrganizationManageClient(conn)
|
|
|
|
|
Reply, err := c.PageBaseOrganization(ctx, &queryArg)
|
|
|
|
@ -37,6 +41,9 @@ func GetBaseOrganization(modelArg BaseOrganizationProto.ModelArg) (*BaseOrganiza
|
|
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
|
|
|
|
defer cancel()
|
|
|
|
|
conn := GRpcUtil.GetConnection()
|
|
|
|
|
if conn == nil {
|
|
|
|
|
return nil, errors.New("RPC服务未启动!")
|
|
|
|
|
}
|
|
|
|
|
//2、业务传参
|
|
|
|
|
c := BaseOrganizationProto.NewBaseOrganizationManageClient(conn)
|
|
|
|
|
Reply, err := c.GetBaseOrganization(ctx, &modelArg)
|
|
|
|
@ -56,6 +63,9 @@ func UpdateBaseOrganization(modelArg BaseOrganizationProto.ModelArg) (*BaseOrgan
|
|
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
|
|
|
|
defer cancel()
|
|
|
|
|
conn := GRpcUtil.GetConnection()
|
|
|
|
|
if conn == nil {
|
|
|
|
|
return nil, errors.New("RPC服务未启动!")
|
|
|
|
|
}
|
|
|
|
|
//2、业务传参
|
|
|
|
|
c := BaseOrganizationProto.NewBaseOrganizationManageClient(conn)
|
|
|
|
|
Reply, err := c.UpdateBaseOrganization(ctx, &modelArg)
|
|
|
|
@ -75,6 +85,9 @@ func AddBaseOrganization(modelArg BaseOrganizationProto.ModelArg) (*BaseOrganiza
|
|
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
|
|
|
|
defer cancel()
|
|
|
|
|
conn := GRpcUtil.GetConnection()
|
|
|
|
|
if conn == nil {
|
|
|
|
|
return nil, errors.New("RPC服务未启动!")
|
|
|
|
|
}
|
|
|
|
|
//2、业务传参
|
|
|
|
|
c := BaseOrganizationProto.NewBaseOrganizationManageClient(conn)
|
|
|
|
|
Reply, err := c.AddBaseOrganization(ctx, &modelArg)
|
|
|
|
@ -94,6 +107,9 @@ func DeleteBaseOrganization(deleteIdsArg BaseOrganizationProto.DeleteIdsArg) (*B
|
|
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
|
|
|
|
defer cancel()
|
|
|
|
|
conn := GRpcUtil.GetConnection()
|
|
|
|
|
if conn == nil {
|
|
|
|
|
return nil, errors.New("RPC服务未启动!")
|
|
|
|
|
}
|
|
|
|
|
//2、业务传参
|
|
|
|
|
c := BaseOrganizationProto.NewBaseOrganizationManageClient(conn)
|
|
|
|
|
Reply, err := c.DeleteBaseOrganization(ctx, &deleteIdsArg)
|
|
|
|
@ -108,6 +124,9 @@ func GetMultipleBaseOrganization(ids []string) (*BaseOrganizationProto.Reply, er
|
|
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
|
|
|
|
defer cancel()
|
|
|
|
|
conn := GRpcUtil.GetConnection()
|
|
|
|
|
if conn == nil {
|
|
|
|
|
return nil, errors.New("RPC服务未启动!")
|
|
|
|
|
}
|
|
|
|
|
//2、业务传参
|
|
|
|
|
c := BaseOrganizationProto.NewBaseOrganizationManageClient(conn)
|
|
|
|
|
Reply, err := c.GetMultipleBaseOrganization(ctx, &BaseOrganizationProto.MultipleQueryArg{Ids: ids})
|
|
|
|
@ -122,6 +141,9 @@ func GetBureauOrgTree(modelArg BaseOrganizationProto.ModelArg) (*BaseOrganizatio
|
|
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
|
|
|
|
defer cancel()
|
|
|
|
|
conn := GRpcUtil.GetConnection()
|
|
|
|
|
if conn == nil {
|
|
|
|
|
return nil, errors.New("RPC服务未启动!")
|
|
|
|
|
}
|
|
|
|
|
//2、业务传参
|
|
|
|
|
c := BaseOrganizationProto.NewBaseOrganizationManageClient(conn)
|
|
|
|
|
Reply, err := c.GetBureauOrgTree(ctx, &modelArg)
|
|
|
|
@ -136,6 +158,9 @@ func GetOrgManager(ids []string) (*BaseOrganizationProto.Reply, error) {
|
|
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
|
|
|
|
defer cancel()
|
|
|
|
|
conn := GRpcUtil.GetConnection()
|
|
|
|
|
if conn == nil {
|
|
|
|
|
return nil, errors.New("RPC服务未启动!")
|
|
|
|
|
}
|
|
|
|
|
//2、业务传参
|
|
|
|
|
c := BaseOrganizationProto.NewBaseOrganizationManageClient(conn)
|
|
|
|
|
Reply, err := c.GetOrgManager(ctx, &BaseOrganizationProto.MultipleQueryArg{Ids: ids})
|
|
|
|
@ -155,6 +180,9 @@ func SetEnableEdu(multipleQueryArg BaseOrganizationProto.MultipleQueryArg) (*Bas
|
|
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
|
|
|
|
defer cancel()
|
|
|
|
|
conn := GRpcUtil.GetConnection()
|
|
|
|
|
if conn == nil {
|
|
|
|
|
return nil, errors.New("RPC服务未启动!")
|
|
|
|
|
}
|
|
|
|
|
//2、业务传参
|
|
|
|
|
c := BaseOrganizationProto.NewBaseOrganizationManageClient(conn)
|
|
|
|
|
Reply, err := c.SetEnableEdu(ctx, &multipleQueryArg)
|
|
|
|
@ -174,6 +202,9 @@ func SetDisableEdu(multipleQueryArg BaseOrganizationProto.MultipleQueryArg) (*Ba
|
|
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
|
|
|
|
defer cancel()
|
|
|
|
|
conn := GRpcUtil.GetConnection()
|
|
|
|
|
if conn == nil {
|
|
|
|
|
return nil, errors.New("RPC服务未启动!")
|
|
|
|
|
}
|
|
|
|
|
//2、业务传参
|
|
|
|
|
c := BaseOrganizationProto.NewBaseOrganizationManageClient(conn)
|
|
|
|
|
Reply, err := c.SetDisableEdu(ctx, &multipleQueryArg)
|
|
|
|
|