| | |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.LocationEnum; |
| | | using WIDESEA_Common.OrderEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | |
| | | using WIDESEA_IRecordService; |
| | | using WIDESEA_IStockService; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_OutboundRepository; |
| | | |
| | | namespace WIDESEA_OutboundService |
| | | { |
| | |
| | | proStockInfoDetails.AddRange(item.proStockInfoDetails); |
| | | } |
| | | _stockInfoService.ProStockInfoDetailService.Repository.UpdateData(proStockInfoDetails); |
| | | Dt_ProOutOrder proOutOrder = _proOutOrderRepository.QueryFirst(x => x.Id == proOutOrderDetails.FirstOrDefault().ProOrderId); |
| | | if (proOutOrder.ProOrderStatus == OutOrderStatusEnum.æªå¼å§.ObjToInt()) |
| | | { |
| | | proOutOrder.ProOrderStatus = OutOrderStatusEnum.åºåºä¸.ObjToInt(); |
| | | _proOutOrderRepository.UpdateData(proOutOrder); |
| | | } |
| | | BaseDal.UpdateData(proOutOrderDetails); |
| | | |
| | | List<Dt_OutProStockInfo> addOutStockLockInfos = outProStockInfos.Where(x => x.Id == 0).ToList(); |
| | |
| | | item.LockQtyPcs += needQty - residueQuantity; |
| | | outStocks.AddRange(assignOutStocks); |
| | | float assignQuantity = needQty - residueQuantity; |
| | | bool isCanLot = !string.IsNullOrEmpty(item.PLot); |
| | | bool isCanDate = !string.IsNullOrEmpty(item.DateCode); |
| | | bool isCanLot = string.IsNullOrEmpty(item.PLot); |
| | | bool isCanDate = string.IsNullOrEmpty(item.DateCode); |
| | | List<Dt_ProOutOrderDetail> details = proOutOrderDetails |
| | | .Where(x => x.SaleOrder == item.SaleOrder && x.PCode == item.PCode && x.PVer == item.PVer |
| | | && (isCanLot ? x.PLot == item.PLot : true) |
| | | && (isCanDate ? x.DateCode == item.DateCode : true)) |
| | | && (isCanLot ? isCanLot : x.PLot == item.PLot) |
| | | && (isCanDate ? isCanDate : x.DateCode == item.DateCode)) |
| | | .ToList(); |
| | | |
| | | for (int i = 0; i < details.Count; i++) |
| | |
| | | float orderQuantity = details[i].QtyPcs; |
| | | for (int j = 0; j < assignOutStocks.Count; j++) |
| | | { |
| | | //åºåºè®¢åæç»å·²åé
æ°é |
| | | float detailAssignQuantity = outProStockInfos.Where(x => x.SaleOrder == item.SaleOrder && x.PCode == item.PCode && x.PVer == item.PVer |
| | | && (item.PLot.IsNotEmptyOrNull() ? x.PLot == item.PLot : false) |
| | | && (item.DateCode.IsNotEmptyOrNull() ? x.DateCode == item.PLot : false) |
| | | && x.OrderDetailId == details[i].Id).Sum(x => x.AssignQuantity);//åºåºè®¢åæç»å·²åé
æ°é |
| | | && (isCanLot ? isCanLot : x.PLot == item.PLot) |
| | | && (isCanDate ? isCanDate : x.DateCode == item.DateCode) |
| | | && x.OrderDetailId == details[i].Id).Sum(x => x.AssignQuantity); |
| | | |
| | | float palletAssignQuantity = outProStockInfos.Where(x => x.SaleOrder == item.SaleOrder && x.PCode == item.PCode && x.PVer == item.PVer |
| | | && (item.PLot.IsNotEmptyOrNull() ? x.PLot == item.PLot : false) |
| | | && (item.DateCode.IsNotEmptyOrNull() ? x.DateCode == item.PLot : false |
| | | && x.PalletCode == assignOutStocks[j].PalletCode)).Sum(x => x.AssignQuantity); |
| | | && (isCanLot ? isCanLot : x.PLot == item.PLot) |
| | | && (isCanDate ? isCanDate : x.DateCode == item.DateCode) |
| | | && x.PalletCode == assignOutStocks[j].PalletCode).Sum(x => x.AssignQuantity); |
| | | //åºåºè¯¦æ
å·²åé
æ°é |
| | | palletAssignQuantity = outProStockInfos.Where(x => x.SaleOrder == item.SaleOrder && x.PCode == item.PCode && x.PVer == item.PVer |
| | | && (item.PLot.IsNotEmptyOrNull() ? x.PLot == item.PLot : false) |
| | | && (item.DateCode.IsNotEmptyOrNull() ? x.DateCode == item.PLot : false && x.PalletCode == assignOutStocks[j].PalletCode)).Sum(x => x.AssignQuantity);//åºåºè¯¦æ
å·²åé
æ°é |
| | | && (isCanLot ? isCanLot : x.PLot == item.PLot) |
| | | && (isCanDate ? isCanDate : x.DateCode == item.DateCode) |
| | | && x.PalletCode == assignOutStocks[j].PalletCode).Sum(x => x.AssignQuantity);//åºåºè¯¦æ
å·²åé
æ°é |
| | | float palletOutboundQuantity = assignOutStocks[j].proStockInfoDetails.Sum(x => x.OutboundQuantity); |
| | | if (palletAssignQuantity < palletOutboundQuantity)//妿åºåºè¯¦æ
å·²åé
æ°éå°äºæçå·²åé
æ°éï¼åå¯ä»¥ç»§ç»æ·»å 该æçåºåºä¿¡æ¯ |
| | | { |