| | |
| | | /// </summary> |
| | | /// <param name="billNo">补料单号</param> |
| | | /// <returns>补料单明细列表</returns> |
| | | public List<MesItemBlDetail> GetMesItemBlDetailByBillNo( |
| | | WarehouseQuery query) |
| | | public (string bl001, List<MesItemBlDetail> item) |
| | | GetMesItemBlDetailByBillNo( |
| | | WarehouseQuery query) |
| | | { |
| | | if (string.IsNullOrEmpty(query.billNo)) |
| | | throw new Exception("请选单据号!"); |
| | |
| | | }) |
| | | .ToList(); |
| | | |
| | | return blDetails; |
| | | return (mesItemBl.Bl001, blDetails); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// - userName: 用户名 |
| | | /// - blNo: 补料单号(必填) |
| | | /// </remarks> |
| | | public (bool success, List<PendingMaterialDto> pendingList) SctlScanBarcode( |
| | | WarehouseQuery query) |
| | | public (WarehouseQuery item, List<MesItemBlDetail> pendingList) |
| | | SctlScanBarcode( |
| | | WarehouseQuery query) |
| | | { |
| | | #region 参数校验 |
| | | |
| | | if (string.IsNullOrEmpty(query.billNo)) |
| | | throw new Exception("请选取单据号!"); |
| | | |
| | |
| | | if (string.IsNullOrEmpty(query.blNo)) |
| | | throw new Exception("补料单号不能为空!"); |
| | | |
| | | #endregion |
| | | |
| | | // 检验是否重复扫描 |
| | | var exists = Db.Queryable<MesInvItemOutCDetails>() |
| | |
| | | new JoinQueryInfos(JoinType.Left, a.Id == b.Mid)) |
| | | .Where((a, b) => a.BlNo == query.blNo |
| | | && (b.Bld007 ?? 0) - (b.Bld008 ?? 0) > 0) |
| | | .Select((a, b) => new PendingMaterialDto |
| | | .Select((a, b) => new MesItemBlDetail |
| | | { |
| | | SectionCode = b.Bld012.ToString(), |
| | | ItemNo = b.Bld002, |
| | | ItemName = b.Bld003, |
| | | ItemSpec = b.Bld004, |
| | | PendingQty = (b.Bld007 ?? 0) - (b.Bld008 ?? 0) |
| | | Bld012 = b.Bld012, |
| | | Bld002 = b.Bld002, |
| | | Bld003 = b.Bld003, |
| | | Bld004 = b.Bld004, |
| | | Bld007 = b.Bld007, |
| | | Bld008 = b.Bld008 |
| | | }) |
| | | .ToList(); |
| | | |
| | | return (false, pendingList); |
| | | |
| | | query.Num = stockBarcode.Quantity; |
| | | query.Fum = quantity; |
| | | |
| | | return (query, pendingList); |
| | | } |
| | | |
| | | // 开启事务处理 |
| | |
| | | .Count(); |
| | | |
| | | if (itemCount > 0) |
| | | { |
| | | // 更新已存在的物料明细数量 |
| | | db.Updateable<MesInvItemOutItems>() |
| | | .SetColumns(i => |
| | |
| | | .Where(i => |
| | | i.ItemOutId == outId && i.ItemId == stockBarcode.ItemId) |
| | | .ExecuteCommand(); |
| | | } |
| | | else |
| | | { |
| | | // 插入新的物料明细记录 |
| | | db.Insertable(new MesInvItemOutItems |
| | | { |
| | |
| | | // Unit = blDetail.Bld009, |
| | | // DepotId = (int)stockBarcode.DepotsId |
| | | }).IgnoreColumns(true).ExecuteCommand(); |
| | | |
| | | } |
| | | |
| | | // 插入出库单条码明细 |
| | | db.Insertable(new MesInvItemOutCDetails |
| | | { |
| | |
| | | new JoinQueryInfos(JoinType.Left, a.Id == b.Mid)) |
| | | .Where((a, b) => a.BlNo == query.blNo |
| | | && (b.Bld007 ?? 0) - (b.Bld008 ?? 0) > 0) |
| | | .Select((a, b) => new PendingMaterialDto |
| | | .Select((a, b) => new MesItemBlDetail |
| | | { |
| | | SectionCode = b.Bld012.ToString(), |
| | | ItemNo = b.Bld002, |
| | | ItemName = b.Bld003, |
| | | ItemSpec = b.Bld004, |
| | | PendingQty = (b.Bld007 ?? 0) - (b.Bld008 ?? 0) |
| | | Bld012 = b.Bld012, |
| | | Bld002 = b.Bld002, |
| | | Bld003 = b.Bld003, |
| | | Bld004 = b.Bld004, |
| | | Bld007 = b.Bld007, |
| | | Bld008 = b.Bld008 |
| | | }) |
| | | .ToList(); |
| | | |
| | | return (true, finalPendingList); |
| | | return (query, finalPendingList); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// - Num: 发料数量(必填,必须大于0) |
| | | /// - blNo: 补料单号(必填) |
| | | /// </remarks> |
| | | public (bool success, List<PendingMaterialDto> pendingList) SplitBarcode( |
| | | public (bool success, List<MesItemBlDetail> pendingList) SplitBarcode( |
| | | WarehouseQuery query) |
| | | { |
| | | #region 参数校验 |
| | | |
| | | if (string.IsNullOrEmpty(query.userName)) |
| | | throw new Exception("用户名不能为空!"); |
| | | |
| | |
| | | if (string.IsNullOrEmpty(query.blNo)) |
| | | throw new Exception("补料单号不能为空!"); |
| | | |
| | | #endregion |
| | | |
| | | // 检验是否重复扫描 |
| | | var exists = Db.Queryable<MesInvItemOutCDetails>() |
| | |
| | | new JoinQueryInfos(JoinType.Left, a.Id == b.Mid)) |
| | | .Where((a, b) => a.BlNo == query.blNo |
| | | && (b.Bld007 ?? 0) - (b.Bld008 ?? 0) > 0) |
| | | .Select((a, b) => new PendingMaterialDto |
| | | .Select((a, b) => new MesItemBlDetail |
| | | { |
| | | SectionCode = b.Bld012.ToString(), |
| | | ItemNo = b.Bld002, |
| | | ItemName = b.Bld003, |
| | | ItemSpec = b.Bld004, |
| | | PendingQty = (b.Bld007 ?? 0) - (b.Bld008 ?? 0) |
| | | Bld012 = b.Bld012, |
| | | Bld002 = b.Bld002, |
| | | Bld003 = b.Bld003, |
| | | Bld004 = b.Bld004, |
| | | Bld007 = b.Bld007, |
| | | Bld008 = b.Bld008 |
| | | }) |
| | | .ToList(); |
| | | |
| | |
| | | /// </summary> |
| | | /// <param name="query">查询参数</param> |
| | | /// <returns>生产超领单明细列表</returns> |
| | | public List<MesItemBlDetail> GetMesItemBlDetailBySccBillNo( |
| | | public (string bl001,List<MesItemBlDetail> item) GetMesItemBlDetailBySccBillNo( |
| | | WarehouseQuery query) |
| | | { |
| | | if (string.IsNullOrEmpty(query.billNo)) |
| | |
| | | }) |
| | | .ToList(); |
| | | |
| | | return pendingDetails; |
| | | return (mesItemBl.Bl001,pendingDetails); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// - userName: 用户名(必填) |
| | | /// - blNo: 超领单号(必填) |
| | | /// </remarks> |
| | | public (bool success, List<PendingMaterialDto> pendingList) |
| | | public (WarehouseQuery item, List<MesItemBlDetail> pendingList) |
| | | ScanBarcodeForOverPicking( |
| | | WarehouseQuery query) |
| | | { |
| | |
| | | new JoinQueryInfos(JoinType.Left, a.Id == b.Mid)) |
| | | .Where((a, b) => a.BlNo == query.blNo |
| | | && (b.Bld007 ?? 0) - (b.Bld008 ?? 0) > 0) |
| | | .Select((a, b) => new PendingMaterialDto |
| | | .Select((a, b) => new MesItemBlDetail |
| | | { |
| | | SectionCode = b.Bld012.ToString(), |
| | | ItemNo = b.Bld002, |
| | | ItemName = b.Bld003, |
| | | ItemSpec = b.Bld004, |
| | | PendingQty = (b.Bld007 ?? 0) - (b.Bld008 ?? 0) |
| | | Bld012 = b.Bld012, |
| | | Bld002 = b.Bld002, |
| | | Bld003 = b.Bld003, |
| | | Bld004 = b.Bld004, |
| | | Bld007 = b.Bld007, |
| | | Bld008 = b.Bld008 |
| | | }) |
| | | .ToList(); |
| | | |
| | | return (false, pendingList); |
| | | query.Num = stockBarcode.Quantity; |
| | | query.Fum = quantity; |
| | | |
| | | return (query, pendingList); |
| | | } |
| | | |
| | | // 执行数据库事务 |
| | |
| | | new JoinQueryInfos(JoinType.Left, a.Id == b.Mid)) |
| | | .Where((a, b) => a.BlNo == query.blNo |
| | | && (b.Bld007 ?? 0) - (b.Bld008 ?? 0) > 0) |
| | | .Select((a, b) => new PendingMaterialDto |
| | | .Select((a, b) => new MesItemBlDetail |
| | | { |
| | | SectionCode = b.Bld012.ToString(), |
| | | ItemNo = b.Bld002, |
| | | ItemName = b.Bld003, |
| | | ItemSpec = b.Bld004, |
| | | PendingQty = (b.Bld007 ?? 0) - (b.Bld008 ?? 0) |
| | | Bld012 = b.Bld012, |
| | | Bld002 = b.Bld002, |
| | | Bld003 = b.Bld003, |
| | | Bld004 = b.Bld004, |
| | | Bld007 = b.Bld007, |
| | | Bld008 = b.Bld008 |
| | | }) |
| | | .ToList(); |
| | | |
| | | return (true, finalPendingList); |
| | | return (query, finalPendingList); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | /// <param name="query">查询参数</param> |
| | | /// <returns>处理结果</returns> |
| | | public (bool success, List<PendingMaterialDto> pendingList) |
| | | public (bool success, List<MesItemBlDetail> pendingList) |
| | | PrintBarcodeForOverPicking(WarehouseQuery query) |
| | | { |
| | | UseTransaction(db => |
| | |
| | | new JoinQueryInfos(JoinType.Left, a.Id == b.Mid)) |
| | | .Where((a, b) => a.BlNo == query.blNo |
| | | && (b.Bld007 ?? 0) - (b.Bld008 ?? 0) > 0) |
| | | .Select((a, b) => new PendingMaterialDto |
| | | .Select((a, b) => new MesItemBlDetail |
| | | { |
| | | SectionCode = b.Bld012.ToString(), |
| | | ItemNo = b.Bld002, |
| | | ItemName = b.Bld003, |
| | | ItemSpec = b.Bld004, |
| | | PendingQty = (b.Bld007 ?? 0) - (b.Bld008 ?? 0) |
| | | Bld012 = b.Bld012, |
| | | Bld002 = b.Bld002, |
| | | Bld003 = b.Bld003, |
| | | Bld004 = b.Bld004, |
| | | Bld007 = b.Bld007, |
| | | Bld008 = b.Bld008 |
| | | }) |
| | | .ToList(); |
| | | |