修改了拉取时间

This commit is contained in:
2024-12-23 10:31:17 +08:00
parent d2ffc8b8fd
commit 4cd92745e6
10 changed files with 28 additions and 9 deletions

View File

@@ -36,6 +36,7 @@ namespace WMS.Web.Domain.Services.Public
/// </summary>
public class ErpService : IErpService
{
private readonly IOutStockTaskService _outStockTaskService;
private IMapper _mapper;
private AppOptions _appOptions;
private ErpOptions _erpOptions;
@@ -304,7 +305,7 @@ namespace WMS.Web.Domain.Services.Public
//2.时间条件:可能还有其它条件
//var beginTime = DateTime.Now.AddDays(-2).ToString("yyyy-MM-dd 00:00:00");
var beginStr = DateTime.Now.AddDays(-3).ToString("yyyy-MM-dd HH:mm:ss");
var beginStr = DateTime.Now.AddDays(-9).ToString("yyyy-MM-dd HH:mm:ss");//本是3alter by yzh
if (beginTime != null) beginStr = beginTime?.ToString("yyyy-MM-dd HH:mm:ss");
var endTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
//3.获取金蝶其他入库订单:拼接参数和条件
@@ -1021,7 +1022,7 @@ namespace WMS.Web.Domain.Services.Public
}
var endTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
_logger.LogInformation($"物料拉取-结束时间:{endTime}");
//5.物料集合进行缓存-当前缓存时间到当天晚上的0点后面定时任务执行重新放入缓存
//5.物料集合进行缓存-当前缓存时间到当天晚上的0点后面a执行重新放入缓存
_memoryCache.Set(_erpOptions.cache_materail_key, erp_materials_list, new MemoryCacheEntryOptions().SetAbsoluteExpiration(TimeSpan.FromMinutes(DateTimeUtil.GetTotalMinutesTimeSpan())));
_logger.LogInformation($"物料拉取-总条数:{erp_materials_list.Count}");
return ResultList<ErpMaterialDto>.ReSuccess(erp_materials_list);
@@ -1405,6 +1406,8 @@ namespace WMS.Web.Domain.Services.Public
{
try
{
//1.获取缓存中的供应商数据;
var suppliers = _memoryCache.Get<List<ErpSupplierDto>>(_erpOptions.cache_supplier_key);
if (suppliers == null || suppliers.Count == 0)
@@ -1471,6 +1474,7 @@ namespace WMS.Web.Domain.Services.Public
/// <returns></returns>
public async Task<ResultList<ErpCustomerDto>> BillQueryForCustomer()
{
try
{
//1.获取缓存中的供应商数据;