Skip to content

Commit

Permalink
Correct timestamp (back)
Browse files Browse the repository at this point in the history
  • Loading branch information
aorzelskiGH committed Jul 10, 2024
1 parent c615a68 commit d46e7b3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/AasxServerBlazor/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"AasxServerBlazor": {
"commandName": "Project",
"commandLineArgs": "--with-db --start-index 1000 --no-security --secret-string-api 1234 --aasx-in-memory 1000 --data-path \"C:\\Development\\aasxs-repository\" --edit --external-blazor http://localhost:5001",
"commandLineArgs": "--with-db --start-index 1000 --save-temp 30 --no-security --secret-string-api 1234 --aasx-in-memory 1000 --data-path \"C:\\Development\\aasxs-repository\" --edit --external-blazor http://localhost:5001",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
Expand Down
2 changes: 1 addition & 1 deletion src/AasxServerDB/PageRetriever.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static List<AASXSet> GetPageAASXData(int size = 1000, string searchLower
(sme.SemanticId != null && sme.SemanticId.ToLower().Contains(searchLower)) ||
(sme.SMEType != null && sme.SMEType.ToLower().Contains(searchLower)) ||
(sme.TValue != null && sme.TValue.ToLower().Contains(searchLower)) ||
(withDateTime && sme.TimeStampTree.CompareTo(dateTime) > 0) ||
(withDateTime && sme.TimeStamp.CompareTo(dateTime) > 0) ||
db.OValueSets.Any(sv => sv.SMEId == sme.Id && (sv.Attribute.ToLower().Contains(searchLower) || ((string) sv.Value).ToLower().Contains(searchLower))) ||
(sme.TValue != null && (
(sme.TValue.Equals("S") && db.SValueSets.Any(sv => sv.SMEId == sme.Id && ((sv.Annotation != null && sv.Annotation.ToLower().Contains(searchLower)) || (sv.Value != null && sv.Value.ToLower().Contains(searchLower))))) ||
Expand Down
12 changes: 6 additions & 6 deletions src/AasxServerDB/Query.cs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ private List<SMEWithValue> GetSMEWithValue(string smSemanticId = "", string smId
.Where(sme =>
(sme.TValue == string.Empty || sme.TValue == null) &&
(!withSME || (sme.SemanticId != null && sme.SemanticId.Equals(semanticId))) &&
(!withDiff || sme.TimeStampTree.CompareTo(diff) > 0))
(!withDiff || sme.TimeStamp.CompareTo(diff) > 0))
.Select(sme => new SMEWithValue { sme = sme })
.ToList());
}
Expand All @@ -402,7 +402,7 @@ private List<SMEWithValue> GetSMEWithValue(string smSemanticId = "", string smId
db.SMESets
.Where(sme =>
(!withSME || (sme.SemanticId != null && sme.SemanticId.Equals(semanticId))) &&
(!withDiff || sme.TimeStampTree.CompareTo(diff) > 0)),
(!withDiff || sme.TimeStamp.CompareTo(diff) > 0)),
v => v.SMEId, sme => sme.Id, (v, sme) => new SMEWithValue { sme = sme, value = v.Value })
.ToList());
}
Expand Down Expand Up @@ -443,7 +443,7 @@ private List<SMEWithValue> GetSMEWithValue(string smSemanticId = "", string smId
(db.SMESets
.Where(sme =>
(!withSME || (sme.SemanticId != null && sme.SemanticId.Equals(semanticId))) &&
(!withDiff || sme.TimeStampTree.CompareTo(diff) > 0))),
(!withDiff || sme.TimeStamp.CompareTo(diff) > 0))),
v => v.SMEId, sme => sme.Id, (v, sme) => new SMEWithValue { sme = sme, value = v.Value.ToString() })
.ToList());
}
Expand Down Expand Up @@ -484,7 +484,7 @@ private List<SMEWithValue> GetSMEWithValue(string smSemanticId = "", string smId
(db.SMESets
.Where(sme =>
(!withSME || (sme.SemanticId != null && sme.SemanticId.Equals(semanticId))) &&
(!withDiff || sme.TimeStampTree.CompareTo(diff) > 0))),
(!withDiff || sme.TimeStamp.CompareTo(diff) > 0))),
v => v.SMEId, sme => sme.Id, (v, sme) => new SMEWithValue { sme = sme, value = v.Value.ToString() })
.ToList());
}
Expand All @@ -507,7 +507,7 @@ private List<SMEWithValue> GetSMEWithValue(string smSemanticId = "", string smId
db.SMESets
.Where(sme =>
(!withSME || (sme.SemanticId != null && sme.SemanticId.Equals(semanticId))) &&
(!withDiff || sme.TimeStampTree.CompareTo(diff) > 0)),
(!withDiff || sme.TimeStamp.CompareTo(diff) > 0)),
v => v.SMEId, sme => sme.Id, (v, sme) => new SMEWithValue { sme = sme, value = (string) v.Value })
.ToList());
}
Expand Down Expand Up @@ -548,7 +548,7 @@ private static List<SMEResult> GetSMEResult(List<SMEWithValue> smeList)
value = sme.value,
idShortPath = path,
url = $"{ExternalBlazor}/submodels/{Base64UrlEncoder.Encode(identifier)}/submodel-elements/{path}",
timeStampTree = TimeStamp.TimeStamp.DateTimeToString(sme.sme.TimeStampTree)
timeStamp = TimeStamp.TimeStamp.DateTimeToString(sme.sme.TimeStamp)
};
}
);
Expand Down
2 changes: 1 addition & 1 deletion src/AasxServerDB/Result/SMEResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ public class SMEResult
public string idShortPath { get; set; }
public string? value { get; set; }
public string? url { get; set; }
public string? timeStampTree { get; set; }
public string? timeStamp { get; set; }
}
}

0 comments on commit d46e7b3

Please sign in to comment.