浏览代码

Merge branch 'feature/v1.0.16' of https://jygit.jydev.jianyu360.cn/BaseService/biService into feature/v1.0.16

wangchuanjin 1 年之前
父节点
当前提交
784c9f199d

+ 18 - 0
api/biService.api

@@ -81,6 +81,15 @@ type (
 		Bid string `json:"bid,optional"`
 		Sid string `json:"sid"`
 	}
+	ExportReq {
+		Mail       string   `json:"mail"`
+		Mapping    []string `json:"mapping"`
+		PositionId int64    `header:"positionId,optional"`
+	}
+	OperateReq {
+		NewId string `json:"newId"`
+		Type  int64  `json:"type"`
+	}
 )
 
 service biService-api {
@@ -110,4 +119,13 @@ service biService-api {
 	@doc "用户身份"
 	@handler Myinfo
 	post /biService/myInfo (MyInfoReq) returns (resp)
+	@doc "项目全量导出"
+	@handler allProjectExport
+	post /biService/allProjectExport (ExportReq) returns (resp)
+	@doc "资讯全量导出"
+	@handler allInfoExport
+	post /biService/allInfoExport (ExportReq) returns (resp)
+	@doc "资讯操作"
+	@handler infoOperate
+	post /biService/infoOperate (OperateReq) returns (resp)
 }

+ 28 - 0
api/internal/handler/allinfoexporthandler.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 allInfoExportHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.ExportReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewAllInfoExportLogic(r.Context(), svcCtx)
+		resp, err := l.AllInfoExport(&req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

+ 28 - 0
api/internal/handler/allprojectexporthandler.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 allProjectExportHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.ExportReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewAllProjectExportLogic(r.Context(), svcCtx)
+		resp, err := l.AllProjectExport(&req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

+ 28 - 0
api/internal/handler/infooperatehandler.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 infoOperateHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.OperateReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewInfoOperateLogic(r.Context(), svcCtx)
+		resp, err := l.InfoOperate(&req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

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

@@ -72,6 +72,21 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 				Path:    "/biService/myInfo",
 				Handler: MyinfoHandler(serverCtx),
 			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/biService/allProjectExport",
+				Handler: allProjectExportHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/biService/allInfoExport",
+				Handler: allInfoExportHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/biService/infoOperate",
+				Handler: infoOperateHandler(serverCtx),
+			},
 		},
 	)
 }

+ 35 - 0
api/internal/logic/allinfoexportlogic.go

@@ -0,0 +1,35 @@
+package logic
+
+import (
+	"bp.jydev.jianyu360.cn/BaseService/biService/rpc/biservice"
+	"context"
+
+	"bp.jydev.jianyu360.cn/BaseService/biService/api/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/biService/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type AllInfoExportLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewAllInfoExportLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AllInfoExportLogic {
+	return &AllInfoExportLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *AllInfoExportLogic) AllInfoExport(req *types.ExportReq) (resp *types.Resp, err error) {
+	// todo: add your logic here and delete this line
+	res, err := l.svcCtx.BiServiceRpc.AllInfoExport(l.ctx, &biservice.ExportReq{
+		Mail:       req.Mail,
+		Mapping:    req.Mapping,
+		PositionId: req.PositionId,
+	})
+	return &types.Resp{Error_code: res.ErrorCode, Error_msg: res.ErrorMsg}, err
+}

+ 35 - 0
api/internal/logic/allprojectexportlogic.go

@@ -0,0 +1,35 @@
+package logic
+
+import (
+	"bp.jydev.jianyu360.cn/BaseService/biService/rpc/biservice"
+	"context"
+
+	"bp.jydev.jianyu360.cn/BaseService/biService/api/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/biService/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type AllProjectExportLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewAllProjectExportLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AllProjectExportLogic {
+	return &AllProjectExportLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *AllProjectExportLogic) AllProjectExport(req *types.ExportReq) (resp *types.Resp, err error) {
+	// todo: add your logic here and delete this line
+	res, err := l.svcCtx.BiServiceRpc.AllProjectExport(l.ctx, &biservice.ExportReq{
+		Mail:       req.Mail,
+		Mapping:    req.Mapping,
+		PositionId: req.PositionId,
+	})
+	return &types.Resp{Error_code: res.ErrorCode, Error_msg: res.ErrorMsg}, err
+}

+ 34 - 0
api/internal/logic/infooperatelogic.go

@@ -0,0 +1,34 @@
+package logic
+
+import (
+	"bp.jydev.jianyu360.cn/BaseService/biService/rpc/biservice"
+	"context"
+
+	"bp.jydev.jianyu360.cn/BaseService/biService/api/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/biService/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type InfoOperateLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewInfoOperateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *InfoOperateLogic {
+	return &InfoOperateLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *InfoOperateLogic) InfoOperate(req *types.OperateReq) (resp *types.Resp, err error) {
+	// todo: add your logic here and delete this line
+	res, err := l.svcCtx.BiServiceRpc.InfoOperate(l.ctx, &biservice.OperateReq{
+		NewId: req.NewId,
+		Type:  req.Type,
+	})
+	return &types.Resp{Error_code: res.ErrorCode, Error_msg: res.ErrorMsg, Data: res.Data}, err
+}

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

@@ -84,3 +84,14 @@ type MyInfoReq struct {
 	Bid string `json:"bid,optional"`
 	Sid string `json:"sid"`
 }
+
+type ExportReq struct {
+	Mail       string   `json:"mail"`
+	Mapping    []string `json:"mapping"`
+	PositionId int64    `header:"positionId,optional"`
+}
+
+type OperateReq struct {
+	NewId string `json:"newId"`
+	Type  int64  `json:"type"`
+}

+ 29 - 2
entity/entity.go

