|
@@ -90,6 +90,17 @@ func FormatData(data map[string]interface{}, item string) (bool, bool) {
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+ } else if item == "allocation" || item == "rebind" {
|
|
|
|
+ userId = mongodb.BsonIdToSId(data["mogUserId"])
|
|
|
|
+ userInfo := TiDb.FindOne("dwd_f_userbase_baseinfo", map[string]interface{}{
|
|
|
|
+ "userid": userId,
|
|
|
|
+ }, "", "")
|
|
|
|
+ if userInfo != nil && len(*userInfo) > 0 {
|
|
|
|
+ phone = common.ObjToString((*userInfo)["phone"])
|
|
|
|
+ uId = common.ObjToString((*userInfo)["uid"])
|
|
|
|
+ source = common.ObjToString((*userInfo)["source"])
|
|
|
|
+ belong_to = common.ObjToString((*userInfo)["belong_to"])
|
|
|
|
+ }
|
|
} else if item == "saleLeads" { //留资
|
|
} else if item == "saleLeads" { //留资
|
|
userId = common.ObjToString(data["userid"])
|
|
userId = common.ObjToString(data["userid"])
|
|
if !mongodb.IsObjectIdHex(userId) {
|
|
if !mongodb.IsObjectIdHex(userId) {
|
|
@@ -99,7 +110,6 @@ func FormatData(data map[string]interface{}, item string) (bool, bool) {
|
|
userId = common.ObjToString((*userMapping)["userid"])
|
|
userId = common.ObjToString((*userMapping)["userid"])
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
cluename = common.ObjToString(data["company"])
|
|
cluename = common.ObjToString(data["company"])
|
|
phone = common.ObjToString(data["phone"])
|
|
phone = common.ObjToString(data["phone"])
|
|
role = common.ObjToString(data["companyType"])
|
|
role = common.ObjToString(data["companyType"])
|
|
@@ -424,6 +434,7 @@ func FormatData(data map[string]interface{}, item string) (bool, bool) {
|
|
}
|
|
}
|
|
|
|
|
|
func SaveClue(item, userId, uId, top_cluetype, sub_cluetype, topname, subname, cluename, name, saleName, phone, position, department, departments, industry, follow_project_area, role, seatNumber string, positionId int64, source, sourceCode, remark string, keyword []string, belong_to string, isGroup, isCommerce int, isFreeze bool, demand string) bool {
|
|
func SaveClue(item, userId, uId, top_cluetype, sub_cluetype, topname, subname, cluename, name, saleName, phone, position, department, departments, industry, follow_project_area, role, seatNumber string, positionId int64, source, sourceCode, remark string, keyword []string, belong_to string, isGroup, isCommerce int, isFreeze bool, demand string) bool {
|
|
|
|
+ log.Println("线索修改前", item, userId, uId, top_cluetype, sub_cluetype, topname, subname, cluename, name, saleName, phone, position, department, departments, industry, follow_project_area, role, seatNumber, positionId, source, sourceCode, remark)
|
|
nowTime := time.Now().Format("2006-01-02 15:04:05")
|
|
nowTime := time.Now().Format("2006-01-02 15:04:05")
|
|
nowTimes := time.Unix(time.Now().Unix()+3600*12, 0).Format("2006-01-02 15:04:05")
|
|
nowTimes := time.Unix(time.Now().Unix()+3600*12, 0).Format("2006-01-02 15:04:05")
|
|
clueId, uodateId1, uodateId2, uodateId3, uodateId4, uodateId5, uodateId6 := int64(0), int64(0), int64(0), int64(0), int64(0), int64(0), int64(0)
|
|
clueId, uodateId1, uodateId2, uodateId3, uodateId4, uodateId5, uodateId6 := int64(0), int64(0), int64(0), int64(0), int64(0), int64(0), int64(0)
|
|
@@ -794,7 +805,6 @@ func WorkUpdateClue(data map[string]interface{}, saleData []map[string]interface
|
|
clueUpdateData["comeinsource_open"] = nil
|
|
clueUpdateData["comeinsource_open"] = nil
|
|
clueUpdateData["level_open"] = nil
|
|
clueUpdateData["level_open"] = nil
|
|
clueUpdateData["clue_level"] = nil
|
|
clueUpdateData["clue_level"] = nil
|
|
-
|
|
|
|
}
|
|
}
|
|
} else if is_assign == 1 && positionId != old_position_id {
|
|
} else if is_assign == 1 && positionId != old_position_id {
|
|
clueUpdateData["seatNumber"] = seatNumber
|
|
clueUpdateData["seatNumber"] = seatNumber
|
|
@@ -875,7 +885,6 @@ func WorkUpdateClue(data map[string]interface{}, saleData []map[string]interface
|
|
//变更记录
|
|
//变更记录
|
|
if (trailstatus == "00" || old_position_id == 0 || (pIsOk && old_cluename != cluename && cluename != "")) && is_assign == 1 {
|
|
if (trailstatus == "00" || old_position_id == 0 || (pIsOk && old_cluename != cluename && cluename != "")) && is_assign == 1 {
|
|
if trailstatus == "00" && trailstatusTime != "" && time.Now().Unix()-trailstatusTimes.Unix() < 86400 {
|
|
if trailstatus == "00" && trailstatusTime != "" && time.Now().Unix()-trailstatusTimes.Unix() < 86400 {
|
|
-
|
|
|
|
} else if old_position_id == 0 {
|
|
} else if old_position_id == 0 {
|
|
updateId1 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
|
|
updateId1 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
|
|
"clue_id": clueId,
|
|
"clue_id": clueId,
|
|
@@ -1227,8 +1236,8 @@ func WorkUpdateClue(data map[string]interface{}, saleData []map[string]interface
|
|
}
|
|
}
|
|
}
|
|
}
|
|
func UpdateClue(data map[string]interface{}, saleData []map[string]interface{}, item, userId, uId, top_cluetype, sub_cluetype, topname, subname, cluename, name, saleName, phone, position, department, departments, industry, follow_project_area, role, seatNumber, level string, positionId int64, source, sourceCode, remark string, keyword []string, belong_to string, isGroup, isCommerce int, pIsOk bool) bool {
|
|
func UpdateClue(data map[string]interface{}, saleData []map[string]interface{}, item, userId, uId, top_cluetype, sub_cluetype, topname, subname, cluename, name, saleName, phone, position, department, departments, industry, follow_project_area, role, seatNumber, level string, positionId int64, source, sourceCode, remark string, keyword []string, belong_to string, isGroup, isCommerce int, pIsOk bool) bool {
|
|
|
|
+ log.Println("线索修改前", data, item, userId, uId, top_cluetype, sub_cluetype, topname, subname, cluename, name, saleName, phone, position, department, departments, industry, follow_project_area, role, seatNumber, level, positionId, source, sourceCode, remark)
|
|
name = strings.ReplaceAll(name, " ", "")
|
|
name = strings.ReplaceAll(name, " ", "")
|
|
- log.Println("线索修改前", data)
|
|
|
|
nowTime := time.Now().Format("2006-01-02 15:04:05")
|
|
nowTime := time.Now().Format("2006-01-02 15:04:05")
|
|
nowTimes := time.Unix(time.Now().Unix()+3600*12, 0).Format("2006-01-02 15:04:05")
|
|
nowTimes := time.Unix(time.Now().Unix()+3600*12, 0).Format("2006-01-02 15:04:05")
|
|
trailstatus := common.ObjToString(data["trailstatus"]) //data都为原线索数据
|
|
trailstatus := common.ObjToString(data["trailstatus"]) //data都为原线索数据
|