|
@@ -402,13 +402,14 @@ public class RedPackApplication : IRedPackApplication, IScopeDependency
|
|
|
var entity = dto.Adapt<SupplementRecord>();
|
|
|
var industryName = await _orderSnapshotRepository.Queryable()
|
|
|
.Where(m => m.Id == record.OrderId)
|
|
|
- .Select(m => m.IndustryName)
|
|
|
+ .Select(m => new { m.IndustryName, m.IndustryId })
|
|
|
.FirstAsync();
|
|
|
entity.OrderId = record.OrderId;
|
|
|
entity.RedPackRecordId = record.Id;
|
|
|
entity.RedPackAuditId = audit.Id;
|
|
|
entity.No = record.No;
|
|
|
- entity.IndustryName = industryName;
|
|
|
+ entity.IndustryName = industryName.IndustryName;
|
|
|
+ entity.IndustryId = industryName.IndustryId;
|
|
|
await _supplementRecordRepository.AddAsync(entity);
|
|
|
|
|
|
if (dto.IsSendSMS)
|
|
@@ -506,9 +507,17 @@ public class RedPackApplication : IRedPackApplication, IScopeDependency
|
|
|
return query;
|
|
|
}
|
|
|
|
|
|
- public Task<PagedDto<SnapshotRedPackRecordSupplementItemsOutDto>> GetRedPackRecordSupplementItemsAsync(SnapshotRedPackRecordSupplementItemsInDto dto)
|
|
|
+ public ISugarQueryable<SnapshotRedPackRecordSupplementItemsOutDto> GetRedPackRecordSupplementItemsAsync(SnapshotRedPackRecordSupplementItemsInDto dto)
|
|
|
{
|
|
|
- throw new NotImplementedException();
|
|
|
+ var query = _supplementRecordRepository.Queryable()
|
|
|
+ .LeftJoin<Order>((supp, order) => supp.OrderId == order.Id)
|
|
|
+ .WhereIF(dto.No.NotNullOrEmpty(), (supp, order) => order.No.Contains(dto.No))
|
|
|
+ .WhereIF(dto.FromPhone.NotNullOrEmpty(), (supp, order) => order.FromPhone.Contains(dto.FromPhone))
|
|
|
+ .WhereIF(dto.Title.NotNullOrEmpty(), (supp, order) => order.Title.Contains(dto.Title))
|
|
|
+ .WhereIF(dto.IndustryId.NotNullOrEmpty(), (supp, order) => supp.IndustryId == dto.IndustryId)
|
|
|
+ .WhereIF(dto.BeginCreationTime.HasValue && dto.EndCreationTime.HasValue, (supp, order) => supp.CreationTime >= dto.BeginCreationTime && supp.CreationTime <= dto.EndCreationTime)
|
|
|
+ .Select<SnapshotRedPackRecordSupplementItemsOutDto>();
|
|
|
+ return query;
|
|
|
}
|
|
|
|
|
|
|