| | |
| | | _detailRepository.UpdateData(outboundOrderDetails); |
| | | if (pickedDetails.Any()) |
| | | { |
| | | UpdateStockStatus(pickedDetails.Select(x => x.PalletCode).ToList(), StockStatusEmun.åºåºéå®.ObjToInt()); |
| | | UpdateStockStatus(pickedDetails.Select(x => x.PalletCode).ToList(), StockStatusEmun.åºåºéå®.ObjToInt(),outboundOrder); |
| | | UpdateLocationStatus(pickedDetails.Select(x => x.LocationCode).ToList(), LocationStatusEnum.Lock.ObjToInt()); |
| | | } |
| | | //鿣å䏿£éï¼å»æéå®è®°å½ååºï¼å次ç»çæ¶æ£é¤åæ¡ç |
| | |
| | | } |
| | | } |
| | | |
| | | public bool UpdateStockStatus(List<string> palletCodes, int status) |
| | | public bool UpdateStockStatus(List<string> palletCodes, int status,Dt_OutboundOrder outOrder) |
| | | { |
| | | try |
| | | { |
| | | List<Dt_StockInfo> stockInfos = _stockInfoRepository.QueryData(x => palletCodes.Contains(x.PalletCode)); |
| | | ///æºä»è°æºä»åæ®è®°å½ |
| | | if(outOrder.OrderType == 117) |
| | | { |
| | | stockInfos.ForEach(stockInfo => stockInfo.Remark = outOrder.OrderNo); |
| | | } |
| | | stockInfos.ForEach(stockInfo => stockInfo.StockStatus = status); |
| | | _stockInfoRepository.UpdateData(stockInfos); |
| | | return true; |
| | |
| | | return content.Error($"æªæ¾å°æç{palletCode}åºåä¿¡æ¯ä¸å
许ååº"); |
| | | } |
| | | |
| | | var task = await _taskRepository.Db.Queryable<Dt_Task>() |
| | | .Where(x => x.PalletCode == palletCode) |
| | | .FirstAsync(); |
| | | |
| | | if (task != null) |
| | | { |
| | | return content.Error($"æç{palletCode}åå¨ä»»å¡ååºå¤±è´¥!"); |
| | | } |
| | | |
| | | // åé
æ°è´§ä½ |
| | | var newLocation = _locationInfoService.AssignLocation(stock.LocationType); |
| | | |
| | | if (newLocation == null) |
| | | { |
| | | return WebResponseContent.Instance.Error("没æç©ºé²åºä½å¯ååº"); |
| | | } |
| | | |
| | | if(stock.Remark !=null && stock.Remark != "") |
| | | { |
| | | Dt_OutboundOrder outboundOrder = _outboundRepository.QueryFirst(x => x.OrderNo == stock.Remark && x.OrderType == 117 && x.OrderStatus == OutOrderStatusEnum.åºåºä¸.ObjToInt()); |
| | | if (outboundOrder != null) |
| | | { |
| | | // 1. æ ¹æ®è®¢åå·æ¥è¯¢è°æ¨ç©æä¿¡æ¯ |
| | | List<Dt_AllocateMaterialInfo> allocateMaterialInfos = _allocateMaterialInfoRepository.QueryData(x => x.OrderNo == outboundOrder.OrderNo); |
| | | |
| | | // 2. 夿æ¯å¦åå¨è°æ¨ç©æï¼æ²¡æåç´æ¥è·³è¿æ ¡éª |
| | | if (allocateMaterialInfos != null && allocateMaterialInfos.Any()) |
| | | { |
| | | // 3. æåææ Barcode éå |
| | | List<string> barcodes = allocateMaterialInfos.Select(x => x.Barcode).ToList(); |
| | | |
| | | // 4. æ ¹æ® Barcode æ¹éæ¥è¯¢åºåæç» |
| | | List<Dt_StockInfoDetail> stockInfoDetails = _stockDetailRepository.QueryData(x => barcodes.Contains(x.Barcode) && x.OrderNo == outboundOrder.OrderNo); |
| | | |
| | | // 5. æ°é对æ¯ï¼ä¸ç¸ç â æªå
¨é¨ç»ç宿 |
| | | if (barcodes.Count != stockInfoDetails.Count) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æºä»è°æºä»åæ®{outboundOrder.OrderNo}å°æªå
¨é¨ç»ç宿ï¼è¯·å
è¿è¡ç»çåååºåæ®ç¸å
³æç®±"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (stock.Details.Count <= 0) |
| | | { |
| | | stock.PalletType = (int)PalletTypeEnum.Empty; |
| | |
| | | |
| | | stock.StockStatus = (int)StockStatusEmun.å
¥åºç¡®è®¤; |
| | | stock.LocationCode = ""; |
| | | } |
| | | |
| | | var task = await _taskRepository.Db.Queryable<Dt_Task>() |
| | | .Where(x => x.PalletCode == palletCode) |
| | | .FirstAsync(); |
| | | |
| | | if (task != null) |
| | | { |
| | | return content.Error($"æç{palletCode}åå¨ä»»å¡ååºå¤±è´¥!"); |
| | | } |
| | | |
| | | // åé
æ°è´§ä½ |
| | | var newLocation = _locationInfoService.AssignLocation(stock.LocationType); |
| | | |
| | | if(newLocation == null) |
| | | { |
| | | return WebResponseContent.Instance.Error("没æç©ºé²åºä½å¯ååº"); |
| | | } |
| | | |
| | | var newTask = new Dt_Task() |