diff --git a/README.md b/README.md index 8f8b406..193ad85 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -# mobility +# Mobilitäten aus MoveOn laden diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..c79a968 --- /dev/null +++ b/build.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src-modules/module/mobility/conf/excludes.txt b/src-modules/module/mobility/conf/excludes.txt new file mode 100644 index 0000000..a69386d --- /dev/null +++ b/src-modules/module/mobility/conf/excludes.txt @@ -0,0 +1,9 @@ +preparation.sql +finalize.sql +rohdaten/*.err +*.log +*.err +rohdaten/unl/* +masken/ids +conf/customize.sql +conf/*.log diff --git a/src-modules/module/mobility/conf/includes.txt b/src-modules/module/mobility/conf/includes.txt new file mode 100644 index 0000000..431e226 --- /dev/null +++ b/src-modules/module/mobility/conf/includes.txt @@ -0,0 +1,2 @@ +WEB-INF/conf/edustore/db/bin/SQL_ENV_mobility.sam +doku/mobility_modul/mobility.html diff --git a/src-modules/module/mobility/conf/mobility.xml b/src-modules/module/mobility/conf/mobility.xml new file mode 100644 index 0000000..04c13fb --- /dev/null +++ b/src-modules/module/mobility/conf/mobility.xml @@ -0,0 +1,256 @@ + + +Auswertungen aus MoveOn + + + + + + + + + + + + + + + + + + superx + superx + mobility_person + id + 1 + pk_mobility_person + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + Staat des 1. Auslandsaufenthaltes + + Dauer des 1. Aufenthaltes in Monaten + + Art des 1. Auslandsaufenthaltes + + Art des Mobilitätsprogramms + + + + + + + + + superx + superx + mobility_stay + id + 1 + pk_mobility_stay + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +@@mobility_admin_beschreibung@@ @@@mobility_doku_admin_url@@@ + + + + +$MOBILITY_PFAD/maskenD. Quathamer23.5.2007INFORMIX +$MOBILITY_PFAD/maskenD. Quathamer23.5.2007POSTGRES + + +$MOBILITY_PFAD/maskenD. Quathamer23.5.2007INFORMIX +$MOBILITY_PFAD/maskenD. Quathamer23.5.2007POSTGRES + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src-modules/module/mobility/datentabellen/trans_mobility_person.sql b/src-modules/module/mobility/datentabellen/trans_mobility_person.sql new file mode 100644 index 0000000..b00ecc8 --- /dev/null +++ b/src-modules/module/mobility/datentabellen/trans_mobility_person.sql @@ -0,0 +1,63 @@ + +--Regeln zum Matching zwischen MoveOn Name zu SuperX/CO Name/Matrikelnr (Protokoll Besprechung Fr. Sommer, Hr. Brüggemann und DQ 20.10.2017): + +--1. Wenn über Vorname/Nachname/Geburtsdatum eine Matrikelnummer in CO gefunden wird, +-- wird diese mit höchster Priorität genommen +--2. Wenn über Vorname/Nachname/Geburtsdatum mehrere Matrikelnummern in CO gefunden werden, +-- wird diejenige aus dem (zeitlich gesehen) letzten Studiengang mit höchster Priorität genommen +--3. Wenn nach obigen Regeln eine Matrikelnr. in CO nicht gefunden werden kann, +-- es aber in MoveOn eine Matrikelnr. gibt, wird zunächst geprüft ob in MoveOn das gleiche Geburtsdatum gespeichert ist +-- wie in CO. Wenn ja, wird die Matrikelnr. von MoveOn übernommen + +delete from mobility_person +where id in (select id from mobility_person_neu); + + + +insert into mobility_person(first_name, + surname, + date_of_birth, + matriculation_id, + id) + SELECT first_name, + surname, + date_of_birth, + case when length(matriculation_id) < 11 then val(matriculation_id) + else null::integer end as matriculation_id, + id +FROM mobility_person_neu + ; + + +--dann matrikelnr zuweisen: +--Regel 1+2: +update mobility_person set matrikel_nr =( +select max(S.matrikel_nr) +from sos_sos S, sos_stud_d D +where S.matrikel_nr=D.matrikel_nr +and D.nachname=mobility_person.surname +and D.vorname=mobility_person.first_name +and S.d_geburt=mobility_person.date_of_birth +and today() between S.gueltig_von and S.gueltig_bis +) +where matrikel_nr is null +and date_of_birth is not null; + +--Regel 3: +update mobility_person set matrikel_nr =matriculation_id +where matrikel_nr is null +and matriculation_id is not null +-- and 0< (select count(*) +-- from sos_sos S, sos_stud_d D +-- where S.matrikel_nr=D.matrikel_nr +-- and S.matrikel_nr=mobility_person.matriculation_id +-- and S.d_geburt=mobility_person.date_of_birth +-- and today() between S.gueltig_von and S.gueltig_bis +-- ) +; + + +select 'Alle',count(*) from mobility_person +union select 'Mit Matrikelnr.',count(*) from mobility_person +where matrikel_nr is not null; + diff --git a/src-modules/module/mobility/datentabellen/trans_mobility_stay.sql b/src-modules/module/mobility/datentabellen/trans_mobility_stay.sql new file mode 100644 index 0000000..376427b --- /dev/null +++ b/src-modules/module/mobility/datentabellen/trans_mobility_stay.sql @@ -0,0 +1,137 @@ + +--freemarker template + +delete from mobility_stay +where id in (select M.id from mobility_stay_neu M); + +insert into mobility_stay(name, +person_id, + id, + academic_period_start_id, + academic_period_end_id, + is_active, + ects_credits, + country_id, + country_name_deu, + duration_months, + stay_type, + stay_type_id, + framework, + framework_id, + is_self_funded, + scholarship_deu, + is_guest, + is_academic_services, + direction_id, + stay_nr) + select name, + person_id, + id, + academic_period_start_id, + academic_period_end_id, + is_active, + ects_credits, + country_id, + country_name_deu, + duration_months, + stay_type, + stay_type_id, + framework, + framework_id, + is_self_funded, + scholarship_deu, + is_guest, + is_academic_services, + direction_id, + stay_nr + from mobility_stay_neu; +--WS z.B. 20125 nach 20122 +update mobility_stay set academic_period_start_id=academic_period_start_id-3 +where substring('' || academic_period_start_id from 5 for 1)='5'; +--SoSe z.B. 20140 nach 20141 +update mobility_stay set academic_period_start_id=academic_period_start_id+1 +where substring('' || academic_period_start_id from 5 for 1)='0'; + +update mobility_stay set academic_period_end_id=academic_period_end_id-3 +where substring('' || academic_period_end_id from 5 for 1)='5'; +--SoSe z.B. 20140 nach 20141 +update mobility_stay set academic_period_end_id=academic_period_end_id+1 +where substring('' || academic_period_end_id from 5 for 1)='0'; +--Country +update mobility_stay set st_abr_country_astat =(select min(val(C.astat)) +from cifx C +where mobility_stay.country_name_deu=C.druck +and C.key=12 +) +where id in (select M.id from mobility_stay_neu M); +--Ausnahmefälle Staaten +update mobility_stay set st_abr_country_astat=479 +where country_name_deu='China (VR)' +and st_abr_country_astat is null +; +update mobility_stay set st_abr_country_astat=434 +where country_name_deu='Korea, Dem. Volksrep.' +and st_abr_country_astat is null; +update mobility_stay set st_abr_country_astat=368 +where country_name_deu='USA' +and st_abr_country_astat is null +; +update mobility_stay set st_abr_country_astat=245 +where country_name_deu='Kongo, Dem. Republik' +and st_abr_country_astat is null +; +update mobility_stay set st_abr_country_astat=160 +where country_name_deu='Russland' +and st_abr_country_astat is null; + +update mobility_stay set st_abr_country_astat=431 +where country_name_deu='Sri Lanka' +and st_abr_country_astat is null; + +update mobility_stay set st_abr_country_astat=449 +where country_name_deu='Laos' +and st_abr_country_astat is null; + +update mobility_stay set st_abr_country_astat=164 +where country_name_deu='Tschechien' +and st_abr_country_astat is null; + +--Prüfselect: +-- SELECT country_id,country_name_deu,count(*) +-- FROM mobility_stay +-- where country_name_deu is not null +-- and st_abr_country_astat is null +-- group by 1,2 + -- ; + +--st_abr_month +update mobility_stay set st_abr_month=duration_months; +--st_abr_type +--stay.stay_type_id=1 -01 = Studium +--stay.stay_type_id=2 -02 = Praktikum +--stay.stay_type_id ungleich 1 oder 2 -03 +update mobility_stay set st_abr_type='0' || stay_type_id +where stay_type_id in ('1','2') +and id in (select M.id from mobility_stay_neu M); +update mobility_stay set st_abr_type='01' +where stay_type_id ='1, 2' +and id in (select M.id from mobility_stay_neu M); + + +update mobility_stay set st_abr_type='03' +where (stay_type_id not in ('1','2','1, 2') or stay_type_id is null) +and id in (select M.id from mobility_stay_neu M); + +--st_abr_program +update mobility_stay set st_abr_program='01' +where framework ilike '%erasmus%' +and id in (select M.id from mobility_stay_neu M); +update mobility_stay set st_abr_program='02' +where st_abr_program is null +and id in (select M.id from mobility_stay_neu M); + +update mobility_stay set st_abr_country_astat='0' || trim(st_abr_country_astat) +where length(trim(st_abr_country_astat))<3; +update mobility_stay set st_abr_country_astat='0' || trim(st_abr_country_astat) +where length(trim(st_abr_country_astat))<3; + diff --git a/src-modules/module/mobility/etl/read_moveon/apiload.kjb b/src-modules/module/mobility/etl/read_moveon/apiload.kjb new file mode 100644 index 0000000..d0e1496 --- /dev/null +++ b/src-modules/module/mobility/etl/read_moveon/apiload.kjb @@ -0,0 +1,363 @@ + + + apiload + + + + 0 + / + - + 2017/11/07 23:02:08.210 + - + 2017/11/07 23:02:08.210 + + + dataObject + + + + + page + + + + + rows + + + + + + + + + + + + + + + ID_JOB + Y + ID_JOB + + + CHANNEL_ID + Y + CHANNEL_ID + + + JOBNAME + Y + JOBNAME + + + STATUS + Y + STATUS + + + LINES_READ + Y + LINES_READ + + + LINES_WRITTEN + Y + LINES_WRITTEN + + + LINES_UPDATED + Y + LINES_UPDATED + + + LINES_INPUT + Y + LINES_INPUT + + + LINES_OUTPUT + Y + LINES_OUTPUT + + + LINES_REJECTED + Y + LINES_REJECTED + + + ERRORS + Y + ERRORS + + + STARTDATE + Y + STARTDATE + + + ENDDATE + Y + ENDDATE + + + LOGDATE + Y + LOGDATE + + + DEPDATE + Y + DEPDATE + + + REPLAYDATE + Y + REPLAYDATE + + + LOG_FIELD + Y + LOG_FIELD + + + EXECUTING_SERVER + N + EXECUTING_SERVER + + + EXECUTING_USER + N + EXECUTING_USER + + + START_JOB_ENTRY + N + START_JOB_ENTRY + + + CLIENT + N + CLIENT + + + + + +
+ + + ID_BATCH + Y + ID_BATCH + + + CHANNEL_ID + Y + CHANNEL_ID + + + LOG_DATE + Y + LOG_DATE + + + JOBNAME + Y + TRANSNAME + + + JOBENTRYNAME + Y + STEPNAME + + + LINES_READ + Y + LINES_READ + + + LINES_WRITTEN + Y + LINES_WRITTEN + + + LINES_UPDATED + Y + LINES_UPDATED + + + LINES_INPUT + Y + LINES_INPUT + + + LINES_OUTPUT + Y + LINES_OUTPUT + + + LINES_REJECTED + Y + LINES_REJECTED + + + ERRORS + Y + ERRORS + + + RESULT + Y + RESULT + + + NR_RESULT_ROWS + Y + NR_RESULT_ROWS + + + NR_RESULT_FILES + Y + NR_RESULT_FILES + + + LOG_FIELD + N + LOG_FIELD + + + COPY_NR + N + COPY_NR + + + + + +
+ + + ID_BATCH + Y + ID_BATCH + + + CHANNEL_ID + Y + CHANNEL_ID + + + LOG_DATE + Y + LOG_DATE + + + LOGGING_OBJECT_TYPE + Y + LOGGING_OBJECT_TYPE + + + OBJECT_NAME + Y + OBJECT_NAME + + + OBJECT_COPY + Y + OBJECT_COPY + + + REPOSITORY_DIRECTORY + Y + REPOSITORY_DIRECTORY + + + FILENAME + Y + FILENAME + + + OBJECT_ID + Y + OBJECT_ID + + + OBJECT_REVISION + Y + OBJECT_REVISION + + + PARENT_CHANNEL_ID + Y + PARENT_CHANNEL_ID + + + ROOT_CHANNEL_ID + Y + ROOT_CHANNEL_ID + + + N + + + + START + + SPECIAL + Y + N + N + 0 + 0 + 60 + 12 + 0 + 1 + 1 + N + Y + 0 + 96 + 128 + + + php_it + + SHELL + /usr/bin/php + ${Internal.Job.Filename.Directory}/tmp + N + N + Y + ${Internal.Job.Filename.Directory}/tmp/mylog.log + N + + N + N + N +