@@ -1,6 +1,7 @@
 package entity
 
 import (
+	"app.yhyue.com/moapp/jybase/mail"
 	"log"
 	"strings"
 
@@ -46,7 +47,12 @@ var (
 		"07": "待签署客户",
 		"08": "成交客户",
 	}
-	PublicKey = ""
+	PublicKey        = ""
+	GmailAuth        []*mail.GmailAuth
+	UpdataProjectUrl string
+	ExportDirectory  string
+	ExportUrl        string
+	ExportCount      int
 )
 
 type HlyjS struct {
@@ -62,6 +68,22 @@ type HlyjS struct {
 type Handler struct {
 }
 
+func InitMail(GmailAuthArr []struct {
+	Addr string
+	Port int
+	Pwd  string
+	User string
+}) {
+	for _, v := range GmailAuthArr {
+		mail1 := &mail.GmailAuth{
+			SmtpHost: v.Addr,
+			SmtpPort: v.Port,
+			User:     v.User,
+			Pwd:      v.Pwd,
+		}
+		GmailAuth = append(GmailAuth, mail1)
+	}
+}
 func InitMysql(n, x, y, z, s, m, a *mysql.Mysql) {
 	JyMysql = &mysql.Mysql{
 		Address:      n.Address,
@@ -202,12 +224,17 @@ func (h *Handler) HandleMessage(m *nsq.Message) error {
 	}
 	return nil
 }
+func InitConfig(directory, projectUrl, exportUrl string, count int) {
+	ExportDirectory = directory
+	UpdataProjectUrl = projectUrl
+	ExportUrl = exportUrl
+	ExportCount = count
+}
 
 // 初始化reidis
 func InitRedis(redisAddr []string) {
 	redis.InitRedisBySize(strings.Join(redisAddr, ","), 100, 30, 300)
 }
-
 func GetHlyj(appid, account, secret, tokenUrl, callUrl, integratedid string, callFlag int) {
 	Hlyj = &HlyjS{
 		Appid:        appid,

+ 13 - 6
go.mod

@@ -8,6 +8,7 @@ require (
 	github.com/gogf/gf/v2 v2.0.6
 	github.com/nsqio/go-nsq v1.1.0
 	github.com/tjfoc/gmsm v1.4.1
+	github.com/xuri/excelize/v2 v2.8.0
 	github.com/zeromicro/go-zero v1.3.5
 	google.golang.org/grpc v1.51.0
 	google.golang.org/protobuf v1.28.1
@@ -56,6 +57,7 @@ require (
 	github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
 	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
 	github.com/modern-go/reflect2 v1.0.2 // indirect
+	github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
 	github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect
 	github.com/olekukonko/tablewriter v0.0.5 // indirect
 	github.com/olivere/elastic v6.2.37+incompatible // indirect
@@ -67,11 +69,15 @@ require (
 	github.com/prometheus/client_model v0.2.0 // indirect
 	github.com/prometheus/common v0.37.0 // indirect
 	github.com/prometheus/procfs v0.8.0 // indirect
+	github.com/richardlehane/mscfb v1.0.4 // indirect
+	github.com/richardlehane/msoleps v1.0.3 // indirect
 	github.com/rivo/uniseg v0.2.0 // indirect
 	github.com/spaolacci/murmur3 v1.1.0 // indirect
 	github.com/xdg-go/pbkdf2 v1.0.0 // indirect
 	github.com/xdg-go/scram v1.1.1 // indirect
 	github.com/xdg-go/stringprep v1.0.3 // indirect
+	github.com/xuri/efp v0.0.0-20230802181842-ad255f2331ca // indirect
+	github.com/xuri/nfp v0.0.0-20230819163627-dc951e3ffe1a // indirect
 	github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
 	go.etcd.io/etcd/api/v3 v3.5.5 // indirect
 	go.etcd.io/etcd/client/pkg/v3 v3.5.5 // indirect
@@ -86,16 +92,17 @@ require (
 	go.uber.org/automaxprocs v1.5.1 // indirect
 	go.uber.org/multierr v1.8.0 // indirect
 	go.uber.org/zap v1.21.0 // indirect
-	golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect
-	golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
+	golang.org/x/crypto v0.12.0 // indirect
+	golang.org/x/net v0.14.0 // indirect
 	golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
-	golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect
-	golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 // indirect
-	golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
-	golang.org/x/text v0.4.0 // indirect
+	golang.org/x/sync v0.1.0 // indirect
+	golang.org/x/sys v0.11.0 // indirect
+	golang.org/x/term v0.11.0 // indirect
+	golang.org/x/text v0.12.0 // indirect
 	golang.org/x/time v0.0.0-20220411224347-583f2d630306 // indirect
 	google.golang.org/appengine v1.6.7 // indirect
 	google.golang.org/genproto v0.0.0-20220602131408-e326c6e8e9c8 // indirect
+	gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
 	gopkg.in/inf.v0 v0.9.1 // indirect
 	gopkg.in/yaml.v2 v2.4.0 // indirect
 	gopkg.in/yaml.v3 v3.0.1 // indirect

+ 45 - 9
go.sum

@@ -424,6 +424,8 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN
 github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
 github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
 github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
+github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
+github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
 github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe h1:iruDEfMl2E6fbMZ9s0scYfZQ84/6SPL6zC8ACM2oIL0=
 github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
 github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
@@ -512,6 +514,11 @@ github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5
 github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4=
 github.com/rabbitmq/amqp091-go v1.1.0/go.mod h1:ogQDLSOACsLPsIq0NpbtiifNZi2YOz0VTJ0kHRghqbM=
 github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
+github.com/richardlehane/mscfb v1.0.4 h1:WULscsljNPConisD5hR0+OyZjwK46Pfyr6mPu5ZawpM=
+github.com/richardlehane/mscfb v1.0.4/go.mod h1:YzVpcZg9czvAuhk9T+a3avCpcFPMUWm7gK3DypaEsUk=
+github.com/richardlehane/msoleps v1.0.1/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg=
+github.com/richardlehane/msoleps v1.0.3 h1:aznSZzrwYRl3rLKRT3gUk9am7T/mLNSnJINvN0AQoVM=
+github.com/richardlehane/msoleps v1.0.3/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg=
 github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
 github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
 github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
@@ -575,6 +582,12 @@ github.com/xdg-go/stringprep v1.0.3 h1:kdwGpVNwPFtjs98xCGkHjQtGKh86rDcRZN17QEMCO
 github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8=
 github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I=
 github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y=
+github.com/xuri/efp v0.0.0-20230802181842-ad255f2331ca h1:uvPMDVyP7PXMMioYdyPH+0O+Ta/UO1WFfNYMO3Wz0eg=
+github.com/xuri/efp v0.0.0-20230802181842-ad255f2331ca/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI=
+github.com/xuri/excelize/v2 v2.8.0 h1:Vd4Qy809fupgp1v7X+nCS/MioeQmYVVzi495UCTqB7U=
+github.com/xuri/excelize/v2 v2.8.0/go.mod h1:6iA2edBTKxKbZAa7X5bDhcCg51xdOn1Ar5sfoXRGrQg=
+github.com/xuri/nfp v0.0.0-20230819163627-dc951e3ffe1a h1:Mw2VNrNNNjDtw68VsEj2+st+oCSn4Uz7vZw6TbhcV1o=
+github.com/xuri/nfp v0.0.0-20230819163627-dc951e3ffe1a/go.mod h1:WwHg+CVyzlv/TX9xqBFXEZAuxOPxn2k1GNHwG41IIUQ=
 github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA=
 github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA=
 github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
@@ -583,6 +596,7 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
 github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
 github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
+github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
 github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA=
 github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 h1:k/gmLsJDWwWqbLCur2yWnJzwQEKRcAHXo6seXGuSwWw=
 github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA=
@@ -668,8 +682,10 @@ golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPh
 golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
 golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
 golang.org/x/crypto v0.0.0-20210920023735-84f357641f63/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
-golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d h1:sK3txAijHtOK88l68nt020reeT1ZdKLIYetKl95FzVY=
+golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
 golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
+golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk=
+golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
 golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
 golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
 golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -682,6 +698,8 @@ golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EH
 golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
 golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
 golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
+golang.org/x/image v0.11.0 h1:ds2RoQvBvYTiJkwpSFDwCcDFNX7DqjL2WsUgTNk0Ooo=
+golang.org/x/image v0.11.0/go.mod h1:bglhjqbqVuEb9e9+eNR45Jfu7D+T4Qan+NhQk8Ck2P8=
 golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
 golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
 golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
@@ -702,6 +720,8 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB
 golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
+golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
 golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -747,8 +767,11 @@ golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qx
 golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
 golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
 golang.org/x/net v0.0.0-20220531201128-c960675eff93/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
-golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0=
 golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
+golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
+golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
+golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14=
+golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -770,8 +793,9 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ
 golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f h1:Ax0t5p6N38Ga0dThY21weqDEyz2oklo4IvDkpigvkD8=
-golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
+golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -839,13 +863,19 @@ golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBc
 golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20220429233432-b5fbb4746d32/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 h1:h+EGohizhe9XlX18rfpa8k8RAc5XyaeamM+0VHRd4lc=
-golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
+golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
-golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY=
 golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
+golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
+golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
+golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0=
+golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU=
 golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -855,8 +885,10 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
 golang.org/x/text v0.3.8-0.20211105212822-18b340fc7af2/go.mod h1:EFNZuWvGYxIRUEX+K8UmCFwYmZjqcrnq15ZuVldZkZ0=
-golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
-golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
+golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
+golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
+golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc=
+golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
 golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -917,6 +949,8 @@ golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
 golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
 golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
 golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo=
+golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
+golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@@ -1019,6 +1053,7 @@ google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw
 google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
 google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
 gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
+gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc h1:2gGKlE2+asNV9m7xrywl36YYNnBG5ZQ0r/BOOxqPpmk=
 gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk=
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
@@ -1029,6 +1064,7 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EV
 gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
 gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
 gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
+gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df h1:n7WqCuqOuCbNr617RXOY0AWRXxgwEyPp2z+p0+hgMuE=
 gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df/go.mod h1:LRQQ+SO6ZHR7tOkpBDuZnXENFzX8qRjMDMyPD6BRkCw=
 gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY=
 gopkg.in/h2non/gock.v1 v1.1.2/go.mod h1:n7UGz/ckNChHiK05rDoiC4MYSunEC/lyaUm2WWaDva0=

+ 12 - 0
rpc/biService.proto

@@ -132,6 +132,15 @@ message Param {
 	string value = 1;
 	string type = 2;
 }
+message ExportReq {
+	string mail = 1;
+	repeated string mapping = 2;
+	int64 PositionId=3;
+}
+message OperateReq {
+	string newId = 1;
+	int64 type=2;
+}
 service BiService {
 	rpc myDataAsset (MyDataAssetReq) returns (MyDataAssetResp); //我的数据资产
 	rpc addProject (AddProjectReq) returns (AddProjectResp); //添加项目
@@ -145,4 +154,7 @@ service BiService {
 	rpc autoFollow (CallReq) returns (ClueImportResp);
 	rpc sqlManage (SqlManageReq) returns (Reply); //bi通用接口
 	rpc myInfo (MyInfoReq) returns (Reply); //用户身份
+	rpc allInfoExport (ExportReq) returns (Reply); //资讯全量导出
+	rpc allProjectExport (ExportReq) returns (Reply); //项目全量导出
+	rpc infoOperate (OperateReq) returns (Resp); //数据操作
 }

+ 3 - 0
rpc/biservice.go

@@ -29,12 +29,14 @@ func main() {
 	srv := server.NewBiServiceServer(ctx)
 	entity.PublicKey = c.PublicKey
 	entity.InitMysql(c.Mysql.JianYu, c.Mysql.JyDoc, c.Mysql.Bi, c.Mysql.Tidb, c.Mysql.BiTidb, c.Mysql.CallTidb, c.Mysql.BiService)
+	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.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()
 	entity.InitRedis(c.RedisAddress)
+	entity.InitConfig(c.ExportDirectory, c.UpdateProjectUrl, c.ExportUrl, c.ExportCount)
 	//合力亿捷
 	entity.GetHlyj(c.Hlyj.Appid, c.Hlyj.Account, c.Hlyj.Secret, c.Hlyj.TokenUrl, c.Hlyj.CallUrl, c.Hlyj.Integratedid, c.Hlyj.CallFlag)
 	//nsq
@@ -52,6 +54,7 @@ func main() {
 	s := zrpc.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) {
 		pb.RegisterBiServiceServer(grpcServer, srv)
 	})
+
 	defer s.Stop()
 
 	fmt.Printf("Starting rpc server at %s...\n", c.ListenOn)

+ 20 - 0
rpc/biservice/biservice.go

@@ -24,11 +24,13 @@ type (
 	DistributeClueReq = pb.DistributeClueReq
 	DistributeDatas   = pb.DistributeDatas
 	DrawClueReq       = pb.DrawClueReq
+	ExportReq         = pb.ExportReq
 	GetInfoIdResp     = pb.GetInfoIdResp
 	MyDataAsset       = pb.MyDataAsset
 	MyDataAssetReq    = pb.MyDataAssetReq
 	MyDataAssetResp   = pb.MyDataAssetResp
 	MyInfoReq         = pb.MyInfoReq
+	OperateReq        = pb.OperateReq
 	Param             = pb.Param
 	Reply             = pb.Reply
 	Resp              = pb.Resp
@@ -47,6 +49,9 @@ type (
 		AutoFollow(ctx context.Context, in *CallReq, opts ...grpc.CallOption) (*ClueImportResp, error)
 		SqlManage(ctx context.Context, in *SqlManageReq, opts ...grpc.CallOption) (*Reply, error)
 		MyInfo(ctx context.Context, in *MyInfoReq, opts ...grpc.CallOption) (*Reply, error)
+		AllInfoExport(ctx context.Context, in *ExportReq, opts ...grpc.CallOption) (*Reply, error)
+		AllProjectExport(ctx context.Context, in *ExportReq, opts ...grpc.CallOption) (*Reply, error)
+		InfoOperate(ctx context.Context, in *OperateReq, opts ...grpc.CallOption) (*Resp, error)
 	}
 
 	defaultBiService struct {
@@ -119,3 +124,18 @@ func (m *defaultBiService) MyInfo(ctx context.Context, in *MyInfoReq, opts ...gr
 	client := pb.NewBiServiceClient(m.cli.Conn())
 	return client.MyInfo(ctx, in, opts...)
 }
+
+func (m *defaultBiService) AllInfoExport(ctx context.Context, in *ExportReq, opts ...grpc.CallOption) (*Reply, error) {
+	client := pb.NewBiServiceClient(m.cli.Conn())
+	return client.AllInfoExport(ctx, in, opts...)
+}
+
+func (m *defaultBiService) AllProjectExport(ctx context.Context, in *ExportReq, opts ...grpc.CallOption) (*Reply, error) {
+	client := pb.NewBiServiceClient(m.cli.Conn())
+	return client.AllProjectExport(ctx, in, opts...)
+}
+
+func (m *defaultBiService) InfoOperate(ctx context.Context, in *OperateReq, opts ...grpc.CallOption) (*Resp, error) {
+	client := pb.NewBiServiceClient(m.cli.Conn())
+	return client.InfoOperate(ctx, in, opts...)
+}

+ 13 - 0
rpc/etc/biservice.yaml

@@ -104,3 +104,16 @@ Hlyj:
   CallUrl: https://a1.7x24cc.com/commonInte #外呼集成接口
   Integratedid: "8546"
 PublicKey: "791c521fec164e6c"
+Mail:
+  - Addr: smtp.exmail.qq.com
+    Port: 465
+    Pwd: "ue9Rg9Sf4CVtdm5a"
+    User: "public03@topnet.net.cn"
+  - Addr: smtp.exmail.qq.com
+    Port: 465
+    Pwd: "ue9Rg9Sf4CVtdm5a"
+    User: "public03@topnet.net.cn"
+UpdateProjectUrl: "https://tieta.spdata.jianyu360.com/updateProject"
+ExportDirectory: "D:/top_git_projects/biService"
+ExportUrl: "https://jybx-webtest.jydev.jianyu360.com/tietaRes"
+ExportCount: 15000

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

@@ -66,4 +66,14 @@ type Config struct {
 		Integratedid string
 	}
 	PublicKey string
+	Mail      []struct {
+		Addr string
+		Port int
+		Pwd  string
+		User string
+	}
+	UpdateProjectUrl string
+	ExportDirectory  string
+	ExportCount      int
+	ExportUrl        string
 }

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

@@ -0,0 +1,35 @@
+package logic
+
+import (
+	"bp.jydev.jianyu360.cn/BaseService/biService/service"
+	"context"
+
+	"bp.jydev.jianyu360.cn/BaseService/biService/rpc/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/biService/rpc/pb"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type AllInfoExportLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewAllInfoExportLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AllInfoExportLogic {
+	return &AllInfoExportLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+func (l *AllInfoExportLogic) AllInfoExport(in *pb.ExportReq) (*pb.Reply, error) {
+	// todo: add your logic here and delete this line
+	go (&service.ExportReq{
+		Mail:       in.Mail,
+		Mapping:    in.Mapping,
+		PositionId: in.PositionId,
+	}).AllInfoExport()
+	return &pb.Reply{}, nil
+}

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

@@ -0,0 +1,35 @@
+package logic
+
+import (
+	"bp.jydev.jianyu360.cn/BaseService/biService/service"
+	"context"
+
+	"bp.jydev.jianyu360.cn/BaseService/biService/rpc/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/biService/rpc/pb"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type AllProjectExportLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewAllProjectExportLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AllProjectExportLogic {
+	return &AllProjectExportLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+func (l *AllProjectExportLogic) AllProjectExport(in *pb.ExportReq) (*pb.Reply, error) {
+	// todo: add your logic here and delete this line
+	go (&service.ExportReq{
+		Mail:       in.Mail,
+		Mapping:    in.Mapping,
+		PositionId: in.PositionId,
+	}).AllProjectExport()
+	return &pb.Reply{}, nil
+}

+ 38 - 0
rpc/internal/logic/infooperatelogic.go

@@ -0,0 +1,38 @@
+package logic
+
+import (
+	"bp.jydev.jianyu360.cn/BaseService/biService/service"
+	"context"
+	"github.com/gogf/gf/v2/util/gconv"
+
+	"bp.jydev.jianyu360.cn/BaseService/biService/rpc/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/biService/rpc/pb"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type InfoOperateLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewInfoOperateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *InfoOperateLogic {
+	return &InfoOperateLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+func (l *InfoOperateLogic) InfoOperate(in *pb.OperateReq) (*pb.Resp, error) {
+	// todo: add your logic here and delete this line
+	fool := (&service.Operate{
+		OperateType: in.Type,
+		NewId:       in.NewId,
+	}).InfoOperate()
+	return &pb.Resp{
+		ErrorCode: gconv.Int64(!fool),
+		ErrorMsg:  "",
+	}, nil
+}

+ 15 - 0
rpc/internal/server/biserviceserver.go

@@ -81,3 +81,18 @@ func (s *BiServiceServer) MyInfo(ctx context.Context, in *pb.MyInfoReq) (*pb.Rep
 	l := logic.NewMyInfoLogic(ctx, s.svcCtx)
 	return l.MyInfo(in)
 }
+
+func (s *BiServiceServer) AllInfoExport(ctx context.Context, in *pb.ExportReq) (*pb.Reply, error) {
+	l := logic.NewAllInfoExportLogic(ctx, s.svcCtx)
+	return l.AllInfoExport(in)
+}
+
+func (s *BiServiceServer) AllProjectExport(ctx context.Context, in *pb.ExportReq) (*pb.Reply, error) {
+	l := logic.NewAllProjectExportLogic(ctx, s.svcCtx)
+	return l.AllProjectExport(in)
+}
+
+func (s *BiServiceServer) InfoOperate(ctx context.Context, in *pb.OperateReq) (*pb.Resp, error) {
+	l := logic.NewInfoOperateLogic(ctx, s.svcCtx)
+	return l.InfoOperate(in)
+}

+ 217 - 51
rpc/pb/biService.pb.go

@@ -1408,6 +1408,124 @@ func (x *Param) GetType() string {
 	return ""
 }
 
+type ExportReq struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Mail       string   `protobuf:"bytes,1,opt,name=mail,proto3" json:"mail,omitempty"`
+	Mapping    []string `protobuf:"bytes,2,rep,name=mapping,proto3" json:"mapping,omitempty"`
+	PositionId int64    `protobuf:"varint,3,opt,name=PositionId,proto3" json:"PositionId,omitempty"`
+}
+
+func (x *ExportReq) Reset() {
+	*x = ExportReq{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_biService_proto_msgTypes[20]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *ExportReq) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ExportReq) ProtoMessage() {}
+
+func (x *ExportReq) ProtoReflect() protoreflect.Message {
+	mi := &file_biService_proto_msgTypes[20]
+	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 ExportReq.ProtoReflect.Descriptor instead.
+func (*ExportReq) Descriptor() ([]byte, []int) {
+	return file_biService_proto_rawDescGZIP(), []int{20}
+}
+
+func (x *ExportReq) GetMail() string {
+	if x != nil {
+		return x.Mail
+	}
+	return ""
+}
+
+func (x *ExportReq) GetMapping() []string {
+	if x != nil {
+		return x.Mapping
+	}
+	return nil
+}
+
+func (x *ExportReq) GetPositionId() int64 {
+	if x != nil {
+		return x.PositionId
+	}
+	return 0
+}
+
+type OperateReq struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	NewId string `protobuf:"bytes,1,opt,name=newId,proto3" json:"newId,omitempty"`
+	Type  int64  `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"`
+}
+
+func (x *OperateReq) Reset() {
+	*x = OperateReq{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_biService_proto_msgTypes[21]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *OperateReq) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*OperateReq) ProtoMessage() {}
+
+func (x *OperateReq) ProtoReflect() protoreflect.Message {
+	mi := &file_biService_proto_msgTypes[21]
+	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 OperateReq.ProtoReflect.Descriptor instead.
+func (*OperateReq) Descriptor() ([]byte, []int) {
+	return file_biService_proto_rawDescGZIP(), []int{21}
+}
+
+func (x *OperateReq) GetNewId() string {
+	if x != nil {
+		return x.NewId
+	}
+	return ""
+}
+
+func (x *OperateReq) GetType() int64 {
+	if x != nil {
+		return x.Type
+	}
+	return 0
+}
+
 var File_biService_proto protoreflect.FileDescriptor
 
 var file_biService_proto_rawDesc = []byte{
@@ -1571,41 +1689,57 @@ var file_biService_proto_rawDesc = []byte{
 	0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x69, 0x64, 0x22, 0x31, 0x0a, 0x05, 0x50, 0x61,
 	0x72, 0x61, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01,
 	0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70,
-	0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x32, 0x88, 0x04,
-	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, 0x17, 0x0a, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x08, 0x2e, 0x43,
-	0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x05, 0x2e, 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, 0x22, 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, 0x06, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1c, 0x0a, 0x06, 0x6d, 0x79,
-	0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0a, 0x2e, 0x4d, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71,
-	0x1a, 0x06, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62,
-	0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x59, 0x0a,
+	0x09, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61,
+	0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x18,
+	0x0a, 0x07, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52,
+	0x07, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x1e, 0x0a, 0x0a, 0x50, 0x6f, 0x73, 0x69,
+	0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x50, 0x6f,
+	0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x36, 0x0a, 0x0a, 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, 0xf8, 0x04, 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, 0x17, 0x0a, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x12,
+	0x08, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x05, 0x2e, 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, 0x22, 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, 0x06, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1c, 0x0a,
+	0x06, 0x6d, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0a, 0x2e, 0x4d, 0x79, 0x49, 0x6e, 0x66, 0x6f,
+	0x52, 0x65, 0x71, 0x1a, 0x06, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x23, 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, 0x06, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x79,
+	0x12, 0x26, 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, 0x06, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x21, 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, 0x05, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e,
+	0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -1620,7 +1754,7 @@ func file_biService_proto_rawDescGZIP() []byte {
 	return file_biService_proto_rawDescData
 }
 
-var file_biService_proto_msgTypes = make([]protoimpl.MessageInfo, 20)
+var file_biService_proto_msgTypes = make([]protoimpl.MessageInfo, 22)
 var file_biService_proto_goTypes = []interface{}{
 	(*MyDataAssetReq)(nil),    // 0: MyDataAssetReq
 	(*MyDataAssetResp)(nil),   // 1: MyDataAssetResp
@@ -1642,6 +1776,8 @@ var file_biService_proto_goTypes = []interface{}{
 	(*SqlManageReq)(nil),      // 17: SqlManageReq
 	(*MyInfoReq)(nil),         // 18: MyInfoReq
 	(*Param)(nil),             // 19: Param
+	(*ExportReq)(nil),         // 20: ExportReq
+	(*OperateReq)(nil),        // 21: OperateReq
 }
 var file_biService_proto_depIdxs = []int32{
 	2,  // 0: MyDataAssetResp.data:type_name -> MyDataAsset
@@ -1661,20 +1797,26 @@ var file_biService_proto_depIdxs = []int32{
 	8,  // 14: BiService.autoFollow:input_type -> CallReq
 	17, // 15: BiService.sqlManage:input_type -> SqlManageReq
 	18, // 16: BiService.myInfo:input_type -> MyInfoReq
-	1,  // 17: BiService.myDataAsset:output_type -> MyDataAssetResp
-	4,  // 18: BiService.addProject:output_type -> AddProjectResp
-	6,  // 19: BiService.getInfoId:output_type -> GetInfoIdResp
-	4,  // 20: BiService.drawClue:output_type -> AddProjectResp
-	9,  // 21: BiService.Call:output_type -> Resp
-	4,  // 22: BiService.distributeClue:output_type -> AddProjectResp
-	14, // 23: BiService.clueImport:output_type -> ClueImportResp
-	4,  // 24: BiService.clueAdd:output_type -> AddProjectResp
-	14, // 25: BiService.clueImportTt:output_type -> ClueImportResp
-	14, // 26: BiService.autoFollow:output_type -> ClueImportResp
-	10, // 27: BiService.sqlManage:output_type -> Reply
-	10, // 28: BiService.myInfo:output_type -> Reply
-	17, // [17:29] is the sub-list for method output_type
-	5,  // [5:17] is the sub-list for method input_type
+	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 -> Resp
+	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 -> Reply
+	10, // 31: BiService.myInfo:output_type -> Reply
+	10, // 32: BiService.allInfoExport:output_type -> Reply
+	10, // 33: BiService.allProjectExport:output_type -> Reply
+	9,  // 34: BiService.infoOperate:output_type -> Resp
+	20, // [20:35] is the sub-list for method output_type
+	5,  // [5:20] 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
@@ -1926,6 +2068,30 @@ func file_biService_proto_init() {
 				return nil
 			}
 		}
+		file_biService_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*ExportReq); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_biService_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*OperateReq); 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{
@@ -1933,7 +2099,7 @@ func file_biService_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_biService_proto_rawDesc,
 			NumEnums:      0,
-			NumMessages:   20,
+			NumMessages:   22,
 			NumExtensions: 0,
 			NumServices:   1,
 		},

+ 123 - 12
rpc/pb/biService_grpc.pb.go

@@ -19,18 +19,21 @@ import (
 const _ = grpc.SupportPackageIsVersion7
 
 const (
-	BiService_MyDataAsset_FullMethodName    = "/BiService/myDataAsset"
-	BiService_AddProject_FullMethodName     = "/BiService/addProject"
-	BiService_GetInfoId_FullMethodName      = "/BiService/getInfoId"
-	BiService_DrawClue_FullMethodName       = "/BiService/drawClue"
-	BiService_Call_FullMethodName           = "/BiService/Call"
-	BiService_DistributeClue_FullMethodName = "/BiService/distributeClue"
-	BiService_ClueImport_FullMethodName     = "/BiService/clueImport"
-	BiService_ClueAdd_FullMethodName        = "/BiService/clueAdd"
-	BiService_ClueImportTt_FullMethodName   = "/BiService/clueImportTt"
-	BiService_AutoFollow_FullMethodName     = "/BiService/autoFollow"
-	BiService_SqlManage_FullMethodName      = "/BiService/sqlManage"
-	BiService_MyInfo_FullMethodName         = "/BiService/myInfo"
+	BiService_MyDataAsset_FullMethodName      = "/BiService/myDataAsset"
+	BiService_AddProject_FullMethodName       = "/BiService/addProject"
+	BiService_GetInfoId_FullMethodName        = "/BiService/getInfoId"
+	BiService_DrawClue_FullMethodName         = "/BiService/drawClue"
+	BiService_Call_FullMethodName             = "/BiService/Call"
+	BiService_DistributeClue_FullMethodName   = "/BiService/distributeClue"
+	BiService_ClueImport_FullMethodName       = "/BiService/clueImport"
+	BiService_ClueAdd_FullMethodName          = "/BiService/clueAdd"
+	BiService_ClueImportTt_FullMethodName     = "/BiService/clueImportTt"
+	BiService_AutoFollow_FullMethodName       = "/BiService/autoFollow"
+	BiService_SqlManage_FullMethodName        = "/BiService/sqlManage"
+	BiService_MyInfo_FullMethodName           = "/BiService/myInfo"
+	BiService_AllInfoExport_FullMethodName    = "/BiService/allInfoExport"
+	BiService_AllProjectExport_FullMethodName = "/BiService/allProjectExport"
+	BiService_InfoOperate_FullMethodName      = "/BiService/infoOperate"
 )
 
 // BiServiceClient is the client API for BiService service.
@@ -49,6 +52,9 @@ type BiServiceClient interface {
 	AutoFollow(ctx context.Context, in *CallReq, opts ...grpc.CallOption) (*ClueImportResp, error)
 	SqlManage(ctx context.Context, in *SqlManageReq, opts ...grpc.CallOption) (*Reply, error)
 	MyInfo(ctx context.Context, in *MyInfoReq, opts ...grpc.CallOption) (*Reply, error)
+	AllInfoExport(ctx context.Context, in *ExportReq, opts ...grpc.CallOption) (*Reply, error)
+	AllProjectExport(ctx context.Context, in *ExportReq, opts ...grpc.CallOption) (*Reply, error)
+	InfoOperate(ctx context.Context, in *OperateReq, opts ...grpc.CallOption) (*Resp, error)
 }
 
 type biServiceClient struct {
@@ -167,6 +173,33 @@ func (c *biServiceClient) MyInfo(ctx context.Context, in *MyInfoReq, opts ...grp
 	return out, nil
 }
 
+func (c *biServiceClient) AllInfoExport(ctx context.Context, in *ExportReq, opts ...grpc.CallOption) (*Reply, error) {
+	out := new(Reply)
+	err := c.cc.Invoke(ctx, BiService_AllInfoExport_FullMethodName, in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *biServiceClient) AllProjectExport(ctx context.Context, in *ExportReq, opts ...grpc.CallOption) (*Reply, error) {
+	out := new(Reply)
+	err := c.cc.Invoke(ctx, BiService_AllProjectExport_FullMethodName, in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *biServiceClient) InfoOperate(ctx context.Context, in *OperateReq, opts ...grpc.CallOption) (*Resp, error) {
+	out := new(Resp)
+	err := c.cc.Invoke(ctx, BiService_InfoOperate_FullMethodName, 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
@@ -183,6 +216,9 @@ type BiServiceServer interface {
 	AutoFollow(context.Context, *CallReq) (*ClueImportResp, error)
 	SqlManage(context.Context, *SqlManageReq) (*Reply, error)
 	MyInfo(context.Context, *MyInfoReq) (*Reply, error)
+	AllInfoExport(context.Context, *ExportReq) (*Reply, error)
+	AllProjectExport(context.Context, *ExportReq) (*Reply, error)
+	InfoOperate(context.Context, *OperateReq) (*Resp, error)
 	mustEmbedUnimplementedBiServiceServer()
 }
 
@@ -226,6 +262,15 @@ func (UnimplementedBiServiceServer) SqlManage(context.Context, *SqlManageReq) (*
 func (UnimplementedBiServiceServer) MyInfo(context.Context, *MyInfoReq) (*Reply, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method MyInfo not implemented")
 }
+func (UnimplementedBiServiceServer) AllInfoExport(context.Context, *ExportReq) (*Reply, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method AllInfoExport not implemented")
+}
+func (UnimplementedBiServiceServer) AllProjectExport(context.Context, *ExportReq) (*Reply, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method AllProjectExport not implemented")
+}
+func (UnimplementedBiServiceServer) InfoOperate(context.Context, *OperateReq) (*Resp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method InfoOperate not implemented")
+}
 func (UnimplementedBiServiceServer) mustEmbedUnimplementedBiServiceServer() {}
 
 // UnsafeBiServiceServer may be embedded to opt out of forward compatibility for this service.
@@ -455,6 +500,60 @@ func _BiService_MyInfo_Handler(srv interface{}, ctx context.Context, dec func(in
 	return interceptor(ctx, in, info, handler)
 }
 
+func _BiService_AllInfoExport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(ExportReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(BiServiceServer).AllInfoExport(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: BiService_AllInfoExport_FullMethodName,
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(BiServiceServer).AllInfoExport(ctx, req.(*ExportReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _BiService_AllProjectExport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(ExportReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(BiServiceServer).AllProjectExport(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: BiService_AllProjectExport_FullMethodName,
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(BiServiceServer).AllProjectExport(ctx, req.(*ExportReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _BiService_InfoOperate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(OperateReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(BiServiceServer).InfoOperate(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: BiService_InfoOperate_FullMethodName,
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(BiServiceServer).InfoOperate(ctx, req.(*OperateReq))
+	}
+	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)
@@ -510,6 +609,18 @@ var BiService_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "myInfo",
 			Handler:    _BiService_MyInfo_Handler,
 		},
+		{
+			MethodName: "allInfoExport",
+			Handler:    _BiService_AllInfoExport_Handler,
+		},
+		{
+			MethodName: "allProjectExport",
+			Handler:    _BiService_AllProjectExport_Handler,
+		},
+		{
+			MethodName: "infoOperate",
+			Handler:    _BiService_InfoOperate_Handler,
+		},
 	},
 	Streams:  []grpc.StreamDesc{},
 	Metadata: "biService.proto",

+ 2 - 24
service/clue.go

@@ -1,7 +1,6 @@
 package service
 
 import (
-	"bytes"
 	"context"
 	"database/sql"
 	"encoding/json"
@@ -114,7 +113,7 @@ func ClueImportTtSync(this *biservice.ClueImportReq) (string, int) {
 	}
 }
 
-//根据id重新生成es
+// 根据id重新生成es
 func CreateEsById(newId string) bool {
 	data := BiService.FindOne("customer_data_ttzl", map[string]interface{}{"id_new": newId}, "", "")
 	if data == nil || len(*data) == 0 {
@@ -125,7 +124,7 @@ func CreateEsById(newId string) bool {
 	return ok
 }
 
-//重新生成es
+// 重新生成es
 func CreateEs(v map[string]interface{}) (string, bool) {
 	details := ""
 	biddingData, ok := Bidding.FindOne("bidding", map[string]interface{}{"_id": mongodb.StringTOBsonId(common.ObjToString(v["id"]))})
@@ -1148,24 +1147,3 @@ func doGet(url string) ([]byte, error) {
 	log.Println(url, "调用结果 ", string(bs))
 	return bs, nil
 }
-
-func doPost(url string, body []byte) ([]byte, error) {
-	req, err := http.NewRequest("POST", url, bytes.NewReader(body))
-	if err != nil {
-		return nil, err
-	}
-	req.Header.Add("Content-Type", "application/json;charset=utf-8")
-	resp, err := http.DefaultClient.Do(req)
-	if err != nil {
-		return nil, err
-	}
-	bs, err := ioutil.ReadAll(resp.Body)
-	if err != nil {
-		return nil, err
-	}
-	defer func() {
-		_ = resp.Body.Close()
-	}()
-	log.Println(url, "调用结果 ", string(bs))
-	return bs, nil
-}

+ 238 - 0
service/exprot.go

@@ -0,0 +1,238 @@
+package service
+
+import (
+	"app.yhyue.com/moapp/jybase/mail"
+	"archive/zip"
+	. "bp.jydev.jianyu360.cn/BaseService/biService/entity"
+	"fmt"
+	"github.com/gogf/gf/v2/util/gconv"
+	"github.com/xuri/excelize/v2"
+	"io"
+	"log"
+	"math/rand"
+	"os"
+	"path/filepath"
+	"strings"
+	"time"
+)
+
+var (
+	DateTime = "2006-01-02 15:04:05"
+)
+
+type ExportReq struct {
+	Mail       string
+	Mapping    []string
+	PositionId int64
+}
+
+// 全量项目导出
+func (a *ExportReq) AllProjectExport() {
+	tableColumn := []string{}
+	exportKey := []interface{}{}
+	for _, value := range a.Mapping {
+		valueArr := strings.Split(value, ":")
+		tableColumn = append(tableColumn, valueArr[0])
+		exportKey = append(exportKey, valueArr[1])
+	}
+	timeStr := time.Now().Format("20060102150405")
+	rand.Seed(time.Now().UnixNano())
+	randomInt := rand.Intn(10000) // 生成0到9999之间的随机整数
+	timeStr = fmt.Sprintf("%s%s", timeStr, gconv.String(randomInt))
+	pathArr := export("customer_data_ttzl_project", tableColumn, exportKey, timeStr)
+	if len(pathArr) > 0 {
+		pathstr := compressFiles(pathArr, timeStr)
+		state := sendMail("项目", a.Mail, pathstr)
+		BiService.Insert("export_record", map[string]interface{}{
+			"positionId": a.PositionId,
+			"type":       "project",
+			"excelPath":  strings.Join(pathArr, ","),
+			"zipPath":    pathstr,
+			"sendState":  state,
+			"createTime": time.Now().Format(DateTime),
+		})
+	}
+}
+
+// 全量资讯导出
+func (a *ExportReq) AllInfoExport() {
+	tableColumn := []string{}
+	exportKey := []interface{}{}
+	for _, value := range a.Mapping {
+		valueArr := strings.Split(value, ":")
+		tableColumn = append(tableColumn, valueArr[0])
+		exportKey = append(exportKey, valueArr[1])
+	}
+	timeStr := time.Now().Format("20060102150405")
+	rand.Seed(time.Now().UnixNano())
+	randomInt := rand.Intn(10000) // 生成0到9999之间的随机整数
+	timeStr = fmt.Sprintf("%s%s", timeStr, gconv.String(randomInt))
+	pathArr := export("customer_data_ttzl", tableColumn, exportKey, timeStr)
+	if len(pathArr) > 0 {
+		pathstr := compressFiles(pathArr, timeStr)
+		state := sendMail("标讯", a.Mail, pathstr)
+		BiService.Insert("export_record", map[string]interface{}{
+			"positionId": a.PositionId,
+			"type":       "project",
+			"excelPath":  strings.Join(pathArr, ","),
+			"zipPath":    pathstr,
+			"sendState":  state,
+			"createTime": time.Now().Format(DateTime),
+		})
+	}
+}
+
+// 导出开始
+func export(table string, tableColumn []string, key []interface{}, timeStr string) []string {
+	pathArr := []string{}
+	sqlStr := fmt.Sprintf("SELECT %s FROM %s", strings.Join(tableColumn, ","), table)
+	fileCounter := 1
+	writer, file := InirWrite(key)
+	a := 0
+	path := ""
+	BiService.SelectByBath(1, func(l *[]map[string]interface{}) bool {
+		if a%ExportCount == 0 && a > 0 {
+			a = 0
+			//入excel处理
+			writer, file, path = Warehousing(writer, file, fileCounter, key, timeStr)
+			fileCounter++
+			pathArr = append(pathArr, path)
+		}
+		dataHandle(writer, l, a, tableColumn)
+		a++
+		return true
+	}, sqlStr)
+	if a > 0 && a != ExportCount {
+		writer, file, path = Warehousing(writer, file, fileCounter, key, timeStr)
+		pathArr = append(pathArr, path)
+	}
+	return pathArr
+}
+
+// 数据处理
+func dataHandle(writer *excelize.StreamWriter, l *[]map[string]interface{}, a int, tableColumn []string) {
+	for _, value := range *l {
+		valueArr := []interface{}{}
+		for _, column := range tableColumn {
+			valueArr = append(valueArr, gconv.String(value[column]))
+		}
+		cell, _ := excelize.CoordinatesToCellName(1, a+1)
+		writer.SetRow(cell, valueArr)
+	}
+}
+
+// 入excel
+func Warehousing(writer *excelize.StreamWriter, file *excelize.File, fileCounter int, key []interface{}, timeStr string) (*excelize.StreamWriter, *excelize.File, string) {
+	log.Println(fmt.Sprintf("开始第%d数据", fileCounter))
+	writer.Flush()
+	folderPath := fmt.Sprintf("%s/%s", ExportDirectory, timeStr)
+	_, err := os.Stat(folderPath)
+	if os.IsNotExist(err) {
+		//创建文件夹
+		err := os.MkdirAll(folderPath, os.ModePerm)
+		if err != nil {
+			log.Println("创建文件夹失败:", err)
+		}
+	}
+	fileName := fmt.Sprintf("%s/output%d.xlsx", folderPath, fileCounter)
+	err = file.SaveAs(fileName)
+	if err != nil {
+		log.Println(err)
+	}
+	writer, file = InirWrite(key)
+	return writer, file, fileName
+}
+
+// excel初始化
+func InirWrite(key []interface{}) (*excelize.StreamWriter, *excelize.File) {
+	//文件初始化
+	file := excelize.NewFile()
+	//设置表名
+	file.SetSheetName("Sheet1", "表1")
+	//创建流式写入
+	writer, _ := file.NewStreamWriter("表1")
+	// 定义每个 Excel 文件的数据行数限制
+	writer.SetRow("A1", key)
+	return writer, file
+}
+
+// 发送邮箱
+func sendMail(title, target_mail string, path string) bool {
+	mailStr := "<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <title>铁塔全量%s数据导出</title>\n</head>\n<body>\n<div>\n    <p>铁塔全量%s数据已导出成功,导出时间:%s,请点击链接下载数据:<a href=\"%s\">%s</a></p>\n  </div>\n</body>"
+	html := fmt.Sprintf(mailStr, title, title, time.Now().Format(DateTime), path, path)
+	fool := false
+	for k, v := range GmailAuth {
+		fool := mail.GSendMail("剑鱼标讯", target_mail, "", "", fmt.Sprintf("铁塔全量%s数据导出", title), html, "", "", v)
+		if fool {
+			log.Println(target_mail, fmt.Sprintf("使用%s发送邮件成功", v.User))
+			break
+		}
+		if k < len(GmailAuth)-1 {
+			log.Println(target_mail, fmt.Sprintf("使用%s发送邮件失败!3s后使用其他邮箱尝试", v.User))
+		} else {
+			log.Println(target_mail, fmt.Sprintf("使用%s发送邮件失败!", v.User))
+		}
+		time.Sleep(time.Second * 3)
+	}
+	return fool
+}
+
+// 文件压缩
+func compressFiles(filePattern []string, timeStr string) string {
+	folderPath := fmt.Sprintf("%s/%s", ExportDirectory, timeStr)
+	_, err := os.Stat(folderPath)
+	if os.IsNotExist(err) {
+		//创建文件夹
+		err := os.MkdirAll(folderPath, os.ModePerm)
+		if err != nil {
+			log.Println("创建文件夹失败:", err)
+		}
+	}
+	zipFilename := fmt.Sprintf("%s/%s.zip", folderPath, timeStr)
+	// 创建 ZIP 文件
+	zipFile, err := os.Create(zipFilename)
+	if err != nil {
+		log.Fatal(err)
+	}
+	defer zipFile.Close()
+
+	// 创建 ZIP Writer
+	zipWriter := zip.NewWriter(zipFile)
+	defer zipWriter.Close()
+
+	// 遍历文件列表
+	for _, file := range filePattern {
+		// 打开文件
+		f, err := os.Open(file)
+		if err != nil {
+			log.Fatal(err)
+		}
+		defer f.Close()
+		// 获取文件信息
+		_, err = f.Stat()
+		if err != nil {
+			log.Fatal(err)
+		}
+		//文件名切割
+		nameArr := strings.Split(file, "/")
+		name := nameArr[len(nameArr)-1]
+		name = fmt.Sprintf("%s/%s", timeStr, name)
+		// 创建 ZIP 内部文件
+		zipFile, err := zipWriter.Create(name)
+		if err != nil {
+			log.Fatal(err)
+		}
+		// 将文件内容复制到 ZIP 文件中
+		_, err = io.Copy(zipFile, f)
+		if err != nil {
+			log.Fatal(err)
+		}
+	}
+	// 打印压缩文件路径
+	absPath, err := filepath.Abs(zipFilename)
+	if err != nil {
+		log.Fatal(err)
+	}
+	log.Printf("Files compressed to: %s", absPath)
+	return fmt.Sprintf("%s/%s/%s.zip", ExportUrl, timeStr, timeStr)
+}

+ 74 - 0
service/operate.go

@@ -0,0 +1,74 @@
+package service
+
+import (
+	. "bp.jydev.jianyu360.cn/BaseService/biService/entity"
+	"bytes"
+	"encoding/json"
+	"io/ioutil"
+	"log"
+	"net/http"
+)
+
+type Operate struct {
+	NewId       string
+	OperateType int64
+}
+
+func (a *Operate) InfoOperate() bool {
+	//数据查询
+	data := BiService.FindOne("customer_data_ttzl", map[string]interface{}{"id_new": a.NewId}, "", "")
+	if data == nil || len(*data) == 0 {
+		log.Println("没有找到该数据", a.NewId)
+		return false
+	}
+	sendParam := map[string]interface{}{
+		"type": a.OperateType,
+	}
+	if a.OperateType == 0 {
+		//修改
+		_, ok := CreateEs(*data)
+		if !ok {
+			return false
+		}
+		sendParam["nid"] = a.NewId
+	} else {
+		//删除
+		//清除mysql数据
+		if BiService.Delete("customer_data_ttzl", map[string]interface{}{"id_new": a.NewId}) {
+			//清除es数据
+			Es.DelById("ttbid", "ttbid", a.NewId)
+		} else {
+			return false
+		}
+		projectId := (*data)["projectId"]
+		if projectId == "" {
+			return true
+		}
+		sendParam["nid"] = projectId
+	}
+	marshalData, _ := json.Marshal(sendParam)
+	DoPost(UpdataProjectUrl, marshalData)
+	return true
+
+}
+
+func DoPost(url string, body []byte) ([]byte, error) {
+	req, err := http.NewRequest("POST", url, bytes.NewReader(body))
+	if err != nil {
+		return nil, err
+	}
+	req.Header.Add("Content-Type", "application/json;charset=utf-8")
+	resp, err := http.DefaultClient.Do(req)
+	if err != nil {
+		return nil, err
+	}
+	bs, err := ioutil.ReadAll(resp.Body)
+	if err != nil {
+		return nil, err
+	}
+	defer func() {
+		_ = resp.Body.Close()
+	}()
+	log.Println(url, "调用结果 ", string(bs))
+	return bs, nil
+}