|
@@ -25,7 +25,6 @@ func (f *Front) RemarkList() {
|
|
qu.Catch()
|
|
qu.Catch()
|
|
pid := qu.ObjToString(f.GetString("pid"))
|
|
pid := qu.ObjToString(f.GetString("pid"))
|
|
tid := qu.ObjToString(f.GetString("tid"))
|
|
tid := qu.ObjToString(f.GetString("tid"))
|
|
- sourceinfo := qu.ObjToString(f.GetString("s_sourceinfo"))
|
|
|
|
if f.Method() == "POST" {
|
|
if f.Method() == "POST" {
|
|
//user := f.GetSession("user").(map[string]interface{})
|
|
//user := f.GetSession("user").(map[string]interface{})
|
|
start, _ := f.GetInteger("start")
|
|
start, _ := f.GetInteger("start")
|
|
@@ -49,8 +48,8 @@ func (f *Front) RemarkList() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
field := map[string]interface{}{"v_baseinfo.title": 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)
|
|
|
|
|
|
+ info, _ := util.Mgo.Find(util.DATACOLLNAME, query, `{"_id": 1}`, field, false, start, limit)
|
|
|
|
+ count := util.Mgo.Count(util.DATACOLLNAME, query)
|
|
f.ServeJson(map[string]interface{}{
|
|
f.ServeJson(map[string]interface{}{
|
|
"draw": draw,
|
|
"draw": draw,
|
|
"data": *info,
|
|
"data": *info,
|
|
@@ -60,7 +59,6 @@ func (f *Front) RemarkList() {
|
|
} else {
|
|
} else {
|
|
f.T["pid"] = pid
|
|
f.T["pid"] = pid
|
|
f.T["tid"] = tid
|
|
f.T["tid"] = tid
|
|
- f.T["s_sourceinfo"] = sourceinfo
|
|
|
|
_ = f.Render("project/remark_list.html", &f.T)
|
|
_ = f.Render("project/remark_list.html", &f.T)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -69,16 +67,16 @@ func (f *Front) RemarkDetail() {
|
|
pid := f.GetString("pid")
|
|
pid := f.GetString("pid")
|
|
tid := f.GetString("tid")
|
|
tid := f.GetString("tid")
|
|
did := f.GetString("did")
|
|
did := f.GetString("did")
|
|
- coll := f.GetString("s_sourceinfo")
|
|
|
|
project, _ := util.Mgo.FindById(util.PROJECTCOLLNAME, pid, `{"v_fields": 1}`)
|
|
project, _ := util.Mgo.FindById(util.PROJECTCOLLNAME, pid, `{"v_fields": 1}`)
|
|
|
|
+ qu.Debug(pid)
|
|
|
|
+ qu.Debug(*project)
|
|
fs, _ := (*project)["v_fields"].([]interface{})
|
|
fs, _ := (*project)["v_fields"].([]interface{})
|
|
- rep := getDetail(did, coll, "remark", qu.ObjArrToMapArr(fs)) //获取本条公告的信息
|
|
|
|
- f.T["otherInfo"] = rep["otherInfo"] //展示关联公告信息
|
|
|
|
- f.T["moreInfo"] = rep["moreInfo"] //更多关联公告信息
|
|
|
|
|
|
+ rep := getDetail(did, "remark", qu.ObjArrToMapArr(fs)) //获取本条公告的信息
|
|
|
|
+ f.T["otherInfo"] = rep["otherInfo"] //展示关联公告信息
|
|
|
|
+ f.T["moreInfo"] = rep["moreInfo"] //更多关联公告信息
|
|
f.T["pid"] = pid
|
|
f.T["pid"] = pid
|
|
f.T["tid"] = tid
|
|
f.T["tid"] = tid
|
|
f.T["did"] = did
|
|
f.T["did"] = did
|
|
- f.T["coll"] = coll
|
|
|
|
f.T["info"] = rep["info"]
|
|
f.T["info"] = rep["info"]
|
|
f.T["common"] = rep["common"]
|
|
f.T["common"] = rep["common"]
|
|
f.T["other"] = rep["other"]
|
|
f.T["other"] = rep["other"]
|
|
@@ -114,14 +112,14 @@ func (f *Front) RemarkDetail() {
|
|
f.T["ck_package"] = rep["ck_package"]
|
|
f.T["ck_package"] = rep["ck_package"]
|
|
f.T["ck_winnerorder"] = rep["ck_winnerorder"]
|
|
f.T["ck_winnerorder"] = rep["ck_winnerorder"]
|
|
f.T["keyword"] = rep["matchkey"]
|
|
f.T["keyword"] = rep["matchkey"]
|
|
- f.T["nextid"] = GetNextDataId(did, coll, tid) //下一条id
|
|
|
|
- f.T["lastid"] = GetLastDataId(did, coll, tid) //上一条id
|
|
|
|
|
|
+ f.T["nextid"] = GetNextDataId(did, tid) //下一条id
|
|
|
|
+ f.T["lastid"] = GetLastDataId(did, tid) //上一条id
|
|
_ = f.Render("project/remark_detail.html", &f.T)
|
|
_ = f.Render("project/remark_detail.html", &f.T)
|
|
}
|
|
}
|
|
|
|
|
|
-func getDetail(id, coll, stype string, fs []map[string]interface{}) map[string]interface{} {
|
|
|
|
|
|
+func getDetail(id, stype string, fs []map[string]interface{}) map[string]interface{} {
|
|
rep := map[string]interface{}{}
|
|
rep := map[string]interface{}{}
|
|
- infoTmp, _ := util.Mgo.FindById(coll, id, ``)
|
|
|
|
|
|
+ infoTmp, _ := util.Mgo.FindById(util.DATACOLLNAME, id, ``)
|
|
rep["s_excp_info"] = (*infoTmp)["s_excp_info"]
|
|
rep["s_excp_info"] = (*infoTmp)["s_excp_info"]
|
|
baseInfo := (*infoTmp)["v_baseinfo"].(map[string]interface{}) //字段值
|
|
baseInfo := (*infoTmp)["v_baseinfo"].(map[string]interface{}) //字段值
|
|
var bzInfo map[string]interface{} //标注信息
|
|
var bzInfo map[string]interface{} //标注信息
|
|
@@ -602,7 +600,7 @@ func DealData(tmpLen int, publishtime float64, tmp []map[string]interface{}, mor
|
|
}
|
|
}
|
|
|
|
|
|
// GetNextDataId 获取当前数据下一条的id
|
|
// GetNextDataId 获取当前数据下一条的id
|
|
-func GetNextDataId(id, coll, tid string) string {
|
|
|
|
|
|
+func GetNextDataId(id, tid string) string {
|
|
nextIdQuery := map[string]interface{}{
|
|
nextIdQuery := map[string]interface{}{
|
|
//"b_istag": false,
|
|
//"b_istag": false,
|
|
"_id": map[string]interface{}{
|
|
"_id": map[string]interface{}{
|
|
@@ -611,8 +609,10 @@ func GetNextDataId(id, coll, tid string) string {
|
|
}
|
|
}
|
|
if tid != "" {
|
|
if tid != "" {
|
|
nextIdQuery["s_usertaskid"] = tid
|
|
nextIdQuery["s_usertaskid"] = tid
|
|
|
|
+ } else {
|
|
|
|
+
|
|
}
|
|
}
|
|
- one, _ := util.Mgo.Find(coll, nextIdQuery, `{"_id":1}`, `{"_id":1}`, true, 0, 1)
|
|
|
|
|
|
+ one, _ := util.Mgo.Find(util.DATACOLLNAME, nextIdQuery, `{"_id":1}`, `{"_id":1}`, true, 0, 1)
|
|
if len(*one) == 1 && len((*one)[0]) > 0 {
|
|
if len(*one) == 1 && len((*one)[0]) > 0 {
|
|
return mgo.BsonIdToSId((*one)[0]["_id"])
|
|
return mgo.BsonIdToSId((*one)[0]["_id"])
|
|
} else {
|
|
} else {
|
|
@@ -628,7 +628,7 @@ func GetNextDataId(id, coll, tid string) string {
|
|
return ""
|
|
return ""
|
|
}
|
|
}
|
|
|
|
|
|
-func GetLastDataId(id, coll, tid string) string {
|
|
|
|
|
|
+func GetLastDataId(id, tid string) string {
|
|
nextIdQuery := map[string]interface{}{
|
|
nextIdQuery := map[string]interface{}{
|
|
//"b_istag": false,
|
|
//"b_istag": false,
|
|
"_id": map[string]interface{}{
|
|
"_id": map[string]interface{}{
|
|
@@ -638,7 +638,7 @@ func GetLastDataId(id, coll, tid string) string {
|
|
if tid != "" {
|
|
if tid != "" {
|
|
nextIdQuery["s_usertaskid"] = tid
|
|
nextIdQuery["s_usertaskid"] = tid
|
|
}
|
|
}
|
|
- one, _ := util.Mgo.Find(coll, nextIdQuery, `{"_id":-1}`, `{"_id":1}`, true, 0, 1)
|
|
|
|
|
|
+ one, _ := util.Mgo.Find(util.DATACOLLNAME, nextIdQuery, `{"_id":-1}`, `{"_id":1}`, true, 0, 1)
|
|
if len(*one) == 1 && len((*one)[0]) > 0 {
|
|
if len(*one) == 1 && len((*one)[0]) > 0 {
|
|
return mgo.BsonIdToSId((*one)[0]["_id"])
|
|
return mgo.BsonIdToSId((*one)[0]["_id"])
|
|
} else {
|
|
} else {
|
|
@@ -655,7 +655,7 @@ func GetLastDataId(id, coll, tid string) string {
|
|
}
|
|
}
|
|
|
|
|
|
// GetNextDataId1 质检下一条
|
|
// GetNextDataId1 质检下一条
|
|
-func GetNextDataId1(id, coll, tid, tag string) string {
|
|
|
|
|
|
+func GetNextDataId1(id, tid, tag string) string {
|
|
nextIdQuery := map[string]interface{}{
|
|
nextIdQuery := map[string]interface{}{
|
|
"_id": map[string]interface{}{
|
|
"_id": map[string]interface{}{
|
|
"$gt": mgo.StringTOBsonId(id),
|
|
"$gt": mgo.StringTOBsonId(id),
|
|
@@ -673,7 +673,7 @@ func GetNextDataId1(id, coll, tid, tag string) string {
|
|
} else {
|
|
} else {
|
|
nextIdQuery["i_ckdata"] = 2
|
|
nextIdQuery["i_ckdata"] = 2
|
|
}
|
|
}
|
|
- one, _ := util.Mgo.Find(coll, nextIdQuery, `{"_id":1}`, `{"_id":1}`, true, 0, 1)
|
|
|
|
|
|
+ one, _ := util.Mgo.Find(util.DATACOLLNAME, nextIdQuery, `{"_id":1}`, `{"_id":1}`, true, 0, 1)
|
|
if len(*one) == 1 && len((*one)[0]) > 0 {
|
|
if len(*one) == 1 && len((*one)[0]) > 0 {
|
|
return mgo.BsonIdToSId((*one)[0]["_id"])
|
|
return mgo.BsonIdToSId((*one)[0]["_id"])
|
|
} else {
|
|
} else {
|
|
@@ -689,7 +689,7 @@ func GetNextDataId1(id, coll, tid, tag string) string {
|
|
return ""
|
|
return ""
|
|
}
|
|
}
|
|
|
|
|
|
-func GetLastDataId1(id, coll, tid, tag string) string {
|
|
|
|
|
|
+func GetLastDataId1(id, tid, tag string) string {
|
|
nextIdQuery := map[string]interface{}{
|
|
nextIdQuery := map[string]interface{}{
|
|
"_id": map[string]interface{}{
|
|
"_id": map[string]interface{}{
|
|
"$lt": mgo.StringTOBsonId(id),
|
|
"$lt": mgo.StringTOBsonId(id),
|
|
@@ -707,7 +707,7 @@ func GetLastDataId1(id, coll, tid, tag string) string {
|
|
} else {
|
|
} else {
|
|
nextIdQuery["i_ckdata"] = 2
|
|
nextIdQuery["i_ckdata"] = 2
|
|
}
|
|
}
|
|
- one, _ := util.Mgo.Find(coll, nextIdQuery, `{"_id":-1}`, `{"_id":1}`, true, 0, 1)
|
|
|
|
|
|
+ one, _ := util.Mgo.Find(util.DATACOLLNAME, nextIdQuery, `{"_id":-1}`, `{"_id":1}`, true, 0, 1)
|
|
if len(*one) == 1 && len((*one)[0]) > 0 {
|
|
if len(*one) == 1 && len((*one)[0]) > 0 {
|
|
return mgo.BsonIdToSId((*one)[0]["_id"])
|
|
return mgo.BsonIdToSId((*one)[0]["_id"])
|
|
} else {
|
|
} else {
|
|
@@ -758,8 +758,7 @@ func (f *Front) CheckList() {
|
|
for _, l := range *list {
|
|
for _, l := range *list {
|
|
if status := qu.ObjToString(l["s_status"]); status == "进行中" { //更新任务进度
|
|
if status := qu.ObjToString(l["s_status"]); status == "进行中" { //更新任务进度
|
|
giveNum := qu.IntAll(l["i_givenum"])
|
|
giveNum := qu.IntAll(l["i_givenum"])
|
|
- sourceinfo := qu.ObjToString(l["s_sourceinfo"])
|
|
|
|
- tagNum := util.Mgo.Count(sourceinfo, map[string]interface{}{"s_usertaskid": mgo.BsonIdToSId(l["_id"]), "b_istag": true})
|
|
|
|
|
|
+ tagNum := util.Mgo.Count(util.TASKCOLLNAME, map[string]interface{}{"s_usertaskid": mgo.BsonIdToSId(l["_id"]), "b_istag": true})
|
|
progressFloat := float64(tagNum) / float64(giveNum)
|
|
progressFloat := float64(tagNum) / float64(giveNum)
|
|
value, _ := strconv.ParseFloat(fmt.Sprintf("%.4f", progressFloat), 64)
|
|
value, _ := strconv.ParseFloat(fmt.Sprintf("%.4f", progressFloat), 64)
|
|
decimalValue := decimal.NewFromFloat(value)
|
|
decimalValue := decimal.NewFromFloat(value)
|
|
@@ -780,7 +779,6 @@ func (f *Front) CheckData() {
|
|
pid := f.GetString("pid")
|
|
pid := f.GetString("pid")
|
|
gid := f.GetString("gid")
|
|
gid := f.GetString("gid")
|
|
tid := f.GetString("tid")
|
|
tid := f.GetString("tid")
|
|
- sourceinfo := f.GetString("s_sourceinfo")
|
|
|
|
if f.Method() == "POST" {
|
|
if f.Method() == "POST" {
|
|
start, _ := f.GetInteger("start")
|
|
start, _ := f.GetInteger("start")
|
|
limit, _ := f.GetInteger("length")
|
|
limit, _ := f.GetInteger("length")
|
|
@@ -803,9 +801,9 @@ func (f *Front) CheckData() {
|
|
} else if s_excp == "-1" {
|
|
} else if s_excp == "-1" {
|
|
query["s_excp"] = map[string]interface{}{"$exists": true}
|
|
query["s_excp"] = map[string]interface{}{"$exists": true}
|
|
}
|
|
}
|
|
- count := util.Mgo.Count(sourceinfo, query)
|
|
|
|
|
|
+ count := util.Mgo.Count(util.DATACOLLNAME, query)
|
|
fields := map[string]interface{}{"v_baseinfo.title": 1, "b_check": 1, "i_ckdata": 1, "s_login": 1, "b_istag": 1, "s_excp": 1, "s_excp_info": 1}
|
|
fields := map[string]interface{}{"v_baseinfo.title": 1, "b_check": 1, "i_ckdata": 1, "s_login": 1, "b_istag": 1, "s_excp": 1, "s_excp_info": 1}
|
|
- info, _ := util.Mgo.Find(sourceinfo, query, `{"_id": 1}`, fields, false, start, limit)
|
|
|
|
|
|
+ info, _ := util.Mgo.Find(util.DATACOLLNAME, query, `{"_id": 1}`, fields, false, start, limit)
|
|
f.ServeJson(map[string]interface{}{
|
|
f.ServeJson(map[string]interface{}{
|
|
"draw": draw,
|
|
"draw": draw,
|
|
"data": *info,
|
|
"data": *info,
|
|
@@ -816,14 +814,13 @@ func (f *Front) CheckData() {
|
|
task, _ := util.Mgo.FindById(util.TASKCOLLNAME, tid, map[string]interface{}{"i_givenum": 1})
|
|
task, _ := util.Mgo.FindById(util.TASKCOLLNAME, tid, map[string]interface{}{"i_givenum": 1})
|
|
f.T["taskNum"] = (*task)["i_givenum"]
|
|
f.T["taskNum"] = (*task)["i_givenum"]
|
|
tagCount, checkCount := 0, 0
|
|
tagCount, checkCount := 0, 0
|
|
- 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 = util.Mgo.Count(util.DATACOLLNAME, map[string]interface{}{"s_usertaskid": tid, "b_istag": true})
|
|
|
|
+ checkCount = util.Mgo.Count(util.DATACOLLNAME, map[string]interface{}{"s_usertaskid": tid, "b_check": true})
|
|
f.T["taskTagNum"] = tagCount
|
|
f.T["taskTagNum"] = tagCount
|
|
f.T["taskCheckNum"] = checkCount
|
|
f.T["taskCheckNum"] = checkCount
|
|
f.T["pid"] = pid
|
|
f.T["pid"] = pid
|
|
f.T["tid"] = tid
|
|
f.T["tid"] = tid
|
|
f.T["gid"] = gid
|
|
f.T["gid"] = gid
|
|
- f.T["sourceinfo"] = sourceinfo
|
|
|
|
f.T["topsubtype"] = util.TopSubStypeArr
|
|
f.T["topsubtype"] = util.TopSubStypeArr
|
|
f.T["allfield"] = util.AllFieldArr
|
|
f.T["allfield"] = util.AllFieldArr
|
|
_ = f.Render("project/check_user_data_list.html", &f.T)
|
|
_ = f.Render("project/check_user_data_list.html", &f.T)
|
|
@@ -836,7 +833,6 @@ func (f *Front) CheckJyData() {
|
|
gid := f.GetString("gid")
|
|
gid := f.GetString("gid")
|
|
tid := f.GetString("tid")
|
|
tid := f.GetString("tid")
|
|
stype := f.GetString("stype")
|
|
stype := f.GetString("stype")
|
|
- sourceinfo := f.GetString("s_sourceinfo")
|
|
|
|
datatype, _ := f.GetInteger("datatype")
|
|
datatype, _ := f.GetInteger("datatype")
|
|
if f.Method() == "POST" {
|
|
if f.Method() == "POST" {
|
|
start, _ := f.GetInteger("start")
|
|
start, _ := f.GetInteger("start")
|
|
@@ -972,9 +968,9 @@ func (f *Front) CheckJyData() {
|
|
} else if !fieldScreen && notag {
|
|
} else if !fieldScreen && notag {
|
|
query["i_ckdata"] = 0
|
|
query["i_ckdata"] = 0
|
|
}
|
|
}
|
|
- count := util.Mgo.Count(sourceinfo, query)
|
|
|
|
|
|
+ count := util.Mgo.Count(util.DATACOLLNAME, query)
|
|
fields := map[string]interface{}{"v_baseinfo.title": 1, "b_check": 1, "i_ckdata": 1, "s_login": 1, "b_istag": 1, "s_excp": 1, "s_excp_info": 1, "b_isEff": 1}
|
|
fields := map[string]interface{}{"v_baseinfo.title": 1, "b_check": 1, "i_ckdata": 1, "s_login": 1, "b_istag": 1, "s_excp": 1, "s_excp_info": 1, "b_isEff": 1}
|
|
- info, _ := util.Mgo.Find(sourceinfo, query, `{"_id": 1}`, fields, false, start, limit)
|
|
|
|
|
|
+ info, _ := util.Mgo.Find(util.DATACOLLNAME, query, `{"_id": 1}`, fields, false, start, limit)
|
|
f.ServeJson(map[string]interface{}{
|
|
f.ServeJson(map[string]interface{}{
|
|
"draw": draw,
|
|
"draw": draw,
|
|
"data": *info,
|
|
"data": *info,
|
|
@@ -989,7 +985,7 @@ func (f *Front) CheckJyData() {
|
|
f.T["taskNum"] = (*project)["i_importnum"]
|
|
f.T["taskNum"] = (*project)["i_importnum"]
|
|
query1["i_ckdata"] = 2
|
|
query1["i_ckdata"] = 2
|
|
} else if stype == "notag" {
|
|
} else if stype == "notag" {
|
|
- f.T["taskNum"] = util.Mgo.Count(sourceinfo, map[string]interface{}{"b_istagging": false})
|
|
|
|
|
|
+ f.T["taskNum"] = util.Mgo.Count(util.DATACOLLNAME, map[string]interface{}{"b_istagging": false})
|
|
query1["b_istagging"] = false
|
|
query1["b_istagging"] = false
|
|
if datatype == 1 {
|
|
if datatype == 1 {
|
|
// 待分发数据
|
|
// 待分发数据
|
|
@@ -1001,7 +997,7 @@ func (f *Front) CheckJyData() {
|
|
query1["b_isgivegroup"] = true
|
|
query1["b_isgivegroup"] = true
|
|
}
|
|
}
|
|
} else if stype == "tag" {
|
|
} else if stype == "tag" {
|
|
- f.T["taskNum"] = util.Mgo.Count(sourceinfo, map[string]interface{}{"b_istagging": false})
|
|
|
|
|
|
+ f.T["taskNum"] = util.Mgo.Count(util.DATACOLLNAME, map[string]interface{}{"b_istagging": false})
|
|
query1["b_istagging"] = true //未达标
|
|
query1["b_istagging"] = true //未达标
|
|
query1["i_ckdata"] = 2
|
|
query1["i_ckdata"] = 2
|
|
} else {
|
|
} else {
|
|
@@ -1009,22 +1005,22 @@ func (f *Front) CheckJyData() {
|
|
f.T["taskNum"] = (*project)["i_importnum"]
|
|
f.T["taskNum"] = (*project)["i_importnum"]
|
|
query1["i_ckdata"] = 2
|
|
query1["i_ckdata"] = 2
|
|
}
|
|
}
|
|
- count := util.Mgo.Count(sourceinfo, query1)
|
|
|
|
|
|
+ count := util.Mgo.Count(util.DATACOLLNAME, query1)
|
|
//f.T["taskNum"] = count
|
|
//f.T["taskNum"] = count
|
|
f.T["taskTagNum"] = count
|
|
f.T["taskTagNum"] = count
|
|
query1["b_check"] = true // 已质检
|
|
query1["b_check"] = true // 已质检
|
|
- checkCount := util.Mgo.Count(sourceinfo, query1)
|
|
|
|
|
|
+ checkCount := util.Mgo.Count(util.DATACOLLNAME, query1)
|
|
f.T["taskCheckNum"] = checkCount
|
|
f.T["taskCheckNum"] = checkCount
|
|
} else {
|
|
} else {
|
|
task, _ := util.Mgo.FindById(util.TASKCOLLNAME, tid, map[string]interface{}{"i_givenum": 1})
|
|
task, _ := util.Mgo.FindById(util.TASKCOLLNAME, tid, map[string]interface{}{"i_givenum": 1})
|
|
f.T["taskNum"] = (*task)["i_givenum"]
|
|
f.T["taskNum"] = (*task)["i_givenum"]
|
|
tagCount, checkCount := 0, 0
|
|
tagCount, checkCount := 0, 0
|
|
if stype == "group" {
|
|
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})
|
|
|
|
|
|
+ tagCount = util.Mgo.Count(util.DATACOLLNAME, map[string]interface{}{"s_grouptaskid": tid, "b_istag": true})
|
|
|
|
+ checkCount = util.Mgo.Count(util.DATACOLLNAME, map[string]interface{}{"s_grouptaskid": tid, "b_check": true})
|
|
} else {
|
|
} 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})
|
|
|
|
|
|
+ tagCount = util.Mgo.Count(util.DATACOLLNAME, map[string]interface{}{"s_usertaskid": tid, "b_istag": true})
|
|
|
|
+ checkCount = util.Mgo.Count(util.DATACOLLNAME, map[string]interface{}{"s_usertaskid": tid, "b_check": true})
|
|
}
|
|
}
|
|
f.T["taskTagNum"] = tagCount
|
|
f.T["taskTagNum"] = tagCount
|
|
f.T["taskCheckNum"] = checkCount
|
|
f.T["taskCheckNum"] = checkCount
|
|
@@ -1033,7 +1029,6 @@ func (f *Front) CheckJyData() {
|
|
f.T["pid"] = pid
|
|
f.T["pid"] = pid
|
|
f.T["tid"] = tid
|
|
f.T["tid"] = tid
|
|
f.T["gid"] = gid
|
|
f.T["gid"] = gid
|
|
- f.T["sourceinfo"] = sourceinfo
|
|
|
|
f.T["stype"] = stype
|
|
f.T["stype"] = stype
|
|
f.T["datatype"] = datatype
|
|
f.T["datatype"] = datatype
|
|
f.T["topsubtype"] = util.TopSubStypeArr
|
|
f.T["topsubtype"] = util.TopSubStypeArr
|
|
@@ -1048,17 +1043,15 @@ func (f *Front) CheckDetail() {
|
|
tid := f.GetString("tid")
|
|
tid := f.GetString("tid")
|
|
pid := f.GetString("pid")
|
|
pid := f.GetString("pid")
|
|
did := f.GetString("did")
|
|
did := f.GetString("did")
|
|
- coll := f.GetString("s_sourceinfo")
|
|
|
|
project, _ := util.Mgo.FindById(util.PROJECTCOLLNAME, pid, `{"v_fields": 1}`)
|
|
project, _ := util.Mgo.FindById(util.PROJECTCOLLNAME, pid, `{"v_fields": 1}`)
|
|
fs, _ := (*project)["v_fields"].([]interface{})
|
|
fs, _ := (*project)["v_fields"].([]interface{})
|
|
- rep := getDetail(did, coll, "check", qu.ObjArrToMapArr(fs)) //获取本条公告的信息
|
|
|
|
- f.T["otherInfo"] = rep["otherInfo"] //展示关联公告信息
|
|
|
|
- f.T["moreInfo"] = rep["moreInfo"] //更多关联公告信息
|
|
|
|
|
|
+ rep := getDetail(did, "check", qu.ObjArrToMapArr(fs)) //获取本条公告的信息
|
|
|
|
+ f.T["otherInfo"] = rep["otherInfo"] //展示关联公告信息
|
|
|
|
+ f.T["moreInfo"] = rep["moreInfo"] //更多关联公告信息
|
|
f.T["s_excp_info"] = rep["s_excp_info"]
|
|
f.T["s_excp_info"] = rep["s_excp_info"]
|
|
f.T["pid"] = pid
|
|
f.T["pid"] = pid
|
|
f.T["tid"] = tid
|
|
f.T["tid"] = tid
|
|
f.T["did"] = did
|
|
f.T["did"] = did
|
|
- f.T["coll"] = coll
|
|
|
|
f.T["info"] = rep["info"]
|
|
f.T["info"] = rep["info"]
|
|
f.T["common"] = rep["common"]
|
|
f.T["common"] = rep["common"]
|
|
f.T["other"] = rep["other"]
|
|
f.T["other"] = rep["other"]
|
|
@@ -1094,8 +1087,8 @@ func (f *Front) CheckDetail() {
|
|
f.T["ck_package"] = rep["ck_package"]
|
|
f.T["ck_package"] = rep["ck_package"]
|
|
f.T["ck_winnerorder"] = rep["ck_winnerorder"]
|
|
f.T["ck_winnerorder"] = rep["ck_winnerorder"]
|
|
f.T["topsubtype"] = util.TopSubStypeArr2
|
|
f.T["topsubtype"] = util.TopSubStypeArr2
|
|
- f.T["nextid"] = GetNextDataId1(did, coll, tid, qu.ObjToString(f.GetSession("check"))) //下一条id
|
|
|
|
- f.T["lastid"] = GetLastDataId1(did, coll, tid, qu.ObjToString(f.GetSession("check"))) //下一条id
|
|
|
|
|
|
+ f.T["nextid"] = GetNextDataId1(did, tid, qu.ObjToString(f.GetSession("check"))) //下一条id
|
|
|
|
+ f.T["lastid"] = GetLastDataId1(did, tid, qu.ObjToString(f.GetSession("check"))) //下一条id
|
|
_ = f.Render("project/check_detail.html", &f.T)
|
|
_ = f.Render("project/check_detail.html", &f.T)
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1109,7 +1102,6 @@ func (f *Front) CheckSave() {
|
|
userRole := qu.ObjToString(user["i_role"]) //当前登录用户权限
|
|
userRole := qu.ObjToString(user["i_role"]) //当前登录用户权限
|
|
var obj []map[string]interface{}
|
|
var obj []map[string]interface{}
|
|
infoId := f.GetString("s_infoid")
|
|
infoId := f.GetString("s_infoid")
|
|
- sourceInfo := f.GetString("s_sourceinfo")
|
|
|
|
pid := f.GetString("pid")
|
|
pid := f.GetString("pid")
|
|
project, _ := util.Mgo.FindById(util.PROJECTCOLLNAME, pid, map[string]interface{}{"s_name": 1, "v_fields": 1})
|
|
project, _ := util.Mgo.FindById(util.PROJECTCOLLNAME, pid, map[string]interface{}{"s_name": 1, "v_fields": 1})
|
|
data := f.GetString("data")
|
|
data := f.GetString("data")
|
|
@@ -1171,7 +1163,7 @@ func (f *Front) CheckSave() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- dataInfo, _ := util.Mgo.FindById(sourceInfo, infoId, map[string]interface{}{"v_baseinfo": 1, "v_taginfo": 1}) //查询标注保存前的原始信息
|
|
|
|
|
|
+ dataInfo, _ := util.Mgo.FindById(util.DATACOLLNAME, infoId, map[string]interface{}{"v_baseinfo": 1, "v_taginfo": 1}) //查询标注保存前的原始信息
|
|
tagInfo, _ := (*dataInfo)["v_taginfo"].(map[string]interface{})
|
|
tagInfo, _ := (*dataInfo)["v_taginfo"].(map[string]interface{})
|
|
baseInfo, _ := (*dataInfo)["v_baseinfo"].(map[string]interface{})
|
|
baseInfo, _ := (*dataInfo)["v_baseinfo"].(map[string]interface{})
|
|
if tagInfo != nil && len(tagInfo) > 0 {
|
|
if tagInfo != nil && len(tagInfo) > 0 {
|
|
@@ -1251,12 +1243,11 @@ func (f *Front) CheckSave() {
|
|
if len(baseUnsetResult) > 0 {
|
|
if len(baseUnsetResult) > 0 {
|
|
set["$unset"] = baseUnsetResult
|
|
set["$unset"] = baseUnsetResult
|
|
}
|
|
}
|
|
- qu.Debug(sourceInfo)
|
|
|
|
qu.Debug(infoId)
|
|
qu.Debug(infoId)
|
|
qu.Debug(set)
|
|
qu.Debug(set)
|
|
- success = util.Mgo.UpdateById(sourceInfo, infoId, set)
|
|
|
|
|
|
+ success = util.Mgo.UpdateById(util.DATACOLLNAME, infoId, set)
|
|
//2、更新marked表
|
|
//2、更新marked表
|
|
- tmp, _ := util.Mgo.FindById(sourceInfo, infoId, map[string]interface{}{"v_baseinfo": 1, "v_taginfo": 1, "i_ckdata": 1})
|
|
|
|
|
|
+ tmp, _ := util.Mgo.FindById(util.DATACOLLNAME, infoId, map[string]interface{}{"v_baseinfo": 1, "v_taginfo": 1, "i_ckdata": 1})
|
|
delete(*tmp, "_id")
|
|
delete(*tmp, "_id")
|
|
(*tmp)["updatetime"] = time.Now().Unix()
|
|
(*tmp)["updatetime"] = time.Now().Unix()
|
|
_ = util.Mgo.Update(util.AllToColl, map[string]interface{}{"_id": mgo.StringTOBsonId(infoId)}, map[string]interface{}{"$set": tmp}, true, false)
|
|
_ = util.Mgo.Update(util.AllToColl, map[string]interface{}{"_id": mgo.StringTOBsonId(infoId)}, map[string]interface{}{"$set": tmp}, true, false)
|
|
@@ -1269,13 +1260,11 @@ func (f *Front) CheckSave() {
|
|
func (f *Front) CheckResult() {
|
|
func (f *Front) CheckResult() {
|
|
pid := f.GetString("pid")
|
|
pid := f.GetString("pid")
|
|
tid := f.GetString("tid")
|
|
tid := f.GetString("tid")
|
|
- sourceinfo := f.GetString("s_sourceinfo")
|
|
|
|
stype := f.GetString("stype")
|
|
stype := f.GetString("stype")
|
|
datatype, _ := f.GetInteger("datatype")
|
|
datatype, _ := f.GetInteger("datatype")
|
|
var allNum int
|
|
var allNum int
|
|
- 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})
|
|
|
|
- //checkCount := util.Mgo.Count(sourceinfo, map[string]interface{}{"s_grouptaskid": tid, "b_check": true})
|
|
|
|
|
|
+ projcet, _ := util.Mgo.FindById(util.PROJECTCOLLNAME, pid, map[string]interface{}{"v_fields": 1, "appid": 1})
|
|
|
|
+ appid := qu.ObjToString((*projcet)["appid"])
|
|
|
|
|
|
markNum, checkNum, checkNumR := 0, 0, 0 // 标注数量, 审核数据量, 审核数据完全正确的数据量
|
|
markNum, checkNum, checkNumR := 0, 0, 0 // 标注数量, 审核数据量, 审核数据完全正确的数据量
|
|
cmaps := make(map[string]int) // 标注字段整体准确率
|
|
cmaps := make(map[string]int) // 标注字段整体准确率
|
|
@@ -1302,6 +1291,7 @@ func (f *Front) CheckResult() {
|
|
if tid == "" {
|
|
if tid == "" {
|
|
query1 := make(map[string]interface{})
|
|
query1 := make(map[string]interface{})
|
|
if stype == "all" {
|
|
if stype == "all" {
|
|
|
|
+ query1["appid"] = appid
|
|
query1["i_ckdata"] = 2
|
|
query1["i_ckdata"] = 2
|
|
} else if stype == "notag" {
|
|
} else if stype == "notag" {
|
|
if datatype == 1 {
|
|
if datatype == 1 {
|
|
@@ -1317,7 +1307,7 @@ func (f *Front) CheckResult() {
|
|
query1["b_istagging"] = true //未达标
|
|
query1["b_istagging"] = true //未达标
|
|
query1["i_ckdata"] = 2
|
|
query1["i_ckdata"] = 2
|
|
}
|
|
}
|
|
- allNum = util.Mgo.Count(sourceinfo, query1)
|
|
|
|
|
|
+ allNum = util.Mgo.Count(util.DATACOLLNAME, query1)
|
|
} else {
|
|
} else {
|
|
task, _ := util.Mgo.FindById(util.TASKCOLLNAME, tid, map[string]interface{}{"i_givenum": 1})
|
|
task, _ := util.Mgo.FindById(util.TASKCOLLNAME, tid, map[string]interface{}{"i_givenum": 1})
|
|
allNum = qu.IntAll((*task)["i_givenum"]) //任务数据量
|
|
allNum = qu.IntAll((*task)["i_givenum"]) //任务数据量
|
|
@@ -1327,9 +1317,10 @@ func (f *Front) CheckResult() {
|
|
query["s_usertaskid"] = tid
|
|
query["s_usertaskid"] = tid
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ query["appid"] = appid
|
|
query["b_check"] = true
|
|
query["b_check"] = true
|
|
- checkNum = util.Mgo.Count(sourceinfo, query)
|
|
|
|
- result := sess.DB(util.Mgo.DbName).C(sourceinfo).Find(query).Iter()
|
|
|
|
|
|
+ checkNum = util.Mgo.Count(util.DATACOLLNAME, query)
|
|
|
|
+ result := sess.DB(util.Mgo.DbName).C(util.DATACOLLNAME).Find(query).Iter()
|
|
if checkNum == 0 {
|
|
if checkNum == 0 {
|
|
f.ServeJson(map[string]interface{}{"rep": false, "msg": "无质检审核数据!"})
|
|
f.ServeJson(map[string]interface{}{"rep": false, "msg": "无质检审核数据!"})
|
|
return
|
|
return
|
|
@@ -1467,7 +1458,6 @@ func (f *Front) CheckResult() {
|
|
}
|
|
}
|
|
f.T["pid"] = pid
|
|
f.T["pid"] = pid
|
|
f.T["tid"] = tid
|
|
f.T["tid"] = tid
|
|
- f.T["sourceinfo"] = sourceinfo
|
|
|
|
f.T["taskNum"] = allNum
|
|
f.T["taskNum"] = allNum
|
|
f.T["taskTagNum"] = markNum
|
|
f.T["taskTagNum"] = markNum
|
|
f.T["taskCheckNum"] = checkNum
|
|
f.T["taskCheckNum"] = checkNum
|
|
@@ -1509,7 +1499,6 @@ func CountPr(c1, c2 int) string {
|
|
func (f *Front) CheckExcpResult() {
|
|
func (f *Front) CheckExcpResult() {
|
|
pid := f.GetString("pid")
|
|
pid := f.GetString("pid")
|
|
tid := f.GetString("tid")
|
|
tid := f.GetString("tid")
|
|
- sourceinfo := f.GetString("s_sourceinfo")
|
|
|
|
stype := f.GetString("stype")
|
|
stype := f.GetString("stype")
|
|
query := make(map[string]interface{})
|
|
query := make(map[string]interface{})
|
|
var dataSource []map[string]interface{}
|
|
var dataSource []map[string]interface{}
|
|
@@ -1522,22 +1511,24 @@ func (f *Front) CheckExcpResult() {
|
|
query["s_excp"] = map[string]interface{}{"$exists": true}
|
|
query["s_excp"] = map[string]interface{}{"$exists": true}
|
|
|
|
|
|
} else {
|
|
} else {
|
|
|
|
+ pinfo, _ := util.Mgo.FindById(util.PROJECTCOLLNAME, pid, bson.M{"appid": 1})
|
|
|
|
+ query["appid"] = qu.ObjToString((*pinfo)["appid"])
|
|
query["s_excp"] = map[string]interface{}{"$exists": true}
|
|
query["s_excp"] = map[string]interface{}{"$exists": true}
|
|
- excpNum := util.Mgo.Count(sourceinfo, query)
|
|
|
|
- tagNum := util.Mgo.Count(sourceinfo, map[string]interface{}{"i_ckdata": 2})
|
|
|
|
|
|
+ excpNum := util.Mgo.Count(util.DATACOLLNAME, query)
|
|
|
|
+ tagNum := util.Mgo.Count(util.DATACOLLNAME, map[string]interface{}{"i_ckdata": 2})
|
|
dataSource = append(dataSource, map[string]interface{}{"name": "达标数据", "num1": excpNum, "num2": tagNum, "num3": CountPr(excpNum, tagNum)})
|
|
dataSource = append(dataSource, map[string]interface{}{"name": "达标数据", "num1": excpNum, "num2": tagNum, "num3": CountPr(excpNum, tagNum)})
|
|
}
|
|
}
|
|
f.T["tableData"] = dataSource
|
|
f.T["tableData"] = dataSource
|
|
f.T["pid"] = pid
|
|
f.T["pid"] = pid
|
|
f.T["tid"] = tid
|
|
f.T["tid"] = tid
|
|
- f.T["sourceinfo"] = sourceinfo
|
|
|
|
_ = f.Render("project/check_excp_result.html", &f.T)
|
|
_ = f.Render("project/check_excp_result.html", &f.T)
|
|
}
|
|
}
|
|
|
|
|
|
func (f *Front) CheckExcpData() {
|
|
func (f *Front) CheckExcpData() {
|
|
- sourceinfo := f.GetString("s_sourceinfo")
|
|
|
|
|
|
+ appid := f.GetString("appid")
|
|
// 达标,待分发数据
|
|
// 达标,待分发数据
|
|
query := map[string]interface{}{
|
|
query := map[string]interface{}{
|
|
|
|
+ "appid": appid,
|
|
"b_istagging": false,
|
|
"b_istagging": false,
|
|
//"b_isgivegroup": false,
|
|
//"b_isgivegroup": false,
|
|
}
|
|
}
|
|
@@ -1546,7 +1537,7 @@ func (f *Front) CheckExcpData() {
|
|
sess := util.Mgo.GetMgoConn()
|
|
sess := util.Mgo.GetMgoConn()
|
|
defer util.Mgo.DestoryMongoConn(sess)
|
|
defer util.Mgo.DestoryMongoConn(sess)
|
|
count := 0
|
|
count := 0
|
|
- it := sess.DB(util.Mgo.DbName).C(sourceinfo).Find(query).Select(nil).Iter()
|
|
|
|
|
|
+ it := sess.DB(util.Mgo.DbName).C(util.DATACOLLNAME).Find(query).Select(nil).Iter()
|
|
for tmp := make(map[string]interface{}); it.Next(&tmp); count++ {
|
|
for tmp := make(map[string]interface{}); it.Next(&tmp); count++ {
|
|
if tmp["s_excp"] != nil {
|
|
if tmp["s_excp"] != nil {
|
|
f.ServeJson(map[string]interface{}{"success": true})
|
|
f.ServeJson(map[string]interface{}{"success": true})
|
|
@@ -1561,7 +1552,7 @@ func (f *Front) CheckExcpData() {
|
|
info := tmp["v_baseinfo"].(map[string]interface{})
|
|
info := tmp["v_baseinfo"].(map[string]interface{})
|
|
ex, exp := DataException(info)
|
|
ex, exp := DataException(info)
|
|
if ex != "" {
|
|
if ex != "" {
|
|
- util.Mgo.UpdateById(sourceinfo, tmp["_id"], map[string]interface{}{"$set": map[string]interface{}{"s_excp": ex, "s_excp_info": exp}})
|
|
|
|
|
|
+ util.Mgo.UpdateById(util.DATACOLLNAME, tmp["_id"], map[string]interface{}{"$set": map[string]interface{}{"s_excp": ex, "s_excp_info": exp}})
|
|
}
|
|
}
|
|
}()
|
|
}()
|
|
}(tmp)
|
|
}(tmp)
|
|
@@ -1633,15 +1624,16 @@ func (f *Front) JyMarkList() {
|
|
start, _ := f.GetInteger("start")
|
|
start, _ := f.GetInteger("start")
|
|
limit, _ := f.GetInteger("length")
|
|
limit, _ := f.GetInteger("length")
|
|
draw, _ := f.GetInteger("draw")
|
|
draw, _ := f.GetInteger("draw")
|
|
- sourceInfo := f.GetString("s_sourceinfo") //数据源表
|
|
|
|
- istag := f.GetString("b_istag") //
|
|
|
|
- field := f.GetString("field") //字段
|
|
|
|
- dataType := f.GetString("datatype") //信息类型
|
|
|
|
- min := f.GetString("minval") //min max不用int类型接收,以免有默认值0
|
|
|
|
|
|
+ appid := f.GetString("appid")
|
|
|
|
+ istag := f.GetString("b_istag") //
|
|
|
|
+ field := f.GetString("field") //字段
|
|
|
|
+ dataType := f.GetString("datatype") //信息类型
|
|
|
|
+ min := f.GetString("minval") //min max不用int类型接收,以免有默认值0
|
|
max := f.GetString("maxval")
|
|
max := f.GetString("maxval")
|
|
hasno, _ := f.GetBool("hasno") //是否存在
|
|
hasno, _ := f.GetBool("hasno") //是否存在
|
|
notag, _ := f.GetBool("notag") //是否标注
|
|
notag, _ := f.GetBool("notag") //是否标注
|
|
query := map[string]interface{}{ //剑鱼自用的标注页面, 查询待分发的数据量
|
|
query := map[string]interface{}{ //剑鱼自用的标注页面, 查询待分发的数据量
|
|
|
|
+ "appid": appid,
|
|
"b_isgivegroup": false,
|
|
"b_isgivegroup": false,
|
|
//"b_isgiveuser": false,
|
|
//"b_isgiveuser": false,
|
|
}
|
|
}
|
|
@@ -1725,17 +1717,16 @@ func (f *Front) JyMarkList() {
|
|
} else if !fieldScreen && notag {
|
|
} else if !fieldScreen && notag {
|
|
query["i_ckdata"] = 0
|
|
query["i_ckdata"] = 0
|
|
}
|
|
}
|
|
- count := util.Mgo.Count(sourceInfo, query)
|
|
|
|
|
|
+ count := util.Mgo.Count(util.DATACOLLNAME, query)
|
|
fields := map[string]interface{}{"v_baseinfo.title": 1, "b_istag": 1, "i_ckdata": 1}
|
|
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)
|
|
|
|
- //checkedNum, allNum := GetCheckedAndAllDataInfo(query, coll) //已标和总数信息
|
|
|
|
|
|
+ qu.Debug(query)
|
|
|
|
+ list, _ := util.Mgo.Find(util.DATACOLLNAME, query, map[string]interface{}{"_id": 1}, fields, false, start, limit)
|
|
f.ServeJson(map[string]interface{}{"draw": draw, "data": *list, "recordsFiltered": count, "recordsTotal": count})
|
|
f.ServeJson(map[string]interface{}{"draw": draw, "data": *list, "recordsFiltered": count, "recordsTotal": count})
|
|
} else {
|
|
} else {
|
|
- pid := f.GetString("pid")
|
|
|
|
- info, _ := util.Mgo.FindById(util.PROJECTCOLLNAME, pid, map[string]interface{}{"s_sourceinfo": 1})
|
|
|
|
- f.T["s_sourceinfo"] = (*info)["s_sourceinfo"]
|
|
|
|
|
|
+ appid := f.GetString("appid")
|
|
|
|
+ f.T["pid"] = f.GetString("pid")
|
|
f.T["stype"] = stype
|
|
f.T["stype"] = stype
|
|
- f.T["pid"] = pid
|
|
|
|
|
|
+ f.T["appid"] = appid
|
|
f.T["topsubtype"] = util.TopSubStypeArr
|
|
f.T["topsubtype"] = util.TopSubStypeArr
|
|
f.T["allfield"] = util.AllFieldArr
|
|
f.T["allfield"] = util.AllFieldArr
|
|
_ = f.Render("project/remark_jy_list.html", &f.T)
|
|
_ = f.Render("project/remark_jy_list.html", &f.T)
|
|
@@ -1754,7 +1745,6 @@ func (f *Front) JyUserDataMark() {
|
|
userRole := qu.ObjToString(user["i_role"]) //当前登录用户权限
|
|
userRole := qu.ObjToString(user["i_role"]) //当前登录用户权限
|
|
obj := []map[string]interface{}{}
|
|
obj := []map[string]interface{}{}
|
|
infoId := f.GetString("s_infoid")
|
|
infoId := f.GetString("s_infoid")
|
|
- sourceInfo := f.GetString("s_sourceinfo")
|
|
|
|
isEff, _ := f.GetBool("isEff")
|
|
isEff, _ := f.GetBool("isEff")
|
|
pid := f.GetString("pid")
|
|
pid := f.GetString("pid")
|
|
data := f.GetString("data")
|
|
data := f.GetString("data")
|
|
@@ -1818,7 +1808,7 @@ func (f *Front) JyUserDataMark() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
qu.Debug("baseUnset===", baseUnset)
|
|
qu.Debug("baseUnset===", baseUnset)
|
|
- dataInfo, _ := util.Mgo.FindById(sourceInfo, infoId, map[string]interface{}{"v_baseinfo": 1, "v_taginfo": 1}) //查询标注保存前的原始信息
|
|
|
|
|
|
+ dataInfo, _ := util.Mgo.FindById(util.DATACOLLNAME, infoId, map[string]interface{}{"v_baseinfo": 1, "v_taginfo": 1}) //查询标注保存前的原始信息
|
|
//tagInfo, _ := (*dataInfo)["v_taginfo"].(map[string]interface{})
|
|
//tagInfo, _ := (*dataInfo)["v_taginfo"].(map[string]interface{})
|
|
baseInfo, _ := (*dataInfo)["v_baseinfo"].(map[string]interface{})
|
|
baseInfo, _ := (*dataInfo)["v_baseinfo"].(map[string]interface{})
|
|
//if tagInfo != nil && len(tagInfo) > 0 {
|
|
//if tagInfo != nil && len(tagInfo) > 0 {
|
|
@@ -1876,12 +1866,11 @@ func (f *Front) JyUserDataMark() {
|
|
if len(baseUnsetResult) > 0 {
|
|
if len(baseUnsetResult) > 0 {
|
|
set["$unset"] = baseUnsetResult
|
|
set["$unset"] = baseUnsetResult
|
|
}
|
|
}
|
|
- qu.Debug(sourceInfo)
|
|
|
|
qu.Debug(infoId)
|
|
qu.Debug(infoId)
|
|
qu.Debug(set)
|
|
qu.Debug(set)
|
|
- success = util.Mgo.UpdateById(sourceInfo, infoId, set)
|
|
|
|
|
|
+ success = util.Mgo.UpdateById(util.DATACOLLNAME, infoId, set)
|
|
//2、更新marked表
|
|
//2、更新marked表
|
|
- tmp, _ := util.Mgo.FindById(sourceInfo, infoId, map[string]interface{}{"v_baseinfo": 1, "v_taginfo": 1, "i_ckdata": 1})
|
|
|
|
|
|
+ tmp, _ := util.Mgo.FindById(util.DATACOLLNAME, infoId, map[string]interface{}{"v_baseinfo": 1, "v_taginfo": 1, "i_ckdata": 1})
|
|
delete((*tmp), "_id")
|
|
delete((*tmp), "_id")
|
|
(*tmp)["updatetime"] = time.Now().Unix()
|
|
(*tmp)["updatetime"] = time.Now().Unix()
|
|
_ = util.Mgo.Update(util.AllToColl, map[string]interface{}{"_id": mgo.StringTOBsonId(infoId)}, map[string]interface{}{"$set": tmp}, true, false)
|
|
_ = util.Mgo.Update(util.AllToColl, map[string]interface{}{"_id": mgo.StringTOBsonId(infoId)}, map[string]interface{}{"$set": tmp}, true, false)
|
|
@@ -1971,13 +1960,12 @@ func (f *Front) UserDataMark() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//
|
|
//
|
|
- userTask, _ := util.Mgo.FindById(util.TASKCOLLNAME, userTaskId, map[string]interface{}{"s_personid": 1, "s_personname": 1, "s_projectname": 1, "s_sourceinfo": 1})
|
|
|
|
|
|
+ userTask, _ := util.Mgo.FindById(util.TASKCOLLNAME, userTaskId, map[string]interface{}{"s_personid": 1, "s_personname": 1, "s_projectname": 1})
|
|
if userTask == nil || len(*userTask) == 0 {
|
|
if userTask == nil || len(*userTask) == 0 {
|
|
f.ServeJson(map[string]interface{}{"success": success, "msg": "查询用户任务失败"})
|
|
f.ServeJson(map[string]interface{}{"success": success, "msg": "查询用户任务失败"})
|
|
return
|
|
return
|
|
- }
|
|
|
|
- sourceInfo := qu.ObjToString((*userTask)["s_sourceinfo"]) //数据源表
|
|
|
|
- dataInfo, _ := util.Mgo.FindById(sourceInfo, infoId, map[string]interface{}{"v_baseinfo": 1, "v_taginfo": 1}) //查询标注保存前的原始信息
|
|
|
|
|
|
+ } //数据源表
|
|
|
|
+ dataInfo, _ := util.Mgo.FindById(util.DATACOLLNAME, infoId, map[string]interface{}{"v_baseinfo": 1, "v_taginfo": 1}) //查询标注保存前的原始信息
|
|
//tagInfo, _ := (*dataInfo)["v_taginfo"].(map[string]interface{})
|
|
//tagInfo, _ := (*dataInfo)["v_taginfo"].(map[string]interface{})
|
|
baseInfo, _ := (*dataInfo)["v_baseinfo"].(map[string]interface{})
|
|
baseInfo, _ := (*dataInfo)["v_baseinfo"].(map[string]interface{})
|
|
//if tagInfo != nil && len(tagInfo) > 0 {
|
|
//if tagInfo != nil && len(tagInfo) > 0 {
|
|
@@ -2037,9 +2025,9 @@ func (f *Front) UserDataMark() {
|
|
set["$unset"] = baseUnsetResult
|
|
set["$unset"] = baseUnsetResult
|
|
}
|
|
}
|
|
qu.Debug(set)
|
|
qu.Debug(set)
|
|
- success = util.Mgo.UpdateById(sourceInfo, infoId, set)
|
|
|
|
|
|
+ success = util.Mgo.UpdateById(util.DATACOLLNAME, infoId, set)
|
|
//2、更新marked表
|
|
//2、更新marked表
|
|
- tmp, _ := util.Mgo.FindById(sourceInfo, infoId, map[string]interface{}{"v_baseinfo": 1, "v_taginfo": 1, "i_ckdata": 1})
|
|
|
|
|
|
+ tmp, _ := util.Mgo.FindById(util.DATACOLLNAME, infoId, map[string]interface{}{"v_baseinfo": 1, "v_taginfo": 1, "i_ckdata": 1})
|
|
delete((*tmp), "_id")
|
|
delete((*tmp), "_id")
|
|
(*tmp)["updatetime"] = time.Now().Unix()
|
|
(*tmp)["updatetime"] = time.Now().Unix()
|
|
_ = util.Mgo.Update(util.AllToColl, map[string]interface{}{"_id": mgo.StringTOBsonId(infoId)}, map[string]interface{}{"$set": tmp}, true, false)
|
|
_ = util.Mgo.Update(util.AllToColl, map[string]interface{}{"_id": mgo.StringTOBsonId(infoId)}, map[string]interface{}{"$set": tmp}, true, false)
|
|
@@ -2490,9 +2478,9 @@ func (f *Front) CheckDataPurchase() {
|
|
if f.Method() == "POST" {
|
|
if f.Method() == "POST" {
|
|
datatype, _ := f.GetInteger("datatype")
|
|
datatype, _ := f.GetInteger("datatype")
|
|
stype := f.GetString("stype")
|
|
stype := f.GetString("stype")
|
|
- sourceinfo := f.GetString("s_sourceinfo")
|
|
|
|
tid := f.GetString("taskid")
|
|
tid := f.GetString("taskid")
|
|
pid := f.GetString("pid")
|
|
pid := f.GetString("pid")
|
|
|
|
+ appid := f.GetString("appid")
|
|
keyword := f.GetString("keyword")
|
|
keyword := f.GetString("keyword")
|
|
keyword = strings.ReplaceAll(keyword, ",", ",")
|
|
keyword = strings.ReplaceAll(keyword, ",", ",")
|
|
keyArr := strings.Split(keyword, ",")
|
|
keyArr := strings.Split(keyword, ",")
|
|
@@ -2505,6 +2493,7 @@ func (f *Front) CheckDataPurchase() {
|
|
query["s_usertaskid"] = tid
|
|
query["s_usertaskid"] = tid
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
|
|
+ query["appid"] = appid
|
|
if stype == "notag" {
|
|
if stype == "notag" {
|
|
query["b_istagging"] = false
|
|
query["b_istagging"] = false
|
|
if datatype == 1 {
|
|
if datatype == 1 {
|
|
@@ -2524,7 +2513,7 @@ func (f *Front) CheckDataPurchase() {
|
|
}
|
|
}
|
|
util.Mgo.UpdateById(util.PROJECTCOLLNAME, pid, map[string]interface{}{"$set": map[string]interface{}{"purchasinglist_key": keyword}})
|
|
util.Mgo.UpdateById(util.PROJECTCOLLNAME, pid, map[string]interface{}{"$set": map[string]interface{}{"purchasinglist_key": keyword}})
|
|
query["v_baseinfo.purchasinglist"] = map[string]interface{}{"$exists": true}
|
|
query["v_baseinfo.purchasinglist"] = map[string]interface{}{"$exists": true}
|
|
- info, _ := util.Mgo.Find(sourceinfo, query, `{"_id": 1}`, `{"v_baseinfo": 1, "b_isEff": 1, "v_checkinfo": 1, "v_taginfo": 1}`, false, -1, -1)
|
|
|
|
|
|
+ info, _ := util.Mgo.Find(util.DATACOLLNAME, query, `{"_id": 1}`, `{"v_baseinfo": 1, "b_isEff": 1, "v_checkinfo": 1, "v_taginfo": 1}`, false, -1, -1)
|
|
var updateArr [][]map[string]interface{}
|
|
var updateArr [][]map[string]interface{}
|
|
for _, m := range *info {
|
|
for _, m := range *info {
|
|
baseinfo := m["v_baseinfo"].(map[string]interface{})
|
|
baseinfo := m["v_baseinfo"].(map[string]interface{})
|
|
@@ -2561,12 +2550,12 @@ func (f *Front) CheckDataPurchase() {
|
|
}
|
|
}
|
|
if len(updateArr) > 500 {
|
|
if len(updateArr) > 500 {
|
|
tmps := updateArr
|
|
tmps := updateArr
|
|
- util.Mgo.UpdateBulk(sourceinfo, tmps...)
|
|
|
|
|
|
+ util.Mgo.UpdateBulk(util.DATACOLLNAME, tmps...)
|
|
updateArr = [][]map[string]interface{}{}
|
|
updateArr = [][]map[string]interface{}{}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if len(updateArr) > 0 {
|
|
if len(updateArr) > 0 {
|
|
- util.Mgo.UpSertBulk(sourceinfo, updateArr...)
|
|
|
|
|
|
+ util.Mgo.UpSertBulk(util.DATACOLLNAME, updateArr...)
|
|
}
|
|
}
|
|
f.ServeJson(map[string]interface{}{"success": true, "msg": ""})
|
|
f.ServeJson(map[string]interface{}{"success": true, "msg": ""})
|
|
}
|
|
}
|