| | |
| | | using WIDESEA_Common.CommonEnum; |
| | | using WIDESEA_Common.OrderEnum; |
| | | using WIDESEA_Common.StockEnum; |
| | | using WIDESEA_Common.WareHouseEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.Helper; |
| | |
| | | { |
| | | return content.Error($"ä¸ä¸ªéè´åæ®éé¢ä¸å
许ç»ç两个ä»åºï¼è¯·éæ°éæ©ä»åºï¼ä¸ä¸ä¸ªç»çä»åºä¸º{isWarehouse.WarehouseCode}"); |
| | | } |
| | | |
| | | if (inboundOrder.BusinessType == "11" && inboundOrder.IsTestMaterials == 1 && (palletDto.WarehouseType != "1076" || palletDto.WarehouseType != "5057")) |
| | | { |
| | | return content.Error($"è¯¥åæ®ä¸ºè¯äº§ç©æï¼éè¦å
¥åºå°è¯äº§ä»ï¼è¯·éæ°æ ¹æ®ååºéæ©è¯äº§ä»åºè¿è¡ç»çå
¥åº"); |
| | | } |
| | | if (!_locationInfoService.QueryLocationCount(Convert.ToInt32(palletDto.locationType))) |
| | | { |
| | | return content.Error($"该åºåº{palletDto.locationType}ä¸åå¨ç©ºé²åºä½"); |
| | | } |
| | | |
| | | var nullpallet =_stockInfoRepository.QueryFirst(x => x.PalletType == -1 && x.PalletCode == palletDto.PalletCode); |
| | | if (nullpallet != null) |
| | | { |
| | | return content.Error($"该æç{palletDto.PalletCode}å·²ç»è¿è¡ç©ºæç»ç,ä¸è½å¨è¿è¡ç»ç"); |
| | | } |
| | | var outbundPallet = _stockInfoRepository.QueryFirst(x => x.StockStatus == (int)StockStatusEmun.åºåºå®æ && x.PalletCode == palletDto.PalletCode); |
| | | if (outbundPallet != null) |
| | | { |
| | | return content.Error($"该æç{palletDto.PalletCode}æªè¿è¡å空箱,ä¸è½è¿è¡ç»ç"); |
| | | } |
| | | |
| | | foreach (var item in details) |
| | |
| | | //} |
| | | } |
| | | _mesReturnRecord.UpdateData(returnRecords); |
| | | //éæ°åè°å®æçåæ®ï¼æ´æ°åºåç¶æ |
| | | foreach (var returnRecord in returnRecords) |
| | | { |
| | | if (returnRecord.ReturnStatus == 1) |
| | | { |
| | | _stockInfoRepository.Db.Updateable<Dt_StockInfoDetail>().SetColumns(it => new Dt_StockInfoDetail |
| | | { |
| | | Status = StockStatusEmun.å
¥åºå®æ.ObjToInt() |
| | | }).Where(it => it.OrderNo == returnRecord.OrderNo && returnRecord.RequestData.Contains(it.Barcode)).ExecuteCommand(); |
| | | } |
| | | } |
| | | |
| | | var inboundOrderDetail = _inboundOrderRepository.Db.Queryable<Dt_InboundOrderDetail>() |
| | | .Where(x => x.OrderId == inboundOrder.Id && x.OrderDetailStatus==(int)OrderDetailStatusEnum.Over && x.ReturnToMESStatus == 0) |
| | | .Where(x => x.OrderId == inboundOrder.Id && x.OrderDetailStatus == (int)OrderDetailStatusEnum.Over && x.ReturnToMESStatus == 0) |
| | | .ToList(); |
| | | |
| | | var stocks = _stockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.StockStatus == (int)StockStatusEmun.å
¥åºå®æ) |
| | | .Where(it => SqlFunc.Subqueryable<Dt_StockInfoDetail>().Where(s => s.StockId == it.Id && s.OrderNo == inboundOrder.InboundOrderNo).Any()) |
| | | .Where(it => SqlFunc.Subqueryable<Dt_StockInfoDetail>().Where(s => s.StockId == it.Id && s.OrderNo == inboundOrder.InboundOrderNo && s.Status == StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt()).Any()) |
| | | .ToList(); |
| | | |
| | | var stockIds = stocks.Select(s => s.Id).ToList(); |
| | |
| | | inbound => inbound.Barcode, |
| | | stockdetail => stockdetail.Barcode, |
| | | (inbound, stockdetail) => inbound.Id) |
| | | .ToList(); |
| | | |
| | | var inbounddetailBarcode = inboundOrderDetail |
| | | .Join(allDetailsData, |
| | | inbound => inbound.Barcode, |
| | | stockdetail => stockdetail.Barcode, |
| | | (inbound, stockdetail) => stockdetail.Barcode) |
| | | .ToList(); |
| | | |
| | | var detail = allDetailsData.Where(x => matchedData.Contains(x.Barcode)).ToList(); |
| | |
| | | { |
| | | _inboundOrderRepository.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 1 }) |
| | | .Where(it => it.OrderId == inboundOrder.Id && inbounddetailID.Contains(it.Id)).ExecuteCommand(); |
| | | |
| | | _stockInfoRepository.Db.Updateable<Dt_StockInfoDetail>().SetColumns(it => new Dt_StockInfoDetail |
| | | { |
| | | Status = StockStatusEmun.å
¥åºå®æ.ObjToInt() |
| | | }).Where(it => it.OrderNo == inboundOrder.InboundOrderNo && inbounddetailBarcode.Contains(it.Barcode)).ExecuteCommand(); |
| | | } |
| | | else |
| | | { |
| | |
| | | details = FeedbackInboundDetailsModelDto(detail) |
| | | }; |
| | | |
| | | if (feedmodel.details.Count<=0) |
| | | if (feedmodel.details.Count <= 0) |
| | | { |
| | | if (returnRecords.Count() == returnRecords.Count(x => x.ReturnStatus == 1)) |
| | | { |
| | |
| | | { |
| | | _inboundOrderRepository.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 1 }) |
| | | .Where(it => inbounddetailID.Contains(it.Id)).ExecuteCommand(); |
| | | |
| | | _stockInfoRepository.Db.Updateable<Dt_StockInfoDetail>().SetColumns(it => new Dt_StockInfoDetail |
| | | { |
| | | Status = StockStatusEmun.å
¥åºå®æ.ObjToInt() |
| | | }).Where(it => it.OrderNo == inboundOrder.InboundOrderNo && inbounddetailBarcode.Contains(it.Barcode)).ExecuteCommand(); |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | public List<AllocateDtoDetail> GetAllocateDtoDetails(List<Dt_StockInfoDetail> stockInfoDetails) |
| | | { |
| | | var groupedData = stockInfoDetails.GroupBy(item => new { item.MaterielCode, item.InboundOrderRowNo, item.BarcodeUnit, item.WarehouseCode }) |