WH01243 1 сар өмнө
parent
commit
55217a5b47

+ 0 - 1
clueSync/config.go

@@ -225,7 +225,6 @@ type (
 	ConditionEntity struct {
 		TopName      string      `json:"topName"`
 		SubName      string      `json:"subName"`
-		Limitation   int64       `json:"limitation"`
 		ConditionArr []Condition `json:"conditionArr"`
 	}
 	Condition struct {

+ 2 - 2
clueSync/job.go

@@ -18,7 +18,7 @@ import (
 )
 
 func FormatData(data map[string]interface{}, item string) (bool, bool, bool) {
-	userId, uId, positionId, source, cluename, phone, sourceCode, keyword, limitation := gconv.String(data["user_id"]), "", "", "", "", "", "", []string{}, gconv.Int64(data["limitation"])
+	userId, uId, positionId, source, cluename, phone, sourceCode, keyword, _ := gconv.String(data["user_id"]), "", "", "", "", "", "", []string{}, ""
 	role, industry, department, departments, position, name, top_cluetype, sub_cluetype, follow_project_area, level := "", "", "", "", "", "", "", "", "", ""
 	query, topname, subname, belong_to, sourceName, remark, sourceId := map[string]interface{}{}, "", "", "01", "", "", int64(0)
 	nowTime := time.Now().Format("2006-01-02 15:04:05")
@@ -343,7 +343,7 @@ func FormatData(data map[string]interface{}, item string) (bool, bool, bool) {
 		return true, true, true
 	}
 	log.Println("人员选择", level, cluename, phone, isGroup, isCommerce)
-	position_id, seatNumber, saleName, saleData, pIsOk, isFreeze, noticePositionId := autoDraw(level, cluename, phone, isGroup, isCommerce, item, limitation) //查询当前分配次数最少的,如果当前线索有销售,此次找出的不会+1
+	position_id, seatNumber, saleName, saleData, pIsOk, isFreeze, noticePositionId := autoDraw(level, cluename, phone, isGroup, isCommerce) //查询当前分配次数最少的,如果当前线索有销售,此次找出的不会+1
 	log.Println("data -------", position_id, seatNumber, saleName, pIsOk, isFreeze, noticePositionId)
 	if position_id > 0 && seatNumber != "" {
 		uCount, oks := TiDb.FindOne("dwd_f_crm_clue_info", map[string]interface{}{"uid": uId}, "", ""), true //查当前线索是否已存在

+ 2 - 15
clueSync/jobutil.go

@@ -1037,7 +1037,7 @@ func getClueType(item string, data map[string]interface{}, sourceCode string, so
 }
 
 // 获取自动分配的人
-func autoDraw(mode, cluename, phone string, isGroup, isCommerce int, item string, limitation int64) (positionId int64, seatNumber, saleName string, saleData []map[string]interface{}, isOk, isFreeze bool, noticePositionId int64) {
+func autoDraw(mode, cluename, phone string, isGroup, isCommerce int) (positionId int64, seatNumber, saleName string, saleData []map[string]interface{}, isOk, isFreeze bool, noticePositionId int64) {
 	isOk = false
 	isFreeze = false
 	if TiDb.Count("dwd_f_crm_clue_info", map[string]interface{}{"phone": phone, "is_assign": 1}) == 0 { //线索没销售进入,有销售走分配次数最少的逻辑
@@ -1075,7 +1075,6 @@ func autoDraw(mode, cluename, phone string, isGroup, isCommerce int, item string
 										m["saleName"] = common.ObjToString(v["name"])
 										cdataNew = append(cdataNew, m)
 									} else {
-										//达上限了
 										upperLimitCount++
 										upperLimitPersonMap[positionid1] = true
 										m["saleName"] = common.ObjToString(v["name"])
@@ -1267,7 +1266,7 @@ func autoDraw(mode, cluename, phone string, isGroup, isCommerce int, item string
 						if FindUpperLimit(gconv.String(v["position_id"]), mode, false) {
 							continue
 						}
-						if countres == 0 && (item=="tag"&&  ){
+						if countres == 0 {
 							res = common.Int64All(v["count"])
 							positionId = common.Int64All(v["position_id"])
 						} else {
@@ -1366,18 +1365,6 @@ func FindUpperLimit(positionId string, level string, isAdd bool) bool {
 	}
 	return isFull
 }
-//735线索是否达总量
-func Find735UpperLimit(positionId string, subName string, isAdd bool,limitation int64 ) bool {
-	timeStr:=time.Now().Format(time.time.DateOnly)
-	if positionId == "" {
-		return false
-	}
-	isFull := TiDb.CountBySql(`select count from dwd_f_crm_clue_autodraw_record where position_id=? and subName=?   and date = ?  `, positionId,subName,timeStr) >= limitation
-	if isFull && isAdd && level != "" {
-		TiDb.UpdateOrDeleteBySql(`update dwd_f_crm_clue_autodraw_record set count = count + 1 where position_id = ? and clue_level = ?`, positionId, level)
-	}
-	return isFull
-}
 func getSeatNumberPositionId(seatNumber string) (positionId int64) {
 	saleData := TiDb.FindOne("dwd_f_crm_personnel_management", map[string]interface{}{"seat_number": seatNumber}, "", "")
 	if saleData != nil && len(*saleData) > 0 {

+ 1 - 1
clueSync/tag.go

@@ -399,6 +399,7 @@ func LabelToClue() {
 		if len(dataArr) == 0 {
 			continue
 		}
+
 		for _, baseUserId := range dataArr {
 			log.Println("735标签用户:", baseUserId)
 			if baseUserId == 0 {
@@ -408,7 +409,6 @@ func LabelToClue() {
 				"baseUserId": baseUserId,
 				"topName":    v.TopName,
 				"subName":    v.SubName,
-				"limitation": v.Limitation,
 			}, "tag")
 
 		}