Răsfoiți Sursa

客成判断修改

WH01243 1 an în urmă
părinte
comite
92bc737034
1 a modificat fișierele cu 22 adăugiri și 20 ștergeri
  1. 22 20
      clueSync/jobutil.go

+ 22 - 20
clueSync/jobutil.go

@@ -84,24 +84,19 @@ func WorkDataHandle(company, phone, demand, name, product string, acceptanceData
 			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)
+			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 {
 			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{}{
 					"clue_id": clueId,
 				}, "position_id", "")
 				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{}{
 						"type":        "kc",
 						"position_id": (*customerMap)["position_id"],
@@ -112,22 +107,29 @@ func WorkDataHandle(company, phone, demand, name, product string, acceptanceData
 					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":     "工单创建",
-					"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 {
 				//线索变更
 				ok, data, saleData = FindPosition(positionId, trailstatus, 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)
+				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 {
@@ -136,7 +138,7 @@ func WorkDataHandle(company, phone, demand, name, product string, acceptanceData
 		if !ok {
 			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)