|
@@ -191,6 +191,9 @@ func FormatData(data map[string]interface{}, item string) (bool, bool) {
|
|
//seatNumber position_id
|
|
//seatNumber position_id
|
|
//自动分配规则暂不确定
|
|
//自动分配规则暂不确定
|
|
log.Println("data +++", top_cluetype, sub_cluetype, level, follow_project_area)
|
|
log.Println("data +++", top_cluetype, sub_cluetype, level, follow_project_area)
|
|
|
|
+ if top_cluetype == "" || sub_cluetype == "" || level == "" {
|
|
|
|
+ return true, true
|
|
|
|
+ }
|
|
position_id, seatNumber, saleName, saleData := autoDraw(level)
|
|
position_id, seatNumber, saleName, saleData := autoDraw(level)
|
|
log.Println("data -------", position_id, seatNumber, saleName)
|
|
log.Println("data -------", position_id, seatNumber, saleName)
|
|
if position_id > 0 && seatNumber != "" && top_cluetype != "" && sub_cluetype != "" {
|
|
if position_id > 0 && seatNumber != "" && top_cluetype != "" && sub_cluetype != "" {
|
|
@@ -720,6 +723,11 @@ func autoDraw(mode string) (positionId int64, seatNumber, saleName string, saleD
|
|
isOk := false
|
|
isOk := false
|
|
for _, vv := range *countData {
|
|
for _, vv := range *countData {
|
|
if common.ObjToString(v["seatNumber"]) == common.ObjToString(vv["seatNumber"]) {
|
|
if common.ObjToString(v["seatNumber"]) == common.ObjToString(vv["seatNumber"]) {
|
|
|
|
+ if common.IntAll(v["status"]) == 0 {
|
|
|
|
+ vv["status"] = 1
|
|
|
|
+ } else {
|
|
|
|
+ vv["status"] = 2
|
|
|
|
+ }
|
|
isOk = true
|
|
isOk = true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -738,16 +746,29 @@ func autoDraw(mode string) (positionId int64, seatNumber, saleName string, saleD
|
|
}
|
|
}
|
|
if seatNumber == "" {
|
|
if seatNumber == "" {
|
|
res := int64(0)
|
|
res := int64(0)
|
|
- for k, v := range *countData {
|
|
|
|
- if k == 0 {
|
|
|
|
- res = common.Int64All(v["count"])
|
|
|
|
- seatNumber = common.ObjToString(v["seatNumber"])
|
|
|
|
- } else {
|
|
|
|
- if common.Int64All(v["count"]) <= res {
|
|
|
|
|
|
+ countres := 0
|
|
|
|
+ for _, v := range *countData {
|
|
|
|
+ if common.IntAll(v["status"]) == 1 {
|
|
|
|
+ if countres == 0 {
|
|
res = common.Int64All(v["count"])
|
|
res = common.Int64All(v["count"])
|
|
seatNumber = common.ObjToString(v["seatNumber"])
|
|
seatNumber = common.ObjToString(v["seatNumber"])
|
|
|
|
+ } else {
|
|
|
|
+ if common.Int64All(v["count"]) <= res {
|
|
|
|
+ res = common.Int64All(v["count"])
|
|
|
|
+ seatNumber = common.ObjToString(v["seatNumber"])
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ countres++
|
|
}
|
|
}
|
|
|
|
+ // if k == 0 {
|
|
|
|
+ // res = common.Int64All(v["count"])
|
|
|
|
+ // seatNumber = common.ObjToString(v["seatNumber"])
|
|
|
|
+ // } else {
|
|
|
|
+ // if common.Int64All(v["count"]) <= res {
|
|
|
|
+ // res = common.Int64All(v["count"])
|
|
|
|
+ // seatNumber = common.ObjToString(v["seatNumber"])
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|