From 0c3fd95f86fe6799d9b72943f1473c53514d3d6b Mon Sep 17 00:00:00 2001 From: cjy Date: Mon, 9 Sep 2024 17:04:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=BC=96=E5=8F=B7=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E6=8F=BD=E8=B4=A7=E4=BA=BA=E7=BC=96=E5=8F=B7=E7=94=9F?= =?UTF-8?q?=E6=88=90?= 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-service/DS.WMS.Core/Sys/Method/CommonService.cs | 10 +++++++--- 3 files changed, 10 insertions(+), 6 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 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; }