Przeglądaj źródła

Merge branch 'dev_v1.0.23_wh' of BaseService/biService into feature/v1.0.23

王浩 1 rok temu
rodzic
commit
15e188f481
1 zmienionych plików z 16 dodań i 3 usunięć
  1. 16 3
      service/company.go

+ 16 - 3
service/company.go

@@ -3,6 +3,7 @@ package service
 import (
 	"fmt"
 	"github.com/gogf/gf/v2/util/gconv"
+	"log"
 	"strconv"
 	"strings"
 	"sync"
@@ -68,8 +69,15 @@ func DistributeClueShow(this *biservice.DistributeClueShowReq, allocationCap int
 		//现有数据查询
 		existingCount := JyBiTidb.CountBySql(`select count(1) from dwd_f_crm_clue_info where position_id=? and  is_assign=1 and trailstatus != '08' `, m.PositionId)
 		m.ExistingCount = existingCount
-		if existingCount > allocationCap {
-			continue
+		if existingCount >= allocationCap {
+			if this.DataType != 1 {
+				return &biservice.DistributeClueShowResp{
+					ErrorCode: 1,
+					ErrorMsg:  "线索已达上限",
+				}
+			} else {
+				continue
+			}
 		}
 		if this.DataType == 1 {
 			m.CompanyCount = 0
@@ -144,7 +152,9 @@ func DistributeClueShow(this *biservice.DistributeClueShowReq, allocationCap int
 						isOk = false
 						if this.DataType == 3 {
 							dclue(id, positionId, this.IsTask, this.PositionId) //分线索
+							log.Println("11111111", id, positionId)
 						}
+
 					}
 				}
 				if isOk {
@@ -235,7 +245,8 @@ func DistributeClueShow(this *biservice.DistributeClueShowReq, allocationCap int
 							rdata[sindex].ClueCount += int64(len(v))
 							if this.DataType == 3 {
 								for _, vv := range v {
-									dclue(vv, paid, this.IsTask, this.PositionId) //分线索
+									dclue(vv, paid, this.IsTask, this.PositionId) //分线索*/
+									log.Println("2222", vv, paid)
 								}
 							}
 						}
@@ -317,6 +328,7 @@ func DistributeClueShow(this *biservice.DistributeClueShowReq, allocationCap int
 						}
 					}
 				}
+				fmt.Println(222, minIndex)
 				if minIndex >= len(rdata) {
 					continue
 				}
@@ -346,6 +358,7 @@ func DistributeClueShow(this *biservice.DistributeClueShowReq, allocationCap int
 								}()
 								id := common.Int64All(i["id"])
 								dclue(id, rdata[minIndex].PositionId, this.IsTask, this.PositionId)
+								log.Println("3333", id, rdata[minIndex].PositionId)
 							}(i)
 						}
 						wg.Wait()