wangchuanjin 1 年間 前
コミット
52339d1f84

+ 22 - 13
api/application.api

@@ -229,23 +229,32 @@ type (
 		Type                   string `json:"type,optional"`
 	}
 	AssociateReq {
-		Name string `json:"name"`
-		Type string `json:"type"`
+		EntAccountId int64  `header:"entAccountId"`
+		EntName      string `header:"entName"`
+		Name         string `json:"name"`
+		Type         string `json:"type"`
 	}
 	AllprojectReq {
-		PositionId int64  `header:"positionId"`
-		Name       string `json:"name,optional"`
+		EntAccountId int64  `header:"entAccountId"`
+		PositionId   int64  `header:"positionId"`
+		Name         string `json:"name,optional"`
+		Type         int64  `json:"type,optional"`
+		Id           string `json:"id,optional"`
 	}
 	NetWorkListReq {
-		PositionId      int64  `header:"positionId"`
-		Type            string `json:"type,optional"`
-		Name            string `json:"name,optional"`
-		Monitor         string `json:"monitor,optional"`
-		Starttime       string `json:"starttime,optional"`
-		Endtime         string `json:"endtime,optional"`
-		Order_amount    string `json:"order_amount,optional"`
-		Current_page    string `json:"current_page,optional"`
-		Project_matchme string `json:"project_matchme,optional"`
+		PositionId         int64  `header:"positionId"`
+		Type               string `json:"type,optional"`
+		Name               string `json:"name,optional"`
+		Monitor            int64  `json:"monitor,optional"`
+		Starttime          string `json:"starttime,optional"`
+		Endtime            string `json:"endtime,optional"`
+		Order_amount       int64  `json:"order_amount,optional"`
+		Current_page       int64  `json:"current_page,optional"`
+		Project_matchme    int64  `json:"project_matchme,optional"`
+		Buyercount_start   int64  `json:"buyercount_start,optional"`
+		Buyercount_end     int64  `json:"buyercount_end,optional"`
+		Monitorcount_start int64  `json:"monitorcount_start,optional"`
+		Monitorcount_end   int64  `json:"monitorcount_end,optional"`
 	}
 )
 

+ 37 - 0
api/common/network.go

@@ -3,7 +3,9 @@ package common
 import (
 	"context"
 	"fmt"
+	"strings"
 
+	. "app.yhyue.com/moapp/jybase/common"
 	"github.com/zeromicro/go-zero/core/logx"
 )
 
@@ -36,3 +38,38 @@ func (n *networkCom) GetEntTagSeat(labelType int) []string {
 	}
 	return array
 }
+
+//获取我的业态
+func (n *networkCom) GetMyProbusfor(entAccoutId int64) []string {
+	datas := CrmMysql.SelectBySql(`select probusfor from crm.config_tenant where account_id=?`, entAccoutId)
+	if datas == nil || len(*datas) == 0 {
+		return nil
+	}
+	probusfor := ObjToString((*datas)[0]["probusfor"])
+	if probusfor == "" {
+		return nil
+	}
+	return strings.Split(probusfor, ",")
+}
+
+//
+func (n *networkCom) Count(query string, args ...interface{}) int64 {
+	row := ClickhouseConn.QueryRow(context.Background(), query, args...)
+	var count uint64
+	if err := row.Scan(&count); err != nil {
+		logx.Error(err)
+		return 0
+	}
+	return int64(count)
+}
+
+//
+func (n *networkCom) WhArgs(args []string) (string, []interface{}) {
+	newArgs := make([]interface{}, len(args))
+	wh := make([]string, len(args))
+	for k, v := range args {
+		newArgs[k] = v
+		wh[k] = "?"
+	}
+	return strings.Join(wh, ","), newArgs
+}

+ 319 - 49
api/internal/service/network.go

