Jianghan 3 yıl önce
ebeveyn
işleme
a6cb749d78

+ 56 - 8
src/front/remark.go

@@ -526,6 +526,7 @@ func DealData(tmpLen int, publishtime float64, tmp []map[string]interface{}, mor
 // GetNextDataId 获取当前数据下一条的id
 func GetNextDataId(id, coll, tid string) string {
 	nextIdQuery := map[string]interface{}{
+		"i_ckdata": 2,
 		"_id": map[string]interface{}{
 			"$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)
 	if one != nil && len(*one) == 1 {
 		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
 }
@@ -556,6 +563,12 @@ func GetNextDataId1(id, coll, tid string) string {
 	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"])
+	} 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
 }
@@ -612,6 +625,7 @@ func (f *Front) CheckData() {
 	tid := f.GetString("tid")
 	stype := f.GetString("stype")
 	sourceinfo := f.GetString("s_sourceinfo")
+	datatype, _ := f.GetInteger("datatype")
 	if f.Method() == "POST" {
 		start, _ := f.GetInteger("start")
 		limit, _ := f.GetInteger("length")
@@ -629,8 +643,15 @@ func (f *Front) CheckData() {
 			query["b_istag"] = true
 		} else {
 			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" {
 				query["b_istagging"] = true //未达标
 				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})
 			//f.T["taskNum"] = (*project)["i_importnum"]
 			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" {
 				query1["b_istagging"] = true //未达标
-				query2["b_istagging"] = true
+				query1["i_ckdata"] = 2
 			}
 			f.T["taskNum"] = util.Mgo.Count(sourceinfo, query1)
 			query1["b_check"] = true // 已质检
@@ -690,6 +719,7 @@ func (f *Front) CheckData() {
 		f.T["tid"] = tid
 		f.T["sourceinfo"] = sourceinfo
 		f.T["stype"] = stype
+		f.T["datatype"] = datatype
 		_ = f.Render("project/check_data_list.html", &f.T)
 	}
 }
@@ -894,6 +924,7 @@ func (f *Front) CheckResult() {
 	tid := f.GetString("tid")
 	sourceinfo := f.GetString("s_sourceinfo")
 	stype := f.GetString("stype")
+	datatype, _ := f.GetInteger("datatype")
 	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})
 	//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)
 	query := make(map[string]interface{})
 	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 {
 		if stype == "group" {
 			query["s_grouptaskid"] = tid

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

@@ -64,8 +64,7 @@
     let pid = {{ .T.pid }}
     let sourceinfo = {{ .T.sourceinfo }}
     let stype = {{ .T.stype }}
-
-    let index = 0
+    let datatype = {{ .T.datatype }}
 
     $(function () {
         ttable = $('#dataTable').dataTable({
@@ -81,7 +80,7 @@
             "ajax": {
                 "url": "/front/user/check/data",
                 "type": "post",
-                "data": {"tid": tid, "s_sourceinfo": sourceinfo, "stype": stype}
+                "data": {"tid": tid, "s_sourceinfo": sourceinfo, "stype": stype, "datatype": datatype}
             },
             "language": {
                 "url": "/dist/js/dataTables.chinese.lang"
@@ -96,8 +95,7 @@
                     ttable.api().page(redirectpage).draw(false);
                 });
                 this.api().column(0).nodes().each(function (cell, i) {
-                    index ++
-                    cell.innerHTML = index;
+                    cell.innerHTML = i + 1;
                 });
             },
             "columns": [
@@ -128,7 +126,7 @@
     function checkResult() {
         let num = {{ .T.taskCheckNum }}
         if (num > 0) {
-            window.location.href = "/front/user/check/result?pid={{.T.pid}}&tid={{.T.tid}}&s_sourceinfo={{.T.sourceinfo}}"
+            window.location.href = "/front/user/check/result?pid={{.T.pid}}&tid={{.T.tid}}&s_sourceinfo={{.T.sourceinfo}}&stype={{.T.stype}}&datatype={{.T.datatype}}"
         }else {
             showTip("没有审核数据")
         }

+ 4 - 2
src/web/templates/project/check_task_list.html

@@ -33,6 +33,7 @@
                             <tr>
                                 <th>序号</th>
                                 <th>项目名称</th>
+                                <th>用户</th>
                                 <th>数据量</th>
                                 <th>任务状态</th>
                                 <th>完成进度</th>
@@ -87,9 +88,10 @@
             "columns": [
                 {"data": null, width: "1%"},
                 {"data": "s_projectname", width: "6%"},
+                {"data": "s_login", width: "4%"},
                 {"data": "i_givenum", width: "3%"},
-                {"data": "s_status", width: "4%"},
-                {"data": "s_progress", width: "4%"},
+                {"data": "s_status", width: "3%"},
+                {"data": "s_progress", width: "3%"},
                 {"data": "i_starttime", width: "4%", render: function (val) {
                         if (val === undefined) {
                             return "未开始"

+ 40 - 12
src/web/templates/project/project_clear.html

@@ -400,9 +400,8 @@
                     success: function (r) {
                         if (r.success) {
                             let msg = r.msg+"<br>"+"共收回"+r.count+"数据。"
-                            showTip(msg, 1000, function () {
-                                location.reload()
-                            });
+                            showTip(msg, 1000);
+                            location.reload()
                         } else {
                             showTip(r.msg);
                         }
@@ -448,9 +447,8 @@
                     success: function (r) {
                         if (r.success) {
                             let msg = r.msg+"<br>"+"收回数据"+r.count+"条"
-                            showTip(msg, 1000, function () {
-                                location.reload()
-                            });
+                            showTip(msg, 1000);
+                            location.reload()
                         } else {
                             showTip(r.msg);
                         }
@@ -463,9 +461,6 @@
     }
 
     function checkMethod(stype) {
-        let num1 = {{ .T.okAllDataNum }}
-        let num2 = {{ .T.okNotGiveDataNum }}
-        let num3 = {{ .T.IsNotOkIsTagDataNum }}
         // if (stype === "all") {
         //     if (num2 <= 0) {
         //         showTip("没有可质检的数据")
@@ -482,10 +477,43 @@
         //         return;
         //     }
         // }
-        if (stype === "notag" && num1 > 0 && num2 > 0) {
-            window.location.href = "/front/user/check/data?pid="+projectid+"&s_sourceinfo={{.T.s_sourceinfo}}"+"&stype="+stype
+        if (stype === "all") {
+            let num0 = {{ .T.allIsTagDataNum }}     // 已标注
+            if (num0 > 0) {
+                window.location.href = "/front/user/check/data?pid="+projectid+"&s_sourceinfo={{.T.s_sourceinfo}}"+"&stype="+stype
+            }else {
+                showTip("没有质检数据")
+            }
+        }else if (stype === "notag") {
+            let num0 = {{ .T.okAllDataNum }}
+            let num1 = {{ .T.okIsGiveDataNum }}     // 达标 已分发
+            let num2 = {{ .T.okNotGiveDataNum }}    // 达标 待分发
+            let num3 = {{ .T.okIsTagDataNum }}      // 达标 已标注
+            if (num0 > 0) {
+                if (num1 > 0) {
+                    if (num3 > 0) {
+                        window.location.href = "/front/user/check/data?pid="+projectid+"&s_sourceinfo={{.T.s_sourceinfo}}"+"&stype="+stype+"&datatype=2"
+                    }else {
+                        showTip("没有质检数据")
+                    }
+                }else {
+                    if (num2 > 0) {
+                        window.location.href = "/front/user/check/data?pid="+projectid+"&s_sourceinfo={{.T.s_sourceinfo}}"+"&stype="+stype+"&datatype=1"
+                    }else {
+                        showTip("没有质检数据")
+                    }
+                }
+            }else {
+                showTip("没有质检数据")
+            }
+
         }else {
-            showTip("没有标注数据")
+            let num0 = {{ .T.IsNotOkIsTagDataNum }}
+            if (num0 > 0) {
+                window.location.href = "/front/user/check/data?pid="+projectid+"&s_sourceinfo={{.T.s_sourceinfo}}"+"&stype="+stype
+            }else {
+                showTip("没有质检数据")
+            }
         }
     }
 

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

@@ -80,8 +80,6 @@
     let topsubtype = {{ .T.topsubtype }}
     let allfield = {{ .T.allfield }}
 
-    let index = 0
-
     $(function () {
         ttable = $('#dataTable').dataTable({
             "paging": true,
@@ -111,8 +109,7 @@
                     ttable.api().page(redirectpage).draw(false);
                 });
                 this.api().column(0).nodes().each(function (cell, i) {
-                    index ++
-                    cell.innerHTML = index;
+                    cell.innerHTML = i + 1;
                 });
             },
             "columns": [

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

@@ -51,8 +51,6 @@
     let pid = {{ .T.pid }}
     let sourceinfo = {{ .T.s_sourceinfo }}
 
-    let index = 0
-
     $(function () {
         ttable = $('#dataTable').dataTable({
             "paging": true,
@@ -82,8 +80,7 @@
                     ttable.api().page(redirectpage).draw(false);
                 });
                 this.api().column(0).nodes().each(function (cell, i) {
-                    index ++
-                    cell.innerHTML = index;
+                    cell.innerHTML = i + 1;
                 });
             },
             "columns": [

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

@@ -146,7 +146,7 @@
                         if (r.success) {
                             ttable.api().ajax.reload()
                         } else {
-                            showTip(r.msg);
+                            showTip(r.msg, 2000);
                         }
                     }
                 })

+ 4 - 6
src/web/templates/project/task_list.html

@@ -194,9 +194,8 @@
                 success: function (r) {
                     if (r.success) {
                         let msg = r.msg+"<br>"+"共收回"+r.count+"数据。"
-                        showTip(msg, 1000, function () {
-                            ttable.api().ajax.reload()
-                        });
+                        showTip(msg, 1000);
+                        ttable.api().ajax.reload()
                     } else {
                         showTip(r.msg);
                     }
@@ -216,9 +215,8 @@
                     success: function (r) {
                         if (r.success) {
                             let msg = r.msg+"<br>"+"共收回"+r.count+"数据。"
-                            showTip(msg, 1000, function () {
-                                ttable.api().ajax.reload()
-                            });
+                            showTip(msg, 1000);
+                            ttable.api().ajax.reload()
                         } else {
                             showTip(r.msg);
                         }

+ 4 - 2
src/web/templates/project/task_user_list.html

@@ -33,6 +33,7 @@
                             <tr>
                                 <th>序号</th>
                                 <th>项目名称</th>
+                                <th>用户</th>
                                 <th>数据量</th>
                                 <th>任务状态</th>
                                 <th>完成进度</th>
@@ -87,9 +88,10 @@
             "columns": [
                 {"data": null, width: "1%"},
                 {"data": "s_projectname", width: "6%"},
+                {"data": "s_login", width: "4%"},
                 {"data": "i_givenum", width: "3%"},
-                {"data": "s_status", width: "4%"},
-                {"data": "s_progress", width: "4%"},
+                {"data": "s_status", width: "3%"},
+                {"data": "s_progress", width: "3%"},
                 {"data": "i_starttime", width: "4%", render: function (val) {
                         if (val === undefined) {
                             return "未开始"