Beispieldaten hinzugefügt
This commit is contained in:
4124
2021-07-15_KS_H_L_Oldenburg_Karpfenweg.xml
Normal file
4124
2021-07-15_KS_H_L_Oldenburg_Karpfenweg.xml
Normal file
File diff suppressed because it is too large
Load Diff
3287
2021-07-15_KS_H_L_Oldenburg_Lachsweg.xml
Normal file
3287
2021-07-15_KS_H_L_Oldenburg_Lachsweg.xml
Normal file
File diff suppressed because it is too large
Load Diff
3863
2021-07-19_KR_H_L_Oldenburg_Geschwister-Scholl-Straße.xml
Normal file
3863
2021-07-19_KR_H_L_Oldenburg_Geschwister-Scholl-Straße.xml
Normal file
File diff suppressed because it is too large
Load Diff
5954
2021-07-20_KR_H_L_Oldenburg_Adenauerallee.xml
Normal file
5954
2021-07-20_KR_H_L_Oldenburg_Adenauerallee.xml
Normal file
File diff suppressed because it is too large
Load Diff
21370
2021-08-02_KS_H_L_Oldenburg_Am-Stadtrand.xml
Normal file
21370
2021-08-02_KS_H_L_Oldenburg_Am-Stadtrand.xml
Normal file
File diff suppressed because it is too large
Load Diff
4845
2021-08-04_KS_H_L_Oldenburg_Mümmelmannsweg.xml
Normal file
4845
2021-08-04_KS_H_L_Oldenburg_Mümmelmannsweg.xml
Normal file
File diff suppressed because it is too large
Load Diff
14927
KS_Oldenburg_Heideweg.xml
Normal file
14927
KS_Oldenburg_Heideweg.xml
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using XMLParser;
|
||||
|
||||
@@ -8,44 +9,92 @@ namespace XMLProgramm
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static Dictionary<string,decimal> CalculateDay(List<KanalObjekt> inspektionen)
|
||||
{
|
||||
Dictionary<string,decimal> result = new Dictionary<string, decimal>();
|
||||
decimal HauptkanalLaenge =0.0m;
|
||||
|
||||
inspektionen
|
||||
.FindAll(s => s.Inspektionsdaten.Anlagentyp.Equals(EAnlagetyp.Haltung))
|
||||
.ForEach(g => HauptkanalLaenge += g.Inspektionsdaten.OptischeInspektion.Rohrleitung.Inspektionslaenge);
|
||||
|
||||
List<KanalObjekt> Anschlussleitungen = inspektionen.FindAll(x => x.Inspektionsdaten.Anlagentyp.Equals(EAnlagetyp.Anschlussleitung));
|
||||
List<KanalObjekt> SEs = Anschlussleitungen.FindAll(x => x.Stammdaten.Knoten != null && x.Stammdaten.Knoten.Anschlusspunkt != null && x.Stammdaten.Knoten.Anschlusspunkt.Punktkennung.Equals("SE"));
|
||||
List<KanalObjekt> SOs = Anschlussleitungen.FindAll(x => x.Stammdaten.Knoten != null && x.Stammdaten.Knoten.Anschlusspunkt != null && !x.Stammdaten.Knoten.Anschlusspunkt.Punktkennung.Equals("SE"));
|
||||
|
||||
foreach(KanalObjekt s in SEs) {
|
||||
Anschlussleitungen.Remove(s);
|
||||
}
|
||||
foreach(KanalObjekt s in SOs) {
|
||||
Anschlussleitungen.Remove(s);
|
||||
}
|
||||
|
||||
SOs.AddRange(Anschlussleitungen);
|
||||
|
||||
result.Add("StraßenablaufCount",SEs.Count);
|
||||
result.Add("SontigeCount",SOs.Count);
|
||||
|
||||
decimal SEPauschal = 34.00m * SEs.Count;
|
||||
decimal SOPauschal = 45.00m * SOs.Count;
|
||||
decimal HauptkanalPreis = 1.60m * HauptkanalLaenge;
|
||||
|
||||
result.Add("StraßenablaufPauschal",SEPauschal);
|
||||
result.Add("SonstigesPauschal",SOPauschal);
|
||||
result.Add("HauptkanalPreis",HauptkanalPreis);
|
||||
|
||||
decimal SEOverlength = 0.0m;
|
||||
// SE preise
|
||||
foreach(KanalObjekt Strassenablauf in SEs) {
|
||||
decimal length = Strassenablauf.Inspektionsdaten.OptischeInspektion.Rohrleitung.Inspektionslaenge;
|
||||
if(length > 5.0m) {
|
||||
SEOverlength += length - 5.0m;
|
||||
}
|
||||
}
|
||||
decimal SOOverlength = 0.0m;
|
||||
// SO preise
|
||||
foreach(KanalObjekt Sonstige in SOs) {
|
||||
decimal length = Sonstige.Inspektionsdaten.OptischeInspektion.Rohrleitung.Inspektionslaenge;
|
||||
if(length > 7.0m) {
|
||||
SOOverlength += length - 7.0m;
|
||||
}
|
||||
}
|
||||
|
||||
decimal LeitungOverlength = SEOverlength + SOOverlength;
|
||||
|
||||
decimal LeitungsOverlengthPreis = LeitungOverlength * 2.4m;
|
||||
result.Add("LeitungÜberlaenge",LeitungOverlength);
|
||||
result.Add("PreisLeitung",LeitungsOverlengthPreis);
|
||||
result.Add("Umsatz",(LeitungsOverlengthPreis + HauptkanalPreis + SEPauschal + SOPauschal));
|
||||
return result;
|
||||
|
||||
|
||||
|
||||
}
|
||||
static void Main(string[] args)
|
||||
{
|
||||
XMLParse ser = new XMLParse("input.xml");
|
||||
IEnumerable<string> datums = ser.KanalObjekte.Select(x => x.Inspektionsdaten.OptischeInspektion.Inspektionsdatum).Distinct();
|
||||
List<KanalObjekt> objekte = new List<KanalObjekt>();
|
||||
DirectoryInfo info = new DirectoryInfo("./");
|
||||
FileInfo[] daten = info.GetFiles("*.xml");
|
||||
foreach(FileInfo aktuell in daten) {
|
||||
XMLParse ser = new XMLParse(aktuell.FullName);
|
||||
objekte.AddRange(ser.KanalObjekte);
|
||||
}
|
||||
|
||||
//XMLParse ser = new XMLParse("KS_Oldenburg_Heideweg.xml");
|
||||
//objekte.AddRange(ser.KanalObjekte);
|
||||
//objekte = objekte.OrderBy(x => x.Inspektionsdaten.OptischeInspektion.Inspektionsdatum);
|
||||
IEnumerable<string> datums = objekte.OrderBy(d => d.Inspektionsdaten.OptischeInspektion.Inspektionstime).Select(x => x.Inspektionsdaten.OptischeInspektion.Inspektionsdatum).Distinct();
|
||||
|
||||
decimal gesamt = 0.0m;
|
||||
//Dictionary<string,decimal> s = CalculateDay(objekte.FindAll(x => x.Inspektionsdaten.OptischeInspektion.Inspektionsdatum.Equals("05.08.2021")));
|
||||
foreach(string datum in datums) {
|
||||
Console.WriteLine("Folgende Datums sind erfasst worden : "+datum);
|
||||
List<KanalObjekt> inspektionen = ser.KanalObjekte.FindAll(x => x.Inspektionsdaten.OptischeInspektion.Inspektionsdatum.Equals(datum));
|
||||
int counter = 0;
|
||||
foreach(KanalObjekt s in inspektionen) {
|
||||
counter++;
|
||||
decimal length = s.Inspektionsdaten.OptischeInspektion.Rohrleitung.Inspektionslaenge;
|
||||
Console.Write(s.Stammdaten.Objektbezeichnung+ " "+length);
|
||||
//if(s.Stammdaten.Objektbezeichnung.Equals("45893017")) Debugger.Break();
|
||||
if(s.Inspektionsdaten.Anlagentyp.Equals(EAnlagetyp.Anschlussleitung)) {
|
||||
if(s.Stammdaten.Knoten != null && s.Stammdaten.Knoten.Anschlusspunkt != null && s.Stammdaten.Knoten.Anschlusspunkt.Punktkennung.Equals("SE")) {
|
||||
// 45903556RS07 ist anschlusspunkt => null, denn es ist einen Schacht
|
||||
if(length > 5.0m) {
|
||||
Console.Write(" Straßenablauf ");
|
||||
decimal overlength = length - 5.0m;
|
||||
Console.Write("# Over : "+overlength);
|
||||
Dictionary<string,decimal> s = CalculateDay(objekte.FindAll(x => x.Inspektionsdaten.OptischeInspektion.Inspektionsdatum.Equals(datum)));
|
||||
Console.WriteLine("Umsatz am : "+datum + " " + s["Umsatz"]);
|
||||
gesamt +=s["Umsatz"];
|
||||
//if(datum.Equals("05.08.2021")) Debugger.Break();
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(length > 7.0m) {
|
||||
Console.Write(" Sonstiges ");
|
||||
decimal overlength = length - 7.0m;
|
||||
Console.Write("# Over : "+overlength);
|
||||
}
|
||||
}
|
||||
}
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Durchschnitt : "+gesamt / datums.Count());
|
||||
|
||||
|
||||
}
|
||||
Console.WriteLine(counter);
|
||||
counter = 0;
|
||||
Console.WriteLine("####");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user