ソースを参照

人员分配失败处理

WH01243 10 ヶ月 前
コミット
3317c917a8
1 ファイル変更12 行追加11 行削除
  1. 12 11
      clueSync/jobutil.go

+ 12 - 11
clueSync/jobutil.go

@@ -1080,32 +1080,33 @@ func autoDraw(mode, cluename, phone string, isGroup, isCommerce int) (positionId
 					upperLimitCount := 0
 					isFull := false
 					for _, m := range *cdata {
-						positionid := gconv.Int64(m["position_id"])
+						positionid1 := gconv.Int64(m["position_id"])
 						for _, v := range *pdata {
 							resign := common.IntAll(v["resign"])
 							assign_type := common.IntAll(v["assign_type"])
 							role_id := common.IntAll(v["role_id"])
-							if positionid == common.Int64All(v["position_id"]) {
+							if positionid1 == common.Int64All(v["position_id"]) {
 								if resign == 0 && (assign_type == 1 || role_id == 8) {
-									if !FindUpperLimit(gconv.String(positionid), mode, true) {
-										personMap[positionid] = true
+									if !FindUpperLimit(gconv.String(positionid1), mode, true) {
+										personMap[positionid1] = true
 										m["saleName"] = common.ObjToString(v["name"])
 										cdataNew = append(cdataNew, m)
 									} else {
 										upperLimitCount++
-										upperLimitPersonMap[positionid] = true
+										upperLimitPersonMap[positionid1] = true
 										m["saleName"] = common.ObjToString(v["name"])
 										upperLimitCdataNew = append(upperLimitCdataNew, m)
 									}
 								}
 							}
 						}
-						if len(cdataNew) == 0 && len(upperLimitCdataNew) > 0 {
-							//没有达上限的人数为0    全部都是达上限的
-							personMap = upperLimitPersonMap
-							cdataNew = upperLimitCdataNew
-							isFull = true
-						}
+
+					}
+					if len(cdataNew) == 0 && len(upperLimitCdataNew) > 0 {
+						//没有达上限的人数为0    全部都是达上限的
+						personMap = upperLimitPersonMap
+						cdataNew = upperLimitCdataNew
+						isFull = true
 					}
 					//查询是否都有没有离职
 					if len(personMap) != 0 && len(cdataNew) > 0 {