Browse Source

feat:xiugai

wangchuanjin 9 months ago
parent
commit
36b5833ed8
2 changed files with 10 additions and 7 deletions
  1. 1 1
      api/internal/service/CoopHistoryService.go
  2. 9 6
      api/internal/service/network.go

+ 1 - 1
api/internal/service/CoopHistoryService.go

@@ -133,7 +133,7 @@ func GetPrList(req *types.CoopHistoryReq) *PrListRes {
 	}
 	// 关联单位
 	var r4 []map[string]interface{}
-	r4 = Findfirstparty([]string{fmt.Sprintf("'%s'", pTmp.BuyerId)}, r4)
+	r4 = Findfirstparty([]string{pTmp.BuyerId}, r4)
 	prListRes.Size_2 = int64(len(r4))
 	if req.ChannelType == "0" || req.ChannelType == "2" {
 		for _, m := range r4 {

+ 9 - 6
api/internal/service/network.go

@@ -5,6 +5,7 @@ import (
 	"database/sql"
 	"encoding/json"
 	"fmt"
+	"log"
 	"math"
 	"sort"
 	"strings"
@@ -331,7 +332,7 @@ func (n *network) AllProject(in *types.AllprojectReq) (reply *types.Reply) {
 	reply = &types.Reply{}
 	key := fmt.Sprintf(NetworkManageAllProjectKey, in.PositionId)
 	rbt, rerr := redis.GetNewBytes("newother", key)
-	if rerr == nil && rbt != nil {
+	if false && rerr == nil && rbt != nil {
 		json.Unmarshal(*rbt, &reply)
 		return
 	}
@@ -473,7 +474,6 @@ func (n *network) AllProject(in *types.AllprojectReq) (reply *types.Reply) {
 		sort.Sort(v)
 		id, pType, pMyType, pMyId := "", "", "", ""
 		for _, vv := range v.Children {
-			childStartCheckCodeLen := len(checkCode)
 			myId := vv.CompanyId
 			if vv.Type == "middleman" {
 				myId = fmt.Sprint(vv.Id)
@@ -524,7 +524,8 @@ func (n *network) AllProject(in *types.AllprojectReq) (reply *types.Reply) {
 						}
 						cccNodes = append(cccNodes, nt)
 						cccIndexMap[vvv.Name] = len(cccNodes) - 1
-						if (!hasDefaultCheck && vv.Count > 0) || compareId == in.ClickId {
+						if !hasDefaultCheck || compareId == in.ClickId {
+							log.Println("-----1", nt.CODE)
 							checkCode = append(checkCode, nt.CODE)
 						}
 					}
@@ -560,11 +561,12 @@ func (n *network) AllProject(in *types.AllprojectReq) (reply *types.Reply) {
 						MYTYPE:    "firstparty",
 						DATACOUNT: dataCount,
 					}
-					if (!hasDefaultCheck && vv.Count > 0) || compareId == in.ClickId {
+					if !hasDefaultCheck || compareId == in.ClickId {
+						log.Println("-----2", nt.CODE)
 						checkCode = append(checkCode, nt.CODE)
 					}
 					*convList = append(*convList, nt)
-					if !hasDefaultCheck && vv.Count > 0 {
+					if !hasDefaultCheck {
 						hasDefaultCheck = true
 					}
 				}
@@ -610,7 +612,8 @@ func (n *network) AllProject(in *types.AllprojectReq) (reply *types.Reply) {
 				MYTYPE:    vv.Type,
 			}
 			//如果甲方的子节点被选中了,父节点跟着被选中,非甲方的要对比子节点可介绍业主
-			if (!hasDefaultCheck && vv.Count > 0) || childStartCheckCodeLen != len(checkCode) || (v.Name != "甲方" && in.ClickId != "" && compareId == fmt.Sprint(vv.Id)) {
+			if !hasDefaultCheck || (v.Name != "甲方" && in.ClickId != "" && compareId == fmt.Sprint(vv.Id)) {
+				log.Println("-----3", cm.CODE)
 				hasDefaultCheck = true
 				checkCode = append(checkCode, cm.CODE)
 			}