调整获取时间
This commit is contained in:
@@ -53,7 +53,8 @@ namespace WMS.Web.Domain.IService.Public
|
||||
/// 同步金蝶数据 不传源订单号则更新所有
|
||||
/// </summary>
|
||||
/// <param name="billNos"></param>
|
||||
/// <param name="begin"></param>
|
||||
/// <returns></returns>
|
||||
Task<Result> Sync(List<string> billNos = null);
|
||||
Task<Result> Sync(List<string> billNos = null,DateTime? begin=null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,8 +47,10 @@ namespace WMS.Web.Domain.QuartzJob
|
||||
//2.记录:开始时间
|
||||
var begindatetime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||
_logger.LogInformation($"出库单-同步金蝶出库单数据:执行开始时间->{begindatetime}");
|
||||
|
||||
DateTime begin = DateTime.Now.AddDays(-1);//默认拉去一天以内的数据
|
||||
//3.同步数据
|
||||
var result = await _outStockTaskService.Sync(null);
|
||||
var result = await _outStockTaskService.Sync(null, begin);
|
||||
//5.记录:结束时间
|
||||
var enddatetime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||
_logger.LogInformation($"出库单-同步金蝶出库单数据:执行结束时间->{begindatetime}");
|
||||
|
||||
@@ -285,7 +285,7 @@ namespace WMS.Web.Domain.Services
|
||||
/// </summary>
|
||||
/// <param name="sourceBillNos"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<Result> Sync(List<string> billNos = null)
|
||||
public async Task<Result> Sync(List<string> billNos = null, DateTime? begin = null)
|
||||
{
|
||||
//1.事务
|
||||
IDbContextTransaction _transaction = _transactionRepositories.GetTransaction();
|
||||
@@ -296,8 +296,7 @@ namespace WMS.Web.Domain.Services
|
||||
if (billNos == null)
|
||||
{
|
||||
//DateTime begin = await _erpOpsSyncDateRepositories.Get(ErpOpsSyncType.OutStock);
|
||||
DateTime begin = Convert.ToDateTime("2024-03-01 00:00:00");//正式环境 从3月1好开始
|
||||
if (DateTime.Now > Convert.ToDateTime("2024-03-04 00:00:00"))
|
||||
if (begin == null)
|
||||
begin = DateTime.Now.AddDays(-3);//默认拉去三天以内的数据
|
||||
//更新时间范围内所有
|
||||
result = await BillQueryForSalOutStock(false, null, begin);
|
||||
|
||||
Reference in New Issue
Block a user