Sfoglia il codice sorgente

消息通知默认值处理

WH01243 1 anno fa
parent
commit
de1421ae3d

+ 3 - 2
jyBXSubscribe/rpc/etc/bxsubscribe.yaml

@@ -8,7 +8,7 @@ Timeout: 100000
 Webrpcport: 8013
 DefaultDay: 7
 DefaulCount:
-  Pay: 1000
+  Pay: 10
   Free: 50
 CodeServiceConf:
   Etcd:
@@ -20,4 +20,5 @@ PowerCheckCenterKey: "powercheck.rpc" #权益校验中台
 EntManageApplication: "entmanageapplication.rpc" #企业管理中台
 AppUrl: "/front/downloadJyApp/qr?page=%&source=%s"
 Nsq: 192.168.3.240:4260
-NsqTopic: jy_event
+NsqTopic: jy_event
+Registedate: 1705556502

+ 1 - 0
jyBXSubscribe/rpc/internal/config/config.go

@@ -21,6 +21,7 @@ type Config struct {
 	AppUrl               string
 	Nsq                  string
 	NsqTopic             string
+	Registedate          int64
 }
 
 type Db struct {

+ 27 - 20
jyBXSubscribe/rpc/model/service/pushSet.go

@@ -66,11 +66,12 @@ func (this *PushSetService) Find() map[string]*bxsubscribe.PushSet {
 	//
 	ShowWx := false
 	s_m_openid := ""
-	pushSetMap, _ = IC.Mgo.FindById(util.USER, this.UserId, `{"o_pushset":":1,"s_m_openid":1}`)
+	pushSetMap, _ = IC.Mgo.FindById(util.USER, this.UserId, `{"o_pushset":":1,"s_m_openid":1,"l_registedate",1}`)
 	if pushSetMap != nil && len(*pushSetMap) > 0 {
 		s_m_openid = common.InterfaceToStr((*pushSetMap)["s_m_openid"])
 		o_msgPushSet, _ = (*pushSetMap)["o_pushset"].(map[string]interface{})
 	}
+	registedate := int64(0)
 	if s_m_openid != "" {
 		//微信是否关注处理
 		subscribeList := &[]map[string]interface{}{}
@@ -81,8 +82,8 @@ func (this *PushSetService) Find() map[string]*bxsubscribe.PushSet {
 				ShowWx = true
 			}
 		}
+		registedate = common.Int64All((*pushSetMap)["l_registedate"])
 	}
-
 	if this.PositionType == 1 {
 		pushSetMap, _ = IC.Mgo.FindOne(util.ENTUSER, map[string]interface{}{"i_entid": this.EntId, "i_userid": this.EntUserId})
 	}
@@ -103,69 +104,69 @@ func (this *PushSetService) Find() map[string]*bxsubscribe.PushSet {
 		}
 	}
 	//推送设置
-	fool, o_subset := pushSetMontage(o_pushset["o_subset"], "o_subset", powerData, ShowWx)
+	fool, o_subset := pushSetMontage(o_pushset["o_subset"], "o_subset", powerData, ShowWx, registedate)
 	if fool {
 		pushSet["o_subset"] = o_subset
 	}
 
-	fool, o_week_report := pushSetMontage(o_pushset["o_week_report"], "o_week_report", powerData, ShowWx)
+	fool, o_week_report := pushSetMontage(o_pushset["o_week_report"], "o_week_report", powerData, ShowWx, registedate)
 	if fool {
 		pushSet["o_week_report"] = o_week_report
 	}
-	fool, o_month_report := pushSetMontage(o_pushset["o_month_report"], "o_month_report", powerData, ShowWx)
+	fool, o_month_report := pushSetMontage(o_pushset["o_month_report"], "o_month_report", powerData, ShowWx, registedate)
 	if fool {
 		pushSet["o_month_report"] = o_month_report
 	}
-	fool, o_newproject_forecast := pushSetMontage(o_pushset["o_newproject_forecast"], "o_newproject_forecast", powerData, ShowWx)
+	fool, o_newproject_forecast := pushSetMontage(o_pushset["o_newproject_forecast"], "o_newproject_forecast", powerData, ShowWx, registedate)
 	if fool {
 		pushSet["o_newproject_forecast"] = o_newproject_forecast
 	}
 	//企业信息
-	fool, o_entinfo := pushSetMontage(o_pushset["o_entinfo"], "o_entinfo", powerData, ShowWx)
+	fool, o_entinfo := pushSetMontage(o_pushset["o_entinfo"], "o_entinfo", powerData, ShowWx, registedate)
 	if fool {
 		pushSet["o_entinfo"] = o_entinfo
 	}
 	//项目关注
