Browse Source

feat: 查看公司类型

zhangxinlei1996 1 năm trước cách đây
mục cha
commit
dbd2f5a5e7

+ 7 - 0
api/biService.api

@@ -97,6 +97,10 @@ type (
 		NewId string `json:"newId"`
 		Type  int64  `json:"type"`
 	}
+
+	getCompanyTypeReq {
+		CompanyName string `json:"companyName"`
+	}
 )
 
 service biService-api {
@@ -138,4 +142,7 @@ service biService-api {
 	@doc "资讯操作"
 	@handler infoOperate
 	post /biService/infoOperate (OperateReq) returns (biResp)
+	@doc "公司类型"
+	@handler getCompanyType
+	post /biService/getCompanyType(getCompanyTypeReq) returns (biResp)
 }

+ 28 - 0
api/internal/handler/getcompanytypehandler.go

@@ -0,0 +1,28 @@
+package handler
+
+import (
+	"net/http"
+
+	"bp.jydev.jianyu360.cn/BaseService/biService/api/internal/logic"
+	"bp.jydev.jianyu360.cn/BaseService/biService/api/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/biService/api/internal/types"
+	"github.com/zeromicro/go-zero/rest/httpx"
+)
+
+func getCompanyTypeHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.GetCompanyTypeReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+			return
+		}
+
+		l := logic.NewGetCompanyTypeLogic(r.Context(), svcCtx)
+		resp, err := l.GetCompanyType(&req)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 5 - 0
api/internal/handler/routes.go

@@ -92,6 +92,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 				Path:    "/biService/infoOperate",
 				Handler: infoOperateHandler(serverCtx),
 			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/biService/getCompanyType",
+				Handler: getCompanyTypeHandler(serverCtx),
+			},
 		},
 	)
 }

+ 42 - 0
api/internal/logic/getcompanytypelogic.go

