|
|
|
@ -397,6 +397,23 @@ class EcYearsController < ApplicationController
|
|
|
|
|
new_eto.attributes = pre_eto.attributes.dup.except("id", "ec_year_id")
|
|
|
|
|
new_eto.ec_year_id = ec_year.id
|
|
|
|
|
new_eto.save!
|
|
|
|
|
|
|
|
|
|
# 复制 "毕业要去 vs 培养目标"
|
|
|
|
|
pre_ervsos = EcRequirementVsObjective.where(:ec_training_objective_id => pre_eto.id)
|
|
|
|
|
pre_ervsos.each do |ervso|
|
|
|
|
|
new_ervso = EcRequirementVsObjective.new
|
|
|
|
|
new_ervso.attributes = ervso.attributes.dup.except("id", "ec_training_objective_id", "ec_graduation_requirement_id")
|
|
|
|
|
new_ervso.ec_training_objective_id = new_eto.id
|
|
|
|
|
new_egr_id = -1
|
|
|
|
|
egr_record.each do |egr_id|
|
|
|
|
|
if egr_id[0] == ervso.id
|
|
|
|
|
new_egr_id = egr_id[1]
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
raise("找不对应的毕业要求") if new_egr_id == -1
|
|
|
|
|
new_ervso.ec_graduation_requirement_id = new_egr_id
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 复制 "培养目标分项"
|
|
|
|
|
pre_eto.ec_training_subitems.try(:each) do |pre_ets|
|
|
|
|
|
new_ets = EcTrainingSubitem.new
|
|
|
|
|