Kaynağa Gözat

标签处理

WH01243 6 ay önce
ebeveyn
işleme
8be58d2acf
1 değiştirilmiş dosya ile 22 ekleme ve 17 silme
  1. 22 17
      clueSync/kc.go

+ 22 - 17
clueSync/kc.go

@@ -21,7 +21,6 @@ func kcSync() {
 	sql := `select * from dwd_f_userbase_order_info where (payable_money > 0 or  (payable_money=0 and  ( filter  like "%分期付款补充权益%"  or   filter  like "%原订单不支持开通多项权益%"  or    filter  like "%原订单不支持开通多项权益%")))
 	  and  data_spec!="dhy4" and  order_status=1  and refund_status!=1  and  vip_starttime<"2099-01-01"
 	  and vip_endtime > "` + time.Now().Format(date.Date_Full_Layout) + `" and autoUpdate > "` + cfg.LastkcTime + `" order by autoUpdate asc`
-
 	//sql := `select * from dwd_f_userbase_order_info where order_code="152504013602"  `
 	data := TiDb.SelectBySql(sql)
 	if data != nil && *data != nil && len(*data) > 0 {
@@ -206,23 +205,29 @@ func kcJob(data map[string]interface{}) int {
 			log.Println("移交客成positionId", customerPositionId, customerName, saleDep, orderPositionId, salesperson, true)
 			oldName := gconv.String((*csmdata)["name"])
 			updateMap := map[string]interface{}{
-				"is_transfer":               0,
-				"is_renewal_protection":     0,
-				"product_access":            product,
-				"buy_subject":               buy_subject,
-				"transfertime":              nowTime,
-				"service_starttime":         starttime,
-				"service_endtime":           endtime,
-				"ent_id":                    entId,
-				"company_name":              company_name,
-				"name":                      customerName,
-				"position_id":               customerPositionId,
-				"relationship_building_way": 1,
-				"tasksource":                "1",
+				"is_transfer":           0,
+				"is_renewal_protection": 0,
+				"product_access":        product,
+				"buy_subject":           buy_subject,
+				"transfertime":          nowTime,
+				"service_starttime":     starttime,
+				"service_endtime":       endtime,
+				"ent_id":                entId,
+				"company_name":          company_name,
+				"name":                  customerName,
+				"position_id":           customerPositionId,
 			}
-			if is_transfer == 0 {
-				delete(updateMap, "relationship_building_way")
-				delete(updateMap, "tasksource")
+			if is_transfer == 1 {
+				//重新进去
+				updateMap["relationship_building_way"] = 1
+				updateMap["tasksource"] = "1"
+				updateMap["inventory_way"] = 1
+				updateMap["training_way"] = 1
+				updateMap["is_pre_sales_training"] = 0
+				updateMap["service_stage"] = 1
+			} else {
+				updateMap["relationship_building_way"] = 1
+				updateMap["tasksource"] = "1"
 			}
 			TiDb.Update("dwd_f_csm_customer_info", map[string]interface{}{"clue_id": clueId}, updateMap)
 			TiDb.Insert("dwd_f_crm_clue_change_record", map[string]interface{}{