From d49eaa0082c430d4630cbc323e51b88f5139be7e Mon Sep 17 00:00:00 2001 From: cjy Date: Mon, 23 Sep 2024 16:26:58 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=A1=A8=E5=8D=95=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Code/Method/CodeFormSetService.cs | 32 +++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/ds-wms-service/DS.WMS.Core/Code/Method/CodeFormSetService.cs b/ds-wms-service/DS.WMS.Core/Code/Method/CodeFormSetService.cs index 217cec6c..a8e74cd9 100644 --- a/ds-wms-service/DS.WMS.Core/Code/Method/CodeFormSetService.cs +++ b/ds-wms-service/DS.WMS.Core/Code/Method/CodeFormSetService.cs @@ -11,6 +11,7 @@ using DS.WMS.Core.Sys.Dtos; using DS.WMS.Core.Sys.Entity; using DS.WMS.Core.Sys.Interface; using DS.WMS.Core.Sys.Method; +using DS.WMS.Core.TaskPlat.Dtos; using Mapster; using Microsoft.Extensions.DependencyInjection; using SqlSugar; @@ -113,12 +114,31 @@ public class CodeFormSetService : IFormSetService public DataResult GetFormSetInfoByModule(string permissionId, int formNo = 0,string taskStatus="") { var tenantDb = saasService.GetBizDbScopeById(user.TenantId); - var data = tenantDb.Queryable() - .Where(x => x.PermissionId == long.Parse(permissionId) && x.FormNo == formNo && x.Status == StatusEnum.Enable) - .WhereIF(!string.IsNullOrWhiteSpace(taskStatus), a => a.TaskStatus == taskStatus) - .Select() - .First(); - return DataResult.Success(data, MultiLanguageConst.DataQuerySuccess); + + if (string.IsNullOrEmpty(taskStatus)) + { + var data = tenantDb.Queryable() + .Where(x => x.PermissionId == long.Parse(permissionId) && x.FormNo == formNo && x.Status == StatusEnum.Enable) + .Select() + .First(); + return DataResult.Success(data, MultiLanguageConst.DataQuerySuccess); + } + else + { + var data = tenantDb.Queryable() + .Where(x => x.PermissionId == long.Parse(permissionId) && x.FormNo == formNo && x.Status == StatusEnum.Enable && x.TaskStatus == taskStatus) + .Select() + .First(); + + if (data.IsNull()) + { + data = tenantDb.Queryable() + .Where(x => x.PermissionId == long.Parse(permissionId) && x.FormNo == formNo && x.Status == StatusEnum.Enable) + .Select() + .First(); + } + return DataResult.Success(data, MultiLanguageConst.DataQuerySuccess); + } } /// /// 根据权限模块获取表单设置列表