|
@@ -84,24 +84,19 @@ func WorkDataHandle(company, phone, demand, name, product string, acceptanceData
|
|
if !ok {
|
|
if !ok {
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
- UpdateClue(*uCount, saleData, "", "", uId, "", "", "", "", company, name, gconv.String(data["name"]), phone, "", "", "", "", "", "", gconv.String(data["seat_number"]), "", gconv.Int64(data["position_id"]), "", "", "", []string{}, "", isGroup, isCommerce, true, demand)
|
|
|
|
|
|
+ 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 {
|
|
} else {
|
|
trailstatus := gconv.String((*uCount)["trailstatus"])
|
|
trailstatus := gconv.String((*uCount)["trailstatus"])
|
|
- if trailstatus == "01" || trailstatus == "03" || trailstatus == "04" {
|
|
|
|
- //变更销售员
|
|
|
|
- ok, data, saleData = FindPosition(positionId, "", false)
|
|
|
|
- if !ok {
|
|
|
|
- return false
|
|
|
|
- }
|
|
|
|
- UpdateClue(*uCount, saleData, "", "", uId, "", "", "", "", company, name, gconv.String(data["name"]), phone, "", "", "", "", "", "", gconv.String(data["seat_number"]), "", gconv.Int64(data["position_id"]), "", "", "", []string{}, "", isGroup, isCommerce, true, demand)
|
|
|
|
- } else if trailstatus == "08" {
|
|
|
|
|
|
+ IS_TRANSFER := gconv.Int64((*uCount)["IS_TRANSFER"])
|
|
|
|
+ if IS_TRANSFER == 1 {
|
|
|
|
+ //客成处理
|
|
//客成
|
|
//客成
|
|
//生成客成数据
|
|
//生成客成数据
|
|
customerMap := TiDb.FindOne("dwd_f_csm_customer_info", map[string]interface{}{
|
|
customerMap := TiDb.FindOne("dwd_f_csm_customer_info", map[string]interface{}{
|
|
"clue_id": clueId,
|
|
"clue_id": clueId,
|
|
}, "position_id", "")
|
|
}, "position_id", "")
|
|
if customerMap != nil && len(*customerMap) > 0 {
|
|
if customerMap != nil && len(*customerMap) > 0 {
|
|
- UpdateClue(*uCount, saleData, "", "", uId, "", "", "", "", company, name, gconv.String((*uCount)["name"]), phone, "", "", "", "", "", "", gconv.String((*uCount)["seat_number"]), "", gconv.Int64((*uCount)["position_id"]), "", "", "", []string{}, "", isGroup, isCommerce, true, demand)
|
|
|
|
|
|
+ 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{}{
|
|
data = map[string]interface{}{
|
|
"type": "kc",
|
|
"type": "kc",
|
|
"position_id": (*customerMap)["position_id"],
|
|
"position_id": (*customerMap)["position_id"],
|
|
@@ -112,22 +107,29 @@ func WorkDataHandle(company, phone, demand, name, product string, acceptanceData
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
TiDb.Insert("dwd_f_crm_clue_change_record", map[string]interface{}{
|
|
TiDb.Insert("dwd_f_crm_clue_change_record", map[string]interface{}{
|
|
- "clue_id": clueId,
|
|
|
|
- "position_id": (*customerMap)["position_id"],
|
|
|
|
- "change_type": "加入任务车",
|
|
|
|
- "new_value": "工单创建",
|
|
|
|
- "new_value_BAK": "工单创建",
|
|
|
|
- "createtime": time.Now().Format(date.Date_Full_Layout),
|
|
|
|
- "BCPCID": common.GetRandom(32),
|
|
|
|
- "operator_id": -1,
|
|
|
|
|
|
+ "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,
|
|
})
|
|
})
|
|
|
|
+ }
|
|
|
|
+ if trailstatus == "01" || trailstatus == "03" || trailstatus == "04" {
|
|
|
|
+ //变更销售员
|
|
|
|
+ ok, data, saleData = FindPosition(positionId, "", false)
|
|
|
|
+ if !ok {
|
|
|
|
+ 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)
|
|
} else {
|
|
} else {
|
|
//线索变更
|
|
//线索变更
|
|
ok, data, saleData = FindPosition(positionId, trailstatus, false)
|
|
ok, data, saleData = FindPosition(positionId, trailstatus, false)
|
|
if !ok {
|
|
if !ok {
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
- UpdateClue(*uCount, saleData, "", "", uId, "", "", "", "", company, name, gconv.String(data["name"]), phone, "", "", "", "", "", "", gconv.String(data["seat_number"]), "", gconv.Int64(data["position_id"]), "", "", "", []string{}, "", isGroup, isCommerce, true, demand)
|
|
|
|
|
|
+ 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 {
|
|
} else {
|
|
@@ -136,7 +138,7 @@ func WorkDataHandle(company, phone, demand, name, product string, acceptanceData
|
|
if !ok {
|
|
if !ok {
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
- SaveClue("", "", uId, "", "", "", "", cluename, name, gconv.String(data["name"]), phone, "", "", "", "", "", "", gconv.String(data["seat_number"]), gconv.Int64(data["position_id"]), "", "", "", []string{}, "", isGroup, isCommerce, false, demand)
|
|
|
|
|
|
+ SaveClue("", "", uId, "5", "169", "", "", cluename, name, gconv.String(data["name"]), phone, "", "", "", "", "", "", gconv.String(data["seat_number"]), gconv.Int64(data["position_id"]), "", "", "", []string{}, "", isGroup, isCommerce, false, demand)
|
|
}
|
|
}
|
|
//工单生成
|
|
//工单生成
|
|
AddOrderWork(acceptanceData, data, product, phone, company)
|
|
AddOrderWork(acceptanceData, data, product, phone, company)
|