Fix experience missing rss2_id.
This commit is contained in:
parent
b78bd2a39d
commit
f235436e19
|
@ -237,10 +237,13 @@ module FguSyncPlugin
|
|||
if type.nil?
|
||||
type = ExperienceType.create(:title_translations => self.localize_data(dt["emp_type"]))
|
||||
end
|
||||
else
|
||||
type = nil
|
||||
end
|
||||
Experience.where(:rss2_id => nil, :organizationt_title=> dt["organization_title"], :job_title => dt["job_title"], :member_profile => mp, :experience_type => type).destroy # destroy old data
|
||||
exp = Experience.where(:rss2_id => rss2_id).first
|
||||
exp_data = {:rss2_id => rss2_id, :start_date => start_date, :end_date => end_date, :organizationt_title_translations => organization_title, :job_title_translations => job_title, :member_profile => mp, :experience_type => type}
|
||||
if exp.nil?
|
||||
if exp.nil? || rss2_id.blank?
|
||||
exp = Experience.create(exp_data)
|
||||
puts "Saving new Exp."
|
||||
else
|
||||
|
@ -796,14 +799,16 @@ module FguSyncPlugin
|
|||
"f_start" => "start_date",
|
||||
"f_end" => "end_date",
|
||||
"f_comp" => "organization_title",
|
||||
"f_empname" => "job_title"
|
||||
"f_empname" => "job_title",
|
||||
"rss_id" => "rss2_id"
|
||||
},
|
||||
'vrul_inemp' => {
|
||||
"f_start" => "start_date",
|
||||
"f_end" => "end_date",
|
||||
"f_unit" => "organization_title",
|
||||
"f_empname" => "job_title",
|
||||
"f_emptype" => "emp_type"
|
||||
"f_emptype" => "emp_type",
|
||||
"rss_id" => "rss2_id"
|
||||
},
|
||||
'dbo.v_rul_research_credential' => {
|
||||
"紀錄編號" => "rss2_id",
|
||||
|
@ -936,7 +941,10 @@ module FguSyncPlugin
|
|||
end
|
||||
|
||||
def self.query_db(table_name, filter_params={})
|
||||
order_fields = {} # true => order by first column with desc order
|
||||
order_fields = {
|
||||
'vrul_exp' => false,
|
||||
'vrul_inemp' => false
|
||||
} # true => order by first column with desc order
|
||||
rss_id_offsets = {}
|
||||
# rss_id_offsets = {
|
||||
# 'rsspublish' => 1073443
|
||||
|
@ -978,6 +986,8 @@ module FguSyncPlugin
|
|||
h.each do |k,v|
|
||||
if v.class == String
|
||||
h[k] = v.strip
|
||||
elsif v.class == BigDecimal
|
||||
h[k] = v.to_i
|
||||
end
|
||||
end
|
||||
tmp.each do |k,v|
|
||||
|
@ -1033,6 +1043,8 @@ module FguSyncPlugin
|
|||
h.each do |k,v|
|
||||
if v.class == String
|
||||
h[k] = v.strip
|
||||
elsif v.class == BigDecimal
|
||||
h[k] = v.to_i
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue