|
@@ -526,6 +526,7 @@ func DealData(tmpLen int, publishtime float64, tmp []map[string]interface{}, mor
|
|
// GetNextDataId 获取当前数据下一条的id
|
|
// GetNextDataId 获取当前数据下一条的id
|
|
func GetNextDataId(id, coll, tid string) string {
|
|
func GetNextDataId(id, coll, tid string) string {
|
|
nextIdQuery := map[string]interface{}{
|
|
nextIdQuery := map[string]interface{}{
|
|
|
|
+ "i_ckdata": 2,
|
|
"_id": map[string]interface{}{
|
|
"_id": map[string]interface{}{
|
|
"$gt": mgo.StringTOBsonId(id),
|
|
"$gt": mgo.StringTOBsonId(id),
|
|
},
|
|
},
|
|
@@ -537,6 +538,12 @@ func GetNextDataId(id, coll, tid string) string {
|
|
one, _ := util.Mgo.Find(coll, nextIdQuery, `{"_id":1}`, `{"_id":1}`, true, 0, 1)
|
|
one, _ := util.Mgo.Find(coll, nextIdQuery, `{"_id":1}`, `{"_id":1}`, true, 0, 1)
|
|
if one != nil && len(*one) == 1 {
|
|
if one != nil && len(*one) == 1 {
|
|
return mgo.BsonIdToSId((*one)[0]["_id"])
|
|
return mgo.BsonIdToSId((*one)[0]["_id"])
|
|
|
|
+ } else {
|
|
|
|
+ delete(nextIdQuery, "_id")
|
|
|
|
+ one, _ = util.Mgo.Find(coll, nextIdQuery, `{"_id":1}`, `{"_id":1}`, true, 0, 1)
|
|
|
|
+ if one != nil && len(*one) == 1 {
|
|
|
|
+ return mgo.BsonIdToSId((*one)[0]["_id"])
|
|
|
|
+ }
|
|
}
|
|
}
|
|
return id
|
|
return id
|
|
}
|
|
}
|
|
@@ -556,6 +563,12 @@ func GetNextDataId1(id, coll, tid string) string {
|
|
one, _ := util.Mgo.Find(coll, nextIdQuery, `{"_id":1}`, `{"_id":1}`, true, 0, 1)
|
|
one, _ := util.Mgo.Find(coll, nextIdQuery, `{"_id":1}`, `{"_id":1}`, true, 0, 1)
|
|
if one != nil && len(*one) == 1 {
|
|
if one != nil && len(*one) == 1 {
|
|
return mgo.BsonIdToSId((*one)[0]["_id"])
|
|
return mgo.BsonIdToSId((*one)[0]["_id"])
|
|
|
|
+ } else {
|
|
|
|
+ delete(nextIdQuery, "_id")
|
|
|
|
+ one, _ = util.Mgo.Find(coll, nextIdQuery, `{"_id":1}`, `{"_id":1}`, true, 0, 1)
|
|
|
|
+ if one != nil && len(*one) == 1 {
|
|
|
|
+ return mgo.BsonIdToSId((*one)[0]["_id"])
|
|
|
|
+ }
|
|
}
|
|
}
|
|
return id
|
|
return id
|
|
}
|
|
}
|
|
@@ -612,6 +625,7 @@ func (f *Front) CheckData() {
|
|
tid := f.GetString("tid")
|
|
tid := f.GetString("tid")
|
|
stype := f.GetString("stype")
|
|
stype := f.GetString("stype")
|
|
sourceinfo := f.GetString("s_sourceinfo")
|
|
sourceinfo := f.GetString("s_sourceinfo")
|
|
|
|
+ datatype, _ := f.GetInteger("datatype")
|
|
if f.Method() == "POST" {
|
|
if f.Method() == "POST" {
|
|
start, _ := f.GetInteger("start")
|
|
start, _ := f.GetInteger("start")
|
|
limit, _ := f.GetInteger("length")
|
|
limit, _ := f.GetInteger("length")
|
|
@@ -629,8 +643,15 @@ func (f *Front) CheckData() {
|
|
query["b_istag"] = true
|
|
query["b_istag"] = true
|
|
} else {
|
|
} else {
|
|
if stype == "notag" {
|
|
if stype == "notag" {
|
|
- query["b_istagging"] = false // 达标
|
|
|
|
- query["b_isgivegroup"] = false
|
|
|
|
|
|
+ if datatype == 1 {
|
|
|
|
+ // 待分发数据
|
|
|
|
+ query["b_isgivegroup"] = false
|
|
|
|
+ query["b_istagging"] = false
|
|
|
|
+ } else {
|
|
|
|
+ // 标注数据
|
|
|
|
+ query["i_ckdata"] = 2
|
|
|
|
+ query["b_isgivegroup"] = false
|
|
|
|
+ }
|
|
} else if stype == "tag" {
|
|
} else if stype == "tag" {
|
|
query["b_istagging"] = true //未达标
|
|
query["b_istagging"] = true //未达标
|
|
query["i_ckdata"] = 2
|
|
query["i_ckdata"] = 2
|
|
@@ -659,13 +680,21 @@ func (f *Front) CheckData() {
|
|
//project, _ := util.Mgo.FindById(util.PROJECTCOLLNAME, pid, map[string]interface{}{"i_importnum": 1})
|
|
//project, _ := util.Mgo.FindById(util.PROJECTCOLLNAME, pid, map[string]interface{}{"i_importnum": 1})
|
|
//f.T["taskNum"] = (*project)["i_importnum"]
|
|
//f.T["taskNum"] = (*project)["i_importnum"]
|
|
query1 := make(map[string]interface{})
|
|
query1 := make(map[string]interface{})
|
|
- query2 := make(map[string]interface{})
|
|
|
|
- if stype == "notag" {
|
|
|
|
- query1["b_istagging"] = false // 达标
|
|
|
|
- query1["b_isgivegroup"] = false //未分发
|
|
|
|
|
|
+ if stype == "all" {
|
|
|
|
+ query1["i_ckdata"] = 2
|
|
|
|
+ } else if stype == "notag" {
|
|
|
|
+ if datatype == 1 {
|
|
|
|
+ // 待分发数据
|
|
|
|
+ query1["b_isgivegroup"] = false
|
|
|
|
+ query1["b_istagging"] = false
|
|
|
|
+ } else {
|
|
|
|
+ // 标注数据
|
|
|
|
+ query1["i_ckdata"] = 2
|
|
|
|
+ query1["b_isgivegroup"] = false
|
|
|
|
+ }
|
|
} else if stype == "tag" {
|
|
} else if stype == "tag" {
|
|
query1["b_istagging"] = true //未达标
|
|
query1["b_istagging"] = true //未达标
|
|
- query2["b_istagging"] = true
|
|
|
|
|
|
+ query1["i_ckdata"] = 2
|
|
}
|
|
}
|
|
f.T["taskNum"] = util.Mgo.Count(sourceinfo, query1)
|
|
f.T["taskNum"] = util.Mgo.Count(sourceinfo, query1)
|
|
query1["b_check"] = true // 已质检
|
|
query1["b_check"] = true // 已质检
|
|
@@ -690,6 +719,7 @@ func (f *Front) CheckData() {
|
|
f.T["tid"] = tid
|
|
f.T["tid"] = tid
|
|
f.T["sourceinfo"] = sourceinfo
|
|
f.T["sourceinfo"] = sourceinfo
|
|
f.T["stype"] = stype
|
|
f.T["stype"] = stype
|
|
|
|
+ f.T["datatype"] = datatype
|
|
_ = f.Render("project/check_data_list.html", &f.T)
|
|
_ = f.Render("project/check_data_list.html", &f.T)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -894,6 +924,7 @@ func (f *Front) CheckResult() {
|
|
tid := f.GetString("tid")
|
|
tid := f.GetString("tid")
|
|
sourceinfo := f.GetString("s_sourceinfo")
|
|
sourceinfo := f.GetString("s_sourceinfo")
|
|
stype := f.GetString("stype")
|
|
stype := f.GetString("stype")
|
|
|
|
+ datatype, _ := f.GetInteger("datatype")
|
|
task, _ := util.Mgo.FindById(util.TASKCOLLNAME, tid, map[string]interface{}{"i_givenum": 1})
|
|
task, _ := util.Mgo.FindById(util.TASKCOLLNAME, tid, map[string]interface{}{"i_givenum": 1})
|
|
projcet, _ := util.Mgo.FindById(util.PROJECTCOLLNAME, pid, map[string]interface{}{"v_fields": 1})
|
|
projcet, _ := util.Mgo.FindById(util.PROJECTCOLLNAME, pid, map[string]interface{}{"v_fields": 1})
|
|
//tagCount := util.Mgo.Count(sourceinfo, map[string]interface{}{"s_grouptaskid": tid, "b_istag": true})
|
|
//tagCount := util.Mgo.Count(sourceinfo, map[string]interface{}{"s_grouptaskid": tid, "b_istag": true})
|
|
@@ -909,7 +940,24 @@ func (f *Front) CheckResult() {
|
|
defer util.Mgo.DestoryMongoConn(sess)
|
|
defer util.Mgo.DestoryMongoConn(sess)
|
|
query := make(map[string]interface{})
|
|
query := make(map[string]interface{})
|
|
if tid == "" {
|
|
if tid == "" {
|
|
-
|
|
|
|
|
|
+ query1 := make(map[string]interface{})
|
|
|
|
+ if stype == "all" {
|
|
|
|
+ query1["i_ckdata"] = 2
|
|
|
|
+ } else if stype == "notag" {
|
|
|
|
+ if datatype == 1 {
|
|
|
|
+ // 待分发数据
|
|
|
|
+ query1["b_isgivegroup"] = false
|
|
|
|
+ query1["b_istagging"] = false
|
|
|
|
+ } else {
|
|
|
|
+ // 标注数据
|
|
|
|
+ query1["i_ckdata"] = 2
|
|
|
|
+ query1["b_isgivegroup"] = false
|
|
|
|
+ }
|
|
|
|
+ } else if stype == "tag" {
|
|
|
|
+ query1["b_istagging"] = true //未达标
|
|
|
|
+ query1["i_ckdata"] = 2
|
|
|
|
+ }
|
|
|
|
+ f.T["taskNum"] = util.Mgo.Count(sourceinfo, query1)
|
|
} else {
|
|
} else {
|
|
if stype == "group" {
|
|
if stype == "group" {
|
|
query["s_grouptaskid"] = tid
|
|
query["s_grouptaskid"] = tid
|