|
@@ -43,7 +43,7 @@ func (f *Front) RemarkList() {
|
|
|
}
|
|
|
}
|
|
|
qu.Debug(query)
|
|
|
- field := map[string]interface{}{"title": 1, "v_baseinfo": 1, "b_istag": 1, "i_ckdata": 1}
|
|
|
+ field := map[string]interface{}{"v_baseinfo.title": 1, "b_istag": 1, "i_ckdata": 1}
|
|
|
info, _ := util.Mgo.Find(sourceinfo, query, `{"_id": 1}`, field, false, start, limit)
|
|
|
count := util.Mgo.Count(sourceinfo, query)
|
|
|
qu.Debug(query, sourceinfo, count)
|
|
@@ -102,7 +102,7 @@ func (f *Front) RemarkDetail() {
|
|
|
f.T["worder_new"] = rep["worder_new"]
|
|
|
f.T["pcl_new"] = rep["pcl_new"]
|
|
|
f.T["pkg_new"] = rep["pkg_new"]
|
|
|
- f.T["nextid"] = GetNextDataId(did, coll, pid) //下一条id
|
|
|
+ f.T["nextid"] = GetNextDataId(did, coll, tid) //下一条id
|
|
|
_ = f.Render("project/remark_detail.html", &f.T)
|
|
|
}
|
|
|
|
|
@@ -523,7 +523,7 @@ func DealData(tmpLen int, publishtime float64, tmp []map[string]interface{}, mor
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//获取当前数据下一条的id
|
|
|
+// GetNextDataId 获取当前数据下一条的id
|
|
|
func GetNextDataId(id, coll, tid string) string {
|
|
|
nextIdQuery := map[string]interface{}{
|
|
|
"_id": map[string]interface{}{
|
|
@@ -533,6 +533,26 @@ func GetNextDataId(id, coll, tid string) string {
|
|
|
if tid != "" {
|
|
|
nextIdQuery["s_usertaskid"] = tid
|
|
|
}
|
|
|
+ qu.Debug(nextIdQuery, coll)
|
|
|
+ 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
|
|
|
+}
|
|
|
+
|
|
|
+// GetNextDataId1 质检下一条
|
|
|
+func GetNextDataId1(id, coll, tid string) string {
|
|
|
+ nextIdQuery := map[string]interface{}{
|
|
|
+ "b_istag": true,
|
|
|
+ "_id": map[string]interface{}{
|
|
|
+ "$gt": mgo.StringTOBsonId(id),
|
|
|
+ },
|
|
|
+ }
|
|
|
+ if tid != "" {
|
|
|
+ nextIdQuery["s_usertaskid"] = tid
|
|
|
+ }
|
|
|
+ qu.Debug(nextIdQuery, coll)
|
|
|
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"])
|
|
@@ -553,7 +573,7 @@ func (f *Front) CheckList() {
|
|
|
searchStr := f.GetString("search[value]")
|
|
|
search := strings.TrimSpace(searchStr)
|
|
|
query := map[string]interface{}{
|
|
|
- "s_stype": "group",
|
|
|
+ "s_stype": "user",
|
|
|
}
|
|
|
if iRole != "0" {
|
|
|
query["s_groupid"] = gid
|
|
@@ -601,13 +621,16 @@ func (f *Front) CheckData() {
|
|
|
query := make(map[string]interface{})
|
|
|
if tid != "" {
|
|
|
// 任务数据质检
|
|
|
+ if stype == "group" {
|
|
|
+ query["s_grouptaskid"] = tid
|
|
|
+ } else {
|
|
|
+ query["s_usertaskid"] = tid
|
|
|
+ }
|
|
|
query["b_istag"] = true
|
|
|
- query["s_grouptaskid"] = tid
|
|
|
} else {
|
|
|
if stype == "notag" {
|
|
|
query["b_istagging"] = false // 达标
|
|
|
query["b_isgivegroup"] = false
|
|
|
- query["i_ckdata"] = 2
|
|
|
} else if stype == "tag" {
|
|
|
query["b_istagging"] = true //未达标
|
|
|
query["i_ckdata"] = 2
|
|
@@ -621,8 +644,8 @@ func (f *Front) CheckData() {
|
|
|
}
|
|
|
}
|
|
|
qu.Debug("Query:", query)
|
|
|
- field := map[string]interface{}{"title": 1, "v_baseinfo": 1, "b_istag": 1, "i_ckdata": 1, "s_login": 1}
|
|
|
- info, _ := util.Mgo.Find(sourceinfo, query, `{"_id": 1}`, field, false, start, limit)
|
|
|
+ fields := map[string]interface{}{"v_baseinfo.title": 1, "b_check": 1, "i_ckdata": 1, "s_login": 1}
|
|
|
+ info, _ := util.Mgo.Find(sourceinfo, query, `{"_id": 1}`, fields, false, start, limit)
|
|
|
count := util.Mgo.Count(sourceinfo, query)
|
|
|
qu.Debug(query, sourceinfo, count)
|
|
|
f.ServeJson(map[string]interface{}{
|
|
@@ -633,34 +656,40 @@ func (f *Front) CheckData() {
|
|
|
})
|
|
|
} else {
|
|
|
if tid == "" {
|
|
|
- project, _ := util.Mgo.FindById(util.PROJECTCOLLNAME, pid, map[string]interface{}{"i_importnum": 1})
|
|
|
- f.T["taskNum"] = (*project)["i_importnum"]
|
|
|
+ //project, _ := util.Mgo.FindById(util.PROJECTCOLLNAME, pid, map[string]interface{}{"i_importnum": 1})
|
|
|
+ //f.T["taskNum"] = (*project)["i_importnum"]
|
|
|
query1 := make(map[string]interface{})
|
|
|
query2 := make(map[string]interface{})
|
|
|
if stype == "notag" {
|
|
|
- query1["b_istagging"] = false // 达标
|
|
|
- query2["b_istagging"] = false
|
|
|
+ query1["b_istagging"] = false // 达标
|
|
|
+ query1["b_isgivegroup"] = false //未分发
|
|
|
} else if stype == "tag" {
|
|
|
query1["b_istagging"] = true //未达标
|
|
|
query2["b_istagging"] = true
|
|
|
}
|
|
|
- query1["i_ckdata"] = 2
|
|
|
- query2["b_check"] = true
|
|
|
- tagCount := util.Mgo.Count(sourceinfo, query1)
|
|
|
- checkCount := util.Mgo.Count(sourceinfo, query2)
|
|
|
- f.T["taskTagNum"] = tagCount
|
|
|
+ f.T["taskNum"] = util.Mgo.Count(sourceinfo, query1)
|
|
|
+ query1["b_check"] = true // 已质检
|
|
|
+ checkCount := util.Mgo.Count(sourceinfo, query1)
|
|
|
+ f.T["taskTagNum"] = 0
|
|
|
f.T["taskCheckNum"] = checkCount
|
|
|
} else {
|
|
|
task, _ := util.Mgo.FindById(util.TASKCOLLNAME, tid, map[string]interface{}{"i_givenum": 1})
|
|
|
f.T["taskNum"] = (*task)["i_givenum"]
|
|
|
- tagCount := util.Mgo.Count(sourceinfo, map[string]interface{}{"s_grouptaskid": tid, "b_istag": true})
|
|
|
- checkCount := util.Mgo.Count(sourceinfo, map[string]interface{}{"s_grouptaskid": tid, "b_check": true})
|
|
|
+ tagCount, checkCount := 0, 0
|
|
|
+ if stype == "group" {
|
|
|
+ tagCount = util.Mgo.Count(sourceinfo, map[string]interface{}{"s_grouptaskid": tid, "b_istag": true})
|
|
|
+ checkCount = util.Mgo.Count(sourceinfo, map[string]interface{}{"s_grouptaskid": tid, "b_check": true})
|
|
|
+ } else {
|
|
|
+ tagCount = util.Mgo.Count(sourceinfo, map[string]interface{}{"s_usertaskid": tid, "b_istag": true})
|
|
|
+ checkCount = util.Mgo.Count(sourceinfo, map[string]interface{}{"s_usertaskid": tid, "b_check": true})
|
|
|
+ }
|
|
|
f.T["taskTagNum"] = tagCount
|
|
|
f.T["taskCheckNum"] = checkCount
|
|
|
}
|
|
|
f.T["pid"] = pid
|
|
|
f.T["tid"] = tid
|
|
|
f.T["sourceinfo"] = sourceinfo
|
|
|
+ f.T["stype"] = stype
|
|
|
_ = f.Render("project/check_data_list.html", &f.T)
|
|
|
}
|
|
|
}
|
|
@@ -707,7 +736,7 @@ func (f *Front) CheckDetail() {
|
|
|
f.T["worder_new"] = rep["worder_new"]
|
|
|
f.T["pcl_new"] = rep["pcl_new"]
|
|
|
f.T["pkg_new"] = rep["pkg_new"]
|
|
|
- f.T["nextid"] = GetNextDataId(did, coll, tid) //下一条id
|
|
|
+ f.T["nextid"] = GetNextDataId1(did, coll, tid) //下一条id
|
|
|
_ = f.Render("project/check_detail.html", &f.T)
|
|
|
}
|
|
|
|
|
@@ -878,6 +907,11 @@ func (f *Front) CheckResult() {
|
|
|
}
|
|
|
sess := util.Mgo.GetMgoConn()
|
|
|
defer util.Mgo.DestoryMongoConn(sess)
|
|
|
+ if tid == "" {
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ }
|
|
|
query := map[string]interface{}{"s_grouptaskid": tid, "b_istag": true}
|
|
|
result := sess.DB(util.Mgo.DbName).C(sourceinfo).Find(query).Iter()
|
|
|
for tmp := make(map[string]interface{}); result.Next(&tmp); markNum++ {
|