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); + } } /// /// 根据权限模块获取表单设置列表