You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123 lines
3.8 KiB
C#

using Estsh.Core.Wms.IServices;
using Estsh.Core.Model.Result;
using Estsh.Core.Util;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Estsh.Core.Models;
namespace Estsh.Core.Web.Areas.Wms.Controllers.Receiving
{
[Route("wms/[controller]")]
[ApiController]
public class ReceiveCustomerController : Controller
{
private IReceiveService service;
public ReceiveCustomerController(IReceiveService _service)
{
this.service = _service;
}
[HttpPost("UpdateSap")]
public IActionResult UpdateSap(string orderNo, int userId)
{
List<RfInfo> obj = service.UpdateSap(orderNo, userId);
return Json(obj);
}
[HttpPost("GetFatidAccFatCode")]
public IActionResult GetFatidAccFatCode(Newtonsoft.Json.Linq.JObject jobj)
{
string factoryId = jobj["factoryId"].ToString();
WmsResponseResult result = new WmsResponseResult();
try
{
List<SysFactory> obj = service.GetFatidAccFatCode(factoryId);
result.Success = true;
result.Data = obj;
}
catch (Exception ex)
{
result.Msg = ex.Message;
}
return Json(result);
}
[HttpPost("GetInstruct")]
public IActionResult GetInstruct(Newtonsoft.Json.Linq.JObject jobj)
{
string vbeln = jobj["vbeln"].ToString();
WmsResponseResult result = new WmsResponseResult();
try
{
List<SapRdn> obj = service.GetInstruct(vbeln);
result.Success = true;
result.Data = obj;
}
catch (Exception ex)
{
result.Msg = ex.Message;
}
return Json(result);
}
[HttpPost("GetCartonReturn")]
public IActionResult GetCartonReturn(string orderNo, string locateName, string cartonNo, int userId)
{
List<RfInfo> obj = service.GetCartonReturn(orderNo, locateName, cartonNo, userId);
return Json(obj);
}
[HttpPost("Istru")]
public IActionResult Istru(string carton_no, float qty, string VBELN)
{
string[] obj = service.Istru(carton_no, qty, VBELN);
return Json(obj);
}
[HttpPost("GetNcLocate")]
public IActionResult GetNcLocate(string orderNo, string locateName)
{
List<dynamic> obj = service.GetNcLocate(orderNo, locateName);
return Json(obj);
}
[HttpPost("GetCustomerReturnInstr")]
public IActionResult GetCustomerReturnInstr(Newtonsoft.Json.Linq.JObject jobj)
{
string factory_code = jobj["factory_code"].ToString();
WmsResponseResult result = new WmsResponseResult();
try
{
List<SapRdn> obj = service.GetCustomerReturnInstr(factory_code);
result.Success = true;
result.Data = obj;
}
catch (Exception ex)
{
result.Msg = ex.Message;
}
return Json(result);
}
[HttpPost("UpdateSapStaLock")]
public IActionResult UpdateSapStaLock(Newtonsoft.Json.Linq.JObject jobj)
{
string vbeln = jobj["vbeln"].ToString();
WmsResponseResult result = new WmsResponseResult();
try
{
bool obj = service.UpdateSapStaLock(vbeln);
result.Success = true;
result.Data = obj;
}
catch (Exception ex)
{
result.Msg = ex.Message;
}
return Json(result);
}
}
}