Ancora update x gestione API ordini
This commit is contained in:
@@ -10,34 +10,70 @@ namespace WebDoorCreator.API.Controllers
|
||||
[ApiController]
|
||||
public class OrderController : ControllerBase
|
||||
{
|
||||
public OrderController(IConfiguration configuration, QueueDataService DataService)
|
||||
public OrderController(IConfiguration configuration, WebDoorCreatorService DataService)
|
||||
{
|
||||
Log.Info("Starting OrderController");
|
||||
_configuration = configuration;
|
||||
QDataServ = DataService;
|
||||
WDCService = DataService;
|
||||
Log.Info("Avviato OrderController");
|
||||
}
|
||||
// GET: api/Alive
|
||||
/// <summary>
|
||||
/// GET: api/Order
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public string Get()
|
||||
{
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Order detail for cost evaluation
|
||||
/// </summary>
|
||||
/// <param name="OrderId"></param>
|
||||
/// <returns></returns>
|
||||
/// GET: api/Order/GetCurrent
|
||||
/// Recupera ordini degli ultimi 6 mesi dato cliente e stato
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("GetCurrent")]
|
||||
public async Task<List<int>> GetCurrent(int id, int ordStatus)
|
||||
{
|
||||
List<int> answ = new List<int>();
|
||||
DateTime dtEnd = DateTime.Now;
|
||||
DateTime dtStart = dtEnd.AddMonths(-1);
|
||||
var rawData = await WDCService.OrderStatusGetFilt(id, ordStatus, dtStart, dtEnd);
|
||||
if (rawData != null)
|
||||
{
|
||||
answ = rawData.Select(x => x.OrderId).ToList();
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Order detail for cost evaluation
|
||||
/// </summary>
|
||||
/// <param name="OrderId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("OrderDetail")]
|
||||
public async Task<OrderDetailsDTO> OrderDetail(int OrderId)
|
||||
{
|
||||
OrderDetailsDTO answ = new OrderDetailsDTO();
|
||||
OrderDetailsDTO answ = new OrderDetailsDTO()
|
||||
{
|
||||
OrderId = OrderId
|
||||
};
|
||||
// recupero info ordine
|
||||
var rawOrder = await WDCService.OrderGetByKey(OrderId);
|
||||
if (rawOrder != null)
|
||||
{
|
||||
answ.OrderDescript = rawOrder.OrderDescript;
|
||||
answ.OrderExtCode = rawOrder.OrderExtCode;
|
||||
// recupero info customer
|
||||
|
||||
// recuper elenco porte...
|
||||
//answ. = rawOrder.OrderDescript;
|
||||
}
|
||||
// popolo con dati specifica...
|
||||
return answ;
|
||||
}
|
||||
|
||||
private static IConfiguration _configuration = null!;
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
private QueueDataService QDataServ { get; set; } = null!;
|
||||
private WebDoorCreatorService WDCService { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user