Browse Source

加车处理

WH01243 11 months ago
parent
commit
d4699c94c2
1 changed files with 11 additions and 26 deletions
  1. 11 26
      clueSync/job.go

+ 11 - 26
clueSync/job.go

@@ -1092,19 +1092,6 @@ func WorkUpdateClue(data map[string]interface{}, saleData []map[string]interface
 					}
 
 				}
-				if old_sub_cluetype == sub_cluetype && !is_ok {
-					if trailstatus == "00" || is_assign == 0 || is_assign == -1 {
-						updateId5 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
-							"clue_id":     clueId,
-							"position_id": positionId,
-							"change_type": "加入任务车",
-							"new_value":   gconv.String(common.If(gconv.Int64(data["position_id"]) == 0, "线索自动分配", "线索来源自动更新")) + "-" + topname + "-" + subname,
-							"createtime":  nowTime,
-							"BCPCID":      common.GetRandom(32),
-							"operator_id": -1,
-						})
-					}
-				}
 			}
 		}
 		if old_top_cluetype != "" {
@@ -1668,20 +1655,18 @@ func UpdateClue(data map[string]interface{}, saleData []map[string]interface{},
 							})
 						}
 					}
+				} else if gconv.Int64(clueUpdateData["is_task"]) == 1 {
+					updateId5 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
+						"clue_id":     clueId,
+						"position_id": common.If(trailstatus == "00" || is_assign == 0 || is_assign == -1, positionId, common.Int64All(data["position_id"])),
+						"change_type": "加入任务车",
+						"new_value":   gconv.String(common.If(gconv.Int64(data["position_id"]) == 0, "线索自动分配", "线索来源自动更新")) + "-" + topname + "-" + subname,
+						"createtime":  nowTime,
+						"BCPCID":      common.GetRandom(32),
+						"operator_id": -1,
+					})
 				}
-				if old_sub_cluetype == sub_cluetype && !is_ok {
-					if trailstatus == "00" || trailstatus == "09" || is_assign == 0 || is_assign == -1 {
-						updateId5 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
-							"clue_id":     clueId,
-							"position_id": positionId,
-							"change_type": "加入任务车",
-							"new_value":   gconv.String(common.If(gconv.Int64(data["position_id"]) == 0, "线索自动分配", "线索来源自动更新")) + "-" + topname + "-" + subname,
-							"createtime":  nowTime,
-							"BCPCID":      common.GetRandom(32),
-							"operator_id": -1,
-						})
-					}
-				}
+
 			}
 		}
 		if old_top_cluetype != "" {