| | |
| | | [Authorize] |
| | | public class PdaAsnController : ControllerBase |
| | | { |
| | | #region 依赖注入 |
| | | private readonly IPdaAsnServer _PdaAsnSvc; |
| | | |
| | | public PdaAsnController(IPdaAsnServer pdaAsnSvc) |
| | | { |
| | | _PdaAsnSvc = pdaAsnSvc; |
| | | } |
| | | |
| | | |
| | | #region JC34 |
| | | |
| | | //---------------------------------------------组托收货页面---------------------------------------------------------------------- |
| | | |
| | | /// <summary> |
| | | /// 绑定托盘 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | /// <returns></returns> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [UnitOfWork] |
| | | public IActionResult BindPallet(PdaPalletBindVm model) |
| | | { |
| | | 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("未获取到用户信息"); |
| | | } |
| | | if (model.TableType == 0) |
| | | { |
| | | _PdaAsnSvc.BindPalletPasteCode(model, int.Parse(UserId)); |
| | | } |
| | | else if (model.TableType == 1) |
| | | { |
| | | _PdaAsnSvc.BindPalletNoPasteCode(model, int.Parse(UserId)); |
| | | } |
| | | |
| | | return Ok(new { code = 0, msg = "绑定成功!" }); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取需要贴标签的入库单 单据号集合 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult GetPasteAsnNoStrList() |
| | | { |
| | | try |
| | | { |
| | | var models = _PdaAsnSvc.GetPasteAsnNoStrList(); |
| | | |
| | | return Ok(new { code = 0, msg = "入库单信息", data = models }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取不需要贴标签的入库单 单据号集合 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult GetNoPasteAsnNoStrList() |
| | | { |
| | | try |
| | | { |
| | | var models = _PdaAsnSvc.GetNoPasteAsnNoStrList(); |
| | | |
| | | return Ok(new { code = 0, msg = "入库单信息", data = models }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 判断托盘是否可用 |
| | | /// </summary> |
| | | /// <param name="model">PalletNo:托盘条码</param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult IsEnablePalletNo(PalletBindVm model) |
| | | { |
| | | try |
| | | { |
| | | var strMsg = _PdaAsnSvc.IsEnablePalletNo(model.PalletNo); |
| | | |
| | | 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> |
| | | /// 根据单据号获取贴标的入库单据信息(ID-物料-批次) |
| | | /// </summary> |
| | | /// <param name="model">AsnNo:单据号</param> |
| | | /// <returns></returns> |
| | | [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> |
| | | /// 根据单据号获取不贴标的入库单据信息(ID-物料-批次) |
| | | /// </summary> |
| | | /// <param name="model">AsnNo:单据号</param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult GetArrivalNoticeDetails(ArrivalNoticeVm model) |
| | | { |
| | | try |
| | | { |
| | | var models = _PdaAsnSvc.GetArrivalNoticeDetails(model); |
| | | |
| | | return Ok(new { code = 0, msg = "入库单明细信息", data = models }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 根据入库单明细ID获取物料详情 (PDA物料批次选项数据) |
| | | /// </summary> |
| | | /// <param name="model">Id:入库单明细ID</param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult GetArrivalNoticeDetail(ArrivalNoticeDetailVm model) |
| | | { |
| | | try |
| | | { |
| | | var models = _PdaAsnSvc.GetArrivalNoticeDetail(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 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 }); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | //---------------------------------------------组托收货页面---------------------------------------------------------------------- |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region 公用方法 |
| | | /// <summary> |
| | |
| | | { |
| | | return Ok(new { code = 0, msg = "入库单信息", data = models }); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 判断托盘是否可用 |
| | | /// </summary> |
| | | /// <param name="model">PalletNo:托盘条码</param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult IsEnablePalletNo(PalletBindVm model) |
| | | { |
| | | try |
| | | { |
| | | var strMsg = _PdaAsnSvc.IsEnablePalletNo(model.PalletNo); |
| | | |
| | | 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">AsnNo:单据号</param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult GetArrivalNoticeDetails(ArrivalNoticeVm model) |
| | | { |
| | | try |
| | | { |
| | | var models = _PdaAsnSvc.GetArrivalNoticeDetails(model); |
| | | |
| | | return Ok(new { code = 0, msg = "入库单明细信息", data = models }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 根据明细ID获取物料详情 |
| | | /// </summary> |
| | | /// <param name="model">Id:入库单明细ID</param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult GetArrivalNoticeDetail(ArrivalNoticeDetailVm model) |
| | | { |
| | | try |
| | | { |
| | | var models = _PdaAsnSvc.GetArrivalNoticeDetail(model); |
| | | |
| | | return Ok(new { code = 0, msg = "入库单明细详细信息", data = models }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 生产入库 |
| | | |
| | | #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 }); |
| | | } |
| | | } |
| | | [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] |
| | | [UnitOfWork] |
| | | public IActionResult BindPallet(PdaPalletBindVm model) |
| | | { |
| | | 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("未获取到用户信息"); |
| | | } |
| | | if (model.TableType == 0) |
| | | { |
| | | _PdaAsnSvc.BindPalletPasteCode(model, int.Parse(UserId)); |
| | | } |
| | | else if (model.TableType == 1) |
| | | { |
| | | _PdaAsnSvc.BindPalletNoPasteCode(model, int.Parse(UserId)); |
| | | } |
| | | |
| | | return Ok(new { code = 0, msg = "绑定成功!" }); |
| | | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region 平库入库 |
| | | /// <summary> |