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

Adjustreact
cxt 5 years ago
commit 73658397d2

@ -23,23 +23,23 @@ class ApplicationController < ActionController::Base
# 所有请求必须合法签名 # 所有请求必须合法签名
def check_sign def check_sign
# if !Rails.env.development? if !Rails.env.development?
# Rails.logger.info("66666 #{params}") Rails.logger.info("66666 #{params}")
# # suffix = request.url.split(".").last.split("?").first # suffix = request.url.split(".").last.split("?").first
# # suffix_arr = ["xls", "xlsx", "pdf", "zip"] # excel文件先注释 # suffix_arr = ["xls", "xlsx", "pdf", "zip"] # excel文件先注释
# # unless suffix_arr.include?(suffix) # unless suffix_arr.include?(suffix)
# if params[:client_key].present? if params[:client_key].present?
# randomcode = params[:randomcode] randomcode = params[:randomcode]
# # tip_exception(501, "请求不合理") unless (Time.now.to_i - randomcode.to_i).between?(0,5) # tip_exception(501, "请求不合理") unless (Time.now.to_i - randomcode.to_i).between?(0,5)
#
# sign = Digest::MD5.hexdigest("#{OPENKEY}#{randomcode}") sign = Digest::MD5.hexdigest("#{OPENKEY}#{randomcode}")
# Rails.logger.info("2222 #{sign}") Rails.logger.info("2222 #{sign}")
# tip_exception(501, "请求不合理") if sign != params[:client_key] tip_exception(501, "请求不合理") if sign != params[:client_key]
# else else
# tip_exception(501, "请求不合理") tip_exception(501, "请求不合理")
# end end
# # end # end
# end end
end end
# 全局配置参数 # 全局配置参数

@ -9,8 +9,8 @@ namespace :subjects do
buffer_size = 0 buffer_size = 0
column_value = "subject_id, study_count, course_study_count, initiative_study, passed_count, course_used_count, " + column_value = "subject_id, study_count, course_study_count, initiative_study, passed_count, course_used_count, " +
"school_used_count, created_at, updated_at" "school_used_count, created_at, updated_at"
subjects.find_in_batches(batch_size: 50) do |s, index| subjects.find_in_batches(batch_size: 50) do |s|
Parallel.each_with_index(s, in_processes: 4) do |subject| Parallel.each(s, in_processes: 4) do |subject|
puts("---------------------data_statistic: #{subject.id}") puts("---------------------data_statistic: #{subject.id}")
Rails.logger.info("---------------------data_statistic: #{subject.id}") Rails.logger.info("---------------------data_statistic: #{subject.id}")
data = Subjects::DataStatisticService.new(subject) data = Subjects::DataStatisticService.new(subject)
@ -23,7 +23,8 @@ namespace :subjects do
"#{data.passed_count}, #{data.course_used_count}, #{data.school_used_count}, " + "#{data.passed_count}, #{data.course_used_count}, #{data.school_used_count}, " +
"'#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}', '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}')") "'#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}', '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}')")
buffer_size += 1 buffer_size += 1
if buffer_size == 1000 || subjects.count == (index+1) puts "buffer_size: #{buffer_size}; subject: #{subject == s.last}; index:#{index+1}"
if buffer_size == 1000 || subject == s.last
sql = "REPLACE INTO subject_records(#{column_value}) VALUES #{str}" sql = "REPLACE INTO subject_records(#{column_value}) VALUES #{str}"
puts sql puts sql
ActiveRecord::Base.connection.execute sql ActiveRecord::Base.connection.execute sql

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 66 KiB

@ -493,6 +493,9 @@ const options = [{
children: [{ children: [{
value: "兰州", value: "兰州",
label: '兰州' label: '兰州'
},{
value: "嘉峪关",
label: '嘉峪关'
},{ },{
value: '白银', value: '白银',
label: '白银' label: '白银'

@ -247,7 +247,7 @@ const App = (props) => {
<section className="static_section_header"> <section className="static_section_header">
<div className="header_title"> <div className="header_title">
<span className="title-p">学习统计</span> <span className="title-p">学习统计</span>
<span className="title-sub">Android综合实训之物联网移动应用</span> <span className="title-sub"></span>
</div> </div>
<div className="header-number header-flex"> <div className="header-number header-flex">
<StaticNumberAndTxt <StaticNumberAndTxt

@ -30,13 +30,13 @@
font-weight: bold; font-weight: bold;
&::before{ &::before{
position: absolute; //position: absolute;
content: ''; //content: '';
border-left: 1px solid rgba(192,196,204,1); //border-left: 1px solid rgba(192,196,204,1);
right: -10px; //right: -10px;
top: 2px; //top: 2px;
bottom: 0px; //bottom: 0px;
margin-left: 10px; //margin-left: 10px;
} }
} }
.title-sub{ .title-sub{

Loading…
Cancel
Save