|
|
@ -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,12 +150,17 @@ 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
|
|
|
|
respond_to do |format|
|
|
|
|
if params[:export].present? && params[:export]
|
|
|
|
format.zip{
|
|
|
|
normal_status(0,"正在下载中")
|
|
|
|
zipfile = zip_homework_common @task, zip_works
|
|
|
|
else
|
|
|
|
file = decode64(zipfile[0][:base64file])
|
|
|
|
respond_to do |format|
|
|
|
|
send_file "#{OUTPUT_FOLDER}/#{file}", filename: filename_for_content_disposition(file), type: 'application/zip'
|
|
|
|
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
|
|
|
|
end
|
|
|
|
else
|
|
|
|
else
|
|
|
|
normal_status(status,status == -2 ? "500M" : "无附件可下载")
|
|
|
|
normal_status(status,status == -2 ? "500M" : "无附件可下载")
|
|
|
|