Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_course
cxt 5 years ago
commit 49ca3882f6

@ -208,9 +208,11 @@ class HomeworkCommonsController < ApplicationController
student_work_to_xlsx(@work_excel,@homework)
exercise_export_name = current_user.real_name + "_" + @course.name + "_" + @homework.name + "_" + Time.now.strftime('%Y%m%d_%H%M%S')
render xlsx: "#{exercise_export_name.strip.first(30)}",template: "homework_commons/works_list.xlsx.axlsx",locals:
render xlsx: "#{exercise_export_name.encode(Encoding.default_external,"UTF-8", :invalid => :replace, :undef => :replace, :replace => " ").strip.first(30)}",template: "homework_commons/works_list.xlsx.axlsx",locals:
{table_columns: @work_head_cells,task_users: @work_cells_column}
}
# .encode(Encoding.default_external, 'gb2312')
end
end
elsif params[:format] == "zip"

@ -10,9 +10,8 @@ class ZipsController < ApplicationController
service = BatchExportShixunReportService.new(@homework, @all_student_works)
filename = filename_for_content_disposition(service.filename)
Rails.logger.info("################___________file_name________________###########{filename}")
Rails.logger.info("################___________service.filename________________###########{service.filename}")
send_file service.zip, filename: filename.encode(Encoding.default_external, 'gb2312'), type: 'application/zip'
send_file service.zip, filename: filename, type: 'application/zip'
rescue BatchExportShixunReportService::Error => ex
normal_status(-1, ex.message)
end

@ -40,10 +40,17 @@ module ExportHelper
works.includes(user: :user_extension, student_works_scores: :user).each_with_index do |w, index|
w_user = w.user
w_1 = (index + 1)
w_2 = w_user.login
w_3 = w_user.real_name
w_3_1 = w_user.mail
w_4 = w_user.student_id.present? ? w_user.student_id : "--"
if w_user.present?
w_2 = w_user&.login
w_3 = w_user&.real_name
w_3_1 = w_user&.mail
w_4 = w_user.student_id.present? ? w_user.student_id : "--"
else
w_2 = "--"
w_3 = "--"
w_3_1 = "--"
w_4 = "--"
end
course_name = course.students.find_by(user_id: w.user_id).try(:course_group_name)
w_5 = course_name.present? ? course_name : "--"
#0 未提交, 1 按时提交, 2 延迟提交

Loading…
Cancel
Save