@@ -1,41 +1,45 @@
 package service
 
 import (
+	"context"
 	"database/sql"
 	"fmt"
+	"math"
 	"strings"
+	"sync"
 
 	. "app.yhyue.com/moapp/jybase/common"
 	. "app.yhyue.com/moapp/jybase/date"
 	. "app.yhyue.com/moapp/jybase/es"
 	. "bp.jydev.jianyu360.cn/CRM/application/api/common"
 	"bp.jydev.jianyu360.cn/CRM/application/api/internal/types"
+	"github.com/zeromicro/go-zero/core/logx"
 )
 
 var Network = &network{}
 
 type network struct {
 }
+type networkTree struct {
+	Count    int64
+	Name     string
+	Children []*networkTreeChild
+}
+type networkTreeChild struct {
+	Count int64
+	Name  string
+	Id    string
+	Type  int
+}
 
 //人脉库-添加/修改人脉
 func (n *network) AddOrUpdate(in *types.AddOrUpdateReq) *types.Reply {
 	reply := &types.Reply{}
-	itype := 0
-	//firstparty:甲方 supplier:供应商 adiffb:同甲异业 middleman:中间人 agency:招标代理机构
-	switch in.Type {
-	case "firstparty":
-		itype = 1
-	case "supplier:供应商":
-		itype = 2
-	case "adiffb":
-		itype = 3
-	case "middleman":
-		itype = 4
-	case "agency":
-		itype = 5
-	}
 	nowFormat := NowFormat(Date_Full_Layout)
-	var saveIntroduce = func(tx *sql.Tx, cid int64) int64 {
+	var saveIntroduce = func(tx *sql.Tx, cid int64, isUpdate bool) bool {
+		if in.Type != "middleman" {
+			return true
+		}
 		values := []interface{}{}
 		if in.Introduce_owner_id != "" {
 			for k, v := range strings.Split(in.Introduce_owner_id, ",") {
@@ -47,17 +51,20 @@ func (n *network) AddOrUpdate(in *types.AddOrUpdateReq) *types.Reply {
 				values = append(values, in.PositionId, in.EntId, in.EntDeptId, in.EntUserId, cid, v, strings.Split(in.Introduce_project_name, ",")[k], 2, nowFormat)
 			}
 		}
-		var r3 int64
-		if len(values) > 0 {
-			_, r3 = CrmMysql.InsertBatchByTx(tx, "crm.connection_introduce", []string{"position_id", "ent_id", "ent_dept_id", "ent_user_id", "connection_id", "relate_id", "relate_name", "itype", "create_time"}, values)
+		if len(values) == 0 {
+			return false
 		}
-		return r3
+		var r2 int64
+		if isUpdate {
+			r2 = CrmMysql.UpdateOrDeleteBySqlByTx(tx, `delete from crm.connection_introduce where connection_id=? and position_id=?`, in.Id, in.PositionId)
+		}
+		r3, _ := CrmMysql.InsertBatchByTx(tx, "crm.connection_introduce", []string{"position_id", "ent_id", "ent_dept_id", "ent_user_id", "connection_id", "relate_id", "relate_name", "itype", "create_time"}, values)
+		return r2 >= 0 && r3 > 0
 	}
 	if in.Id > 0 {
 		if CrmMysql.ExecTx("更新人脉", func(tx *sql.Tx) bool {
 			r1 := CrmMysql.UpdateOrDeleteBySqlByTx(tx, `update crm.connection set company_name=?,company_id=?,contact_person=?,contact_phone=?,update_time=? where id=? and position_id=?`, in.Company_name, in.Company_id, in.Contact_person, in.Contact_phone, nowFormat, in.Id, in.PositionId)
-			r2 := CrmMysql.UpdateOrDeleteBySqlByTx(tx, `delete from crm.connection_introduce where connection_id=? and position_id=?`, in.Id, in.PositionId)
-			return r1 > 0 && r2 >= 0 && saveIntroduce(tx, in.Id) >= 0
+			return r1 >= 0 && saveIntroduce(tx, in.Id, true)
 		}) {
 			reply.Data = map[string]interface{}{
 				"status": 1,
@@ -68,14 +75,15 @@ func (n *network) AddOrUpdate(in *types.AddOrUpdateReq) *types.Reply {
 			}
 		}
 	} else {
-		id := 0
+		itype := n.TypeConvert(in.Type)
+		var r1 int64
 		if CrmMysql.ExecTx("新增人脉", func(tx *sql.Tx) bool {
-			_, r1 := CrmMysql.InsertBatchByTx(tx, "crm.connection", []string{"position_id", "ent_id", "ent_dept_id", "ent_user_id", "itype", "company_name", "company_id", "contact_person", "contact_phone", "status", "create_time", "update_time"}, []interface{}{in.PositionId, in.EntId, in.EntDeptId, in.EntUserId, itype, in.Company_name, in.Company_id, in.Contact_person, in.Contact_phone, 1, nowFormat, nowFormat})
-			return r1 > 0 && saveIntroduce(tx, r1) >= 0
+			_, r1 = CrmMysql.InsertBatchByTx(tx, "crm.connection", []string{"position_id", "ent_id", "ent_dept_id", "ent_user_id", "itype", "company_name", "company_id", "contact_person", "contact_phone", "status", "create_time", "update_time"}, []interface{}{in.PositionId, in.EntId, in.EntDeptId, in.EntUserId, itype, in.Company_name, in.Company_id, in.Contact_person, in.Contact_phone, 1, nowFormat, nowFormat})
+			return r1 > 0 && saveIntroduce(tx, r1, false)
 		}) {
 			reply.Data = map[string]interface{}{
 				"status": 1,
-				"id":     id,
+				"id":     r1,
 			}
 		} else {
 			reply.Data = map[string]interface{}{
@@ -90,39 +98,301 @@ func (n *network) AddOrUpdate(in *types.AddOrUpdateReq) *types.Reply {
 func (n *network) Associate(in *types.AssociateReq) *types.Reply {
 	//类型;firstparty:甲方 supplier:供应商 adiffb:同甲异业 middleman:中间人 middleman_owner:中间人-业主 middleman_project:中间人-项目 agency:招标代理机构
 	res := []map[string]interface{}{}
-	must := []string{fmt.Sprintf(`{"multi_match":{"query":"%s","type":"phrase","fields":["company_name"]}}`, in.Name)}
-	switch in.Type {
-	case "firstparty":
-		must = append(must, fmt.Sprintf(`{"terms":{"company_label":["%s"]}}`, strings.Join(NetworkCom.GetEntTagSeat(2), `","`)))
-		must = append(must, `{"terms":{"company_unit_type":[1,2]}}`)
-	case "supplier":
-		must = append(must, fmt.Sprintf(`{"terms":{"company_label":["%s"]}}`, strings.Join(NetworkCom.GetEntTagSeat(2), `","`)))
-		must = append(must, `{"term":{"company_unit_type":3}}`)
-	case "middleman_owner":
-		must = append(must, `{"terms":{"company_unit_type":[1,2]}}`)
-	case "agency":
-		must = append(must, `{"term":{"company_unit_type":4}}`)
-	}
-	datas := VarEs.Get("ent_info", "ent_info", fmt.Sprintf(`{"query":{"bool":{"must":[%s]}},"size":10,"_source":["id","company_name"]}`, strings.Join(must, ",")))
-	if datas != nil {
-		for _, v := range *datas {
-			res = append(res, map[string]interface{}{
-				"company_name": ObjToString(v["company_name"]),
-				"company_id":   ObjToString(v["id"]),
-			})
+	if in.Type == "adiffb" {
+		probusfors := NetworkCom.GetMyProbusfor(in.EntAccountId)
+		if len(probusfors) > 0 {
+			args := []interface{}{in.EntName}
+			wh, newArgs := NetworkCom.WhArgs(probusfors)
+			args = append(args, newArgs...)
+			q := `select b.winner,b.winner_id from information.transaction_info a 
+				inner join information.transaction_info b on (has(a.winner, ?) and a.buyer_id=b.buyer_id and hasAny(b.property_form,[` + wh + `])`
+			if in.Name != "" {
+				q += ` and b.winner like ?`
+				args = append(args, "%"+in.Name+"%")
+			}
+			q += `) order by b.winner`
+			rows, err := ClickhouseConn.Query(context.Background(), q, args...)
+			if err != nil {
+				logx.Error(err)
+			} else {
+				for rows.Next() {
+					var (
+						company_name string
+						company_id   string
+					)
+					if err := rows.Scan(&company_name, &company_id); err != nil {
+						logx.Error(err)
+						continue
+					}
+					res = append(res, map[string]interface{}{
+						"company_name": company_name,
+						"company_id":   company_id,
+					})
+				}
+				rows.Close()
+				if err := rows.Err(); err != nil {
+					logx.Error(err)
+				}
+			}
+		}
+	} else {
+		must := []string{fmt.Sprintf(`{"multi_match":{"query":"%s","type":"phrase","fields":["company_name"]}}`, in.Name)}
+		switch in.Type {
+		case "firstparty":
+			must = append(must, fmt.Sprintf(`{"terms":{"company_label":["%s"]}}`, strings.Join(NetworkCom.GetEntTagSeat(2), `","`)))
+			must = append(must, `{"terms":{"company_unit_type":[1,2]}}`)
+		case "supplier":
+			must = append(must, fmt.Sprintf(`{"terms":{"company_label":["%s"]}}`, strings.Join(NetworkCom.GetEntTagSeat(2), `","`)))
+			must = append(must, `{"term":{"company_unit_type":3}}`)
+		case "middleman_owner":
+			must = append(must, `{"terms":{"company_unit_type":[1,2]}}`)
+		case "agency":
+			must = append(must, `{"term":{"company_unit_type":4}}`)
+		}
+		datas := VarEs.Get("ent_info", "ent_info", fmt.Sprintf(`{"query":{"bool":{"must":[%s]}},"size":10,"_source":["id","company_name"]}`, strings.Join(must, ",")))
+		if datas != nil {
+			for _, v := range *datas {
+				res = append(res, map[string]interface{}{
+					"company_name": ObjToString(v["company_name"]),
+					"company_id":   ObjToString(v["id"]),
+				})
+			}
 		}
 	}
 	return &types.Reply{
-		Data: datas,
+		Data: res,
 	}
 }
 
 //人脉库-全部人脉项目
-func (n *network) Allproject(in *types.AllprojectReq) *types.Reply {
-	return nil
+func (n *network) Allproject(in *types.AllprojectReq) (reply *types.Reply) {
+	pool := make(chan bool, 5)
+	wait := &sync.WaitGroup{}
+	lock := &sync.Mutex{}
+	reply = &types.Reply{}
+	wh, newArgs := NetworkCom.WhArgs(NetworkCom.GetMyProbusfor(in.EntAccountId))
+	if in.Id != "" {
+		if in.Type == 1 {
+			q := `select c.id as company_id,c.company_name,b.name from information.ent_map_code a 
+				inner join information.ent_code b on (a.a_id=? and b.pcode in ('0100','0200') and a.code=b.code) 
+				inner join information.ent_info c on (a.b_id=c.id)`
+			args := []interface{}{in.Id}
+			if in.Name != "" {
+				q += ` where c.company_name like ?`
+				args = append(args, "%"+in.Name+"%")
+			}
+			q += ` order by b.name,c.company_name`
+			rows, err := ClickhouseConn.Query(context.Background(), q, args...)
+			if err != nil {
+				logx.Error(err)
+				return
+			}
+			nameIndex := map[string]int{}
+			list := []*networkTree{}
+			for rows.Next() {
+				var (
+					company_id   string
+					company_name string
+					name         string
+				)
+				if err := rows.Scan(&company_id, &company_name, &name); err != nil {
+					logx.Error(err)
+					continue
+				}
+				if _, ok := nameIndex[name]; !ok {
+					nameIndex[name] = len(list)
+					list = append(list, &networkTree{
+						Name: name,
+					})
+				}
+				pool <- true
+				wait.Add(1)
+				go func(cIndex int, cId, cName string) {
+					defer func() {
+						<-pool
+						wait.Done()
+					}()
+					ntc := &networkTreeChild{
+						Name: cName,
+						Id:   cId,
+						Type: 1,
+					}
+					if wh != "" {
+						thisArgs := []interface{}{ntc.Id}
+						thisArgs = append(thisArgs, newArgs...)
+						ntc.Count = NetworkCom.Count(`select count(1) from information.transaction_info where buyer_id=? and hasAny(property_form,[`+wh+`])`, thisArgs...)
+					}
+					lock.Lock()
+					list[cIndex].Count += ntc.Count
+					list[cIndex].Children = append(list[cIndex].Children, ntc)
+					lock.Unlock()
+				}(nameIndex[name], company_id, company_name)
+			}
+			wait.Wait()
+			rows.Close()
+			if err := rows.Err(); err != nil {
+				logx.Error(err)
+			}
+		}
+	} else {
+		q := `SELECT a.company_id,a.company_name,b.itype AS TYPE,a.contact_person AS person,a.contact_phone AS phone,COUNT(b.id) AS ipc FROM crm.connection a 
+			LEFT JOIN crm.connection_introduce b ON (b.position_id=? AND b.itype=2 AND a.id=b.connection_id) WHERE a.position_id=?`
+		args := []interface{}{in.PositionId, in.PositionId}
+		if in.Name != "" {
+			q += ` and company_name like ?`
+			args = append(args, "%"+in.Name+"%")
+		}
+		q += ` GROUP BY a.id ORDER BY a.create_time DESC`
+		datas := CrmMysql.SelectBySql(q, args...)
+		var count int64
+		list := []*networkTree{
+			&networkTree{
+				Name: "甲方",
+			},
+			&networkTree{
+				Name: "供应商",
+			},
+			&networkTree{
+				Name: "同甲异业渠道",
+			},
+			&networkTree{
+				Name: "中间人",
+			},
+			&networkTree{
+				Name: "招标代理",
+			},
+		}
+		//
+		for _, vt := range *datas {
+			pool <- true
+			wait.Add(1)
+			go func(v map[string]interface{}) {
+				defer func() {
+					<-pool
+					wait.Done()
+				}()
+				itype := IntAll(v["itype"])
+				if itype <= 0 || itype >= len(list) {
+					return
+				}
+				ntc := &networkTreeChild{
+					Name: ObjToString(v["company_name"]),
+					Id:   ObjToString(v["company_id"]),
+					Type: IntAll(v["itype"]),
+				}
+				if wh != "" {
+					thisArgs := []interface{}{ntc.Id}
+					thisArgs = append(thisArgs, newArgs...)
+					if itype == 1 {
+						ntc.Count = NetworkCom.Count(`select count(1) from information.transaction_info where buyer_id=? and hasAny(b.property_form,[`+wh+`])`, thisArgs)
+					} else if itype == 2 || itype == 3 {
+						ntc.Count = NetworkCom.Count(`select count(1) from information.transaction_info where winner_id=? and hasAny(b.property_form,[`+wh+`])`, thisArgs)
+					} else if itype == 4 {
+						ntc.Count = Int64All(v["ipc"])
+					} else if itype == 5 {
+						ntc.Count = NetworkCom.Count(`select count(1) from information.transaction_info where agency_id=? and hasAny(b.property_form,[`+wh+`])`, thisArgs)
+					}
+				}
+				lock.Lock()
+				count += ntc.Count
+				list[itype].Count += ntc.Count
+				list[itype].Children = append(list[itype].Children, ntc)
+				lock.Unlock()
+			}(vt)
+		}
+		wait.Wait()
+		reply = &types.Reply{
+			Data: map[string]interface{}{
+				"count": count,
+				"list":  list,
+			},
+		}
+	}
+	return reply
 }
 
 //人脉库-列表
 func (n *network) List(in *types.NetWorkListReq) *types.Reply {
-	return nil
+	q := `select company_id,company_name,itype as type,contact_person as person,contact_phone as phone from crm.connection where position_id=?`
+	args := []interface{}{in.PositionId}
+	if in.Type != "" {
+		q += ` and itype=?`
+		args = append(args, n.TypeConvert(in.Type))
+	}
+	if in.Starttime != "" {
+		q += ` and create_time>=?`
+		args = append(args, in.Starttime)
+	}
+	if in.Endtime != "" {
+		q += ` and create_time<=?`
+		args = append(args, in.Endtime)
+	}
+	if in.Name != "" {
+		q += ` and company_name like ?`
+		args = append(args, "%"+in.Name+"%")
+	}
+	q += ` order by create_time desc`
+	list := CrmMysql.SelectBySql(q, args...)
+	finalList := []map[string]interface{}{}
+	length := int64(len(*list))
+	var pageSize int64 = 10
+	total_page := int64(math.Ceil(float64(length) / float64(pageSize)))
+	firstparty_count, supplier_count, adiffb_count, middleman_count, agency_count := 0, 0, 0, 0, 0
+	if length > 0 {
+		for _, v := range *list {
+			switch Int64All(v["itype"]) {
+			case 1:
+				firstparty_count++
+			case 2:
+				supplier_count++
+			case 3:
+				adiffb_count++
+			case 4:
+				middleman_count++
+			case 5:
+				agency_count++
+			}
+		}
+		if in.Current_page <= 0 {
+			in.Current_page = 1
+		}
+		if in.Current_page > total_page {
+			in.Current_page = total_page
+		}
+		start := (in.Current_page - 1) * pageSize
+		end := start + pageSize
+		if end > length {
+			end = length
+		}
+		finalList = (*list)[start:end]
+	}
+	return &types.Reply{
+		Data: map[string]interface{}{
+			"total_page":       total_page,
+			"firstparty_count": firstparty_count,
+			"supplier_count":   supplier_count,
+			"adiffb_count":     adiffb_count,
+			"middleman_count":  middleman_count,
+			"agency_count":     agency_count,
+			"list":             finalList,
+		},
+	}
+}
+
+//
+func (n *network) TypeConvert(itype string) int {
+	//firstparty:甲方 supplier:供应商 adiffb:同甲异业 middleman:中间人 agency:招标代理机构
+	switch itype {
+	case "firstparty":
+		return 1
+	case "supplier":
+		return 2
+	case "adiffb":
+		return 3
+	case "middleman":
+		return 4
+	case "agency":
+		return 5
+	}
+	return 0
 }

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

@@ -33,20 +33,36 @@ func initDb() {
 }
 func TestAddOrUpdate(t *testing.T) {
 	initDb()
-	res := Network.AddOrUpdate(&types.AddOrUpdateReq{
-		PositionId:             943,
-		Company_id:             "112233445566",
-		Company_name:           "王传进的测试企业1",
-		Contact_person:         "王传进1",
-		Contact_phone:          "15037870765",
-		Introduce_owner_id:     "11,22,33",
-		Introduce_owner_name:   "aa,bb,cc",
-		Introduce_project_id:   "44,55,66",
-		Introduce_project_name: "dd,ee,ff",
-		Type:                   "middleman",
-		Id:                     1,
-	})
-	log.Println(res)
+	//类型;firstparty:甲方 supplier:供应商 adiffb:同甲异业 middleman:中间人 agency:招标代理机构
+	for _, v := range []string{"firstparty", "supplier", "adiffb", "middleman", "agency"} {
+		text := ""
+		switch v {
+		case "firstparty":
+			text = "甲方"
+		case "supplier":
+			text = "供应商"
+		case "adiffb":
+			text = "同甲异业"
+		case "middleman":
+			text = "中间人"
+		case "agency":
+			text = "招标代理机构"
+		}
+		text += "_2"
+		res := Network.AddOrUpdate(&types.AddOrUpdateReq{
+			PositionId:             943,
+			Company_id:             "112233445566",
+			Company_name:           "王传进的" + text,
+			Contact_person:         "王传进",
+			Contact_phone:          "15037870765",
+			Introduce_owner_id:     "11,22,33",
+			Introduce_owner_name:   "aa,bb,cc",
+			Introduce_project_id:   "44,55,66",
+			Introduce_project_name: "dd,ee,ff",
+			Type:                   "middleman",
+		})
+		log.Println(res)
+	}
 }
 
 func TestAssociate(t *testing.T) {
@@ -59,3 +75,16 @@ func TestAssociate(t *testing.T) {
 	})
 	log.Println(res.Data)
 }
+
+func TestNetWorkList(t *testing.T) {
+	initDb()
+	//类型;firstparty:甲方 supplier:供应商 adiffb:同甲异业 middleman:中间人 agency:招标代理机构
+	res := Network.List(&types.NetWorkListReq{
+		PositionId: 943,
+		Name:       "王传进",
+	})
+	log.Println(res.Data.(map[string]interface{})["total_page"])
+	for _, v := range res.Data.(map[string]interface{})["list"].([]map[string]interface{}) {
+		log.Println(v)
+	}
+}

+ 22 - 13
api/internal/types/types.go

@@ -248,23 +248,32 @@ type AddOrUpdateReq struct {
 }
 
 type AssociateReq struct {
-	Name string `json:"name"`
-	Type string `json:"type"`
+	EntAccountId int64  `header:"entAccountId"`
+	EntName      string `header:"entName"`
+	Name         string `json:"name"`
+	Type         string `json:"type"`
 }
 
 type AllprojectReq struct {
-	PositionId int64  `header:"positionId"`
-	Name       string `json:"name,optional"`
+	EntAccountId int64  `header:"entAccountId"`
+	PositionId   int64  `header:"positionId"`
+	Name         string `json:"name,optional"`
+	Type         int64  `json:"type,optional"`
+	Id           string `json:"id,optional"`
 }
 
 type NetWorkListReq struct {
-	PositionId      int64  `header:"positionId"`
-	Type            string `json:"type,optional"`
-	Name            string `json:"name,optional"`
-	Monitor         string `json:"monitor,optional"`
-	Starttime       string `json:"starttime,optional"`
-	Endtime         string `json:"endtime,optional"`
-	Order_amount    string `json:"order_amount,optional"`
-	Current_page    string `json:"current_page,optional"`
-	Project_matchme string `json:"project_matchme,optional"`
+	PositionId         int64  `header:"positionId"`
+	Type               string `json:"type,optional"`
+	Name               string `json:"name,optional"`
+	Monitor            int64  `json:"monitor,optional"`
+	Starttime          string `json:"starttime,optional"`
+	Endtime            string `json:"endtime,optional"`
+	Order_amount       int64  `json:"order_amount,optional"`
+	Current_page       int64  `json:"current_page,optional"`
+	Project_matchme    int64  `json:"project_matchme,optional"`
+	Buyercount_start   int64  `json:"buyercount_start,optional"`
+	Buyercount_end     int64  `json:"buyercount_end,optional"`
+	Monitorcount_start int64  `json:"monitorcount_start,optional"`
+	Monitorcount_end   int64  `json:"monitorcount_end,optional"`
 }