Browse Source

到货信息模板显示七天数据

集成Redis
lvzb 2 years ago
parent
commit
92cd073cf9
  1. 14
      be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/PurchaseReceiptController.cs
  2. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/InspectNotes/IInspectNoteAppService.cs
  3. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Plans/SupplierAsns/ISupplierAsnAppService.cs
  4. 23
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/InspectNotes/InspectNoteAppService.cs
  5. 10
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/SupplierAsns/SupplierAsnAppService.cs

14
be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/PurchaseReceiptController.cs

@ -91,7 +91,7 @@ namespace Win_in.Sfs.Wms.Dashboard.Host.Controllers
{
var dto = new PurchaseReceiptSumQtyDashboardDto();
var items = await this.GetUnPurchaseReceiptItemDashboardAsync();
var items = await this.GetUnPurchaseReceiptItemDashboardAsync().ConfigureAwait(false);
dto = new PurchaseReceiptSumQtyDashboardDto() { Qty = items.Sum(t => t.Qty) };
@ -101,7 +101,7 @@ namespace Win_in.Sfs.Wms.Dashboard.Host.Controllers
[HttpGet("un-receipt-count-by-supplier")]
public virtual async Task<List<PurchaseReceiptCountBySupplierDashboardDto>> GetUnReceiptCountBySupplierQtyAsync()
{
var items = await GetUnPurchaseReceiptItemDashboardAsync();
var items = await GetUnPurchaseReceiptItemDashboardAsync().ConfigureAwait(false);
var dtos = items.GroupBy(t => t.SupplierShortName)
.Select(
@ -117,12 +117,12 @@ namespace Win_in.Sfs.Wms.Dashboard.Host.Controllers
[HttpGet("un-receipt-item-list")]
public virtual async Task<List<PurchaseReceiptItemDashboardDto>> GetUnReceiptItemListAsync()
{
return await this.GetUnPurchaseReceiptItemDashboardAsync();
return await this.GetUnPurchaseReceiptItemDashboardAsync().ConfigureAwait(false);
}
private async Task<List<PurchaseReceiptItemDashboardDto>> GetPurchaseReceiptItemDashboardAsync()
{
var inspectNoteDetailDto = await _inspectNoteAppService.GetInspectNoteDetailByToDayTaskAsync();
var inspectNoteDetailDto = await _inspectNoteAppService.GetInspectNoteDetailByDayTaskAsync(7).ConfigureAwait(false);//7天数据
var packingCodeList = inspectNoteDetailDto.Where(p => p.Status == EnumInventoryStatus.OK|| p.Status == EnumInventoryStatus.INSP).Select(p => p.PackingCode).ToList();
var balances = await _balanceApp.GetListByPackingCodesAsync(packingCodeList);
balances = balances.Where(p => p.LocationCode == "INSPECT").ToList();
@ -196,9 +196,9 @@ namespace Win_in.Sfs.Wms.Dashboard.Host.Controllers
return await this._supplierApp.GetByCodesAsync(codes);
}
private async Task<List<SupplierAsnDTO>> GetSupplierAsnsAsync()
private async Task<List<SupplierAsnDTO>> GetSupplierAsnsAsync(int day)
{
return await this._supplierAsnApp.GetForTodayUnReceivedListAsync();
return await this._supplierAsnApp.GeUnReceivedByDayListAsync(day);
}
private List<PurchaseReceiptItemDashboardDto> ConvertToUnPurchaseReceiptItemDashboard(
@ -245,7 +245,7 @@ namespace Win_in.Sfs.Wms.Dashboard.Host.Controllers
{
var dtos = new List<PurchaseReceiptItemDashboardDto>();
var supplierAsns = await this.GetSupplierAsnsAsync();
var supplierAsns = await this.GetSupplierAsnsAsync(7).ConfigureAwait(false);//七天数据
var supplierCodes = supplierAsns.Select(t => t.SupplierCode).Distinct();

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/InspectNotes/IInspectNoteAppService.cs

@ -23,4 +23,5 @@ public interface IInspectNoteAppService : ISfsStoreMasterReadOnlyAppServiceBase
Task<List<InspectNoteDTO>> CreateSummaryDetailAndDetailByIdAsync(Guid id, InspectNoteEditInput input);
Task<List<InspectNoteDetailDTO>> GetInspectNoteDetailByToDayTaskAsync();
Task<List<InspectNoteDetailDTO>> GetInspectNoteDetailByDayTaskAsync(int day);
}

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Plans/SupplierAsns/ISupplierAsnAppService.cs

@ -36,4 +36,5 @@ public interface ISupplierAsnAppService
Task UpdateStatusAsync(string asnNumber, EnumSupplierAsnStatus status);
Task<List<SupplierAsnDTO>> GetForTodayListAsync();
Task<List<SupplierAsnDTO>> GeUnReceivedByDayListAsync(int day);
}

23
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/InspectNotes/InspectNoteAppService.cs

@ -112,4 +112,27 @@ public class InspectNoteAppService : SfsStoreWithDetailsAppServiceBase<
return detailDtos;
}
[HttpPost("detail-list/by-day")]
public virtual async Task<List<InspectNoteDetailDTO>> GetInspectNoteDetailByDayTaskAsync(int day)
{
var endtime = DateTime.Today.AddHours(24).AddSeconds(-1);
var starttime = endtime.AddDays(-day).AddSeconds(1);
var entitys = await _repository.GetListAsync(
p => p.Details.Any(
y => y.InspectDate<= endtime
&& y.InspectDate>= starttime), true
).ConfigureAwait(false);
List<InspectNoteDetail> list = new List<InspectNoteDetail>();
foreach (var entity in entitys)
{
list.AddRange(entity.Details.Where(y => y.InspectDate <= endtime
&& y.InspectDate >= starttime));
}
var detailDtos = ObjectMapper.Map<List<InspectNoteDetail>, List<InspectNoteDetailDTO>>(list);
return detailDtos;
}
}

10
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/SupplierAsns/SupplierAsnAppService.cs

@ -395,7 +395,17 @@ public class SupplierAsnAppService :
return ObjectMapper.Map<List<SupplierAsn>, List<SupplierAsnDTO>>(entities);
}
[HttpGet("list-un-received-by-day")]
public virtual async Task<List<SupplierAsnDTO>> GeUnReceivedByDayListAsync(int day)
{
var endtime = DateTime.Today.AddHours(24).AddSeconds(-1);
var starttime = endtime.AddDays(-day).AddSeconds(1);
var entities = await _repository.GetListAsync(
p => p.PlanArriveDate>= starttime && p.PlanArriveDate <= endtime
&& (p.Status != EnumSupplierAsnStatus.Received && p.Status != EnumSupplierAsnStatus.Cancelled), true).ConfigureAwait(false);
return ObjectMapper.Map<List<SupplierAsn>, List<SupplierAsnDTO>>(entities);
}
[HttpGet("list-by-starttime-endtime")]
public virtual async Task<List<SupplierAsnDTO>> GetByStartTimeEndTimeAsync(DateTime startTime, DateTime endTime)
{

Loading…
Cancel
Save