wangchuanjin пре 8 месеци
родитељ
комит
8b64000eea
2 измењених фајлова са 19 додато и 16 уклоњено
  1. 4 2
      api/internal/service/network.go
  2. 15 14
      api/internal/service/network_test.go

+ 4 - 2
api/internal/service/network.go

@@ -1108,10 +1108,11 @@ func (n *network) Introduce_Supplier(values []string, businessType []string, pro
 		return map[string]*projectInfo{}
 	}
 	wh, args := WhArgs(values)
+	args = append(args, NetworkCom.ProjectYearLimit())
 	repeat := map[string]bool{}
 	whRepeat := map[string]map[string]bool{}
 	buyers := []string{}
-	q := `select winner_id,buyer_id,buyer from information.transaction_info_all prewhere hasAny(winner_id,[` + wh + `]) and buyer_id<>''`
+	q := `select winner_id,buyer_id,buyer from information.transaction_info_all prewhere hasAny(winner_id,[` + wh + `]) and buyer_id<>'' and zbtime>?`
 	rows, err := ClickhouseConn.Query(context.Background(), q, args...)
 	if err != nil {
 		logx.Error(err)
@@ -1161,7 +1162,8 @@ func (n *network) Introduce_Agency(values []string, businessType []string, proje
 		return map[string]*projectInfo{}
 	}
 	wh, args := WhArgs(values)
-	q := `select DISTINCT agency_id,buyer_id,buyer from information.transaction_info_all prewhere agency_id in (` + wh + `) and buyer_id<>''`
+	args = append(args, NetworkCom.ProjectYearLimit())
+	q := `select DISTINCT agency_id,buyer_id,buyer from information.transaction_info_all prewhere agency_id in (` + wh + `) and buyer_id<>'' and zbtime>?`
 	rows, err := ClickhouseConn.Query(context.Background(), q, args...)
 	if err != nil {
 		logx.Error(err)

+ 15 - 14
api/internal/service/network_test.go

@@ -78,8 +78,7 @@ func TestNetWorkList(t *testing.T) {
 	InitConf()
 	//类型;firstparty:甲方 supplier:供应商 adiffb:同甲异业 middleman:中间人 agency:招标代理机构
 	res := Network.List(&types.NetWorkListReq{
-		EntAccountId: 64,
-		UserId:       "1205591997",
+		EntId: 221,
 		//PositionId:   1205591997,
 		//PositionId: 1205592003,
 		PositionId:   935,
@@ -93,8 +92,8 @@ func TestNetWorkList(t *testing.T) {
 		Project_matchme: 1,
 		//Starttime: "2024-04-23",
 		//Endtime:   "2024-04-23",
-		//Type: "middleman",
-		//Name: "新疆",
+		//Type: "agency",
+		//Name: "中英保集团有限公司",
 	})
 	for k, v := range res.Data.(map[string]interface{}) {
 		if k == "list" {
@@ -109,11 +108,13 @@ func TestNetWorkList(t *testing.T) {
 func TestAllProject(t *testing.T) {
 	InitConf()
 	res := Network.AllProject(&types.AllprojectReq{
-		EntId:      221,
-		PositionId: 935,
-		//ClickId:    "30126",
-		//ClickId: "a2c934cc9fda4561864077f2cf7f44ba",
-		//CheckCode: "同甲异业渠道,同甲异业渠道:ffe7b3b526f048f9999b803a4241ce77",
+		EntId:      1,
+		PositionId: 65858,
+		//ClickId:    "30126", //甲方 有多级
+		//ClickId: "60090", //甲方 有一级
+		//ClickId:    "13", //供应商
+		//ClickId:   "a2c934cc9fda4561864077f2cf7f44ba",
+		//CheckCode: "同甲异业渠道:ffe7b3b526f048f9999b803a4241ce77",
 		//PositionId: 1205591997, //刘苗
 		//PositionId: 1205592003,//刘亚丽
 		//Id:   "009c313ef8e740e59d57432aea777102",
@@ -126,11 +127,11 @@ func TestAllProject(t *testing.T) {
 func TestOwner(t *testing.T) {
 	InitConf()
 	ownerService := &OwnerService{
-		//PartyA: "ffe7b3b526f048f9999b803a4241ce77",
+		PartyA:      "ffe7b3b526f048f9999b803a4241ce77",
 		Heterotophy: "ffe7b3b526f048f9999b803a4241ce77",
 		//Agency:      "wcj_11111111c,112233445566,001dfe3364b8480c965f81ab64d76bb4,00172d07d1fd4d90bd95fe5a348a845d",
-		//Agency:      "00172d07d1fd4d90bd95fe5a348a845d",
-		//Supplier:    "ffe7b3b526f048f9999b803a4241ce77",
+		Agency:      "00172d07d1fd4d90bd95fe5a348a845d",
+		Supplier:    "ffe7b3b526f048f9999b803a4241ce77",
 		PageIndex:   1,
 		PageSize:    100,
 		ProjectType: "1",
@@ -159,7 +160,7 @@ func TestCoopHistoryService(t *testing.T) {
 		PositionId:  935,
 		EntId:       221,
 		Buyer:       "武汉市中心医院",
-		ChannelType: "2",
+		ChannelType: "0",
 	})
 	log.Println(result.Size_1, result.Size_2, result.Size_3, result.Size_4)
 	for _, v := range result.Result {
@@ -190,7 +191,7 @@ func TestDeleteCache(t *testing.T) {
 
 func TestIntroduceSupplier(t *testing.T) {
 	InitConf()
-	for k, v := range Network.Introduce_Supplier([]string{"fb180e2267d74081a0e177692df92b42"}, []string{"建筑工程", "机械设备", "信息技术"}) {
+	for k, v := range Network.Introduce_Supplier([]string{"fb180e2267d74081a0e177692df92b42"}, []string{"建筑工程", "机械设备", "信息技术"}, true) {
 		log.Println(k, fmt.Sprintf("%+v", v))
 	}
 }