using Kean.Application.Command.ViewModels; using Kean.Infrastructure.Soap; using Kean.Presentation.Rest.Models; using Kean.Presentation.Rest.Soaps.Contracts; using Microsoft.Extensions.Logging; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace Kean.Presentation.Rest.Soaps.Services { [Route("soap/AgvApply")] public class AgvApplyService : IAgvApplyService { private readonly ILogger _logger; // 日志 private readonly Application.Command.Interfaces.IStockService _stockCommandService; // 库存命令服务 private readonly Application.Query.Interfaces.IMaterialService _materialQueryService; // 物料查询服务 private readonly Kean.Infrastructure.Configuration.BarcodeInterpreter _barcodeInterpreter; // 条码解释器 /// /// 依赖注入 /// public AgvApplyService( Application.Command.Interfaces.IStockService stockCommandService, Kean.Infrastructure.Configuration.BarcodeInterpreter barcodeInterpreter, ILogger logger, Application.Query.Interfaces.IMaterialService materialQueryService) { _stockCommandService = stockCommandService; _materialQueryService = materialQueryService; _logger = logger; _barcodeInterpreter = barcodeInterpreter; } /// /// 申请入库 /// public async Task AgvApplyIn(string barcode, List sfc) { _logger.LogInformation($"AGV申请入库接口[ApplyIn]开始:参数barcode-{barcode} sfc-{sfc}"); Result result = new Result(); result.code = ""; await _materialQueryService.GetMaterial(barcode, false); _logger.LogInformation($"AGV申请入库接口[ApplyIn]结束: 结果RESULT-{result.code} 消息MSG-{result.message}"); return JsonConvert.SerializeObject(result); } } }