文档服务地址:http://47.92.0.57:3000/ 周报索引地址:http://47.92.0.57:3000/s/NruNXRYmV

Commit 8261e5a4 by 李景熙

修复审核进度

parent 4b6e24f3
......@@ -79,7 +79,7 @@ def set_result_id(userid, dataid, resultid):
else:
return True
# 获取某用户,某分片的标注进度
def get_total_num(sliceId):
try:
num = Relation.select().where(Relation.slice_id == sliceId, Relation.flag2 == 0, Relation.complete_time.is_null(False)).count()
......@@ -89,6 +89,14 @@ def get_total_num(sliceId):
return num
def get_completed_num(sliceId):
try:
num = Relation.select().where(Relation.slice_id == sliceId, Relation.flag2 == 1, Relation.complete_time.is_null(False)).count()
except:
return 0
else:
return num
# 获取某用户,某分片的标注进度
def get_flag_count(userId, sliceId):
try:
......@@ -133,7 +141,7 @@ def get_state(user_id, data_id):
# 获取某文件的标注者信息
def get_executors(data_id):
try:
find = Relation.select(Relation.user_id, Relation.flag2).where(Relation.data_id == data_id)
find = Relation.select(Relation.user_id).where(Relation.data_id == data_id)
index = 0
list = []
while index < len(find):
......@@ -141,8 +149,7 @@ def get_executors(data_id):
list.append(
{
'id': find[index].user_id,
'nickname': name,
'state': int(find[index].flag2)
'nickname': name
}
)
index += 1
......
......@@ -73,7 +73,6 @@ def delete_slice_by_task(task_id):
else:
return Result(1, "delete success", {})
def find_slice_by_check(task_id):
try:
find = Slice.select(Slice.task_id, Slice.slice_id, Slice.document_number, Slice.type, Slice.model_id, Slice.illustration).where(
......@@ -83,6 +82,7 @@ def find_slice_by_check(task_id):
list = []
while index < len(find):
total_num = Relation.get_total_num(find[index].slice_id)
completed_num = Relation.get_completed_num(find[index].slice_id)
if total_num != 0:
if find[index].type == '0':
t = "文本"
......@@ -99,6 +99,7 @@ def find_slice_by_check(task_id):
'fileNum': find[index].document_number,
'type': t,
'template': template,
'completedNum': completed_num,
'totalNum': total_num
}
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment