Explorar el Código

Merge branch 'dev_v1.1.49_wh' of BaseService/jyMicroservices into feature/v1.1.49

王浩 hace 1 año
padre
commit
d315d98f31

+ 3 - 0
jyBXSubscribe/api/bxsubscribe.api

@@ -82,6 +82,9 @@ type (
 		AccountId       int64                    `header:"accountId,optional"`
 		PositionId      int64                    `header:"positionId,optional"`
 		District        map[string]interface{}   `json:"district,optional"`
+		ISwitch         int64                    `json:"iSwitch,optional"`
+		Amount          string                   `json:"amount,optional"`
+		Matchmode       string                   `json:"matchmode,optional"`
 	}
 	SetReadReq {
 		AppId        string `header:"appId"`

+ 3 - 0
jyBXSubscribe/api/internal/logic/subscribeupdatelogic.go

@@ -52,6 +52,9 @@ func (l *SubscribeUpdateLogic) SubscribeUpdate(req *types.SubscribeUpdateReq) (r
 		Mail:            req.Mail,
 		Otherbuyerclass: req.Otherbuyerclass,
 		District:        req.District,
+		Amount:          req.Amount,
+		ISwitch:         req.ISwitch,
+		Matchmode:       req.Matchmode,
 	}
 	fmt.Println("###")
 	b, _ := json.Marshal(su)

+ 3 - 0
jyBXSubscribe/api/internal/types/types.go

@@ -74,6 +74,9 @@ type SubscribeUpdateReq struct {
 	AccountId       int64                    `header:"accountId,optional"`
 	PositionId      int64                    `header:"positionId,optional"`
 	District        map[string]interface{}   `json:"district,optional"`
+	ISwitch         int64                    `json:"iSwitch,optional"`
+	Amount          string                   `json:"amount,optional"`
+	Matchmode       string                   `json:"matchmode,optional"`
 }
 
 type SetReadReq struct {

+ 3 - 0
jyBXSubscribe/entity/common.go

@@ -20,4 +20,7 @@ type SubscribeUpdate struct {
 	Mail            string                   `json:"mail,optional"`            //邮箱
 	Otherbuyerclass string                   `json:"otherbuyerclass,optional"` //匹配未分类类型 1匹配 0不匹配
 	District        map[string]interface{}   `json:"district,optional"`        //区县
+	Amount          string                   `json:"amount,optional"`
+	ISwitch         int64                    `json:"iSwitch,optional"`
+	Matchmode       string                   `json:"matchmode,optional"`
 }

+ 8 - 0
jyBXSubscribe/rpc/model/service/subscribe.go

@@ -6,6 +6,7 @@ import (
 	"jyBXSubscribe/entity"
 	IC "jyBXSubscribe/rpc/init"
 	"strconv"
+	"strings"
 
 	"app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/mongodb"
@@ -62,6 +63,10 @@ func (this *SubseribeService) Update() (int64, error) {
 	if this.Buyerclass != nil {
 		setMap["o_vipjy.a_buyerclass"] = this.Buyerclass
 	}
+	if this.Amount != "" {
+		setMap["o_vipjy.amount"] = this.Amount
+	}
+	setMap["o_vipjy.i_switch"] = this.ISwitch
 	if this.Items != nil {
 		setMap["o_vipjy.a_items"] = this.Items
 		//判断是否新增
@@ -85,6 +90,9 @@ func (this *SubseribeService) Update() (int64, error) {
 	if this.Infotype != nil {
 		setMap["o_vipjy.a_infotype"] = this.Infotype
 	}
+	if this.Matchmode != "" {
+		setMap["o_vipjy.i_matchmode"] = strings.Split(this.Matchmode, ",")
+	}
 	if this.Matchway != "" {
 		i_matchway, _ := strconv.Atoi(this.Matchway)
 		setMap["o_vipjy.i_matchway"] = i_matchway

+ 19 - 7
jyBXSubscribe/rpc/model/staffSubscribe.go

@@ -28,11 +28,14 @@ type PersonSubscribe struct {
 			Matchway float64  `json:"matchway"`
 		} `json:"a_key"`
 	} `json:"a_items"`
-	IEntFastimport int `json:"i_ent_fastimport"`
-	IApppush       int `json:"i_apppush"`
-	IMailpush      int `json:"i_mailpush"`
-	IMatchway      int `json:"i_matchway"`
-	IRatemode      int `json:"i_ratemode"`
+	IEntFastimport int      `json:"i_ent_fastimport"`
+	IApppush       int      `json:"i_apppush"`
+	IMailpush      int      `json:"i_mailpush"`
+	IMatchway      int      `json:"i_matchmode"`
+	IMatchmode     []string `json:"i_matchmode"`
+	IRatemode      int      `json:"i_ratemode"`
+	Amount         string   `json:"amount"`
+	ISwitch        int      `json:"i_switch"`
 }
 
 // IsEmpty 判断订阅内容是否为空
@@ -324,9 +327,12 @@ func getPersonSubscribe(query map[string]interface{}) (rData map[string]interfac
 		rData["district"] = subDetail.Odistrict
 		rData["infotype"] = subDetail.AInfotype
 		rData["projectmatch"] = subDetail.IProjectmatch
-		rData["matchway"] = common.If(subDetail.IMatchway == 0, 1, subDetail.IMatchway) //匹配方式 默认标题匹配 1
+		rData["matchway"] = common.If(subDetail.IMatchway == 0, 1, subDetail.IMatchway)                        //匹配方式 默认标题匹配 1
+		rData["matchmode"] = common.If(len(subDetail.IMatchmode) > 0, subDetail.IMatchmode, []string{"title"}) //匹配方式 默认标题匹配 1
 		rData["wordsList"] = wordsList
 		rData["buyerClass"] = subDetail.ABuyerclass
+		rData["switch"] = subDetail.ISwitch
+		rData["amount"] = subDetail.Amount
 		regionMap := map[string]map[string][]string{}
 		if subDetail.OArea != nil {
 			district := map[string]interface{}{}
@@ -384,7 +390,7 @@ func getEntDistribute(ruleId string, entId, uid int64) (rData map[string]interfa
 		wordsRes, _ = IC.Mgo.FindOne("entniche_rule", map[string]interface{}{"i_entid": entId, "i_deptid": map[string]interface{}{"$exists": 0}, "i_userid": map[string]interface{}{"$exists": 0}})
 	}
 	wordsList := []map[string]interface{}{}
-	infotype, i_projectmatch, i_matchway := []string{}, 0, 0
+	infotype, i_projectmatch, i_matchway, amount, iSwitch, i_matchmode := []string{}, 0, 1, "", 0, []string{"title"}
 	if wordsRes != nil && len(*wordsRes) > 0 {
 		thisSub := &PersonSubscribe{}
 		if gconv.Struct((*wordsRes)["o_entniche"], thisSub) == nil {
@@ -402,8 +408,11 @@ func getEntDistribute(ruleId string, entId, uid int64) (rData map[string]interfa
 				}
 			}
 			i_matchway = thisSub.IMatchway
+			i_matchmode = thisSub.IMatchmode
 			i_projectmatch = thisSub.IProjectmatch
 			infotype = thisSub.AInfotype
+			amount = thisSub.Amount
+			iSwitch = thisSub.ISwitch
 		}
 	}
 	rData["buyerClass"] = (*ruleRes)["a_buyerclass"] //采购单位类型
@@ -436,6 +445,9 @@ func getEntDistribute(ruleId string, entId, uid int64) (rData map[string]interfa
 	rData["regionMap"] = regionMap
 	rData["infotype"] = infotype
 	rData["projectmatch"] = i_projectmatch
+	rData["switch"] = iSwitch
+	rData["amount"] = amount
+	rData["matchmode"] = i_matchmode
 	rData["matchway"] = i_matchway
 	rData["wordsList"] = wordsList
 	return

+ 2 - 12
jyBXSubscribe/rpc/type/bxsubscribe/bxsubscribe.pb.go

@@ -3347,7 +3347,6 @@ type PushSet struct {
 	IRatemode   int64    `protobuf:"varint,5,opt,name=i_ratemode,json=iRatemode,proto3" json:"i_ratemode,omitempty"`
 	IsWxShow    int64    `protobuf:"varint,6,opt,name=isWxShow,proto3" json:"isWxShow,omitempty"`
 	Interested  int64    `protobuf:"varint,7,opt,name=interested,proto3" json:"interested,omitempty"`
-	IsMailShow  int64    `protobuf:"varint,8,opt,name=isMailShow,proto3" json:"isMailShow,omitempty"`
 	INomsgtip   int64    `protobuf:"varint,9,opt,name=i_nomsgtip,json=iNomsgtip,proto3" json:"i_nomsgtip,omitempty"`
 	IApppushTip int64    `protobuf:"varint,10,opt,name=i_apppush_tip,json=iApppushTip,proto3" json:"i_apppush_tip,omitempty"`
 }
@@ -3433,13 +3432,6 @@ func (x *PushSet) GetInterested() int64 {
 	return 0
 }
 
-func (x *PushSet) GetIsMailShow() int64 {
-	if x != nil {
-		return x.IsMailShow
-	}
-	return 0
-}
-
 func (x *PushSet) GetINomsgtip() int64 {
 	if x != nil {
 		return x.INomsgtip
@@ -4518,7 +4510,7 @@ var file_bxsubscribe_proto_rawDesc = []byte{
 	0x6e, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x23, 0x0a, 0x08,
 	0x54, 0x69, 0x6d, 0x65, 0x4a, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x5f, 0x74, 0x69,
 	0x6d, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x61, 0x54, 0x69, 0x6d, 0x65,
-	0x73, 0x22, 0xb7, 0x02, 0x0a, 0x07, 0x50, 0x75, 0x73, 0x68, 0x53, 0x65, 0x74, 0x12, 0x17, 0x0a,
+	0x73, 0x22, 0x97, 0x02, 0x0a, 0x07, 0x50, 0x75, 0x73, 0x68, 0x53, 0x65, 0x74, 0x12, 0x17, 0x0a,
 	0x07, 0x61, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06,
 	0x61, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x5f, 0x77, 0x78, 0x70, 0x75,
 	0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x69, 0x57, 0x78, 0x70, 0x75, 0x73,
@@ -4531,9 +4523,7 @@ var file_bxsubscribe_proto_rawDesc = []byte{
 	0x69, 0x73, 0x57, 0x78, 0x53, 0x68, 0x6f, 0x77, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08,
 	0x69, 0x73, 0x57, 0x78, 0x53, 0x68, 0x6f, 0x77, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x6e, 0x74, 0x65,
 	0x72, 0x65, 0x73, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x69, 0x6e,
-	0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x65, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x73, 0x4d, 0x61,
-	0x69, 0x6c, 0x53, 0x68, 0x6f, 0x77, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x69, 0x73,
-	0x4d, 0x61, 0x69, 0x6c, 0x53, 0x68, 0x6f, 0x77, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x5f, 0x6e, 0x6f,
+	0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x65, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x5f, 0x6e, 0x6f,
 	0x6d, 0x73, 0x67, 0x74, 0x69, 0x70, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x69, 0x4e,
 	0x6f, 0x6d, 0x73, 0x67, 0x74, 0x69, 0x70, 0x12, 0x22, 0x0a, 0x0d, 0x69, 0x5f, 0x61, 0x70, 0x70,
 	0x70, 0x75, 0x73, 0x68, 0x5f, 0x74, 0x69, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b,