pan
2025-11-19 c84db706e8c8d82a96bb4b4c18c243a42b2976c1
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateService.cs
@@ -1,11 +1,13 @@
using Microsoft.Extensions.Logging;
using SqlSugar;
using SqlSugar.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common.AllocateEnum;
using WIDESEA_Common.OrderEnum;
using WIDESEA_Core;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.BaseServices;
@@ -50,14 +52,14 @@
        public IRepository<Dt_AllocateOrder> Repository => BaseDal;
        public WebResponseContent ReceiveAllocateOrder(Dt_AllocateOrder allocateOrder, int operateType)
        public async Task<WebResponseContent> ReceiveAllocateOrder(Dt_AllocateOrder allocateOrder, int operateType)
        {
            try
            {
                return operateType switch
                {
                    1 => AddAllocateOrder(allocateOrder),
                    2 => UpdateAllocateOrder(allocateOrder),
                    1 => await AddAllocateOrder(allocateOrder),
                    2 => await UpdateAllocateOrder(allocateOrder),
                    3 => DeleteAllocateOrder(allocateOrder),
                    _ => WebResponseContent.Instance.OK(),
@@ -69,7 +71,7 @@
            }
        }
        public WebResponseContent AddAllocateOrder(Dt_AllocateOrder allocateOrder)
        public async Task<WebResponseContent> AddAllocateOrder(Dt_AllocateOrder allocateOrder)
        {
            try
            {
@@ -81,15 +83,15 @@
                Db.InsertNav(allocateOrder).Include(x => x.Details).ExecuteCommand();
                if (Enum.TryParse<BusinessTypeEnum>(allocateOrder.BusinessType, out var businessType))
                {
                    if (businessType == BusinessTypeEnum.外部仓库调智仓)
                    if (businessType == BusinessTypeEnum.智仓调外部仓库)
                    {
                        var inboundOrders = ConvertToInboundOrders(allocateOrder);
                        _inboundService.InbounOrderService.ReceiveInboundOrder(inboundOrders, 1);
                        await _inboundService.InbounOrderService.ReceiveInboundOrder(inboundOrders, 1);
                    }
                    else if (businessType == BusinessTypeEnum.智仓调外部仓库)
                    else if (businessType == BusinessTypeEnum.外部仓库调智仓)
                    {
                        var outboundOrders = ConvertToOutboundOrders(allocateOrder);
                        _outboundService.OutboundOrderService.ReceiveOutboundOrder(outboundOrders, 1);
                        await _outboundService.OutboundOrderService.ReceiveOutboundOrder(outboundOrders, 1);
                    }
                    else
                    {
@@ -105,7 +107,7 @@
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        public WebResponseContent UpdateAllocateOrder(Dt_AllocateOrder model)
        public async Task<WebResponseContent> UpdateAllocateOrder(Dt_AllocateOrder model)
        {
            try
            {
@@ -238,7 +240,7 @@
                   InboundOrderNo=allocateOrder.OrderNo,
                   UpperOrderNo=allocateOrder.UpperOrderNo,
                   SupplierId=allocateOrder.SupplierId,
                   OrderType=allocateOrder.OrderType,
                   OrderType=InOrderTypeEnum.Allocat.ObjToInt(),
                   OrderStatus=allocateOrder.OrderStatus,
                   CreateType=allocateOrder.CreateType,
                   BusinessType=allocateOrder.BusinessType,
@@ -257,7 +259,7 @@
                       OrderDetailStatus=detail.OrderDetailStatus,
                       Unit=detail.Unit,
                       RowNo=0,
                       SupplyCode="",
                       SupplyCode=detail.SupplyCode,
                       WarehouseCode=detail.WarehouseCode,
                       Barcode=detail.Barcode,
                       OutBoxbarcodes="",
@@ -275,7 +277,7 @@
                WarehouseId = allocateOrder.WarehouseId,
                OrderNo = allocateOrder.OrderNo,
                UpperOrderNo = allocateOrder.UpperOrderNo,
                OrderType = allocateOrder.OrderType,
                OrderType = OutOrderTypeEnum.Allocate.ObjToInt(),
                OrderStatus = allocateOrder.OrderStatus,
                CreateType = allocateOrder.CreateType,
                BusinessType = allocateOrder.BusinessType,
@@ -296,7 +298,7 @@
                    OrderDetailStatus = detail.OrderDetailStatus,
                    Unit = detail.Unit,
                    RowNo = 0,
                    SupplyCode = "",
                    SupplyCode = detail.SupplyCode,
                    WarehouseCode = detail.WarehouseCode,
                }).ToList()