| | |
| | | Check.Length(input.Remark, "备注", WmsMaterialStockConsts.MaxRemarkLength); |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 根据条件获取出入库单据详情列表 |
| | | /// </summary> |
| | | /// <param name="whereConditions"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | public async Task<List<WmsMaterialStock>> GetListByFilterAsync(Expression<Func<WmsMaterialStock, bool>> whereConditions, CancellationToken cancellationToken = default) |
| | | { |
| | | return await _wmsmaterialstockRepository.GetListByFilterAsync(whereConditions); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 根据条件获取单个出入库单据详情 |
| | | /// </summary> |
| | | /// <param name="whereConditions"></param> |
| | | /// <param name="isMultipleThrowException">是否查询出多条就报错</param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | public async Task<WmsMaterialStock> GetSingleByFilterAsync(Expression<Func<WmsMaterialStock, bool>> whereConditions, bool isMultipleThrowException = false, CancellationToken cancellationToken = default) |
| | | { |
| | | return await _wmsmaterialstockRepository.GetSingleByFilterAsync(whereConditions, isMultipleThrowException); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 根据条件获取出入库单据详情列表 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public virtual async Task<List<WmsMaterialStockDto>> FindListByFilterAsync(GetWmsMaterialStockInput input, CancellationToken cancellationToken = default) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | if (input.Sorting.IsNullOrWhiteSpace()) |
| | | { |
| | | input.Sorting = nameof(WmsMaterialStock.Sort); |
| | | } |
| | | |
| | | #region 动态构造查询条件 |
| | | |
| | | //动态构造查询条件 |
| | | var whereConditions = DynamicGetQueryParams(input); |
| | | |
| | | #endregion |
| | | |
| | | var list = await _wmsmaterialstockRepository.GetListByFilterAsync(whereConditions?.data); |
| | | |
| | | return new List<WmsMaterialStockDto>(ObjectMapper.Map<List<WmsMaterialStock>, List<WmsMaterialStockDto>>(list)); |
| | | } |
| | | /// <summary> |
| | | /// 根据条件获取单个出入库单据详情 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public virtual async Task<WmsMaterialStockDto> FindSingleByFilterAsync(GetWmsMaterialStockInput input, CancellationToken cancellationToken = default) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | if (input.Sorting.IsNullOrWhiteSpace()) |
| | | { |
| | | input.Sorting = nameof(WmsMaterialStock.Sort); |
| | | } |
| | | |
| | | #region 动态构造查询条件 |
| | | |
| | | //动态构造查询条件 |
| | | var whereConditions = DynamicGetQueryParams(input); |
| | | |
| | | #endregion |
| | | |
| | | var dataObj = await _wmsmaterialstockRepository.GetSingleByFilterAsync(whereConditions?.data); |
| | | |
| | | return (ObjectMapper.Map<WmsMaterialStock, WmsMaterialStockDto>(dataObj)); |
| | | } |
| | | } |