|
|
|
|
using Estsh.Core.Wms.IServices;
|
|
|
|
|
using Estsh.Core.Model.Result;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using Estsh.Core.Models;
|
|
|
|
|
using Estsh.Core.Controllers;
|
|
|
|
|
|
|
|
|
|
namespace Estsh.Core.Web.Areas.Wms.Controllers.Receiving
|
|
|
|
|
{
|
|
|
|
|
[Route("wms/[controller]")]
|
|
|
|
|
[ApiController]
|
|
|
|
|
public class ReceiveController : WmsBaseController
|
|
|
|
|
{
|
|
|
|
|
private IReceiveService service;
|
|
|
|
|
|
|
|
|
|
// GET: LoginController
|
|
|
|
|
public ReceiveController(IReceiveService _service)
|
|
|
|
|
{
|
|
|
|
|
service = _service;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpPost("CheckCartonStatus")]
|
|
|
|
|
public IActionResult CheckCartonStatus(Newtonsoft.Json.Linq.JObject jobj)
|
|
|
|
|
{
|
|
|
|
|
string cartonNo = jobj["cartonNo"].ToString();
|
|
|
|
|
string destStatus = jobj["destStatus"].ToString();
|
|
|
|
|
string orderNo = jobj["orderNo"].ToString();
|
|
|
|
|
|
|
|
|
|
WmsResponseResult result = new WmsResponseResult();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
string obj = service.CheckCartonStatus(cartonNo, destStatus, orderNo);
|
|
|
|
|
result.Success = true;
|
|
|
|
|
result.Data = obj;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
result.Msg = ex.Message;
|
|
|
|
|
}
|
|
|
|
|
return Json(result);
|
|
|
|
|
}
|
|
|
|
|
[HttpPost("GetPassword")]
|
|
|
|
|
public IActionResult GetPassword()
|
|
|
|
|
{
|
|
|
|
|
WmsResponseResult result = new WmsResponseResult();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
List<SysBase> obj = service.GetPassword();
|
|
|
|
|
|
|
|
|
|
result.Success = true;
|
|
|
|
|
result.Data = obj;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
result.Msg = ex.Message;
|
|
|
|
|
}
|
|
|
|
|
return Json(result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpPost("IsInputDateCode")]
|
|
|
|
|
public IActionResult IsInputDateCode()
|
|
|
|
|
{
|
|
|
|
|
WmsResponseResult result = new WmsResponseResult();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
bool obj = service.IsInputDateCode();
|
|
|
|
|
result.Success = true;
|
|
|
|
|
result.Data = obj;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
result.Msg = ex.Message;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Json(result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpPost("TransASN_PO")]
|
|
|
|
|
public IActionResult TransASN_PO(Newtonsoft.Json.Linq.JObject jobj)
|
|
|
|
|
{
|
|
|
|
|
string orderNo = jobj["orderNo"].ToString();
|
|
|
|
|
|
|
|
|
|
WmsResponseResult result = new WmsResponseResult();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
List<RfInfo> obj = service.TransASN_PO(orderNo);
|
|
|
|
|
result.Success = true;
|
|
|
|
|
result.Data = obj;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
result.Msg = ex.Message;
|
|
|
|
|
}
|
|
|
|
|
return Json(result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpPost("GetGROrderNo")]
|
|
|
|
|
public IActionResult GetGROrderNo(Newtonsoft.Json.Linq.JObject jobj)
|
|
|
|
|
{
|
|
|
|
|
string cartonNo = jobj["cartonNo"].ToString();
|
|
|
|
|
WmsResponseResult result = new WmsResponseResult();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
string obj = service.GetGROrderNo(cartonNo);
|
|
|
|
|
result.Success = true;
|
|
|
|
|
result.Data = obj;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
result.Msg = ex.Message;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Json(result);
|
|
|
|
|
}
|
|
|
|
|
[HttpPost("CheckPartNow")]
|
|
|
|
|
public IActionResult CheckPartNow(Newtonsoft.Json.Linq.JObject jobj)
|
|
|
|
|
{
|
|
|
|
|
string cartonNo = jobj["cartonNo"].ToString();
|
|
|
|
|
WmsResponseResult result = new WmsResponseResult();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
object obj = service.CheckPartNow(cartonNo);
|
|
|
|
|
result.Success = true;
|
|
|
|
|
result.Data = obj;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
result.Msg = ex.Message;
|
|
|
|
|
}
|
|
|
|
|
return Json(result);
|
|
|
|
|
}
|
|
|
|
|
[HttpPost("ConfirmQc")]
|
|
|
|
|
public IActionResult ConfirmQc(Newtonsoft.Json.Linq.JObject jobj)
|
|
|
|
|
{
|
|
|
|
|
string orderNo = jobj["orderNo"].ToString();
|
|
|
|
|
int userId = Convert.ToInt32(jobj["userId"]);
|
|
|
|
|
WmsResponseResult result = new WmsResponseResult();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
List<RfInfo> obj = service.ConfirmQc(orderNo, userId);
|
|
|
|
|
result.Success = true;
|
|
|
|
|
result.Data=obj;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
result.Msg=ex.Message;
|
|
|
|
|
}
|
|
|
|
|
return Json(result);
|
|
|
|
|
}
|
|
|
|
|
[HttpPost("GetCompareSeDate")]
|
|
|
|
|
public IActionResult GetCompareSeDate(Newtonsoft.Json.Linq.JObject jobj)
|
|
|
|
|
{
|
|
|
|
|
string cartonNo = jobj["cartonNo"].ToString();
|
|
|
|
|
WmsResponseResult result = new WmsResponseResult();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
List<RfInfo> obj = service.GetCompareSeDate(cartonNo);
|
|
|
|
|
result.Success = true;
|
|
|
|
|
result.Data = obj;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
result.Msg = ex.Message;
|
|
|
|
|
}
|
|
|
|
|
return Json(result);
|
|
|
|
|
}
|
|
|
|
|
[HttpPost("GetDayReceivedInfo")]
|
|
|
|
|
public IActionResult GetDayReceivedInfo(Newtonsoft.Json.Linq.JObject jobj)
|
|
|
|
|
{
|
|
|
|
|
string cartonNo = jobj["cartonNo"].ToString();
|
|
|
|
|
WmsResponseResult result=new WmsResponseResult();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
List<dynamic> obj = service.GetDayReceivedInfo(cartonNo);
|
|
|
|
|
result.Success=true;
|
|
|
|
|
result.Data = obj;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
result.Msg = ex.Message;
|
|
|
|
|
}
|
|
|
|
|
return Json(result);
|
|
|
|
|
}
|
|
|
|
|
[HttpPost("GetGroup")]
|
|
|
|
|
public IActionResult GetGroup(Newtonsoft.Json.Linq.JObject jobj)
|
|
|
|
|
{
|
|
|
|
|
string cartonNo = jobj["cartonNo"].ToString();
|
|
|
|
|
WmsResponseResult result = new WmsResponseResult();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
string obj = service.GetGroup(cartonNo);
|
|
|
|
|
result.Success=true;
|
|
|
|
|
result.Data = obj;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
result.Msg = ex.Message;
|
|
|
|
|
}
|
|
|
|
|
return Json(result);
|
|
|
|
|
}
|
|
|
|
|
[HttpPost("GetPlanQty")]
|
|
|
|
|
public IActionResult GetPlanQty(Newtonsoft.Json.Linq.JObject jobj)
|
|
|
|
|
{
|
|
|
|
|
string cartonNo = jobj["cartonNo"].ToString();
|
|
|
|
|
WmsResponseResult result = new WmsResponseResult();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
string obj = service.GetPlanQty(cartonNo);
|
|
|
|
|
result.Success = true;
|
|
|
|
|
result.Data = obj;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
result.Msg = ex.Message;
|
|
|
|
|
}
|
|
|
|
|
return Json(result);
|
|
|
|
|
}
|
|
|
|
|
[HttpPost("GetProductionBatch")]
|
|
|
|
|
public IActionResult GetProductionBatch()
|
|
|
|
|
{
|
|
|
|
|
WmsResponseResult result = new WmsResponseResult();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
bool obj = service.GetProductionBatch();
|
|
|
|
|
result.Success = true;
|
|
|
|
|
result.Data = obj;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
result.Msg = ex.Message;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Json(result);
|
|
|
|
|
}
|
|
|
|
|
[HttpPost("GetUpdateCarton")]
|
|
|
|
|
public IActionResult GetUpdateCarton(Newtonsoft.Json.Linq.JObject jobj)
|
|
|
|
|
{
|
|
|
|
|
string cartonNo = jobj["cartonNo"].ToString();
|
|
|
|
|
WmsResponseResult result = new WmsResponseResult();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
List<sys_gr_chk_updateqty> obj = service.GetUpdateCarton(cartonNo);
|
|
|
|
|
result.Success = true;
|
|
|
|
|
result.Data = obj;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
result.Msg = ex.Message;
|
|
|
|
|
}
|
|
|
|
|
return Json(result);
|
|
|
|
|
}
|
|
|
|
|
[HttpPost("GetUser")]
|
|
|
|
|
public IActionResult GetUser(Newtonsoft.Json.Linq.JObject jobj)
|
|
|
|
|
{
|
|
|
|
|
string user = jobj["user"].ToString();
|
|
|
|
|
WmsResponseResult result = new WmsResponseResult();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
List<SysBase> obj = service.GetUser(user);
|
|
|
|
|
result.Success = true;
|
|
|
|
|
result.Data = obj;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
result.Msg = ex.Message;
|
|
|
|
|
}
|
|
|
|
|
return Json(result);
|
|
|
|
|
}
|
|
|
|
|
[HttpPost("isExistCheckPart")]
|
|
|
|
|
public IActionResult isExistCheckPart(Newtonsoft.Json.Linq.JObject jobj)
|
|
|
|
|
{
|
|
|
|
|
string CartonNo = jobj["cartonNo"].ToString();
|
|
|
|
|
WmsResponseResult result = new WmsResponseResult();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
bool obj = service.isExistCheckPart(CartonNo);
|
|
|
|
|
result.Success = true;
|
|
|
|
|
result.Data = obj;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
result.Msg = ex.Message;
|
|
|
|
|
}
|
|
|
|
|
return Json(result);
|
|
|
|
|
}
|
|
|
|
|
[HttpPost("ReceiveCarton")]
|
|
|
|
|
//public IActionResult ReceiveCarton(string cartonNo, string groupNo, double qty, string shipNo, string factoryId, int userId, string mfgLogNo, string batchpartNo, string batchflag)
|
|
|
|
|
public IActionResult ReceiveCarton(Newtonsoft.Json.Linq.JObject jobj)
|
|
|
|
|
{
|
|
|
|
|
WmsResponseResult result = new WmsResponseResult();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
string cartonNo = jobj["cartonNo"].ToString();
|
|
|
|
|
string groupNo = jobj["groupNo"].ToString();
|
|
|
|
|
double qty = Convert.ToDouble(jobj["qty"].ToString() == "" ? 0 : jobj["qty"]);
|
|
|
|
|
string shipNo = jobj["shipNo"].ToString();
|
|
|
|
|
string factoryId = jobj["factoryId"].ToString();
|
|
|
|
|
int userId = Convert.ToInt32(jobj["userId"].ToString());
|
|
|
|
|
string mfgLogNo = jobj["mfgLogNo"].ToString();
|
|
|
|
|
string batchpartNo = jobj["batchpartNo"].ToString();
|
|
|
|
|
string batchflag = jobj["batchflag"].ToString();
|
|
|
|
|
List<dynamic> obj = service.ReceiveCarton(cartonNo, groupNo, qty, shipNo, factoryId, userId, mfgLogNo, batchpartNo, batchflag);
|
|
|
|
|
|
|
|
|
|
result.Success = true;
|
|
|
|
|
result.Data = obj;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
result.Msg = ex.Message;
|
|
|
|
|
}
|
|
|
|
|
return Json(result);
|
|
|
|
|
}
|
|
|
|
|
[HttpPost("updateCheckCounter")]
|
|
|
|
|
public IActionResult updateCheckCounter(Newtonsoft.Json.Linq.JObject jobj)
|
|
|
|
|
{
|
|
|
|
|
string cartonNo = jobj["cartonNo"].ToString();
|
|
|
|
|
WmsResponseResult result = new WmsResponseResult();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
object obj = service.updateCheckCounter(cartonNo);
|
|
|
|
|
result.Success = true;
|
|
|
|
|
result.Data = obj;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
result.Msg = ex.Message;
|
|
|
|
|
}
|
|
|
|
|
return Json(result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpPost("SaveCheckplan")]
|
|
|
|
|
public IActionResult SaveCheckplan(string cartonNo, int qty, int userID)
|
|
|
|
|
{
|
|
|
|
|
List<RfInfo> obj = service.SaveCheckplan(cartonNo, qty, userID);
|
|
|
|
|
return Json(obj);
|
|
|
|
|
}
|
|
|
|
|
[HttpPost("GetProdBatchPart")]
|
|
|
|
|
public IActionResult GetProdBatchPart(string carton_no)
|
|
|
|
|
{
|
|
|
|
|
List<dynamic> obj = service.GetProdBatchPart(carton_no);
|
|
|
|
|
return Json(obj);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|