chengsc
2025-05-13 6167bf4c8fe617d9f9861585042149d48ad15dbb
Wms/Wms/Controllers/UpApiController.cs
@@ -24,6 +24,8 @@
using System.Threading.Tasks;
using WMS.BLL.BllPdaServer;
using WMS.IBLL.IPdaServer;
using WMS.BLL.BllQualityServer;
using WMS.IBLL;
namespace Wms.Controllers
{
@@ -41,7 +43,9 @@
        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;
@@ -49,6 +53,7 @@
            _stockCheckSvc = stockCheckSvc;
            _procurePlanSvc = procurePlanSvc;
            _pdaAsnServer = pdaAsnServer;
            _http = http;
        }
        #endregion
@@ -268,7 +273,7 @@
                {
                    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 });
            }
@@ -278,6 +283,40 @@
            }
        }
        /// <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 被调上游调用接口