|
@@ -3,6 +3,7 @@ package service
|
|
import (
|
|
import (
|
|
"fmt"
|
|
"fmt"
|
|
"github.com/gogf/gf/v2/util/gconv"
|
|
"github.com/gogf/gf/v2/util/gconv"
|
|
|
|
+ "log"
|
|
"strconv"
|
|
"strconv"
|
|
"strings"
|
|
"strings"
|
|
"sync"
|
|
"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)
|
|
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
|
|
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 {
|
|
if this.DataType == 1 {
|
|
m.CompanyCount = 0
|
|
m.CompanyCount = 0
|
|
@@ -144,7 +152,9 @@ func DistributeClueShow(this *biservice.DistributeClueShowReq, allocationCap int
|
|
isOk = false
|
|
isOk = false
|
|
if this.DataType == 3 {
|
|
if this.DataType == 3 {
|
|
dclue(id, positionId, this.IsTask, this.PositionId) //分线索
|
|
dclue(id, positionId, this.IsTask, this.PositionId) //分线索
|
|
|
|
+ log.Println("11111111", id, positionId)
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if isOk {
|
|
if isOk {
|
|
@@ -235,7 +245,8 @@ func DistributeClueShow(this *biservice.DistributeClueShowReq, allocationCap int
|
|
rdata[sindex].ClueCount += int64(len(v))
|
|
rdata[sindex].ClueCount += int64(len(v))
|
|
if this.DataType == 3 {
|
|
if this.DataType == 3 {
|
|
for _, vv := range v {
|
|
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) {
|
|
if minIndex >= len(rdata) {
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
@@ -346,6 +358,7 @@ func DistributeClueShow(this *biservice.DistributeClueShowReq, allocationCap int
|
|
}()
|
|
}()
|
|
id := common.Int64All(i["id"])
|
|
id := common.Int64All(i["id"])
|
|
dclue(id, rdata[minIndex].PositionId, this.IsTask, this.PositionId)
|
|
dclue(id, rdata[minIndex].PositionId, this.IsTask, this.PositionId)
|
|
|
|
+ log.Println("3333", id, rdata[minIndex].PositionId)
|
|
}(i)
|
|
}(i)
|
|
}
|
|
}
|
|
wg.Wait()
|
|
wg.Wait()
|