wangchuanjin hai 9 meses
pai
achega
bfbcc9b7f5
Modificáronse 3 ficheiros con 8 adicións e 20 borrados
  1. 4 16
      api/internal/service/network.go
  2. 3 3
      api/internal/service/owner.go
  3. 1 1
      go.mod

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

@@ -143,7 +143,7 @@ func (n *nodeTrees) Swap(i, j int) {
 	(*n)[i], (*n)[j] = (*n)[j], (*n)[i]
 }
 
-//人脉库-添加/修改人脉
+// 人脉库-添加/修改人脉
 func (n *network) AddOrUpdate(in *types.AddOrUpdateReq) *types.Reply {
 	reply := &types.Reply{Data: map[string]interface{}{
 		"status": 0,
@@ -234,7 +234,7 @@ func (n *network) AddOrUpdate(in *types.AddOrUpdateReq) *types.Reply {
 	return reply
 }
 
-//人脉库-业主名称联想
+// 人脉库-业主名称联想
 func (n *network) Associate(in *types.AssociateReq) (reply *types.Reply) {
 	//类型;firstparty:甲方 supplier:供应商 adiffb:同甲异业 middleman:中间人 middleman_owner:中间人-业主 middleman_project:中间人-项目 agency:招标代理机构
 	res := []map[string]string{}
@@ -325,7 +325,7 @@ func (n *network) Associate(in *types.AssociateReq) (reply *types.Reply) {
 	return
 }
 
-//人脉库-全部人脉项目
+// 人脉库-全部人脉项目
 func (n *network) AllProject(in *types.AllprojectReq) (reply *types.Reply) {
 	reply = &types.Reply{}
 	key := fmt.Sprintf(NetworkManageAllProjectKey, in.PositionId)
@@ -578,7 +578,7 @@ func (n *network) AllProject(in *types.AllprojectReq) (reply *types.Reply) {
 	return reply
 }
 
-//人脉库-列表
+// 人脉库-列表
 func (n *network) List(in *types.NetWorkListReq) *types.Reply {
 	if in.Page_size <= 0 {
 		in.Page_size = 10
@@ -874,7 +874,6 @@ func (n *network) List(in *types.NetWorkListReq) *types.Reply {
 	}
 }
 
-//
 func (n *network) FirstpartyNetwork(name string, values []string) map[string][]*firstpartyNetwork {
 	result := map[string][]*firstpartyNetwork{}
 	if len(values) == 0 {
@@ -916,7 +915,6 @@ func (n *network) FirstpartyNetwork(name string, values []string) map[string][]*
 	return result
 }
 
-//
 func (n *network) Introduce_Firstparty(fpn map[string][]*firstpartyNetwork, businessType []string) map[string]*projectInfo {
 	values := []string{}
 	vm := map[string]*projectInfo{}
@@ -983,7 +981,6 @@ func (n *network) Introduce_Firstparty(fpn map[string][]*firstpartyNetwork, busi
 	return result
 }
 
-//
 func (n *network) Introduce_Supplier(values []string, businessType []string) map[string]*projectInfo {
 	if len(values) == 0 {
 		return map[string]*projectInfo{}
@@ -1037,7 +1034,6 @@ func (n *network) Introduce_Supplier(values []string, businessType []string) map
 	return n.MakeProjectInfo(buyers, vbs, businessType)
 }
 
-//
 func (n *network) Introduce_Agency(values []string, businessType []string) map[string]*projectInfo {
 	if len(values) == 0 {
 		return map[string]*projectInfo{}
@@ -1081,7 +1077,6 @@ func (n *network) Introduce_Agency(values []string, businessType []string) map[s
 	return n.MakeProjectInfo(buyers, vbs, businessType)
 }
 
-//
 func (n *network) Introduce_Middleman_Buyer(values []string, businessType []string) map[string]*projectInfo {
 	return n.BuyerProjectInfo(values, businessType)
 }
@@ -1124,7 +1119,6 @@ func (n *network) Introduce_Middleman_Project(values []string, businessType []st
 	return result
 }
 
-//
 func (n *network) TypeStrConvert(itype string) int64 {
 	//firstparty:甲方 supplier:供应商 adiffb:同甲异业 middleman:中间人 agency:招标代理机构
 	switch itype {
@@ -1142,7 +1136,6 @@ func (n *network) TypeStrConvert(itype string) int64 {
 	return 0
 }
 
-//
 func (n *network) TypeIntConvert(itype int64) string {
 	//firstparty:甲方 supplier:供应商 adiffb:同甲异业 middleman:中间人 agency:招标代理机构
 	switch itype {
@@ -1160,7 +1153,6 @@ func (n *network) TypeIntConvert(itype int64) string {
 	return ""
 }
 
-//
 func (n *network) GetQyxyId(ids []string) map[string]string {
 	m := map[string]string{}
 	if len(ids) == 0 {
@@ -1191,7 +1183,6 @@ func (n *network) GetQyxyId(ids []string) map[string]string {
 	return m
 }
 
-//
 func (n *network) BuyerProjectInfo(ids []string, businessType []string) map[string]*projectInfo {
 	vm := map[string]*projectInfo{}
 	if len(ids) == 0 {
@@ -1235,7 +1226,6 @@ func (n *network) BuyerProjectInfo(ids []string, businessType []string) map[stri
 	return vm
 }
 
-//
 func (n *network) MakeProjectInfo(buyers []string, vbs map[string][]*idName, businessType []string) map[string]*projectInfo {
 	pis := n.BuyerProjectInfo(buyers, businessType)
 	vm := map[string]*projectInfo{}
@@ -1263,7 +1253,6 @@ func (n *network) MakeProjectInfo(buyers []string, vbs map[string][]*idName, bus
 	return vm
 }
 
-//
 func (n *network) AllIntroduceOwner(sqlAppend1, sqlAppend2 string, args []interface{}, isTjProject bool, businessType []string) *introduceOwnerProject {
 	q := `select a.id,a.company_id,a.company_name,a.qyxy_id,a.itype,a.contact_person as person,a.contact_phone as phone,count(DISTINCT if(b.itype=1,b.relate_id,null)) as buyer_count,count(DISTINCT if(b.itype=2,b.relate_id,null)) as project_count,GROUP_CONCAT(IF(b.itype=1,b.relate_id,NULL)) AS relate_buyer_id,GROUP_CONCAT(IF(b.itype=1,b.relate_name,NULL)) AS relate_buyer_name,GROUP_CONCAT(IF(b.itype=2,b.relate_id,NULL)) AS relate_project_id,a.create_time from crm.connection a 
 		left join crm.connection_introduce b on (a.position_id=? and b.position_id=? and a.id=b.connection_id) where a.position_id=?` + sqlAppend1 + ` GROUP BY a.id order by a.create_time desc` + sqlAppend2
@@ -1325,7 +1314,6 @@ func (n *network) AllIntroduceOwner(sqlAppend1, sqlAppend2 string, args []interf
 	return iop
 }
 
-//
 func (n *network) DeleteCache(positionId int64) {
 	redis.Del("newother", fmt.Sprintf(NetworkManageAllProjectKey, positionId))
 	redis.DelByCodePattern("newother", fmt.Sprintf(NetworkManageList, positionId, "*"))

+ 3 - 3
api/internal/service/owner.go

@@ -704,14 +704,14 @@ func ProjectHandle(buyerArr []string, area, businessStr string, dataMap *map[str
 	projectMap := &map[string]map[string]interface{}{}
 	count := int64(0)
 	tscSql := `'` + strings.ReplaceAll(businessStr, ",", `','`) + `'`
-	sqlStr := `select buyer,buyer_id,groupUniqArray(area) as area,count(if(hasAny(topscopeclass,[`
+	sqlStr := `select buyer,buyer_id,groupUniqArray(area) as areaStr,count(if(hasAny(topscopeclass,[`
 	sqlStr += tscSql + `])=1 and project_bidstatus>1,1,null)) as ocount,SUM(if(hasAny(topscopeclass,[`
 	sqlStr += tscSql + `])=1 and project_bidstatus>1,project_money,0)) as project_money ,MAX(zbtime) as zbtime from transaction_info_all where`
 	buyer, buyerArgs := ConditionHandle(buyerArr)
 	sqlStr += fmt.Sprintf(fmt.Sprintf(" buyer_id in (%s)", buyer), buyerArgs...)
 	if len(area) > 0 && area != "" {
 		areaStr, areaArgs := ConditionHandle(strings.Split(area, ","))
-		sqlStr += fmt.Sprintf(fmt.Sprintf(" area in (%s)", areaStr), areaArgs...)
+		sqlStr += fmt.Sprintf(fmt.Sprintf(" and  area in (%s)", areaStr), areaArgs...)
 	}
 	sqlStr += " GROUP by buyer,buyer_id "
 	if sourceType == "1" {
@@ -757,7 +757,7 @@ func ProjectHandle(buyerArr []string, area, businessStr string, dataMap *map[str
 type BuyerAggStruct struct {
 	Buyer        string          `ch:"buyer"`
 	BuyerId      string          `ch:"buyer_id"`
-	Area         []string        `ch:"area"`
+	Area         []string        `ch:"areaStr"`
 	ProjectMoney decimal.Decimal `ch:"project_money"`
 	Zbtime       int64           `ch:"zbtime"`
 	Ocount       uint64          `ch:"ocount"`

+ 1 - 1
go.mod

@@ -1,6 +1,6 @@
 module bp.jydev.jianyu360.cn/CRM/networkManage
 
-go 1.19
+go 1.20
 
 require (
 	app.yhyue.com/moapp/jybase v0.0.0-20241028060726-9b8837ab6e42