using Infrastructure.Extensions;
using JinianNet.JNTemplate;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.IdentityModel.Tokens;
using ZR.Admin.WebApi.Extensions;
using ZR.Model.Dto;
using ZR.Model.MES.qu;
using ZR.Model.MES.wms;
using ZR.Model.MES.wms.Dto;
using ZR.Service.mes.wms;
using ZR.Service.mes.wms.IService;
using static System.Runtime.InteropServices.JavaScript.JSType;
namespace ZR.Admin.WebApi.Controllers.mes.wms
{
///
/// 退库模块
///
[Route("/mes/wm/exitwarehouse")]
public class WMExitwarehouseController : BaseController
{
private readonly IWMExitwarehouseService Exitwarehouse;
public WMExitwarehouseController(IWMExitwarehouseService Exitwarehouse) {
this.Exitwarehouse = Exitwarehouse;
}
///
/// 一般退库
///
///
///
[HttpGet("common")]
public IActionResult ExitwarehouseCommmon(string originalCode)
{
string msg = null;
bool data = Exitwarehouse.ExitwarehouseCommmon(originalCode);
if (data)
{
msg = "退库成功";
}
else
{
msg = "箱子不在仓库中";
}
return ToResponse(new ApiResult(200, msg, data));
}
///
/// 7 判断箱子是否存在成品库仓库里
///
///
///
[HttpGet("is_existed_warehouse")]
public IActionResult IsExistedWarehouse(string originalCode = "")
{
if (string.IsNullOrEmpty(originalCode))
{
return ToResponse(new ApiResult(200, "传入为空", false));
}
string msg = null;
bool data = this.Exitwarehouse.IsExistedWarehouse(originalCode);
if (data)
{
msg = "存在";
}
else
{
msg = "不存在";
}
return ToResponse(new ApiResult(200, msg, data));
}
}
}