| | |
| | | |
| | | #region 基础功能 |
| | | |
| | | public List<ExportNoticeDto> GetExportNoticeList(string no, string type, string status, string lotNo, int? logisticsId, string isWave, string isDespatch, string waveNo, int page, int limit, out int count) |
| | | public async Task<List<ExportNoticeDto>> GetExportNoticeList(GetExportNoticeVm model, RefAsync<int> count) |
| | | { |
| | | try |
| | | { |
| | | var strList = new List<string>(); |
| | | |
| | | if (!string.IsNullOrWhiteSpace(lotNo)) |
| | | if (!string.IsNullOrWhiteSpace(model.LotNo)) |
| | | { |
| | | var detailList = Db.Queryable<BllExportNoticeDetail>().Where(m => m.IsDel == "0" && m.LotNo.Contains(lotNo.Trim())).Select(m => m.SONo).Distinct().ToList(); |
| | | var detailList = Db.Queryable<BllExportNoticeDetail>().Where(m => m.IsDel == "0" && m.LotNo.Contains(model.LotNo.Trim())).Select(m => m.SONo).Distinct().ToList(); |
| | | strList = detailList; |
| | | } |
| | | Expression<Func<BllExportNotice, bool>> item = Expressionable.Create<BllExportNotice>() |
| | | .AndIF(!string.IsNullOrWhiteSpace(no), it => it.SONo.Contains(no.Trim())) |
| | | .AndIF(!string.IsNullOrWhiteSpace(type), it => it.Type == type) |
| | | .AndIF(!string.IsNullOrWhiteSpace(status), it => it.Status == status) |
| | | .AndIF(logisticsId != null, it => it.LogisticsId == logisticsId) |
| | | .AndIF(!string.IsNullOrWhiteSpace(isWave), it => it.IsWave == isWave) |
| | | .AndIF(!string.IsNullOrWhiteSpace(isDespatch), it => it.IsDespatch == isDespatch) |
| | | .AndIF(!string.IsNullOrWhiteSpace(waveNo), it => it.WaveNo.Contains(waveNo.Trim())) |
| | | .AndIF(!string.IsNullOrWhiteSpace(lotNo), it => strList.Contains(it.SONo)) |
| | | .AndIF(!string.IsNullOrWhiteSpace(model.No), it => it.SONo.Contains(model.No.Trim())) |
| | | .AndIF(!string.IsNullOrWhiteSpace(model.Type), it => it.Type == model.Type) |
| | | .AndIF(!string.IsNullOrWhiteSpace(model.Status), it => it.Status == model.Status) |
| | | .AndIF(model.LogisticsId != null, it => it.LogisticsId == model.LogisticsId) |
| | | .AndIF(!string.IsNullOrWhiteSpace(model.IsWave), it => it.IsWave == model.IsWave) |
| | | .AndIF(!string.IsNullOrWhiteSpace(model.IsDespatch), it => it.IsDespatch == model.IsDespatch) |
| | | .AndIF(!string.IsNullOrWhiteSpace(model.WaveNo), it => it.WaveNo.Contains(model.WaveNo.Trim())) |
| | | .AndIF(!string.IsNullOrWhiteSpace(model.LotNo), it => strList.Contains(it.SONo)) |
| | | .ToExpression();//注意 这一句 不能少 |
| | | var total = 0; |
| | | var data = GetAllWhereAsync(item) |
| | | |
| | | var data = await GetAllWhereAsync(item) |
| | | .LeftJoin<SysLogisticsInfo>((a, b) => a.LogisticsId == b.Id) |
| | | .LeftJoin<SysUserInfor>((a, b, c) => a.CreateUser == c.Id) |
| | | .LeftJoin<SysUserInfor>((a, b, c, d) => a.CreateUser == d.Id) |
| | |
| | | CheckTime = a.CheckTime |
| | | }) |
| | | .OrderByDescending(a => a.CreateTime) |
| | | .ToOffsetPage(page, limit, ref total); |
| | | count = total; |
| | | .ToPageListAsync(model.Page, model.Limit, count); |
| | | |
| | | return data; |
| | | } |