Pārlūkot izejas kodu

非集团在工商查询修改

WH01243 8 mēneši atpakaļ
vecāks
revīzija
c8a5be8d30
3 mainītis faili ar 16 papildinājumiem un 5 dzēšanām
  1. 1 1
      clueSync/job.go
  2. 14 3
      clueSync/jobutil.go
  3. 1 1
      clueSync/kc.go

+ 1 - 1
clueSync/job.go

@@ -244,7 +244,7 @@ func FormatData(data map[string]interface{}, item string) (bool, bool, bool) {
 	}
 	log.Println(333, cluename)
 	cluename = strings.ReplaceAll(cluename, " ", "")
-	isGroup, isCommerce := GetCompanyType(cluename)                                                                    //判断是否集团公司、工商库
+	isGroup, isCommerce := GetCompanyType(cluename, uId)                                                               //判断是否集团公司、工商库
 	if source == "0104" || strings.HasPrefix(belong_to, "02") || source == "0102" || source == "0103" || phone == "" { //参照用户来源代码表
 		//log.Println("线索分配失败,线索过滤!!", item, source, phone, userId)
 		//saveHlyj(belong_to, item, phone, name, sourceName, cluename, position, nowTime, isGroup, isCommerce)

+ 14 - 3
clueSync/jobutil.go

@@ -76,8 +76,9 @@ func WorkDataHandle(company, phone, demand, name, product string, acceptanceData
 	if cluename == "" {
 		cluename = phone //没有线索名,手机号代替
 	}
+
 	ok, data, saleData := false, map[string]interface{}{}, []map[string]interface{}{}
-	isGroup, isCommerce := GetCompanyType(cluename)
+	isGroup, isCommerce := GetCompanyType(cluename, uId)
 	uCount, _ := TiDb.FindOne("dwd_f_crm_clue_info", map[string]interface{}{"uid": uId}, "", ""), true //查当前线索是否已存在
 	if uCount != nil && len(*uCount) > 0 {
 		isUpdate := gconv.Int64((*uCount)["is_artificially_modified"])
@@ -1326,9 +1327,19 @@ func getPositionId(phone string) (positionId int64) {
 	return
 }
 
-func GetCompanyType(companyName string) (int, int) {
-	//是否是集团
+func GetCompanyType(companyName string, uId string) (int, int) {
 	isGroup, isCommerce := 0, 0
+	uCount := TiDb.FindOne("dwd_f_crm_clue_info", map[string]interface{}{"uid": uId}, "", "")
+	if uCount != nil && len(*uCount) > 0 {
+		isUpdate := gconv.Int64((*uCount)["is_artificially_modified"])
+		if isUpdate == 1 {
+			companyName = gconv.String((*uCount)["cluename"])
+		}
+	}
+	if companyName == "" {
+		return isGroup, isCommerce
+	}
+	//是否是集团
 	if c := TiDb.CountBySql(`select count(1) from group_company_name where company_name=?`, companyName); c > 0 {
 		isGroup = 1
 	}

+ 1 - 1
clueSync/kc.go

@@ -470,7 +470,7 @@ func ordersClue() {
 				} else {
 					trailstatus = "01"
 				}
-				isGroup, isCommerce := GetCompanyType(cluename) //判断是否集团公司、工商库
+				isGroup, isCommerce := GetCompanyType(cluename, uId) //判断是否集团公司、工商库
 				clueData := TiDb.FindOne("dwd_f_crm_clue_info", map[string]interface{}{"uid": uId}, "", "")
 				if clueData == nil || len(*clueData) == 0 {
 					log.Println("saleDep", saleDep)