|
|
@ -132,6 +132,8 @@ class GraduationTasksController < ApplicationController
|
|
|
|
tip_exception(403, "无权限操作")
|
|
|
|
tip_exception(403, "无权限操作")
|
|
|
|
elsif complete_works == 0
|
|
|
|
elsif complete_works == 0
|
|
|
|
normal_status(-1,"暂无用户提交")
|
|
|
|
normal_status(-1,"暂无用户提交")
|
|
|
|
|
|
|
|
elsif params[:export].present? && params[:export]
|
|
|
|
|
|
|
|
normal_status(0,"正在下载中")
|
|
|
|
else
|
|
|
|
else
|
|
|
|
respond_to do |format|
|
|
|
|
respond_to do |format|
|
|
|
|
format.xlsx{
|
|
|
|
format.xlsx{
|
|
|
@ -148,13 +150,18 @@ class GraduationTasksController < ApplicationController
|
|
|
|
zip_works = @work_excel.where("work_status > 0")
|
|
|
|
zip_works = @work_excel.where("work_status > 0")
|
|
|
|
status = checkfileSize(zip_works)
|
|
|
|
status = checkfileSize(zip_works)
|
|
|
|
if status == 0
|
|
|
|
if status == 0
|
|
|
|
|
|
|
|
if params[:export].present? && params[:export]
|
|
|
|
|
|
|
|
normal_status(0,"正在下载中")
|
|
|
|
|
|
|
|
else
|
|
|
|
respond_to do |format|
|
|
|
|
respond_to do |format|
|
|
|
|
format.zip{
|
|
|
|
format.zip{
|
|
|
|
|
|
|
|
set_export_cookies
|
|
|
|
zipfile = zip_homework_common @task, zip_works
|
|
|
|
zipfile = zip_homework_common @task, zip_works
|
|
|
|
file = decode64(zipfile[0][:base64file])
|
|
|
|
file = decode64(zipfile[0][:base64file])
|
|
|
|
send_file "#{OUTPUT_FOLDER}/#{file}", filename: filename_for_content_disposition(file), type: 'application/zip'
|
|
|
|
send_file "#{OUTPUT_FOLDER}/#{file}", filename: filename_for_content_disposition(file), type: 'application/zip'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
else
|
|
|
|
else
|
|
|
|
normal_status(status,status == -2 ? "500M" : "无附件可下载")
|
|
|
|
normal_status(status,status == -2 ? "500M" : "无附件可下载")
|
|
|
|
end
|
|
|
|
end
|
|
|
|