|
@@ -650,6 +650,9 @@ func UpdateClue(data map[string]interface{}, saleData []map[string]interface{},
|
|
|
clueUpdateData["position_id"] = positionId
|
|
|
clueUpdateData["comeintime"] = nowTime
|
|
|
clueUpdateData["is_assign"] = 1
|
|
|
+ clueUpdateData["comeinsource_open"] = nil
|
|
|
+ clueUpdateData["level_open"] = nil
|
|
|
+ clueUpdateData["clue_level"] = nil
|
|
|
// seaUpdateData["seatNumber"] = seatNumber
|
|
|
// seaUpdateData["position_id"] = positionId
|
|
|
// seaUpdateData["comeintime"] = nowTime
|
|
@@ -667,6 +670,9 @@ func UpdateClue(data map[string]interface{}, saleData []map[string]interface{},
|
|
|
clueUpdateData["seatNumber"] = old_seatNumber
|
|
|
clueUpdateData["position_id"] = old_position_id
|
|
|
clueUpdateData["is_assign"] = 1
|
|
|
+ clueUpdateData["comeinsource_open"] = nil
|
|
|
+ clueUpdateData["level_open"] = nil
|
|
|
+ clueUpdateData["clue_level"] = nil
|
|
|
}
|
|
|
if trailstatus != "08" && is_assign == 0 {
|
|
|
if trailstatus == "00" && trailstatusTime != "" && time.Now().Unix()-trailstatusTimes.Unix() < 86400 {
|
|
@@ -778,7 +784,7 @@ func UpdateClue(data map[string]interface{}, saleData []map[string]interface{},
|
|
|
}
|
|
|
} else if trailstatus != "08" && is_assign == 0 {
|
|
|
if trailstatus == "00" && trailstatusTime != "" && time.Now().Unix()-trailstatusTimes.Unix() < 86400 {
|
|
|
- } else if trailstatus != "01" {
|
|
|
+ } else {
|
|
|
updateId1 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
|
|
|
"clue_id": clueId,
|
|
|
"position_id": positionId,
|
|
@@ -790,6 +796,19 @@ func UpdateClue(data map[string]interface{}, saleData []map[string]interface{},
|
|
|
"BCPCID": common.GetRandom(32),
|
|
|
"operator_id": -1,
|
|
|
})
|
|
|
+ if trailstatus != "01" {
|
|
|
+ updateId4 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
|
|
|
+ "clue_id": clueId,
|
|
|
+ "position_id": positionId,
|
|
|
+ "change_field": "trailstatus",
|
|
|
+ "change_type": "基本信息变更",
|
|
|
+ "old_value": CodeTrail[trailstatus],
|
|
|
+ "new_value": "商机线索",
|
|
|
+ "createtime": nowTime,
|
|
|
+ "BCPCID": common.GetRandom(32),
|
|
|
+ "operator_id": -1,
|
|
|
+ })
|
|
|
+ }
|
|
|
updateId3 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
|
|
|
"clue_id": clueId,
|
|
|
"position_id": positionId,
|
|
@@ -801,20 +820,9 @@ func UpdateClue(data map[string]interface{}, saleData []map[string]interface{},
|
|
|
"BCPCID": common.GetRandom(32),
|
|
|
"operator_id": -1,
|
|
|
})
|
|
|
- updateId4 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
|
|
|
- "clue_id": clueId,
|
|
|
- "position_id": positionId,
|
|
|
- "change_field": "trailstatus",
|
|
|
- "change_type": "基本信息变更",
|
|
|
- "old_value": CodeTrail[trailstatus],
|
|
|
- "new_value": "商机线索",
|
|
|
- "createtime": nowTime,
|
|
|
- "BCPCID": common.GetRandom(32),
|
|
|
- "operator_id": -1,
|
|
|
- })
|
|
|
}
|
|
|
}
|
|
|
- if trailstatus != "08" && recordCount <= 0 {
|
|
|
+ if (trailstatus != "08" && recordCount <= 0) || is_assign == 0 {
|
|
|
if trailstatus == "00" && trailstatusTime != "" && time.Now().Unix()-trailstatusTimes.Unix() < 86400 {
|
|
|
} else {
|
|
|
updateId5 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
|