Selaa lähdekoodia

批量分配处理

WH01243 1 vuosi sitten
vanhempi
commit
f68b1e22e5
1 muutettua tiedostoa jossa 6 lisäystä ja 3 poistoa
  1. 6 3
      service/company.go

+ 6 - 3
service/company.go

@@ -73,7 +73,7 @@ func DistributeClueShow(this *biservice.DistributeClueShowReq, allocationCap int
 			if this.DataType != 1 {
 				return &biservice.DistributeClueShowResp{
 					ErrorCode: 1,
-					ErrorMsg:  "线索已达上限",
+					ErrorMsg:  "超出私海线索上限",
 				}
 			} else {
 				continue
@@ -83,6 +83,9 @@ func DistributeClueShow(this *biservice.DistributeClueShowReq, allocationCap int
 			m.CompanyCount = 0
 			m.MinCount = 0
 		} else {
+			if c.DistributedCount <= 0 {
+				continue
+			}
 			m.CompanyCount = c.DistributedCount
 		}
 		rdata = append(rdata, m)
@@ -310,7 +313,7 @@ func DistributeClueShow(this *biservice.DistributeClueShowReq, allocationCap int
 						if this.UpdatePositionID == rdata[minIndex].PositionId {
 							return &biservice.DistributeClueShowResp{
 								ErrorCode: 1,
-								ErrorMsg:  "线索已达上限",
+								ErrorMsg:  "超出私海线索上限",
 							}
 						}
 
@@ -344,7 +347,7 @@ func DistributeClueShow(this *biservice.DistributeClueShowReq, allocationCap int
 					}
 				}
 				if this.DataType == 3 && isindexok {
-					iddata := JyBiTidb.SelectBySql(`SELECT id FROM dwd_f_crm_clue_info WHERE cluename = "` + cluename + `" and id in (` + strings.Join(clueArrs1, ",") + `)`)
+					iddata := JyBiTidb.SelectBySql(`SELECT id FROM dwd_f_crm_clue_info WHERE cluename = "` + cluename + `" and id in (` + strings.Join(clueArrs1, ",") + `) ORDER BY createtime DESC LIMIT ` + gconv.String(count))
 					if iddata != nil { //分线索
 						wg := new(sync.WaitGroup)
 						ch := make(chan bool, 10)