|
@@ -566,10 +566,10 @@ func GetWithEntPortraitData(listDataItf interface{}, province string, bidamountO
|
|
|
businessAggs := map[string][]string{} //企业标签
|
|
|
hasTagTotalBidAmount, hasTagProjectCount := 0.0, 0 //有企业分类中标总金额,其他归为"其他分类"
|
|
|
for _, winner := range *listData {
|
|
|
- winnerIdList = append(winnerIdList, winner.WinnerId)
|
|
|
- allWinnerMap[winner.WinnerId] = winner
|
|
|
- hasTagTotalBidAmount += winner.BidamountCount
|
|
|
- hasTagProjectCount += winner.ProjectCount
|
|
|
+ if !(winner.WinnerId == "" || winner.WinnerId == "-") {
|
|
|
+ winnerIdList = append(winnerIdList, winner.WinnerId)
|
|
|
+ allWinnerMap[winner.WinnerId] = winner
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
tBegin := time.Now()
|
|
@@ -606,7 +606,7 @@ func GetWithEntPortraitData(listDataItf interface{}, province string, bidamountO
|
|
|
if entMsgList == nil || len(entMsgList) == 0 {
|
|
|
return nil, 0, errors.New("中标企业查询结果为空")
|
|
|
}
|
|
|
-
|
|
|
+ var has_TagBusiness []string
|
|
|
for _, entMsg := range entMsgList {
|
|
|
if len(entMsg) < 2 {
|
|
|
continue
|
|
@@ -631,10 +631,24 @@ func GetWithEntPortraitData(listDataItf interface{}, province string, bidamountO
|
|
|
if businessStr := qutil.ObjToString(entMsg["tag_business"]); businessStr != "" {
|
|
|
firstTag := strings.Split(businessStr, ",")[0]
|
|
|
businessAggs[firstTag] = append(businessAggs[firstTag], companyId)
|
|
|
- } else {
|
|
|
- businessAggs["其他"] = append(businessAggs["其他"], companyId)
|
|
|
+ has_TagBusiness = append(has_TagBusiness, companyId)
|
|
|
}
|
|
|
}
|
|
|
+ //计算所有有企业标签的企业中标金额总数、及项目数量
|
|
|
+ for _, winner := range *listData {
|
|
|
+ isOther := true
|
|
|
+ for _, _id := range has_TagBusiness {
|
|
|
+ if winner.WinnerId == _id {
|
|
|
+ isOther = false
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if !isOther {
|
|
|
+ hasTagTotalBidAmount += winner.BidamountCount
|
|
|
+ hasTagProjectCount += winner.ProjectCount
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
thisProvinceWinnerCount := 0
|
|
|
if province != "" {
|
|
|
province = excludeAddressReg.ReplaceAllString(province, "") //去掉城市后缀
|