Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
8ce50cceb7 | |||
9b4bbf4275 | |||
9e1171cf35 | |||
e42636853d | |||
c711fd6774 | |||
9225b76253 |
44
.vscode/tasks.json
vendored
44
.vscode/tasks.json
vendored
@ -1,50 +1,6 @@
|
|||||||
{
|
{
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"options": {
|
|
||||||
"env": {
|
|
||||||
"serverUserSecretsId": "6501aa0f-8499-4be5-96a9-e99b11323eeb"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tasks": [
|
"tasks": [
|
||||||
{
|
|
||||||
"label": "userSecretsInit",
|
|
||||||
"command": "dotnet",
|
|
||||||
"type": "process",
|
|
||||||
"args": [
|
|
||||||
"user-secrets",
|
|
||||||
"-p",
|
|
||||||
"${workspaceFolder}/Server/OI.Metrology.Server.csproj",
|
|
||||||
"init"
|
|
||||||
],
|
|
||||||
"problemMatcher": "$msCompile"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "userSecretsSet",
|
|
||||||
"command": "dotnet",
|
|
||||||
"type": "process",
|
|
||||||
"args": [
|
|
||||||
"user-secrets",
|
|
||||||
"-p",
|
|
||||||
"${workspaceFolder}/Server/OI.Metrology.Server.csproj",
|
|
||||||
"set",
|
|
||||||
"asdf",
|
|
||||||
"123"
|
|
||||||
],
|
|
||||||
"problemMatcher": "$msCompile"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "userSecretsMkLink",
|
|
||||||
"command": "cmd",
|
|
||||||
"type": "shell",
|
|
||||||
"args": [
|
|
||||||
"/c",
|
|
||||||
"mklink",
|
|
||||||
"/J",
|
|
||||||
".vscode\\UserSecrets",
|
|
||||||
"${userHome}\\AppData\\Roaming\\Microsoft\\UserSecrets\\$env:serverUserSecretsId"
|
|
||||||
],
|
|
||||||
"problemMatcher": "$msCompile"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"label": "buildServer",
|
"label": "buildServer",
|
||||||
"command": "dotnet",
|
"command": "dotnet",
|
||||||
|
71
.vscode/thunder-tests/thunderActivity.json
vendored
71
.vscode/thunder-tests/thunderActivity.json
vendored
@ -123,76 +123,5 @@
|
|||||||
"value": "1"
|
"value": "1"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
|
||||||
{
|
|
||||||
"_id": "4eafe190-e59e-4a3e-af76-356f62fde842",
|
|
||||||
"colId": "history",
|
|
||||||
"containerId": "",
|
|
||||||
"name": "https://oi-metrology-viewer-prod.mes.infineon.com/api/tooltypes",
|
|
||||||
"url": "https://oi-metrology-viewer-prod.mes.infineon.com/api/tooltypes",
|
|
||||||
"method": "GET",
|
|
||||||
"sortNum": 0,
|
|
||||||
"created": "2023-03-07T17:20:54.044Z",
|
|
||||||
"modified": "2023-03-07T17:20:54.044Z",
|
|
||||||
"headers": [],
|
|
||||||
"params": [],
|
|
||||||
"tests": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"_id": "280ea9be-50e3-4813-8eb0-ffff739fe196",
|
|
||||||
"colId": "history",
|
|
||||||
"containerId": "",
|
|
||||||
"name": "GetHeaders",
|
|
||||||
"url": "https://oi-metrology-viewer-prod.mes.infineon.com/api/export/headers",
|
|
||||||
"method": "GET",
|
|
||||||
"sortNum": 0,
|
|
||||||
"created": "2023-03-07T17:21:05.219Z",
|
|
||||||
"modified": "2023-03-07T19:35:11.146Z",
|
|
||||||
"headers": [],
|
|
||||||
"params": [],
|
|
||||||
"body": {
|
|
||||||
"type": "json",
|
|
||||||
"raw": "{\n \"PSN\": \"4698\",\n \"RDS\": \"578824\",\n \"Reactor\": \"62\",\n \"ID\": 1678296039\n}",
|
|
||||||
"form": []
|
|
||||||
},
|
|
||||||
"tests": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"_id": "6d8098aa-eb50-422e-b38d-32709d985e8e",
|
|
||||||
"colId": "history",
|
|
||||||
"containerId": "",
|
|
||||||
"name": "GetHeaders-Dev",
|
|
||||||
"url": "http://mestsa008/api/export/headers",
|
|
||||||
"method": "POST",
|
|
||||||
"sortNum": 0,
|
|
||||||
"created": "2023-03-07T17:21:05.219Z",
|
|
||||||
"modified": "2023-03-08T18:18:04.054Z",
|
|
||||||
"headers": [],
|
|
||||||
"params": [],
|
|
||||||
"body": {
|
|
||||||
"type": "json",
|
|
||||||
"raw": "{\n \"PSN\": \"4698\",\n \"RDS\": \"578824\",\n \"Reactor\": \"62\",\n \"ID\": 1678296039\n}",
|
|
||||||
"form": []
|
|
||||||
},
|
|
||||||
"tests": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"_id": "61383ad6-ceb4-4d98-86c1-bf00c0e4204d",
|
|
||||||
"colId": "history",
|
|
||||||
"containerId": "",
|
|
||||||
"name": "GetHeaders-localhost",
|
|
||||||
"url": "http://localhost:5126/api/export/headers",
|
|
||||||
"method": "GET",
|
|
||||||
"sortNum": 0,
|
|
||||||
"created": "2023-03-07T17:21:05.219Z",
|
|
||||||
"modified": "2023-03-08T19:05:54.744Z",
|
|
||||||
"headers": [],
|
|
||||||
"params": [],
|
|
||||||
"body": {
|
|
||||||
"type": "json",
|
|
||||||
"raw": "{\n \"PSN\": \"4698\",\n \"RDS\": \"578824\",\n \"Reactor\": \"62\",\n \"ID\": -1678296039\n}",
|
|
||||||
"form": []
|
|
||||||
},
|
|
||||||
"tests": []
|
|
||||||
}
|
}
|
||||||
]
|
]
|
14
.vscode/thunder-tests/thunderCollection.json
vendored
14
.vscode/thunder-tests/thunderCollection.json
vendored
@ -5,19 +5,5 @@
|
|||||||
"created": "2023-02-27T20:07:11.913Z",
|
"created": "2023-02-27T20:07:11.913Z",
|
||||||
"sortNum": 10000,
|
"sortNum": 10000,
|
||||||
"folders": []
|
"folders": []
|
||||||
},
|
|
||||||
{
|
|
||||||
"_id": "fb96b15a-0cc4-48c7-8767-34f1242750e8",
|
|
||||||
"colName": "Export EC",
|
|
||||||
"created": "2023-03-08T17:16:29.420Z",
|
|
||||||
"sortNum": 20000,
|
|
||||||
"folders": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"_id": "5bfd00bc-b58c-49d3-9f27-5acadd060a51",
|
|
||||||
"colName": "Export IFX",
|
|
||||||
"created": "2023-03-08T17:31:19.468Z",
|
|
||||||
"sortNum": 30000,
|
|
||||||
"folders": []
|
|
||||||
}
|
}
|
||||||
]
|
]
|
152
.vscode/thunder-tests/thunderclient.json
vendored
152
.vscode/thunder-tests/thunderclient.json
vendored
@ -265,157 +265,5 @@
|
|||||||
"value": "2"
|
"value": "2"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
|
||||||
{
|
|
||||||
"_id": "0aafd6ed-26a6-4a07-825c-8c1fee603b6a",
|
|
||||||
"colId": "fb96b15a-0cc4-48c7-8767-34f1242750e8",
|
|
||||||
"containerId": "",
|
|
||||||
"name": "GetHeaders",
|
|
||||||
"url": "https://oi-metrology-viewer-prod.mes.infineon.com/api/export/headers",
|
|
||||||
"method": "GET",
|
|
||||||
"sortNum": 10000,
|
|
||||||
"created": "2023-03-08T17:16:56.561Z",
|
|
||||||
"modified": "2023-03-08T17:17:39.783Z",
|
|
||||||
"headers": [],
|
|
||||||
"params": [],
|
|
||||||
"body": {
|
|
||||||
"type": "json",
|
|
||||||
"raw": "{\n \"PSN\": \"4698\",\n \"RDS\": \"578824\",\n \"Reactor\": \"62\",\n \"ID\": 1678296039\n}",
|
|
||||||
"form": []
|
|
||||||
},
|
|
||||||
"tests": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"_id": "af298148-482d-4822-80ba-1abb86e1f9c2",
|
|
||||||
"colId": "fb96b15a-0cc4-48c7-8767-34f1242750e8",
|
|
||||||
"containerId": "",
|
|
||||||
"name": "GetExport",
|
|
||||||
"url": "https://oi-metrology-viewer-prod.mes.infineon.com/api/export/export",
|
|
||||||
"method": "GET",
|
|
||||||
"sortNum": 15000,
|
|
||||||
"created": "2023-03-08T17:17:47.597Z",
|
|
||||||
"modified": "2023-03-08T17:19:13.764Z",
|
|
||||||
"headers": [],
|
|
||||||
"params": [],
|
|
||||||
"body": {
|
|
||||||
"type": "json",
|
|
||||||
"raw": "{\n \"PSN\": \"4698\",\n \"RDS\": \"578824\",\n \"Reactor\": \"62\",\n \"ID\": 1678296039\n}",
|
|
||||||
"form": []
|
|
||||||
},
|
|
||||||
"tests": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"_id": "a787c81d-381e-451d-9d96-e607f06efdaf",
|
|
||||||
"colId": "fb96b15a-0cc4-48c7-8767-34f1242750e8",
|
|
||||||
"containerId": "",
|
|
||||||
"name": "GetLogistics",
|
|
||||||
"url": "https://oi-metrology-viewer-prod.mes.infineon.com/api/export/logistics",
|
|
||||||
"method": "GET",
|
|
||||||
"sortNum": 30000,
|
|
||||||
"created": "2023-03-08T17:18:38.179Z",
|
|
||||||
"modified": "2023-03-08T17:19:21.874Z",
|
|
||||||
"headers": [],
|
|
||||||
"params": [],
|
|
||||||
"body": {
|
|
||||||
"type": "json",
|
|
||||||
"raw": "{\n \"PSN\": \"4698\",\n \"RDS\": \"578824\",\n \"Reactor\": \"62\",\n \"ID\": 1678296039\n}",
|
|
||||||
"form": []
|
|
||||||
},
|
|
||||||
"tests": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"_id": "7e19c7d4-2d93-46e1-88fd-ba5312885713",
|
|
||||||
"colId": "fb96b15a-0cc4-48c7-8767-34f1242750e8",
|
|
||||||
"containerId": "",
|
|
||||||
"name": "GetProcessDataStandardFormat",
|
|
||||||
"url": "https://oi-metrology-viewer-prod.mes.infineon.com/api/export/pdsf",
|
|
||||||
"method": "GET",
|
|
||||||
"sortNum": 40000,
|
|
||||||
"created": "2023-03-08T17:18:49.042Z",
|
|
||||||
"modified": "2023-03-08T17:19:27.119Z",
|
|
||||||
"headers": [],
|
|
||||||
"params": [],
|
|
||||||
"body": {
|
|
||||||
"type": "json",
|
|
||||||
"raw": "{\n \"PSN\": \"4698\",\n \"RDS\": \"578824\",\n \"Reactor\": \"62\",\n \"ID\": 1678296039\n}",
|
|
||||||
"form": []
|
|
||||||
},
|
|
||||||
"tests": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"_id": "25eb571f-064c-4b3f-8c20-666c66c1b123",
|
|
||||||
"colId": "5bfd00bc-b58c-49d3-9f27-5acadd060a51",
|
|
||||||
"containerId": "",
|
|
||||||
"name": "GetHeaders",
|
|
||||||
"url": "https://mestsa008.infineon.com:50302/api/export/headers",
|
|
||||||
"method": "GET",
|
|
||||||
"sortNum": 10000,
|
|
||||||
"created": "2023-03-08T17:31:19.471Z",
|
|
||||||
"modified": "2023-03-08T18:48:51.819Z",
|
|
||||||
"headers": [],
|
|
||||||
"params": [],
|
|
||||||
"body": {
|
|
||||||
"type": "json",
|
|
||||||
"raw": "{\n \"PSN\": \"4698\",\n \"RDS\": \"578824\",\n \"Reactor\": \"62\",\n \"ID\": 1678296039\n}",
|
|
||||||
"form": []
|
|
||||||
},
|
|
||||||
"tests": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"_id": "f5feb8e3-0e82-4b47-a15e-97ef069a1539",
|
|
||||||
"colId": "5bfd00bc-b58c-49d3-9f27-5acadd060a51",
|
|
||||||
"containerId": "",
|
|
||||||
"name": "GetExport",
|
|
||||||
"url": "https://mestsa008.infineon.com:50302/api/export/export",
|
|
||||||
"method": "GET",
|
|
||||||
"sortNum": 15000,
|
|
||||||
"created": "2023-03-08T17:31:19.472Z",
|
|
||||||
"modified": "2023-03-08T17:31:19.472Z",
|
|
||||||
"headers": [],
|
|
||||||
"params": [],
|
|
||||||
"body": {
|
|
||||||
"type": "json",
|
|
||||||
"raw": "{\n \"PSN\": \"4698\",\n \"RDS\": \"578824\",\n \"Reactor\": \"62\",\n \"ID\": 1678296039\n}",
|
|
||||||
"form": []
|
|
||||||
},
|
|
||||||
"tests": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"_id": "7fddba99-14a2-4c6a-bf4a-4b94391929cf",
|
|
||||||
"colId": "5bfd00bc-b58c-49d3-9f27-5acadd060a51",
|
|
||||||
"containerId": "",
|
|
||||||
"name": "GetLogistics",
|
|
||||||
"url": "https://mestsa008.infineon.com:50302/api/export/logistics",
|
|
||||||
"method": "GET",
|
|
||||||
"sortNum": 30000,
|
|
||||||
"created": "2023-03-08T17:31:19.473Z",
|
|
||||||
"modified": "2023-03-08T17:31:19.473Z",
|
|
||||||
"headers": [],
|
|
||||||
"params": [],
|
|
||||||
"body": {
|
|
||||||
"type": "json",
|
|
||||||
"raw": "{\n \"PSN\": \"4698\",\n \"RDS\": \"578824\",\n \"Reactor\": \"62\",\n \"ID\": 1678296039\n}",
|
|
||||||
"form": []
|
|
||||||
},
|
|
||||||
"tests": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"_id": "07d5b0c3-684a-4cad-8a48-b164e8da87b0",
|
|
||||||
"colId": "5bfd00bc-b58c-49d3-9f27-5acadd060a51",
|
|
||||||
"containerId": "",
|
|
||||||
"name": "GetProcessDataStandardFormat",
|
|
||||||
"url": "https://mestsa008.infineon.com:50302/api/export/pdsf",
|
|
||||||
"method": "GET",
|
|
||||||
"sortNum": 40000,
|
|
||||||
"created": "2023-03-08T17:31:19.474Z",
|
|
||||||
"modified": "2023-03-08T17:31:19.474Z",
|
|
||||||
"headers": [],
|
|
||||||
"params": [],
|
|
||||||
"body": {
|
|
||||||
"type": "json",
|
|
||||||
"raw": "{\n \"PSN\": \"4698\",\n \"RDS\": \"578824\",\n \"Reactor\": \"62\",\n \"ID\": 1678296039\n}",
|
|
||||||
"form": []
|
|
||||||
},
|
|
||||||
"tests": []
|
|
||||||
}
|
}
|
||||||
]
|
]
|
@ -30,11 +30,11 @@
|
|||||||
<PackageReference Include="Dapper" Version="2.0.123" />
|
<PackageReference Include="Dapper" Version="2.0.123" />
|
||||||
<PackageReference Include="EntityFramework" Version="6.4.4" />
|
<PackageReference Include="EntityFramework" Version="6.4.4" />
|
||||||
<PackageReference Include="jQuery" Version="3.6.3" />
|
<PackageReference Include="jQuery" Version="3.6.3" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="7.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="7.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
|
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.0" />
|
||||||
<PackageReference Include="Serilog.AspNetCore" Version="6.1.0" />
|
<PackageReference Include="Serilog.AspNetCore" Version="6.1.0" />
|
||||||
<PackageReference Include="Serilog.AspNetCore.Ingestion" Version="1.0.0-dev-00032" />
|
<PackageReference Include="Serilog.AspNetCore.Ingestion" Version="1.0.0-dev-00032" />
|
||||||
<PackageReference Include="Serilog.Settings.Configuration" Version="3.4.0" />
|
<PackageReference Include="Serilog.Settings.Configuration" Version="3.4.0" />
|
||||||
|
@ -15,68 +15,25 @@ public class ExportController : Controller, IExportController<IActionResult>
|
|||||||
public ExportController(IExportRepository exportRepository) =>
|
public ExportController(IExportRepository exportRepository) =>
|
||||||
_ExportRepository = exportRepository;
|
_ExportRepository = exportRepository;
|
||||||
|
|
||||||
private static string? GetJson(Stream stream)
|
|
||||||
{
|
|
||||||
string? result;
|
|
||||||
if (!stream.CanRead)
|
|
||||||
result = null;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Task<string> task = new StreamReader(stream).ReadToEndAsync();
|
|
||||||
result = task.Result;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static HeaderCommon GetHeaderCommon(Stream stream)
|
|
||||||
{
|
|
||||||
HeaderCommon? result;
|
|
||||||
string? json = GetJson(stream);
|
|
||||||
result = string.IsNullOrEmpty(json) ? null : JsonSerializer.Deserialize<HeaderCommon>(json);
|
|
||||||
result ??= new();
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("export")]
|
[Route("export")]
|
||||||
public IActionResult GetExport() =>
|
public IActionResult GetExport(HeaderCommon headerCommon) =>
|
||||||
Content(_ExportRepository.GetExport(GetHeaderCommon(Request.Body)));
|
Content(_ExportRepository.GetExport(headerCommon));
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("headers")]
|
[Route("headers")]
|
||||||
public IActionResult GetHeaders() =>
|
public IActionResult GetHeaders(HeaderCommon headerCommon) =>
|
||||||
Json(_ExportRepository.GetHeaders(GetHeaderCommon(Request.Body)), new JsonSerializerOptions { PropertyNamingPolicy = null, WriteIndented = true });
|
Json(_ExportRepository.GetHeaders(headerCommon), new JsonSerializerOptions { PropertyNamingPolicy = null, WriteIndented = true });
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("logistics")]
|
[Route("logistics")]
|
||||||
public IActionResult GetLogistics() =>
|
public IActionResult GetLogistics(HeaderCommon headerCommon) =>
|
||||||
Json(_ExportRepository.GetLogistics(GetHeaderCommon(Request.Body)), new JsonSerializerOptions { PropertyNamingPolicy = null, WriteIndented = true });
|
Json(_ExportRepository.GetLogistics(headerCommon), new JsonSerializerOptions { PropertyNamingPolicy = null, WriteIndented = true });
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("pdsf")]
|
[Route("pdsf")]
|
||||||
[Route("processDataStandardFormat")]
|
[Route("processDataStandardFormat")]
|
||||||
public IActionResult GetProcessDataStandardFormat() =>
|
public IActionResult GetProcessDataStandardFormat(HeaderCommon headerCommon) =>
|
||||||
Content(_ExportRepository.GetProcessDataStandardFormat(GetHeaderCommon(Request.Body)));
|
Content(_ExportRepository.GetProcessDataStandardFormat(headerCommon));
|
||||||
|
|
||||||
[HttpPost]
|
|
||||||
[Route("export")]
|
|
||||||
public IActionResult PostExport() =>
|
|
||||||
Content(_ExportRepository.GetExport(GetHeaderCommon(Request.Body)));
|
|
||||||
|
|
||||||
[HttpPost]
|
|
||||||
[Route("headers")]
|
|
||||||
public IActionResult PostHeaders() =>
|
|
||||||
Json(_ExportRepository.GetHeaders(GetHeaderCommon(Request.Body)), new JsonSerializerOptions { PropertyNamingPolicy = null, WriteIndented = true });
|
|
||||||
|
|
||||||
[HttpPost]
|
|
||||||
[Route("logistics")]
|
|
||||||
public IActionResult PostLogistics() =>
|
|
||||||
Json(_ExportRepository.GetLogistics(GetHeaderCommon(Request.Body)), new JsonSerializerOptions { PropertyNamingPolicy = null, WriteIndented = true });
|
|
||||||
|
|
||||||
[HttpPost]
|
|
||||||
[Route("pdsf")]
|
|
||||||
[Route("processDataStandardFormat")]
|
|
||||||
public IActionResult PostProcessDataStandardFormat() =>
|
|
||||||
Content(_ExportRepository.GetProcessDataStandardFormat(GetHeaderCommon(Request.Body)));
|
|
||||||
|
|
||||||
}
|
}
|
@ -30,29 +30,9 @@ public partial class InboundController : ControllerBase, IInboundController<IAct
|
|||||||
_MetrologyRepository = metrologyRepository;
|
_MetrologyRepository = metrologyRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string? GetJson(Stream stream)
|
|
||||||
{
|
|
||||||
string? result;
|
|
||||||
if (!stream.CanRead)
|
|
||||||
result = null;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Task<string> task = new StreamReader(stream).ReadToEndAsync();
|
|
||||||
result = task.Result;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static JToken GetJToken(Stream stream)
|
|
||||||
{
|
|
||||||
string? json = GetJson(stream);
|
|
||||||
JToken jsonbody = string.IsNullOrEmpty(json) ? JToken.Parse("{}") : JToken.Parse(json);
|
|
||||||
return jsonbody;
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Route("{tooltype}")]
|
[Route("{tooltype}")]
|
||||||
public IActionResult Post(string tooltype)
|
public IActionResult Post(string tooltype, [FromBody] JToken jsonbody)
|
||||||
{
|
{
|
||||||
IPAddress? remoteIP = HttpContext.Connection.RemoteIpAddress;
|
IPAddress? remoteIP = HttpContext.Connection.RemoteIpAddress;
|
||||||
if (!_InboundRepository.IsIPAddressAllowed(_AppSettings.InboundApiAllowedIPList, remoteIP))
|
if (!_InboundRepository.IsIPAddressAllowed(_AppSettings.InboundApiAllowedIPList, remoteIP))
|
||||||
@ -62,7 +42,18 @@ public partial class InboundController : ControllerBase, IInboundController<IAct
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
JToken jsonbody = GetJToken(Request.Body);
|
if (jsonbody is null || !jsonbody.Any())
|
||||||
|
{
|
||||||
|
if (!Request.Body.CanRead)
|
||||||
|
jsonbody = JToken.Parse("{}");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
using Stream stream = Request.Body;
|
||||||
|
_ = stream.Seek(0, SeekOrigin.Begin);
|
||||||
|
string json = new StreamReader(stream).ReadToEnd();
|
||||||
|
jsonbody = JToken.Parse(json);
|
||||||
|
}
|
||||||
|
}
|
||||||
DataResponse dataResponse = _InboundRepository.Data(_MetrologyRepository, _InboundDataService, tooltype, jsonbody);
|
DataResponse dataResponse = _InboundRepository.Data(_MetrologyRepository, _InboundDataService, tooltype, jsonbody);
|
||||||
if (!dataResponse.Errors.Any())
|
if (!dataResponse.Errors.Any())
|
||||||
return Ok(dataResponse);
|
return Ok(dataResponse);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
<SccProjectName>SAK</SccProjectName>
|
<SccProjectName>SAK</SccProjectName>
|
||||||
<SccProvider>SAK</SccProvider>
|
<SccProvider>SAK</SccProvider>
|
||||||
@ -28,14 +28,14 @@
|
|||||||
<PackageReference Include="Dapper" Version="2.0.123" />
|
<PackageReference Include="Dapper" Version="2.0.123" />
|
||||||
<PackageReference Include="EntityFramework" Version="6.4.4" />
|
<PackageReference Include="EntityFramework" Version="6.4.4" />
|
||||||
<PackageReference Include="jQuery" Version="3.6.3" />
|
<PackageReference Include="jQuery" Version="3.6.3" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="7.0.4" />
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="7.0.2" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="7.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="7.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
|
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.0" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
|
||||||
<PackageReference Include="Serilog.AspNetCore.Ingestion" Version="1.0.0-dev-00032" />
|
<PackageReference Include="Serilog.AspNetCore.Ingestion" Version="1.0.0-dev-00032" />
|
||||||
<PackageReference Include="Serilog.AspNetCore" Version="6.1.0" />
|
<PackageReference Include="Serilog.AspNetCore" Version="6.1.0" />
|
||||||
<PackageReference Include="Serilog.Settings.Configuration" Version="3.4.0" />
|
<PackageReference Include="Serilog.Settings.Configuration" Version="3.4.0" />
|
||||||
|
@ -9,6 +9,7 @@ namespace OI.Metrology.Server.Repository;
|
|||||||
public class ExportRepository : IExportRepository
|
public class ExportRepository : IExportRepository
|
||||||
{
|
{
|
||||||
|
|
||||||
|
private readonly string _MockRoot;
|
||||||
private readonly Serilog.ILogger _Log;
|
private readonly Serilog.ILogger _Log;
|
||||||
private readonly string _RepositoryName;
|
private readonly string _RepositoryName;
|
||||||
private readonly AppSettings _AppSettings;
|
private readonly AppSettings _AppSettings;
|
||||||
@ -17,6 +18,7 @@ public class ExportRepository : IExportRepository
|
|||||||
public ExportRepository(AppSettings appSettings)
|
public ExportRepository(AppSettings appSettings)
|
||||||
{
|
{
|
||||||
_AppSettings = appSettings;
|
_AppSettings = appSettings;
|
||||||
|
_MockRoot = appSettings.MockRoot;
|
||||||
_RdsToHeaderCommonCollection = new();
|
_RdsToHeaderCommonCollection = new();
|
||||||
_RepositoryName = nameof(ExportRepository)[..^10];
|
_RepositoryName = nameof(ExportRepository)[..^10];
|
||||||
_Log = Serilog.Log.ForContext<ExportRepository>();
|
_Log = Serilog.Log.ForContext<ExportRepository>();
|
||||||
@ -25,10 +27,9 @@ public class ExportRepository : IExportRepository
|
|||||||
private static string[] Get()
|
private static string[] Get()
|
||||||
{
|
{
|
||||||
DateTime dateTime = DateTime.Now;
|
DateTime dateTime = DateTime.Now;
|
||||||
DateTime lastWeekDateTime = dateTime.AddDays(-7);
|
|
||||||
Calendar calendar = new CultureInfo("en-US").Calendar;
|
Calendar calendar = new CultureInfo("en-US").Calendar;
|
||||||
string weekOfYear = $"{dateTime:yyyy}_Week_{calendar.GetWeekOfYear(dateTime, CalendarWeekRule.FirstDay, DayOfWeek.Sunday):00}";
|
string weekOfYear = calendar.GetWeekOfYear(dateTime, CalendarWeekRule.FirstDay, DayOfWeek.Sunday).ToString("00");
|
||||||
string lastWeekOfYear = $"{lastWeekDateTime:yyyy}_Week_{calendar.GetWeekOfYear(lastWeekDateTime, CalendarWeekRule.FirstDay, DayOfWeek.Sunday):00}";
|
string lastWeekOfYear = calendar.GetWeekOfYear(dateTime.AddDays(7), CalendarWeekRule.FirstDay, DayOfWeek.Sunday).ToString("00");
|
||||||
return new string[] { weekOfYear, lastWeekOfYear };
|
return new string[] { weekOfYear, lastWeekOfYear };
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,13 +40,10 @@ public class ExportRepository : IExportRepository
|
|||||||
string[] weeks = Get();
|
string[] weeks = Get();
|
||||||
foreach (string weekYear in weeks)
|
foreach (string weekYear in weeks)
|
||||||
{
|
{
|
||||||
if (headerCommon.ID < 1)
|
|
||||||
directory = Path.Combine(_AppSettings.ApiExportPath, weekYear, $"-{headerCommon.PSN}", $"-{headerCommon.Reactor}", $"-{headerCommon.RDS}");
|
|
||||||
else
|
|
||||||
directory = Path.Combine(_AppSettings.ApiExportPath, weekYear, $"-{headerCommon.PSN}", $"-{headerCommon.Reactor}", $"-{headerCommon.RDS}", $"-{headerCommon.ID}");
|
directory = Path.Combine(_AppSettings.ApiExportPath, weekYear, $"-{headerCommon.PSN}", $"-{headerCommon.Reactor}", $"-{headerCommon.RDS}", $"-{headerCommon.ID}");
|
||||||
if (!Directory.Exists(directory))
|
if (!Directory.Exists(directory))
|
||||||
continue;
|
continue;
|
||||||
results.AddRange(Directory.GetFiles(directory, searchPattern, SearchOption.AllDirectories));
|
results.AddRange(Directory.GetFiles(directory, searchPattern, SearchOption.TopDirectoryOnly));
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
@ -53,25 +51,34 @@ public class ExportRepository : IExportRepository
|
|||||||
string IExportRepository.GetExport(HeaderCommon headerCommon)
|
string IExportRepository.GetExport(HeaderCommon headerCommon)
|
||||||
{
|
{
|
||||||
string result;
|
string result;
|
||||||
|
if (!string.IsNullOrEmpty(_MockRoot))
|
||||||
|
result = File.ReadAllText(Path.Combine(string.Concat(AppContext.BaseDirectory, _MockRoot), $"{_RepositoryName}-{nameof(IExportRepository.GetExport)}.txt"));
|
||||||
|
else
|
||||||
|
{
|
||||||
List<string> files = GetFiles(headerCommon, "*.txt");
|
List<string> files = GetFiles(headerCommon, "*.txt");
|
||||||
if (files.Count != 1)
|
if (files.Count != 1)
|
||||||
result = string.Empty;
|
result = string.Empty;
|
||||||
else
|
else
|
||||||
result = File.ReadAllText(files.First());
|
result = File.ReadAllText(files.First());
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<HeaderCommon[]> IExportRepository.GetHeaders(HeaderCommon headerCommon)
|
Result<HeaderCommon[]> IExportRepository.GetHeaders(HeaderCommon headerCommon)
|
||||||
{
|
{
|
||||||
Result<HeaderCommon[]>? result;
|
Result<HeaderCommon[]>? result;
|
||||||
|
if (!string.IsNullOrEmpty(_MockRoot))
|
||||||
|
{
|
||||||
|
string json = File.ReadAllText(Path.Combine(string.Concat(AppContext.BaseDirectory, _MockRoot), $"{_RepositoryName}-{nameof(IExportRepository.GetHeaders)}.json"));
|
||||||
|
result = JsonSerializer.Deserialize<Result<HeaderCommon[]>>(json);
|
||||||
|
if (result is null)
|
||||||
|
throw new NullReferenceException(nameof(result));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
List<HeaderCommon> results = new();
|
List<HeaderCommon> results = new();
|
||||||
string json;
|
string json;
|
||||||
HeaderCommon? hc;
|
HeaderCommon? hc;
|
||||||
string? directory;
|
|
||||||
string directoryName;
|
|
||||||
JsonElement? jsonElement;
|
|
||||||
const string ticks = "Ticks";
|
|
||||||
JsonProperty[] jsonProperties;
|
|
||||||
List<string> files = GetFiles(headerCommon, "*.json");
|
List<string> files = GetFiles(headerCommon, "*.json");
|
||||||
foreach (string file in files)
|
foreach (string file in files)
|
||||||
{
|
{
|
||||||
@ -79,23 +86,6 @@ public class ExportRepository : IExportRepository
|
|||||||
hc = JsonSerializer.Deserialize<HeaderCommon>(json);
|
hc = JsonSerializer.Deserialize<HeaderCommon>(json);
|
||||||
if (hc is null)
|
if (hc is null)
|
||||||
continue;
|
continue;
|
||||||
if (hc.ID < 1)
|
|
||||||
{
|
|
||||||
directory = Path.GetDirectoryName(file);
|
|
||||||
if (directory is null)
|
|
||||||
continue;
|
|
||||||
directoryName = Path.GetFileName(directory);
|
|
||||||
if (directoryName.Length < 1 || directoryName[0] != '-' || !long.TryParse(directoryName[1..], out long id))
|
|
||||||
continue;
|
|
||||||
hc.ID = id;
|
|
||||||
}
|
|
||||||
jsonElement = JsonSerializer.Deserialize<JsonElement>(json);
|
|
||||||
if (jsonElement is not null && jsonElement.Value.ValueKind == JsonValueKind.Object)
|
|
||||||
{
|
|
||||||
jsonProperties = (from l in jsonElement.Value.EnumerateObject() where l.Name == ticks select l).ToArray();
|
|
||||||
if (jsonProperties.Any() && long.TryParse(jsonProperties[0].Value.ToString(), out long ticksValue))
|
|
||||||
hc.Date = new(ticksValue);
|
|
||||||
}
|
|
||||||
results.Add(hc);
|
results.Add(hc);
|
||||||
}
|
}
|
||||||
result = new()
|
result = new()
|
||||||
@ -103,12 +93,23 @@ public class ExportRepository : IExportRepository
|
|||||||
Results = results.ToArray(),
|
Results = results.ToArray(),
|
||||||
TotalRows = results.Count,
|
TotalRows = results.Count,
|
||||||
};
|
};
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<HeaderCommon[]> IExportRepository.GetLogistics(HeaderCommon headerCommon)
|
Result<HeaderCommon[]> IExportRepository.GetLogistics(HeaderCommon headerCommon)
|
||||||
{
|
{
|
||||||
Result<HeaderCommon[]>? result;
|
Result<HeaderCommon[]>? result;
|
||||||
|
if (!string.IsNullOrEmpty(_MockRoot))
|
||||||
|
{
|
||||||
|
string json = File.ReadAllText(Path.Combine(string.Concat(AppContext.BaseDirectory, _MockRoot), $"{_RepositoryName}-{nameof(IExportRepository.GetLogistics)}.json"));
|
||||||
|
result = JsonSerializer.Deserialize<Result<HeaderCommon[]>>(json);
|
||||||
|
if (result is null)
|
||||||
|
throw new NullReferenceException(nameof(result));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
List<HeaderCommon> results = new();
|
List<HeaderCommon> results = new();
|
||||||
string json;
|
string json;
|
||||||
HeaderCommon? hc;
|
HeaderCommon? hc;
|
||||||
@ -126,17 +127,23 @@ public class ExportRepository : IExportRepository
|
|||||||
Results = results.ToArray(),
|
Results = results.ToArray(),
|
||||||
TotalRows = results.Count,
|
TotalRows = results.Count,
|
||||||
};
|
};
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
string IExportRepository.GetProcessDataStandardFormat(HeaderCommon headerCommon)
|
string IExportRepository.GetProcessDataStandardFormat(HeaderCommon headerCommon)
|
||||||
{
|
{
|
||||||
string result;
|
string result;
|
||||||
|
if (!string.IsNullOrEmpty(_MockRoot))
|
||||||
|
result = File.ReadAllText(Path.Combine(string.Concat(AppContext.BaseDirectory, _MockRoot), $"{_RepositoryName}-{nameof(IExportRepository.GetProcessDataStandardFormat)}.pdsf"));
|
||||||
|
else
|
||||||
|
{
|
||||||
List<string> files = GetFiles(headerCommon, "*.pdsf");
|
List<string> files = GetFiles(headerCommon, "*.pdsf");
|
||||||
if (files.Count != 1)
|
if (files.Count != 1)
|
||||||
result = string.Empty;
|
result = string.Empty;
|
||||||
else
|
else
|
||||||
result = File.ReadAllText(files.First());
|
result = File.ReadAllText(files.First());
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,39 +177,6 @@ public class InfinityQSRepository : IInfinityQSRepository
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
string IInfinityQSRepository.GetCommandText(InfinityQSBase infinityQSBase)
|
|
||||||
{
|
|
||||||
StringBuilder result = new();
|
|
||||||
if (string.IsNullOrEmpty(infinityQSBase.PR_NAME))
|
|
||||||
throw new ArgumentException(nameof(infinityQSBase.PR_NAME));
|
|
||||||
if (string.IsNullOrEmpty(infinityQSBase.PD_NAME))
|
|
||||||
throw new ArgumentException(nameof(infinityQSBase.PD_NAME));
|
|
||||||
if (infinityQSBase.SE_SGTM is null)
|
|
||||||
throw new ArgumentException(nameof(infinityQSBase.SE_SGTM));
|
|
||||||
_ = result
|
|
||||||
.AppendLine(" select ")
|
|
||||||
.AppendLine(" ev.f_evnt [ev_evnt], ")
|
|
||||||
.AppendLine(" ev.f_sgtm [ev_sgtm], ")
|
|
||||||
.AppendLine(" dateadd(HH, -7, (dateadd(SS, convert(bigint, ev.f_sgtm), '19700101'))) [ev_utc7], ")
|
|
||||||
.AppendLine(" pr.f_name [pr_name], ")
|
|
||||||
.AppendLine(" pd.f_name [pd_name], ")
|
|
||||||
.AppendLine(" td.f_test [td_test], ")
|
|
||||||
.AppendLine(" td.f_name [td_name], ")
|
|
||||||
.AppendLine(" ev.f_name [ev_name] ")
|
|
||||||
.AppendLine(" from [spcepiworld].[dbo].[evnt_inf] ev ")
|
|
||||||
.AppendLine(" join [spcepiworld].[dbo].[prcs_dat] pr ")
|
|
||||||
.AppendLine(" on ev.f_prcs = pr.f_prcs ")
|
|
||||||
.AppendLine(" join [spcepiworld].[dbo].[part_dat] pd ")
|
|
||||||
.AppendLine(" on ev.f_part = pd.f_part ")
|
|
||||||
.AppendLine(" join [spcepiworld].[dbo].[test_dat] td ")
|
|
||||||
.AppendLine(" on ev.f_test = td.f_test ")
|
|
||||||
.Append(" where pr.f_name = '").Append(infinityQSBase.PR_NAME).AppendLine("' ")
|
|
||||||
.Append(" and pd.f_name = '").Append(infinityQSBase.PD_NAME).AppendLine("' ")
|
|
||||||
.Append(" and ev.f_sgtm = ").Append(infinityQSBase.SE_SGTM).AppendLine(" ")
|
|
||||||
.AppendLine(" for json path ");
|
|
||||||
return result.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
Result<InfinityQSEvent[]> IInfinityQSRepository.GetEvents(string subGroupId)
|
Result<InfinityQSEvent[]> IInfinityQSRepository.GetEvents(string subGroupId)
|
||||||
{
|
{
|
||||||
Result<InfinityQSEvent[]>? result;
|
Result<InfinityQSEvent[]>? result;
|
||||||
@ -229,7 +196,7 @@ public class InfinityQSRepository : IInfinityQSRepository
|
|||||||
results = Array.Empty<InfinityQSEvent>();
|
results = Array.Empty<InfinityQSEvent>();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string commandText = infinityQSRepository.GetCommandText(infinityQSBase);
|
string commandText = $"select * from [spcepiworld].[dbo].[evnt_inf] ev where ev.f_prcs = '{infinityQSBase.PR_NAME}' and ev.f_part = '{infinityQSBase.PD_NAME}' and ev.f_sgtm = {infinityQSBase.SE_SGTM} ";
|
||||||
StringBuilder stringBuilder = GetForJsonPath(_DBConnectionFactory, commandText);
|
StringBuilder stringBuilder = GetForJsonPath(_DBConnectionFactory, commandText);
|
||||||
results = JsonSerializer.Deserialize<InfinityQSEvent[]>(stringBuilder.ToString(), new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
|
results = JsonSerializer.Deserialize<InfinityQSEvent[]>(stringBuilder.ToString(), new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
|
||||||
if (results is null)
|
if (results is null)
|
||||||
|
@ -26,7 +26,7 @@ public class InfinityQSV2Repository : IInfinityQSV2Repository
|
|||||||
{
|
{
|
||||||
StringBuilder result = new();
|
StringBuilder result = new();
|
||||||
if (string.IsNullOrEmpty(subGroupId))
|
if (string.IsNullOrEmpty(subGroupId))
|
||||||
throw new ArgumentException(null, nameof(subGroupId));
|
throw new ArgumentException(nameof(subGroupId));
|
||||||
_ = result
|
_ = result
|
||||||
.AppendLine(" select ")
|
.AppendLine(" select ")
|
||||||
.AppendLine(" sd.f_sgrp sd_sgrp, ")
|
.AppendLine(" sd.f_sgrp sd_sgrp, ")
|
||||||
@ -50,7 +50,7 @@ public class InfinityQSV2Repository : IInfinityQSV2Repository
|
|||||||
StringBuilder result = new();
|
StringBuilder result = new();
|
||||||
const string dateTimeFormat = "yyyy-MM-dd HH:mm:ss";
|
const string dateTimeFormat = "yyyy-MM-dd HH:mm:ss";
|
||||||
if (!string.IsNullOrEmpty(dateTime) && (dateTime.Contains('-') || dateTime.Contains(' ') || dateTime.Contains(':')) && dateTime.Length != dateTimeFormat.Length)
|
if (!string.IsNullOrEmpty(dateTime) && (dateTime.Contains('-') || dateTime.Contains(' ') || dateTime.Contains(':')) && dateTime.Length != dateTimeFormat.Length)
|
||||||
throw new ArgumentException(null, nameof(dateTime));
|
throw new ArgumentException(nameof(dateTime));
|
||||||
_ = result
|
_ = result
|
||||||
.AppendLine(" select ")
|
.AppendLine(" select ")
|
||||||
.AppendLine(" se.f_sgrp se_sgrp, ")
|
.AppendLine(" se.f_sgrp se_sgrp, ")
|
||||||
@ -180,39 +180,6 @@ public class InfinityQSV2Repository : IInfinityQSV2Repository
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
string IInfinityQSV2Repository.GetCommandText(InfinityQSBaseV2 infinityQSBase)
|
|
||||||
{
|
|
||||||
StringBuilder result = new();
|
|
||||||
if (string.IsNullOrEmpty(infinityQSBase.Process))
|
|
||||||
throw new ArgumentException(nameof(infinityQSBase.Process));
|
|
||||||
if (string.IsNullOrEmpty(infinityQSBase.Part))
|
|
||||||
throw new ArgumentException(nameof(infinityQSBase.Part));
|
|
||||||
if (infinityQSBase.SubGroupDateTime is null)
|
|
||||||
throw new ArgumentException(nameof(infinityQSBase.SubGroupDateTime));
|
|
||||||
_ = result
|
|
||||||
.AppendLine(" select ")
|
|
||||||
.AppendLine(" ev.f_evnt [ev_evnt], ")
|
|
||||||
.AppendLine(" ev.f_sgtm [ev_sgtm], ")
|
|
||||||
.AppendLine(" dateadd(HH, -7, (dateadd(SS, convert(bigint, ev.f_sgtm), '19700101'))) [ev_utc7], ")
|
|
||||||
.AppendLine(" pr.f_name [pr_name], ")
|
|
||||||
.AppendLine(" pd.f_name [pd_name], ")
|
|
||||||
.AppendLine(" td.f_test [td_test], ")
|
|
||||||
.AppendLine(" td.f_name [td_name], ")
|
|
||||||
.AppendLine(" ev.f_name [ev_name] ")
|
|
||||||
.AppendLine(" from [spcepiworld].[dbo].[evnt_inf] ev ")
|
|
||||||
.AppendLine(" join [spcepiworld].[dbo].[prcs_dat] pr ")
|
|
||||||
.AppendLine(" on ev.f_prcs = pr.f_prcs ")
|
|
||||||
.AppendLine(" join [spcepiworld].[dbo].[part_dat] pd ")
|
|
||||||
.AppendLine(" on ev.f_part = pd.f_part ")
|
|
||||||
.AppendLine(" join [spcepiworld].[dbo].[test_dat] td ")
|
|
||||||
.AppendLine(" on ev.f_test = td.f_test ")
|
|
||||||
.Append(" where pr.f_name = '").Append(infinityQSBase.Process).AppendLine("' ")
|
|
||||||
.Append(" and pd.f_name = '").Append(infinityQSBase.Part).AppendLine("' ")
|
|
||||||
.Append(" and ev.f_sgtm = ").Append(infinityQSBase.SubGroupDateTime).AppendLine(" ")
|
|
||||||
.AppendLine(" for json path ");
|
|
||||||
return result.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
Result<InfinityQSEventV2[]> IInfinityQSV2Repository.GetEvents(string subGroupId)
|
Result<InfinityQSEventV2[]> IInfinityQSV2Repository.GetEvents(string subGroupId)
|
||||||
{
|
{
|
||||||
Result<InfinityQSEventV2[]>? result;
|
Result<InfinityQSEventV2[]>? result;
|
||||||
@ -232,7 +199,7 @@ public class InfinityQSV2Repository : IInfinityQSV2Repository
|
|||||||
collection = Array.Empty<InfinityQSEvent>();
|
collection = Array.Empty<InfinityQSEvent>();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string commandText = infinityQSV2Repository.GetCommandText(infinityQSBase);
|
string commandText = $"select * from [spcepiworld].[dbo].[evnt_inf] ev where ev.f_prcs = '{infinityQSBase.Process}' and ev.f_part = '{infinityQSBase.Part}' and ev.f_sgtm = {infinityQSBase.SubGroupDateTime} ";
|
||||||
StringBuilder stringBuilder = GetForJsonPath(_DBConnectionFactory, commandText);
|
StringBuilder stringBuilder = GetForJsonPath(_DBConnectionFactory, commandText);
|
||||||
collection = JsonSerializer.Deserialize<InfinityQSEvent[]>(stringBuilder.ToString(), new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
|
collection = JsonSerializer.Deserialize<InfinityQSEvent[]>(stringBuilder.ToString(), new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
|
||||||
if (collection is null)
|
if (collection is null)
|
||||||
|
@ -492,7 +492,7 @@ function recipeParametersButtonRunInfo() {
|
|||||||
var gridCreated = $("#ModalBodyGrid").data("igGrid");
|
var gridCreated = $("#ModalBodyGrid").data("igGrid");
|
||||||
if (gridCreated)
|
if (gridCreated)
|
||||||
$("#ModalBodyGrid").igGrid("destroy");
|
$("#ModalBodyGrid").igGrid("destroy");
|
||||||
$.getJSON('https://oi-prod-ec-api.mes.infineon.com/api/oiWizard/materials/rds/' + jsonObject.RDS, function (data) {
|
$.getJSON('http://messa020ec.ec.local/api/oiWizard/materials/rds/' + jsonObject.RDS, function (data) {
|
||||||
$("#RecipeParametersButton").prop("disabled", false);
|
$("#RecipeParametersButton").prop("disabled", false);
|
||||||
var text = "";
|
var text = "";
|
||||||
for (var i = 0; i < data.rds.rdsLayers.length; i++) {
|
for (var i = 0; i < data.rds.rdsLayers.length; i++) {
|
||||||
|
@ -1,13 +1,27 @@
|
|||||||
namespace OI.Metrology.Shared.DataModels;
|
namespace OI.Metrology.Shared.DataModels;
|
||||||
|
|
||||||
public record InfinityQSEvent(int EV_EVNT,
|
public record InfinityQSEvent(int F_EVNT,
|
||||||
int EV_SGTM,
|
int F_CRTM,
|
||||||
string EV_UTC7,
|
int F_EDTM,
|
||||||
string PR_NAME,
|
int F_TYPE,
|
||||||
string PD_NAME,
|
string F_NAME,
|
||||||
int TD_TEST,
|
int F_EMPL,
|
||||||
string TD_NAME,
|
int F_EVTM,
|
||||||
string EV_NAME)
|
int F_PRCS,
|
||||||
|
int F_PART,
|
||||||
|
int F_TEST,
|
||||||
|
int F_SGTM,
|
||||||
|
int F_ACC,
|
||||||
|
int F_ACEM,
|
||||||
|
int F_ACTM,
|
||||||
|
int F_CAC,
|
||||||
|
int F_CAEM,
|
||||||
|
int F_CATM,
|
||||||
|
int F_FLAG,
|
||||||
|
int F_USER,
|
||||||
|
int F_DSBL,
|
||||||
|
int F_RFC,
|
||||||
|
int F_TRTM)
|
||||||
{
|
{
|
||||||
|
|
||||||
public static InfinityQSEventV2[] Convert(InfinityQSEvent[] collection)
|
public static InfinityQSEventV2[] Convert(InfinityQSEvent[] collection)
|
||||||
@ -20,25 +34,53 @@ public record InfinityQSEvent(int EV_EVNT,
|
|||||||
|
|
||||||
public static InfinityQSEventV2 Map(InfinityQSEvent item)
|
public static InfinityQSEventV2 Map(InfinityQSEvent item)
|
||||||
{
|
{
|
||||||
InfinityQSEventV2 result = new(item.EV_EVNT,
|
InfinityQSEventV2 result = new(item.F_EVNT,
|
||||||
item.EV_SGTM,
|
item.F_CRTM,
|
||||||
item.EV_UTC7,
|
item.F_EDTM,
|
||||||
item.PR_NAME,
|
item.F_TYPE,
|
||||||
item.PD_NAME,
|
item.F_NAME,
|
||||||
item.TD_TEST,
|
item.F_EMPL,
|
||||||
item.TD_NAME,
|
item.F_EVTM,
|
||||||
item.EV_NAME);
|
item.F_PRCS,
|
||||||
|
item.F_PART,
|
||||||
|
item.F_TEST,
|
||||||
|
item.F_SGTM,
|
||||||
|
item.F_ACC,
|
||||||
|
item.F_ACEM,
|
||||||
|
item.F_ACTM,
|
||||||
|
item.F_CAC,
|
||||||
|
item.F_CAEM,
|
||||||
|
item.F_CATM,
|
||||||
|
item.F_FLAG,
|
||||||
|
item.F_USER,
|
||||||
|
item.F_DSBL,
|
||||||
|
item.F_RFC,
|
||||||
|
item.F_TRTM);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public record InfinityQSEventV2(int EventId,
|
public record InfinityQSEventV2(int Evnt,
|
||||||
int SubGroupDateTimeId,
|
int Crtm,
|
||||||
string SubGroupDateTime,
|
int Edtm,
|
||||||
string Process,
|
int Type,
|
||||||
string Part,
|
string Name,
|
||||||
int VariableNumber,
|
int Empl,
|
||||||
string Variable,
|
int Evtm,
|
||||||
string Name)
|
int Prcs,
|
||||||
|
int Part,
|
||||||
|
int Test,
|
||||||
|
int Sgtm,
|
||||||
|
int Acc,
|
||||||
|
int Acem,
|
||||||
|
int Actm,
|
||||||
|
int Cac,
|
||||||
|
int Caem,
|
||||||
|
int Catm,
|
||||||
|
int Flag,
|
||||||
|
int User,
|
||||||
|
int Dsbl,
|
||||||
|
int Rfc,
|
||||||
|
int Trtm)
|
||||||
{ }
|
{ }
|
@ -1,3 +1,5 @@
|
|||||||
|
using OI.Metrology.Shared.DataModels;
|
||||||
|
|
||||||
namespace OI.Metrology.Shared.Models.Stateless;
|
namespace OI.Metrology.Shared.Models.Stateless;
|
||||||
|
|
||||||
public interface IExportController<T>
|
public interface IExportController<T>
|
||||||
@ -12,13 +14,9 @@ public interface IExportController<T>
|
|||||||
}
|
}
|
||||||
|
|
||||||
static string GetRouteName() => nameof(IExportController<T>)[1..^10];
|
static string GetRouteName() => nameof(IExportController<T>)[1..^10];
|
||||||
T GetExport();
|
T GetExport(HeaderCommon headerCommon);
|
||||||
T GetHeaders();
|
T GetHeaders(HeaderCommon headerCommon);
|
||||||
T GetLogistics();
|
T GetLogistics(HeaderCommon headerCommon);
|
||||||
T GetProcessDataStandardFormat();
|
T GetProcessDataStandardFormat(HeaderCommon headerCommon);
|
||||||
T PostExport();
|
|
||||||
T PostHeaders();
|
|
||||||
T PostLogistics();
|
|
||||||
T PostProcessDataStandardFormat();
|
|
||||||
|
|
||||||
}
|
}
|
@ -1,3 +1,5 @@
|
|||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
||||||
namespace OI.Metrology.Shared.Models.Stateless;
|
namespace OI.Metrology.Shared.Models.Stateless;
|
||||||
|
|
||||||
public interface IInboundController<T>
|
public interface IInboundController<T>
|
||||||
@ -9,7 +11,7 @@ public interface IInboundController<T>
|
|||||||
}
|
}
|
||||||
|
|
||||||
static string GetRouteName() => nameof(IInboundController<T>)[1..^10];
|
static string GetRouteName() => nameof(IInboundController<T>)[1..^10];
|
||||||
T Post(string tooltype);
|
T Post(string tooltype, JToken jsonbody);
|
||||||
T AttachFile(string tooltype, long headerid, string datauniqueid = "");
|
T AttachFile(string tooltype, long headerid, string datauniqueid = "");
|
||||||
|
|
||||||
}
|
}
|
@ -6,7 +6,6 @@ public interface IInfinityQSRepository
|
|||||||
{
|
{
|
||||||
|
|
||||||
string GetCommandText(string subGroupId);
|
string GetCommandText(string subGroupId);
|
||||||
string GetCommandText(InfinityQSBase infinityQSBase);
|
|
||||||
string GetCommandText(string? subGroupId, string? process, string? job, string? part, string? lot, string? dateTime);
|
string GetCommandText(string? subGroupId, string? process, string? job, string? part, string? lot, string? dateTime);
|
||||||
Result<InfinityQSBase[]> GetData(string subGroupId);
|
Result<InfinityQSBase[]> GetData(string subGroupId);
|
||||||
Result<InfinityQSDescriptor[]> GetDescriptors(string subGroupId);
|
Result<InfinityQSDescriptor[]> GetDescriptors(string subGroupId);
|
||||||
|
@ -6,7 +6,6 @@ public interface IInfinityQSV2Repository
|
|||||||
{
|
{
|
||||||
|
|
||||||
string GetCommandText(string subGroupId);
|
string GetCommandText(string subGroupId);
|
||||||
string GetCommandText(InfinityQSBaseV2 infinityQSBase);
|
|
||||||
string GetCommandText(string? subGroupId, string? process, string? job, string? part, string? lot, string? dateTime);
|
string GetCommandText(string? subGroupId, string? process, string? job, string? part, string? lot, string? dateTime);
|
||||||
Result<InfinityQSBaseV2[]> GetData(string subGroupId);
|
Result<InfinityQSBaseV2[]> GetData(string subGroupId);
|
||||||
Result<InfinityQSDescriptorV2[]> GetDescriptors(string subGroupId);
|
Result<InfinityQSDescriptorV2[]> GetDescriptors(string subGroupId);
|
||||||
|
@ -30,8 +30,8 @@
|
|||||||
<DefineConstants>Linux</DefineConstants>
|
<DefineConstants>Linux</DefineConstants>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="System.Text.Json" Version="7.0.2" />
|
<PackageReference Include="System.Text.Json" Version="7.0.1" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
@ -31,9 +31,9 @@
|
|||||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
|
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.4" />
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.1" />
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
|
||||||
<PackageReference Include="MSTest.TestAdapter" Version="3.0.2" />
|
<PackageReference Include="MSTest.TestAdapter" Version="3.0.2" />
|
||||||
<PackageReference Include="MSTest.TestFramework" Version="3.0.2" />
|
<PackageReference Include="MSTest.TestFramework" Version="3.0.2" />
|
||||||
<PackageReference Include="Serilog.Settings.Configuration" Version="3.4.0" />
|
<PackageReference Include="Serilog.Settings.Configuration" Version="3.4.0" />
|
||||||
|
@ -29,20 +29,12 @@ public class UnitTestAppSettingsController
|
|||||||
_ControllerName = nameof(Server.ApiControllers.AppSettingsController)[..^10];
|
_ControllerName = nameof(Server.ApiControllers.AppSettingsController)[..^10];
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void NonThrowTryCatch()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{ throw new Exception(); }
|
|
||||||
catch (Exception) { }
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void TestControllerName()
|
public void TestControllerName()
|
||||||
{
|
{
|
||||||
_Logger.Information("Starting Web Application");
|
_Logger.Information("Starting Web Application");
|
||||||
Assert.AreEqual(IAppSettingsController<object>.GetRouteName(), _ControllerName);
|
Assert.AreEqual(IAppSettingsController<object>.GetRouteName(), _ControllerName);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -53,7 +45,6 @@ public class UnitTestAppSettingsController
|
|||||||
IAppSettingsRepository<Server.Models.Binder.AppSettings> appSettingsRepository = serviceProvider.GetRequiredService<IAppSettingsRepository<Server.Models.Binder.AppSettings>>();
|
IAppSettingsRepository<Server.Models.Binder.AppSettings> appSettingsRepository = serviceProvider.GetRequiredService<IAppSettingsRepository<Server.Models.Binder.AppSettings>>();
|
||||||
appSettingsRepository.VerifyConnectionStrings();
|
appSettingsRepository.VerifyConnectionStrings();
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -64,7 +55,6 @@ public class UnitTestAppSettingsController
|
|||||||
AppSettings appSettings = serviceProvider.GetRequiredService<AppSettings>();
|
AppSettings appSettings = serviceProvider.GetRequiredService<AppSettings>();
|
||||||
Assert.IsNotNull(appSettings);
|
Assert.IsNotNull(appSettings);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -76,7 +66,6 @@ public class UnitTestAppSettingsController
|
|||||||
Server.Models.Binder.AppSettings appSettings = appSettingsRepository.GetAppSettings();
|
Server.Models.Binder.AppSettings appSettings = appSettingsRepository.GetAppSettings();
|
||||||
Assert.IsTrue(appSettings is not null);
|
Assert.IsTrue(appSettings is not null);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -93,7 +82,6 @@ public class UnitTestAppSettingsController
|
|||||||
Assert.IsNotNull(json);
|
Assert.IsNotNull(json);
|
||||||
Assert.IsTrue(json != "[]");
|
Assert.IsTrue(json != "[]");
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -105,7 +93,6 @@ public class UnitTestAppSettingsController
|
|||||||
string result = appSettingsRepository.GetBuildNumberAndGitCommitSeven();
|
string result = appSettingsRepository.GetBuildNumberAndGitCommitSeven();
|
||||||
Assert.IsTrue(result is not null);
|
Assert.IsTrue(result is not null);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -121,7 +108,6 @@ public class UnitTestAppSettingsController
|
|||||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetBuildNumberAndGitCommitSeven)}.json"), json);
|
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetBuildNumberAndGitCommitSeven)}.json"), json);
|
||||||
Assert.IsNotNull(json);
|
Assert.IsNotNull(json);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -54,8 +54,8 @@ public class UnitTestClientSettingsController
|
|||||||
{
|
{
|
||||||
HttpClient httpClient = _WebApplicationFactory.CreateClient();
|
HttpClient httpClient = _WebApplicationFactory.CreateClient();
|
||||||
_Logger.Information("Starting Web Application");
|
_Logger.Information("Starting Web Application");
|
||||||
#if DEBUG
|
|
||||||
string actionName = nameof(IClientSettingsController<object>.Action.Client);
|
string actionName = nameof(IClientSettingsController<object>.Action.Client);
|
||||||
|
#if DEBUG
|
||||||
HttpResponseMessage httpResponseMessage = await httpClient.GetAsync($"api/{_ControllerName}/{actionName}");
|
HttpResponseMessage httpResponseMessage = await httpClient.GetAsync($"api/{_ControllerName}/{actionName}");
|
||||||
Assert.AreEqual(HttpStatusCode.OK, httpResponseMessage.StatusCode);
|
Assert.AreEqual(HttpStatusCode.OK, httpResponseMessage.StatusCode);
|
||||||
Assert.AreEqual("application/json; charset=utf-8", httpResponseMessage.Content.Headers.ContentType?.ToString());
|
Assert.AreEqual("application/json; charset=utf-8", httpResponseMessage.Content.Headers.ContentType?.ToString());
|
||||||
|
@ -3,7 +3,6 @@ using Microsoft.Extensions.DependencyInjection;
|
|||||||
using OI.Metrology.Shared.DataModels;
|
using OI.Metrology.Shared.DataModels;
|
||||||
using OI.Metrology.Shared.Models.Stateless;
|
using OI.Metrology.Shared.Models.Stateless;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace OI.Metrology.Tests;
|
namespace OI.Metrology.Tests;
|
||||||
|
|
||||||
@ -29,27 +28,16 @@ public class UnitTestExportController
|
|||||||
_ControllerName = nameof(Server.ApiControllers.ExportController)[..^10];
|
_ControllerName = nameof(Server.ApiControllers.ExportController)[..^10];
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void NonThrowTryCatch()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{ throw new Exception(); }
|
|
||||||
catch (Exception) { }
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void TestControllerName()
|
public void TestControllerName()
|
||||||
{
|
{
|
||||||
_Logger.Information("Starting Web Application");
|
_Logger.Information("Starting Web Application");
|
||||||
Assert.AreEqual(IExportController<string>.GetRouteName(), _ControllerName);
|
Assert.AreEqual(IExportController<string>.GetRouteName(), _ControllerName);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static HeaderCommon GetHeaderCommon() =>
|
private static HeaderCommon GetHeaderCommon() =>
|
||||||
new() { PSN = "5008", Reactor = "61", RDS = "579487", ID = 1678209360 };
|
new() { PSN = "5008", Reactor = "39", RDS = "578918", ID = 1 };
|
||||||
|
|
||||||
private static StringContent GetStringContent() =>
|
|
||||||
new(System.Text.Json.JsonSerializer.Serialize(GetHeaderCommon()), Encoding.UTF8, "application/json");
|
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void GetExport()
|
public void GetExport()
|
||||||
@ -60,7 +48,6 @@ public class UnitTestExportController
|
|||||||
string result = exportRepository.GetExport(GetHeaderCommon());
|
string result = exportRepository.GetExport(GetHeaderCommon());
|
||||||
Assert.IsNotNull(result);
|
Assert.IsNotNull(result);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -68,22 +55,10 @@ public class UnitTestExportController
|
|||||||
{
|
{
|
||||||
HttpClient httpClient = _WebApplicationFactory.CreateClient();
|
HttpClient httpClient = _WebApplicationFactory.CreateClient();
|
||||||
_Logger.Information("Starting Web Application");
|
_Logger.Information("Starting Web Application");
|
||||||
string? result = await httpClient.GetStringAsync($"api/{_ControllerName}/export");
|
string? result = await httpClient.GetStringAsync($"api/{_ControllerName}/headers");
|
||||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetExport)}.txt"), result);
|
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetExport)}.txt"), result);
|
||||||
Assert.IsNotNull(result);
|
Assert.IsNotNull(result);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public async Task PostExportApi()
|
|
||||||
{
|
|
||||||
HttpClient httpClient = _WebApplicationFactory.CreateClient();
|
|
||||||
_Logger.Information("Starting Web Application");
|
|
||||||
HttpResponseMessage httpResponseMessage = await httpClient.PostAsync($"api/{_ControllerName}/export", GetStringContent());
|
|
||||||
Assert.IsTrue(httpResponseMessage.StatusCode == System.Net.HttpStatusCode.OK);
|
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -95,7 +70,6 @@ public class UnitTestExportController
|
|||||||
Result<HeaderCommon[]> result = exportRepository.GetHeaders(GetHeaderCommon());
|
Result<HeaderCommon[]> result = exportRepository.GetHeaders(GetHeaderCommon());
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -108,18 +82,6 @@ public class UnitTestExportController
|
|||||||
Result<HeaderCommon[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<HeaderCommon[]>>(json);
|
Result<HeaderCommon[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<HeaderCommon[]>>(json);
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public async Task PostHeadersApi()
|
|
||||||
{
|
|
||||||
HttpClient httpClient = _WebApplicationFactory.CreateClient();
|
|
||||||
_Logger.Information("Starting Web Application");
|
|
||||||
HttpResponseMessage httpResponseMessage = await httpClient.PostAsync($"api/{_ControllerName}/headers", GetStringContent());
|
|
||||||
Assert.IsTrue(httpResponseMessage.StatusCode == System.Net.HttpStatusCode.OK);
|
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -131,7 +93,6 @@ public class UnitTestExportController
|
|||||||
Result<HeaderCommon[]> result = exportRepository.GetLogistics(GetHeaderCommon());
|
Result<HeaderCommon[]> result = exportRepository.GetLogistics(GetHeaderCommon());
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -139,23 +100,11 @@ public class UnitTestExportController
|
|||||||
{
|
{
|
||||||
HttpClient httpClient = _WebApplicationFactory.CreateClient();
|
HttpClient httpClient = _WebApplicationFactory.CreateClient();
|
||||||
_Logger.Information("Starting Web Application");
|
_Logger.Information("Starting Web Application");
|
||||||
string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/logistics");
|
string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/headers");
|
||||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetLogistics)}.json"), json);
|
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetLogistics)}.json"), json);
|
||||||
Result<HeaderCommon[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<HeaderCommon[]>>(json);
|
Result<HeaderCommon[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<HeaderCommon[]>>(json);
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public async Task PostLogisticsApi()
|
|
||||||
{
|
|
||||||
HttpClient httpClient = _WebApplicationFactory.CreateClient();
|
|
||||||
_Logger.Information("Starting Web Application");
|
|
||||||
HttpResponseMessage httpResponseMessage = await httpClient.PostAsync($"api/{_ControllerName}/logistics", GetStringContent());
|
|
||||||
Assert.IsTrue(httpResponseMessage.StatusCode == System.Net.HttpStatusCode.OK);
|
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -167,7 +116,6 @@ public class UnitTestExportController
|
|||||||
string result = exportRepository.GetProcessDataStandardFormat(GetHeaderCommon());
|
string result = exportRepository.GetProcessDataStandardFormat(GetHeaderCommon());
|
||||||
Assert.IsNotNull(result);
|
Assert.IsNotNull(result);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -175,22 +123,10 @@ public class UnitTestExportController
|
|||||||
{
|
{
|
||||||
HttpClient httpClient = _WebApplicationFactory.CreateClient();
|
HttpClient httpClient = _WebApplicationFactory.CreateClient();
|
||||||
_Logger.Information("Starting Web Application");
|
_Logger.Information("Starting Web Application");
|
||||||
string? result = await httpClient.GetStringAsync($"api/{_ControllerName}/processDataStandardFormat");
|
string? result = await httpClient.GetStringAsync($"api/{_ControllerName}/headers");
|
||||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetProcessDataStandardFormat)}.pdsf"), result);
|
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetProcessDataStandardFormat)}.pdsf"), result);
|
||||||
Assert.IsNotNull(result);
|
Assert.IsNotNull(result);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public async Task PostProcessDataStandardFormatApi()
|
|
||||||
{
|
|
||||||
HttpClient httpClient = _WebApplicationFactory.CreateClient();
|
|
||||||
_Logger.Information("Starting Web Application");
|
|
||||||
HttpResponseMessage httpResponseMessage = await httpClient.PostAsync($"api/{_ControllerName}/processDataStandardFormat", GetStringContent());
|
|
||||||
Assert.IsTrue(httpResponseMessage.StatusCode == System.Net.HttpStatusCode.OK);
|
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -28,25 +28,14 @@ public class UnitTestInfinityQSController
|
|||||||
_ControllerName = nameof(Server.ApiControllers.InfinityQSController)[..^10];
|
_ControllerName = nameof(Server.ApiControllers.InfinityQSController)[..^10];
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void NonThrowTryCatch()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{ throw new Exception(); }
|
|
||||||
catch (Exception) { }
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void TestControllerName()
|
public void TestControllerName()
|
||||||
{
|
{
|
||||||
_Logger.Information("Starting Web Application");
|
_Logger.Information("Starting Web Application");
|
||||||
Assert.AreEqual(IInfinityQSController<string>.GetRouteName(), _ControllerName);
|
Assert.AreEqual(IInfinityQSController<string>.GetRouteName(), _ControllerName);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !DEBUG
|
|
||||||
[Ignore]
|
|
||||||
#endif
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void GetCommandText()
|
public void GetCommandText()
|
||||||
{
|
{
|
||||||
@ -56,12 +45,8 @@ public class UnitTestInfinityQSController
|
|||||||
string result = infinityQSRepository.GetCommandText("1677273357", "61", "CDE5", "5012", "575908", "");
|
string result = infinityQSRepository.GetCommandText("1677273357", "61", "CDE5", "5012", "575908", "");
|
||||||
Assert.IsNotNull(result);
|
Assert.IsNotNull(result);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !DEBUG
|
|
||||||
[Ignore]
|
|
||||||
#endif
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public async Task GetCommandTextApi()
|
public async Task GetCommandTextApi()
|
||||||
{
|
{
|
||||||
@ -71,12 +56,8 @@ public class UnitTestInfinityQSController
|
|||||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetCommandText)}.sql"), json);
|
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetCommandText)}.sql"), json);
|
||||||
Assert.IsNotNull(json);
|
Assert.IsNotNull(json);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !DEBUG
|
|
||||||
[Ignore]
|
|
||||||
#endif
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void GetData()
|
public void GetData()
|
||||||
{
|
{
|
||||||
@ -92,12 +73,8 @@ public class UnitTestInfinityQSController
|
|||||||
Assert.IsNotNull(result?.Results[0].TD_NAME);
|
Assert.IsNotNull(result?.Results[0].TD_NAME);
|
||||||
Assert.IsNotNull(result?.Results[0].TD_TEST);
|
Assert.IsNotNull(result?.Results[0].TD_TEST);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !DEBUG
|
|
||||||
[Ignore]
|
|
||||||
#endif
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public async Task GetDataApi()
|
public async Task GetDataApi()
|
||||||
{
|
{
|
||||||
@ -109,12 +86,8 @@ public class UnitTestInfinityQSController
|
|||||||
Result<InfinityQSBase[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSBase[]>>(json);
|
Result<InfinityQSBase[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSBase[]>>(json);
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !DEBUG
|
|
||||||
[Ignore]
|
|
||||||
#endif
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void GetDescriptors()
|
public void GetDescriptors()
|
||||||
{
|
{
|
||||||
@ -127,12 +100,8 @@ public class UnitTestInfinityQSController
|
|||||||
Assert.IsNotNull(result?.Results[0].SD_SGRP);
|
Assert.IsNotNull(result?.Results[0].SD_SGRP);
|
||||||
Assert.IsNotNull(result?.Results[0].SD_TSNO);
|
Assert.IsNotNull(result?.Results[0].SD_TSNO);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !DEBUG
|
|
||||||
[Ignore]
|
|
||||||
#endif
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public async Task GetDescriptorsApi()
|
public async Task GetDescriptorsApi()
|
||||||
{
|
{
|
||||||
@ -144,12 +113,8 @@ public class UnitTestInfinityQSController
|
|||||||
Result<InfinityQSDescriptor[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSDescriptor[]>>(json);
|
Result<InfinityQSDescriptor[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSDescriptor[]>>(json);
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !DEBUG
|
|
||||||
[Ignore]
|
|
||||||
#endif
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void GetEvents()
|
public void GetEvents()
|
||||||
{
|
{
|
||||||
@ -159,12 +124,8 @@ public class UnitTestInfinityQSController
|
|||||||
Result<InfinityQSEvent[]> result = infinityQSRepository.GetEvents("1677273357");
|
Result<InfinityQSEvent[]> result = infinityQSRepository.GetEvents("1677273357");
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !DEBUG
|
|
||||||
[Ignore]
|
|
||||||
#endif
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public async Task GetEventsApi()
|
public async Task GetEventsApi()
|
||||||
{
|
{
|
||||||
@ -175,12 +136,8 @@ public class UnitTestInfinityQSController
|
|||||||
Result<InfinityQSEvent[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSEvent[]>>(json);
|
Result<InfinityQSEvent[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSEvent[]>>(json);
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !DEBUG
|
|
||||||
[Ignore]
|
|
||||||
#endif
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void GetHeader()
|
public void GetHeader()
|
||||||
{
|
{
|
||||||
@ -190,12 +147,8 @@ public class UnitTestInfinityQSController
|
|||||||
Result<InfinityQSBase[]> result = infinityQSRepository.GetHeader("1677273357");
|
Result<InfinityQSBase[]> result = infinityQSRepository.GetHeader("1677273357");
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !DEBUG
|
|
||||||
[Ignore]
|
|
||||||
#endif
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public async Task GetHeaderApi()
|
public async Task GetHeaderApi()
|
||||||
{
|
{
|
||||||
@ -206,7 +159,6 @@ public class UnitTestInfinityQSController
|
|||||||
Result<InfinityQSBase[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSBase[]>>(json);
|
Result<InfinityQSBase[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSBase[]>>(json);
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -28,20 +28,12 @@ public class UnitTestInfinityQSV2Controller
|
|||||||
_ControllerName = nameof(Server.ApiControllers.InfinityQSV2Controller)[..^10];
|
_ControllerName = nameof(Server.ApiControllers.InfinityQSV2Controller)[..^10];
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void NonThrowTryCatch()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{ throw new Exception(); }
|
|
||||||
catch (Exception) { }
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void TestControllerName()
|
public void TestControllerName()
|
||||||
{
|
{
|
||||||
_Logger.Information("Starting Web Application");
|
_Logger.Information("Starting Web Application");
|
||||||
Assert.AreEqual(IInfinityQSV2Controller<string>.GetRouteName(), _ControllerName);
|
Assert.AreEqual(IInfinityQSV2Controller<string>.GetRouteName(), _ControllerName);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -53,12 +45,8 @@ public class UnitTestInfinityQSV2Controller
|
|||||||
string result = infinityQSV2Repository.GetCommandText("1677273357", "61", "CDE5", "5012", "575908", "");
|
string result = infinityQSV2Repository.GetCommandText("1677273357", "61", "CDE5", "5012", "575908", "");
|
||||||
Assert.IsNotNull(result);
|
Assert.IsNotNull(result);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !DEBUG
|
|
||||||
[Ignore]
|
|
||||||
#endif
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public async Task GetCommandTextApi()
|
public async Task GetCommandTextApi()
|
||||||
{
|
{
|
||||||
@ -68,12 +56,8 @@ public class UnitTestInfinityQSV2Controller
|
|||||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetCommandText)}.sql"), json);
|
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetCommandText)}.sql"), json);
|
||||||
Assert.IsNotNull(json);
|
Assert.IsNotNull(json);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !DEBUG
|
|
||||||
[Ignore]
|
|
||||||
#endif
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void GetData()
|
public void GetData()
|
||||||
{
|
{
|
||||||
@ -89,12 +73,8 @@ public class UnitTestInfinityQSV2Controller
|
|||||||
Assert.IsNotNull(result?.Results[0].VariableNumber);
|
Assert.IsNotNull(result?.Results[0].VariableNumber);
|
||||||
Assert.IsNotNull(result?.Results[0].SubGroupDateTime);
|
Assert.IsNotNull(result?.Results[0].SubGroupDateTime);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !DEBUG
|
|
||||||
[Ignore]
|
|
||||||
#endif
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public async Task GetDataApi()
|
public async Task GetDataApi()
|
||||||
{
|
{
|
||||||
@ -106,12 +86,8 @@ public class UnitTestInfinityQSV2Controller
|
|||||||
Result<InfinityQSBaseV2[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSBaseV2[]>>(json);
|
Result<InfinityQSBaseV2[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSBaseV2[]>>(json);
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !DEBUG
|
|
||||||
[Ignore]
|
|
||||||
#endif
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void GetDescriptors()
|
public void GetDescriptors()
|
||||||
{
|
{
|
||||||
@ -124,12 +100,8 @@ public class UnitTestInfinityQSV2Controller
|
|||||||
Assert.IsNotNull(result?.Results[0].SubGroupId);
|
Assert.IsNotNull(result?.Results[0].SubGroupId);
|
||||||
Assert.IsNotNull(result?.Results[0].SiteNumber);
|
Assert.IsNotNull(result?.Results[0].SiteNumber);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !DEBUG
|
|
||||||
[Ignore]
|
|
||||||
#endif
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public async Task GetDescriptorsApi()
|
public async Task GetDescriptorsApi()
|
||||||
{
|
{
|
||||||
@ -141,12 +113,8 @@ public class UnitTestInfinityQSV2Controller
|
|||||||
Result<InfinityQSDescriptorV2[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSDescriptorV2[]>>(json);
|
Result<InfinityQSDescriptorV2[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSDescriptorV2[]>>(json);
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !DEBUG
|
|
||||||
[Ignore]
|
|
||||||
#endif
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void GetEvents()
|
public void GetEvents()
|
||||||
{
|
{
|
||||||
@ -156,12 +124,8 @@ public class UnitTestInfinityQSV2Controller
|
|||||||
Result<InfinityQSEventV2[]> result = infinityQSV2Repository.GetEvents("1677273357");
|
Result<InfinityQSEventV2[]> result = infinityQSV2Repository.GetEvents("1677273357");
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !DEBUG
|
|
||||||
[Ignore]
|
|
||||||
#endif
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public async Task GetEventsApi()
|
public async Task GetEventsApi()
|
||||||
{
|
{
|
||||||
@ -172,12 +136,8 @@ public class UnitTestInfinityQSV2Controller
|
|||||||
Result<InfinityQSEvent[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSEvent[]>>(json);
|
Result<InfinityQSEvent[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSEvent[]>>(json);
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !DEBUG
|
|
||||||
[Ignore]
|
|
||||||
#endif
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void GetHeader()
|
public void GetHeader()
|
||||||
{
|
{
|
||||||
@ -187,12 +147,8 @@ public class UnitTestInfinityQSV2Controller
|
|||||||
Result<InfinityQSBaseV2[]> result = infinityQSV2Repository.GetHeader("1677273357");
|
Result<InfinityQSBaseV2[]> result = infinityQSV2Repository.GetHeader("1677273357");
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !DEBUG
|
|
||||||
[Ignore]
|
|
||||||
#endif
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public async Task GetHeaderApi()
|
public async Task GetHeaderApi()
|
||||||
{
|
{
|
||||||
@ -203,7 +159,6 @@ public class UnitTestInfinityQSV2Controller
|
|||||||
Result<InfinityQSBaseV2[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSBaseV2[]>>(json);
|
Result<InfinityQSBaseV2[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSBaseV2[]>>(json);
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
NonThrowTryCatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>net7.0</TargetFrameworks>
|
<TargetFrameworks>net7.0</TargetFrameworks>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
@ -8,14 +8,14 @@
|
|||||||
<SupportedPlatform Include="browser" />
|
<SupportedPlatform Include="browser" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="MudBlazor" Version="6.1.9" />
|
<PackageReference Include="MudBlazor" Version="6.1.8" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.4" />
|
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.2" />
|
||||||
<PackageReference Include="IgniteUI.Blazor" Version="22.2.24" />
|
<PackageReference Include="IgniteUI.Blazor" Version="22.2.24" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
|
||||||
<PackageReference Include="Serilog.Sinks.BrowserConsole" Version="1.0.0" />
|
<PackageReference Include="Serilog.Sinks.BrowserConsole" Version="1.0.0" />
|
||||||
<PackageReference Include="Serilog.Sinks.BrowserHttp" Version="1.0.0-dev-00032" />
|
<PackageReference Include="Serilog.Sinks.BrowserHttp" Version="1.0.0-dev-00032" />
|
||||||
<PackageReference Include="System.Net.Http.Json" Version="7.0.1" />
|
<PackageReference Include="System.Net.Http.Json" Version="7.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Shared\OI.Metrology.Shared.csproj" />
|
<ProjectReference Include="..\Shared\OI.Metrology.Shared.csproj" />
|
||||||
|
@ -15,23 +15,16 @@ trigger:
|
|||||||
- "ClientHub/*"
|
- "ClientHub/*"
|
||||||
|
|
||||||
pool:
|
pool:
|
||||||
name: Mesa-Windows-Service
|
name: Mesa-IIS
|
||||||
demands: OI-Metrology-Server-Development
|
demands: OI-Metrology-Server-Development
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
# solution: '**/*.sln'
|
# solution: '**/*.sln'
|
||||||
# buildPlatform: 'Any CPU'
|
# buildPlatform: 'Any CPU'
|
||||||
buildConfiguration: "Debug"
|
buildConfiguration: 'Debug'
|
||||||
ASPNETCORE_ENVIRONMENT: "Development"
|
ASPNETCORE_ENVIRONMENT: 'Development'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- script: |
|
|
||||||
set exeName=OI.Metrology.Server
|
|
||||||
echo %exeName%
|
|
||||||
echo ##vso[task.setvariable variable=ExeName;]%exeName%
|
|
||||||
echo $(ExeName)
|
|
||||||
displayName: ExeName
|
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
set coreVersion=net7.0
|
set coreVersion=net7.0
|
||||||
echo %coreVersion%
|
echo %coreVersion%
|
||||||
@ -86,28 +79,13 @@ steps:
|
|||||||
workingDirectory: Server
|
workingDirectory: Server
|
||||||
displayName: "Safe storage of app secrets - Server"
|
displayName: "Safe storage of app secrets - Server"
|
||||||
|
|
||||||
- script: |
|
|
||||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "IsDevelopment" true
|
|
||||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "MockRoot" "/Data/Tests"
|
|
||||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "URLs" "http://localhost:5002;"
|
|
||||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "MonAResource" "OI_Metrology_Viewer_IFX"
|
|
||||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "ApiExportPath" "\\messdv002.na.infineon.com\Candela\Archive\API"
|
|
||||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "ConnectionString" "Data Source=MESSAD1001\TEST1,59583;Integrated Security=True;Initial Catalog=Metrology;"
|
|
||||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "Oi2SqlConnectionString" "Data Source=MESSAD1001\TEST1,59583;Initial Catalog=LSL2SQL;Persist Security Info=True;User ID=srpadmin;Password=0okm9ijn;"
|
|
||||||
workingDirectory: Server
|
|
||||||
displayName: "Safe storage of app secrets II - Server"
|
|
||||||
|
|
||||||
- script: '"C:\program files\dotnet\dotnet.exe" build --configuration $(Configuration) --source $(NugetSource)'
|
|
||||||
workingDirectory: Tests
|
|
||||||
displayName: "Core Build - Tests"
|
|
||||||
|
|
||||||
- script: '"C:\program files\dotnet\dotnet.exe" build --configuration $(Configuration) --source $(NugetSource)'
|
- script: '"C:\program files\dotnet\dotnet.exe" build --configuration $(Configuration) --source $(NugetSource)'
|
||||||
workingDirectory: Server
|
workingDirectory: Server
|
||||||
displayName: "Core Build - Server"
|
displayName: "Core Build - Server"
|
||||||
|
|
||||||
- powershell: Get-ChildItem .\ -include TestResults -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse }
|
- powershell: Get-ChildItem .\ -include TestResults -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse }
|
||||||
workingDirectory: "$(System.DefaultWorkingDirectory)/.vscode"
|
workingDirectory: "$(System.DefaultWorkingDirectory)/.vscode"
|
||||||
displayName: "PowerShell Script"
|
displayName: 'PowerShell Script'
|
||||||
|
|
||||||
- script: "dotnet test --configuration $(Configuration)"
|
- script: "dotnet test --configuration $(Configuration)"
|
||||||
workingDirectory: Tests
|
workingDirectory: Tests
|
||||||
@ -132,14 +110,6 @@ steps:
|
|||||||
testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)"
|
testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)"
|
||||||
searchFolder: "$(System.DefaultWorkingDirectory)/.vscode"
|
searchFolder: "$(System.DefaultWorkingDirectory)/.vscode"
|
||||||
|
|
||||||
- task: PublishTestResults@2
|
|
||||||
displayName: "Publish Test Results **/coverage.cobertura.xml"
|
|
||||||
inputs:
|
|
||||||
testResultsFormat: VSTest
|
|
||||||
testResultsFiles: "**/coverage.cobertura.xml"
|
|
||||||
testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)"
|
|
||||||
searchFolder: "$(System.DefaultWorkingDirectory)/.vscode"
|
|
||||||
|
|
||||||
- task: mspremier.CreateWorkItem.CreateWorkItem-task.CreateWorkItem@1
|
- task: mspremier.CreateWorkItem.CreateWorkItem-task.CreateWorkItem@1
|
||||||
displayName: "Create work item"
|
displayName: "Create work item"
|
||||||
inputs:
|
inputs:
|
||||||
@ -159,69 +129,16 @@ steps:
|
|||||||
SourceFolder: '$(Build.ArtifactStagingDirectory)\Server'
|
SourceFolder: '$(Build.ArtifactStagingDirectory)\Server'
|
||||||
TargetFolder: 'D:\$(CoreVersion)\$(Build.Repository.Name)\$(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)\Server'
|
TargetFolder: 'D:\$(CoreVersion)\$(Build.Repository.Name)\$(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)\Server'
|
||||||
|
|
||||||
- script: 'sc stop "$(Build.Repository.Name)-$(Configuration)"'
|
|
||||||
workingDirectory: Server
|
|
||||||
displayName: "Service Control - Stop"
|
|
||||||
continueOnError: true
|
|
||||||
|
|
||||||
- script: 'sc delete "$(Build.Repository.Name)-$(Configuration)"'
|
|
||||||
workingDirectory: Server
|
|
||||||
displayName: "Service Control - Delete"
|
|
||||||
continueOnError: true
|
|
||||||
|
|
||||||
- task: DownloadSecureFile@1
|
|
||||||
name: downloadSecureFileKDBX
|
|
||||||
displayName: "Download secure file"
|
|
||||||
inputs:
|
|
||||||
secureFile: "Infineon-NA.kdbx"
|
|
||||||
|
|
||||||
- script: echo "<$(downloadSecureFileKDBX.secureFilePath)>"
|
|
||||||
displayName: "Echo Path"
|
|
||||||
|
|
||||||
- powershell: |
|
|
||||||
$data = @('$(downloadSecureFileKDBX.secureFilePath)', '-c:GetEntryString', '-Field:Password', '-refx-UUID:A6302662940458499454E35D28FCC9F7', '-pw-enc:AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAtBhT01pNnUGaN/uPLxZGvAAAAAACAAAAAAADZgAAwAAAABAAAAAM4xlYguhv7jzchU8dq9pVAAAAAASAAACgAAAAEAAAANS9rIoaYfNq5TwCmTrqElsgAAAA7O4J52FqCctXlCxYB2J5b/W4T+pZCN2zwFj7XCAFW6IUAAAAhQsBDOERAUZJdtSy8AfxwOAZflo=')
|
|
||||||
$data.count
|
|
||||||
$processStartInfo = New-Object System.Diagnostics.ProcessStartInfo
|
|
||||||
$processStartInfo.FileName = "C:\Users\meseafsvc\AppData\Local\IFXApps\KeePass-2.51.1---KPScript-2.51.1\KPScript.exe"
|
|
||||||
$processStartInfo.RedirectStandardError = $true
|
|
||||||
$processStartInfo.RedirectStandardOutput = $true
|
|
||||||
$processStartInfo.UseShellExecute = $false
|
|
||||||
$processStartInfo.Arguments = $data
|
|
||||||
$process = New-Object System.Diagnostics.Process
|
|
||||||
$process.StartInfo = $processStartInfo
|
|
||||||
$process.Start() | Out-Null
|
|
||||||
$process.WaitForExit()
|
|
||||||
$stdout = $process.StandardOutput.ReadToEnd()
|
|
||||||
$stderr = $process.StandardError.ReadToEnd()
|
|
||||||
Write-Host "stderr: $stderr"
|
|
||||||
Write-Host "exit code: " + $process.ExitCode
|
|
||||||
Write-Host "##vso[task.setvariable variable=pipelinePassword;]$stdout"
|
|
||||||
displayName: pipelinePassword
|
|
||||||
|
|
||||||
- script: 'sc create "$(Build.Repository.Name)-$(Configuration)" start= delayed-auto DisplayName= "$(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)" binPath= D:\$(CoreVersion)\$(Build.Repository.Name)\$(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)\Server\$(ExeName).exe obj= INFINEON\meseafsvc password="$(pipelinePassword)"'
|
|
||||||
workingDirectory: Server
|
|
||||||
displayName: "Service Control - Create"
|
|
||||||
|
|
||||||
- script: 'sc start "$(Build.Repository.Name)-$(Configuration)"'
|
|
||||||
workingDirectory: Server
|
|
||||||
displayName: "Service Control - Start"
|
|
||||||
|
|
||||||
- task: PublishBuildArtifacts@1
|
- task: PublishBuildArtifacts@1
|
||||||
displayName: "Publish Artifact: drop"
|
displayName: "Publish Artifact: drop"
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
- script: '"C:\program files\dotnet\dotnet.exe" clean --configuration $(Configuration)'
|
- script: |
|
||||||
|
"C:\program files\dotnet\dotnet.exe" clean --configuration $(Configuration)
|
||||||
workingDirectory: Tests
|
workingDirectory: Tests
|
||||||
displayName: "Core Clean - Tests"
|
displayName: "Core Clean - Tests"
|
||||||
|
|
||||||
- script: '"C:\program files\dotnet\dotnet.exe" clean --configuration $(Configuration)'
|
- script: |
|
||||||
|
"C:\program files\dotnet\dotnet.exe" clean --configuration $(Configuration)
|
||||||
workingDirectory: Server
|
workingDirectory: Server
|
||||||
displayName: "Core Clean - Server"
|
displayName: "Core Clean - Server"
|
||||||
|
|
||||||
- script: '"C:\program files\dotnet\dotnet.exe" clean --configuration $(Configuration)'
|
|
||||||
workingDirectory: Server
|
|
||||||
displayName: "Core Clean - Server"
|
|
||||||
|
|
||||||
- script: 'echo $(Build.SourceVersion)-$(Build.BuildId)>bin_x_x_\Debug\$(CoreVersion)\win-x64\$(Build.Repository.Name).txt'
|
|
||||||
workingDirectory: "EAF Viewer"
|
|
||||||
displayName: "Force Fail"
|
|
||||||
|
@ -110,14 +110,6 @@ steps:
|
|||||||
testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)"
|
testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)"
|
||||||
searchFolder: "$(System.DefaultWorkingDirectory)/.vscode"
|
searchFolder: "$(System.DefaultWorkingDirectory)/.vscode"
|
||||||
|
|
||||||
- task: PublishTestResults@2
|
|
||||||
displayName: "Publish Test Results **/coverage.cobertura.xml"
|
|
||||||
inputs:
|
|
||||||
testResultsFormat: VSTest
|
|
||||||
testResultsFiles: "**/coverage.cobertura.xml"
|
|
||||||
testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)"
|
|
||||||
searchFolder: "$(System.DefaultWorkingDirectory)/.vscode"
|
|
||||||
|
|
||||||
- task: mspremier.CreateWorkItem.CreateWorkItem-task.CreateWorkItem@1
|
- task: mspremier.CreateWorkItem.CreateWorkItem-task.CreateWorkItem@1
|
||||||
displayName: "Create work item"
|
displayName: "Create work item"
|
||||||
inputs:
|
inputs:
|
||||||
|
Reference in New Issue
Block a user