|
@@ -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 "%原订单不支持开通多项权益%")))
|
|
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 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`
|
|
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" `
|
|
//sql := `select * from dwd_f_userbase_order_info where order_code="152504013602" `
|
|
data := TiDb.SelectBySql(sql)
|
|
data := TiDb.SelectBySql(sql)
|
|
if data != nil && *data != nil && len(*data) > 0 {
|
|
if data != nil && *data != nil && len(*data) > 0 {
|
|
@@ -206,23 +205,26 @@ func kcJob(data map[string]interface{}) int {
|
|
log.Println("移交客成positionId", customerPositionId, customerName, saleDep, orderPositionId, salesperson, true)
|
|
log.Println("移交客成positionId", customerPositionId, customerName, saleDep, orderPositionId, salesperson, true)
|
|
oldName := gconv.String((*csmdata)["name"])
|
|
oldName := gconv.String((*csmdata)["name"])
|
|
updateMap := map[string]interface{}{
|
|
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
|
|
}
|
|
}
|
|
TiDb.Update("dwd_f_csm_customer_info", map[string]interface{}{"clue_id": clueId}, updateMap)
|
|
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{}{
|
|
TiDb.Insert("dwd_f_crm_clue_change_record", map[string]interface{}{
|
|
@@ -641,6 +643,7 @@ func refundAuto() {
|
|
"reason": "成交客户续费失败",
|
|
"reason": "成交客户续费失败",
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+ continue
|
|
}
|
|
}
|
|
isFull := FindUpperLimit(gconv.String(saleId), "", false)
|
|
isFull := FindUpperLimit(gconv.String(saleId), "", false)
|
|
isAllRefund := false
|
|
isAllRefund := false
|