|
@@ -85,7 +85,6 @@ type OwnerlListRes struct {
|
|
|
// OwnerlList 执行主要的业务逻辑
|
|
|
func (t *OwnerService) OwnerlList() *OwnerlListRes {
|
|
|
// 先查询采购单位列表
|
|
|
- startTime := time.Now().Unix()
|
|
|
businessStr := FindBusiness(t.EntId, t.UserId)
|
|
|
// 初始化分页参数
|
|
|
if t.PageSize == 0 {
|
|
@@ -101,6 +100,7 @@ func (t *OwnerService) OwnerlList() *OwnerlListRes {
|
|
|
if businessStr == "" {
|
|
|
return olr
|
|
|
}
|
|
|
+ logx.Info(t.PositionId, " OwnerlList start 。。。")
|
|
|
//监控状态处理
|
|
|
monitorMap := NetworkCom.EntMonitor(gconv.String(t.PositionId))
|
|
|
comKey := common.GetMd5String(fmt.Sprintf("%+v business:%s", t, businessStr))
|
|
@@ -125,12 +125,13 @@ func (t *OwnerService) OwnerlList() *OwnerlListRes {
|
|
|
if len(*dataMap) == 0 && t.Supplier == "" && t.Heterotophy == "" && t.Agency == "" {
|
|
|
return olr
|
|
|
}
|
|
|
+ logx.Info(t.PositionId, " BuyerList over 。。。")
|
|
|
// 项目数量查询
|
|
|
buyerArr := getBuyerArr(dataMap)
|
|
|
// 项目数量处理
|
|
|
+ logx.Info(t.PositionId, " ProjectHandle start 。。。")
|
|
|
projectMap, connectionsNumber := t.ProjectHandle(buyerArr, businessStr, monitorBuyers)
|
|
|
- endTime := time.Now().Unix()
|
|
|
- fmt.Println("用时时间:", endTime-startTime)
|
|
|
+ logx.Info(t.PositionId, " ProjectHandle over 。。。")
|
|
|
if len(*projectMap) == 0 {
|
|
|
return olr
|
|
|
}
|
|
@@ -155,10 +156,9 @@ func (t *OwnerService) OwnerlList() *OwnerlListRes {
|
|
|
}
|
|
|
}
|
|
|
// 可介绍业主人脉处理
|
|
|
- a3 := time.Now().Unix()
|
|
|
+ logx.Info(t.PositionId, " ConnectionsHandle start 。。。")
|
|
|
routeList := ConnectionsHandle(buyerIdArr, t.PositionId, false)
|
|
|
- a4 := time.Now().Unix()
|
|
|
- fmt.Println("组合数1111据", a4-a3)
|
|
|
+ logx.Info(t.PositionId, " ConnectionsHandle over 。。。")
|
|
|
updateReturnDataWithRoutes(olr.ReturnData, routeList)
|
|
|
}
|
|
|
if len(olr.ReturnData) > 0 {
|
|
@@ -235,6 +235,7 @@ func Findwinner(buyerArr []string) []map[string]interface{} {
|
|
|
args1 = append(args1, args1...)
|
|
|
//供应商 采购单位 供应商 招标代理机构 采购单位 招标代理机构 需要计算合作次数
|
|
|
winnerSql := `select zbtime,project_id,project_name,buyer_id,buyer,wr_id,wr,agency_id,agency from transaction_info_all ARRAY JOIN winner_id as wr_id,winner as wr where buyer_id in (` + wh1 + `) and LENGTH(winner)=LENGTH(winner_id) order by zbtime DESC,project_id DESC`
|
|
|
+ logx.Info("Findwinner 合作 sql ", winnerSql, args1)
|
|
|
winnerArr := SupplierFindConnectionsHandle(winnerSql, args1...)
|
|
|
if winnerArr != nil && len(winnerArr) > 0 {
|
|
|
//企业联系人处理
|
|
@@ -258,6 +259,7 @@ func Findwinner(buyerArr []string) []map[string]interface{} {
|
|
|
if len(entIdArr) > 0 {
|
|
|
wh2, args2 := common.WhArgs(entIdArr)
|
|
|
personSql := `select id,name as personName from ent_contact where id in (` + wh2 + `) ORDER by name`
|
|
|
+ logx.Info("Findwinner 联系人 sql ", personSql, args2)
|
|
|
personArr := PersonFindConnectionsHandle(personSql, args2...)
|
|
|
//联系人处理
|
|
|
for _, v := range personArr {
|
|
@@ -726,7 +728,7 @@ func (t *OwnerService) ProjectHandle(buyerArr []string, businessStr string, moni
|
|
|
}
|
|
|
countSql := fmt.Sprintf("select count(1) as count from (%s) b ", sqlStr)
|
|
|
sqlStr += fmt.Sprintf(" order by maxzbtime desc limit %d,%d", startIndex, t.PageSize)
|
|
|
- logx.Info("查询列表sql", sqlStr, allArgs)
|
|
|
+ logx.Info(t.PositionId, " ProjectHandle sql ", sqlStr, allArgs)
|
|
|
//总数查询
|
|
|
ass := []BuyerAggStruct{}
|
|
|
rows, err1 := ClickhouseConn.Query(context.TODO(), sqlStr, allArgs...)
|
|
@@ -756,7 +758,10 @@ func (t *OwnerService) ProjectHandle(buyerArr []string, businessStr string, moni
|
|
|
"buyerName": buyerName,
|
|
|
}
|
|
|
}
|
|
|
- return projectMap, T.NetworkCom.Count(countSql, allArgs...)
|
|
|
+ logx.Info(t.PositionId, " ProjectHandle sql over 。。。", sqlStr, allArgs)
|
|
|
+ count := T.NetworkCom.Count(countSql, allArgs...)
|
|
|
+ logx.Info(t.PositionId, " ProjectHandle count over 。。。", sqlStr, allArgs)
|
|
|
+ return projectMap, count
|
|
|
}
|
|
|
|
|
|
type BuyerAggStruct struct {
|