Browse Source

1创建models

2.创建controllers
master
taoleite 1 week ago
parent
commit
a794f02700
  1. 40
      Controllers/AsrsStatusController.cs
  2. 47
      Controllers/InputRequestController.cs
  3. 16
      Controllers/IsAliveController.cs
  4. 34
      Controllers/OutputRequestController.cs
  5. 45
      Controllers/SendInputStorageLinePathStateController.cs
  6. 15
      Controllers/UpdateProductsController.cs
  7. 22
      Models/CancelInputRequest.cs
  8. 15
      Models/CancelInputRequestReturn.cs
  9. 20
      Models/CancelOutputRequest.cs
  10. 15
      Models/CancelOutputRequestReturn.cs
  11. 39
      Models/GetStock.cs
  12. 99
      Models/InputRequest.cs
  13. 21
      Models/InputRequestReturn.cs
  14. 14
      Models/ItemDropped.cs
  15. 18
      Models/ItemDroppedReturn.cs
  16. 18
      Models/OutputRequestByProductIds.cs
  17. 22
      Models/OutputRequestByProductIdsReturn.cs
  18. 24
      Models/OutputRequestBySku.cs
  19. 22
      Models/OutputRequestBySkuReturn.cs
  20. 16
      Models/UpdateOutputRequest.cs
  21. 15
      Models/UpdateOutputRequestReturn.cs
  22. 26
      Models/UpdateProducts.cs
  23. 15
      Models/UpdateProductsReturn.cs
  24. 7
      appsettings.json

40
Controllers/AsrsStatusController.cs

@ -0,0 +1,40 @@
using Microsoft.AspNetCore.Mvc;
namespace WMS_GIRAF_Interface.Controllers
{
/// <summary>
///
/// </summary>
[ApiController, Route("Asrs")]
public class AsrsStatusController : ControllerBase
{
private readonly IConfiguration _configuration;
public AsrsStatusController(IConfiguration configuration)
{
_configuration = configuration;
}
/// <summary>
///
/// </summary>
/// <param name="asrsIdentifier"></param>
/// <returns></returns>
[HttpGet("[asrsIdentifier]/status")]
public bool KeepAlive([FromRoute] string asrsIdentifier)
{
return true;
}
[HttpGet("[asrsIdentifier]/stock")]
public bool GetStock(
[FromRoute] string asrsIdentifier,
[FromQuery] string sku)
{
}
}
}

47
Controllers/InputRequestController.cs

@ -0,0 +1,47 @@
using Microsoft.AspNetCore.Mvc;
using WMS_GIRAF_Interface.Models;
namespace WMS_GIRAF_Interface.Controllers;
/// <summary>
/// 入库申请Giraf->WMS
/// </summary>
[ApiController, Route("/Input")]
public class InputRequestController : ControllerBase
{
/// <summary>
/// 入库任务请求
/// </summary>
/// <param name="inputRequest">轮胎入库任务请求json</param>
[HttpPost]
public void GetInputRequestFromGiraf(InputRequest.RootObject inputRequest)
{
//TODO:获取入库任务,并生成到巷道的任务
}
/// <summary>
/// 删除入库请求
/// /Input/ItemDropped
/// </summary>
/// <param name="itemDropped">取消入库请求报文</param>
[HttpPost("ItemDropped")]
public void GetItemDroppedFromGiraf(ItemDropped.RootObject itemDropped)
{
//TODO:获取轮胎post信息,并进行更新
}
/// <summary>
/// 取消入库请求
/// </summary>
/// <param name="inputRequest"></param>
[HttpPost("Cancel")]
public void CancelInputRequest(CancelInputRequest.RootObject inputRequest)
{
//TODO:取消入库请求,如果已经到入库口,无法进行取消
}
}

16
Controllers/IsAliveController.cs

@ -1,16 +0,0 @@
using Microsoft.AspNetCore.Mvc;
namespace WMS_GIRAF_Interface.Controllers
{
[ApiController, Route("api/[controller]")]
public class IsAliveController : ControllerBase
{
[HttpGet]
public bool SendWmsStatus()
{
return true;
}
}
}

34
Controllers/OutputRequestController.cs

