| | |
| | | { |
| | | throw new Exception("托盘码为空,请输入托盘码"); |
| | | } |
| | | var palletInfo = Db.Queryable<DataStockDetail>().First(w => w.IsDel == "0" && w.PalletNo == palletNo); |
| | | if (!string.IsNullOrEmpty(palletInfo.WareHouseNo)) |
| | | { |
| | | throw new Exception("该托盘还未出库"); |
| | | } |
| | | if (type == "1")//平库出库获取单据 |
| | | { |
| | | var allotList = Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && m.Status == "1" && m.PalletNo == palletNo).Select(m => m.SONo).Distinct().Where(m => !string.IsNullOrWhiteSpace(m)).ToList(); |
| | |
| | | { |
| | | foreach (var demo in list) |
| | | { |
| | | var com = comInfo.FirstOrDefault(m => m.IsDel == "0" && m.BoxNo3 == demo.BoxNo); |
| | | //if (!string.IsNullOrWhiteSpace(boxNo3)) |
| | | //{ |
| | | // var com = comInfo.FirstOrDefault(m => m.IsDel == "0" && m.BoxNo3 == demo.BoxNo); |
| | | //} |
| | | //else if (!string.IsNullOrWhiteSpace(boxNo)) |
| | | //{ |
| | | // if (expr) |
| | | // { |
| | | |
| | | // } |
| | | |
| | | //} |
| | | var com = comInfo.FirstOrDefault(m => m.IsDel == "0" && m.BoxNo3 != null && m.BoxNo3 == demo.BoxNo); |
| | | if (com != null) |
| | | { |
| | | demo.PickedQty = com.CompleteQty; |
| | |
| | | { |
| | | throw new Exception($"{palletNo}托盘上存在箱码信息,无法在数量拣货进行操作!"); |
| | | } |
| | | //出库单明细 |
| | | var noticeDetail = Db.Queryable<BllExportNoticeDetail>().First(a => a.Id == int.Parse(soDetailId) && a.IsDel == "0"); |
| | | if (noticeDetail == null) |
| | | |
| | | BllExportAllot allot = null; |
| | | if (!string.IsNullOrWhiteSpace(soDetailId)) |
| | | { |
| | | throw new Exception($"未查询到对应出库单明细信息,请核实!"); |
| | | //出库单明细 |
| | | var noticeDetail = Db.Queryable<BllExportNoticeDetail>().First(a => a.Id == int.Parse(soDetailId) && a.IsDel == "0"); |
| | | if (noticeDetail == null) |
| | | { |
| | | throw new Exception($"未查询到对应出库单明细信息,请核实!"); |
| | | } |
| | | //出库单总单 |
| | | var notice = Db.Queryable<BllExportNotice>().First(a => a.IsDel == "0" && a.SONo == noticeDetail.SONo); |
| | | if (notice == null) |
| | | { |
| | | throw new Exception($"未查询到对应出库单总单信息,请核实!"); |
| | | } |
| | | //分配信息 |
| | | allot = Db.Queryable<BllExportAllot>().First(a => a.IsDel == "0" && a.SONo == notice.SONo && a.SODetailNo == noticeDetail.Id && a.PalletNo == palletNo && (a.Status == "2" || a.Status == "3")); |
| | | if (allot == null) |
| | | { |
| | | throw new Exception($"未查询到对应分配信息,请核实!"); |
| | | } |
| | | } |
| | | //出库单总单 |
| | | var notice = Db.Queryable<BllExportNotice>().First(a => a.IsDel == "0" && a.SONo == noticeDetail.SONo); |
| | | if (notice == null) |
| | | { |
| | | throw new Exception($"未查询到对应出库单总单信息,请核实!"); |
| | | } |
| | | //分配信息 |
| | | var allot = Db.Queryable<BllExportAllot>().First(a => a.IsDel == "0" && a.SONo == notice.SONo && a.SODetailNo == noticeDetail.Id && a.PalletNo == palletNo && (a.Status == "2" || a.Status == "3")); |
| | | if (allot == null) |
| | | { |
| | | throw new Exception($"未查询到对应分配信息,请核实!"); |
| | | } |
| | | |
| | | //库存明细 |
| | | var detail = Db.Queryable<DataStockDetail>().First(a => a.IsDel == "0" && a.PalletNo == palletNo); |
| | | if (detail == null) |
| | |
| | | { |
| | | SkuNo = detail.SkuNo, |
| | | BoxNo = detail.SkuNo, |
| | | Qty = (int)allot.Qty, |
| | | PickedQty = (int)allot.CompleteQty, |
| | | Qty = allot == null ? (int)(detail.Qty-detail.LockQty) : (int)allot.Qty, |
| | | PickedQty = allot == null ? 0 : (int)allot.CompleteQty, |
| | | }; |
| | | |
| | | pdaInfo.Add(info); |