Browse Source

Bugfix Übernahme SPO-Version von COSTAGE zu SOS #18

master
Daniel Quathamer 3 months ago
parent
commit
34c626a5ad
  1. 4
      src-modules/module/costage/conf/costage.xml
  2. 41
      src-modules/module/costage/hilfstabellen/costage_st_pruef_aggr_fuellen.sql
  3. 12
      src-modules/module/costage/hilfstabellen/costage_st_studien_aggr_fuellen.sql
  4. 45
      src-modules/module/costage/rohdaten_sos/sos_costage_unload.xml

4
src-modules/module/costage/conf/costage.xml

@ -640,6 +640,10 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[CO]" /> @@ -640,6 +640,10 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[CO]" />
<column name="leistungsdatum_msg" type ="DATE" size ="7" default ="" notnull ="false" description="Prüfungsdatum MSG"/>
<column name="semester_msg" type ="INTEGER" size ="8" default ="" notnull ="false" description="Semester MSG" />
<column name="summe" type ="INTEGER" size ="2" default ="" notnull ="false" description="Summe" />
<column name="po_stp_stp_version_kb" type ="CHAR" size ="10" default ="" notnull ="false" description="SPO-Version" >
<sourcefield table="costage_st_studien_spoversionen" name="po_stp_stp_version_kb" sourcesystem="co" />
<comment>Lookup via: st_studium_nr - costage_st_studien_spoversionen.st_studium_nr, hierbei die jeweils letzte (max(gueltig_ab) </comment>
</column>
</columns>
<indexes>
<index name="ix_costage_st_pruef_aggr1" unique="false">

41
src-modules/module/costage/hilfstabellen/costage_st_pruef_aggr_fuellen.sql

@ -57,7 +57,8 @@ null::integer as pnr, @@ -57,7 +57,8 @@ null::integer as pnr,
null::integer as leistung_nr_msg,
null::integer as st_studiengang_nr_msg,
null::date as leistungsdatum_msg,
null::integer as semester_msg
null::integer as semester_msg,
null::char(10) as po_stp_stp_version_kb
into temp tmp_pruef
FROM costage_st_semester E, costage_leistungen_typen T, costage_leistungen L, costage_st_studierendenstammdaten S
where E.semester_id=L.veranstaltung_semester
@ -149,6 +150,15 @@ from costage_st_studien S @@ -149,6 +150,15 @@ from costage_st_studien S
where S.st_studium_nr=tmp_pruef.st_studium_nr
and S.st_studstamm_nr=tmp_pruef.st_studstamm_nr
;
--Fachsemester bei TSAB aus Sem. des Prüfungsdatums holen:
update tmp_pruef set
fachsemester = S.fachsemester
from costage_st_studien_aggr S
where S.semester=tmp_pruef.semester
and S.st_studium_nr=tmp_pruef.st_studium_nr
and S.matrikelnummer=tmp_pruef.matrikelnummer
and tmp_pruef.leistungsdetailtyp_kb='TSAB'
;
--Prüfung kann nach letztem eingeschr. Semester sein, daher zuerst letztes Sem. ermitteln:
select S.st_studium_nr,
@ -168,11 +178,12 @@ group by 1,2 @@ -168,11 +178,12 @@ group by 1,2
--Dann Studium vom letzten Semester in den Prüfungs-Datensatz schreiben:
update tmp_pruef set
st_studienstatus_nr=S.st_studienstatus_nr,
fachsemester = S.fachsemester,
--fachsemester = S.fachsemester, --wird oben ermittelt, ab 0.6 nicht mehr aus letztem Studiums-Semester
studiengang_nr=S.studiengang_nr,
fach_nr=S.fach_nr,
unikey=S.unikey,
st_studiengang_nr_msg=S.st_studiengang_nr_msg
st_studiengang_nr_msg=S.st_studiengang_nr_msg,
po_stp_stp_version_kb=S.po_stp_stp_version_kb
from tmp_max_sem M, costage_st_studien_aggr S
where S.matrikelnummer=M.matrikelnummer
and S.st_studium_nr=M.st_studium_nr
@ -213,6 +224,24 @@ leistungsdatum_msg=leistungsdatum, @@ -213,6 +224,24 @@ leistungsdatum_msg=leistungsdatum,
semester_msg=semester
where tmp_pruef.leistungsdetailtyp_kb !='TSAB'
;
--Fachsemester bei MSG gibt es in CO nicht. Daher die Regel:
--die Fachsemesterzahl sollte die höchste FS-Zahl aus allen TSG enthalten:
select matrikelnummer,st_studiengang_nr_msg,max(semester) as semester_max,max(fachsemester) as fachsem_max
into temp tmp_fachsem_msg
from tmp_pruef
where leistungsdetailtyp_kb='TSAB'
and st_studiengang_nr_msg is not null
group by 1,2;
update tmp_pruef set fachsemester=T.fachsem_max
from tmp_fachsem_msg T
where T.matrikelnummer=tmp_pruef.matrikelnummer
and T.st_studiengang_nr_msg=tmp_pruef.st_studiengang_nr
and T.semester_max <=tmp_pruef.semester
and tmp_pruef.leistungsdetailtyp_kb='BAKN'
;
drop table tmp_fachsem_msg;
--unikey setzen, wenn noch nicht vorhanden (z.B. bei MSG):
update tmp_pruef set unikey=K.unikey
@ -222,6 +251,8 @@ and K.st_skz_nr=G.st_skz_nr @@ -222,6 +251,8 @@ and K.st_skz_nr=G.st_skz_nr
and tmp_pruef.unikey is null
;
delete from costage_st_pruef_aggr
where semester >= ${beginn_semester};
@ -243,6 +274,7 @@ insert into costage_st_pruef_aggr(st_studium_nr, @@ -243,6 +274,7 @@ insert into costage_st_pruef_aggr(st_studium_nr,
pnr,
abschnitt,
stp_sp_nr,
po_stp_stp_version_kb,
note,
credits,
leistungsdatum,
@ -272,6 +304,7 @@ select @@ -272,6 +304,7 @@ select
pnr,
abschnitt,
stp_sp_nr,
po_stp_stp_version_kb,
case when pv_notenskala_typ_kb in ('DE1','DE2','DE3','DE4','DE5','DE6','DE7') or pv_notenskala_typ_kb is null then note_zahl else null::float end as note,
credits,
leistungsdatum,
@ -283,7 +316,7 @@ select @@ -283,7 +316,7 @@ select
semester_msg,
count(*)
from tmp_pruef
group by 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27;
group by 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28;
drop table tmp_pruef;
drop table tmp_pruef2;

12
src-modules/module/costage/hilfstabellen/costage_st_studien_aggr_fuellen.sql

@ -426,6 +426,7 @@ null::timestamp as beginn_datum, @@ -426,6 +426,7 @@ null::timestamp as beginn_datum,
null::timestamp AS gueltig_ab,
null::integer as st_studienstatus_nr,
null::integer as primaerflag_studien_msg,
null::integer as st_studium_nr_msg,
max(T.semester) as letztes_tsg_semester,
max(T.fachsemester) as fachsemester,
max(T.praxissemester) as praxissemester,
@ -435,7 +436,7 @@ from tmp_studien_msg_tsg_fehlend F, tmp_studien_tsg T @@ -435,7 +436,7 @@ from tmp_studien_msg_tsg_fehlend F, tmp_studien_tsg T
where F.st_studstamm_nr=T.st_studstamm_nr
and F.st_studiengang_nr_tsg=T.st_studiengang_nr
and T.semester=F.endsemester_tsg
group by 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,23,24,25,26,27,28,29 ,30 ,31,32 ,33 ,34,35,36,37
group by 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,23,24,25,26,27,28,29 ,30 ,31,32 ,33 ,34,35,36,37,38
;
update tmp_studien_msg_tsg_fehlend2 set
@ -445,7 +446,8 @@ abm_art_s=S.abm_art_s, @@ -445,7 +446,8 @@ abm_art_s=S.abm_art_s,
abm_art_s_msg=S.abm_art_s_msg,
beginn_datum =S.beginn_datum,
gueltig_ab=S.gueltig_ab,
st_studienstatus_nr=S.st_studienstatus_nr
st_studienstatus_nr=S.st_studienstatus_nr,
st_studium_nr_msg=S.st_studium_nr_msg
from tmp_studien_tsg S
where S.st_studiengang_nr=tmp_studien_msg_tsg_fehlend2.st_studiengang_nr_tsg
and S.st_studstamm_nr=tmp_studien_msg_tsg_fehlend2.st_studstamm_nr
@ -503,7 +505,8 @@ praxissemester, @@ -503,7 +505,8 @@ praxissemester,
klinsem,
studienfach_sortierung,
letztes_tsg_semester,
primaerflag_studien_msg
primaerflag_studien_msg,
st_studium_nr_msg
)
select distinct semester,
semester_anfang,
@ -546,7 +549,8 @@ praxissemester, @@ -546,7 +549,8 @@ praxissemester,
klinsem,
studienfach_sortierung,
letztes_tsg_semester,
primaerflag_studien_msg
primaerflag_studien_msg,
st_studium_nr_msg
from tmp_studien_msg_tsg_fehlend2 F, costage_st_studiengaenge G
where G.st_studiengang_nr=F.st_studiengang_nr_msg
;

45
src-modules/module/costage/rohdaten_sos/sos_costage_unload.xml

@ -292,18 +292,18 @@ P.studiengang_nr, @@ -292,18 +292,18 @@ P.studiengang_nr,
P.fach_nr,
G.abschluss,
P.semester,
P.leistungsdatum,
(case when leistungsdetailtyp_kb!='TSAB' then P.leistungsdatum else null::date end),
G.skz_key as stg,
null::integer as vert,
null::integer as schwp,
string_not_null(G.fachkennzeichen),
round(P.note::decimal(15,4),2) as note,
(case when leistungsdetailtyp_kb!='TSAB' then round(P.note::decimal(15,4),2) else null::decimal end) as note,
null::integer as vken1,
null::char(7), --pruefungsamt_nr
P.abschnitt as pnr,
val(G.pversion),
P.leistungsstatus_map_kb as pstatus,
P.fachsemester ,
P.po_stp_stp_version_kb as pversion,
(case when leistungsdetailtyp_kb!='TSAB' then P.leistungsstatus_map_kb else null::char(10) end) as pstatus,
(case when leistungsdetailtyp_kb!='TSAB' then P.fachsemester else null::integer end) as fachsemester,
P.leistungsdetailtyp_kb as part,
P.leistung_nr,
null::integer as pversuch,
@ -336,11 +336,11 @@ null::char(1) as ut_top_k_elementtype_id, @@ -336,11 +336,11 @@ null::char(1) as ut_top_k_elementtype_id,
null::char(1) as child_ut_top_unit_id,
null::char(1) as child_ut_top_unit_stat,
null::char(1) as k_unit_purpose_id,
null::char(1) as sem_der_pruefung_exa,
null::char(1) as d_abg_pruefung_exa,
null::char(1) as pstatus_tsg,
null::char(1) as note_tsg,
null::char(1) as fach_sem_zahl_tsg
(case when leistungsdetailtyp_kb='TSAB' then semester else null::integer end) as sem_der_pruefung_exa,
(case when leistungsdetailtyp_kb='TSAB' then leistungsdatum else null::date end) as d_abg_pruefung_exa,
(case when leistungsdetailtyp_kb='TSAB' then leistungsstatus_map_kb else null::char(10) end) as pstatus_tsg,
(case when leistungsdetailtyp_kb='TSAB' then note else null::float end) as note_tsg,
(case when leistungsdetailtyp_kb='TSAB' then fachsemester else null::integer end) as fach_sem_zahl_tsg
FROM costage_st_pruef_aggr P, costage_st_studiengaenge G
where G.st_studiengang_nr=P.st_studiengang_nr
AND P.semester >= $start_pruef_sem
@ -880,7 +880,30 @@ null as lid, @@ -880,7 +880,30 @@ null as lid,
null as parent_lid,
null as sortorder
FROM xdummy
;
union
SELECT
9002,
-1,
leistungsdetailtyp_kb as apnr,
substring(name_de from 1 for 10),--ktxt,
substring(name_de from 1 for 255) as dtxt,
substring(name_de from 1 for 255) as ltxt,
null::char(10) as astat,
null::char(10) as parent,
leistungsdetailtyp_kb,--sortc1 wird später uniquename
' ',
null as sprache,
null::date as gueltig_von,
null::date as gueltig_bis,
leistungsdetailtyp_kb::varchar(255), --sourcesystem_id
' ', --hiskey_id
'A', --struktur_c
null as lid,
null as parent_lid,
null as sortorder
FROM costage_leistungen_detail_typen
WHERE leistungsdetailtyp_kb is not null
]]>
</extraction-sql>

Loading…
Cancel
Save