Преглед на файлове

邮件缺失时间处理

WH01243 преди 3 месеца
родител
ревизия
d12225433d
променени са 1 файла, в които са добавени 20 реда и са изтрити 27 реда
  1. 20 27
      clueSync/kc.go

+ 20 - 27
clueSync/kc.go

@@ -705,7 +705,7 @@ func refundAuto() {
 			isRenewalProtection := common.IntAll(v["is_renewal_protection"])
 			clueData := TiDb.FindOne("dwd_f_crm_clue_info", map[string]interface{}{"id": clueId}, "name,phone,company_nature,company_verification,cluename,userid,position_id,uid", "")
 			if clueData != nil && len(*clueData) > 0 {
-				uid := gconv.String((*clueData)["uid"])
+				uid = gconv.String((*clueData)["uid"])
 				saleId, newPerson, newSeatNumber = FindPositionIdClueId(uid)
 				oldSaleId = common.Int64All((*clueData)["position_id"])
 				oldPersonData := FindPersonOne(oldSaleId)
@@ -716,7 +716,6 @@ func refundAuto() {
 				userName = gconv.String((*clueData)["name"])
 				company_nature = common.IntAll((*clueData)["company_nature"])
 				company_verification = common.IntAll((*clueData)["company_verification"])
-				uid = gconv.String((*clueData)["uid"])
 				phone = gconv.String((*clueData)["phone"])
 			}
 			personArr := getUserIdToUid(uid)
@@ -1059,8 +1058,8 @@ func refundAuto() {
 			}
 		}
 		return true
-	}, `select ent_id,clue_id,position_id,name,is_renewal_protection,company_name from dwd_f_csm_customer_info where is_transfer = 0`)
-	//}, `select ent_id,clue_id,position_id,name,is_renewal_protection,company_name from dwd_f_csm_customer_info where clue_id =1189082`)
+		//}, `select ent_id,clue_id,position_id,name,is_renewal_protection,company_name from dwd_f_csm_customer_info where is_transfer = 0`)
+	}, `select ent_id,clue_id,position_id,name,is_renewal_protection,company_name from dwd_f_csm_customer_info where id =570005`)
 
 	//移交电销提醒
 	for i, v := range mailData {
@@ -1451,9 +1450,8 @@ func FindPositionIdClueId(uid string) (int64, string, string) {
 	for _, m := range *clueData {
 		productType := gconv.String(m["productType"])
 		if productType == "大会员" {
-			fileJson := gconv.Map(m["filter"])
-			comboId := gconv.Int(fileJson["comboId"])
-			if comboId == 4 {
+			level := gconv.Int(m["service_type"])
+			if level == 4 {
 				continue
 			}
 		}
@@ -1848,8 +1846,8 @@ func KcOrderFormat(orderCode string) *OrderInfo {
 		product_type := gconv.String(orderData["product_type"])
 		serviceList := []string{}
 		if product_type == "大会员" {
-			product_type_name, _, comboId := GetOrderProduct(product_type, gconv.String(orderData["filter"]))
-			if comboId == 5 {
+			product_type_name, _, level := GetOrderProduct(product_type, gconv.String(orderData["filter"]))
+			if level == 5 {
 				product_type += "自定义版"
 				for _, serversId := range strings.Split(gconv.String(gconv.Map(orderData["serversId"])), ",") {
 					if serviceName := bigmemberService[common.Int64All(serversId)]; serviceName != "" {
@@ -1979,27 +1977,22 @@ func GetOrderProduct(productType string, file string) (string, int64, int64) {
 		return "", 0, 0
 	}
 	productName := ""
-	comboId := int64(0)
+	level := int64(0)
 	switch productType {
 	case "大会员":
-		comboId = gconv.Int64(fileJson["comboId"])
+
+		level = gconv.Int64(fileJson["comboId"])
+		if level == 0 {
+			level = gconv.Int64(fileJson["level"])
+		}
 		// {1: "专家版", 2: "智慧版", 3: "商机版", 4: "试用版", 5: "定制版", 6: "商机版2.0", 7: "专家版2.0"}
-		switch comboId {
-		case 1:
-			productName = "大会员专家版"
-		case 2:
-			productName = "大会员智慧版"
-		case 3:
-			productName = "大会员商家版"
-		case 5:
+		switch level {
+		case 0:
 			productName = "大会员自定义"
+		case 30190:
+			productName = "大会员商机版2.0(单省版)"
 		case 6:
-			areaCount := common.IntAll(fileJson["areaCount"])
-			if areaCount == 1 {
-				productName = "大会员商机版2.0(单省版)"
-			} else {
-				productName = "大会员商机版2.0"
-			}
+			productName = "大会员商机版2.0"
 		case 7:
 			productName = "大会员专家版2.0"
 		}
@@ -2010,9 +2003,9 @@ func GetOrderProduct(productType string, file string) (string, int64, int64) {
 		"name": productName,
 	}, "", "")
 	if productData == nil || len(*productData) == 0 {
-		return productName, 0, comboId
+		return productName, 0, level
 	}
-	return productName, gconv.Int64((*productData)["code"]), comboId
+	return productName, gconv.Int64((*productData)["code"]), level
 }
 
 func GetTimeDifference(timeStr1, timeStr2 string) int {