|
@@ -817,6 +817,10 @@ func WorkUpdateClue(data map[string]interface{}, saleData []map[string]interface
|
|
|
clueUpdateData["trailstatus_time"] = nowTime
|
|
|
}
|
|
|
}
|
|
|
+ if trailstatus == "02" { //在公海的成交客户
|
|
|
+ clueUpdateData["trailstatus"] = "01"
|
|
|
+ clueUpdateData["trailstatus_time"] = nowTime
|
|
|
+ }
|
|
|
is_ok := false
|
|
|
if (trailstatus != "08" && recordCount <= 0) || is_assign == 0 {
|
|
|
if trailstatus == "00" && trailstatusTime != "" && time.Now().Unix()-trailstatusTimes.Unix() < 86400 {
|
|
@@ -992,6 +996,29 @@ func WorkUpdateClue(data map[string]interface{}, saleData []map[string]interface
|
|
|
"operator_id": -1,
|
|
|
})
|
|
|
}
|
|
|
+ } else if trailstatus != "08" && is_assign == -1 {
|
|
|
+ updateId1 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
|
|
|
+ "clue_id": clueId,
|
|
|
+ "position_id": positionId,
|
|
|
+ "change_field": "position_id",
|
|
|
+ "change_type": "所属人变更",
|
|
|
+ "old_value": common.If(oldsaleName != "", oldsaleName, "/"),
|
|
|
+ "new_value": common.If(saleName != "", saleName, "/"),
|
|
|
+ "createtime": nowTime,
|
|
|
+ "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,
|
|
|
+ })
|
|
|
} else if (pIsOk && old_cluename == cluename && cluename != "") && is_assign == 1 && positionId != old_position_id {
|
|
|
updateId1 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
|
|
|
"clue_id": clueId,
|
|
@@ -1010,7 +1037,6 @@ func WorkUpdateClue(data map[string]interface{}, saleData []map[string]interface
|
|
|
} else {
|
|
|
if old_sub_cluetype != sub_cluetype && !is_ok {
|
|
|
if is_transfer != 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, positionId, common.If(is_assign == 1, positionId, common.Int64All(data["position_id"]))),
|
|
@@ -1332,6 +1358,7 @@ func UpdateClue(data map[string]interface{}, saleData []map[string]interface{},
|
|
|
clueUpdateData["position_id"] = positionId
|
|
|
clueUpdateData["comeintime"] = nowTime
|
|
|
clueUpdateData["is_assign"] = 1
|
|
|
+ clueUpdateData["is_assign"] = 1
|
|
|
clueUpdateData["comeinsource_open"] = nil
|
|
|
clueUpdateData["level_open"] = nil
|
|
|
clueUpdateData["clue_level"] = nil
|
|
@@ -1356,6 +1383,10 @@ func UpdateClue(data map[string]interface{}, saleData []map[string]interface{},
|
|
|
clueUpdateData["trailstatus_time"] = nowTime
|
|
|
}
|
|
|
}
|
|
|
+ if trailstatus == "02" { //在公海的成交客户
|
|
|
+ clueUpdateData["trailstatus"] = "01"
|
|
|
+ clueUpdateData["trailstatus_time"] = nowTime
|
|
|
+ }
|
|
|
is_ok := false
|
|
|
if (trailstatus != "08" && recordCount <= 0) || is_assign == 0 {
|
|
|
if trailstatus == "00" && trailstatusTime != "" && time.Now().Unix()-trailstatusTimes.Unix() < 86400 {
|
|
@@ -1530,6 +1561,29 @@ func UpdateClue(data map[string]interface{}, saleData []map[string]interface{},
|
|
|
"operator_id": -1,
|
|
|
})
|
|
|
}
|
|
|
+ } else if trailstatus != "08" && is_assign == -1 {
|
|
|
+ updateId1 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
|
|
|
+ "clue_id": clueId,
|
|
|
+ "position_id": positionId,
|
|
|
+ "change_field": "position_id",
|
|
|
+ "change_type": "所属人变更",
|
|
|
+ "old_value": common.If(oldsaleName != "", oldsaleName, "/"),
|
|
|
+ "new_value": common.If(saleName != "", saleName, "/"),
|
|
|
+ "createtime": nowTime,
|
|
|
+ "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) || is_assign == 0 {
|
|
|
if trailstatus == "00" && trailstatusTime != "" && time.Now().Unix()-trailstatusTimes.Unix() < 86400 {
|