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
|
{
|
/// <summary>
|
/// 企企通SRM
|
/// </summary>
|
[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<IActionResult> GetSRMList(iSrmParams iParams)
|
{
|
ApiAction response = new();
|
try
|
{
|
response = response.GetResponse(DI.Resolve<IiSRM>().GetSRMList(iParams));
|
}
|
catch (System.Exception ex)
|
{
|
response = response.GetResponse().CatchExceptionWithLog(ex);
|
}
|
return Ok(response);
|
}
|
|
[HttpPost]
|
[Route("api/[controller]/[action]")]
|
public async Task<IActionResult> SrmDlvys(List<iSrmDlvy> dlvys)
|
{
|
ApiAction response = new();
|
try
|
{
|
response = response.GetResponse(_ISrmToWms.SrmDlvys(dlvys));
|
}
|
catch (System.Exception ex)
|
{
|
response = response.GetResponse().CatchExceptionWithLog(ex);
|
}
|
return Ok(response);
|
}
|
|
/// <summary>
|
/// qqt SRM推送到Wms
|
/// </summary>
|
/// <param name="dlvys"></param>
|
/// <returns></returns>
|
[HttpPost]
|
[Route("api/[controller]/[action]")]
|
public async Task<IActionResult> SrmDlvysToWms(List<iSrmDlvy> dlvys)
|
{
|
ApiAction response = new();
|
try
|
{
|
response = response.GetResponse(_ISrmToWms.SrmDlvysToWms(dlvys));
|
}
|
catch (System.Exception ex)
|
{
|
response = response.GetResponse().CatchExceptionWithLog(ex);
|
}
|
return Ok(response);
|
}
|
}
|
}
|