Browse Source

no message

Jianghan 3 years ago
parent
commit
7d586347fb

+ 2 - 1
src/front/mark.go

@@ -112,7 +112,8 @@ func (f *Front) JyMarkList() {
 			query["i_ckdata"] = 0
 		}
 		qu.Debug("query:", query, sourceInfo)
-		list, _ := util.Mgo.Find(sourceInfo, query, map[string]interface{}{"_id": 1}, nil, false, start, limit)
+		fields := map[string]interface{}{"v_baseinfo.title": 1, "b_istag": 1, "i_ckdata": 1}
+		list, _ := util.Mgo.Find(sourceInfo, query, map[string]interface{}{"_id": 1}, fields, false, start, limit)
 		count := util.Mgo.Count(sourceInfo, query)
 		//checkedNum, allNum := GetCheckedAndAllDataInfo(query, coll) //已标和总数信息
 		f.ServeJson(map[string]interface{}{"draw": draw, "data": *list, "recordsFiltered": count, "recordsTotal": count})

+ 22 - 6
src/front/remark.go

@@ -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)
@@ -621,8 +621,12 @@ 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_usertaskid"] = tid
 		} else {
 			if stype == "notag" {
 				query["b_istagging"] = false // 达标
@@ -640,8 +644,8 @@ func (f *Front) CheckData() {
 			}
 		}
 		qu.Debug("Query:", query)
-		field := map[string]interface{}{"title": 1, "v_baseinfo": 1, "b_check": 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{}{
@@ -671,14 +675,21 @@ func (f *Front) CheckData() {
 		} 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_usertaskid": tid, "b_istag": true})
-			checkCount := util.Mgo.Count(sourceinfo, map[string]interface{}{"s_usertaskid": 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)
 	}
 }
@@ -896,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++ {

+ 4 - 1
src/util/config.go

@@ -50,9 +50,12 @@ var (
 
 var SE = qu.SimpleEncrypt{Key: "topJYBX2019"}
 var SourceInfoIndexArr = []mongo.IndexModel{
-	mongo.IndexModel{Keys: map[string]interface{}{"s_grouptaskid": 1}},               //独立索引
+	mongo.IndexModel{Keys: map[string]interface{}{"s_grouptaskid": 1}}, //独立索引
+	mongo.IndexModel{Keys: map[string]interface{}{"s_usertaskid": 1}},
 	mongo.IndexModel{Keys: map[string]interface{}{"s_grouptaskid": 1, "b_istag": 1}}, //联合索引
 	mongo.IndexModel{Keys: map[string]interface{}{"s_grouptaskid": 1, "s_isgiveuser": 1}},
+	mongo.IndexModel{Keys: map[string]interface{}{"s_usertaskid": 1, "b_istag": 1}},
+	mongo.IndexModel{Keys: map[string]interface{}{"s_usertaskid": 1, "b_check": 1}},
 	mongo.IndexModel{Keys: map[string]interface{}{"b_istagging": 1}},
 	mongo.IndexModel{Keys: map[string]interface{}{"b_istagging": 1, "b_istag": 1}},
 	mongo.IndexModel{Keys: map[string]interface{}{"b_isgivegroup": 1, "b_istagging": 1}},

+ 4 - 1
src/web/templates/project/check_data_list.html

@@ -63,6 +63,7 @@
     let tid = {{ .T.tid }}
     let pid = {{ .T.pid }}
     let sourceinfo = {{ .T.sourceinfo }}
+    let stype = {{ .T.stype }}
 
     let index = 0
 
@@ -71,6 +72,8 @@
             "paging": true,
             "lengthChange": false,
             "searching": true,
+            "processing": true,
+            "pageLength": 20,
             "ordering": false,
             "info": true,
             "autoWidth": false,
@@ -78,7 +81,7 @@
             "ajax": {
                 "url": "/front/user/check/data",
                 "type": "post",
-                "data": {"tid": tid, "s_sourceinfo": sourceinfo}
+                "data": {"tid": tid, "s_sourceinfo": sourceinfo, "stype": stype}
             },
             "language": {
                 "url": "/dist/js/dataTables.chinese.lang"

+ 2 - 0
src/web/templates/project/remark_jy_list.html

@@ -86,6 +86,8 @@
         ttable = $('#dataTable').dataTable({
             "paging": true,
             "lengthChange": false,
+            "processing": true,
+            "pageLength": 20,
             "searching": false,
             "ordering": false,
             "info": true,

+ 2 - 0
src/web/templates/project/remark_list.html

@@ -57,6 +57,8 @@
         ttable = $('#dataTable').dataTable({
             "paging": true,
             "lengthChange": false,
+            "processing": true,
+            "pageLength": 20,
             "searching": true,
             "ordering": false,
             "info": true,

+ 1 - 1
src/web/templates/project/task_group_list.html

@@ -115,7 +115,7 @@
                         tmp = '<div>' +
                             '<a class="btn btn-sm btn-primary" href="/front/group/user/task/list?grouptaskid=' + val + '&s_sourceinfo='+row.s_sourceinfo+'">查看</a>&nbsp;&nbsp;' +
                             // '<a class="btn btn-sm btn-warning">分发</a>&nbsp;&nbsp;' +
-                            '<a class="btn btn-sm btn-primary" href="/front/user/check/data?pid='+row.s_projectid+'&tid=' + val + '&s_sourceinfo='+row.s_sourceinfo+'">质检</a>&nbsp;&nbsp;' +
+                            '<a class="btn btn-sm btn-primary" href="/front/user/check/data?pid='+row.s_projectid+'&tid='+val+'&s_sourceinfo='+row.s_sourceinfo+'&stype=group">质检</a>&nbsp;&nbsp;' +
                             // '<a class="btn btn-sm btn-primary">质检结果</a>&nbsp;&nbsp;' +
                             '<a class="btn btn-sm btn-primary" onclick="deliverTask(\'' + val + '\',\'' + row.s_status + '\')">交付</a>&nbsp;&nbsp;' +
                             '</div>';