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;//前缀