Bladeren bron

Merge branch 'dev_v1.5.2_wh' of jianyu/datatools into feature/v1.5.2

王浩 1 jaar geleden
bovenliggende
commit
918beba8e7
2 gewijzigde bestanden met toevoegingen van 4 en 4 verwijderingen
  1. 1 0
      clueSync/job.go
  2. 3 4
      clueSync/jobutil.go

+ 1 - 0
clueSync/job.go

@@ -343,6 +343,7 @@ func FormatData(data map[string]interface{}, item string) (bool, bool) {
 							"position_id":  0,
 							"BCPCID":       BCPCID,
 							"operator_id":  -1})
+						clueUpdateData["role"] = role
 					}
 					if old_cluename != cluename && cluename != "" {
 						clueUpdateData["cluename"] = cluename //新的线索名不为空才替换

+ 3 - 4
clueSync/jobutil.go

@@ -507,9 +507,8 @@ func autoDraw(mode, cluename, phone string, isGroup, isCommerce int) (positionId
 			for _, kv := range *data {
 				positionId1 := gconv.String(kv["position_id"])
 				if !FindUpperLimit(positionId1, "", false) {
+					positionId = common.Int64All(kv["position_id"])
 					saleName = common.ObjToString(kv["name"])
-					positionId = common.Int64All((*data)[0]["position_id"])
-					saleName = common.ObjToString((*data)[0]["name"])
 					rData := TiDb.FindOne("dwd_f_crm_clue_autodraw_record", map[string]interface{}{"clue_level": mode}, "", "count desc")
 					if rData != nil && len(*rData) > 0 {
 						TiDb.Insert("dwd_f_crm_clue_autodraw_record", map[string]interface{}{
@@ -569,9 +568,9 @@ func FindUpperLimit(positionId string, level string, isAdd bool) bool {
 		return false
 	}
 	isFull := false
-	fmt.Println("111", positionId, TiDb.CountBySql(`select count(1) from dwd_f_crm_clue_info where position_id=? and is_assign=1    `, positionId))
+	fmt.Println("111", positionId, TiDb.CountBySql(`select count(1) from dwd_f_crm_clue_info where position_id=? and is_assign=1  and trailstatus != '08'    `, positionId))
 	isFull = TiDb.CountBySql(`select count(1) from dwd_f_crm_clue_info where position_id=? and is_assign=1   and trailstatus != '08'  `, positionId) >= cfg.AllocationCap
-
+	fmt.Println("2222", TiDb.CountBySql(`select count(1) from dwd_f_crm_clue_info where position_id=? and is_assign=1   and trailstatus != '08'  `, positionId), TiDb.CountBySql(`select count(1) from dwd_f_crm_clue_info where position_id=? and is_assign=1   and trailstatus != '08'  `, positionId) >= cfg.AllocationCap)
 	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)
 	}