|
@@ -539,7 +539,7 @@ func ClueImportSync(this *biservice.ClueImportReq) (string, int) {
|
|
|
clueData := JyBiTidb.FindOne("dwd_f_crm_clue_info", map[string]interface{}{"phone": phone}, "", "")
|
|
|
if clueData == nil || len(*clueData) == 0 {
|
|
|
countAdd++
|
|
|
- JyBiTidb.Insert("dwd_f_crm_clue_info", map[string]interface{}{
|
|
|
+ clueId := JyBiTidb.Insert("dwd_f_crm_clue_info", map[string]interface{}{
|
|
|
"userid": v["userId"],
|
|
|
"uid": v["uId"],
|
|
|
"is_assign": 0,
|
|
@@ -555,6 +555,25 @@ func ClueImportSync(this *biservice.ClueImportReq) (string, int) {
|
|
|
"position": position,
|
|
|
"batch_import": this.Pcbh,
|
|
|
})
|
|
|
+ JyBiTidb.Insert("dwd_f_crm_clue_change_record", map[string]interface{}{
|
|
|
+ "clue_id": clueId,
|
|
|
+ "position_id": -1,
|
|
|
+ "change_type": "创建线索",
|
|
|
+ "new_value": "线索导入创建",
|
|
|
+ "createtime": nowTime,
|
|
|
+ "BCPCID": common.GetRandom(32),
|
|
|
+ "operator_id": this.PositionId,
|
|
|
+ })
|
|
|
+ if JyBiTidb.Count("dwd_f_userbase_contacts", map[string]interface{}{"phone": phone}) == 0 {
|
|
|
+ JyBiTidb.Insert("dwd_f_userbase_contacts", map[string]interface{}{
|
|
|
+ "status": 1,
|
|
|
+ "is_delete": 1,
|
|
|
+ "createtime": nowTime,
|
|
|
+ "updatetime": nowTime,
|
|
|
+ "phone": phone,
|
|
|
+ "baseinfo_id": v["uId"],
|
|
|
+ })
|
|
|
+ }
|
|
|
} else {
|
|
|
is_assign := common.IntAll((*clueData)["is_assign"])
|
|
|
clueId := common.Int64All((*clueData)["id"])
|