| | |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Newtonsoft.Json; |
| | | using SqlSugar; |
| | | using SqlSugar.Extensions; |
| | | using System.Net; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_BasicService; |
| | |
| | | private readonly ILocationInfoService _locationInfoService; |
| | | private readonly IDailySequenceService _dailySequenceService; |
| | | private readonly IMaterialUnitService _materialUnitService; |
| | | private readonly IRepository<Dt_MaterielInfo> _materialInfoRepository; |
| | | private readonly IOutStockLockInfoService _outStockLockInfoService; |
| | | private readonly IOutboundOrderDetailService _outboundOrderDetailService; |
| | | private readonly IRepository<Dt_Task> _taskRepository; |
| | | private readonly ITask_HtyService _task_HtyService; |
| | | private readonly ILogger<InboundOrderController> _logger; |
| | | public InboundOrderController(IInboundOrderService service, WIDESEA_IBasicService.IErpApiService erpApiService, WIDESEA_IBasicService.IInvokeMESService invokeMESService, IESSApiService eSSApiService, IDailySequenceService dailySequenceService, ILocationInfoService locationInfoService, ILogger<InboundOrderController> logger, IMaterialUnitService materialUnitService, IInboundService inboundService, IOutStockLockInfoService outStockLockInfoService, IOutboundOrderDetailService outboundOrderDetailService, IRepository<Dt_Task> taskRepository, ITask_HtyService task_HtyService) : base(service) |
| | | public InboundOrderController(IInboundOrderService service, WIDESEA_IBasicService.IErpApiService erpApiService, WIDESEA_IBasicService.IInvokeMESService invokeMESService, IESSApiService eSSApiService, IDailySequenceService dailySequenceService, ILocationInfoService locationInfoService, ILogger<InboundOrderController> logger, IMaterialUnitService materialUnitService, IInboundService inboundService, IOutStockLockInfoService outStockLockInfoService, IOutboundOrderDetailService outboundOrderDetailService, IRepository<Dt_Task> taskRepository, ITask_HtyService task_HtyService, IRepository<Dt_MaterielInfo> materialInfoRepository) : base(service) |
| | | { |
| | | this.erpApiService = erpApiService; |
| | | _invokeMESService = invokeMESService; |
| | |
| | | _outboundOrderDetailService = outboundOrderDetailService; |
| | | _taskRepository = taskRepository; |
| | | _task_HtyService = task_HtyService; |
| | | _materialInfoRepository = materialInfoRepository; |
| | | } |
| | | |
| | | [HttpPost, Route("Test"), AllowAnonymous, MethodParamsValidate] |
| | |
| | | Dt_InboundOrder dt_InboundOrder = new Dt_InboundOrder() { Details = new List<Dt_InboundOrderDetail>() }; |
| | | foreach (var detailitem in item.details) |
| | | { |
| | | |
| | | var materialName = _materialInfoRepository.QueryFirst(x => x.MaterielCode == detailitem.materialCode).MaterielName; |
| | | if (detailitem.barcodes != null && detailitem.barcodes.Any()) |
| | | { |
| | | foreach (var barcode in detailitem.barcodes) |
| | |
| | | { |
| | | lineNo = detailitem.lineNo, |
| | | MaterielCode = detailitem.materialCode, |
| | | MaterielName = materialName, |
| | | SupplyCode = detailitem.supplyCode, |
| | | BatchNo = detailitem.batchNo, |
| | | Unit = detailitem.unit, |
| | |
| | | OutBoxbarcodes = barcode.outBoxbarcodes, |
| | | BarcodeUnit = barcode.unit, |
| | | BarcodeQty = barcode.qty, |
| | | OrderQuantity = barcode.qty |
| | | OrderQuantity = barcode.qty, |
| | | Remark = detailitem.remark??"", |
| | | |
| | | }; |
| | | |
| | | dt_InboundOrder.Details.Add(inboundOrderDetail); |
| | |
| | | OrderQuantity = detailitem.qty, |
| | | BarcodeUnit = detailitem.unit, |
| | | BarcodeQty = detailitem.qty, |
| | | MaterielName = materialName, |
| | | Remark = detailitem.remark??"" |
| | | }; |
| | | dt_InboundOrder.Details.Add(inboundOrderDetail); |
| | | } |
| | |
| | | dt_InboundOrder.BusinessType = item.business_type; |
| | | dt_InboundOrder.IsBatch = item.isBatch; |
| | | dt_InboundOrder.FactoryArea = item.factoryArea; |
| | | |
| | | dt_InboundOrder.CreateType = OrderCreateTypeEnum.UpperSystemPush.ObjToInt(); |
| | | dt_InboundOrder.IsTestMaterials = item.isTestMaterials; |
| | | inboundOrders.Add(dt_InboundOrder); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | [HttpPost, Route("UndoPalletGroup"), AllowAnonymous, MethodParamsValidate] |
| | | public WebResponseContent UndoPalletGroup(string palletCode,string barcode="") |
| | | public WebResponseContent UndoPalletGroup(string code) |
| | | { |
| | | return Service.UndoPalletGroup(palletCode,barcode); |
| | | return Service.UndoPalletGroup(code); |
| | | } |
| | | /// <summary> |
| | | /// |
| | |
| | | return await _invokeMESService.BatchOrderFeedbackToMes(request.orderNos, request.inout); |
| | | } |
| | | |
| | | |
| | | [HttpPost, Route("HandCloseOrder"), AllowAnonymous, MethodParamsValidate] |
| | | public WebResponseContent HandCloseOrder(List<string> orderIds) |
| | | { |
| | | return Service.HandCloseOrder(orderIds); |
| | | } |
| | | |
| | | [HttpPost, Route("GetLocationType"), AllowAnonymous, MethodParamsValidate] |
| | | public WebResponseContent GetLocationType(string code) |
| | | { |
| | | return Service.GetLocationType(code); |
| | | } |
| | | } |
| | | } |