| | |
| | | 锘縰sing AngleSharp.Dom; |
| | | using Mapster; |
| | | using Masuit.Tools; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Math; |
| | | using SqlSugar; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | |
| | | using WIDESEA_Cache; |
| | | using WIDESEA_Common; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.Enums; |
| | | |
| | | namespace WIDESEA_StorageBasicService; |
| | | |
| | | public class StockInfoHtyService : ServiceBase<DtStockInfo_Hty, IStockInfoHtyRepository>, IStockInfoHtyService |
| | | { |
| | | |
| | | private readonly ISimpleCacheService _simpleCacheService; |
| | | private readonly ILocationStatusChangeRecordRepository _locationStatusChangeRecordRepository; |
| | | public StockInfoHtyService(IStockInfoHtyRepository BaseDal, ISimpleCacheService simpleCacheService, ILocationStatusChangeRecordRepository locationStatusChangeRecordRepository) : base(BaseDal) |
| | | public StockInfoHtyService(IStockInfoHtyRepository BaseDal, ILocationStatusChangeRecordRepository locationStatusChangeRecordRepository) : base(BaseDal) |
| | | { |
| | | _simpleCacheService = simpleCacheService; |
| | | _locationStatusChangeRecordRepository = locationStatusChangeRecordRepository; |
| | | } |
| | | |
| | |
| | | } |
| | | catch { } |
| | | } |
| | | |
| | | Expression<Func<DtStockInfo_Hty, bool>> locationStatus = null; |
| | | Expression<Func<DtStockInfo_Hty, bool>> roadwayNo = null; |
| | | Expression<Func<DtStockInfo_Hty, bool>> materielCode = null; |
| | | foreach (var item in searchParametersList) |
| | | { |
| | | if (item.Name.Contains("locationStatus")) |
| | | if (item.Name.Contains("materielCode")) |
| | | { |
| | | locationStatus = x => x.LocationInfo.LocationStatus == Convert.ToInt32(item.Value); |
| | | } |
| | | else if (item.Name.Contains("roadwayNo")) |
| | | { |
| | | roadwayNo = x => x.LocationInfo.RoadwayNo.Contains(item.Value); |
| | | } |
| | | else if (item.Name.Contains("materielCode")) |
| | | { |
| | | materielCode = x => x.StockInfoDetails.Any(d => d.MaterielCode.Contains(item.Value)); |
| | | materielCode = x => x.StockInfoDetails.Any(d => d.MaterielCode == item.Value); |
| | | } |
| | | } |
| | | //.IncludesAllFirstLayer() |
| | | var data = BaseDal.Db.Queryable<DtStockInfo_Hty>() |
| | | .Includes(x => x.StockInfoDetails) |
| | | .Includes(x => x.LocationInfo) |
| | | .Where(x=>x.CreateDate>DateTime.Now.AddMonths(-1)) |
| | | .WhereIF(!wheres.IsNullOrEmpty(), wheres) |
| | | .WhereIF(locationStatus != null, locationStatus) |
| | | .WhereIF(roadwayNo != null, roadwayNo) |
| | | .WhereIF(materielCode != null, materielCode) |
| | | .WhereIF(materielCode != null, materielCode) |
| | | .OrderBy(orderByModels) |
| | | .ToPageList(options.Page, options.Rows, ref totalCount); |
| | | return new PageGridData<DtStockInfo_Hty>(totalCount, data); |