@ -0,0 +1,34 @@
using Microsoft.AspNetCore.Mvc;
using WMS_GIRAF_Interface.Models;
namespace WMS_GIRAF_Interface.Controllers
{
[ApiController, Route("/Output")]
public class OutputRequestController : ControllerBase
{
[HttpPost("ByProductIds")]
public void OutputRequestByProductIds(OutputRequestByProductIds.RootObject outputRequest)
{
}
[HttpPost("BySku")]
public void OutputRequestBySku(OutputRequestBySku.RootObject outputRequest)
{
}
[HttpPut]
public void UpdateOutputRequest(UpdateOutputRequest.RootObject updateOutputRequest)
{
}
[HttpPost("Cancel")]
public void CancelOutputRequest(CancelOutputRequest.RootObject cancelOutputRequest)
{
}
}
}

45
Controllers/SendInputStorageLinePathStateController.cs

@ -1,45 +0,0 @@
using Microsoft.AspNetCore.Mvc;
using WMS_GIRAF_Interface.Models;
using WMS_GIRAF_Interface.Repositories.Implement;
using WMS_GIRAF_Interface.Repositories.Interface;
namespace WMS_GIRAF_Interface.Controllers
{
[ApiController, Route("api/[controller]")]
public class SendInputStorageLinePathStateController :ControllerBase
{
private readonly IdestinationIdRepository _destinationIdRepository;
public SendInputStorageLinePathStateController(IdestinationIdRepository destinationIdRepository)
{
_destinationIdRepository = destinationIdRepository;
}
/// <summary>
/// 更新入库路径状态
/// </summary>
[HttpPost]
public void GetInputStatusFromGiraf(InputStorageLinePathState.Rootobject inputStorageLinePathState )
{
//根据LineNumber获取巷道信息
if (inputStorageLinePathState.LineNumber!=0)
{
var LaneWayInfo = _destinationIdRepository.GetDestinationId(inputStorageLinePathState.LineNumber);
if (LaneWayInfo!=null)
{
}
}
else
{
//tlt:line number不可以为0
}
}
}
}

15
Controllers/UpdateProductsController.cs

@ -0,0 +1,15 @@
using Microsoft.AspNetCore.Mvc;
namespace WMS_GIRAF_Interface.Controllers
{
[ApiController]
[Route("products")]
public class UpdateProductsController : ControllerBase
{
[HttpPut]
public IActionResult UpdateProducts()
{
return Ok();
}
}
}

22
Models/CancelInputRequest.cs

@ -0,0 +1,22 @@
namespace WMS_GIRAF_Interface.Models;
public class CancelInputRequest
{
public class RootObject
{
/// <summary>
/// ASRS identifier
/// </summary>
public string asrsIdentifier { get; set; }
/// <summary>
/// Sender
/// </summary>
public string sender { get; set; }
/// <summary>
/// Input request id
/// </summary>
public string inputRequestId { get; set; }
}
}

15
Models/CancelInputRequestReturn.cs

@ -0,0 +1,15 @@
namespace WMS_GIRAF_Interface.Models;
public class CancelInputRequestReturn
{
/// <summary>
/// The status of the request
/// 0:UnknownError;1:Ok;2:UnknownPost;3:UnknownInputRequestId;4:AlreadyDone
/// </summary>
public string status { get; set; }
/// <summary>
/// if status !=1 error details
/// </summary>
public string? errorDetails { get; set; }
}

20
Models/CancelOutputRequest.cs

@ -0,0 +1,20 @@
namespace WMS_GIRAF_Interface.Models;
public class CancelOutputRequest
{
public class RootObject
{
/// <summary>
/// ASRS identifier
/// </summary>
public string asrsIdentifier { get; set; }
/// <summary>
/// Sender
/// </summary>
public string sender { get; set; }
/// <summary>
/// Input request id
/// </summary>
public string inputRequestId { get; set; }
}
}

15
Models/CancelOutputRequestReturn.cs

@ -0,0 +1,15 @@
namespace WMS_GIRAF_Interface.Models;
public class CancelOutputRequestReturn
{
/// <summary>
/// The status of the request
/// 0:UnknownError;1:Ok;2:UnknownPost;3:UnknownInputRequestId;4:AlreadyDone
/// </summary>
public string status { get; set; }
/// <summary>
/// if status !=1 error details
/// </summary>
public string? errorDetails { get; set; }
}

39
Models/GetStock.cs

@ -0,0 +1,39 @@
namespace WMS_GIRAF_Interface.Models;
public class GetStock
{
public class RootObject
{
public StockInfo[] stockInfos { get; set; }
}
public class StockInfo
{
public string sku { get; set; }
public string storageAddress { get; set; }
public Support support { get; set; }
public Product[] products { get; set; }
}
public class Support
{
public string type { get; set; }
public string identifier { get; set; }
public bool IsBlocked { get; set; }
}
public class Product
{
public string identifier { get; set; }
public bool isBlocked { get; set; }
public bool isPriority { get; set; }
public string productClass { get; set; }
public DateTime fabricationDate { get; set; }
public DateTime maturationDate { get; set; }
public DateTime expirationDate { get; set; }
public DateTime highPriorityDate { get; set; }
public bool IsAccessible { get; set; }
}
}

