| | |
| | | public MovesDto ScanInBarcode(WarehouseQuery query) |
| | | { |
| | | if (string.IsNullOrEmpty(query.sectionCode)) |
| | | { |
| | | throw new Exception("请扫库位条码!"); |
| | | } |
| | | |
| | | int pBillTypeId = 300; |
| | | int pTransctionNo = 301; |
| | | var pBillTypeId = 300; |
| | | var pTransctionNo = 301; |
| | | |
| | | var depotQuery = Db.Queryable<MesDepotSections, MesDepots>((a, b) => |
| | | new JoinQueryInfos( |
| | |
| | | .First(); |
| | | |
| | | if (depotQuery == null) |
| | | { |
| | | throw new Exception($"002[库位编码 {query.sectionCode} 不存在,请确认!"); |
| | | } |
| | | |
| | | var cDepotCode = depotQuery.DepotCode; |
| | | |
| | |
| | | .Select((a, b) => new { a.Id, a.BillNo, a.InvDepotsCode }) |
| | | .First(); |
| | | |
| | | if (itemMoveQuery == null) |
| | | { |
| | | throw new Exception("条码未做调拔出库扫码,请核对!"); |
| | | } |
| | | if (itemMoveQuery == null) throw new Exception("条码未做调拔出库扫码,请核对!"); |
| | | |
| | | var cBillNo = itemMoveQuery.BillNo; |
| | | var iDepotCode = itemMoveQuery.InvDepotsCode; |
| | |
| | | .First(); |
| | | |
| | | if (depotValidationQuery == null) |
| | | { |
| | | throw new Exception($"002[库位编码 {query.sectionCode} 不存在,请确认!"); |
| | | } |
| | | |
| | | if (iDepotCode != depotValidationQuery.DepotCode) |
| | | { |
| | | throw new Exception("实际仓库与申请调入仓库不符,请核对!"); |
| | | } |
| | | |
| | | var barcodeCount = Db.Queryable<MesInvItemMovesCDetails>() |
| | | .Where(b => |
| | |
| | | b.ItemMoveId == itemMoveQuery.Id && b.MoveOk == 1) |
| | | .Count(); |
| | | |
| | | if (barcodeCount > 0) |
| | | { |
| | | throw new Exception("条码调拔已完成,请核对!"); |
| | | } |
| | | if (barcodeCount > 0) throw new Exception("条码调拔已完成,请核对!"); |
| | | |
| | | var barcodeInfo = Db.Queryable<MesInvItemBarcodes>() |
| | | .Where(t => t.ItemBarcode == query.barcode) |
| | | .First(); |
| | | |
| | | if (barcodeInfo == null) |
| | | { |
| | | throw new Exception("条码不存在,请核对!"); |
| | | } |
| | | if (barcodeInfo == null) throw new Exception("条码不存在,请核对!"); |
| | | |
| | | var isAudit = UseTransaction(db => |
| | | { |
| | |
| | | .Where(a => a.ItemMoveId == itemMoveQuery.Id && a.MoveOk == 1) |
| | | .Sum(a => SqlFunc.IsNull(a.Quantity, 0)); |
| | | |
| | | if (totalQuantity == scannedQuantity) |
| | | { |
| | | return 1; |
| | | } |
| | | if (totalQuantity == scannedQuantity) return 1; |
| | | |
| | | return 0; |
| | | }); |
| | | |
| | | MovesDto dto = new MovesDto(); |
| | | var dto = new MovesDto(); |
| | | dto.InAudit = isAudit == 1; |
| | | dto.BarcodesInfo = barcodeInfo; |
| | | return dto; |
| | |
| | | |
| | | public MovesDto GetItems(WarehouseQuery query) |
| | | { |
| | | MovesDto dto = new MovesDto(); |
| | | var dto = new MovesDto(); |
| | | |
| | | dto.BarcodeList = GetItemMovesCDetails(query); |
| | | dto.OutItems = GetItemOutItems(query); |
| | |
| | | if (sumqty > quantity) |
| | | throw new Exception( |
| | | "已扫条码数量或本次扫码数量:" + sumqty + " 大于申请数量:" + quantity + ",请核对!"); |
| | | |
| | | |
| | | UseTransaction(db => |
| | | { |
| | | SaveMesInvItemMovesCDetails(db, query, mesInvItemMoves, |