|
@@ -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("------------------")
|