-	fool, o_follow_project := pushSetMontage(o_pushset["o_follow_project"], "o_follow_project", powerData, ShowWx)
+	fool, o_follow_project := pushSetMontage(o_pushset["o_follow_project"], "o_follow_project", powerData, ShowWx, registedate)
 	if fool {
 		pushSet["o_follow_project"] = o_follow_project
 	}
 	//企业关注
-	fool, o_follow_ent := pushSetMontage(o_pushset["o_follow_ent"], "o_follow_ent", powerData, ShowWx)
+	fool, o_follow_ent := pushSetMontage(o_pushset["o_follow_ent"], "o_follow_ent", powerData, ShowWx, registedate)
 	if fool {
 		pushSet["o_follow_ent"] = o_follow_ent
 	}
 	//消息
-	fool, o_msg_active := pushSetMontage(o_msgPushSet["o_msg_active"], "o_msg_active", powerData, ShowWx)
+	fool, o_msg_active := pushSetMontage(o_msgPushSet["o_msg_active"], "o_msg_active", powerData, ShowWx, registedate)
 	if fool {
 		pushSet["o_msg_active"] = o_msg_active
 	}
 	//消息服务
-	fool, o_msg_service := pushSetMontage(o_msgPushSet["o_msg_service"], "o_msg_service", powerData, ShowWx)
+	fool, o_msg_service := pushSetMontage(o_msgPushSet["o_msg_service"], "o_msg_service", powerData, ShowWx, registedate)
 	if fool {
 		pushSet["o_msg_service"] = o_msg_service
 	}
 	//剑鱼学堂
-	fool, o_msg_jyschool := pushSetMontage(o_msgPushSet["o_msg_jyschool"], "o_msg_jyschool", powerData, ShowWx)
+	fool, o_msg_jyschool := pushSetMontage(o_msgPushSet["o_msg_jyschool"], "o_msg_jyschool", powerData, ShowWx, registedate)
 	if fool {
 		pushSet["o_msg_jyschool"] = o_msg_jyschool
 	}
-	fool, o_msg_business := pushSetMontage(o_msgPushSet["o_msg_business"], "o_msg_business", powerData, ShowWx)
+	fool, o_msg_business := pushSetMontage(o_msgPushSet["o_msg_business"], "o_msg_business", powerData, ShowWx, registedate)
 	if fool {
 		pushSet["o_msg_business"] = o_msg_business
 	}
 	//私信
-	fool, o_msg_pending := pushSetMontage(o_msgPushSet["o_msg_pending"], "o_msg_business", powerData, ShowWx)
+	fool, o_msg_pending := pushSetMontage(o_msgPushSet["o_msg_pending"], "o_msg_business", powerData, ShowWx, registedate)
 	if fool {
 		pushSet["o_msg_pending"] = o_msg_pending
 	}
-	fool, o_msg_privateletter := pushSetMontage(o_msgPushSet["o_msg_privateletter"], "o_msg_privateletter", powerData, ShowWx)
+	fool, o_msg_privateletter := pushSetMontage(o_msgPushSet["o_msg_privateletter"], "o_msg_privateletter", powerData, ShowWx, registedate)
 	if fool {
 		pushSet["o_msg_privateletter"] = o_msg_privateletter
 	}
 	return pushSet
 }
-func pushSetMontage(in interface{}, name string, powerData *pb.CheckResp, ShowWx bool) (bool, *bxsubscribe.PushSet) {
+func pushSetMontage(in interface{}, name string, powerData *pb.CheckResp, ShowWx bool, registedate int64) (bool, *bxsubscribe.PushSet) {
 	data := common.ObjToMap(in)
 	a_times := []string{}
 	isMailShow := int64(1)
@@ -346,16 +347,22 @@ func pushSetMontage(in interface{}, name string, powerData *pb.CheckResp, ShowWx
 		if name == "o_msg_active" {
 			isWXShow = 0
 		}
+		iApppush := int64(0)
+		iWxpush := int64(0)
+		if registedate > IC.C.Registedate {
+			iApppush = 1
+			iWxpush = 1
+		}
 		if data == nil || len(*data) == 0 {
 			returnData = &bxsubscribe.PushSet{
-				IApppush: 0,
-				IWxpush:  0,
+				IApppush: iApppush,
+				IWxpush:  iWxpush,
 				IsWxShow: isWXShow,
 			}
 		} else {
 			returnData = &bxsubscribe.PushSet{
-				IApppush: common.Int64All(common.If((*data)["i_apppush"] == nil, 0, (*data)["i_apppush"])),
-				IWxpush:  common.Int64All(common.If((*data)["i_wxpush"] == nil, 0, (*data)["i_wxpush"])),
+				IApppush: common.Int64All(common.If((*data)["i_apppush"] == nil, iApppush, (*data)["i_apppush"])),
+				IWxpush:  common.Int64All(common.If((*data)["i_wxpush"] == nil, iWxpush, (*data)["i_wxpush"])),
 				IsWxShow: isWXShow,
 			}
 		}