| | |
| | | using System.Threading.Tasks; |
| | | using WMS.BLL.BllPdaServer; |
| | | using WMS.IBLL.IPdaServer; |
| | | using WMS.BLL.BllQualityServer; |
| | | using WMS.IBLL; |
| | | |
| | | namespace Wms.Controllers |
| | | { |
| | |
| | | private readonly IStockCheckServer _stockCheckSvc;//盘点单Svc |
| | | private readonly IProcurePlanServer _procurePlanSvc;//采购单Svs |
| | | private readonly IPdaAsnServer _pdaAsnServer;// PDA |
| | | public UpApiController(IOptions<ApiUrlConfig> setting, IExportNoticeServer exNoticeSvc, IArrivalNoticeServer arrivalNoticeServer, IStockCheckServer stockCheckSvc, IProcurePlanServer procurePlanSvc, IPdaAsnServer pdaAsnServer) |
| | | private readonly IHttpServer _http; |
| | | |
| | | public UpApiController(IOptions<ApiUrlConfig> setting, IExportNoticeServer exNoticeSvc, IArrivalNoticeServer arrivalNoticeServer, IStockCheckServer stockCheckSvc, IProcurePlanServer procurePlanSvc, IPdaAsnServer pdaAsnServer, IHttpServer http) |
| | | { |
| | | _config = setting.Value; |
| | | _exNoticeSvc = exNoticeSvc; |
| | |
| | | _stockCheckSvc = stockCheckSvc; |
| | | _procurePlanSvc = procurePlanSvc; |
| | | _pdaAsnServer = pdaAsnServer; |
| | | _http = http; |
| | | } |
| | | #endregion |
| | | |
| | |
| | | { |
| | | return Ok(new { code = 1, msg = "未获取到当前请求箱码信息" }); |
| | | } |
| | | var models = _pdaAsnServer.GetFMBindBoxInfos(BoxNo); |
| | | var models = _pdaAsnServer.GetFMBindBoxInfos(BoxNo, _config.BoxHost + _config.GetBoxUrl); |
| | | |
| | | return Ok(new { code = 0, msg = "标签箱码信息", data = models }); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 发送请验单据 |
| | | /// </summary> |
| | | /// <param name="model">主键ID</param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult SendInspectionRequest(IdVm model) |
| | | { |
| | | try |
| | | { |
| | | 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 = "未获取到当前操作人信息" }); |
| | | } |
| | | var userName = claimsIdentity.FindFirst(ClaimTypes.NameIdentifier)?.Value; |
| | | |
| | | string url = _config.LimesHost + _config.SendInspection; |
| | | var models = _http.SendInspectionRequest(model, int.Parse(userId), url, userName); |
| | | |
| | | return Ok(new HttpReturnModel { Success = "0", Message = "向Limes请验成功!", Data = models }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new HttpReturnModel { Success = "1", Message = e.Message }); |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 被调上游调用接口 |