|
@@ -79,44 +79,44 @@ func WorkDataHandle(company, phone, demand, name, product string, acceptanceData
|
|
|
if uCount != nil && len(*uCount) > 0 {
|
|
|
clueId := gconv.Int64((*uCount)["id"])
|
|
|
positionId := gconv.Int64((*uCount)["position_id"])
|
|
|
- if positionId == 0 {
|
|
|
- //线索变更
|
|
|
- ok, data, saleData = FindPosition(0, "")
|
|
|
- if !ok {
|
|
|
- log.Println(positionId, "用户查询失败")
|
|
|
+ trailstatus := gconv.String((*uCount)["trailstatus"])
|
|
|
+ IS_TRANSFER := gconv.Int64((*uCount)["IS_TRANSFER"])
|
|
|
+ if IS_TRANSFER == 1 {
|
|
|
+ //客成处理
|
|
|
+ //客成
|
|
|
+ //生成客成数据
|
|
|
+ customerMap := TiDb.FindOne("dwd_f_csm_customer_info", map[string]interface{}{
|
|
|
+ "clue_id": clueId,
|
|
|
+ }, "position_id,name", "")
|
|
|
+ if customerMap != nil && len(*customerMap) > 0 {
|
|
|
+ UpdateClue(*uCount, saleData, "", "", uId, "5", "169", "新增线索", "主动咨询客服留资客户", company, name, gconv.String((*uCount)["name"]), phone, "", "", "", "", "", "", gconv.String((*uCount)["seat_number"]), "", gconv.Int64((*uCount)["position_id"]), "", "", "", []string{}, "", isGroup, isCommerce, true, demand)
|
|
|
+ data = map[string]interface{}{
|
|
|
+ "type": "kc",
|
|
|
+ "position_id": (*customerMap)["position_id"],
|
|
|
+ "name": (*customerMap)["name"],
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ log.Println("查询不到客成数据", clueId, uId)
|
|
|
return false
|
|
|
}
|
|
|
- UpdateClue(*uCount, saleData, "", "", uId, "5", "169", "新增线索", "主动咨询客服留资客户", company, name, gconv.String(data["name"]), phone, "", "", "", "", "", "", gconv.String(data["seat_number"]), "", gconv.Int64(data["position_id"]), "", "", "", []string{}, "", isGroup, isCommerce, true, demand)
|
|
|
+ TiDb.Insert("dwd_f_crm_clue_change_record", map[string]interface{}{
|
|
|
+ "clue_id": clueId,
|
|
|
+ "position_id": (*customerMap)["position_id"],
|
|
|
+ "change_type": "加入任务车",
|
|
|
+ "new_value": "咨询客服转客成",
|
|
|
+ "createtime": time.Now().Format(date.Date_Full_Layout),
|
|
|
+ "BCPCID": common.GetRandom(32),
|
|
|
+ "operator_id": -1,
|
|
|
+ })
|
|
|
} else {
|
|
|
- trailstatus := gconv.String((*uCount)["trailstatus"])
|
|
|
- IS_TRANSFER := gconv.Int64((*uCount)["IS_TRANSFER"])
|
|
|
- if IS_TRANSFER == 1 {
|
|
|
- //客成处理
|
|
|
- //客成
|
|
|
- //生成客成数据
|
|
|
- customerMap := TiDb.FindOne("dwd_f_csm_customer_info", map[string]interface{}{
|
|
|
- "clue_id": clueId,
|
|
|
- }, "position_id,name", "")
|
|
|
- if customerMap != nil && len(*customerMap) > 0 {
|
|
|
- UpdateClue(*uCount, saleData, "", "", uId, "5", "169", "新增线索", "主动咨询客服留资客户", company, name, gconv.String((*uCount)["name"]), phone, "", "", "", "", "", "", gconv.String((*uCount)["seat_number"]), "", gconv.Int64((*uCount)["position_id"]), "", "", "", []string{}, "", isGroup, isCommerce, true, demand)
|
|
|
- data = map[string]interface{}{
|
|
|
- "type": "kc",
|
|
|
- "position_id": (*customerMap)["position_id"],
|
|
|
- "name": (*customerMap)["name"],
|
|
|
- }
|
|
|
- } else {
|
|
|
- log.Println("查询不到客成数据", clueId, uId)
|
|
|
+ if positionId == 0 {
|
|
|
+ //线索变更
|
|
|
+ ok, data, saleData = FindPosition(0, "")
|
|
|
+ if !ok {
|
|
|
+ log.Println(positionId, "用户查询失败")
|
|
|
return false
|
|
|
}
|
|
|
- TiDb.Insert("dwd_f_crm_clue_change_record", map[string]interface{}{
|
|
|
- "clue_id": clueId,
|
|
|
- "position_id": (*customerMap)["position_id"],
|
|
|
- "change_type": "加入任务车",
|
|
|
- "new_value": "咨询客服转客成",
|
|
|
- "createtime": time.Now().Format(date.Date_Full_Layout),
|
|
|
- "BCPCID": common.GetRandom(32),
|
|
|
- "operator_id": -1,
|
|
|
- })
|
|
|
+ UpdateClue(*uCount, saleData, "", "", uId, "5", "169", "新增线索", "主动咨询客服留资客户", company, name, gconv.String(data["name"]), phone, "", "", "", "", "", "", gconv.String(data["seat_number"]), "", gconv.Int64(data["position_id"]), "", "", "", []string{}, "", isGroup, isCommerce, true, demand)
|
|
|
} else {
|
|
|
ok, data, saleData = FindPosition(positionId, trailstatus)
|
|
|
if !ok {
|