You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
2.1 KiB
54 lines
2.1 KiB
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<AgvApplyService> _logger; // 日志
|
|
private readonly Application.Command.Interfaces.IStockService _stockCommandService; // 库存命令服务
|
|
private readonly Application.Query.Interfaces.IMaterialService _materialQueryService; // 物料查询服务
|
|
private readonly Kean.Infrastructure.Configuration.BarcodeInterpreter _barcodeInterpreter; // 条码解释器
|
|
|
|
/// <summary>
|
|
/// 依赖注入
|
|
/// </summary>
|
|
public AgvApplyService(
|
|
Application.Command.Interfaces.IStockService stockCommandService,
|
|
Kean.Infrastructure.Configuration.BarcodeInterpreter barcodeInterpreter,
|
|
ILogger<AgvApplyService> logger,
|
|
Application.Query.Interfaces.IMaterialService materialQueryService)
|
|
{
|
|
_stockCommandService = stockCommandService;
|
|
_materialQueryService = materialQueryService;
|
|
_logger = logger;
|
|
_barcodeInterpreter = barcodeInterpreter;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 申请入库
|
|
/// </summary>
|
|
public async Task<string> AgvApplyIn(string barcode, List<string> 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);
|
|
}
|
|
}
|
|
}
|