99
Models/InputRequest.cs

@ -0,0 +1,99 @@
namespace WMS_GIRAF_Interface.Models;
public class InputRequest
{
public class RootObject
{
/// <summary>
/// Identifier of the ASRS
/// </summary>
public string asrsIdentifier { get; set; }
/// <summary>
/// Application that sent the request
/// </summary>
public string sender { get; set; }
/// <summary>
/// Identifier of the input request (unique per sender)
/// </summary>
public string inputRequestId { get; set; }
/// <summary>
/// Type of item to insert(lot number)
/// </summary>
public string sku { get; set; }
/// <summary>
/// Post where the item will be dropped
/// </summary>
public string? introductionPost { get; set; }
/// <summary>
/// Possible posts where the item could be dropped
/// </summary>
public string[]? availableIntroductionPosts { get; set; }
/// <summary>
/// Support information
/// </summary>
public Support? support { get; set; }
/// <summary>
/// Products information
/// </summary>
public List<Product> products { get; set; }
}
/// <summary>
/// Support information
/// </summary>
public class Support
{
/// <summary>
/// type of support
/// </summary>
public string type { get; set; }
/// <summary>
/// identifier of support
/// </summary>
public string? identifier { get; set; }
/// <summary>
/// if support is blocked
/// </summary>
public bool IsBlocked { get; set; }
}
/// <summary>
/// product information
/// </summary>
public class Product
{
/// <summary>
/// tire barcode
/// </summary>
public string identifier { get; set; }
/// <summary>
/// if product is blocked
/// </summary>
public bool isBlocked { get; set; }
/// <summary>
/// if product is priority
/// </summary>
public bool isPriority { get; set; }
/// <summary>
/// population number
/// </summary>
public string? productClass { get; set; }
/// <summary>
/// fabrication date
/// </summary>
public DateTime? fabricationDate { get; set; }
/// <summary>
/// dry date
/// </summary>
public DateTime? maturationDate { get; set; }
/// <summary>
/// old time
/// </summary>
public DateTime? expirationDate { get; set; }
/// <summary>
/// <summary>
/// high priority date
/// </summary>
public DateTime? highPriorityDate { get; set; }
}
}

21
Models/InputRequestReturn.cs

@ -0,0 +1,21 @@
namespace WMS_GIRAF_Interface.Models;
public class InputRequestReturn
{
public class RootObject
{
/// <summary>
/// The status of the request
/// 0:UnknownError;1:Created;2:WrongParameters;3:NoStorageSpace;4:MechanicalIssue;5:UnknownPost
/// </summary>
public string status { get; set; }
/// <summary>
/// if status is 1, this will be the introduction post
/// </summary>
public string? introductionPost { get; set; }
/// <summary>
/// if status !=1 error details
/// </summary>
public string? errorDetails { get; set; }
}
}

14
Models/ItemDropped.cs

@ -0,0 +1,14 @@
namespace WMS_GIRAF_Interface.Models;
public class ItemDropped
{
public class RootObject
{
public string asrsIdentifier { get; set; }
public string sender { get; set; }
public string inputRequestId { get; set; }
public string introductionPost { get; set; }
}
}

18
Models/ItemDroppedReturn.cs

@ -0,0 +1,18 @@
namespace WMS_GIRAF_Interface.Models;
public class ItemDroppedReturn
{
public class RootObject
{
/// <summary>
/// The status of the request
/// 0:UnknownError;1:Ok;2:UnknownPost;3:UnknownInputRequestId;4:AlreadyDone
/// </summary>
public string status { get; set; }
/// <summary>
/// if status !=1 error details
/// </summary>
public string? errorDetails { get; set; }
}
}

18
Models/OutputRequestByProductIds.cs

@ -0,0 +1,18 @@
namespace WMS_GIRAF_Interface.Models;
public class OutputRequestByProductIds
{
public class RootObject
{
public string asrsIdentifier { get; set; }
public string sender { get; set; }
public string outputRequestId { get; set; }
public string evacuationPost { get; set; }
public string[] availableEvacuationPosts { get; set; }
public int priority { get; set; }
public string expectedCompletionDate { get; set; }
public string[] productIds { get; set; }
}
}

