using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Rhea.Common;
using Tiger.Model;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Cors;
using Tiger.Model.Minsun;
using Tiger.IBusiness;
namespace Tiger.Api.Controllers.WMS
{
///
/// 企企通SRM
///
[EnableCors("Any")]
[ApiController]
public partial class SrmController : ControllerBase
{
private readonly ISrmToWms _ISrmToWms;
private readonly ISrmDataToSiHua _ISrmDataToSiHua;
public SrmController(ISrmToWms SrmToWms, ISrmDataToSiHua SrmDataToSiHua)
{
_ISrmToWms = SrmToWms;
_ISrmDataToSiHua = SrmDataToSiHua;
}
[HttpPost]
[Route("api/[controller]/[action]")]
public async Task GetSRMList(iSrmParams iParams)
{
ApiAction response = new();
try
{
response = response.GetResponse(DI.Resolve().GetSRMList(iParams));
}
catch (System.Exception ex)
{
response = response.GetResponse().CatchExceptionWithLog(ex);
}
return Ok(response);
}
[HttpPost]
[Route("api/[controller]/[action]")]
public async Task SrmDlvys(List dlvys)
{
ApiAction response = new();
try
{
response = response.GetResponse(_ISrmToWms.SrmDlvys(dlvys));
}
catch (System.Exception ex)
{
response = response.GetResponse().CatchExceptionWithLog(ex);
}
return Ok(response);
}
///
/// qqt SRM推送到Wms
///
///
///
[HttpPost]
[Route("api/[controller]/[action]")]
public async Task SrmDlvysToWms(List dlvys)
{
ApiAction response = new();
try
{
response = response.GetResponse(_ISrmToWms.SrmDlvysToWms(dlvys));
}
catch (System.Exception ex)
{
response = response.GetResponse().CatchExceptionWithLog(ex);
}
return Ok(response);
}
}
}