| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Newtonsoft.Json; |
| | | using System.Data.Common; |
| | | using System.Diagnostics.Eventing.Reader; |
| | | using System.Threading.Tasks; |
| | |
| | | [HttpPost, Route("ReceiveAllocateOrder"), MethodParamsValidate, AllowAnonymous] |
| | | public async Task<WebResponseContent> ReceiveAllocateOrder([FromBody] AllocateDto model) |
| | | { |
| | | _logger.LogInformation("AllocateOrderController ReceiveAllocateOrder: " + JsonConvert.SerializeObject(model)); |
| | | Dt_AllocateOrder allocateOrder = new Dt_AllocateOrder |
| | | { |
| | | OrderNo = model.OrderNo, |
| | |
| | | FactoryArea = model.FactoryArea, |
| | | IsBatch = model.IsBatch, |
| | | CreateType = model.OperationType, |
| | | FromWarehouse=model.fromWarehouse, |
| | | ToWarehouse=model.toWarehouse, |
| | | FromWarehouse = model.fromWarehouse, |
| | | ToWarehouse = model.toWarehouse, |
| | | Details = new List<Dt_AllocateOrderDetail>() |
| | | }; |
| | | Enum.TryParse<BusinessTypeEnum>(allocateOrder.BusinessType, out var businessType); |
| | | |
| | | //allocateOrder.OrderType = businessType == BusinessTypeEnum.æºä»è°å¤é¨ä»åº ? 215 : 115; |
| | | if (businessType == BusinessTypeEnum.æºä»è°å¤é¨ä»åº) |
| | | { |
| | | allocateOrder.OrderType = 115; |
| | | } |
| | | else if (businessType == BusinessTypeEnum.å¤é¨ä»åºè°æºä») |
| | | { |
| | | allocateOrder.OrderType = 215; |
| | | } |
| | | |
| | | foreach (var detailDto in model.Details) |
| | | { |
| | |
| | | BatchNo = barcodeDto.BatchNo, |
| | | BarcodeQty = barcodeDto.Qty, |
| | | BarcodeUnit = barcodeDto.Unit, |
| | | ValidDate=barcodeDto.validDate, |
| | | ValidDate = barcodeDto.validDate, |
| | | |
| | | }; |
| | | allocateOrder.Details.Add(orderDetail); |