wangchuanjin пре 1 година
родитељ
комит
14392c4b7f
4 измењених фајлова са 52 додато и 30 уклоњено
  1. 15 5
      api/etc/crmapplication.yaml
  2. 4 4
      api/etc/db.yaml
  3. 29 9
      api/internal/service/network_test.go
  4. 4 12
      api/internal/service/owner.go

+ 15 - 5
api/etc/crmapplication.yaml

@@ -5,28 +5,38 @@ Timeout: 20000
 Gateway:
   ServerCode: crmApplication
   Etcd:
-    - 192.168.3.206:2379
+    - 192.168.3.207:2379
+    - 192.168.3.165:2379
+    - 192.168.3.204:2379
 UserCenterRpc:
   Etcd:
     Hosts:
-    - 192.168.3.206:2379
+    - 192.168.3.207:2379
+    - 192.168.3.165:2379
+    - 192.168.3.204:2379
     Key: usercenter.rpc
 FileCenterRpc:
   Etcd:
     Hosts:
-    - 192.168.3.206:2379
+    - 192.168.3.207:2379
+    - 192.168.3.165:2379
+    - 192.168.3.204:2379
     Key: filecenter.rpc
 ossBucketName: jytest2022
 ossUrl: https://jytest2022.oss-cn-beijing.aliyuncs.com
 BaseCenterRpc:
   Etcd:
     Hosts:
-    - 192.168.3.206:2379
+    - 192.168.3.207:2379
+    - 192.168.3.165:2379
+    - 192.168.3.204:2379
     Key: basecenter.rpc
 NextFollowUpTime: 2
 SocialPlatformRpc:
   Etcd:
     Hosts:
-    - 192.168.3.206:2379
+    - 192.168.3.207:2379
+    - 192.168.3.165:2379
+    - 192.168.3.204:2379
     Key: social.rpc
 ResourceCenterKey: resource.rpc

+ 4 - 4
api/etc/db.yaml

@@ -32,9 +32,9 @@ mongo:
     main:
         dbName: qfw
         size: 5
-        address: 192.168.3.206:27080
+        address: 192.168.3.149:27180
     bidding:
-        address: 192.168.3.206:27002
+        address: 192.168.3.149:27102
         size: 5
         dbName: qfw_data
         collection: bidding
@@ -42,7 +42,7 @@ mongo:
         userName: jyDevGroup
         password: jy@DevGroup
     ent:
-        address: 192.168.3.206:27002
+        address: 192.168.3.149:27102
         size: 5
         dbName: mixdata
         replSet: ""
@@ -51,7 +51,7 @@ mongo:
         userName: jyDevGroup
         password: jy@DevGroup
     projectset:
-        address: 192.168.3.206:27002
+        address: 192.168.3.149:27102
         size: 5
         dbName: qfw_data
         replSet: ""

+ 29 - 9
api/internal/service/network_test.go

