| | |
| | | using Model.ModelVm; |
| | | using Wms.Tools; |
| | | using Utility; |
| | | using System.Security.Cryptography; |
| | | |
| | | namespace Wms.Controllers |
| | | { |
| | |
| | | /// <param name="model">SoDetailId:出库单明细ID、PalletNo:托盘码</param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult SoSetPick(PdaSoVm model) |
| | | [ServiceFilter(typeof(ApiResponseActionFilter))] |
| | | public async Task SoSetPick(PdaSoVm 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 = "未获取到当前操作人信息" }); |
| | | } |
| | | |
| | | _pdaSoSvc.SoSetPick(model.SoNo, model.SoDetailId, model.PalletNo, model.BoxNo, model.BoxNo3, model.PickQty, int.Parse(userId)); |
| | | |
| | | return Ok(new { code = 0, msg = "拣货完成", data = "" }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | await _pdaSoSvc.SoSetPick(model.SoNo, model.SoDetailId, model.PalletNo, model.BoxNo, model.BoxNo3, model.PickQty, _userManager.UserId); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="model">SoDetailId:出库单明细ID、PalletNo:托盘码</param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult SoSetQtyPick(PdaSoVm model) |
| | | [ServiceFilter(typeof(ApiResponseActionFilter))] |
| | | public async Task SoSetQtyPick(PdaSoVm 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 = "未获取到当前操作人信息" }); |
| | | } |
| | | |
| | | _pdaSoSvc.SoSetQtyPick(model.SoNo, model.SoDetailId, model.PalletNo, model.PickQty, int.Parse(userId)); |
| | | |
| | | return Ok(new { code = 0, msg = "拣货完成", data = "" }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | await _pdaSoSvc.SoSetQtyPick(model.SoNo, model.SoDetailId, model.PalletNo, model.PickQty, _userManager.UserId); |
| | | } |
| | | |
| | | |
| | |
| | | /// <param name="model">空托盘出库</param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult IssuePlnOutHouse(OutModePalletVm model) |
| | | [ServiceFilter(typeof(ApiResponseActionFilter))] |
| | | public async Task<string> IssuePlnOutHouse(OutModePalletVm 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("未获取到用户信息"); |
| | | } |
| | | |
| | | var strMsg = _pdaSoSvc.IssuePlnOutHouse(model, int.Parse(UserId), _config.WcsHost + _config.IssueComApiUrl); |
| | | |
| | | 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 }); |
| | | } |
| | | return await _pdaSoSvc.IssuePlnOutHouse(model, _userManager.UserId, _config.WcsHost + _config.IssueComApiUrl); |
| | | } |
| | | |
| | | |
| | |
| | | /// <param name="palletNo">托盘号</param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | public IActionResult GetPingKuInfoByPallet(string soNo, string palletNo) |
| | | [ServiceFilter(typeof(ApiResponseActionFilter))] |
| | | public async Task<dynamic> GetPingKuInfoByPallet(string soNo, string palletNo) |
| | | { |
| | | try |
| | | { |
| | | var list = _pdaSoSvc.GetPingKuInfoByPallet(soNo, palletNo); |
| | | return Ok(new { data = list, code = 0, msg = "获取平库托盘信息成功" }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { data = "", code = 1, msg = "获取平库托盘信息错误:" + e.Message }); |
| | | } |
| | | return await _pdaSoSvc.GetPingKuInfoByPallet(soNo, palletNo); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="palletNo">托盘号</param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | public IActionResult PlaneExportSuccess(string soNo, string palletNo) |
| | | [ServiceFilter(typeof(ApiResponseActionFilter))] |
| | | public async Task PlaneExportSuccess(string soNo, string palletNo) |
| | | { |
| | | 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("未获取到用户信息"); |
| | | } |
| | | int uid = Convert.ToInt32(UserId); |
| | | |
| | | _pdaSoSvc.PlaneExportSuccess(soNo, palletNo, uid); |
| | | |
| | | return Ok(new { data = "", code = 0, msg = "平库出库成功" }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { data = "", code = 1, msg = "平库出库错误:" + e.Message }); |
| | | } |
| | | |
| | | await _pdaSoSvc.PlaneExportSuccess(soNo, palletNo, _userManager.UserId); |
| | | } |
| | | |
| | | |
| | |
| | | /// <param name="palletNo">托盘号</param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | public IActionResult GetSampleType(string palletNo) |
| | | [ServiceFilter(typeof(ApiResponseActionFilter))] |
| | | public async Task<string> GetSampleType(string palletNo) |
| | | { |
| | | 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("未获取到用户信息"); |
| | | } |
| | | |
| | | var type = _pdaSoSvc.GetSampleType(palletNo); |
| | | |
| | | return Ok(new { data = type, code = 0, msg = "获取取样类型" }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { data = "", code = 1, msg = "获取取样类型错误:" + e.Message }); |
| | | } |
| | | |
| | | return await _pdaSoSvc.GetSampleType(palletNo); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="palletNo">托盘号</param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | public IActionResult GetAsnNoByPallet(string palletNo) |
| | | [ServiceFilter(typeof(ApiResponseActionFilter))] |
| | | public async Task<List<string>> GetAsnNoByPallet(string palletNo) |
| | | { |
| | | try |
| | | { |
| | | var type = _pdaSoSvc.GetAsnNoByPallet(palletNo); |
| | | |
| | | return Ok(new { data = type, code = 0, msg = "获取入库单据" }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { data = "", code = 1, msg = "获取入库单据错误:" + e.Message }); |
| | | } |
| | | |
| | | return await _pdaSoSvc.GetAsnNoByPallet(palletNo); |
| | | } |
| | | /// <summary> |
| | | /// 取样出库拣货(标签) |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult SampleSoSetPick(PdaSoVm model) |
| | | [ServiceFilter(typeof(ApiResponseActionFilter))] |
| | | public async Task SampleSoSetPick(PdaSoVm 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("未获取到用户信息"); |
| | | } |
| | | int uid = Convert.ToInt32(UserId); |
| | | |
| | | _pdaSoSvc.SampleSoSetPick(model.Type, model.SoNo, model.SoDetailId, model.PalletNo, model.BoxNo, model.BoxNo3, model.PickQty, model.AsnNo, uid); |
| | | |
| | | return Ok(new { data = "", code = 0, msg = "(标签)取样出库拣货" }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { data = "", code = 1, msg = "(标签)取样出库拣货错误:" + e.Message }); |
| | | } |
| | | |
| | | await _pdaSoSvc.SampleSoSetPick(model.Type, model.SoNo, model.SoDetailId, model.PalletNo, model.BoxNo, model.BoxNo3, model.PickQty, model.AsnNo, _userManager.UserId); |
| | | } |
| | | /// <summary> |
| | | /// 取样出库拣货(无标签) |