| | |
| | | using WMS.IBLL.IBllAsnServer; |
| | | using WMS.IBLL.ILogServer; |
| | | using Model.ModelVm.BllAsnVm; |
| | | using Wms.Tools; |
| | | using Microsoft.Extensions.Options; |
| | | |
| | | namespace Wms.Controllers |
| | | { |
| | |
| | | public class BllAsnController : ControllerBase |
| | | { |
| | | #region 依赖注入 |
| | | private readonly ApiUrlConfig _config; //接口交互路径 |
| | | private readonly IArrivalNoticeServer _arrivalNoticeSvc; // 入库单据Svc |
| | | private readonly IPalletBindServer _PalletBindSvc; // 托盘绑定Svc |
| | | private readonly IBllBoxInfoServer _BoxInfoSvc; |
| | |
| | | #endregion |
| | | |
| | | #region 构造函数 |
| | | public BllAsnController(IArrivalNoticeServer arrivalNoticeSvc, IPalletBindServer palletBindSvc,IBllBoxInfoServer bllBoxInfoSvc, ITaskServer taskSvc,IOperationASNServer logSvc, IPalletUnbindServer palletUnbind,IAuditLogServer auditLog,IBllLabelBoxNoServer labelBox) |
| | | public BllAsnController(IOptions<ApiUrlConfig> setting, IArrivalNoticeServer arrivalNoticeSvc, IPalletBindServer palletBindSvc,IBllBoxInfoServer bllBoxInfoSvc, ITaskServer taskSvc,IOperationASNServer logSvc, IPalletUnbindServer palletUnbind,IAuditLogServer auditLog,IBllLabelBoxNoServer labelBox) |
| | | { |
| | | _config = setting.Value; |
| | | _arrivalNoticeSvc = arrivalNoticeSvc; |
| | | _PalletBindSvc = palletBindSvc; |
| | | _BoxInfoSvc = bllBoxInfoSvc; |
| | |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 获取添加明细数据源 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult GetMaterialsList(GetMaterialsVm model) |
| | | { |
| | |
| | | } |
| | | |
| | | model.CreateUser = int.Parse(UserId); |
| | | string strMesage = _arrivalNoticeSvc.AddArrivalNotice(model); |
| | | string strMesage = _arrivalNoticeSvc.AddArrivalNotice(model, _config.WcsHost + _config.AddOrderTaskUrl); |
| | | |
| | | if (strMesage == "") |
| | | { |
| | |
| | | return Ok(new { code = 1, count = 0, msg = e.Message }); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | //编辑标签数量 |
| | | [HttpPost] |
| | | public IActionResult EditLabelQty(EditLabelQtyVm model) |
| | | { |
| | | try |
| | | { |
| | | //获取当前登录的用户ID |
| | | var claimsIdentity = this.User.Identity as ClaimsIdentity; |
| | | if (claimsIdentity == null) |
| | | { |
| | | return Ok(new { code = 1, msg = "未获取到当前操作人信息" }); |
| | | } |
| | | var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value; |
| | | if (string.IsNullOrWhiteSpace(userId)) |
| | | { |
| | | return Ok(new { code = 1, msg = "未获取到当前操作人信息" }); |
| | | } |
| | | _BoxInfoSvc.EditLabelQty(model.Id, model.Qty, int.Parse(userId)); |
| | | return Ok(new { code = 0, msg = "编辑成功", data = "" }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { code = 1, count = 0, msg = e.Message }); |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | } |