From 65ccc41d1b02fe7e3d89d3c1cb0a56647c5a66a9 Mon Sep 17 00:00:00 2001
From: 18942506660 <18942506660@A18942506660>
Date: Tue, 5 Mar 2024 14:52:24 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=8E=B7=E5=8F=96=E6=97=B6?=
=?UTF-8?q?=E9=97=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Controllers/OutStockTaskController.cs | 6 +++-
src/WMS.Web.Api/wwwroot/WMS.Web.Domain.xml | 34 +++++++++++++++++--
.../IService/Public/IOutStockTaskService.cs | 3 +-
.../QuartzJob/OutStockOrderQuartzJob.cs | 4 ++-
.../Services/OutStockTaskService.cs | 5 ++-
5 files changed, 44 insertions(+), 8 deletions(-)
diff --git a/src/WMS.Web.Api/Controllers/OutStockTaskController.cs b/src/WMS.Web.Api/Controllers/OutStockTaskController.cs
index ecc5af53..001176af 100644
--- a/src/WMS.Web.Api/Controllers/OutStockTaskController.cs
+++ b/src/WMS.Web.Api/Controllers/OutStockTaskController.cs
@@ -196,8 +196,12 @@ namespace WMS.Web.Api.Controllers
if (loginInfo == null || loginInfo.UserInfo == null)
return Result.ReFailure(ResultCodes.Token_Invalid_Error);
+ DateTime begin = DateTime.Now.AddDays(-3);//默认拉去三天以内的数据
var res = await _repositories.GetEntityList(dto.Ids);
- return await _outStockTaskService.Sync(res.Select(s => s.BillNo).ToList());
+ //先刷新选中的数据
+ await _outStockTaskService.Sync(res.Select(s => s.BillNo).ToList());
+ //再刷新3天内所有的
+ return await _outStockTaskService.Sync(null, begin);
}
}
}
diff --git a/src/WMS.Web.Api/wwwroot/WMS.Web.Domain.xml b/src/WMS.Web.Api/wwwroot/WMS.Web.Domain.xml
index 24252f9f..98760bb7 100644
--- a/src/WMS.Web.Api/wwwroot/WMS.Web.Domain.xml
+++ b/src/WMS.Web.Api/wwwroot/WMS.Web.Domain.xml
@@ -3445,6 +3445,12 @@
+
+
+ erp:单据查询-销售出库单
+
+
+
erp:查询销售出库单信息
@@ -3602,11 +3608,18 @@
-
+
+
+ 采购发货通知单
+
+
+
+
同步金蝶数据 不传源订单号则更新所有
+
@@ -4693,7 +4706,16 @@
-
+
+
+ 销售出库单
+
+
+
+
+
+
+
同步金蝶数据 不传源订单号则更新所有
@@ -5037,6 +5059,14 @@
+
+
+ 销售出库单
+
+
+
+
+
Get方法
diff --git a/src/WMS.Web.Domain/IService/Public/IOutStockTaskService.cs b/src/WMS.Web.Domain/IService/Public/IOutStockTaskService.cs
index e6a8cf98..6e492436 100644
--- a/src/WMS.Web.Domain/IService/Public/IOutStockTaskService.cs
+++ b/src/WMS.Web.Domain/IService/Public/IOutStockTaskService.cs
@@ -53,7 +53,8 @@ namespace WMS.Web.Domain.IService.Public
/// 同步金蝶数据 不传源订单号则更新所有
///
///
+ ///
///
- Task Sync(List billNos = null);
+ Task Sync(List billNos = null,DateTime? begin=null);
}
}
diff --git a/src/WMS.Web.Domain/QuartzJob/OutStockOrderQuartzJob.cs b/src/WMS.Web.Domain/QuartzJob/OutStockOrderQuartzJob.cs
index 93ad5c1f..e2aa8fea 100644
--- a/src/WMS.Web.Domain/QuartzJob/OutStockOrderQuartzJob.cs
+++ b/src/WMS.Web.Domain/QuartzJob/OutStockOrderQuartzJob.cs
@@ -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}");
diff --git a/src/WMS.Web.Domain/Services/OutStockTaskService.cs b/src/WMS.Web.Domain/Services/OutStockTaskService.cs
index c579662d..692d3058 100644
--- a/src/WMS.Web.Domain/Services/OutStockTaskService.cs
+++ b/src/WMS.Web.Domain/Services/OutStockTaskService.cs
@@ -285,7 +285,7 @@ namespace WMS.Web.Domain.Services
///
///
///
- public async Task Sync(List billNos = null)
+ public async Task Sync(List 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);