| | |
| | | using Model.ModelDto.PdaDto; |
| | | using Microsoft.AspNetCore.Identity; |
| | | using System.Security.Cryptography; |
| | | using Wms.Tools; |
| | | using Microsoft.Extensions.Options; |
| | | |
| | | namespace Wms.Controllers |
| | | { |
| | |
| | | [Authorize] |
| | | public class PdaCrController : ControllerBase |
| | | { |
| | | private readonly ApiUrlConfig _config; //接口交互路径 |
| | | private readonly IPdaCrServer _pdaCrSvc; |
| | | private readonly UserManager _userManager; |
| | | |
| | | public PdaCrController(IPdaCrServer pdaCrSvc, UserManager userManager) |
| | | public PdaCrController(IOptions<ApiUrlConfig> setting, IPdaCrServer pdaCrSvc, UserManager userManager) |
| | | { |
| | | _config = setting.Value; |
| | | _pdaCrSvc = pdaCrSvc; |
| | | _userManager = userManager; |
| | | } |
| | |
| | | [UnitOfWork] |
| | | public async Task AgvTransport(PdaAgvTransportVm model) |
| | | { |
| | | await _pdaCrSvc.AgvTransport(model.PalletNo, model.AreaNo, model.Ruku, _userManager.UserId); |
| | | await _pdaCrSvc.AgvTransport(model.PalletNo, model.AreaNo, model.Ruku, _config.WcsHost+ _config.IssueComApiUrl, _userManager.UserId); |
| | | } |
| | | /// <summary> |
| | | /// agv转运呼叫小车取货 |
| | |
| | | } |
| | | |
| | | var uId = int.Parse(userId); |
| | | _pdaCrSvc.AddLableByDevanning(model.BoxNo, model.DevanQty,uId); |
| | | var list = _pdaCrSvc.AddLableByDevanning(model.BoxNo, model.DevanQty,uId); |
| | | |
| | | return Ok(new { data = list, code = 0, msg = "成功" }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { data = "", code = 1, msg = $"异常:{e.Message}" }); |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 确认收货 |
| | | |
| | | /// <summary> |
| | | /// 根据收货托盘获取出库单信息 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult GetReceiptSoNoByPallet(PdaReceiptVm model) |
| | | { |
| | | try |
| | | { |
| | | |
| | | var soNo = _pdaCrSvc.GetReceiptSoNoByPallet(model.PalletNo); |
| | | |
| | | return Ok(new { data = soNo, code = 0, msg = "成功" }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { data = "", code = 1, msg = $"异常:{e.Message}" }); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 确认收货 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult ConfirmReceipt(PdaReceiptVm model) |
| | | { |
| | | try |
| | | { |
| | | _pdaCrSvc.ConfirmReceipt(model.PalletNo, _userManager.UserId); |
| | | |
| | | return Ok(new { data = "", code = 0, msg = "成功" }); |
| | | } |
| | |
| | | return Ok(new { data = "", code = 1, msg = $"异常:{e.Message}" }); |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region 物料拆托 |
| | | |
| | | /// <summary> |
| | | /// 查询箱信息 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult GetBoxInfo(PdaUpPalletVm model) |
| | | { |
| | | try |
| | | { |
| | | _pdaCrSvc.GetBoxInfo(model.BoxNo, model.PalletNo); |
| | | |
| | | return Ok(new { data = "", code = 0, msg = "成功" }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { data = "", code = 1, msg = $"异常:{e.Message}" }); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 物料拆托 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult UpPalletByBox(PdaUpPalletVm model) |
| | | { |
| | | try |
| | | { |
| | | _pdaCrSvc.UpPalletByBox(model.BoxNo, model.PalletNo,model.PalletNoNew,_userManager.UserId); |
| | | |
| | | return Ok(new { data = "", code = 0, msg = "成功" }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { data = "", code = 1, msg = $"异常:{e.Message}" }); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 根据托盘获取托盘上的物料批次信息 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult GetSelectSkuLotNo(PdaUpPalletVm model) |
| | | { |
| | | try |
| | | { |
| | | var list = _pdaCrSvc.GetSelectSkuLotNo(model.PalletNo); |
| | | |
| | | return Ok(new { data = list, code = 0, msg = "成功" }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { data = "", code = 1, msg = $"异常:{e.Message}" }); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 物料拆托 - 数量页签 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult UpPalletByQty(PdaUpPalletVm model) |
| | | { |
| | | try |
| | | { |
| | | _pdaCrSvc.UpPalletByQty(model.PalletNo, model.PalletNoNew, model.DetailId,model.Qty, _userManager.UserId); |
| | | |
| | | return Ok(new { data = "", code = 0, msg = "成功" }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { data = "", code = 1, msg = $"异常:{e.Message}" }); |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | } |