| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_IOutboundRepository |
| | | { |
| | | public interface INewOutboundOrderDetailRepository : IRepository<Dt_NewOutboundOrderDetail> |
| | | { |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_IOutboundRepository |
| | | { |
| | | public interface INewOutboundOrderRepository : IRepository<Dt_NewOutboundOrder> |
| | | { |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Reflection; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_IOutboundRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_IOutboundService |
| | | { |
| | | public interface INewOutboundOrderDetailService : IService<Dt_NewOutboundOrderDetail> |
| | | { |
| | | INewOutboundOrderDetailRepository Repository { get; } |
| | | |
| | | |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_DTO.Outbound; |
| | | using WIDESEA_IOutboundRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_IOutboundService |
| | | { |
| | | public interface INewOutboundOrderService : IService<Dt_NewOutboundOrder> |
| | | { |
| | | INewOutboundOrderRepository Repository { get; } |
| | | } |
| | | } |
| | |
| | | /// <param name="taskNum"></param> |
| | | /// <returns></returns> |
| | | Dt_OutStockLockInfo GetOutStockLockInfo(Dt_OutboundOrder outboundOrder, Dt_OutboundOrderDetail outboundOrderDetail, Dt_StockInfo outStock, decimal assignQuantity, int? taskNum = null); |
| | | Dt_OutStockLockInfo GetOutStockLockInfo(Dt_NewOutboundOrder outboundOrder, Dt_NewOutboundOrderDetail outboundOrderDetail, Dt_StockInfo outStock, decimal assignQuantity, int? taskNum = null); |
| | | } |
| | | } |
| | |
| | | public interface IOutboundService:IDependency |
| | | { |
| | | IOutboundOrderDetailService OutboundOrderDetailService { get; } |
| | | INewOutboundOrderDetailService NewOutboundOrderDetailService { get; } |
| | | |
| | | IOutboundOrderService OutboundOrderService { get; } |
| | | INewOutboundOrderService NewOutboundOrderService { get; } |
| | | |
| | | IOutStockLockInfoService OutboundStockLockInfoService { get; } |
| | | } |
| | |
| | | /// <param name="stockViews"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent TakeOutbound(List<StockViewDTO> stockViews); |
| | | WebResponseContent WMSGenerateNewOutboundTask(int[] keys); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using Magicodes.ExporterAndImporter.Core; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Attributes; |
| | | using WIDESEA_Core.DB.Models; |
| | | |
| | | namespace WIDESEA_Model.Models |
| | | { |
| | | [SugarTable(nameof(Dt_NewOutboundOrder), "åºåºå")] |
| | | public class Dt_NewOutboundOrder : BaseEntity |
| | | { |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | public int Id { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "åæ®ç¼å·", IsOnlyIgnoreUpdate = true)] |
| | | public string OrderNo { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "䏿¸¸åæ®ç¼å·", IsOnlyIgnoreUpdate = true)] |
| | | public string UpperOrderNo { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "åæ®ç±»å", IsOnlyIgnoreUpdate = true)] |
| | | public int OrderType { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "åæ®ç¶æ")] |
| | | public int OrderStatus { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "å建æ¹å¼", IsOnlyIgnoreUpdate = true)] |
| | | public int CreateType { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "夿³¨")] |
| | | public string Remark { get; set; } |
| | | /// <summary> |
| | | /// æ¨åç³»ç» |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 10, ColumnDescription = "æ¨åç³»ç»")] |
| | | public string System { get; set; } |
| | | |
| | | |
| | | [ImporterHeader(Name = "ä»åºç¼ç ")] |
| | | [ExporterHeader(DisplayName = "ä»åºç¼ç ")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "ä»åºç¼ç ")] |
| | | public string OutWareHouse { get; set; } |
| | | |
| | | [ImporterHeader(Name = "åæ®å°ç±»")] |
| | | [ExporterHeader(DisplayName = "åæ®å°ç±»")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "åæ®å°ç±»", Length = 50)] |
| | | public string TransactionCode { get; set; } |
| | | [ImporterHeader(Name = "åºå
¥åºç±»å")] |
| | | [ExporterHeader(DisplayName = "åºå
¥åºç±»å")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "åºå
¥åºç±»å",Length = 50)] |
| | | public string InoutType { get; set; } |
| | | |
| | | [Navigate(NavigateType.OneToMany, nameof(Dt_OutboundOrderDetail.OrderId), nameof(Id))] |
| | | public List<Dt_OutboundOrderDetail> Details { get; set; } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.DB.Models; |
| | | |
| | | namespace WIDESEA_Model.Models |
| | | { |
| | | [SugarTable(nameof(Dt_NewOutboundOrderDetail), "åºåºåæç»")] |
| | | public class Dt_NewOutboundOrderDetail : BaseEntity |
| | | { |
| | | /// <summary> |
| | | /// ä¸»é® |
| | | /// </summary> |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | public int Id { get; set; } |
| | | /// <summary> |
| | | /// åºåºåä¸»é® |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "åºåºå主é®")] |
| | | public int OrderId { get; set; } |
| | | /// <summary> |
| | | /// ç©æç¼å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "ç©æç¼å·")] |
| | | public string MaterielCode { get; set; } |
| | | /// <summary> |
| | | /// ç©æåç§° |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "ç©æåç§°")] |
| | | public string MaterielName { get; set; } |
| | | /// <summary> |
| | | /// æ¹æ¬¡å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "æ¹æ¬¡å·")] |
| | | public string BatchNo { get; set; } |
| | | /// <summary> |
| | | /// åæ®æ°é |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "åæ®æ°é")] |
| | | public decimal OrderQuantity { get; set; } |
| | | /// <summary> |
| | | /// é宿°é |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "é宿°é", DefaultValue = "0")] |
| | | public decimal LockQuantity { get; set; } |
| | | /// <summary> |
| | | /// å·²åºæ°é |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "å·²åºæ°é", DefaultValue = "0")] |
| | | public decimal OverOutQuantity { get; set; } |
| | | /// <summary> |
| | | /// åæ®æç»ç¶æ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "订åæç»ç¶æ")] |
| | | public int OrderDetailStatus { get; set; } |
| | | /// <summary> |
| | | /// ç©æè§æ ¼ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ç©æè§æ ¼")] |
| | | public string MaterieSpec { get; set; } |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "夿³¨")] |
| | | public string Remark { get; set; } |
| | | /// <summary> |
| | | /// æç»id |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æç»id")] |
| | | public string LinId { get; set; } |
| | | /// <summary> |
| | | /// LPNå· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "LPNå·")] |
| | | public string LPNNo { get; set; } |
| | | /// <summary> |
| | | /// ä»åº |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "ä»åº")] |
| | | public string WarehouseCode { get; set; } |
| | | /// <summary> |
| | | /// åºåº |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "åºåº")] |
| | | public string StorageAreaCode { get; set; } |
| | | /// <summary> |
| | | /// åºä½ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "åºä½")] |
| | | public string StorageLocationCode { get; set; } |
| | | /// <summary> |
| | | /// SMOMæå®åºåºè´§ä½ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "SMOMæå®åºåºè´§ä½")] |
| | | public string LocationName { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "ä¾åºåæ¹æ¬¡")] |
| | | public string SupplierBatch { get; set; } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_IOutboundRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_OutboundRepository |
| | | { |
| | | public class NewOutboundOrderDetailRepository : RepositoryBase<Dt_NewOutboundOrderDetail>, INewOutboundOrderDetailRepository |
| | | { |
| | | public NewOutboundOrderDetailRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) |
| | | { |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_IOutboundRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_OutboundRepository |
| | | { |
| | | public class NewOutboundOrderRepository : RepositoryBase<Dt_NewOutboundOrder>, INewOutboundOrderRepository |
| | | { |
| | | public NewOutboundOrderRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) |
| | | { |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Reflection; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_IOutboundRepository; |
| | | using WIDESEA_IOutboundService; |
| | | using WIDESEA_IRecordService; |
| | | using WIDESEA_IStockRepository; |
| | | using WIDESEA_IStockService; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_StockRepository; |
| | | |
| | | namespace WIDESEA_OutboundService |
| | | { |
| | | public partial class NewOutboundOrderDetailService : ServiceBase<Dt_NewOutboundOrderDetail, INewOutboundOrderDetailRepository>, INewOutboundOrderDetailService |
| | | { |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | |
| | | public INewOutboundOrderDetailRepository Repository => BaseDal; |
| | | |
| | | public NewOutboundOrderDetailService(INewOutboundOrderDetailRepository BaseDal, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) |
| | | { |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using AutoMapper; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Serialization; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common; |
| | | using WIDESEA_Common.OrderEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.CodeConfigEnum; |
| | | using WIDESEA_Core.DB; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Core.Seed; |
| | | using WIDESEA_Core.Utilities; |
| | | using WIDESEA_DTO.Inbound; |
| | | using WIDESEA_DTO.Outbound; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_IOutboundRepository; |
| | | using WIDESEA_IOutboundService; |
| | | using WIDESEA_IStockService; |
| | | //using WIDESEA_ITaskInfoRepository; |
| | | //using WIDESEA_ITaskInfoService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_OutboundService |
| | | { |
| | | public partial class NewOutboundOrderService : ServiceBase<Dt_NewOutboundOrder, INewOutboundOrderRepository>, INewOutboundOrderService |
| | | { |
| | | private readonly IMapper _mapper; |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | |
| | | public INewOutboundOrderRepository Repository => BaseDal; |
| | | |
| | | public NewOutboundOrderService(INewOutboundOrderRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | |
| | | public IOutStockLockInfoService OutboundStockLockInfoService { get; } |
| | | |
| | | public OutboundService(IOutboundOrderDetailService outboundOrderDetailService, IOutboundOrderService outboundOrderService, IOutStockLockInfoService outboundStockLockInfoService) |
| | | public INewOutboundOrderDetailService NewOutboundOrderDetailService { get; } |
| | | |
| | | public INewOutboundOrderService NewOutboundOrderService { get; } |
| | | |
| | | public OutboundService(IOutboundOrderDetailService outboundOrderDetailService, IOutboundOrderService outboundOrderService, IOutStockLockInfoService outboundStockLockInfoService, INewOutboundOrderDetailService newOutboundOrderDetailService, INewOutboundOrderService newOutboundOrderService) |
| | | { |
| | | OutboundOrderDetailService = outboundOrderDetailService; |
| | | OutboundOrderService = outboundOrderService; |
| | | OutboundStockLockInfoService = outboundStockLockInfoService; |
| | | NewOutboundOrderDetailService= newOutboundOrderDetailService; |
| | | NewOutboundOrderService = newOutboundOrderService; |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | return outStockLockInfo; |
| | | } |
| | | |
| | | public Dt_OutStockLockInfo GetOutStockLockInfo(Dt_NewOutboundOrder outboundOrder, Dt_NewOutboundOrderDetail outboundOrderDetail, Dt_StockInfo outStock, decimal assignQuantity, int? taskNum = null) |
| | | { |
| | | |
| | | Dt_OutStockLockInfo outStockLockInfo = new Dt_OutStockLockInfo() |
| | | { |
| | | PalletCode = outStock.PalletCode, |
| | | AssignQuantity = assignQuantity, |
| | | MaterielCode = outboundOrderDetail.MaterielCode, |
| | | BatchNo = outboundOrderDetail.BatchNo ?? outStock.Details.FirstOrDefault()?.BatchNo, |
| | | LocationCode = outStock.LocationCode, |
| | | MaterielName = outboundOrderDetail.MaterielName, |
| | | OrderDetailId = outboundOrderDetail.Id, |
| | | OrderNo = outboundOrder.OrderNo, |
| | | OrderType = outboundOrder.OrderType, |
| | | OriginalQuantity = outStock.Details.Where(x => x.MaterielCode == outboundOrderDetail.MaterielCode).Sum(x => x.StockQuantity), |
| | | //Status = taskNum == null ? OutLockStockStatusEnum.å·²åé
.ObjToInt() : OutLockStockStatusEnum.åºåºä¸.ObjToInt(), |
| | | StockId = outStock.Id, |
| | | TaskNum = taskNum, |
| | | OrderQuantity = outboundOrderDetail.OrderQuantity, |
| | | LinId = outboundOrderDetail.LinId, |
| | | //Unit = outboundOrderDetail.Unit, |
| | | //ProductionDate = outStock.Details.Where(x => x.MaterielCode == outboundOrderDetail.MaterielCode).FirstOrDefault()?.ProductionDate, |
| | | //EffectiveDate = outStock.Details.Where(x => x.MaterielCode == outboundOrderDetail.MaterielCode).FirstOrDefault()?.EffectiveDate |
| | | }; |
| | | |
| | | return outStockLockInfo; |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_TaskInfoService |
| | | { |
| | | public partial class TaskService |
| | | { |
| | | public WebResponseContent WMSGenerateNewOutboundTask(int[] keys) |
| | | { |
| | | try |
| | | { |
| | | List<Dt_Task> tasks = new List<Dt_Task>(); |
| | | List<Dt_LocationInfo> locationInfos = new List<Dt_LocationInfo>(); |
| | | List<Dt_OutStockLockInfo> outStockLockInfos = new List<Dt_OutStockLockInfo>(); |
| | | |
| | | List<Dt_NewOutboundOrderDetail> outboundOrderDetails = _outboundService.NewOutboundOrderDetailService.Repository.QueryData(x => keys.Contains(x.OrderId)); |
| | | if (outboundOrderDetails == null || outboundOrderDetails.Count == 0) |
| | | { |
| | | throw new Exception("æªæ¾å°åºåºåæç»ä¿¡æ¯"); |
| | | } |
| | | if (outboundOrderDetails.FirstOrDefault(x => x.OrderDetailStatus > OrderDetailStatusEnum.New.ObjToInt() && x.OrderDetailStatus != OrderDetailStatusEnum.AssignOverPartial.ObjToInt()) != null) |
| | | { |
| | | throw new Exception("æéåºåºåæç»åå¨åºåºä¸æå·²å®æ"); |
| | | } |
| | | List<Dt_NewOutboundOrder> outboundOrders = _outboundService.NewOutboundOrderService.Repository.QueryData(x => keys.Contains(x.Id)); |
| | | List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.Repository.QueryData(x => outboundOrderDetails.Select(s => s.LPNNo).Contains(x.PalletCode)); |
| | | if (outboundOrderDetails == null || outboundOrderDetails.Count == 0) |
| | | { |
| | | throw new Exception("æªæ¾å°åºåä¿¡æ¯"); |
| | | } |
| | | var Newtasks = GetTasks(stockInfos, TaskTypeEnum.OutProduct); |
| | | List<Dt_StockInfoDetail> stockInfoDetails = _stockService.StockInfoDetailService.Repository.QueryData(x => stockInfos.Select(x => x.Id).Contains(x.StockId)); |
| | | foreach (var item in outboundOrderDetails) |
| | | { |
| | | Dt_StockInfo? stockInfo = stockInfos.FirstOrDefault(x => x.PalletCode == item.LPNNo); |
| | | if (stockInfo == null) continue; |
| | | Dt_StockInfoDetail? stockInfoDetail = stockInfoDetails.FirstOrDefault(x => x.StockId == stockInfo.Id && x.BatchNo == item.BatchNo); |
| | | if (stockInfoDetail == null) continue; |
| | | stockInfoDetail.OutboundQuantity += item.OrderQuantity; |
| | | item.LockQuantity += item.OrderQuantity; |
| | | var outboundOrder = outboundOrders.FirstOrDefault(x => x.Id == item.OrderId); |
| | | Dt_OutStockLockInfo outStockLockInfo = _outboundService.OutboundStockLockInfoService.GetOutStockLockInfo(outboundOrder, item, stockInfo, item.OrderQuantity); |
| | | outStockLockInfo.Status = OutStockStatus.åºåºä¸.ObjToInt(); |
| | | item.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt(); |
| | | outboundOrder.OrderStatus = OutboundStatusEnum.åºåºä¸.ObjToInt(); |
| | | var task = Newtasks.FirstOrDefault(x => x.PalletCode == item.LPNNo); |
| | | task.OrderNo = outboundOrder.OrderNo; |
| | | tasks.Add(task); |
| | | outStockLockInfo.TaskNum = task.TaskNum; |
| | | outStockLockInfos.Add(outStockLockInfo); |
| | | } |
| | | locationInfos.AddRange(_basicService.LocationInfoService.Repository.GetLocationInfos(stockInfos.Select(x => x.LocationCode).ToList())); |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | |
| | | BaseDal.AddData(tasks); |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfos); |
| | | _stockService.StockInfoDetailService.Repository.UpdateData(stockInfoDetails); |
| | | _outboundService.NewOutboundOrderDetailService.Repository.UpdateData(outboundOrderDetails); |
| | | _outboundService.NewOutboundOrderService.Repository.UpdateData(outboundOrders); |
| | | _outboundService.OutboundStockLockInfoService.Repository.AddData(outStockLockInfos); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfos, LocationStatusEnum.Lock.ObjToInt(), StockChangeType.Outbound.ObjToInt(), "", tasks?.Select(x => x.TaskNum).ToList()); |
| | | _basicService.LocationInfoService.Repository.UpdateLocationStatus(locationInfos, LocationStatusEnum.Lock); |
| | | |
| | | _unitOfWorkManage.CommitTran(); |
| | | //å°ä»»å¡æ¨éå°WCS |
| | | return PushTasksToWCS(tasks); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | return Service.WMSGenerateOutboundTask(keys); |
| | | } |
| | | |
| | | [HttpPost, Route("WMSGenerateNewOutboundTask"), AllowAnonymous] |
| | | public WebResponseContent WMSGenerateNewOutboundTask([FromBody] int[] keys) |
| | | { |
| | | return Service.WMSGenerateNewOutboundTask(keys); |
| | | } |
| | | /// <summary> |
| | | /// WCSç³è¯·å
¥åºä»»å¡ |
| | | /// </summary> |