Forráskód Böngészése

离职数据处理

WH01243 5 hónapja
szülő
commit
2c79fd0f23
1 módosított fájl, 3 hozzáadás és 10 törlés
  1. 3 10
      clueSync/kc.go

+ 3 - 10
clueSync/kc.go

@@ -236,7 +236,7 @@ func kcJob(data map[string]interface{}) int {
 				"BCPCID":      common.GetRandom(32),
 				"operator_id": -1,
 			})
-			if customerPositionId > 0 && is_transfer == 1 {
+			if customerPositionId > 0 && (is_transfer == 1 || customerPositionId != gconv.Int64((*csmdata)["position_id"])) {
 				TiDb.Insert("dwd_f_crm_clue_change_record", map[string]interface{}{
 					"clue_id":      clueId,
 					"position_id":  customerPositionId,
@@ -258,7 +258,7 @@ func kcJob(data map[string]interface{}) int {
 					"operator_id": -1,
 				})
 			}
-			if is_transfer == 1 {
+			if is_transfer == 1 && customerPositionId != gconv.Int64((*csmdata)["position_id"]) {
 				if customerName == db.KeCheng.Admin {
 					TiDb.UpdateOrDeleteBySql(`update dwd_f_csm_customer_autodraw_record set count = count + 2 where name = ?`, customerName)
 				} else {
@@ -442,19 +442,12 @@ func findKcNewPerson(entId int, data *[]map[string]interface{}) (positionId int6
 			countres++
 		}
 	}
-
 	for _, v := range *data {
-
 		if name == common.ObjToString(v["name"]) {
-
 			positionId = common.Int64All(v["position_id"])
-
 		}
-
 	}
-
 	return
-
 }
 func kcAuto() {
 	log.Println("客户成功系统自动进入任务车定时任务开始")
@@ -1004,7 +997,7 @@ 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 =1590274`)
+	//}, `select ent_id,clue_id,position_id,name,is_renewal_protection,company_name from dwd_f_csm_customer_info where clue_id =1651434`)
 
 	//移交电销提醒
 	for i, v := range mailData {