|
@@ -8,6 +8,7 @@ import (
|
|
"math"
|
|
"math"
|
|
"sort"
|
|
"sort"
|
|
"strings"
|
|
"strings"
|
|
|
|
+ "sync"
|
|
"time"
|
|
"time"
|
|
|
|
|
|
. "app.yhyue.com/moapp/jybase/common"
|
|
. "app.yhyue.com/moapp/jybase/common"
|
|
@@ -374,7 +375,7 @@ func (n *network) AllProject(in *types.AllprojectReq) (reply *types.Reply) {
|
|
json.Unmarshal(*rbt, &aio)
|
|
json.Unmarshal(*rbt, &aio)
|
|
} else {
|
|
} else {
|
|
aio = n.AllIntroduceOwner(sqlAppend1, "", args, true, businessType)
|
|
aio = n.AllIntroduceOwner(sqlAppend1, "", args, true, businessType)
|
|
- redis.Put("newother", key, aio, C.CacheTimeOut)
|
|
|
|
|
|
+ redis.Put("newother", key, aio, NetworkCom.CacheTimeout())
|
|
}
|
|
}
|
|
firstparty = aio.Firstparty
|
|
firstparty = aio.Firstparty
|
|
firstpartyChild = aio.FirstpartyNetwork
|
|
firstpartyChild = aio.FirstpartyNetwork
|
|
@@ -758,13 +759,12 @@ func (n *network) List(in *types.NetWorkListReq) *types.Reply {
|
|
redisKey := fmt.Sprintf(NetworkManageList, in.PositionId, GetMd5String(fmt.Sprintf("%+v", in)))
|
|
redisKey := fmt.Sprintf(NetworkManageList, in.PositionId, GetMd5String(fmt.Sprintf("%+v", in)))
|
|
aio := &introduceOwnerProject{}
|
|
aio := &introduceOwnerProject{}
|
|
aioByte, aioErr := redis.GetNewBytes("newother", redisKey)
|
|
aioByte, aioErr := redis.GetNewBytes("newother", redisKey)
|
|
|
|
+ timeOut := NetworkCom.CacheTimeout()
|
|
if aioErr == nil && aioByte != nil {
|
|
if aioErr == nil && aioByte != nil {
|
|
- logx.Info("-----3333---")
|
|
|
|
json.Unmarshal(*aioByte, &aio)
|
|
json.Unmarshal(*aioByte, &aio)
|
|
} else {
|
|
} else {
|
|
- logx.Info("--------")
|
|
|
|
aio = n.AllIntroduceOwner(sqlAppend1, sqlAppend2, args, isTjProject, businessType)
|
|
aio = n.AllIntroduceOwner(sqlAppend1, sqlAppend2, args, isTjProject, businessType)
|
|
- redis.Put("newother", redisKey, aio, C.CacheTimeOut)
|
|
|
|
|
|
+ redis.Put("newother", redisKey, aio, timeOut)
|
|
}
|
|
}
|
|
entMonitor := NetworkCom.EntMonitor(in.UserId)
|
|
entMonitor := NetworkCom.EntMonitor(in.UserId)
|
|
for _, v := range aio.Networks {
|
|
for _, v := range aio.Networks {
|
|
@@ -891,24 +891,6 @@ func (n *network) List(in *types.NetWorkListReq) *types.Reply {
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- export_url := ""
|
|
|
|
- if len(export_id) > 0 {
|
|
|
|
- exportIdRepeat := map[string]bool{}
|
|
|
|
- exportId := ""
|
|
|
|
- for _, v := range export_id {
|
|
|
|
- if exportIdRepeat[v] {
|
|
|
|
- continue
|
|
|
|
- }
|
|
|
|
- exportIdRepeat[v] = true
|
|
|
|
- if exportId != "" {
|
|
|
|
- exportId += ","
|
|
|
|
- }
|
|
|
|
- exportId += v
|
|
|
|
- }
|
|
|
|
- md5Id := GetMd5String(exportId)
|
|
|
|
- redis.Put("newother", fmt.Sprintf("network_export_%s", md5Id), exportId, 259200)
|
|
|
|
- export_url = "/subscribepay/network/projectExport?version=1&export_id=" + md5Id
|
|
|
|
- }
|
|
|
|
url := ""
|
|
url := ""
|
|
if v.Qyxy_id != "" && (jump_type == "supplier" || jump_type == "adiffb") {
|
|
if v.Qyxy_id != "" && (jump_type == "supplier" || jump_type == "adiffb") {
|
|
url = "/swordfish/page_big_pc/ent_portrait/" + encrypt.EncodeArticleId2ByCheck(v.Qyxy_id)
|
|
url = "/swordfish/page_big_pc/ent_portrait/" + encrypt.EncodeArticleId2ByCheck(v.Qyxy_id)
|
|
@@ -928,9 +910,9 @@ func (n *network) List(in *types.NetWorkListReq) *types.Reply {
|
|
"expect_amount": RetainDecimal(expect_amount/10000, 2),
|
|
"expect_amount": RetainDecimal(expect_amount/10000, 2),
|
|
"project_count": project_count,
|
|
"project_count": project_count,
|
|
"create_time": v.Create_time,
|
|
"create_time": v.Create_time,
|
|
- "export_url": export_url,
|
|
|
|
"url": url,
|
|
"url": url,
|
|
"id": v.Id,
|
|
"id": v.Id,
|
|
|
|
+ "export_id": strings.Join(export_id, ","),
|
|
})
|
|
})
|
|
}
|
|
}
|
|
csList := &ComSortList{
|
|
csList := &ComSortList{
|
|
@@ -962,6 +944,27 @@ func (n *network) List(in *types.NetWorkListReq) *types.Reply {
|
|
} else {
|
|
} else {
|
|
finalList = csList.List
|
|
finalList = csList.List
|
|
}
|
|
}
|
|
|
|
+ pool := make(chan bool, C.ExportIdCachaPoolSize)
|
|
|
|
+ wait := &sync.WaitGroup{}
|
|
|
|
+ for _, v := range finalList {
|
|
|
|
+ exportId := ObjToString((*v)["export_id"])
|
|
|
|
+ md5Id := GetMd5String(exportId)
|
|
|
|
+ (*v)["export_url"] = "/subscribepay/network/projectExport?version=1&export_id=" + md5Id
|
|
|
|
+ delete(*v, "export_id")
|
|
|
|
+ pool <- true
|
|
|
|
+ wait.Add(1)
|
|
|
|
+ go func(md5IdNew, exportIdNew string) {
|
|
|
|
+ defer func() {
|
|
|
|
+ <-pool
|
|
|
|
+ wait.Done()
|
|
|
|
+ }()
|
|
|
|
+ key := fmt.Sprintf("network_export_%s", md5IdNew)
|
|
|
|
+ if ok, _ := redis.Exists("newother", key); !ok {
|
|
|
|
+ redis.Put("newother", key, exportIdNew, timeOut)
|
|
|
|
+ }
|
|
|
|
+ }(md5Id, exportId)
|
|
|
|
+ }
|
|
|
|
+ wait.Wait()
|
|
total_page := int64(math.Ceil(float64(count) / float64(in.Page_size)))
|
|
total_page := int64(math.Ceil(float64(count) / float64(in.Page_size)))
|
|
return &types.Reply{
|
|
return &types.Reply{
|
|
Data: map[string]interface{}{
|
|
Data: map[string]interface{}{
|