Bladeren bron

feat:xiugai

wangchuanjin 1 jaar geleden
bovenliggende
commit
2c0c217053
1 gewijzigde bestanden met toevoegingen van 19 en 9 verwijderingen
  1. 19 9
      api/internal/service/network.go

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

@@ -405,13 +405,20 @@ func (n *network) AllProject(in *types.AllprojectReq) (reply *types.Reply) {
 			pm["SZ_LEAF"] = 1
 		}
 		sort.Sort(v)
-		id := ""
-		pType := ""
+		id, pType, pMyType, pMyId := "", "", "", ""
 		for _, vv := range v.Children {
-			tempId := vv.CompanyId
+			myId := vv.CompanyId
 			if vv.Type == "middleman" {
-				tempId = fmt.Sprint(vv.Id)
+				myId = fmt.Sprint(vv.Id)
 			}
+			if pMyId != "" {
+				pMyId += ","
+			}
+			pMyId += myId
+			if pMyType != "" {
+				pMyType += ","
+			}
+			pMyType += vv.Type
 			myChildIds, myChildTypes := "", ""
 			if in.Id == "" && v.Name == "甲方" {
 				for _, vvv := range firstpartyChild[vv.CompanyId] {
@@ -436,31 +443,34 @@ func (n *network) AllProject(in *types.AllprojectReq) (reply *types.Reply) {
 				if id != "" {
 					id += ","
 				}
-				id += tempId
+				id += myId
 				if pType != "" {
 					pType += ","
 				}
 				pType += vv.Type
-				myChildIds = tempId
+				myChildIds = myId
 				myChildTypes = vv.Type
 			}
 			cm := map[string]interface{}{
 				"NAME":      vv.CompanyName,
 				"ID":        myChildIds,
 				"SZ_PID0":   v.Name,
-				"SZ_PID1":   v.Name + ":" + tempId,
-				"CODE":      v.Name + ":" + tempId,
+				"SZ_PID1":   v.Name + ":" + myId,
+				"CODE":      v.Name + ":" + myId,
 				"PCODE":     v.Name,
 				"DATACOUNT": vv.Count,
 				"SZ_LEVEL":  1,
 				"SZ_LEAF":   1,
 				"TYPE":      myChildTypes,
-				"MYID":      tempId,
+				"MYID":      myId,
+				"MYTYPE":    vv.Type,
 			}
 			convList = append(convList, cm)
 		}
 		pm["ID"] = id
 		pm["TYPE"] = pType
+		pm["MYTYPE"] = pMyType
+		pm["MYID"] = pMyId
 		convList = append(convList, pm)
 	}
 	reply = &types.Reply{