Browse Source

Die Generierung von TSG bei länger laufendem MSG ist implementiert #1

COStage_0.3_Release
Daniel Quathamer 3 years ago
parent
commit
bc8c3e0e45
  1. 6
      build.xml
  2. 4
      src-modules/module/costage/conf/costage.xml
  3. 170
      src-modules/module/costage/hilfstabellen/costage_st_studien_aggr_fuellen.sql
  4. 37
      src-modules/module/costage/rohdaten/costage_prepare_unlfiles.xsl
  5. 4
      src-modules/module/costage/rohdaten/costage_prepare_unlfiles_generator.x
  6. 3
      src-modules/module/costage/rohdaten/costage_unload.xml

6
build.xml

@ -46,6 +46,12 @@ ant -DMODULE_PATH=$COSTAGE_PFAD -DWEBAPP_DIR=$WEBAPP -DMODULE=costage dist
<property name="SUPERX_BASE" value="${WEBAPP}/WEB-INF" /> <property name="SUPERX_BASE" value="${WEBAPP}/WEB-INF" />
<fileset dir="${MODULE_PATH}/../../conf" includes="module_scripts_create_ant.xml" /> <fileset dir="${MODULE_PATH}/../../conf" includes="module_scripts_create_ant.xml" />
</subant> </subant>
<xslt in="${BASE_DIR}/src-modules/module/${MODULE}/rohdaten/${MODULE}_unload.xml" style="${BASE_DIR}/src-modules/module/${MODULE}/rohdaten/${MODULE}_prepare_unlfiles.xsl" out="${MODULE_PATH}/rohdaten/${MODULE}_prepare_unlfiles.x" force="true">
<outputproperty name="method" value="text" />
<param name="modulname" expression="${MODULE}" />
</xslt>
<chmod dir="${MODULE_PATH}/rohdaten" perm="ugo+x" includes="**/*.x" />
</target> </target>
<target name="dist" description="Create Download package"> <target name="dist" description="Create Download package">
<subant target="erzeuge_paket"> <subant target="erzeuge_paket">

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

@ -422,7 +422,9 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[CO]" />
<column name="matrikelnummer" type ="INTEGER" size ="8" default ="" notnull ="false" description="Matrikelnummer" /> <column name="matrikelnummer" type ="INTEGER" size ="8" default ="" notnull ="false" description="Matrikelnummer" />
<column name="st_studiengang_nr" type ="INTEGER" size ="8" default ="" notnull ="false" description="Studiengang (ID)" /> <column name="st_studiengang_nr" type ="INTEGER" size ="8" default ="" notnull ="false" description="Studiengang (ID)" />
<column name="st_studienstatus_nr" type ="INTEGER" size ="8" default ="" notnull ="false" description="Studienstatus (ID)" /> <column name="st_studienstatus_nr" type ="INTEGER" size ="8" default ="" notnull ="false" description="Studienstatus (ID)" />
<column name="statustyp" type ="CHAR" size ="10" default ="" notnull ="false" description="Studienstatus" /> <column name="statustyp" type ="CHAR" size ="10" default ="" notnull ="false" description="Studienstatus"><comment>ESG oder, bei TSG, der Status des MSG</comment></column>
<column name="statustyp_tsg" type ="CHAR" size ="10" default ="" notnull ="false" description="Studienstatus TSG" />
<column name="tsg_generated" type ="SMALLINT" size ="2" default ="0" notnull ="false" description="Automatisch generierter Datensatz" ><comment>Wenn TSG vor MSG beendet wird, werden TSG-Sätze generiert</comment></column>
<column name="hrst" type ="CHAR" size ="10" default ="" notnull ="false" description="Hörerstatus" /> <column name="hrst" type ="CHAR" size ="10" default ="" notnull ="false" description="Hörerstatus" />
<column name="semester" type ="INTEGER" size ="8" default ="" notnull ="true" description="Semester" /> <column name="semester" type ="INTEGER" size ="8" default ="" notnull ="true" description="Semester" />
<column name="fachsemester" type ="INTEGER" size ="4" default ="" notnull ="false" description="Fachsemester" /> <column name="fachsemester" type ="INTEGER" size ="4" default ="" notnull ="false" description="Fachsemester" />

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

