Code-Verbesserung

main
3009594 2024-11-18 21:13:20 +01:00
parent 8006b66f42
commit 55934bacfe
8 changed files with 112 additions and 50 deletions

View File

@ -1,11 +1,11 @@
<mxfile host="app.diagrams.net" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36" version="24.8.6">
<diagram name="Seite-1" id="xkmZ0K6vz5A5_BixXH1Q">
<mxGraphModel dx="1447" dy="1489" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<mxGraphModel dx="1873" dy="1415" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="xSOr38UQ6ttjsq0tnJFV-13" value="" style="shape=folder;fontStyle=1;spacingTop=10;tabWidth=40;tabHeight=14;tabPosition=left;html=1;whiteSpace=wrap;" vertex="1" parent="1">
<mxGeometry x="750" y="260" width="1590" height="1250" as="geometry" />
<mxCell id="l42d9aidsTNYsLyE-SN_-16" value="" style="shape=folder;fontStyle=1;spacingTop=10;tabWidth=40;tabHeight=14;tabPosition=left;html=1;whiteSpace=wrap;" vertex="1" parent="1">
<mxGeometry x="750" y="260" width="1580" height="1340" as="geometry" />
</mxCell>
<object label="" TUI="" id="ydUtLetK26WXyeJ3qCt--1">
<mxCell style="shape=folder;fontStyle=1;spacingTop=10;tabWidth=40;tabHeight=14;tabPosition=left;html=1;whiteSpace=wrap;points=[[0,0,0,-5,-13],[0,0,0,0,14],[0,0,0,0,78],[0,0,0,0,142],[0,0,0,0,206],[0,0,0,0,270],[0,0,0,20,0],[0,0,0,40,0],[0,0,0,160,14],[0,0,0,280,14],[0,0,0,280,78],[0,0,0,280,142],[0,0,0,280,206],[0,0,0,280,270],[0,0.5,0,0,0],[0.04,0.02,0,0,0],[0.06,0.04,0,0,0],[0.09,0.03,0,0,0],[0.13,0.04,0,0,0],[0.25,1,0,0,0],[0.5,1,0,0,0],[0.75,1,0,0,0]];" parent="1" vertex="1">
@ -238,13 +238,13 @@
<mxCell id="ydUtLetK26WXyeJ3qCt--175" value="&lt;i&gt;Benutzer&lt;/i&gt;" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=37;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;strokeColor=default;spacingTop=10;fontFamily=Helvetica;fontSize=12;fontColor=default;fillColor=default;" parent="1" vertex="1">
<mxGeometry x="1470" y="1010" width="260" height="320" as="geometry" />
</mxCell>
<mxCell id="ydUtLetK26WXyeJ3qCt--176" value="&lt;span style=&quot;font-weight: normal;&quot;&gt;- bibAusweis: Ausweis&lt;/span&gt;&lt;div style=&quot;line-height: 140%;&quot;&gt;&lt;span style=&quot;background-color: initial; font-weight: normal;&quot;&gt;- name: String&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 140%;&quot;&gt;&lt;span style=&quot;background-color: initial; font-weight: normal;&quot;&gt;- alter: int&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 140%;&quot;&gt;&lt;span style=&quot;background-color: initial; font-weight: normal;&quot;&gt;- istStudent: boolean&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 160%;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;-&amp;nbsp;&lt;span style=&quot;background-color: initial;&quot;&gt;ausgeliehenenMedien[]: Medium&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;- angemeldet: boolean&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;- gebühren: double&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;- anmeldeBeginn: LocalDate&lt;/span&gt;&lt;/div&gt;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontSize=12;fontColor=default;fontStyle=1;" parent="ydUtLetK26WXyeJ3qCt--175" vertex="1">
<mxCell id="ydUtLetK26WXyeJ3qCt--176" value="&lt;span style=&quot;font-weight: normal;&quot;&gt;- bibAusweis: Ausweis&lt;/span&gt;&lt;div style=&quot;line-height: 140%;&quot;&gt;&lt;span style=&quot;background-color: initial; font-weight: normal;&quot;&gt;- name: String&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 140%;&quot;&gt;&lt;span style=&quot;background-color: initial; font-weight: normal;&quot;&gt;- alter: int&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 140%;&quot;&gt;&lt;span style=&quot;background-color: initial; font-weight: normal;&quot;&gt;- istStudent: boolean&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 160%;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;-&amp;nbsp;&lt;span style=&quot;background-color: initial;&quot;&gt;ausgeliehenenMedien[]: Ausleihe&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;- angemeldet: boolean&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;- gebühren: double&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;- anmeldeBeginn: LocalDate&lt;/span&gt;&lt;/div&gt;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontSize=12;fontColor=default;fontStyle=1;" parent="ydUtLetK26WXyeJ3qCt--175" vertex="1">
<mxGeometry y="37" width="260" height="163" as="geometry" />
</mxCell>
<mxCell id="ydUtLetK26WXyeJ3qCt--177" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;fontFamily=Helvetica;fontSize=12;fontColor=default;fontStyle=1;" parent="ydUtLetK26WXyeJ3qCt--175" vertex="1">
<mxGeometry y="200" width="260" height="8" as="geometry" />
</mxCell>
<mxCell id="ydUtLetK26WXyeJ3qCt--178" value="&lt;span style=&quot;font-weight: normal;&quot;&gt;+ anmelden(): void&lt;/span&gt;&lt;div&gt;&lt;span style=&quot;font-weight: 400;&quot;&gt;+ abmelden: void&lt;br&gt;&lt;/span&gt;&lt;div&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;+ ausleihen(medium: Ausleihe): void&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-weight: normal; background-color: initial;&quot;&gt;+ jahresgebühren(): double&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;+ zurückgeben(medium: Ausleihe): void&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;+ gebührenbezahlen(int betrag): boolean&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontSize=12;fontColor=default;fontStyle=1;" parent="ydUtLetK26WXyeJ3qCt--175" vertex="1">
<mxCell id="ydUtLetK26WXyeJ3qCt--178" value="&lt;span style=&quot;font-weight: normal;&quot;&gt;+ anmelden(): void&lt;/span&gt;&lt;div&gt;&lt;span style=&quot;font-weight: 400;&quot;&gt;+ abmelden: void&lt;br&gt;&lt;/span&gt;&lt;div&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;+ ausleihen(medium: Ausleihe): void&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-weight: normal; background-color: initial;&quot;&gt;&lt;i&gt;+ jahresgebühren(): double&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;+ zurückgeben(medium: Ausleihe): void&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontSize=12;fontColor=default;fontStyle=1;" parent="ydUtLetK26WXyeJ3qCt--175" vertex="1">
<mxGeometry y="208" width="260" height="112" as="geometry" />
</mxCell>
<mxCell id="ydUtLetK26WXyeJ3qCt--203" value="" style="endArrow=none;html=1;rounded=0;fontFamily=Helvetica;fontSize=12;fontColor=default;fontStyle=1;" parent="1" edge="1">
@ -286,16 +286,6 @@
<mxCell id="i-RIzz4hhB1Q3m7lVkjo-5" value="+ userRegistrieren(name:String, type: String, alter: int, istAdmin: String): void&lt;div&gt;+ userAnmelden(bibKartennummer: String): boolean&lt;/div&gt;&lt;div&gt;+&amp;nbsp;mediumDurchsuchen(auswahl: String, bibKartennummer: String): ArrayList&amp;lt;String&amp;gt;&lt;/div&gt;&lt;div&gt;+&amp;nbsp;mediumAusleihen(bibKartenNummer:&amp;nbsp;&lt;span style=&quot;background-color: initial;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;,eindeutigeKennung:&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;): String&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;+&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;medienVerlängern(eindeutigeKennung:&lt;/span&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;, bibKartennummer:&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;): boolean&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;+&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;gebührenBezahlen(betrag:&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;double&lt;/span&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;, bibKartennummer:&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;): boolean&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;+&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;medienRückgabe(eindeutigeKennung:&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;): ArrayList&amp;lt;String&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;+&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;jahresGebührenBerechnen(bibKartennummer:&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;, datum:&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;): double&lt;/span&gt;&lt;/div&gt;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="i-RIzz4hhB1Q3m7lVkjo-2" vertex="1">
<mxGeometry y="138" width="490" height="142" as="geometry" />
</mxCell>
<mxCell id="i-RIzz4hhB1Q3m7lVkjo-9" value="1" style="endArrow=open;html=1;endSize=12;startArrow=diamondThin;startSize=14;startFill=1;edgeStyle=orthogonalEdgeStyle;align=left;verticalAlign=bottom;rounded=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" edge="1">
<mxGeometry x="-1" y="3" relative="1" as="geometry">
<mxPoint x="1084.5" y="616" as="sourcePoint" />
<mxPoint x="1125" y="769.9999999999998" as="targetPoint" />
<Array as="points">
<mxPoint x="1126" y="617" />
<mxPoint x="1126" y="770" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="i-RIzz4hhB1Q3m7lVkjo-10" value="Mediumverwalter" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="1580" y="390" width="160" height="128" as="geometry" />
</mxCell>
@ -357,7 +347,7 @@
<mxGeometry x="1650" y="360" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="i-RIzz4hhB1Q3m7lVkjo-48" value="1" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="1120" y="740" width="60" height="30" as="geometry" />
<mxGeometry x="1060" y="740" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="i-RIzz4hhB1Q3m7lVkjo-49" value="AusleihSystem" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="801" y="770" width="539" height="180" as="geometry" />
@ -416,35 +406,83 @@
<mxGeometry x="1760" y="550" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="i-RIzz4hhB1Q3m7lVkjo-72" value="kommuniziert" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="1140" y="690" width="60" height="30" as="geometry" />
<mxGeometry x="1060" y="670" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="i-RIzz4hhB1Q3m7lVkjo-73" value="hat" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="767" y="690" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="xSOr38UQ6ttjsq0tnJFV-1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.388;entryY=0.019;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="i-RIzz4hhB1Q3m7lVkjo-49" target="ydUtLetK26WXyeJ3qCt--158">
<mxCell id="xSOr38UQ6ttjsq0tnJFV-1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.388;entryY=0.019;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="i-RIzz4hhB1Q3m7lVkjo-49" target="ydUtLetK26WXyeJ3qCt--158" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="xSOr38UQ6ttjsq0tnJFV-2" value="&lt;font style=&quot;font-size: 12px;&quot;&gt;1&lt;/font&gt;" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxCell id="xSOr38UQ6ttjsq0tnJFV-2" value="&lt;font style=&quot;font-size: 12px;&quot;&gt;1&lt;/font&gt;" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="1060" y="950" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="xSOr38UQ6ttjsq0tnJFV-5" value="Kunde" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="xSOr38UQ6ttjsq0tnJFV-5" value="Studenten" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="1350" y="1450" width="160" height="34" as="geometry" />
</mxCell>
<mxCell id="xSOr38UQ6ttjsq0tnJFV-7" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" vertex="1" parent="xSOr38UQ6ttjsq0tnJFV-5">
<mxCell id="xSOr38UQ6ttjsq0tnJFV-7" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" parent="xSOr38UQ6ttjsq0tnJFV-5" vertex="1">
<mxGeometry y="26" width="160" height="8" as="geometry" />
</mxCell>
<mxCell id="xSOr38UQ6ttjsq0tnJFV-9" value="Mitarbeiter" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="1550" y="1450" width="160" height="34" as="geometry" />
</mxCell>
<mxCell id="xSOr38UQ6ttjsq0tnJFV-11" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" vertex="1" parent="xSOr38UQ6ttjsq0tnJFV-9">
<mxGeometry y="26" width="160" height="8" as="geometry" />
</mxCell>
<mxCell id="xSOr38UQ6ttjsq0tnJFV-17" value="Medium druchsuchen" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxCell id="xSOr38UQ6ttjsq0tnJFV-17" value="Medium druchsuchen" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="450" y="375" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="xSOr38UQ6ttjsq0tnJFV-18" value="Medium&lt;div&gt;Ausleihen&lt;/div&gt;" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxCell id="xSOr38UQ6ttjsq0tnJFV-18" value="Medium&lt;div&gt;Ausleihen&lt;/div&gt;" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="440" y="440" width="80" height="40" as="geometry" />
</mxCell>
<mxCell id="l42d9aidsTNYsLyE-SN_-1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.057;entryY=-0.011;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="i-RIzz4hhB1Q3m7lVkjo-2" target="ydUtLetK26WXyeJ3qCt--175">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="l42d9aidsTNYsLyE-SN_-2" value="1" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="1290" y="439" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="l42d9aidsTNYsLyE-SN_-3" value="hat" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="1470" y="690" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="l42d9aidsTNYsLyE-SN_-4" value="*" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="1470" y="970" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="l42d9aidsTNYsLyE-SN_-5" value="Mitarbeiter" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="1740" y="1437" width="300" height="60" as="geometry" />
</mxCell>
<mxCell id="l42d9aidsTNYsLyE-SN_-7" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" vertex="1" parent="l42d9aidsTNYsLyE-SN_-5">
<mxGeometry y="26" width="300" height="8" as="geometry" />
</mxCell>
<mxCell id="l42d9aidsTNYsLyE-SN_-8" value="+ gebührenVerbuchen(benutzer: Benutzer): void" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" vertex="1" parent="l42d9aidsTNYsLyE-SN_-5">
<mxGeometry y="34" width="300" height="26" as="geometry" />
</mxCell>
<mxCell id="l42d9aidsTNYsLyE-SN_-9" value="Erwachsener" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="1550" y="1450" width="160" height="34" as="geometry" />
</mxCell>
<mxCell id="l42d9aidsTNYsLyE-SN_-11" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" vertex="1" parent="l42d9aidsTNYsLyE-SN_-9">
<mxGeometry y="26" width="160" height="8" as="geometry" />
</mxCell>
<mxCell id="l42d9aidsTNYsLyE-SN_-13" value="" style="endArrow=none;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="1630" y="1400" as="sourcePoint" />
<mxPoint x="1630" y="1400" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="l42d9aidsTNYsLyE-SN_-14" value="" style="endArrow=none;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="1630" y="1400" as="sourcePoint" />
<mxPoint x="1890" y="1400" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="l42d9aidsTNYsLyE-SN_-15" value="" style="endArrow=none;html=1;rounded=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="l42d9aidsTNYsLyE-SN_-5">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="1840" y="1450" as="sourcePoint" />
<mxPoint x="1890" y="1400" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="l42d9aidsTNYsLyE-SN_-17" value="" style="endArrow=none;html=1;rounded=0;exitX=0.457;exitY=0.004;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.526;entryY=1.014;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="i-RIzz4hhB1Q3m7lVkjo-49" target="i-RIzz4hhB1Q3m7lVkjo-5">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="970" y="660" as="sourcePoint" />
<mxPoint x="1020" y="610" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="l42d9aidsTNYsLyE-SN_-18" value="1" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="1040.5" y="620" width="60" height="30" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 350 KiB

