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.
197 lines
6.3 KiB
C#
197 lines
6.3 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;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Estsh.Core.Controllers;
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
namespace Estsh.Core.Web.Plugin.Wms.Areas.wms.Controllers.Move
|
|
{
|
|
[Route("wms/[controller]")]
|
|
[ApiController]
|
|
public class MoveController : Controller
|
|
{
|
|
private IMoveService service;
|
|
|
|
// GET: LoginController
|
|
public MoveController(IMoveService _service)
|
|
{
|
|
service = _service;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 判断库位
|
|
/// </summary>
|
|
/// <returns>工厂代码1002</returns>
|
|
[HttpPost("CheckLocateName")]
|
|
public IActionResult CheckLocateName(Newtonsoft.Json.Linq.JObject jobj)
|
|
{
|
|
string loginId = jobj["loginId"].ToString().Trim();
|
|
string locateName = jobj["locateName"].ToString().Trim();
|
|
string isPack = jobj["isPack"].ToString().Trim();
|
|
WmsResponseResult result = new WmsResponseResult();
|
|
try
|
|
{
|
|
string obj = service.CheckLocateName(loginId, locateName, isPack);
|
|
|
|
result.Success = true;
|
|
result.Data = obj;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
result.Msg = ex.Message;
|
|
}
|
|
return Json(result);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 执行移库操作
|
|
/// </summary>
|
|
/// <param name="jobj"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("CheckMove")]
|
|
public IActionResult CheckMove(Newtonsoft.Json.Linq.JObject jobj)
|
|
{
|
|
string loginId = jobj["loginId"].ToString().Trim();
|
|
string locateName = jobj["locateName"].ToString().Trim();
|
|
string isPack = jobj["isPack"].ToString().Trim();
|
|
string cartonNo = jobj["cartonNo"].ToString().Trim();
|
|
WmsResponseResult result = new WmsResponseResult();
|
|
try
|
|
{
|
|
result = service.CheckMove(loginId, cartonNo, locateName, isPack);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
result.Msg = ex.Message;
|
|
}
|
|
return Json(result);
|
|
}
|
|
|
|
[HttpPost("GetMovePartInfo")]
|
|
public IActionResult GetMovePartInfo(Newtonsoft.Json.Linq.JObject jobj)
|
|
{
|
|
string isPack = jobj["isPack"].ToString().Trim();
|
|
string cartonNo = jobj["cartonNo"].ToString().Trim();
|
|
WmsResponseResult result = new WmsResponseResult();
|
|
try
|
|
{
|
|
List<SysStock> obj = service.GetMovePartInfo(cartonNo, isPack);
|
|
|
|
result.Success = true;
|
|
result.Data = obj;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
result.Msg = ex.Message;
|
|
}
|
|
return Json(result);
|
|
}
|
|
|
|
[HttpPost("GetMoveOrderList")]
|
|
public IActionResult GetMoveOrderList()
|
|
{
|
|
WmsResponseResult result = new WmsResponseResult();
|
|
try
|
|
{
|
|
List<WmsMoveHeader> obj = service.GetMoveOrderList();
|
|
|
|
result.Success = true;
|
|
result.Data = obj;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
result.Msg = ex.Message;
|
|
}
|
|
return Json(result);
|
|
}
|
|
|
|
[HttpPost("CheckMoveOrderLocateName")]
|
|
public IActionResult CheckMoveOrderLocateName(Newtonsoft.Json.Linq.JObject jobj)
|
|
{
|
|
string loginId = jobj["loginId"].ToString().Trim();
|
|
string locateName = jobj["locateName"].ToString().Trim();
|
|
string orderNo = jobj["orderNo"].ToString().Trim();
|
|
WmsResponseResult result = new WmsResponseResult();
|
|
try
|
|
{
|
|
string obj = service.CheckMoveOrderLocateName(loginId, locateName, orderNo);
|
|
|
|
result.Success = true;
|
|
result.Data = obj;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
result.Msg = ex.Message;
|
|
}
|
|
return Json(result);
|
|
}
|
|
|
|
[HttpPost("CheckCartonMoveOrder")]
|
|
public IActionResult CheckCartonMoveOrder(Newtonsoft.Json.Linq.JObject jobj)
|
|
{
|
|
string loginId = jobj["loginId"].ToString().Trim();
|
|
string locateName = jobj["locateName"].ToString().Trim();
|
|
string orderNo = jobj["orderNo"].ToString().Trim();
|
|
string cartonNo = jobj["cartonNo"].ToString().Trim();
|
|
WmsResponseResult result = new WmsResponseResult();
|
|
try
|
|
{
|
|
string obj = service.CheckCartonMoveOrder(loginId, cartonNo, locateName, orderNo);
|
|
|
|
result.Success = true;
|
|
result.Data = obj;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
result.Msg = ex.Message;
|
|
}
|
|
return Json(result);
|
|
}
|
|
|
|
[HttpPost("GetMoveOrderDetailList")]
|
|
public IActionResult GetMoveOrderDetailList(Newtonsoft.Json.Linq.JObject jobj)
|
|
{
|
|
string orderNo = jobj["orderNo"].ToString().Trim();
|
|
WmsResponseResult result = new WmsResponseResult();
|
|
try
|
|
{
|
|
List<WmsMoveDetail> obj = service.GetMoveOrderDetailList(orderNo);
|
|
|
|
result.Success = true;
|
|
result.Data = obj;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
result.Msg = ex.Message;
|
|
}
|
|
return Json(result);
|
|
}
|
|
|
|
[HttpPost("ChangeMoveHeaderStatus")]
|
|
public IActionResult ChangeMoveHeaderStatus(Newtonsoft.Json.Linq.JObject jobj)
|
|
{
|
|
string loginId = jobj["loginId"].ToString().Trim();
|
|
string orderNo = jobj["orderNo"].ToString().Trim();
|
|
WmsResponseResult result = new WmsResponseResult();
|
|
try
|
|
{
|
|
string obj = service.ChangeMoveHeaderStatus(loginId, orderNo);
|
|
|
|
result.Success = true;
|
|
result.Data = obj;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
result.Msg = ex.Message;
|
|
}
|
|
return Json(result);
|
|
}
|
|
}
|
|
}
|