@@ -3,25 +3,20 @@ package service
 import (
 	"context"
 	"encoding/json"
+	"fmt"
 	"log"
 	"testing"
 
-	"github.com/zeromicro/go-zero/zrpc"
-
 	. "app.yhyue.com/moapp/jybase/common"
-	"app.yhyue.com/moapp/jybase/es"
-	. "app.yhyue.com/moapp/jybase/mongodb"
-	"app.yhyue.com/moapp/jybase/mysql"
 	. "bp.jydev.jianyu360.cn/CRM/application/api/common"
-	"bp.jydev.jianyu360.cn/CRM/application/api/internal/config"
 	"bp.jydev.jianyu360.cn/CRM/application/api/internal/types"
 	"bp.jydev.jianyu360.cn/CRM/application/service"
-	"bp.jydev.jianyu360.cn/CRM/baseCenter/rpc/basecenter"
 )
 
 //go test -test.run=TestAddCustomService -fs=../../etc/crmapplication.yaml -lf=../../etc/logs.yaml -df=../../etc/db.yaml -pf=../../etc/push.yaml
 
 func TestAddOrUpdate(t *testing.T) {
+	InitConf()
 	defer Catch()
 	res1 := Network.AddOrUpdate(&types.AddOrUpdateReq{
 		PositionId:           943,
@@ -68,6 +63,7 @@ func TestAddOrUpdate(t *testing.T) {
 }
 
 func TestAssociate(t *testing.T) {
+	InitConf()
 	//log.Println(NetworkCom.GetEntTagSeat(2))
 	//类型;firstparty:甲方 supplier:供应商 adiffb:同甲异业 middleman:中间人 middleman_owner:中间人-业主 middleman_project:中间人-项目 agency:招标代理机构
 	//
@@ -81,6 +77,7 @@ func TestAssociate(t *testing.T) {
 }
 
 func TestNetWorkList(t *testing.T) {
+	InitConf()
 	//类型;firstparty:甲方 supplier:供应商 adiffb:同甲异业 middleman:中间人 agency:招标代理机构
 	res := Network.List(&types.NetWorkListReq{
 		EntAccountId: 64,
@@ -112,6 +109,7 @@ func TestNetWorkList(t *testing.T) {
 	}
 }
 func TestAllProject(t *testing.T) {
+	InitConf()
 	res := Network.AllProject(&types.AllprojectReq{
 		EntAccountId: 64,
 		//PositionId:   935,
@@ -125,9 +123,10 @@ func TestAllProject(t *testing.T) {
 }
 
 func TestOwner(t *testing.T) {
+	InitConf()
 	ownerService := &OwnerService{
-		Intermediary: "30154",
-		PositionId:   935,
+		Intermediary: "30157",
+		PositionId:   1205591997,
 		PageIndex:    1,
 		PageSize:     100,
 	}
@@ -137,6 +136,7 @@ func TestOwner(t *testing.T) {
 }
 
 func TestAddCustomService(t *testing.T) {
+	InitConf()
 	cs := &service.CustomService{
 		PositionId:           1205591997,
 		AppId:                "10000",
@@ -156,3 +156,23 @@ func TestAddCustomService(t *testing.T) {
 	}
 	cs.Add(context.Background())
 }
+func TestCandidateChannel(t *testing.T) {
+	InitConf()
+	ownerService := &OwnerService{
+		//PartyA: "",
+		//Supplier:     req.Supplier,
+		Intermediary: "30154",
+		//Heterotophy:  req.Heterotophy,
+		//Agency:       req.Agency,
+		EntAccountId: 64,
+		PositionId:   935,
+	}
+	data, a1, a2, a3, a4 := ownerService.CandidateChannel()
+	for _, v := range data {
+		log.Println(fmt.Sprintf("%+v", v))
+	}
+	log.Println(a1)
+	log.Println(a2)
+	log.Println(a3)
+	log.Println(a4)
+}

+ 4 - 12
api/internal/service/owner.go

@@ -1,7 +1,6 @@
 package service
 
 import (
-	elastic "app.yhyue.com/moapp/jybase/es"
 	"context"
 	"encoding/json"
 	"fmt"
@@ -9,6 +8,8 @@ import (
 	"strings"
 	"time"
 
+	elastic "app.yhyue.com/moapp/jybase/es"
+
 	"app.yhyue.com/moapp/jybase/encrypt"
 
 	"app.yhyue.com/moapp/jybase/common"
@@ -1156,16 +1157,7 @@ func (t *OwnerService) CandidateChannel() ([]*ResultData, int, int, int, int) {
 	}
 	//状态处理
 	if len(returnData) > 0 {
-		monitorMap := map[string]bool{}
-		query := map[string]interface{}{
-			"userId": gconv.String(t.PositionId),
-		}
-		clist, ok := Mgo.Find("follow_customer", query, ``, `{"name":1}`, false, -1, -1)
-		if ok && clist != nil && len(*clist) > 0 {
-			for _, v := range *clist {
-				monitorMap[gconv.String(v["name"])] = true
-			}
-		}
+		monitorMap := NetworkCom.EntMonitor(gconv.String(t.PositionId))
 		_, ignoredMap, createdMap := FindStatus(t.PositionId)
 		for k, value := range returnData {
 			buyerId := value.BuyerId
@@ -1175,7 +1167,7 @@ func (t *OwnerService) CandidateChannel() ([]*ResultData, int, int, int, int) {
 			if _, ok := createdMap[buyerId]; ok {
 				value.IsCreateCustomer = true
 			}
-			if _, ok := monitorMap[buyerId]; ok {
+			if _, ok := monitorMap[value.EntName]; ok {
 				value.IsMonitor = true
 			}
 			returnData[k] = value