|
@@ -425,14 +425,57 @@ func ReturnOpenSea() {
|
|
|
|
|
|
now := time.Now().Format(date.Date_Full_Layout)
|
|
|
|
|
|
+ //判断节假日
|
|
|
+ statusMap := map[string]int{
|
|
|
+ "06": highIntentionCustomer,
|
|
|
+ "05": intentionCustomer,
|
|
|
+ "04": latentCustomer,
|
|
|
+ "03": sleepCustomer,
|
|
|
+ "01": businessLeads,
|
|
|
+ }
|
|
|
+ for status, statusInt := range statusMap {
|
|
|
+ count, counts := 0, 0
|
|
|
+ for {
|
|
|
+ count++
|
|
|
+ currentTime := t.AddDate(0, 0, -count)
|
|
|
+ currentTime.Format(date.Date_Short_Layout)
|
|
|
+ if currentTime.Weekday() == time.Sunday || currentTime.Weekday() == time.Sunday {
|
|
|
+ isok := false
|
|
|
+ for k, v := range config.DateMap {
|
|
|
+ if currentTime.Format(date.Date_Short_Layout) == k && v == 2 {
|
|
|
+ isok = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if isok {
|
|
|
+ counts++
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ isok := true
|
|
|
+ for k, v := range config.DateMap {
|
|
|
+ if currentTime.Format(date.Date_Short_Layout) == k && v == 1 {
|
|
|
+ isok = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if isok {
|
|
|
+ counts++
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if counts >= statusInt {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ statusMap[status] = counts
|
|
|
+ }
|
|
|
+ //
|
|
|
+
|
|
|
//2.“高意向客户”超过30天未更新跟进记录自动退回公海;
|
|
|
- for trailstatus, nexttime := range map[string]interface{}{
|
|
|
- "06": t.AddDate(0, 0, -highIntentionCustomer),
|
|
|
- "05": t.AddDate(0, 0, -intentionCustomer),
|
|
|
- "04": t.AddDate(0, 0, -latentCustomer),
|
|
|
- "03": t.AddDate(0, 0, -sleepCustomer),
|
|
|
- "01": t.AddDate(0, 0, -businessLeads),
|
|
|
- "00": t,
|
|
|
+ for trailstatus, _ := range map[string]string{
|
|
|
+ "06": "",
|
|
|
+ "05": "",
|
|
|
+ "04": "",
|
|
|
+ "03": "",
|
|
|
+ "01": "",
|
|
|
+ "00": "",
|
|
|
} {
|
|
|
sql := `SELECT a.clue_id,a.position_id,a.seatNumber FROM dwd_f_crm_private_sea a
|
|
|
LEFT JOIN dwd_f_crm_clue_info b ON a.clue_id=b.id
|
|
@@ -442,7 +485,8 @@ func ReturnOpenSea() {
|
|
|
intime := ""
|
|
|
if trailstatus != "00" {
|
|
|
sql += " AND a.comeintime <?"
|
|
|
- nt, _ := nexttime.(time.Time)
|
|
|
+ nt := t.AddDate(0, 0, -statusMap[trailstatus])
|
|
|
+ // nt, _ := nexttime.(time.Time)
|
|
|
intime = nt.Format(date.Date_Full_Layout)
|
|
|
argsSelect = append(argsSelect, intime)
|
|
|
}
|
|
@@ -538,7 +582,7 @@ func ReturnOpenSea() {
|
|
|
log.Println("return sea end")
|
|
|
}
|
|
|
|
|
|
-//2私海手动退回 3私海高意向客户自动退回 4私海意向客户退回 5私海潜在客户退回 6私海沉睡客户退回 7私海商机线索退回 8私海无意向客户退回
|
|
|
+// 2私海手动退回 3私海高意向客户自动退回 4私海意向客户退回 5私海潜在客户退回 6私海沉睡客户退回 7私海商机线索退回 8私海无意向客户退回
|
|
|
func GetComeSource() map[string]int {
|
|
|
return map[string]int{
|
|
|
"06": 3,
|
|
@@ -584,9 +628,9 @@ func GetPositionName(seatNumber string) string {
|
|
|
return ""
|
|
|
}
|
|
|
|
|
|
-//(4)回收站:
|
|
|
-//A.5个自然日内被销售人员手动退回公海的客户;
|
|
|
-//B.3个自然日内有过“已接听”的通话记录且仍处于“商机线索”状态下的客户。
|
|
|
+// (4)回收站:
|
|
|
+// A.5个自然日内被销售人员手动退回公海的客户;
|
|
|
+// B.3个自然日内有过“已接听”的通话记录且仍处于“商机线索”状态下的客户。
|
|
|
func Recycle() {
|
|
|
log.Println("回收站开始")
|
|
|
ctx := gctx.New()
|