maxiaoshan 3 gadi atpakaļ
vecāks
revīzija
4c294e70cc
4 mainītis faili ar 83 papildinājumiem un 1 dzēšanām
  1. 1 1
      src/front/front.go
  2. 78 0
      src/front/mark.go
  3. 3 0
      src/front/quality.go
  4. 1 0
      src/util/config.go

+ 1 - 1
src/front/front.go

@@ -84,8 +84,8 @@ type Front struct {
 	dataMark xweb.Mapper `xweb:"/front/data/mark"` //数据标注
 
 	//check
-
 	remarkList   xweb.Mapper `xweb:"/front/user/remark/list"`
+	jyMarkList   xweb.Mapper `xweb:"/front/user/jymark/list"` //剑鱼用户查看标注数据列表
 	remarkDetail xweb.Mapper `xweb:"/front/user/remark/detail"`
 }
 

+ 78 - 0
src/front/mark.go

@@ -10,6 +10,84 @@ import (
 	"util"
 )
 
+// JyMarkList 剑鱼管理员标注信息列表
+func (f *Front) JyMarkList() {
+	defer qu.Catch()
+	if f.Method() == "POST" {
+		stype := f.GetString("stype") //all:全量标注;notag:达标数据标注;tag:未达标数据标注
+		start, _ := f.GetInteger("start")
+		limit, _ := f.GetInteger("length")
+		draw, _ := f.GetInteger("draw")
+		sourceInfo := f.GetString("s_sourceinfo") //数据源表
+		field := f.GetString("field")             //字段
+		dataType := f.GetString("datatype")       //信息类型
+		min := f.GetString("minval")              //min max不用int类型接收,以免有默认值0
+		max := f.GetString("maxval")
+		hasno, _ := f.GetBool("hasno") //是否存在
+		notag, _ := f.GetBool("notag") //是否标注
+		query := map[string]interface{}{}
+		if stype == "notag" { //查询达标
+			query["b_istagging"] = false
+		} else if stype == "tag" { //查询未达标
+			query["b_istagging"] = true
+		}
+		if dataType != "-1" && dataType != "" { //类型
+			if dataType == util.SPECIALTYPE {
+				query["v_baseinfo.subtype"] = map[string]interface{}{
+					"$exists": false,
+				}
+			} else {
+				subtype := strings.Split(dataType, "-")[1]
+				query["v_baseinfo.subtype"] = subtype
+			}
+		}
+		fieldScreen := false
+		if field != "-1" && field != "" { //字段
+			fieldScreen = true
+			queryfield := map[string]interface{}{
+				"$exists": !hasno,
+			}
+			numMap := map[string]interface{}{}
+			if field == "budget" || field == "bidamount" { //金额区间
+				if min != "" {
+					minint := qu.IntAll(min)
+					numMap["$gte"] = minint
+				}
+				if max != "" {
+					maxint := qu.IntAll(max)
+					numMap["$lte"] = maxint
+				}
+			}
+			if len(numMap) > 0 {
+				if !hasno {
+					query["v_baseinfo."+field] = numMap
+				} else {
+					query["$or"] = []map[string]interface{}{
+						{"v_baseinfo." + field: queryfield},
+						{"v_baseinfo." + field: numMap},
+					}
+				}
+			} else {
+				query["v_baseinfo."+field] = queryfield
+			}
+		}
+		if fieldScreen && notag {
+			query["v_taginfo."+field] = map[string]interface{}{
+				"$exists": false,
+			}
+		} else if !fieldScreen && notag {
+			query["i_ckdata"] = 0
+		}
+		qu.Debug("query:", query)
+		list, _ := util.Mgo.Find(sourceInfo, query, map[string]interface{}{"_id": 1}, nil, 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})
+	} else {
+		_ = f.Render("list.html")
+	}
+}
+
 // DataMark 数据标注
 func (f *Front) DataMark() {
 	qu.Debug("------------------")

+ 3 - 0
src/front/quality.go

@@ -114,6 +114,9 @@ func calculateFieldScore(tmp map[string]interface{}, field_tag []string) map[str
 			"b_istagging":   b_istagging,
 			"b_isprchasing": b_isprchasing,
 			"i_ckdata":      ckdata,
+			"b_istag":       true,
+			"b_isgivegroup": true,
+			"b_isgiveuser":  true,
 		},
 	}
 }

+ 1 - 0
src/util/config.go

@@ -57,6 +57,7 @@ const BIDDINGSTARTID = "5a862f0640d2d9bbe88e3cec"
 const PROJECTCOLLNAME = "f_project"
 const TASKCOLLNAME = "f_task"
 const LOGCOLLNAME = "l_taglog"
+const SPECIALTYPE = "二级不存在"
 
 func InitConfig() {
 	Mgo = &mongodb.MongodbSim{