| | |
| | | using Model.ModelVm.PdaVm; |
| | | using System; |
| | | using System.Security.Claims; |
| | | using WMS.Entity.BllAsnEntity; |
| | | using WMS.IBLL.IPdaServer; |
| | | |
| | | namespace Wms.Controllers |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region MyRegion |
| | | |
| | | /// <summary> |
| | | /// 获取单据明细显示的物料 |
| | | /// </summary> |
| | | /// <param name="model">Type:单据类型</param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult GetArrivalNoticesInfo(ArrivalNoticeVm model) |
| | | { |
| | | try |
| | | { |
| | | var models = _PdaAsnSvc.GetArrivalNoticesInfo(model); |
| | | |
| | | return Ok(new { code = 0, msg = "入库单信息", data = models }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 公用方法 |
| | | /// <summary> |
| | | /// 获取单据列表 |
| | |
| | | var models = _PdaAsnSvc.GetArrivalNotices(model); |
| | | |
| | | return Ok(new { code = 0, msg = "入库单信息", data = models }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 根据入库单获取入库总单信息 |
| | | /// </summary> |
| | | /// <param name="model">ASNNo:入库单号</param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult GetArrivalNotice(ArrivalNoticeVm model) |
| | | { |
| | | try |
| | | { |
| | | var models = _PdaAsnSvc.GetArrivalNotice(model); |
| | | |
| | | if (models == null) |
| | | { |
| | | return Ok(new { code = 1, msg = "入库单信息", data = models }); |
| | | } |
| | | else |
| | | { |
| | | return Ok(new { code = 0, msg = "入库单信息", data = models }); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 绑定托盘 |
| | | /// 根据托盘号或箱码获取托盘信息 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <param name="model">PalletNo:托盘号</param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult BindPallet(PdaPalletBindVm model) |
| | | public IActionResult GetPalletBindInfo(BllPalletBind model) |
| | | { |
| | | try |
| | | { |
| | | var claimsIdentity = this.User.Identity as ClaimsIdentity; |
| | | if (claimsIdentity == null) |
| | | { |
| | | throw new Exception("未获取到用户信息"); |
| | | } |
| | | string UserId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value; |
| | | if (string.IsNullOrWhiteSpace(UserId)) |
| | | { |
| | | throw new Exception("未获取到用户信息"); |
| | | } |
| | | _PdaAsnSvc.BindPallet(model, int.Parse(UserId),model.Origin); |
| | | var models = _PdaAsnSvc.GetPalletBindInfo(model); |
| | | |
| | | return Ok(new { code = 0, msg = "绑定成功!" }); |
| | | |
| | | return Ok(new { code = 0, msg = "托盘信息", data = models }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | model.CreateUser = int.Parse(UserId); |
| | | |
| | | var strMsg = _PdaAsnSvc.DelBoxInfo(model); |
| | | |
| | | if (strMsg == "") |
| | | { |
| | | return Ok(new { code = 0, msg = "删除组托成功!" }); |
| | | } |
| | | else |
| | | { |
| | | return Ok(new { code = 1, msg = strMsg }); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 删除托盘信息 |
| | | /// </summary> |
| | | /// <param name="model">ID\托盘号</param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult DelPalletBind(BllPalletBind model) |
| | | { |
| | | try |
| | | { |
| | | var claimsIdentity = this.User.Identity as ClaimsIdentity; |
| | | if (claimsIdentity == null) |
| | | { |
| | | throw new Exception("未获取到用户信息"); |
| | | } |
| | | string UserId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value; |
| | | if (string.IsNullOrWhiteSpace(UserId)) |
| | | { |
| | | throw new Exception("未获取到用户信息"); |
| | | } |
| | | |
| | | model.CreateUser = int.Parse(UserId); |
| | | |
| | | var strMsg = _PdaAsnSvc.DelPalletBind(model); |
| | | |
| | | if (strMsg == "") |
| | | { |
| | |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 验证储位(地码)是否可用 |
| | | /// </summary> |
| | | /// <param name="model">LocatNo储位地址</param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult CheckLocatNo(PalletBindVm model) |
| | | { |
| | | try |
| | | { |
| | | var result = _PdaAsnSvc.CheckLocatNo(model.LocatNo); |
| | | |
| | | return Ok(new { code = 0, msg = "验证成功!", data = result }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 零箱入库 |
| | |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 组托 |
| | | /// <summary> |
| | | /// 根据箱码获取标签箱码信息 |
| | | /// </summary> |
| | | /// <param name="model">BoxNo:箱号</param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult GetBindBoxInfos(BoxInfoVm model) |
| | | { |
| | | try |
| | | { |
| | | var models = _PdaAsnSvc.GetBindBoxInfos(model); |
| | | |
| | | return Ok(new { code = 0, msg = "标签箱码信息", data = models }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 根据箱码获取标签最小追溯码信息 |
| | | /// </summary> |
| | | /// <param name="model">BoxNo:箱号</param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult GetBindBoxInfo2s(BoxInfoVm model) |
| | | { |
| | | try |
| | | { |
| | | var models = _PdaAsnSvc.GetBindBoxInfo2s(model); |
| | | |
| | | return Ok(new { code = 0, msg = "标签箱码信息", data = models }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | } |
| | | |
| | | [HttpPost] |
| | | public IActionResult GetBindArrivalNoticeDetails(ArrivalNoticeVm model) |
| | | { |
| | | try |
| | | { |
| | | var models = _PdaAsnSvc.GetBindArrivalNoticeDetails(model); |
| | | |
| | | return Ok(new { code = 0, msg = "入库单明细信息", data = models }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 绑定托盘 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult BindPallet(PdaPalletBindVm model) |
| | | { |
| | | try |
| | | { |
| | | var claimsIdentity = this.User.Identity as ClaimsIdentity; |
| | | if (claimsIdentity == null) |
| | | { |
| | | throw new Exception("未获取到用户信息"); |
| | | } |
| | | string UserId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value; |
| | | if (string.IsNullOrWhiteSpace(UserId)) |
| | | { |
| | | throw new Exception("未获取到用户信息"); |
| | | } |
| | | _PdaAsnSvc.BindPallet(model, int.Parse(UserId), model.Origin); |
| | | |
| | | return Ok(new { code = 0, msg = "绑定成功!" }); |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 平库入库 |
| | | /// <summary> |
| | | /// 平库确认入库 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult ConfirmInStock(PalletBindVm model) |
| | | { |
| | | try |
| | | { |
| | | var claimsIdentity = this.User.Identity as ClaimsIdentity; |
| | | if (claimsIdentity == null) |
| | | { |
| | | throw new Exception("未获取到用户信息"); |
| | | } |
| | | string UserId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value; |
| | | if (string.IsNullOrWhiteSpace(UserId)) |
| | | { |
| | | throw new Exception("未获取到用户信息"); |
| | | } |
| | | model.CreateUser = int.Parse(UserId); |
| | | _PdaAsnSvc.ConfirmInStock(model); |
| | | |
| | | return Ok(new { code = 0, msg = "入库成功!" }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |