From 39db6f1d1e6337c6b5f02d16f024ab573957ec03 Mon Sep 17 00:00:00 2001 From: cjy Date: Wed, 18 Sep 2024 17:57:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=B7=E8=BF=90=E5=87=BA=E5=8F=A3=E7=BC=96?= =?UTF-8?q?=E7=A0=81=E8=A7=84=E5=88=99=E6=8C=89=E5=BC=80=E8=88=B9=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E5=8F=96=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DS.WMS.Core/Op/Method/SeaExportService.cs | 4 ++-- .../DS.WMS.Core/Sys/Interface/ICommonService.cs | 2 +- .../DS.WMS.Core/Sys/Method/CommonService.cs | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs index a055bc52..d7287653 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs @@ -227,7 +227,7 @@ public partial class SeaExportService : ISeaExportService // return await Task.FromResult(DataResult.Failed(sequence.Message, MultiLanguageConst.SequenceSetNotExist)); //} // - var sequence = await commonService.GetSequenceNextAsync(tenantDb, user,req.SaleId); + var sequence = await commonService.GetSequenceNextAsync(tenantDb, user,req.SaleId,req.ETD); if (!sequence.Succeeded) { return await Task.FromResult(DataResult.Failed(sequence.Message, MultiLanguageConst.SequenceSetNotExist)); @@ -374,7 +374,7 @@ public partial class SeaExportService : ISeaExportService #region 复制单据单号重新赋值 if (string.IsNullOrEmpty(info.CustomerNo)) { - var sequence = await commonService.GetSequenceNextAsync(tenantDb, user, req.SaleId); + var sequence = await commonService.GetSequenceNextAsync(tenantDb, user, req.SaleId, req.ETD); if (!sequence.Succeeded) { return await Task.FromResult(DataResult.Failed(sequence.Message, MultiLanguageConst.SequenceSetNotExist)); diff --git a/ds-wms-service/DS.WMS.Core/Sys/Interface/ICommonService.cs b/ds-wms-service/DS.WMS.Core/Sys/Interface/ICommonService.cs index a5b8cb39..c1de959a 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Interface/ICommonService.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Interface/ICommonService.cs @@ -209,7 +209,7 @@ public interface ICommonService /// 获取最新业务单据编码 /// /// - public Task> GetSequenceNextAsync(SqlSugarScopeProvider tenantDb, IUser user, long saleId = 0); + public Task> GetSequenceNextAsync(SqlSugarScopeProvider tenantDb, IUser user, long saleId = 0, DateTime? date = null); /// /// 获取字典明细 diff --git a/ds-wms-service/DS.WMS.Core/Sys/Method/CommonService.cs b/ds-wms-service/DS.WMS.Core/Sys/Method/CommonService.cs index a6ddbce4..c94a7721 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Method/CommonService.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Method/CommonService.cs @@ -2152,7 +2152,7 @@ public class CommonService : ICommonService /// 获取最新业务单据编码 /// /// - public async Task> GetSequenceNextAsync(SqlSugarScopeProvider tenantDb, IUser user, long saleId = 0) + public async Task> GetSequenceNextAsync(SqlSugarScopeProvider tenantDb, IUser user, long saleId = 0,DateTime? date = null) { //生成编号 string sequenceNewNo = ""; @@ -2199,19 +2199,19 @@ public class CommonService : ICommonService } break; case "shortdate": //短日期 年2位月2位日期2位 - sequenceNewNo += DateTime.Now.ToString("yyyyMMdd").Substring(2); + sequenceNewNo += date.HasValue ? date.Value.ToString("yyyyMMdd").Substring(2) : DateTime.Now.ToString("yyyyMMdd").Substring(2) ; break; case "date": //日期,年4位 - sequenceNewNo += DateTime.Now.ToString("yyyyMMdd"); + sequenceNewNo += date.HasValue ? date.Value.ToString("yyyyMMdd") : DateTime.Now.ToString("yyyyMMdd"); break; case "ydate": //年月,年4位月2位 - sequenceNewNo += DateTime.Now.ToString("yyyyMMdd").Substring(0, 6); + sequenceNewNo += date.HasValue ? date.Value.ToString("yyyyMMdd").Substring(0, 6) : DateTime.Now.ToString("yyyyMMdd").Substring(0, 6); break; case "sydate": //年月,年2位月2位 - sequenceNewNo += DateTime.Now.ToString("yyyyMMdd").Substring(2, 4); + sequenceNewNo += date.HasValue ? date.Value.ToString("yyyyMMdd").Substring(2, 4) : DateTime.Now.ToString("yyyyMMdd").Substring(2, 4); break; case "timestamp": //日期时间精确到毫秒 - sequenceNewNo += DateTime.Now.ToString("yyyyMMddHHmmssffff"); + sequenceNewNo += date.HasValue ? date.Value.ToString("yyyyMMddHHmmssffff") : DateTime.Now.ToString("yyyyMMddHHmmssffff"); break; case "number": //计数,流水号 var prefix = sequenceNewNo;//前缀