|
@@ -75,25 +75,26 @@ func FormatData(data map[string]interface{}, item string) (bool, bool, bool) {
|
|
|
} else {
|
|
|
query["userid"] = userId
|
|
|
}
|
|
|
- createtimeStr := ""
|
|
|
+ //createtimeStr := ""
|
|
|
userInfo := TiDb.FindOne("dwd_f_userbase_baseinfo", query, "", "")
|
|
|
if userInfo != nil && len(*userInfo) > 0 {
|
|
|
uId = common.ObjToString((*userInfo)["uid"])
|
|
|
source = common.ObjToString((*userInfo)["source"])
|
|
|
belong_to = common.ObjToString((*userInfo)["belong_to"])
|
|
|
s_sourceid = common.ObjToString((*userInfo)["s_sourceid"])
|
|
|
- createtimeStr = common.ObjToString((*userInfo)["l_registedate"])
|
|
|
+ //createtimeStr = common.ObjToString((*userInfo)["l_registedate"])
|
|
|
}
|
|
|
if item == "xcxusers" {
|
|
|
sourceCode = common.ObjToString(data["industry"])
|
|
|
- t, _ := time.Parse("2006-01-02 15:04:05", createtimeStr)
|
|
|
+ //t, _ := time.Parse("2006-01-02 15:04:05", createtimeStr)
|
|
|
if sourceCode == "" {
|
|
|
log.Println("留资没有source", phone)
|
|
|
return true, true, true
|
|
|
}
|
|
|
- if t.Unix() > db.NewRegistration && sourceCode == "安防" {
|
|
|
- return true, true, false
|
|
|
- }
|
|
|
+ /* 安防代码
|
|
|
+ if t.Unix() > db.NewRegistration && sourceCode == "安防" {
|
|
|
+ return true, true, false
|
|
|
+ }*/
|
|
|
//线索名称查询处理
|
|
|
clueData, _ := TiDb.FindOne("dwd_f_crm_clue_info", map[string]interface{}{"uid": uId}, "", ""), true //查当前线索是否已存在
|
|
|
if clueData != nil && len(*clueData) > 0 {
|
|
@@ -116,6 +117,8 @@ func FormatData(data map[string]interface{}, item string) (bool, bool, bool) {
|
|
|
belong_to = common.ObjToString((*userInfo)["belong_to"])
|
|
|
}
|
|
|
} else if item == "saleLeads" { //留资
|
|
|
+ //线索名称打印
|
|
|
+ log.Println(1111, common.ObjToString(data["company"]))
|
|
|
userId = common.ObjToString(data["userid"])
|
|
|
if !mongodb.IsObjectIdHex(userId) {
|
|
|
positionId = userId
|
|
@@ -216,9 +219,11 @@ func FormatData(data map[string]interface{}, item string) (bool, bool, bool) {
|
|
|
phone = common.ObjToString(data["phone"])
|
|
|
sourceId = common.Int64All(data["sourceId"])
|
|
|
}
|
|
|
+ log.Println(222, cluename)
|
|
|
if cluename == "" && item != "message" && item != "orders" && item != "readClue" && item != "rebind" && item != "allocation" {
|
|
|
cluename = phone //没有线索名,手机号代替
|
|
|
}
|
|
|
+ log.Println(333, cluename)
|
|
|
cluename = strings.ReplaceAll(cluename, " ", "")
|
|
|
isGroup, isCommerce := GetCompanyType(cluename) //判断是否集团公司、工商库
|
|
|
if source == "0104" || strings.HasPrefix(belong_to, "02") || source == "0102" || source == "0103" || phone == "" { //参照用户来源代码表
|
|
@@ -279,6 +284,7 @@ func FormatData(data map[string]interface{}, item string) (bool, bool, bool) {
|
|
|
log.Println("线索分配失败,线索过滤top_cluetype!!", item, uId, phone, userId)
|
|
|
return true, true, true
|
|
|
}
|
|
|
+ log.Println("人员选择", level, cluename, phone, isGroup, isCommerce)
|
|
|
position_id, seatNumber, saleName, saleData, pIsOk, isFreeze, noticePositionId := autoDraw(level, cluename, phone, isGroup, isCommerce) //查询当前分配次数最少的,如果当前线索有销售,此次找出的不会+1
|
|
|
log.Println("data -------", position_id, seatNumber, saleName, pIsOk, isFreeze, noticePositionId)
|
|
|
if position_id > 0 && seatNumber != "" {
|