浏览代码

增加企业员工姓名 session

xuzhiheng 2 年之前
父节点
当前提交
3573e110e1

+ 1 - 0
api/biService.api

@@ -23,6 +23,7 @@ type (
 		UserName     string `header:"userName,optional"`
 		UserId       int64  `header:"newUserId,optional"`
 		EntId        int64  `header:"entId,optional"`
+		EntUserName  string `header:"entUserName,optional"`
 	}
 
 	getInfoIdReq {

+ 1 - 0
api/internal/logic/addprojectreqlogic.go

@@ -35,6 +35,7 @@ func (l *AddProjectReqLogic) AddProjectReq(req types.AddProjectReq) (*types.Resp
 		UserId:       req.UserId,
 		UserName:     req.UserName,
 		EntId:        req.EntId,
+		EntUserName:  req.EntUserName,
 	})
 	return &types.Resp{Error_code: res.ErrorCode, Error_msg: res.ErrorMsg, Data: res.Data}, err
 }

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

@@ -23,6 +23,7 @@ type AddProjectReq struct {
 	UserName     string `header:"userName,optional"`
 	UserId       int64  `header:"newUserId,optional"`
 	EntId        int64  `header:"entId,optional"`
+	EntUserName  string `header:"entUserName,optional"`
 }
 
 type GetInfoIdReq struct {

+ 7 - 2
entity/entity.go

@@ -109,7 +109,7 @@ func InitArea() {
 func (h *Handler) HandleMessage(m *nsq.Message) error {
 	defer util.Catch()
 	if len(m.Body) == 0 {
-		// Returning nil will automatically send a FIN command to NSQ to mark the message as processed.
+		log.Println("Nsq接收到空")
 		return nil
 	}
 	var msg *map[string]interface{}
@@ -121,8 +121,13 @@ func (h *Handler) HandleMessage(m *nsq.Message) error {
 	entPostionId := util.Int64All((*msg)["entPostionId"])
 	userPositionId := util.Int64All((*msg)["userPositionId"])
 	entId := util.Int64All((*msg)["entId"])
+	entUserName := util.ObjToString((*msg)["entUserName"])
 	log.Println(userPositionId, entPostionId, entId)
-	ok := JyBiMysql.Update("dwd_f_report_data_baseinfo", map[string]interface{}{"position_id": userPositionId}, map[string]interface{}{"position_id": entPostionId, "ent_id": entId, "position_type": 1})
+	if userPositionId == 0 || entPostionId == 0 {
+		log.Println("职位id为空")
+		return nil
+	}
+	ok := JyBiMysql.Update("dwd_f_report_data_baseinfo", map[string]interface{}{"position_id": userPositionId}, map[string]interface{}{"position_id": entPostionId, "ent_id": entId, "position_type": 1, "user_name": entUserName})
 	if ok {
 		log.Println("个人销售数据同步企业数据成功!!!")
 	} else {

+ 1 - 0
rpc/biService.proto

@@ -32,6 +32,7 @@ message AddProjectReq {
 	string user_name = 7;
 	int64 userId = 8;
 	int64 entId = 9;
+	string entUserName = 10;
 }
 
 message AddProjectResp {

+ 3 - 3
rpc/biservice/biservice.go

@@ -14,13 +14,13 @@ import (
 )
 
 type (
-	AddProjectResp  = pb.AddProjectResp
-	AddProject      = pb.AddProject
-	GetInfoIdResp   = pb.GetInfoIdResp
 	MyDataAssetReq  = pb.MyDataAssetReq
 	MyDataAssetResp = pb.MyDataAssetResp
 	MyDataAsset     = pb.MyDataAsset
 	AddProjectReq   = pb.AddProjectReq
+	AddProjectResp  = pb.AddProjectResp
+	AddProject      = pb.AddProject
+	GetInfoIdResp   = pb.GetInfoIdResp
 
 	BiService interface {
 		MyDataAsset(ctx context.Context, in *MyDataAssetReq) (*MyDataAssetResp, error)

+ 38 - 28
rpc/pb/biService.pb.go

@@ -248,6 +248,7 @@ type AddProjectReq struct {
 	UserName     string `protobuf:"bytes,7,opt,name=user_name,json=userName,proto3" json:"user_name,omitempty"`
 	UserId       int64  `protobuf:"varint,8,opt,name=userId,proto3" json:"userId,omitempty"`
 	EntId        int64  `protobuf:"varint,9,opt,name=entId,proto3" json:"entId,omitempty"`
+	EntUserName  string `protobuf:"bytes,10,opt,name=entUserName,proto3" json:"entUserName,omitempty"`
 }
 
 func (x *AddProjectReq) Reset() {
@@ -345,6 +346,13 @@ func (x *AddProjectReq) GetEntId() int64 {
 	return 0
 }
 
+func (x *AddProjectReq) GetEntUserName() string {
+	if x != nil {
+		return x.EntUserName
+	}
+	return ""
+}
+
 type AddProjectResp struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -550,7 +558,7 @@ var file_biService_proto_rawDesc = []byte{
 	0x28, 0x03, 0x52, 0x12, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65,
 	0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f,
 	0x6e, 0x7a, 0x6a, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52,
-	0x0d, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x4e, 0x7a, 0x6a, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x93,
+	0x0d, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x4e, 0x7a, 0x6a, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xb5,
 	0x02, 0x0a, 0x0d, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71,
 	0x12, 0x17, 0x0a, 0x07, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
 	0x09, 0x52, 0x06, 0x69, 0x6e, 0x66, 0x6f, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75,
@@ -568,33 +576,35 @@ var file_biService_proto_rawDesc = []byte{
 	0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64,
 	0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14,
 	0x0a, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65,
-	0x6e, 0x74, 0x49, 0x64, 0x22, 0x6d, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65,
-	0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f,
-	0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f,
-	0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d,
-	0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d,
-	0x73, 0x67, 0x12, 0x1f, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b,
-	0x32, 0x0b, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x04, 0x64,
-	0x61, 0x74, 0x61, 0x22, 0x24, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63,
-	0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28,
-	0x03, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x5f, 0x0a, 0x0d, 0x47, 0x65, 0x74,
-	0x49, 0x6e, 0x66, 0x6f, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72,
-	0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09,
-	0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x72, 0x72,
-	0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x72,
-	0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03,
-	0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0x99, 0x01, 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, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06,
-	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x6e, 0x74, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4e,
+	0x61, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x6e, 0x74, 0x55, 0x73,
+	0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x6d, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f,
+	0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f,
+	0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x72,
+	0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72,
+	0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x72, 0x72, 0x6f,
+	0x72, 0x4d, 0x73, 0x67, 0x12, 0x1f, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01,
+	0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52,
+	0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x24, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x6a,
+	0x65, 0x63, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x5f, 0x0a, 0x0d, 0x47,
+	0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x0a,
+	0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03,
+	0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x65,
+	0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
+	0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61,
+	0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0x99, 0x01, 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, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62,
+	0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (

+ 1 - 1
service/yearEndReport.go

@@ -67,7 +67,7 @@ func AddProject(this *biservice.AddProjectReq, addCountLimit int) *biservice.Add
 				"account_id":        this.AccountId,
 				"company_name":      this.CompanyName,
 				"user_id":           this.UserId,
-				"user_name":         this.UserName,
+				"user_name":         this.EntUserName,
 				"ent_id":            this.EntId,
 				"status":            0,
 				"projectname":       common.ObjToString(project["projectname"]),