View File

@ -75,12 +75,14 @@ public abstract class Benutzer {
return angemeldet;
}
public void anmelden() {
public boolean anmelden() {
this.angemeldet = true;
return this.angemeldet;
}
public void abmelden() {
public boolean abmelden() {
this.angemeldet = false ;
return this.angemeldet;
}

View File

@ -24,27 +24,27 @@ private BibSystem fassade;
void erstelleObjekt() throws FalscheEingabeException, BenutzerNichtGefundenException {
this.fassade = new BibSystem();
fassade.userRegistrieren("obai", "student", 15, "nein");
fassade.userAnmelden("K1000");
fassade.userAnmelden("K1001");
}
@Disabled
void testMedienSuchenNachTitle()throws MediumNichtGefundenException, FalscheEingabeException, BenutzerNichtAngemeldetException {
ArrayList<String> nichtAusgeliehen = fassade.mediumDurchsuchen("Effektives Java Programmieren", "K1000");
void testMedienSuchenNachTitle()throws MediumNichtGefundenException, FalscheEingabeException, BenutzerNichtAngemeldetException, BenutzerNichtGefundenException {
ArrayList<String> nichtAusgeliehen = fassade.mediumDurchsuchen("Effektives Java Programmieren", "K1001");
nichtAusgeliehen.forEach(System.out::println);
}
@Disabled
void testMedienSuchenNachMedienart()throws MediumNichtGefundenException, FalscheEingabeException, BenutzerNichtAngemeldetException {
ArrayList<String> nichtAusgeliehen = fassade.mediumDurchsuchen("Videospiele", "K1000");
void testMedienSuchenNachMedienart()throws MediumNichtGefundenException, FalscheEingabeException, BenutzerNichtAngemeldetException, BenutzerNichtGefundenException {
ArrayList<String> nichtAusgeliehen = fassade.mediumDurchsuchen("Videospiele", "K1001");
nichtAusgeliehen.forEach(System.out::println);
}
@Test
void testMedienSuchenNachausgeliehen()throws MediumNichtGefundenException, FalscheEingabeException, BenutzerNichtAngemeldetException {
ArrayList<String> nichtAusgeliehen = fassade.mediumDurchsuchen("ausgeliehen", "K1000");
void testMedienSuchenNachausgeliehen()throws MediumNichtGefundenException, FalscheEingabeException, BenutzerNichtAngemeldetException, BenutzerNichtGefundenException {
ArrayList<String> nichtAusgeliehen = fassade.mediumDurchsuchen("ausgeliehen", "K1001");
nichtAusgeliehen.forEach(System.out::println);
}

View File

@ -1,7 +1,11 @@
package domain.Bibliothekskatalog;
import java.time.LocalDate;
import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.stream.Collectors;
import domain.AusleiheSystem.Ausleihe;
import domain.Medium.*;
public class Mediensuchen {
@ -60,14 +64,25 @@ public class Mediensuchen {
.filter(t -> t.getValue().getMedium() instanceof Videospiel)
.map(t -> t.getValue().getMedium())
.map(t -> ((Videospiel)t))
.map(t -> "Eindutige Kennung= " + t.toString()).collect(Collectors.toCollection(ArrayList::new));
.map(t -> "Eindutige Kennung= " + t.toString())
.collect(Collectors.toCollection(ArrayList::new));
default:
return null;
}
}
public Collection<String> baldVerfügbareMedien(ArrayList<Ausleihe> ausleihe) {
LocalDate heutigesDatum = LocalDate.now();
return ausleihe.stream()
.filter(t -> t.getAusleiheEnde().until(heutigesDatum, ChronoUnit.DAYS) <= 3)
.map(t -> t.getMediumverwalter())
.map(t -> t.toString())
.collect(Collectors.toCollection(ArrayList::new));
}
}

View File

@ -41,8 +41,10 @@ public class BibSystem {
// Mediums Durchsuchen
public ArrayList<String> mediumDurchsuchen(String auswahl, String bibKartenNummer) throws FalscheEingabeException, MediumNichtGefundenException, BenutzerNichtAngemeldetException {
if (!checkIfUserImSystemAngemeldetIst(bibKartenNummer))
public ArrayList<String> mediumDurchsuchen(String auswahl, String bibKartenNummer) throws FalscheEingabeException, MediumNichtGefundenException, BenutzerNichtAngemeldetException, BenutzerNichtGefundenException {
Benutzer benutzer = findeBenutzer(bibKartenNummer);
if (benutzer.abmelden())
throw new BenutzerNichtAngemeldetException("Sie müssen sich erst im System anmelden");
ArrayList<String> treffer = new ArrayList<>();
@ -58,7 +60,11 @@ public class BibSystem {
|| auswahl.equalsIgnoreCase("Dvds") || auswahl.equalsIgnoreCase("Cds")
|| auswahl.equalsIgnoreCase("Videospiele"))
treffer = medienSuchen.medienart(auswahl, medien);
else if (auswahl.equalsIgnoreCase("ja")) {
treffer = baldVerfügbareMedien(ausleihe);
}
else
treffer = medienSuchen.title(auswahl, medien);
@ -83,7 +89,7 @@ public class BibSystem {
if (bibBenutzer instanceof Mitarbeiter)
throw new Exception("Mitarbeiter können keine Mediums ausleihen!");
if (!checkIfUserImSystemAngemeldetIst(bibKartenNummer))
if (bibBenutzer.abmelden())
throw new BenutzerNichtAngemeldetException("Sie müssen sich erst im System anmelden");
Ausleihe neueAusleihe = ausleiheSystem.mediumAusleihen(bibBenutzer, eindeutigeKennung);
@ -203,11 +209,7 @@ public class BibSystem {
medien.put(Videospiel.getMedium().getID(), Videospiel);
}
private boolean checkIfUserImSystemAngemeldetIst(String bibKartenNummer) {
return alleBibBenutzer.stream()
.filter(b -> b.getBibAusweis().getKartenNummer().equalsIgnoreCase(bibKartenNummer))
.anyMatch(user -> user.isAngemeldet());
}
public Benutzer findeBenutzer(String bibKartenNummer) throws BenutzerNichtGefundenException {
return alleBibBenutzer.stream()

View File

@ -134,13 +134,18 @@ public class Tui {
// Aktion: 3
private void mediumDurchsuchenProzess() {
System.out.println("<< Medien durchsuchen >>");
System.out.print("Suchkriterium (z. B. Titel, Medienart): ");
System.out.print("Suchkriterium (z. B. Titel, Medienart, Ausgeliehen, nicht Ausgeliehen,Medien die bald wieder verügbar sind (ja/nein)): ");
String auswahl = eingabe.nextLine();
System.out.print("BibKartennummer: ");
String bibKartennummer = eingabe.nextLine();
try {
if (auswahl.equalsIgnoreCase("Medienart")) {
System.out.println("Bücher, Brettspiele, Dvds, Cds, Videospiele");
auswahl = eingabe.nextLine();
}
ArrayList<String> treffer = fassade.mediumDurchsuchen(auswahl, bibKartennummer);
treffer.forEach(System.out::println);
} catch (Exception e) {