Răsfoiți Sursa

feat:xiugai

wangchuanjin 1 an în urmă
părinte
comite
43fa44f4de
2 a modificat fișierele cu 17 adăugiri și 4 ștergeri
  1. 14 1
      api/internal/service/network.go
  2. 3 3
      api/internal/service/network_test.go

+ 14 - 1
api/internal/service/network.go

@@ -637,7 +637,19 @@ func (n *network) List(in *types.NetWorkListReq) *types.Reply {
 			}
 			export_url := ""
 			if len(export_id) > 0 {
-				export_url = "/subscribepay/network/projectExport?export_id=" + encrypt.SE.EncodeStringByCheck(strings.Join(export_id, ","))
+				exportIdRepeat := map[string]bool{}
+				exportId := ""
+				for _, v := range export_id {
+					if exportIdRepeat[v] {
+						continue
+					}
+					exportIdRepeat[v] = true
+					if exportId != "" {
+						exportId += ","
+					}
+					exportId += v
+				}
+				export_url = "/subscribepay/network/projectExport?export_id=" + encrypt.SE.EncodeStringByCheck(exportId)
 			}
 			url := ""
 			if v.Qyxy_id != "" && (jump_type == "supplier" || jump_type == "adiffb") {
@@ -810,6 +822,7 @@ func (n *network) Introduce_Firstparty(fpn map[string][]*firstpartyNetwork, entM
 			}
 			result[k].ProjectCount += vm[vv.CompanyId].ProjectCount
 			result[k].ProjectAmount += vm[vv.CompanyId].ProjectAmount
+			result[k].ExportId = append(result[k].ExportId, vm[vv.CompanyId].ExportId...)
 		}
 	}
 	return result

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

@@ -35,7 +35,7 @@ func initDb() {
 	es.NewEs("v7", "http://192.168.3.149:9200", 5, "", "")
 	log.Println("ccccccc")
 	Mgo = MongodbSim{
-		MongodbAddr: "192.168.3.206:27080",
+		MongodbAddr: "192.168.3.149:27180",
 		Size:        2,
 		DbName:      "qfw",
 	}
@@ -118,7 +118,7 @@ func TestNetWorkList(t *testing.T) {
 		//Project_matchme: 1,
 		//Starttime: "2024-04-23",
 		//Endtime:   "2024-04-23",
-		//Type: "middleman",
+		Type: "firstparty",
 		//Name: "三亚市",
 	})
 	for k, v := range res.Data.(map[string]interface{}) {
@@ -138,7 +138,7 @@ func TestAllProject(t *testing.T) {
 		//PositionId:   935,
 		PositionId: 1205591997,
 		//Id:         "wcj_11111111a",
-		//Type:       "firstparty",
+		//Type: "firstparty",
 	})
 	b, _ := json.Marshal(res.Data)
 	log.Println(string(b))