修改了拉取时间

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

@@ -1,7 +1,7 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16 # Visual Studio Version 17
VisualStudioVersion = 16.0.31729.503 VisualStudioVersion = 17.10.34916.146
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WMS.Web.Api", "src\WMS.Web.Api\WMS.Web.Api.csproj", "{6BC3A5E0-0590-4F16-B7A0-DAAC5591001C}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WMS.Web.Api", "src\WMS.Web.Api\WMS.Web.Api.csproj", "{6BC3A5E0-0590-4F16-B7A0-DAAC5591001C}"
EndProject EndProject

View File

@@ -135,7 +135,8 @@ namespace WMS.Web.Api.Controllers
sbns.Add(sourceBillNo); sbns.Add(sourceBillNo);
//2.同步金蝶 //2.同步金蝶
return await _inStockTaskService.Sysn(sbns); return await _inStockTaskService.Sysn(sbns);
// return await _inStockTaskService.Sysn(null);//alter by yzh
} }
/// <summary> /// <summary>

View File

@@ -296,7 +296,7 @@ namespace WMS.Web.Api.Controllers
if (loginInfo == null || loginInfo.UserInfo == null) if (loginInfo == null || loginInfo.UserInfo == null)
return Result.ReFailure(ResultCodes.Token_Invalid_Error); return Result.ReFailure(ResultCodes.Token_Invalid_Error);
DateTime begin = DateTime.Now.AddDays(-3);//默认拉去三天以内的数据 DateTime begin = DateTime.Now.AddDays(-9);//默认拉去三天以内的数据刷新改成过去8天的数据本身为3天Alter by yzh
var res = await _repositories.GetEntityList(dto.Ids); var res = await _repositories.GetEntityList(dto.Ids);
//先刷新选中的数据 //先刷新选中的数据
await _outStockTaskService.Sync(res.Select(s => s.BillNo).ToList()); await _outStockTaskService.Sync(res.Select(s => s.BillNo).ToList());

View File

@@ -5340,6 +5340,16 @@
箱重 箱重
</summary> </summary>
</member> </member>
<member name="P:WMS.Web.Core.Dto.OutStockTask.ExportInfoResponse.Qty">
<summary>
箱内数量
</summary>
</member>
<member name="P:WMS.Web.Core.Dto.OutStockTask.ExportInfoResponse.AccruedQty">
<summary>
应出库数量
</summary>
</member>
<member name="T:WMS.Web.Core.Dto.OutStockTask.GetOutStockTaskByNoResponse"> <member name="T:WMS.Web.Core.Dto.OutStockTask.GetOutStockTaskByNoResponse">
<summary> <summary>
根据单号搜索出库单任务信息 根据单号搜索出库单任务信息

View File

@@ -10,6 +10,7 @@ using WMS.Web.Domain.Infrastructure;
using WMS.Web.Domain.IService; using WMS.Web.Domain.IService;
using WMS.Web.Domain.IService.Public; using WMS.Web.Domain.IService.Public;
using WMS.Web.Domain.Options; using WMS.Web.Domain.Options;
using WMS.Web.Domain.Services;
namespace WMS.Web.Domain.QuartzJob namespace WMS.Web.Domain.QuartzJob
{ {
@@ -50,6 +51,7 @@ namespace WMS.Web.Domain.QuartzJob
try try
{ {
_logger.LogInformation("执行金蝶删单监测"); _logger.LogInformation("执行金蝶删单监测");
var data = DateTime.Now; var data = DateTime.Now;
if (data.Hour == 8 || data.Hour == 12 || data.Hour == 16 || data.Hour == 20) if (data.Hour == 8 || data.Hour == 12 || data.Hour == 16 || data.Hour == 20)
{ {

View File

@@ -48,7 +48,7 @@ namespace WMS.Web.Domain.QuartzJob
var begindatetime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); var begindatetime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
_logger.LogInformation($"出库单-同步金蝶出库单数据:执行开始时间->{begindatetime}"); _logger.LogInformation($"出库单-同步金蝶出库单数据:执行开始时间->{begindatetime}");
DateTime begin = DateTime.Now.AddHours(-8);//默认拉去8个小时以内的 DateTime begin = DateTime.Now.AddHours(-160);//默认拉去8个小时以内的aLTER BY YZH
//3.同步数据 //3.同步数据
var result = await _outStockTaskService.Sync(null, begin); var result = await _outStockTaskService.Sync(null, begin);
//5.记录:结束时间 //5.记录:结束时间

View File

@@ -21,6 +21,7 @@ using WMS.Web.Domain.IService;
using WMS.Web.Domain.IService.Public; using WMS.Web.Domain.IService.Public;
using WMS.Web.Domain.Services.Public; using WMS.Web.Domain.Services.Public;
using WMS.Web.Domain.Values; using WMS.Web.Domain.Values;
using static StackExchange.Redis.Role;
namespace WMS.Web.Domain.Services namespace WMS.Web.Domain.Services
{ {
@@ -237,7 +238,8 @@ namespace WMS.Web.Domain.Services
{ {
if (billNos == null || billNos.Count == 0) if (billNos == null || billNos.Count == 0)
{ {
var beginTime = DateTime.Now.AddHours(-8); var beginTime = DateTime.Now.AddHours(-260);//默认拉去8小时以内的数据ALTER BY YZH
//1.同步数据:采购订单 //1.同步数据:采购订单
var purchase_result = await this.SsynPurchaseInStock(null, isTransaction, beginTime); var purchase_result = await this.SsynPurchaseInStock(null, isTransaction, beginTime);
if (!purchase_result.IsSuccess) if (!purchase_result.IsSuccess)

View File

@@ -432,7 +432,7 @@ namespace WMS.Web.Domain.Services
{ {
//DateTime begin = await _erpOpsSyncDateRepositories.Get(ErpOpsSyncType.OutStock); //DateTime begin = await _erpOpsSyncDateRepositories.Get(ErpOpsSyncType.OutStock);
if (begin == null) if (begin == null)
begin = DateTime.Now.AddHours(-8);//默认拉去8小时以内的数据 begin = DateTime.Now.AddHours(-220);//默认拉去8小时以内的数据ALTER BY YZH
//更新时间范围内所有 //更新时间范围内所有
result = await BillQueryForSalOutStock(false, null, begin); result = await BillQueryForSalOutStock(false, null, begin);
if (!result.IsSuccess) isRollback = true; if (!result.IsSuccess) isRollback = true;

View File

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