@ -1,6 +1,8 @@
--freemarker template --freemarker template
drop table if exists tmp_studien;
drop table if exists tmp_studien2;
SELECT SELECT
SM.semester_tid as semester, SM.semester_tid as semester,
@ -23,14 +25,15 @@ S.ca12_staat,
S.second_nationality, S.second_nationality,
SG.fachkennzeichen, SG.fachkennzeichen,
ST.studienform_statistik_code, ST.studienform_statistik_code,
null::integer as st_studiengang_nr_msg, (case when SG.studiengangs_typ_kb in ('MSG') then SG.st_studiengang_nr else null::integer end) as st_studiengang_nr_msg,
null::integer as st_studiengang_nr_msg_primaerflag, null::integer as st_studiengang_nr_msg_primaerflag,
null::integer as st_studiengang_nr_tsg, (case when SG.studiengangs_typ_kb in ('TSG') then SG.st_studiengang_nr else null::integer end) as st_studiengang_nr_tsg,
null::integer as studienfach_sortierung, null::integer as studienfach_sortierung,
null::char(10) as hrst, null::char(10) as hrst,
null::integer as fachsemester, null::integer as fachsemester,
null::integer as hssem, null::integer as hssem,
null::char(10) as statustyp, (case when SG.studiengangs_typ_kb in ('TSG') then SA.studienstatustyp else null::char(10) end) as statustyp_tsg,
0::smallint as tsg_generated,
--0::smallint as primaerflag, --0::smallint as primaerflag,
null::integer as studiengang_nr, null::integer as studiengang_nr,
null::integer as fach_nr, null::integer as fach_nr,
@ -40,7 +43,7 @@ null::date as ruebeudat,
null::date as endedat, null::date as endedat,
null::smallint as kz_rueck_beur_ein, null::smallint as kz_rueck_beur_ein,
null::char(10) as hzb_art, null::char(10) as hzb_art,
rank () over (partition by SM.st_sem_nr, S.st_studstamm_nr, SG.studiengangs_identifikator order by SA.gueltig_ab desc) as status_historie rank () over (partition by SM.st_sem_nr, S.st_studstamm_nr, SG.studiengangs_identifikator order by SA.gueltig_ab desc) as status_historie
into temp tmp_studien into temp tmp_studien
FROM costage_st_studierendenstammdaten S, FROM costage_st_studierendenstammdaten S,
costage_st_studien ST, costage_st_studien ST,
@ -55,20 +58,14 @@ and ST.st_studiengang_nr=SG.st_studiengang_nr
and S.matrikelnummer is not null and S.matrikelnummer is not null
--and SM.semester_tid >= 20171 --and SM.semester_tid >= 20171
-- and SM.semester_tid <= 20171 -- and SM.semester_tid <= 20171
--and S.matrikelnummer in ('1415093') and SG.studiengangs_typ_kb in ('ESG','TSG','MSG')
and SG.studiengangs_typ_kb in ('ESG','TSG')
and SA.st_studium_nr=ST.st_studium_nr and SA.st_studium_nr=ST.st_studium_nr
and SA.st_sem_nr=SM.st_sem_nr and SA.st_sem_nr=SM.st_sem_nr
and SA.gueltig_ab <=SM.semester_ende --nur letzter Status im jew. Semester interessiert, nicht danach
and SA.studienstatustyp not in ('a','o') and SA.studienstatustyp not in ('a','o')
and ${COSTAGE_STUDENT_FILTER} and ${COSTAGE_STUDENT_FILTER}
--group by 1,2,3,4,5,6,7,8,9,10,11,12,13 --group by 1,2,3,4,5,6,7,8,9,10,11,12,13
; ;
-- select * from tmp_studien
-- update tmp_studien
-- set abschluss_str=A.name
-- from costage_st_abschlussziele_lokal A
-- where A.st_absz_nr=tmp_studien.abschluss
-- ;
update tmp_studien update tmp_studien
set hrst=H.hoererstatus_kb set hrst=H.hoererstatus_kb
@ -102,6 +99,7 @@ from tmp_studien T, costage_st_hauptstudien H
and H.st_studium_nr=T.st_studium_nr and H.st_studium_nr=T.st_studium_nr
and H.st_sem_nr=T.st_sem_nr and H.st_sem_nr=T.st_sem_nr
and status_historie=1 and status_historie=1
and T.studiengangs_typ_kb in ('ESG','TSG')
; ;
--Studiengänge ohne Primärflag: --Studiengänge ohne Primärflag:
insert into tmp_studien2 insert into tmp_studien2
@ -111,10 +109,10 @@ on (H.st_studstamm_nr=T.st_studstamm_nr
and H.st_studium_nr=T.st_studium_nr and H.st_studium_nr=T.st_studium_nr
and H.st_sem_nr=T.st_sem_nr) and H.st_sem_nr=T.st_sem_nr)
where T.status_historie=1 where T.status_historie=1
and T.studiengangs_typ_kb in ('ESG','TSG')
and H.st_studstamm_nr is null and H.st_studstamm_nr is null
; ;
drop table tmp_studien;
--Ermittlung msg: --Ermittlung msg:
@ -125,6 +123,125 @@ and ST.st_studstamm_nr=tmp_studien2.st_studstamm_nr
and M.st_studiengang_nr_tsg=tmp_studien2.st_studiengang_nr and M.st_studiengang_nr_tsg=tmp_studien2.st_studiengang_nr
and tmp_studien2.studiengangs_typ_kb ='TSG' and tmp_studien2.studiengangs_typ_kb ='TSG'
; ;
update tmp_studien2 set studienstatustyp=null;
--Ermittlung status bei TSG aus MSG:
update tmp_studien2 set studienstatustyp=T.studienstatustyp
from tmp_studien T
where T.st_studiengang_nr=tmp_studien2.st_studiengang_nr_msg
and T.st_studstamm_nr=tmp_studien2.st_studstamm_nr
and T.st_sem_nr=tmp_studien2.st_sem_nr
and T.status_historie=1
and tmp_studien2.studiengangs_typ_kb ='TSG'
;
drop table if exists tmp_fehlend;
--fehlende TSG nachtragen:
select T.st_studium_nr,
T.studienstatustyp,
T.st_studienstatus_nr,
T.st_studiengang_nr_msg,
T.st_sem_nr,
T.st_studstamm_nr,
T.beginn_datum,
T.gueltig_ab
into temp tmp_fehlend
from tmp_studien T
left outer join tmp_studien2 T2
on (T2.st_studiengang_nr_msg=T.st_studiengang_nr
and T2.st_studstamm_nr=T.st_studstamm_nr
and T2.studiengangs_typ_kb ='TSG'
and T.st_sem_nr=T2.st_sem_nr)
where T2.st_studstamm_nr is null
and T.studienstatustyp in ('B','E','I') --nur tatsächlich eingeschrieben
--and T.st_sem_nr=180
;
insert into tmp_studien2(semester,
st_absz_nr,
st_skz_nr,
studiengangs_identifikator,
studiengangs_bezeichnung,
st_sem_nr,
st_studium_nr,
st_studstamm_nr,
st_studiengang_nr,
studiengangs_typ_kb,
studienstatustyp,
st_studienstatus_nr,
beginn_datum,
gueltig_ab,
matrikelnummer,
geschlecht,
ca12_staat,
second_nationality,
fachkennzeichen,
studienform_statistik_code,
st_studiengang_nr_msg,
st_studiengang_nr_tsg,
hrst,
hssem,
statustyp_tsg,
tsg_generated,
primaerflag,
hzb_art,
fachsemester)
select E.semester_tid,
st_absz_nr,
S.st_skz_nr,
S.studiengangs_identifikator,
S.studiengangs_bezeichnung,
T.st_sem_nr,
S.st_studium_nr,
S.st_studstamm_nr,
S.st_studiengang_nr,
S.studiengangs_typ_kb,
T.studienstatustyp,
T.st_studienstatus_nr,
T.beginn_datum,
T.gueltig_ab,
S.matrikelnummer,
S.geschlecht,
S.ca12_staat,
S.second_nationality,
S.fachkennzeichen,
S.studienform_statistik_code,
S.st_studiengang_nr_msg,
S.st_studiengang_nr_tsg,
S.hrst,
S.hssem,
null::char(10) as statustyp_tsg,
1 as tsg_generated,
S.primaerflag,
S.hzb_art,
max(S.fachsemester)
from tmp_fehlend T, tmp_studien2 S,costage_st_semester E
where T.st_studiengang_nr_msg=S.st_studiengang_nr_msg
and T.st_studstamm_nr=S.st_studstamm_nr
and S.studiengangs_typ_kb ='TSG'
and T.st_sem_nr != S.st_sem_nr
and E.st_sem_nr=T.st_sem_nr
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
;
--statustyp_stg nachladen:
update tmp_studien2 set statustyp_tsg=S.statustyp_tsg
from tmp_studien S
where tmp_studien2.st_studium_nr=S.st_studium_nr
and tmp_studien2.st_studstamm_nr=S.st_studstamm_nr
and S.studiengangs_typ_kb ='TSG'
and tmp_studien2.tsg_generated=1
and tmp_studien2.fachsemester=S.fachsemester
;
drop table tmp_studien;
--Ermittlung fach_nr: --Ermittlung fach_nr:
update tmp_studien2 set fach_nr=M.studienfach_sortierung update tmp_studien2 set fach_nr=M.studienfach_sortierung
@ -137,18 +254,6 @@ and tmp_studien2.studiengangs_typ_kb ='TSG'
update tmp_studien2 set fach_nr=1 update tmp_studien2 set fach_nr=1
where fach_nr is null; where fach_nr is null;
--Ermittlung status bei TSG aus MSG:
update tmp_studien2 set studienstatustyp=SA.studienstatustyp
from costage_st_studienstatus SA, costage_st_studiengaenge SG ,costage_st_studien ST
where SG.st_studiengang_nr=tmp_studien2.st_studiengang_nr_msg
and ST.st_studium_nr=SA.st_studium_nr
and ST.st_studstamm_nr=tmp_studien2.st_studstamm_nr
and SA.st_sem_nr=tmp_studien2.st_sem_nr
and SA.gueltig_ab=tmp_studien2.gueltig_ab
and tmp_studien2.studiengangs_typ_kb ='TSG'
;
update tmp_studien2 set unikey=K.unikey update tmp_studien2 set unikey=K.unikey
@ -208,6 +313,8 @@ st_studium_nr,
st_studiengang_nr, st_studiengang_nr,
st_studienstatus_nr, st_studienstatus_nr,
statustyp, statustyp,
statustyp_tsg,
tsg_generated,
hrst, hrst,
semester, semester,
fachsemester, fachsemester,
@ -231,7 +338,9 @@ select st_studium_nr,
st_studiengang_nr, st_studiengang_nr,
st_studienstatus_nr, st_studienstatus_nr,
studienstatustyp, studienstatustyp,
hrst, statustyp_tsg,
tsg_generated,
hrst,
semester, semester,
fachsemester, fachsemester,
hssem, hssem,
@ -291,6 +400,8 @@ st_studium_nr,
st_studiengang_nr, st_studiengang_nr,
st_studienstatus_nr, st_studienstatus_nr,
statustyp, statustyp,
statustyp_tsg,
tsg_generated,
hrst, hrst,
semester, semester,
fachsemester, fachsemester,
@ -314,6 +425,8 @@ select st_studium_nr,
st_studiengang_nr, st_studiengang_nr,
st_studienstatus_nr, st_studienstatus_nr,
studienstatustyp, studienstatustyp,
statustyp_tsg,
tsg_generated,
hrst, hrst,
semester, semester,
fachsemester, fachsemester,
@ -414,9 +527,10 @@ where A.st_studstamm_nr=costage_st_studien_aggr.st_studstamm_nr
and A.st_adresse_typ='H' and A.st_adresse_typ='H'
; ;
drop table tmp_studien2; drop table tmp_studien2;
drop table tmp_primaer_msg; drop table tmp_primaer_msg;
drop table temp_tmp_studien2; drop table temp_tmp_studien2;
drop table tmp_fehlend;

