From dffb2b13699f07d1ee45e09c9bb5083d3a69e8fc Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 16 May 2019 14:18:23 +0800 Subject: [PATCH 1/4] =?UTF-8?q?gem=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index a5bf637a..e6a27782 100644 --- a/Gemfile +++ b/Gemfile @@ -9,7 +9,7 @@ unless RUBY_PLATFORM =~ /w32/ gem 'wkhtmltopdf-binary' elsif RUBY_PLATFORM =~ /linux/ gem "rmagick", "~> 2.13.1" ## centos yum install ImageMagick-devel - gem 'pdfkit' + gem 'pdfkit', "~> 0.8.4.1" gem 'wkhtmltopdf-binary' gem 'rqrcode', '~> 0.10.1' gem 'rqrcode_png' From 5d7eaafb68d5ef06fa8fe39dfe374aa73aa247ad Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 16 May 2019 15:07:03 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E8=B7=AF=E7=94=B1=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/routes.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/routes.rb b/config/routes.rb index e52be2c8..74ac7698 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1103,7 +1103,9 @@ RedmineApp::Application.routes.draw do ## oauth相关 collection do match 'shixuns' + match 'subjects' match 'create_shixun_homework', :via => [:get,:post] + match 'create_subject_homework', :via => [:get,:post] post 'publish_shixun_homework' post 'next_step' post 'programing_test' From 4708e150badeee0c727a76fdd6c16cbacad9d98b Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 16 May 2019 15:14:15 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/zip_service.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/services/zip_service.rb b/app/services/zip_service.rb index b798e111..5ee8617f 100755 --- a/app/services/zip_service.rb +++ b/app/services/zip_service.rb @@ -188,6 +188,7 @@ module ZipService # file_name = "#{exercise.course_id}-#{exercise.exercise_name}-#{exercise_user.user.user_extensions.student_id}-#{exercise_user.user.show_real_name}" + ".pdf" # file_name = "#{Time.now.strftime("%Y%m%d%H%M%S").to_s}-#{exercise.course_id}-#{exercise.id}-#{exercise_user.user.user_extensions.student_id}" + ".pdf" file_name.gsub!(" ", "-") + file_name = filename_for_content_disposition(file_name) kit.to_file("#{OUTPUT_FOLDER}/#{file_name}") out_file = "#{OUTPUT_FOLDER}/#{file_name}" out_file @@ -200,6 +201,7 @@ module ZipService # file_name = "#{homework.course_id}-#{homework.name}-#{student_work.user.user_extensions.student_id}-#{student_work.user.show_real_name}" + ".pdf" # file_name = "#{Time.now.strftime("%Y%m%d%H%M%S").to_s}-#{homework.course_id}-#{homework.id}-#{student_work.user.user_extensions.student_id}" + ".pdf" file_name.gsub!(" ", "-") + file_name = filename_for_content_disposition(file_name) kit.to_file("#{OUTPUT_FOLDER}/#{file_name}") out_file = "#{OUTPUT_FOLDER}/#{file_name}" out_file From d522ca2eb24098232ac963796c7714d8544ac4c6 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 16 May 2019 15:18:31 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/zip_service.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/services/zip_service.rb b/app/services/zip_service.rb index 5ee8617f..72be23fd 100755 --- a/app/services/zip_service.rb +++ b/app/services/zip_service.rb @@ -201,7 +201,10 @@ module ZipService # file_name = "#{homework.course_id}-#{homework.name}-#{student_work.user.user_extensions.student_id}-#{student_work.user.show_real_name}" + ".pdf" # file_name = "#{Time.now.strftime("%Y%m%d%H%M%S").to_s}-#{homework.course_id}-#{homework.id}-#{student_work.user.user_extensions.student_id}" + ".pdf" file_name.gsub!(" ", "-") + Rails.logger.info("######################before_dispos_file_name: #{file_name}") + file_name = filename_for_content_disposition(file_name) + Rails.logger.info("######################after_dispos_file_name: #{file_name}") kit.to_file("#{OUTPUT_FOLDER}/#{file_name}") out_file = "#{OUTPUT_FOLDER}/#{file_name}" out_file