@@ -0,0 +1,42 @@
+package logic
+
+import (
+	"context"
+
+	"bp.jydev.jianyu360.cn/BaseService/biService/api/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/biService/api/internal/types"
+	"bp.jydev.jianyu360.cn/BaseService/biService/rpc/biservice"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GetCompanyTypeLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewGetCompanyTypeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetCompanyTypeLogic {
+	return &GetCompanyTypeLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *GetCompanyTypeLogic) GetCompanyType(req *types.GetCompanyTypeReq) (resp *types.BiResp, err error) {
+	res, err := l.svcCtx.BiServiceRpc.GetCompanyType(l.ctx, &biservice.CompanyReq{
+		CompanyName: req.CompanyName,
+	})
+	status := int64(0)
+	if res != nil {
+		status = res.Status
+	}
+
+	resp = &types.BiResp{
+		Data: map[string]interface{}{
+			"status": status,
+		},
+	}
+	return resp, err
+}

+ 4 - 0
api/internal/types/types.go

@@ -103,3 +103,7 @@ type OperateReq struct {
 	NewId string `json:"newId"`
 	Type  int64  `json:"type"`
 }
+
+type GetCompanyTypeReq struct {
+	CompanyName string `json:"companyName"`
+}

+ 7 - 1
entity/entity.go

@@ -1,10 +1,11 @@
 package entity
 
 import (
-	"app.yhyue.com/moapp/jybase/mail"
 	"log"
 	"strings"
 
+	"app.yhyue.com/moapp/jybase/mail"
+
 	"encoding/json"
 
 	"sync"
@@ -28,6 +29,7 @@ var (
 	BiService        *mysql.Mysql
 	Mgo              *mongodb.MongodbSim
 	Bidding          *mongodb.MongodbSim
+	MgoQyxy          *mongodb.MongodbSim
 	Es               elastic.Es
 	EntEs            elastic.EsV7
 	AreaCode         = map[string]string{}
@@ -159,6 +161,10 @@ func InitBiddingMgo(addr, db, user, pwd string, size int) {
 	Bidding = mongodb.NewMgoWithUser(addr, db, user, pwd, size)
 }
 
+func InitQyxyMgo(addr, db, user, pwd string, size int) {
+	MgoQyxy = mongodb.NewMgoWithUser(addr, db, user, pwd, size)
+}
+
 func InitEs(version, address, userName, password string, size int) {
 	Es = elastic.NewEs(version, address, size, userName, password)
 }

+ 9 - 0
rpc/biService.proto

@@ -141,6 +141,14 @@ message OperateReq {
 	string newId = 1;
 	int64 type=2;
 }
+
+message CompanyReq {
+	string companyName = 1;
+}
+message CompanyResp {
+	int64 status = 1;
+}
+
 service BiService {
 	rpc myDataAsset (MyDataAssetReq) returns (MyDataAssetResp); //我的数据资产
 	rpc addProject (AddProjectReq) returns (AddProjectResp); //添加项目
@@ -157,4 +165,5 @@ service BiService {
 	rpc allInfoExport (ExportReq) returns (BiReply); //资讯全量导出
 	rpc allProjectExport (ExportReq) returns (BiReply); //项目全量导出
 	rpc infoOperate (OperateReq) returns (BiReply); //数据操作
+	rpc getCompanyType (CompanyReq) returns (CompanyResp); //判断公司类型
 }

+ 1 - 0
rpc/biservice.go

@@ -32,6 +32,7 @@ func main() {
 	entity.InitMail(c.Mail)
 	entity.InitMongo(c.Mongo.Qfw.MongodbAddr, c.Mongo.Qfw.DbName, c.Mongo.Qfw.Size)
 	entity.InitBiddingMgo(c.Mongo.Bidding.MongodbAddr, c.Mongo.Bidding.DbName, c.Mongo.Bidding.UserName, c.Mongo.Bidding.Password, c.Mongo.Bidding.Size)
+	entity.InitQyxyMgo(c.Mongo.Qyxy.MongodbAddr, c.Mongo.Qyxy.DbName, c.Mongo.Qyxy.UserName, c.Mongo.Qyxy.Password, c.Mongo.Qyxy.Size)
 	entity.InitEs(c.Es.Version, c.Es.Address, c.Es.UserName, c.Es.Password, c.Es.DbSize)
 	entity.InitEntEs(c.EntEs.Version, c.EntEs.Address, c.EntEs.UserName, c.EntEs.Password, c.EntEs.DbSize)
 	entity.InitArea()

+ 9 - 1
rpc/biservice/biservice.go

@@ -1,4 +1,4 @@
-// Code generated by goctl. DO NOT EDIT!
+// Code generated by goctl. DO NOT EDIT.
 // Source: biService.proto
 
 package biservice
@@ -23,6 +23,8 @@ type (
 	ClueImport        = pb.ClueImport
 	ClueImportReq     = pb.ClueImportReq
 	ClueImportResp    = pb.ClueImportResp
+	CompanyReq        = pb.CompanyReq
+	CompanyResp       = pb.CompanyResp
 	DistributeClueReq = pb.DistributeClueReq
 	DistributeDatas   = pb.DistributeDatas
 	DrawClueReq       = pb.DrawClueReq
@@ -52,6 +54,7 @@ type (
 		AllInfoExport(ctx context.Context, in *ExportReq, opts ...grpc.CallOption) (*BiReply, error)
 		AllProjectExport(ctx context.Context, in *ExportReq, opts ...grpc.CallOption) (*BiReply, error)
 		InfoOperate(ctx context.Context, in *OperateReq, opts ...grpc.CallOption) (*BiReply, error)
+		GetCompanyType(ctx context.Context, in *CompanyReq, opts ...grpc.CallOption) (*CompanyResp, error)
 	}
 
 	defaultBiService struct {
@@ -139,3 +142,8 @@ func (m *defaultBiService) InfoOperate(ctx context.Context, in *OperateReq, opts
 	client := pb.NewBiServiceClient(m.cli.Conn())
 	return client.InfoOperate(ctx, in, opts...)
 }
+
+func (m *defaultBiService) GetCompanyType(ctx context.Context, in *CompanyReq, opts ...grpc.CallOption) (*CompanyResp, error) {
+	client := pb.NewBiServiceClient(m.cli.Conn())
+	return client.GetCompanyType(ctx, in, opts...)
+}

+ 6 - 0
rpc/etc/biservice.yaml

@@ -66,6 +66,12 @@ Mongo:
     UserName:
     Password:
     Size: 10
+  Qyxy:
+    MongodbAddr: 192.168.3.206:27002
+    DbName: mixdata
+    UserName: jyDevGroup
+    Password: jy@DevGroup
+    Size: 10
 Es:
   Address: http://192.168.3.241:9205
   DbSize: 5

+ 7 - 0
rpc/internal/config/config.go

@@ -32,6 +32,13 @@ type Config struct {
 			UserName    string
 			Password    string
 		}
+		Qyxy struct {
+			MongodbAddr string
+			Size        int
+			DbName      string
+			UserName    string
+			Password    string
+		}
 	}
 	Es struct {
 		Address  string

+ 35 - 0
rpc/internal/logic/getcompanytypelogic.go

@@ -0,0 +1,35 @@
+package logic
+
+import (
+	"context"
+
+	"bp.jydev.jianyu360.cn/BaseService/biService/rpc/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/biService/rpc/pb"
+	"bp.jydev.jianyu360.cn/BaseService/biService/service"
+	"github.com/gogf/gf/v2/util/gconv"
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GetCompanyTypeLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewGetCompanyTypeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetCompanyTypeLogic {
+	return &GetCompanyTypeLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+func (l *GetCompanyTypeLogic) GetCompanyType(in *pb.CompanyReq) (*pb.CompanyResp, error) {
+	// todo: add your logic here and delete this line
+
+	status := service.GetCompanyType(in)
+	data := gconv.Int64(status)
+	return &pb.CompanyResp{
+		Status: data,
+	}, nil
+}

+ 6 - 1
rpc/internal/server/biserviceserver.go

@@ -1,4 +1,4 @@
-// Code generated by goctl. DO NOT EDIT!
+// Code generated by goctl. DO NOT EDIT.
 // Source: biService.proto
 
 package server
@@ -96,3 +96,8 @@ func (s *BiServiceServer) InfoOperate(ctx context.Context, in *pb.OperateReq) (*
 	l := logic.NewInfoOperateLogic(ctx, s.svcCtx)
 	return l.InfoOperate(in)
 }
+
+func (s *BiServiceServer) GetCompanyType(ctx context.Context, in *pb.CompanyReq) (*pb.CompanyResp, error) {
+	l := logic.NewGetCompanyTypeLogic(ctx, s.svcCtx)
+	return l.GetCompanyType(in)
+}

+ 192 - 62
rpc/pb/biService.pb.go

@@ -1,7 +1,7 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
 // versions:
 // 	protoc-gen-go v1.27.1
-// 	protoc        v3.20.0--rc2
+// 	protoc        v3.19.4
 // source: biService.proto
 
 package pb
@@ -1526,6 +1526,100 @@ func (x *OperateReq) GetType() int64 {
 	return 0
 }
 
+type CompanyReq struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	CompanyName string `protobuf:"bytes,1,opt,name=companyName,proto3" json:"companyName,omitempty"`
+}
+
+func (x *CompanyReq) Reset() {
+	*x = CompanyReq{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_biService_proto_msgTypes[22]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *CompanyReq) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CompanyReq) ProtoMessage() {}
+
+func (x *CompanyReq) ProtoReflect() protoreflect.Message {
+	mi := &file_biService_proto_msgTypes[22]
+	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 CompanyReq.ProtoReflect.Descriptor instead.
+func (*CompanyReq) Descriptor() ([]byte, []int) {
+	return file_biService_proto_rawDescGZIP(), []int{22}
+}
+
+func (x *CompanyReq) GetCompanyName() string {
+	if x != nil {
+		return x.CompanyName
+	}
+	return ""
+}
+
+type CompanyResp struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Status int64 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"`
+}
+
+func (x *CompanyResp) Reset() {
+	*x = CompanyResp{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_biService_proto_msgTypes[23]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *CompanyResp) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CompanyResp) ProtoMessage() {}
+
+func (x *CompanyResp) ProtoReflect() protoreflect.Message {
+	mi := &file_biService_proto_msgTypes[23]
+	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 CompanyResp.ProtoReflect.Descriptor instead.
+func (*CompanyResp) Descriptor() ([]byte, []int) {
+	return file_biService_proto_rawDescGZIP(), []int{23}
+}
+
+func (x *CompanyResp) GetStatus() int64 {
+	if x != nil {
+		return x.Status
+	}
+	return 0
+}
+
 var File_biService_proto protoreflect.FileDescriptor
 
 var file_biService_proto_rawDesc = []byte{
@@ -1699,48 +1793,56 @@ var file_biService_proto_rawDesc = []byte{
 	0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x65,
 	0x77, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6e, 0x65, 0x77, 0x49, 0x64,
 	0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04,
-	0x74, 0x79, 0x70, 0x65, 0x32, 0x85, 0x05, 0x0a, 0x09, 0x42, 0x69, 0x53, 0x65, 0x72, 0x76, 0x69,
-	0x63, 0x65, 0x12, 0x30, 0x0a, 0x0b, 0x6d, 0x79, 0x44, 0x61, 0x74, 0x61, 0x41, 0x73, 0x73, 0x65,
-	0x74, 0x12, 0x0f, 0x2e, 0x4d, 0x79, 0x44, 0x61, 0x74, 0x61, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52,
-	0x65, 0x71, 0x1a, 0x10, 0x2e, 0x4d, 0x79, 0x44, 0x61, 0x74, 0x61, 0x41, 0x73, 0x73, 0x65, 0x74,
-	0x52, 0x65, 0x73, 0x70, 0x12, 0x2d, 0x0a, 0x0a, 0x61, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65,
-	0x63, 0x74, 0x12, 0x0e, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52,
-	0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52,
-	0x65, 0x73, 0x70, 0x12, 0x2b, 0x0a, 0x09, 0x67, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x49, 0x64,
-	0x12, 0x0e, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71,
-	0x1a, 0x0e, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70,
-	0x12, 0x29, 0x0a, 0x08, 0x64, 0x72, 0x61, 0x77, 0x43, 0x6c, 0x75, 0x65, 0x12, 0x0c, 0x2e, 0x44,
-	0x72, 0x61, 0x77, 0x43, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x41, 0x64, 0x64,
-	0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x19, 0x0a, 0x04, 0x43,
-	0x61, 0x6c, 0x6c, 0x12, 0x08, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x07, 0x2e,
-	0x42, 0x69, 0x52, 0x65, 0x73, 0x70, 0x12, 0x35, 0x0a, 0x0e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69,
-	0x62, 0x75, 0x74, 0x65, 0x43, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x2e, 0x44, 0x69, 0x73, 0x74, 0x72,
-	0x69, 0x62, 0x75, 0x74, 0x65, 0x43, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x41,
-	0x64, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2d, 0x0a,
-	0x0a, 0x63, 0x6c, 0x75, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x0e, 0x2e, 0x43, 0x6c,
-	0x75, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x43, 0x6c,
-	0x75, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x27, 0x0a, 0x07,
-	0x63, 0x6c, 0x75, 0x65, 0x41, 0x64, 0x64, 0x12, 0x0b, 0x2e, 0x43, 0x6c, 0x75, 0x65, 0x41, 0x64,
-	0x64, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63,
-	0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2f, 0x0a, 0x0c, 0x63, 0x6c, 0x75, 0x65, 0x49, 0x6d, 0x70,
-	0x6f, 0x72, 0x74, 0x54, 0x74, 0x12, 0x0e, 0x2e, 0x43, 0x6c, 0x75, 0x65, 0x49, 0x6d, 0x70, 0x6f,
-	0x72, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x43, 0x6c, 0x75, 0x65, 0x49, 0x6d, 0x70, 0x6f,
-	0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x27, 0x0a, 0x0a, 0x61, 0x75, 0x74, 0x6f, 0x46, 0x6f,
-	0x6c, 0x6c, 0x6f, 0x77, 0x12, 0x08, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x0f,
-	0x2e, 0x43, 0x6c, 0x75, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12,
-	0x24, 0x0a, 0x09, 0x73, 0x71, 0x6c, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x12, 0x0d, 0x2e, 0x53,
-	0x71, 0x6c, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x08, 0x2e, 0x42, 0x69,
-	0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1e, 0x0a, 0x06, 0x6d, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12,
-	0x0a, 0x2e, 0x4d, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x08, 0x2e, 0x42, 0x69,
-	0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x25, 0x0a, 0x0d, 0x61, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f,
-	0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x0a, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x52,
-	0x65, 0x71, 0x1a, 0x08, 0x2e, 0x42, 0x69, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x28, 0x0a, 0x10,
-	0x61, 0x6c, 0x6c, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74,
-	0x12, 0x0a, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x08, 0x2e, 0x42,
-	0x69, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x24, 0x0a, 0x0b, 0x69, 0x6e, 0x66, 0x6f, 0x4f, 0x70,
-	0x65, 0x72, 0x61, 0x74, 0x65, 0x12, 0x0b, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52,
-	0x65, 0x71, 0x1a, 0x08, 0x2e, 0x42, 0x69, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x42, 0x06, 0x5a, 0x04,
-	0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x74, 0x79, 0x70, 0x65, 0x22, 0x2e, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x52,
+	0x65, 0x71, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x4e, 0x61, 0x6d,
+	0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79,
+	0x4e, 0x61, 0x6d, 0x65, 0x22, 0x25, 0x0a, 0x0b, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x52,
+	0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x32, 0xb2, 0x05, 0x0a, 0x09,
+	0x42, 0x69, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x30, 0x0a, 0x0b, 0x6d, 0x79, 0x44,
+	0x61, 0x74, 0x61, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x0f, 0x2e, 0x4d, 0x79, 0x44, 0x61, 0x74,
+	0x61, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x4d, 0x79, 0x44, 0x61,
+	0x74, 0x61, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2d, 0x0a, 0x0a, 0x61,
+	0x64, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x0e, 0x2e, 0x41, 0x64, 0x64, 0x50,
+	0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x41, 0x64, 0x64, 0x50,
+	0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2b, 0x0a, 0x09, 0x67, 0x65,
+	0x74, 0x49, 0x6e, 0x66, 0x6f, 0x49, 0x64, 0x12, 0x0e, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f,
+	0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66,
+	0x6f, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x29, 0x0a, 0x08, 0x64, 0x72, 0x61, 0x77, 0x43,
+	0x6c, 0x75, 0x65, 0x12, 0x0c, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x43, 0x6c, 0x75, 0x65, 0x52, 0x65,
+	0x71, 0x1a, 0x0f, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65,
+	0x73, 0x70, 0x12, 0x19, 0x0a, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x08, 0x2e, 0x43, 0x61, 0x6c,
+	0x6c, 0x52, 0x65, 0x71, 0x1a, 0x07, 0x2e, 0x42, 0x69, 0x52, 0x65, 0x73, 0x70, 0x12, 0x35, 0x0a,
+	0x0e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x43, 0x6c, 0x75, 0x65, 0x12,
+	0x12, 0x2e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x43, 0x6c, 0x75, 0x65,
+	0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,
+	0x52, 0x65, 0x73, 0x70, 0x12, 0x2d, 0x0a, 0x0a, 0x63, 0x6c, 0x75, 0x65, 0x49, 0x6d, 0x70, 0x6f,
+	0x72, 0x74, 0x12, 0x0e, 0x2e, 0x43, 0x6c, 0x75, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52,
+	0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x43, 0x6c, 0x75, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52,
+	0x65, 0x73, 0x70, 0x12, 0x27, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x65, 0x41, 0x64, 0x64, 0x12, 0x0b,
+	0x2e, 0x43, 0x6c, 0x75, 0x65, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x41, 0x64,
+	0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2f, 0x0a, 0x0c,
+	0x63, 0x6c, 0x75, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x74, 0x12, 0x0e, 0x2e, 0x43,
+	0x6c, 0x75, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x43,
+	0x6c, 0x75, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x27, 0x0a,
+	0x0a, 0x61, 0x75, 0x74, 0x6f, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x12, 0x08, 0x2e, 0x43, 0x61,
+	0x6c, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x43, 0x6c, 0x75, 0x65, 0x49, 0x6d, 0x70, 0x6f,
+	0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x71, 0x6c, 0x4d, 0x61, 0x6e,
+	0x61, 0x67, 0x65, 0x12, 0x0d, 0x2e, 0x53, 0x71, 0x6c, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x52,
+	0x65, 0x71, 0x1a, 0x08, 0x2e, 0x42, 0x69, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1e, 0x0a, 0x06,
+	0x6d, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0a, 0x2e, 0x4d, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52,
+	0x65, 0x71, 0x1a, 0x08, 0x2e, 0x42, 0x69, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x25, 0x0a, 0x0d,
+	0x61, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x0a, 0x2e,
+	0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x08, 0x2e, 0x42, 0x69, 0x52, 0x65,
+	0x70, 0x6c, 0x79, 0x12, 0x28, 0x0a, 0x10, 0x61, 0x6c, 0x6c, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63,
+	0x74, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x0a, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74,
+	0x52, 0x65, 0x71, 0x1a, 0x08, 0x2e, 0x42, 0x69, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x24, 0x0a,
+	0x0b, 0x69, 0x6e, 0x66, 0x6f, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x65, 0x12, 0x0b, 0x2e, 0x4f,
+	0x70, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x08, 0x2e, 0x42, 0x69, 0x52, 0x65,
+	0x70, 0x6c, 0x79, 0x12, 0x2b, 0x0a, 0x0e, 0x67, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e,
+	0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x52,
+	0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x52, 0x65, 0x73, 0x70,
+	0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -1755,7 +1857,7 @@ func file_biService_proto_rawDescGZIP() []byte {
 	return file_biService_proto_rawDescData
 }
 
-var file_biService_proto_msgTypes = make([]protoimpl.MessageInfo, 22)
+var file_biService_proto_msgTypes = make([]protoimpl.MessageInfo, 24)
 var file_biService_proto_goTypes = []interface{}{
 	(*MyDataAssetReq)(nil),    // 0: MyDataAssetReq
 	(*MyDataAssetResp)(nil),   // 1: MyDataAssetResp
@@ -1779,6 +1881,8 @@ var file_biService_proto_goTypes = []interface{}{
 	(*Param)(nil),             // 19: Param
 	(*ExportReq)(nil),         // 20: ExportReq
 	(*OperateReq)(nil),        // 21: OperateReq
+	(*CompanyReq)(nil),        // 22: CompanyReq
+	(*CompanyResp)(nil),       // 23: CompanyResp
 }
 var file_biService_proto_depIdxs = []int32{
 	2,  // 0: MyDataAssetResp.data:type_name -> MyDataAsset
@@ -1801,23 +1905,25 @@ var file_biService_proto_depIdxs = []int32{
 	20, // 17: BiService.allInfoExport:input_type -> ExportReq
 	20, // 18: BiService.allProjectExport:input_type -> ExportReq
 	21, // 19: BiService.infoOperate:input_type -> OperateReq
-	1,  // 20: BiService.myDataAsset:output_type -> MyDataAssetResp
-	4,  // 21: BiService.addProject:output_type -> AddProjectResp
-	6,  // 22: BiService.getInfoId:output_type -> GetInfoIdResp
-	4,  // 23: BiService.drawClue:output_type -> AddProjectResp
-	9,  // 24: BiService.Call:output_type -> BiResp
-	4,  // 25: BiService.distributeClue:output_type -> AddProjectResp
-	14, // 26: BiService.clueImport:output_type -> ClueImportResp
-	4,  // 27: BiService.clueAdd:output_type -> AddProjectResp
-	14, // 28: BiService.clueImportTt:output_type -> ClueImportResp
-	14, // 29: BiService.autoFollow:output_type -> ClueImportResp
-	10, // 30: BiService.sqlManage:output_type -> BiReply
-	10, // 31: BiService.myInfo:output_type -> BiReply
-	10, // 32: BiService.allInfoExport:output_type -> BiReply
-	10, // 33: BiService.allProjectExport:output_type -> BiReply
-	10, // 34: BiService.infoOperate:output_type -> BiReply
-	20, // [20:35] is the sub-list for method output_type
-	5,  // [5:20] is the sub-list for method input_type
+	22, // 20: BiService.getCompanyType:input_type -> CompanyReq
+	1,  // 21: BiService.myDataAsset:output_type -> MyDataAssetResp
+	4,  // 22: BiService.addProject:output_type -> AddProjectResp
+	6,  // 23: BiService.getInfoId:output_type -> GetInfoIdResp
+	4,  // 24: BiService.drawClue:output_type -> AddProjectResp
+	9,  // 25: BiService.Call:output_type -> BiResp
+	4,  // 26: BiService.distributeClue:output_type -> AddProjectResp
+	14, // 27: BiService.clueImport:output_type -> ClueImportResp
+	4,  // 28: BiService.clueAdd:output_type -> AddProjectResp
+	14, // 29: BiService.clueImportTt:output_type -> ClueImportResp
+	14, // 30: BiService.autoFollow:output_type -> ClueImportResp
+	10, // 31: BiService.sqlManage:output_type -> BiReply
+	10, // 32: BiService.myInfo:output_type -> BiReply
+	10, // 33: BiService.allInfoExport:output_type -> BiReply
+	10, // 34: BiService.allProjectExport:output_type -> BiReply
+	10, // 35: BiService.infoOperate:output_type -> BiReply
+	23, // 36: BiService.getCompanyType:output_type -> CompanyResp
+	21, // [21:37] is the sub-list for method output_type
+	5,  // [5:21] is the sub-list for method input_type
 	5,  // [5:5] is the sub-list for extension type_name
 	5,  // [5:5] is the sub-list for extension extendee
 	0,  // [0:5] is the sub-list for field type_name
@@ -2093,6 +2199,30 @@ func file_biService_proto_init() {
 				return nil
 			}
 		}
+		file_biService_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*CompanyReq); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_biService_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*CompanyResp); 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{
@@ -2100,7 +2230,7 @@ func file_biService_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_biService_proto_rawDesc,
 			NumEnums:      0,
-			NumMessages:   22,
+			NumMessages:   24,
 			NumExtensions: 0,
 			NumServices:   1,
 		},

+ 37 - 1
rpc/pb/biService_grpc.pb.go

@@ -1,7 +1,7 @@
 // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
 // versions:
 // - protoc-gen-go-grpc v1.2.0
-// - protoc             v3.20.0--rc2
+// - protoc             v3.19.4
 // source: biService.proto
 
 package pb
@@ -37,6 +37,7 @@ type BiServiceClient interface {
 	AllInfoExport(ctx context.Context, in *ExportReq, opts ...grpc.CallOption) (*BiReply, error)
 	AllProjectExport(ctx context.Context, in *ExportReq, opts ...grpc.CallOption) (*BiReply, error)
 	InfoOperate(ctx context.Context, in *OperateReq, opts ...grpc.CallOption) (*BiReply, error)
+	GetCompanyType(ctx context.Context, in *CompanyReq, opts ...grpc.CallOption) (*CompanyResp, error)
 }
 
 type biServiceClient struct {
@@ -182,6 +183,15 @@ func (c *biServiceClient) InfoOperate(ctx context.Context, in *OperateReq, opts
 	return out, nil
 }
 
+func (c *biServiceClient) GetCompanyType(ctx context.Context, in *CompanyReq, opts ...grpc.CallOption) (*CompanyResp, error) {
+	out := new(CompanyResp)
+	err := c.cc.Invoke(ctx, "/BiService/getCompanyType", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
 // BiServiceServer is the server API for BiService service.
 // All implementations must embed UnimplementedBiServiceServer
 // for forward compatibility
@@ -201,6 +211,7 @@ type BiServiceServer interface {
 	AllInfoExport(context.Context, *ExportReq) (*BiReply, error)
 	AllProjectExport(context.Context, *ExportReq) (*BiReply, error)
 	InfoOperate(context.Context, *OperateReq) (*BiReply, error)
+	GetCompanyType(context.Context, *CompanyReq) (*CompanyResp, error)
 	mustEmbedUnimplementedBiServiceServer()
 }
 
@@ -253,6 +264,9 @@ func (UnimplementedBiServiceServer) AllProjectExport(context.Context, *ExportReq
 func (UnimplementedBiServiceServer) InfoOperate(context.Context, *OperateReq) (*BiReply, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method InfoOperate not implemented")
 }
+func (UnimplementedBiServiceServer) GetCompanyType(context.Context, *CompanyReq) (*CompanyResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method GetCompanyType not implemented")
+}
 func (UnimplementedBiServiceServer) mustEmbedUnimplementedBiServiceServer() {}
 
 // UnsafeBiServiceServer may be embedded to opt out of forward compatibility for this service.
@@ -536,6 +550,24 @@ func _BiService_InfoOperate_Handler(srv interface{}, ctx context.Context, dec fu
 	return interceptor(ctx, in, info, handler)
 }
 
+func _BiService_GetCompanyType_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(CompanyReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(BiServiceServer).GetCompanyType(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/BiService/getCompanyType",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(BiServiceServer).GetCompanyType(ctx, req.(*CompanyReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
 // BiService_ServiceDesc is the grpc.ServiceDesc for BiService service.
 // It's only intended for direct use with grpc.RegisterService,
 // and not to be introspected or modified (even as a copy)
@@ -603,6 +635,10 @@ var BiService_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "infoOperate",
 			Handler:    _BiService_InfoOperate_Handler,
 		},
+		{
+			MethodName: "getCompanyType",
+			Handler:    _BiService_GetCompanyType_Handler,
+		},
 	},
 	Streams:  []grpc.StreamDesc{},
 	Metadata: "biService.proto",

+ 43 - 0
service/company.go

@@ -0,0 +1,43 @@
+package service
+
+import (
+	"bp.jydev.jianyu360.cn/BaseService/biService/entity"
+	"bp.jydev.jianyu360.cn/BaseService/biService/rpc/biservice"
+)
+
+/*
+判断是不是集团公司
+判断在不在工商库
+return
+1集团公司 2工商库  3都是  -1都不是
+*/
+func GetCompanyType(this *biservice.CompanyReq) int {
+	status := -1
+
+	if this.CompanyName == "" {
+		return status
+	}
+
+	//是否是集团
+	isGroup := false
+	if c := entity.JyBiTidb.CountBySql(`select count(1) from group_company_name where company_name=?`, this.CompanyName); c > 0 {
+		isGroup = true
+	}
+
+	//是否在工商库
+	isCommerce := false
+	if c := entity.MgoQyxy.Count("qyxy_std", map[string]interface{}{"company_name": this.CompanyName}); c > 0 {
+		isCommerce = true
+	}
+
+	//判断
+	if isGroup && isCommerce {
+		status = 3
+	} else if isGroup {
+		status = 1
+	} else if isCommerce {
+		status = 2
+	}
+
+	return status
+}