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 a41cd3d1..eda829fa 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs @@ -213,7 +213,7 @@ public partial class SeaExportService : ISeaExportService // return await Task.FromResult(DataResult.Failed(sequence.Message, MultiLanguageConst.SequenceSetNotExist)); //} // - var sequence = await commonService.GetSequenceNextAsync(tenantDb, user); + var sequence = await commonService.GetSequenceNextAsync(tenantDb, user,req.SaleId); if (!sequence.Succeeded) { return await Task.FromResult(DataResult.Failed(sequence.Message, MultiLanguageConst.SequenceSetNotExist)); @@ -690,7 +690,7 @@ public partial class SeaExportService : ISeaExportService } //获取表单复制模板 var template = tenantDb.Queryable().Where(x => x.PermissionId == 1772509201441099776).First(); - var sequence = commonService.GetSequenceNextAsync(tenantDb, user).GetAwaiter().GetResult(); + var sequence = commonService.GetSequenceNextAsync(tenantDb, user, info.SaleId).GetAwaiter().GetResult(); if (!sequence.Succeeded) { return 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 67230a84..c804d82c 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); + public Task> GetSequenceNextAsync(SqlSugarScopeProvider tenantDb, IUser user, long saleId = 0); /// /// 获取字典明细 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 cb2549cc..4448196e 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Method/CommonService.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Method/CommonService.cs @@ -2050,7 +2050,7 @@ public class CommonService : ICommonService /// 获取最新业务单据编码 /// /// - public async Task> GetSequenceNextAsync(SqlSugarScopeProvider tenantDb, IUser user) + public async Task> GetSequenceNextAsync(SqlSugarScopeProvider tenantDb, IUser user,long saleId = 0) { //生成编号 string sequenceNewNo = ""; @@ -2084,10 +2084,14 @@ public class CommonService : ICommonService case "variable": //变量方式 TODO if (item.RuleValue == "UserNumber") { - var userInfo = await db.Queryable().FirstAsync(x => x.Id == long.Parse(user.UserId)); + if (saleId == 0) + { + return await Task.FromResult(DataResult.Failed("请维护订单揽货人信息!")); + } + var userInfo = await db.Queryable().FirstAsync(x => x.Id == saleId); if (userInfo.UserNumber.IsNull()) { - return await Task.FromResult(DataResult.Failed("该用户编码未维护!")); + return await Task.FromResult(DataResult.Failed("该揽货人用户编码未维护!")); } sequenceNewNo += userInfo.UserNumber; }