|
@@ -32,10 +32,11 @@ func orders() {
|
|
|
ok1, ok2 := FormatData(v, "orders")
|
|
|
if !ok1 {
|
|
|
common.WriteSysConfig(&cfg)
|
|
|
+ log.Println("线索卡点", "orders", v, selectTimeEnd, selectTimeStart)
|
|
|
break
|
|
|
} else {
|
|
|
if !ok2 {
|
|
|
- log.Println("用户分配已达上限")
|
|
|
+ log.Println("用户分配已达上限", "orders", v, selectTimeEnd, selectTimeStart)
|
|
|
common.WriteSysConfig(&cfg)
|
|
|
break
|
|
|
}
|
|
@@ -58,10 +59,11 @@ func readClue() {
|
|
|
ok1, ok2 := FormatData(v, "readClue")
|
|
|
if !ok1 {
|
|
|
common.WriteSysConfig(&cfg)
|
|
|
+ log.Println("用户分配已达上限", "readClue", v, lastReadClueTime)
|
|
|
break
|
|
|
} else {
|
|
|
if !ok2 {
|
|
|
- log.Println("用户分配已达上限")
|
|
|
+ log.Println("用户分配已达上限", "readClue", v, lastReadClueTime)
|
|
|
common.WriteSysConfig(&cfg)
|
|
|
break
|
|
|
}
|
|
@@ -89,7 +91,18 @@ func users() {
|
|
|
if data != nil && *data != nil && len(*data) > 0 {
|
|
|
for k, v := range *data {
|
|
|
createtime := common.ObjToString(v["createtime"])
|
|
|
- FormatData(v, "users")
|
|
|
+ ok1, ok2 := FormatData(v, "users")
|
|
|
+ if !ok1 {
|
|
|
+ common.WriteSysConfig(&cfg)
|
|
|
+ log.Println("线索卡点", "users", v, selectTimeEnd)
|
|
|
+ break
|
|
|
+ } else {
|
|
|
+ if !ok2 {
|
|
|
+ log.Println("用户分配已达上限", "users", v, selectTimeEnd)
|
|
|
+ common.WriteSysConfig(&cfg)
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
if k == len(*data)-1 {
|
|
|
cfg.LastUserId = createtime
|
|
|
}
|
|
@@ -129,10 +142,11 @@ func saleLeads() {
|
|
|
ok1, ok2 := FormatData(thisData, "saleLeads")
|
|
|
if !ok1 {
|
|
|
common.WriteSysConfig(&cfg)
|
|
|
+ log.Println("线索卡点", "saleLeads", thisData, lastId)
|
|
|
break
|
|
|
} else {
|
|
|
if !ok2 {
|
|
|
- log.Println("用户分配已达上限")
|
|
|
+ log.Println("用户分配已达上限", "saleLeads", thisData, lastId)
|
|
|
common.WriteSysConfig(&cfg)
|
|
|
break
|
|
|
}
|
|
@@ -235,7 +249,18 @@ func userbase() {
|
|
|
}
|
|
|
} else {
|
|
|
if count == 0 {
|
|
|
- FormatData(v, "users")
|
|
|
+ ok1, ok2 := FormatData(v, "users")
|
|
|
+ if !ok1 {
|
|
|
+ common.WriteSysConfig(&cfg)
|
|
|
+ log.Println("线索卡点", "userbase uid", v, uId)
|
|
|
+ break
|
|
|
+ } else {
|
|
|
+ if !ok2 {
|
|
|
+ log.Println("用户分配已达上限", "userbase uid", v, uId)
|
|
|
+ common.WriteSysConfig(&cfg)
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
} else {
|
|
|
TiDb.Insert("dwd_f_userbase_contacts", map[string]interface{}{
|
|
|
"status": 1,
|
|
@@ -569,9 +594,7 @@ func FindUpperLimit(positionId string, level string, isAdd bool) bool {
|
|
|
return false
|
|
|
}
|
|
|
isFull := false
|
|
|
- fmt.Println("111", positionId, TiDb.CountBySql(`select count(1) from dwd_f_crm_clue_info where position_id=? and is_assign=1 and trailstatus != '08' `, positionId))
|
|
|
isFull = TiDb.CountBySql(`select count(1) from dwd_f_crm_clue_info where position_id=? and is_assign=1 and trailstatus != '08' `, positionId) >= cfg.AllocationCap
|
|
|
- fmt.Println("2222", TiDb.CountBySql(`select count(1) from dwd_f_crm_clue_info where position_id=? and is_assign=1 and trailstatus != '08' `, positionId), TiDb.CountBySql(`select count(1) from dwd_f_crm_clue_info where position_id=? and is_assign=1 and trailstatus != '08' `, positionId) >= cfg.AllocationCap)
|
|
|
if isFull && isAdd && level != "" {
|
|
|
TiDb.UpdateOrDeleteBySql(`update dwd_f_crm_clue_autodraw_record set count = count + 1 where position_id = ? and clue_level = ?`, positionId, level)
|
|
|
}
|