37
src-modules/module/costage/rohdaten/costage_prepare_unlfiles.xsl

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xml:output method="text" indent="yes"/>
<xsl:template match="/">
<xsl:text>-- XML-generiertes SQL-Script
--von costage_prepare_unlfiles.xsl
if [ ! -f $COSTAGE_LOAD_PFAD/superx.datum ]
then
echo "superx.datum wird nicht übergeben"
date +'%d.%m.%Y' > $COSTAGE_LOAD_PFAD/superx.datum
fi
if [ ! -f $COSTAGE_LOAD_PFAD/costage_unload.err ]
then
echo "costage_unload.err wird nicht übergeben"
cat /dev/null > $COSTAGE_LOAD_PFAD/costage_unload.err
fi
</xsl:text>
<xsl:for-each select="/superx-unload/unload-job [ @transfer-unload-file != '' ] ">
<xsl:text><![CDATA[
if [ ! -f "$COSTAGE_LOAD_PFAD/]]></xsl:text><xsl:value-of select="@transfer-unload-file" /><xsl:text>" ]
then
echo "$COSTAGE_LOAD_PFAD/</xsl:text><xsl:value-of select="@transfer-unload-file" /><xsl:text><![CDATA[ wird nicht übergeben"
cat /dev/null > "$COSTAGE_LOAD_PFAD/]]></xsl:text><xsl:value-of select="@transfer-unload-file" /><xsl:text>"
fi
</xsl:text>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

4
src-modules/module/costage/rohdaten/costage_prepare_unlfiles_generator.x

@ -0,0 +1,4 @@
#!/bin/bash
#Extraction Script for SuperX.
sx_transform.x -IN:costage_unload.xml -XSL:./costage_prepare_unlfiles.xsl -OUT:./costage_prepare_unlfiles.x -method:text

3
src-modules/module/costage/rohdaten/costage_unload.xml

@ -615,7 +615,7 @@ FROM px_st_ersthochschulen_v
</extraction-sql> </extraction-sql>
</unload-job> </unload-job>
<unload-job id="px_st_hochschulsemester_v" extraction-table="" extraction-script="" transfer-unload-file="unl/costage_st_hochschulsemester.unl" > <unload-job id="px_st_hochschulsemester_v" extraction-table="" extraction-script="" transfer-unload-file="unl/costage_st_hochschulsemester.unl" >
<comment> </comment> <comment>Derzeit inaktiv, View aus Graz derzeit nicht nutzbar </comment>
<extraction-sql sourcesystem="co" database="" version=""> <extraction-sql sourcesystem="co" database="" version="">
<![CDATA[ <![CDATA[
SELECT H.st_studstamm_nr, SELECT H.st_studstamm_nr,
@ -627,6 +627,7 @@ and H.anzahl_hochschulsemester >0
and to_number('20' || replace(replace(S.semester_id,'S','1'),'W','2')) >= $COSTAGE_start_st_sem and to_number('20' || replace(replace(S.semester_id,'S','1'),'W','2')) >= $COSTAGE_start_st_sem
and current_date+365 > S.semester_anfang and current_date+365 > S.semester_anfang
and extract(year from S.semester_anfang) > 2000 and extract(year from S.semester_anfang) > 2000
and 1=0
; ;
]]> ]]>

Loading…
Cancel
Save