22
Models/OutputRequestByProductIdsReturn.cs

@ -0,0 +1,22 @@
namespace WMS_GIRAF_Interface.Models;
public class OutputRequestByProductIdsReturn
{
/// <summary>
/// The status of the request
/// 0:UnknownError;1:Created;2:WrongParameters;3:NoStorageSpace;4:MechanicalIssue;5:UnknownPost
/// </summary>
public string status { get; set; }
/// <summary>
/// If status = 1 : post where items will be unloaded
/// </summary>
public string? evacuationPost { get; set; }
/// <summary>
/// If status = 1 : mandatory
/// </summary>
public string? estimatedExitTime { get; set; }
/// <summary>
/// if status !=1 error details
/// </summary>
public string? errorDetails { get; set; }
}

24
Models/OutputRequestBySku.cs

@ -0,0 +1,24 @@
namespace WMS_GIRAF_Interface.Models;
public class OutputRequestBySku
{
public class RootObject
{
public string asrsIdentifier { get; set; }
public string sender { get; set; }
public string outputRequestId { get; set; }
public string evacuationPost { get; set; }
public string[] availableEvacuationPosts { get; set; }
public int priority { get; set; }
public string expectedCompletionDate { get; set; }
public string sku { get; set; }
public string[] substitutionSkus { get; set; }
public bool productIsBlocked { get; set; }
public string productClass { get; set; }
public bool productIsExpired { get; set; }
public string productMinFabricationDate { get; set; }
public string productMaxFabricationDate { get; set; }
}
}

22
Models/OutputRequestBySkuReturn.cs

@ -0,0 +1,22 @@
namespace WMS_GIRAF_Interface.Models;
public class OutputRequestBySkuReturn
{
/// <summary>
/// The status of the request
/// 0:UnknownError;1:Created;2:WrongParameters;3:NoStorageSpace;4:MechanicalIssue;5:UnknownPost
/// </summary>
public string status { get; set; }
/// <summary>
/// If status = 1 : post where items will be unloaded
/// </summary>
public string? evacuationPost { get; set; }
/// <summary>
/// If status = 1 : mandatory
/// </summary>
public string? estimatedExitTime { get; set; }
/// <summary>
/// if status !=1 error details
/// </summary>
public string? errorDetails { get; set; }
}

16
Models/UpdateOutputRequest.cs

@ -0,0 +1,16 @@
namespace WMS_GIRAF_Interface.Models;
public class UpdateOutputRequest
{
public class RootObject
{
public string asrsIdentifier { get; set; }
public string sender { get; set; }
public string outputRequestId { get; set; }
public string evacuationPost { get; set; }
public int priority { get; set; }
public DateTime expectedCompletionDate { get; set; }
}
}

15
Models/UpdateOutputRequestReturn.cs

@ -0,0 +1,15 @@
namespace WMS_GIRAF_Interface.Models;
public class UpdateOutputRequestReturn
{
/// <summary>
/// The status of the request
/// 0:UnknownError;1:Ok;2:UnknownPost;3:UnknownInputRequestId;4:AlreadyDone
/// </summary>
public string status { get; set; }
/// <summary>
/// if status !=1 error details
/// </summary>
public string? errorDetails { get; set; }
}

26
Models/UpdateProducts.cs

@ -0,0 +1,26 @@
namespace WMS_GIRAF_Interface.Models;
public class UpdateProducts
{
public class Rootobject
{
public string asrsIdentifier { get; set; }
public string sender { get; set; }
public string updateRequestId { get; set; }
public Product[] products { get; set; }
}
public class Product
{
public string identifier { get; set; }
public bool isBlocked { get; set; }
public bool isPriority { get; set; }
public string productClass { get; set; }
public DateTime maturationDate { get; set; }
public DateTime expirationDate { get; set; }
public DateTime highPriorityDate { get; set; }
public string newIdentifier { get; set; }
}
}

15
Models/UpdateProductsReturn.cs

@ -0,0 +1,15 @@
namespace WMS_GIRAF_Interface.Models;
public class UpdateProductsReturn
{
/// <summary>
/// The status of the request
/// 0:UnknownError;1:Ok;2:updatePartially;3:wrongParameters;
/// </summary>
public string status { get; set; }
/// <summary>
/// if status !=1 error details
/// </summary>
public string? errorDetails { get; set; }
}

7
appsettings.json

@ -5,5 +5,10 @@
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
"AllowedHosts": "*",
//APPToken
"APPToken": {
"WMSToken": "OLS"
}
}

Loading…
Cancel
Save