Merge branch 'master' of 10.10.14.250:huanghai/dsMin

master
wubin 5 years ago
commit c94ab39197

@ -41,7 +41,7 @@ type BacthSetClassGraduateStageArg struct {
//一个或多个ID
Ids []string `protobuf:"bytes,1,rep,name=Ids,proto3" json:"Ids,omitempty"`
//1恢复为正常班级 2:毕业
//1恢复为正常班级 -3:毕业
Status int32 `protobuf:"varint,2,opt,name=Status,proto3" json:"Status,omitempty"`
//操作人
ActionPersonId string `protobuf:"bytes,3,opt,name=ActionPersonId,proto3" json:"ActionPersonId,omitempty"`

@ -36,7 +36,7 @@ service BaseClassManage {
message BacthSetClassGraduateStageArg {
//ID
repeated string Ids = 1;
//1 2
//1 -3
int32 Status = 2;
//
string ActionPersonId = 3;

@ -0,0 +1,61 @@
package BasePositionDao
import (
"dsBaseRpc/RpcService/BasePosition/BasePositionProto"
"dsBaseRpc/Utils/CommonUtil"
"dsBaseRpc/Utils/DbUtil"
"dsBaseRpc/Utils/SqlKit"
"dsBaseRpc/models"
"github.com/xormplus/builder"
)
var db = DbUtil.Engine
//增加
func AddBasePosition(model models.TBasePosition) (int64, error) {
return db.Insert(model)
}
//修改
func UpdateBasePosition(model models.TBasePosition, ForceUpdateFields []string) (int64, error) {
//1、清除Redis缓存
var ids = []string{model.Id}
var selector = SqlKit.GetBean("t_base_position")
SqlKit.DeleteCacheByIds(ids, selector)
//2、计算本次操作有哪些字段需要更新
NeedUpdateFields := CommonUtil.GetNeedUpdateFields(model)
//3、合并强制更新的字段
ForceUpdateFields = append(ForceUpdateFields, NeedUpdateFields...)
//4、去重
ForceUpdateFields = CommonUtil.RemoveDuplicatesAndEmpty(ForceUpdateFields)
//5、更新操作,强制更新这些列
affected, err := db.ID(model.Id).Cols(ForceUpdateFields...).Update(model)
return affected, err
}
//获取职务所有的树形结构信息(不需要参数)
func TreeBasePosition() ([]map[string]interface{}, int, error) {
var myBuilder = builder.Dialect(builder.MYSQL).Select("*").From("t_base_position")
myBuilder.Where(builder.Eq{"b_use": 1})
myBuilder.OrderBy("area_level")
myBuilder.OrderBy("org_type")
myBuilder.OrderBy("xxbxlxm")
myBuilder.OrderBy("sort_id")
//获取拼接完成的SQL语句
sql, err := myBuilder.ToBoundSQL()
if err != nil {
return nil, 0, err
}
//调用多查询字段通用方法
list, err := db.SQL(sql).Query().List()
return list, len(list), err
}
//根据单位ID获取职务信息
func ListBasePositionByBureauId(in *BasePositionProto.QueryArg) ([]map[string]interface{}, int32, error) {
//1、哪个级别
in.
//2、这个单位ID是哪个类型的org_type
//3、如果是学校那么还需要知道 xxbxlxm
}

@ -0,0 +1,899 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.21.0
// protoc v3.11.4
// source: BasePosition.proto
//在web层重新生成pb.go的方法
//
//protoc -I Business/BasePosition/BasePositionProto/ Business/BasePosition/BasePositionProto/BasePosition.proto --go_out=plugins=grpc:Business/BasePosition/BasePositionProto
package BasePositionProto
import (
context "context"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
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 ListBasePositionByBureauIdArg struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
//单位ID
BureauId string `protobuf:"bytes,1,opt,name=BureauId,proto3" json:"BureauId,omitempty"`
}
func (x *ListBasePositionByBureauIdArg) Reset() {
*x = ListBasePositionByBureauIdArg{}
if protoimpl.UnsafeEnabled {
mi := &file_BasePosition_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListBasePositionByBureauIdArg) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListBasePositionByBureauIdArg) ProtoMessage() {}
func (x *ListBasePositionByBureauIdArg) ProtoReflect() protoreflect.Message {
mi := &file_BasePosition_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 ListBasePositionByBureauIdArg.ProtoReflect.Descriptor instead.
func (*ListBasePositionByBureauIdArg) Descriptor() ([]byte, []int) {
return file_BasePosition_proto_rawDescGZIP(), []int{0}
}
func (x *ListBasePositionByBureauIdArg) GetBureauId() string {
if x != nil {
return x.BureauId
}
return ""
}
type ModelArg struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
//主键ID
Id string `protobuf:"bytes,1,opt,name=Id,proto3" json:"Id,omitempty"`
//整数ID
IdInt int32 `protobuf:"varint,2,opt,name=IdInt,proto3" json:"IdInt,omitempty"`
//职务名称
NodeName string `protobuf:"bytes,3,opt,name=NodeName,proto3" json:"NodeName,omitempty"`
//上级节点ID
ParentId string `protobuf:"bytes,4,opt,name=ParentId,proto3" json:"ParentId,omitempty"`
//区域级别 -1无意义 1市级 2区级
AreaLevel int32 `protobuf:"varint,5,opt,name=AreaLevel,proto3" json:"AreaLevel,omitempty"`
//单位类型 1教育局 2学校 7教辅单位
OrgType int32 `protobuf:"varint,6,opt,name=OrgType,proto3" json:"OrgType,omitempty"`
//学校办学类型(学校专有属性)有字典
Xxbxlxm string `protobuf:"bytes,7,opt,name=Xxbxlxm,proto3" json:"Xxbxlxm,omitempty"`
//第一位为增加 1有 0无 第二位为修改 1有 0无 第三位为删除 1有 0
MaintainId string `protobuf:"bytes,8,opt,name=MaintainId,proto3" json:"MaintainId,omitempty"`
//是否为职务 1是职务 0职务关系节点
PostionFlag int32 `protobuf:"varint,9,opt,name=PostionFlag,proto3" json:"PostionFlag,omitempty"`
//是否可用 1可用 -2不可用
BUse int32 `protobuf:"varint,10,opt,name=BUse,proto3" json:"BUse,omitempty"`
//节点内部排序号
SortId int32 `protobuf:"varint,11,opt,name=SortId,proto3" json:"SortId,omitempty"`
//最后修改时间
LastUpdatedTime string `protobuf:"bytes,12,opt,name=LastUpdatedTime,proto3" json:"LastUpdatedTime,omitempty"`
//需要强制更新的列
ForceUpdateFields []string `protobuf:"bytes,13,rep,name=ForceUpdateFields,proto3" json:"ForceUpdateFields,omitempty"`
}
func (x *ModelArg) Reset() {
*x = ModelArg{}
if protoimpl.UnsafeEnabled {
mi := &file_BasePosition_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ModelArg) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ModelArg) ProtoMessage() {}
func (x *ModelArg) ProtoReflect() protoreflect.Message {
mi := &file_BasePosition_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 ModelArg.ProtoReflect.Descriptor instead.
func (*ModelArg) Descriptor() ([]byte, []int) {
return file_BasePosition_proto_rawDescGZIP(), []int{1}
}
func (x *ModelArg) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *ModelArg) GetIdInt() int32 {
if x != nil {
return x.IdInt
}
return 0
}
func (x *ModelArg) GetNodeName() string {
if x != nil {
return x.NodeName
}
return ""
}
func (x *ModelArg) GetParentId() string {
if x != nil {
return x.ParentId
}
return ""
}
func (x *ModelArg) GetAreaLevel() int32 {
if x != nil {
return x.AreaLevel
}
return 0
}
func (x *ModelArg) GetOrgType() int32 {
if x != nil {
return x.OrgType
}
return 0
}
func (x *ModelArg) GetXxbxlxm() string {
if x != nil {
return x.Xxbxlxm
}
return ""
}
func (x *ModelArg) GetMaintainId() string {
if x != nil {
return x.MaintainId
}
return ""
}
func (x *ModelArg) GetPostionFlag() int32 {
if x != nil {
return x.PostionFlag
}
return 0
}
func (x *ModelArg) GetBUse() int32 {
if x != nil {
return x.BUse
}
return 0
}
func (x *ModelArg) GetSortId() int32 {
if x != nil {
return x.SortId
}
return 0
}
func (x *ModelArg) GetLastUpdatedTime() string {
if x != nil {
return x.LastUpdatedTime
}
return ""
}
func (x *ModelArg) GetForceUpdateFields() []string {
if x != nil {
return x.ForceUpdateFields
}
return nil
}
// 查询参数
type QueryArg struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Page int32 `protobuf:"varint,1,opt,name=Page,proto3" json:"Page,omitempty"`
Limit int32 `protobuf:"varint,2,opt,name=Limit,proto3" json:"Limit,omitempty"`
}
func (x *QueryArg) Reset() {
*x = QueryArg{}
if protoimpl.UnsafeEnabled {
mi := &file_BasePosition_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *QueryArg) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*QueryArg) ProtoMessage() {}
func (x *QueryArg) ProtoReflect() protoreflect.Message {
mi := &file_BasePosition_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 QueryArg.ProtoReflect.Descriptor instead.
func (*QueryArg) Descriptor() ([]byte, []int) {
return file_BasePosition_proto_rawDescGZIP(), []int{2}
}
func (x *QueryArg) GetPage() int32 {
if x != nil {
return x.Page
}
return 0
}
func (x *QueryArg) GetLimit() int32 {
if x != nil {
return x.Limit
}
return 0
}
// 查询请求响应
type Reply struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Success bool `protobuf:"varint,1,opt,name=Success,proto3" json:"Success,omitempty"`
Message string `protobuf:"bytes,2,opt,name=Message,proto3" json:"Message,omitempty"`
Count int32 `protobuf:"varint,3,opt,name=Count,proto3" json:"Count,omitempty"`
List string `protobuf:"bytes,4,opt,name=List,proto3" json:"List,omitempty"`
}
func (x *Reply) Reset() {
*x = Reply{}
if protoimpl.UnsafeEnabled {
mi := &file_BasePosition_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Reply) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Reply) ProtoMessage() {}
func (x *Reply) ProtoReflect() protoreflect.Message {
mi := &file_BasePosition_proto_msgTypes[3]
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 Reply.ProtoReflect.Descriptor instead.
func (*Reply) Descriptor() ([]byte, []int) {
return file_BasePosition_proto_rawDescGZIP(), []int{3}
}
func (x *Reply) GetSuccess() bool {
if x != nil {
return x.Success
}
return false
}
func (x *Reply) GetMessage() string {
if x != nil {
return x.Message
}
return ""
}
func (x *Reply) GetCount() int32 {
if x != nil {
return x.Count
}
return 0
}
func (x *Reply) GetList() string {
if x != nil {
return x.List
}
return ""
}
//删除参数
type DeleteIdsArg struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
//一个或多个ID
Ids []string `protobuf:"bytes,1,rep,name=Ids,proto3" json:"Ids,omitempty"`
}
func (x *DeleteIdsArg) Reset() {
*x = DeleteIdsArg{}
if protoimpl.UnsafeEnabled {
mi := &file_BasePosition_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DeleteIdsArg) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeleteIdsArg) ProtoMessage() {}
func (x *DeleteIdsArg) ProtoReflect() protoreflect.Message {
mi := &file_BasePosition_proto_msgTypes[4]
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 DeleteIdsArg.ProtoReflect.Descriptor instead.
func (*DeleteIdsArg) Descriptor() ([]byte, []int) {
return file_BasePosition_proto_rawDescGZIP(), []int{4}
}
func (x *DeleteIdsArg) GetIds() []string {
if x != nil {
return x.Ids
}
return nil
}
var File_BasePosition_proto protoreflect.FileDescriptor
var file_BasePosition_proto_rawDesc = []byte{
0x0a, 0x12, 0x42, 0x61, 0x73, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x42, 0x61, 0x73, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69,
0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3b, 0x0a, 0x1d, 0x4c, 0x69, 0x73, 0x74, 0x42,
0x61, 0x73, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x42, 0x75, 0x72,
0x65, 0x61, 0x75, 0x49, 0x64, 0x41, 0x72, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x42, 0x75, 0x72, 0x65,
0x61, 0x75, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x42, 0x75, 0x72, 0x65,
0x61, 0x75, 0x49, 0x64, 0x22, 0x80, 0x03, 0x0a, 0x08, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x41, 0x72,
0x67, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49,
0x64, 0x12, 0x14, 0x0a, 0x05, 0x49, 0x64, 0x49, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,
0x52, 0x05, 0x49, 0x64, 0x49, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x4e,
0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x4e,
0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18,
0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12,
0x1c, 0x0a, 0x09, 0x41, 0x72, 0x65, 0x61, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x05, 0x20, 0x01,
0x28, 0x05, 0x52, 0x09, 0x41, 0x72, 0x65, 0x61, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x18, 0x0a,
0x07, 0x4f, 0x72, 0x67, 0x54, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07,
0x4f, 0x72, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x58, 0x78, 0x62, 0x78, 0x6c,
0x78, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x58, 0x78, 0x62, 0x78, 0x6c, 0x78,
0x6d, 0x12, 0x1e, 0x0a, 0x0a, 0x4d, 0x61, 0x69, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x18,
0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x4d, 0x61, 0x69, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x49,
0x64, 0x12, 0x20, 0x0a, 0x0b, 0x50, 0x6f, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6c, 0x61, 0x67,
0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x50, 0x6f, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x46,
0x6c, 0x61, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x42, 0x55, 0x73, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28,
0x05, 0x52, 0x04, 0x42, 0x55, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x6f, 0x72, 0x74, 0x49,
0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x53, 0x6f, 0x72, 0x74, 0x49, 0x64, 0x12,
0x28, 0x0a, 0x0f, 0x4c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x54, 0x69,
0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x4c, 0x61, 0x73, 0x74, 0x55, 0x70,
0x64, 0x61, 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2c, 0x0a, 0x11, 0x46, 0x6f, 0x72,
0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x0d,
0x20, 0x03, 0x28, 0x09, 0x52, 0x11, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74,
0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x22, 0x34, 0x0a, 0x08, 0x51, 0x75, 0x65, 0x72, 0x79,
0x41, 0x72, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x50, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x05, 0x52, 0x04, 0x50, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x4c, 0x69, 0x6d, 0x69, 0x74,
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x65, 0x0a,
0x05, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73,
0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73,
0x12, 0x18, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x09, 0x52, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x43, 0x6f,
0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x43, 0x6f, 0x75, 0x6e, 0x74,
0x12, 0x12, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
0x4c, 0x69, 0x73, 0x74, 0x22, 0x20, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x64,
0x73, 0x41, 0x72, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x49, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28,
0x09, 0x52, 0x03, 0x49, 0x64, 0x73, 0x32, 0xf2, 0x03, 0x0a, 0x12, 0x42, 0x61, 0x73, 0x65, 0x50,
0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x12, 0x4a, 0x0a,
0x0f, 0x47, 0x65, 0x74, 0x42, 0x61, 0x73, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e,
0x12, 0x1b, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x50,
0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x41, 0x72, 0x67, 0x1a, 0x18, 0x2e,
0x42, 0x61, 0x73, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74,
0x6f, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x4a, 0x0a, 0x0f, 0x41, 0x64, 0x64,
0x42, 0x61, 0x73, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x2e, 0x42,
0x61, 0x73, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f,
0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x41, 0x72, 0x67, 0x1a, 0x18, 0x2e, 0x42, 0x61, 0x73, 0x65,
0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65,
0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x51, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42,
0x61, 0x73, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x2e, 0x42, 0x61,
0x73, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x64, 0x73, 0x41, 0x72, 0x67, 0x1a, 0x18, 0x2e, 0x42,
0x61, 0x73, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f,
0x2e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61,
0x74, 0x65, 0x42, 0x61, 0x73, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b,
0x2e, 0x42, 0x61, 0x73, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f,
0x74, 0x6f, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x41, 0x72, 0x67, 0x1a, 0x18, 0x2e, 0x42, 0x61,
0x73, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x10, 0x54, 0x72, 0x65, 0x65, 0x42,
0x61, 0x73, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x2e, 0x42, 0x61,
0x73, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x72, 0x67, 0x1a, 0x18, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x50,
0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x70,
0x6c, 0x79, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x73, 0x65,
0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x42, 0x75, 0x72, 0x65, 0x61, 0x75,
0x49, 0x64, 0x12, 0x1b, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f,
0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x72, 0x67, 0x1a,
0x18, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72,
0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x42, 0x40, 0x0a, 0x16, 0x63,
0x6f, 0x6d, 0x2e, 0x64, 0x73, 0x69, 0x64, 0x65, 0x61, 0x6c, 0x2e, 0x64, 0x73, 0x6d, 0x69, 0x6e,
0x2e, 0x62, 0x61, 0x73, 0x65, 0x42, 0x0c, 0x42, 0x61, 0x73, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74,
0x69, 0x6f, 0x6e, 0x50, 0x01, 0x5a, 0x13, 0x2e, 0x3b, 0x42, 0x61, 0x73, 0x65, 0x50, 0x6f, 0x73,
0x69, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0xa2, 0x02, 0x00, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_BasePosition_proto_rawDescOnce sync.Once
file_BasePosition_proto_rawDescData = file_BasePosition_proto_rawDesc
)
func file_BasePosition_proto_rawDescGZIP() []byte {
file_BasePosition_proto_rawDescOnce.Do(func() {
file_BasePosition_proto_rawDescData = protoimpl.X.CompressGZIP(file_BasePosition_proto_rawDescData)
})
return file_BasePosition_proto_rawDescData
}
var file_BasePosition_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_BasePosition_proto_goTypes = []interface{}{
(*ListBasePositionByBureauIdArg)(nil), // 0: BasePositionProto.ListBasePositionByBureauIdArg
(*ModelArg)(nil), // 1: BasePositionProto.ModelArg
(*QueryArg)(nil), // 2: BasePositionProto.QueryArg
(*Reply)(nil), // 3: BasePositionProto.Reply
(*DeleteIdsArg)(nil), // 4: BasePositionProto.DeleteIdsArg
}
var file_BasePosition_proto_depIdxs = []int32{
1, // 0: BasePositionProto.BasePositionManage.GetBasePosition:input_type -> BasePositionProto.ModelArg
1, // 1: BasePositionProto.BasePositionManage.AddBasePosition:input_type -> BasePositionProto.ModelArg
4, // 2: BasePositionProto.BasePositionManage.DeleteBasePosition:input_type -> BasePositionProto.DeleteIdsArg
1, // 3: BasePositionProto.BasePositionManage.UpdateBasePosition:input_type -> BasePositionProto.ModelArg
2, // 4: BasePositionProto.BasePositionManage.TreeBasePosition:input_type -> BasePositionProto.QueryArg
2, // 5: BasePositionProto.BasePositionManage.ListBasePositionByBureauId:input_type -> BasePositionProto.QueryArg
3, // 6: BasePositionProto.BasePositionManage.GetBasePosition:output_type -> BasePositionProto.Reply
3, // 7: BasePositionProto.BasePositionManage.AddBasePosition:output_type -> BasePositionProto.Reply
3, // 8: BasePositionProto.BasePositionManage.DeleteBasePosition:output_type -> BasePositionProto.Reply
3, // 9: BasePositionProto.BasePositionManage.UpdateBasePosition:output_type -> BasePositionProto.Reply
3, // 10: BasePositionProto.BasePositionManage.TreeBasePosition:output_type -> BasePositionProto.Reply
3, // 11: BasePositionProto.BasePositionManage.ListBasePositionByBureauId:output_type -> BasePositionProto.Reply
6, // [6:12] is the sub-list for method output_type
0, // [0:6] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_BasePosition_proto_init() }
func file_BasePosition_proto_init() {
if File_BasePosition_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_BasePosition_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListBasePositionByBureauIdArg); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_BasePosition_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ModelArg); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_BasePosition_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*QueryArg); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_BasePosition_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Reply); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_BasePosition_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeleteIdsArg); 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_BasePosition_proto_rawDesc,
NumEnums: 0,
NumMessages: 5,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_BasePosition_proto_goTypes,
DependencyIndexes: file_BasePosition_proto_depIdxs,
MessageInfos: file_BasePosition_proto_msgTypes,
}.Build()
File_BasePosition_proto = out.File
file_BasePosition_proto_rawDesc = nil
file_BasePosition_proto_goTypes = nil
file_BasePosition_proto_depIdxs = nil
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConnInterface
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion6
// BasePositionManageClient is the client API for BasePositionManage service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type BasePositionManageClient interface {
//获取单条
GetBasePosition(ctx context.Context, in *ModelArg, opts ...grpc.CallOption) (*Reply, error)
//增加
AddBasePosition(ctx context.Context, in *ModelArg, opts ...grpc.CallOption) (*Reply, error)
//批量删除
DeleteBasePosition(ctx context.Context, in *DeleteIdsArg, opts ...grpc.CallOption) (*Reply, error)
//修改
UpdateBasePosition(ctx context.Context, in *ModelArg, opts ...grpc.CallOption) (*Reply, error)
//获取职务所有的树形结构信息
TreeBasePosition(ctx context.Context, in *QueryArg, opts ...grpc.CallOption) (*Reply, error)
//根据单位ID获取职务信息
ListBasePositionByBureauId(ctx context.Context, in *QueryArg, opts ...grpc.CallOption) (*Reply, error)
}
type basePositionManageClient struct {
cc grpc.ClientConnInterface
}
func NewBasePositionManageClient(cc grpc.ClientConnInterface) BasePositionManageClient {
return &basePositionManageClient{cc}
}
func (c *basePositionManageClient) GetBasePosition(ctx context.Context, in *ModelArg, opts ...grpc.CallOption) (*Reply, error) {
out := new(Reply)
err := c.cc.Invoke(ctx, "/BasePositionProto.BasePositionManage/GetBasePosition", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *basePositionManageClient) AddBasePosition(ctx context.Context, in *ModelArg, opts ...grpc.CallOption) (*Reply, error) {
out := new(Reply)
err := c.cc.Invoke(ctx, "/BasePositionProto.BasePositionManage/AddBasePosition", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *basePositionManageClient) DeleteBasePosition(ctx context.Context, in *DeleteIdsArg, opts ...grpc.CallOption) (*Reply, error) {
out := new(Reply)
err := c.cc.Invoke(ctx, "/BasePositionProto.BasePositionManage/DeleteBasePosition", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *basePositionManageClient) UpdateBasePosition(ctx context.Context, in *ModelArg, opts ...grpc.CallOption) (*Reply, error) {
out := new(Reply)
err := c.cc.Invoke(ctx, "/BasePositionProto.BasePositionManage/UpdateBasePosition", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *basePositionManageClient) TreeBasePosition(ctx context.Context, in *QueryArg, opts ...grpc.CallOption) (*Reply, error) {
out := new(Reply)
err := c.cc.Invoke(ctx, "/BasePositionProto.BasePositionManage/TreeBasePosition", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *basePositionManageClient) ListBasePositionByBureauId(ctx context.Context, in *QueryArg, opts ...grpc.CallOption) (*Reply, error) {
out := new(Reply)
err := c.cc.Invoke(ctx, "/BasePositionProto.BasePositionManage/ListBasePositionByBureauId", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// BasePositionManageServer is the server API for BasePositionManage service.
type BasePositionManageServer interface {
//获取单条
GetBasePosition(context.Context, *ModelArg) (*Reply, error)
//增加
AddBasePosition(context.Context, *ModelArg) (*Reply, error)
//批量删除
DeleteBasePosition(context.Context, *DeleteIdsArg) (*Reply, error)
//修改
UpdateBasePosition(context.Context, *ModelArg) (*Reply, error)
//获取职务所有的树形结构信息
TreeBasePosition(context.Context, *QueryArg) (*Reply, error)
//根据单位ID获取职务信息
ListBasePositionByBureauId(context.Context, *QueryArg) (*Reply, error)
}
// UnimplementedBasePositionManageServer can be embedded to have forward compatible implementations.
type UnimplementedBasePositionManageServer struct {
}
func (*UnimplementedBasePositionManageServer) GetBasePosition(context.Context, *ModelArg) (*Reply, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetBasePosition not implemented")
}
func (*UnimplementedBasePositionManageServer) AddBasePosition(context.Context, *ModelArg) (*Reply, error) {
return nil, status.Errorf(codes.Unimplemented, "method AddBasePosition not implemented")
}
func (*UnimplementedBasePositionManageServer) DeleteBasePosition(context.Context, *DeleteIdsArg) (*Reply, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteBasePosition not implemented")
}
func (*UnimplementedBasePositionManageServer) UpdateBasePosition(context.Context, *ModelArg) (*Reply, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateBasePosition not implemented")
}
func (*UnimplementedBasePositionManageServer) TreeBasePosition(context.Context, *QueryArg) (*Reply, error) {
return nil, status.Errorf(codes.Unimplemented, "method TreeBasePosition not implemented")
}
func (*UnimplementedBasePositionManageServer) ListBasePositionByBureauId(context.Context, *QueryArg) (*Reply, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListBasePositionByBureauId not implemented")
}
func RegisterBasePositionManageServer(s *grpc.Server, srv BasePositionManageServer) {
s.RegisterService(&_BasePositionManage_serviceDesc, srv)
}
func _BasePositionManage_GetBasePosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ModelArg)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BasePositionManageServer).GetBasePosition(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/BasePositionProto.BasePositionManage/GetBasePosition",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BasePositionManageServer).GetBasePosition(ctx, req.(*ModelArg))
}
return interceptor(ctx, in, info, handler)
}
func _BasePositionManage_AddBasePosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ModelArg)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BasePositionManageServer).AddBasePosition(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/BasePositionProto.BasePositionManage/AddBasePosition",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BasePositionManageServer).AddBasePosition(ctx, req.(*ModelArg))
}
return interceptor(ctx, in, info, handler)
}
func _BasePositionManage_DeleteBasePosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteIdsArg)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BasePositionManageServer).DeleteBasePosition(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/BasePositionProto.BasePositionManage/DeleteBasePosition",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BasePositionManageServer).DeleteBasePosition(ctx, req.(*DeleteIdsArg))
}
return interceptor(ctx, in, info, handler)
}
func _BasePositionManage_UpdateBasePosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ModelArg)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BasePositionManageServer).UpdateBasePosition(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/BasePositionProto.BasePositionManage/UpdateBasePosition",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BasePositionManageServer).UpdateBasePosition(ctx, req.(*ModelArg))
}
return interceptor(ctx, in, info, handler)
}
func _BasePositionManage_TreeBasePosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryArg)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BasePositionManageServer).TreeBasePosition(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/BasePositionProto.BasePositionManage/TreeBasePosition",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BasePositionManageServer).TreeBasePosition(ctx, req.(*QueryArg))
}
return interceptor(ctx, in, info, handler)
}
func _BasePositionManage_ListBasePositionByBureauId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryArg)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BasePositionManageServer).ListBasePositionByBureauId(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/BasePositionProto.BasePositionManage/ListBasePositionByBureauId",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BasePositionManageServer).ListBasePositionByBureauId(ctx, req.(*QueryArg))
}
return interceptor(ctx, in, info, handler)
}
var _BasePositionManage_serviceDesc = grpc.ServiceDesc{
ServiceName: "BasePositionProto.BasePositionManage",
HandlerType: (*BasePositionManageServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetBasePosition",
Handler: _BasePositionManage_GetBasePosition_Handler,
},
{
MethodName: "AddBasePosition",
Handler: _BasePositionManage_AddBasePosition_Handler,
},
{
MethodName: "DeleteBasePosition",
Handler: _BasePositionManage_DeleteBasePosition_Handler,
},
{
MethodName: "UpdateBasePosition",
Handler: _BasePositionManage_UpdateBasePosition_Handler,
},
{
MethodName: "TreeBasePosition",
Handler: _BasePositionManage_TreeBasePosition_Handler,
},
{
MethodName: "ListBasePositionByBureauId",
Handler: _BasePositionManage_ListBasePositionByBureauId_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "BasePosition.proto",
}

@ -0,0 +1,82 @@
syntax = "proto3";
//webpb.go
/*
protoc -I Business/BasePosition/BasePositionProto/ Business/BasePosition/BasePositionProto/BasePosition.proto --go_out=plugins=grpc:Business/BasePosition/BasePositionProto
*/
package BasePositionProto;
option go_package = ".;BasePositionProto";
option java_multiple_files = true;
option java_package = "com.dsideal.dsmin.base";
option java_outer_classname = "BasePosition";
option objc_class_prefix = "";
service BasePositionManage {
//
rpc GetBasePosition (ModelArg) returns (Reply) {}
//
rpc AddBasePosition (ModelArg) returns (Reply) {}
//
rpc DeleteBasePosition (DeleteIdsArg) returns (Reply) {}
//
rpc UpdateBasePosition (ModelArg) returns (Reply) {}
//
rpc TreeBasePosition (QueryArg) returns (Reply) {}
//ID
rpc ListBasePositionByBureauId (QueryArg) returns (Reply) {}
}
message ListBasePositionByBureauIdArg {
//ID
string BureauId = 1;
}
message ModelArg {
//ID
string Id = 1;
//ID
int32 IdInt = 2;
//
string NodeName = 3;
//ID
string ParentId = 4;
// -1 1 2
int32 AreaLevel = 5;
// 1 2 7
int32 OrgType = 6;
//
string Xxbxlxm = 7;
// 1 0 1 0 1 0
string MaintainId = 8;
// 1 0
int32 PostionFlag = 9;
// 1 -2
int32 BUse = 10;
//
int32 SortId = 11;
//
string LastUpdatedTime = 12;
//
repeated string ForceUpdateFields = 13;
}
//
message QueryArg{
int32 Page = 1;
int32 Limit = 2;
}
//
message Reply{
bool Success = 1;
string Message = 2;
int32 Count = 3;
string List = 4;
}
//
message DeleteIdsArg {
//ID
repeated string Ids = 1;
}

@ -0,0 +1,170 @@
package BasePositionService
import (
"context"
"dsBaseRpc/Const"
"dsBaseRpc/Const/ErrorConst"
"dsBaseRpc/RpcService/BasePosition/BasePositionDao"
"dsBaseRpc/RpcService/BasePosition/BasePositionProto"
"dsBaseRpc/Utils/CommonUtil"
"dsBaseRpc/Utils/LogUtil"
"dsBaseRpc/Utils/SqlKit"
"dsBaseRpc/models"
"fmt"
)
type Rpc struct{} //服务对象
//选择单条
func (s *Rpc) GetBasePosition(ctx context.Context, in *BasePositionProto.ModelArg) (*BasePositionProto.Reply, error) {
//异常处理
defer func() {
if err := recover(); err != nil {
fmt.Printf("%s\n", err)
}
}()
//统一返回的结构体
var reply BasePositionProto.Reply
//通用获取单条
list := SqlKit.QueryByIds([]string{in.Id}, "t_base_position")
//将结果序列化
reply.Success = true
reply.Count = 1
reply.Message = Const.SuccessDataBaseAction
reply.List = CommonUtil.SerializeToString(list)
return &reply, nil
}
//增加
func (s *Rpc) AddBasePosition(ctx context.Context, in *BasePositionProto.ModelArg) (*BasePositionProto.Reply, error) {
//异常处理
defer func() {
if err := recover(); err != nil {
fmt.Printf("%s\n", err)
}
}()
//rpc响应
var reply BasePositionProto.Reply
model := new(models.TBasePosition)
model.Id = CommonUtil.GetUUID()
model.NodeName = in.NodeName
model.ParentId = in.ParentId
model.AreaLevel = in.AreaLevel
model.OrgType = in.OrgType
model.Xxbxlxm = in.Xxbxlxm
model.PostionFlag = 1 //职务肯定是1
model.SortId = in.SortId
model.MaintainId = "011" //增加,删除,修改
model.BUse = 1
//调用dao
_, err := BasePositionDao.AddBasePosition(*model)
//错误处理
if err != nil {
reply.Success = false
reply.Message = "增加失败,请检查原因!"
return &reply, err
}
reply.Success = true
reply.Message = Const.SuccessDataBaseAction
return &reply, nil
}
//删除
func (s *Rpc) DeleteBasePosition(ctx context.Context, in *BasePositionProto.DeleteIdsArg) (*BasePositionProto.Reply, error) {
//异常处理
defer func() {
if err := recover(); err != nil {
fmt.Printf("%s\n", err)
}
}()
//rpc响应
var reply BasePositionProto.Reply
//调用通用删除命令进行删除
err := SqlKit.DeleteIds("t_base_position", in.Ids)
//错误处理
if err != nil {
LogUtil.Error(ErrorConst.SqlUpdateError, "执行DeleteBasePosition时发生严重错误"+err.Error())
reply.Success = false
reply.Message = Const.DataBaseActionError
return &reply, err
}
reply.Success = true
reply.Message = Const.SuccessDataBaseAction
return &reply, err
}
//修改
func (s *Rpc) UpdateBasePosition(ctx context.Context, in *BasePositionProto.ModelArg) (*BasePositionProto.Reply, error) {
//异常处理
defer func() {
if err := recover(); err != nil {
fmt.Printf("%s\n", err)
}
}()
var reply BasePositionProto.Reply
model := new(models.TBasePosition)
//修改
model.NodeName = in.NodeName
model.SortId = in.SortId
_, err := BasePositionDao.UpdateBasePosition(*model, []string{})
//错误处理
if err != nil {
reply.Success = false
reply.Message = Const.DataBaseActionError
LogUtil.Error(ErrorConst.SqlUpdateError, "执行UpdateBasePosition时发生严重错误"+err.Error())
return &reply, err
}
reply.Success = true
reply.Message = Const.SuccessDataBaseAction
return &reply, nil
}
//同步获取所有表中数据然后以children方式输出
func (s *Rpc) TreeBasePosition(ctx context.Context, in *BasePositionProto.QueryArg) (*BasePositionProto.Reply, error) {
//异常处理
defer func() {
if err := recover(); err != nil {
fmt.Printf("%s\n", err)
}
}()
var reply BasePositionProto.Reply
list, count, err := BasePositionDao.TreeBasePosition()
//错误处理
if err != nil {
reply.Success = false
reply.Message = Const.DataBaseActionError
LogUtil.Error(ErrorConst.SqlQueryError, "执行TreeBasePosition时发生严重错误"+err.Error())
return &reply, err
}
reply.Count = int32(count)
reply.Success = true
reply.Message = Const.SuccessDataBaseAction
reply.List = CommonUtil.SerializeToString(list)
return &reply, nil
}
//根据单位ID获取职务信息
func (s *Rpc) ListBasePositionByBureauId(ctx context.Context, in *BasePositionProto.QueryArg) (*BasePositionProto.Reply, error) {
//异常处理
defer func() {
if err := recover(); err != nil {
fmt.Printf("%s\n", err)
}
}()
var reply BasePositionProto.Reply
list, count, err := BasePositionDao.ListBasePositionByBureauId(in)
//错误处理
if err != nil {
reply.Success = false
reply.Message = Const.DataBaseActionError
LogUtil.Error(ErrorConst.SqlQueryError, "执行ListBasePositionByBureauId时发生严重错误"+err.Error())
return &reply, err
}
reply.Count = count
reply.Success = true
reply.Message = Const.SuccessDataBaseAction
reply.List = CommonUtil.SerializeToString(list)
return &reply, nil
}

@ -8,6 +8,8 @@ import (
"dsBaseRpc/RpcService/BaseGlobal/BaseGlobalService"
"dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationProto"
"dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationService"
"dsBaseRpc/RpcService/BasePosition/BasePositionProto"
"dsBaseRpc/RpcService/BasePosition/BasePositionService"
"dsBaseRpc/RpcService/BasePurview/BasePurviewProto"
"dsBaseRpc/RpcService/BasePurview/BasePurviewService"
"dsBaseRpc/RpcService/BaseRolePerson/BaseRolePersonProto"
@ -109,6 +111,8 @@ func main() {
BaseGlobalProto.RegisterBaseGlobalManageServer(s, &BaseGlobalService.Rpc{})
//人员角色
BaseRolePersonProto.RegisterBaseRolePersonManageServer(s, &BaseRolePersonService.Rpc{})
//职务
BasePositionProto.RegisterBasePositionManageServer(s, &BasePositionService.Rpc{})
//五、开启一个数据上报的协程
go func() {

@ -0,0 +1,16 @@
package models
type TBasePosition struct {
Id string `xorm:"not null pk comment('主键ID') CHAR(36)"`
NodeName string `xorm:"not null comment('职务名称') VARCHAR(100)"`
ParentId string `xorm:"not null comment('上级节点ID') CHAR(36)"`
AreaLevel int32 `xorm:"not null comment('区域级别 -1无意义 1市级 2区级') INT(11)"`
OrgType int32 `xorm:"not null comment('单位类型 1教育局 2学校 7教辅单位') INT(11)"`
Xxbxlxm string `xorm:"not null comment('学校办学类型(学校专有属性)有字典') CHAR(3)"`
MaintainId string `xorm:"not null default ''011'' comment(' 1 0
1 0
1 0') CHAR(3)"`
PostionFlag int32 `xorm:"not null default 1 comment('是否为职务 1是职务 0职务关系节点') INT(11)"`
BUse int32 `xorm:"not null default 1 comment('是否可用 1可用 -2不可用') INT(11)"`
SortId int32 `xorm:"not null default 1 comment('节点内部排序号') INT(11)"`
}

@ -0,0 +1,9 @@
package models
type TBaseTeacherPosition struct {
Id string `xorm:"not null pk comment('主键') CHAR(36)"`
PersonId string `xorm:"not null default '''' comment('人员ID') index(person_id) CHAR(18)"`
BureauId string `xorm:"not null comment('所在单位ID') index(person_id) CHAR(36)"`
PositionId string `xorm:"not null default ''0'' comment('职务ID') CHAR(36)"`
BUse int32 `xorm:"not null default 1 comment('是否可用 1可用 -2不可用') index(person_id) TINYINT(1)"`
}
Loading…
Cancel
Save