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