Browse Source

Merge branch 'feature/v4.10.31' of https://jygit.jydev.jianyu360.cn/qmx/jy into feature/v4.10.31

wangshan 1 week ago
parent
commit
f164e0927e

+ 0 - 1
src/jfw/modules/bigmember/src/config/config.go

@@ -101,7 +101,6 @@ type config struct {
 	RestrictionWaitPool   int
 	BidSearchOldUserLimit int64 // p480  原/publicapply/bidcoll/power 接口返回值的isOld添加到isAdd接口
 	OssUrl                string
-	CustomerServiceUrl    string // 获取客成信息 没有客成有销售返回销售 都没有返回空
 }
 
 type CustomerInfo struct {

+ 0 - 1
src/jfw/modules/bigmember/src/go.mod

@@ -10,7 +10,6 @@ require (
 	bp.jydev.jianyu360.cn/BaseService/userCenter v1.2.21
 	github.com/donnie4w/go-logger v0.0.0-20230316073421-36a48f87a69a
 	github.com/gogf/gf/v2 v2.7.0
-	github.com/levigross/grequests v0.0.0-20231203190023-9c307ef1f48d
 	github.com/olivere/elastic/v7 v7.0.32
 	go.mongodb.org/mongo-driver v1.14.0
 	jygit.jydev.jianyu360.cn/BaseService/ossClient v0.0.0-20250617080435-854a73d39d01

+ 23 - 52
src/jfw/modules/bigmember/src/service/use/custom.go

@@ -4,67 +4,38 @@ import (
 	. "app.yhyue.com/moapp/jybase/api"
 	qu "app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/redis"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 	"fmt"
-	"github.com/levigross/grequests"
 	"jy/src/jfw/modules/bigmember/src/config"
 	"jy/src/jfw/modules/bigmember/src/db"
-	"log"
-)
-
-const (
-	KFPhone = "400-108-6670"
 )
 
 func (u *Use) GetCustom() {
-	data := func() (customInfo map[string]interface{}) {
-		defaultCustomerServiceInfo := getWxm("") //  默认的客服
-		if customInfo, b := defaultCustomerServiceInfo.(map[string]interface{}); b {
-			customInfo["phone"] = KFPhone
-		}
-		userid := qu.ObjToString(u.GetSession("userId"))
-		positionId := qu.Int64All(u.GetSession("positionId"))
-		t := u.GetString("type") // kf 直接返回客服 不查询客成
-		if userid == "" || t == "kf" {
-			return
-		}
-		//  调用王浩的接口获取客服信息
-		//调用王浩的接口 获取客服信息  替换结果
-		data := map[string]interface{}{
-			"position_id": positionId,
-		}
-		geq := &grequests.RequestOptions{
-			JSON: data,
-		}
-		resp, err := grequests.Post(config.Config.CustomerServiceUrl, geq)
-		if err != nil {
-			log.Println("调用接口失败:", data, err)
-		}
-		if resp != nil {
-			csiData := map[string]interface{}{}
-			err = resp.JSON(&csiData)
-			if err != nil {
-				log.Println("序列化失败:", resp, err)
-			} else {
-				if qu.InterfaceToStr(csiData["phone"]) != "" && qu.InterfaceToStr(csiData["wxer"]) != "" {
-					customInfo = csiData
+	r := func() Result {
+		cName := func() (customName string) {
+			userid := qu.ObjToString(u.GetSession("userId"))
+			positionId := qu.Int64All(u.GetSession("positionId"))
+			t := u.GetString("type") // kf 直接返回客服 不查询客成
+			if userid == "" || t == "kf" {
+				return
+			}
+			bigPower := jy.GetBigVipUserBaseMsg(u.Session(), *config.Middleground)
+			if bigPower.Status <= 0 && bigPower.EntnicheStatus <= 0 {
+				return ""
+			}
+			res := db.MysqlSubject.SelectBySql("SELECT i.name as customer_name FROM dwd_f_data_equity_info e INNER JOIN dwd_f_crm_clue_info  c on (e.uid=c.uid) INNER JOIN dwd_f_csm_customer_info i on( c.id = i.clue_id) WHERE e.position_id=? AND e.product_type in ('大会员','商机管理') AND c.is_transfer=1", positionId)
+			if res != nil || len(*res) != 0 {
+				for _, m := range *res {
+					if customName = qu.ObjToString(m["customer_name"]); customName != "" {
+						return
+					}
 				}
 			}
-		}
-		//bigPower := jy.GetBigVipUserBaseMsg(u.Session(), *config.Middleground)
-		//if bigPower.Status <= 0 && bigPower.EntnicheStatus <= 0 {
-		//	return ""
-		//}
-		//res := db.MysqlSubject.SelectBySql("SELECT i.name as customer_name FROM dwd_f_data_equity_info e INNER JOIN dwd_f_crm_clue_info  c on (e.uid=c.uid) INNER JOIN dwd_f_csm_customer_info i on( c.id = i.clue_id) WHERE e.position_id=? AND e.product_type in ('大会员','商机管理') AND c.is_transfer=1", positionId)
-		//if res != nil || len(*res) != 0 {
-		//	for _, m := range *res {
-		//		if customName = qu.ObjToString(m["customer_name"]); customName != "" {
-		//			return
-		//		}
-		//	}
-		//}
-		return
+			return
+		}()
+		return Result{Data: getWxm(cName)}
 	}()
-	u.ServeJson(Result{Data: data})
+	u.ServeJson(r)
 }
 
 func getWxm(name string) (customEwm interface{}) {