PDSF (Process Data Standard Format) to use EAF for
pushing to OI
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OI.Metrology.Server.Models;
|
||||
using OI.Metrology.Shared.Models;
|
||||
using OI.Metrology.Shared.Models.Stateless;
|
||||
@ -43,13 +42,6 @@ public partial class InboundController : ControllerBase, IInboundController<IAct
|
||||
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]
|
||||
[Route("{tooltype}")]
|
||||
public IActionResult Post(string tooltype)
|
||||
@ -62,8 +54,8 @@ public partial class InboundController : ControllerBase, IInboundController<IAct
|
||||
}
|
||||
else
|
||||
{
|
||||
JToken jsonbody = GetJToken(Request.Body);
|
||||
DataResponse dataResponse = _InboundRepository.Data(_MetrologyRepository, _InboundDataService, tooltype, jsonbody);
|
||||
string? json = GetJson(Request.Body);
|
||||
DataResponse dataResponse = _InboundRepository.Data(_MetrologyRepository, _InboundDataService, tooltype, json);
|
||||
if (!dataResponse.Errors.Any())
|
||||
return Ok(dataResponse);
|
||||
else
|
||||
|
@ -100,11 +100,11 @@ public class ToolTypesController : Controller, IToolTypesController<IActionResul
|
||||
[Route("{toolTypeId}/headers/{headerid}/oiexport")]
|
||||
public IActionResult OIExport(int toolTypeId, long headerid)
|
||||
{
|
||||
Exception? exception = _ToolTypesRepository.OIExport(_MetrologyRepo, _AppSettings.OIExportPath, toolTypeId, headerid);
|
||||
if (exception is null)
|
||||
string? message = _ToolTypesRepository.OIExport(_MetrologyRepo, _AttachmentsService, _AppSettings.AttachmentPath, _AppSettings.TableToPath, toolTypeId, headerid);
|
||||
if (message is null)
|
||||
return Ok(new { Message = "OK" });
|
||||
else
|
||||
return BadRequest(JsonConvert.SerializeObject(new { exception.Message }));
|
||||
return BadRequest(JsonConvert.SerializeObject(new { message }));
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user