Browse Source

feat:冲突

wangshan 2 years ago
parent
commit
9a886981e2

+ 0 - 10
jyBXBase/api/bxbase.api

@@ -94,15 +94,6 @@ type (
 	}
 	//首页最新招标信息
 	NewestReq {
-<<<<<<< HEAD
-		City      string `json:"city,optional"`        //定位城市
-		IsSearch  int64  `json:"isSearch,optional"`    //是否根据定位查询es
-		UserId    string `header:"userId,optional"`    //用户id
-		AppId     string `header:"appId"`              //appId
-		EntUserId string `header:"entUserId,optional"` //商机管理用户 用户id:entUserId
-		NewUserId string `header:"newUserId,optional"`
-		EntId     string `header:"entId,optional"`
-=======
 		City         string `json:"city,optional"`        //定位城市
 		IsSearch     int64  `json:"isSearch,optional"`    //是否根据定位查询es
 		UserId       string `header:"userId,optional"`    //用户id
@@ -111,7 +102,6 @@ type (
 		NewUserId    string `header:"newUserId,optional"`
 		EntId        string `header:"entId,optional"`
 		PositionType string `header:"positionType,optional"`
->>>>>>> master
 	}
 	//公共接口返回
 	CommonRes {

+ 0 - 10
jyBXBase/api/internal/types/types.go

@@ -85,15 +85,6 @@ type AddSearchScreen struct {
 }
 
 type NewestReq struct {
-<<<<<<< HEAD
-	City      string `json:"city,optional"`        //定位城市
-	IsSearch  int64  `json:"isSearch,optional"`    //是否根据定位查询es
-	UserId    string `header:"userId,optional"`    //用户id
-	AppId     string `header:"appId"`              //appId
-	EntUserId string `header:"entUserId,optional"` //商机管理用户 用户id:entUserId
-	NewUserId string `header:"newUserId,optional"`
-	EntId     string `header:"entId,optional"`
-=======
 	City         string `json:"city,optional"`        //定位城市
 	IsSearch     int64  `json:"isSearch,optional"`    //是否根据定位查询es
 	UserId       string `header:"userId,optional"`    //用户id
@@ -102,7 +93,6 @@ type NewestReq struct {
 	NewUserId    string `header:"newUserId,optional"`
 	EntId        string `header:"entId,optional"`
 	PositionType string `header:"positionType,optional"`
->>>>>>> master
 }
 
 type CommonRes struct {

+ 1 - 1
jyBXBase/rpc/bxbase.proto

@@ -181,7 +181,7 @@ message NewestBiddingReq{
   string  userId = 3;
   string  appId = 4;
   string  entUserId = 5;
-  string newUserId = 6;
+  int64 newUserId = 6;
   string  entId=7;
   int64 positionType = 8;
 }

+ 14 - 51
jyBXBase/rpc/internal/logic/newestbiddinglogic.go

@@ -35,7 +35,7 @@ func NewNewestBiddingLogic(ctx context.Context, svcCtx *svc.ServiceContext) *New
 	}
 }
 
-// 首页最新招标信息
+// NewestBidding 首页最新招标信息
 func (l *NewestBiddingLogic) NewestBidding(in *bxbase.NewestBiddingReq) (*bxbase.NewsetBiddingResp, error) {
 	t := time.Now()
 	userType := ""
@@ -45,10 +45,6 @@ func (l *NewestBiddingLogic) NewestBidding(in *bxbase.NewestBiddingReq) (*bxbase
 				List: []*bxbase.NewestList{},
 			},
 		}
-<<<<<<< HEAD
-		newUserId, _ := strconv.ParseInt(in.NewUserId, 10, 64)
-=======
->>>>>>> master
 		entUserId, _ := strconv.ParseInt(in.EntUserId, 10, 64)
 		//主体处理(fType:普通用户;vType:超级订阅用户;mType:大会员用户;eType:商机管理用户)
 		if in.PositionType == 1 {
@@ -57,11 +53,7 @@ func (l *NewestBiddingLogic) NewestBidding(in *bxbase.NewestBiddingReq) (*bxbase
 		}
 		rks := ""
 		if userType == "e" {
-<<<<<<< HEAD
 			rks = MC.If(in.EntUserId != "", in.EntUserId, in.City).(string)
-=======
-			rks = MC.If(in.UserId != "", in.EntUserId, in.City).(string)
->>>>>>> master
 		} else {
 			rks = MC.If(in.UserId != "", in.UserId, in.City).(string)
 		}
@@ -74,11 +66,7 @@ func (l *NewestBiddingLogic) NewestBidding(in *bxbase.NewestBiddingReq) (*bxbase
 		if err == nil && redisByte != nil && len(*redisByte) > 0 {
 			err = json.Unmarshal(*redisByte, res.Data)
 			if err != nil {
-<<<<<<< HEAD
 				logx.Info(fmt.Sprintf("%s 读取缓存 序列化异常,err:%s", in.NewUserId, err.Error()))
-=======
-				logx.Info(fmt.Sprintf("读取缓存 序列化异常,err:%s", err.Error()))
->>>>>>> master
 			}
 			if len(res.Data.List) > 0 {
 				return res, 1
@@ -89,22 +77,13 @@ func (l *NewestBiddingLogic) NewestBidding(in *bxbase.NewestBiddingReq) (*bxbase
 		if in.UserId != "" {
 			//优先级 由测试确认  大会员 》 商机管理 》 VIP 》 普通用户 》 搜索历史
 			//获取订阅信息
-<<<<<<< HEAD
-			query := map[string]interface{}{
-				"base_user_id": newUserId,
-			}
-			userMap, ok := IC.Mgo.FindOneByField("user", query, `{"o_jy":1,"o_vipjy":1,"i_vip_status":1,"o_member_jy":1,"i_member_status":1,"s_m_phone":1,"s_phone":1}`)
-			if !ok || userMap == nil || len(*userMap) == 0 {
-=======
 			userMap := IC.Compatible.Select(in.UserId, `{"o_jy":1,"o_vipjy":1,"i_vip_status":1,"o_member_jy":1,"i_member_status":1,"s_m_phone":1,"s_phone":1}`)
 			if userMap == nil || len(*userMap) == 0 {
->>>>>>> master
 				//查询出错
 				res.ErrCode = -1
 				res.ErrMsg = fmt.Errorf("未查询到用户信息").Error()
 				return res, -1
 			}
-			logx.Info("------------00--------")
 			//var isPayUser bool = false
 			//付费用户如果没有数据 直接返回 需求来源:测试
 			//vip用户
@@ -112,24 +91,23 @@ func (l *NewestBiddingLogic) NewestBidding(in *bxbase.NewestBiddingReq) (*bxbase
 			//大会员用户
 			bigStatus := MC.Int64All((*userMap)["i_member_status"])
 			if bigStatus > 0 {
-				o_msgset := MC.ObjToMap((*userMap)["o_member_jy"])
-				big_items, ok := (*o_msgset)["a_items"].([]interface{})
+				oMsgset := MC.ObjToMap((*userMap)["o_member_jy"])
+				bigItems, ok := (*oMsgset)["a_items"].([]interface{})
 				//大会员推送历史
-				result := []*bxbase.NewestList{}
+				var result []*bxbase.NewestList
 				if userType == "e" {
 					result = model.GetNewestInfo(rks, "e", entUserId).GetPushHistory()
 				} else {
-					result = model.GetNewestInfo(rks, "m", newUserId).GetPushHistory()
+					result = model.GetNewestInfo(rks, "m", in.NewUserId).GetPushHistory()
 				}
 				res.Data.Count = int64(len(result))
 				if res.Data.Count > 0 {
-					res.Data.HasSubKeys = ok && len(big_items) > 0
+					res.Data.HasSubKeys = ok && len(bigItems) > 0
 					res.Data.List = result
 					res.Data.SubFlag = "m"
 				}
 				return res, 0
 			}
-			logx.Info("------------11--------")
 			if phone := MC.If((*userMap)["s_phone"] != nil, MC.ObjToString((*userMap)["s_phone"]), MC.ObjToString((*userMap)["s_m_phone"])).(string); phone != "" && in.EntUserId != "" && in.EntId != "" {
 				//商机管理
 				entNicheInfos := IC.MainMysql.SelectBySql(`SELECT i.power_source,u.power FROM entniche_user u LEFT JOIN entniche_info i ON u.ent_id=i.id WHERE u.phone=? and  i.status=1 AND i.id = ?`, phone, in.EntId)
@@ -151,43 +129,33 @@ func (l *NewestBiddingLogic) NewestBidding(in *bxbase.NewestBiddingReq) (*bxbase
 					}
 				}
 			}
-			logx.Info("------------22--------")
 			if vipStatus > 0 {
-				o_msgset := MC.ObjToMap((*userMap)["o_vipjy"])
-				vip_items, ok := (*o_msgset)["a_items"].([]interface{})
+				oMsgset := MC.ObjToMap((*userMap)["o_vipjy"])
+				vipItems, ok := (*oMsgset)["a_items"].([]interface{})
 				//vip查询推送历史
-				result := []*bxbase.NewestList{}
+				var result []*bxbase.NewestList
 				if userType == "e" {
 					result = model.GetNewestInfo(rks, "e", entUserId).GetPushHistory()
 				} else {
-					result = model.GetNewestInfo(rks, "v", newUserId).GetPushHistory()
+					result = model.GetNewestInfo(rks, "v", in.NewUserId).GetPushHistory()
 				}
 				res.Data.IsVip = true
-				res.Data.HasSubKeys = ok && len(vip_items) > 0
+				res.Data.HasSubKeys = ok && len(vipItems) > 0
 				res.Data.Count = int64(len(result))
 				res.Data.List = result
 				res.Data.SubFlag = "v"
 				return res, 0
 			}
 			//普通用户用户- 有关键词
-			o_msgset := MC.ObjToMap((*userMap)["o_jy"])
-			items, ok := (*o_msgset)["a_key"].([]interface{})
-			logx.Info(ok, "------------33--------", items)
+			oMsgset := MC.ObjToMap((*userMap)["o_jy"])
+			items, ok := (*oMsgset)["a_key"].([]interface{})
 			if ok && len(items) > 0 {
-				result := []*bxbase.NewestList{}
 				//普通用户查询推送历史
-<<<<<<< HEAD
-				if userType == "e" {
-					result = model.GetNewestInfo(rks, "e", entUserId).GetPushHistory()
-				} else {
-					result = model.GetNewestInfo(rks, "f", newUserId).GetPushHistory()
-=======
-				result := []*bxbase.NewestList{}
+				var result []*bxbase.NewestList
 				if userType == "e" {
 					result = model.GetNewestInfo(rks, "e", entUserId).GetPushHistory()
 				} else {
 					result = model.GetNewestInfo(rks, "f", in.NewUserId).GetPushHistory()
->>>>>>> master
 				}
 				res.Data.IsVip = false
 				res.Data.HasSubKeys = ok && len(items) > 0
@@ -196,7 +164,6 @@ func (l *NewestBiddingLogic) NewestBidding(in *bxbase.NewestBiddingReq) (*bxbase
 				res.Data.SubFlag = "f"
 				return res, 0
 			}
-			logx.Info("------------44--------")
 			//搜索历史-关键词
 			hKeys := redis.GetStr("other", fmt.Sprintf("s_%s", in.UserId))
 			if hKeys != "" && len(strings.Split(hKeys, ",")) > 0 {
@@ -236,11 +203,7 @@ func (l *NewestBiddingLogic) NewestBidding(in *bxbase.NewestBiddingReq) (*bxbase
 		} else if i == 0 {
 			rks := ""
 			if userType == "e" {
-<<<<<<< HEAD
 				rks = MC.If(in.EntUserId != "", in.EntUserId, in.City).(string)
-=======
-				rks = MC.If(in.UserId != "", in.EntUserId, in.City).(string)
->>>>>>> master
 			} else {
 				rks = MC.If(in.UserId != "", in.UserId, in.City).(string)
 			}

+ 1 - 1
jyBXBase/rpc/internal/server/bxbaseserver.go

@@ -1,4 +1,4 @@
-// Code generated by goctl. DO NOT EDIT.
+// Code generated by goctl. DO NOT EDIT!
 // Source: bxbase.proto
 
 package server

+ 0 - 4
jyBXBase/rpc/model/newestBidding.go

@@ -56,11 +56,7 @@ func GetNewestInfo(userId, userType string, newUserId int64) *NewestInfo {
 func (n *NewestInfo) GetPushHistory() (res []*bxbase.NewestList) {
 	findSQL := "select a.infoid,a.matchkeys,b.isvalidfile as attachment_count,b.budget,b.bidamount from %s a INNER JOIN %s b ON a.userid=%d and a.date>=%d and a.infoid=b.infoid order by a.id desc limit 50"
 	findSQL = fmt.Sprintf(findSQL, n.TableName, Pushbidding, n.NewUserId, time.Now().AddDate(0, 0, -7).Unix())
-<<<<<<< HEAD
-	logx.Info(n.NewUserId, ",", n.TableName, ",subscribePush query sql:", findSQL)
-=======
 	logx.Info(n.TableName, "-------", n.NewUserId, ",findSQL:", findSQL)
->>>>>>> master
 	list := n.MysqlDb.SelectBySql(findSQL)
 	if len(*list) > 0 && list != nil {
 		m := map[string]bool{}

+ 3 - 18
jyBXBase/rpc/type/bxbase/bxbase.pb.go

@@ -1,12 +1,7 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
 // versions:
-<<<<<<< HEAD
 // 	protoc-gen-go v1.28.0
 // 	protoc        v3.15.5
-=======
-// 	protoc-gen-go v1.28.1
-// 	protoc        v3.15.1
->>>>>>> master
 // source: bxbase.proto
 
 package bxbase
@@ -1825,15 +1820,6 @@ type NewestBiddingReq struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-<<<<<<< HEAD
-	City      string `protobuf:"bytes,1,opt,name=city,proto3" json:"city,omitempty"`
-	IsSearch  int64  `protobuf:"varint,2,opt,name=isSearch,proto3" json:"isSearch,omitempty"`
-	UserId    string `protobuf:"bytes,3,opt,name=userId,proto3" json:"userId,omitempty"`
-	AppId     string `protobuf:"bytes,4,opt,name=appId,proto3" json:"appId,omitempty"`
-	EntUserId string `protobuf:"bytes,5,opt,name=entUserId,proto3" json:"entUserId,omitempty"`
-	NewUserId string `protobuf:"bytes,6,opt,name=newUserId,proto3" json:"newUserId,omitempty"`
-	EntId     string `protobuf:"bytes,7,opt,name=entId,proto3" json:"entId,omitempty"`
-=======
 	City         string `protobuf:"bytes,1,opt,name=city,proto3" json:"city,omitempty"`
 	IsSearch     int64  `protobuf:"varint,2,opt,name=isSearch,proto3" json:"isSearch,omitempty"`
 	UserId       string `protobuf:"bytes,3,opt,name=userId,proto3" json:"userId,omitempty"`
@@ -1842,7 +1828,6 @@ type NewestBiddingReq struct {
 	NewUserId    int64  `protobuf:"varint,6,opt,name=newUserId,proto3" json:"newUserId,omitempty"`
 	EntId        string `protobuf:"bytes,7,opt,name=entId,proto3" json:"entId,omitempty"`
 	PositionType int64  `protobuf:"varint,8,opt,name=positionType,proto3" json:"positionType,omitempty"`
->>>>>>> master
 }
 
 func (x *NewestBiddingReq) Reset() {
@@ -1912,11 +1897,11 @@ func (x *NewestBiddingReq) GetEntUserId() string {
 	return ""
 }
 
-func (x *NewestBiddingReq) GetNewUserId() string {
+func (x *NewestBiddingReq) GetNewUserId() int64 {
 	if x != nil {
 		return x.NewUserId
 	}
-	return ""
+	return 0
 }
 
 func (x *NewestBiddingReq) GetEntId() string {
@@ -3121,7 +3106,7 @@ var file_bxbase_proto_rawDesc = []byte{
 	0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x6e, 0x74,
 	0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x65, 0x6e,
 	0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x65, 0x77, 0x55, 0x73,
-	0x65, 0x72, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x65, 0x77, 0x55,
+	0x65, 0x72, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6e, 0x65, 0x77, 0x55,
 	0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x07,
 	0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x70,
 	0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28,

+ 0 - 4
jyBXBase/rpc/type/bxbase/bxbase_grpc.pb.go

@@ -1,11 +1,7 @@
 // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
 // versions:
 // - protoc-gen-go-grpc v1.2.0
-<<<<<<< HEAD
 // - protoc             v3.15.5
-=======
-// - protoc             v3.15.1
->>>>>>> master
 // source: bxbase.proto
 
 package bxbase