Эх сурвалжийг харах

Merge branch 'dev/v1.0.7' of BaseService/biService into feature/v1.0.7

xuzhiheng 2 жил өмнө
parent
commit
36d3443096
1 өөрчлөгдсөн 14 нэмэгдсэн , 1 устгасан
  1. 14 1
      service/clue.go

+ 14 - 1
service/clue.go

@@ -466,6 +466,7 @@ func ClueImportSync(this *biservice.ClueImportReq) (string, int) {
 		defer ClueImportLock.Unlock()
 		result, status, dataArr, countOpen, countAdd, countPrivate := "", 1, []map[string]interface{}{}, 0, 0, 0
 		phoneRegexp := regexp.MustCompile(`^1[0-9]{10}$`)
+		nowTime := time.Now().Format(date.Date_Full_Layout)
 		data := JyBiTidb.Find("dwd_f_crm_bulk_import", map[string]interface{}{"PCBH": this.Pcbh}, "", "", -1, -1)
 		if data != nil && len(*data) > 0 {
 			for k, v := range *data {
@@ -501,6 +502,19 @@ func ClueImportSync(this *biservice.ClueImportReq) (string, int) {
 								dataMap["userId"] = userId
 								dataMap["uId"] = uId
 							}
+						} else {
+							dataMap["uId"] = common.GetRandom(32)
+							JyBiTidb.Insert("dwd_f_userbase_baseinfo", map[string]interface{}{
+								"userid":       v["userId"],
+								"uid":          dataMap["uId"],
+								"name":         name,
+								"phone":        phone,
+								"source":       4,
+								"company_name": companyName,
+								"status":       3,
+								"createtime":   nowTime,
+								"updatetime":   nowTime,
+							})
 						}
 					}
 				}
@@ -522,7 +536,6 @@ func ClueImportSync(this *biservice.ClueImportReq) (string, int) {
 					dataArr = append(dataArr, dataMap)
 				}
 			}
-			nowTime := time.Now().Format(date.Date_Full_Layout)
 			if result != "" {
 				status = -1
 				JyBiTidb.Update("dwd_f_crm_bulk_import_record", map[string]interface{}{"PCBH": this.Pcbh}, map[string]interface{}{