获取表单设置修改

dev
cjy 2 months ago
parent 2b399a2bcc
commit d49eaa0082

@ -11,6 +11,7 @@ using DS.WMS.Core.Sys.Dtos;
using DS.WMS.Core.Sys.Entity; using DS.WMS.Core.Sys.Entity;
using DS.WMS.Core.Sys.Interface; using DS.WMS.Core.Sys.Interface;
using DS.WMS.Core.Sys.Method; using DS.WMS.Core.Sys.Method;
using DS.WMS.Core.TaskPlat.Dtos;
using Mapster; using Mapster;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using SqlSugar; using SqlSugar;
@ -113,12 +114,31 @@ public class CodeFormSetService : IFormSetService
public DataResult<CodeFormSetRes> GetFormSetInfoByModule(string permissionId, int formNo = 0,string taskStatus="") public DataResult<CodeFormSetRes> GetFormSetInfoByModule(string permissionId, int formNo = 0,string taskStatus="")
{ {
var tenantDb = saasService.GetBizDbScopeById(user.TenantId); var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var data = tenantDb.Queryable<CodeFormSet>()
.Where(x => x.PermissionId == long.Parse(permissionId) && x.FormNo == formNo && x.Status == StatusEnum.Enable) if (string.IsNullOrEmpty(taskStatus))
.WhereIF(!string.IsNullOrWhiteSpace(taskStatus), a => a.TaskStatus == taskStatus) {
.Select<CodeFormSetRes>() var data = tenantDb.Queryable<CodeFormSet>()
.First(); .Where(x => x.PermissionId == long.Parse(permissionId) && x.FormNo == formNo && x.Status == StatusEnum.Enable)
return DataResult<CodeFormSetRes>.Success(data, MultiLanguageConst.DataQuerySuccess); .Select<CodeFormSetRes>()
.First();
return DataResult<CodeFormSetRes>.Success(data, MultiLanguageConst.DataQuerySuccess);
}
else
{
var data = tenantDb.Queryable<CodeFormSet>()
.Where(x => x.PermissionId == long.Parse(permissionId) && x.FormNo == formNo && x.Status == StatusEnum.Enable && x.TaskStatus == taskStatus)
.Select<CodeFormSetRes>()
.First();
if (data.IsNull())
{
data = tenantDb.Queryable<CodeFormSet>()
.Where(x => x.PermissionId == long.Parse(permissionId) && x.FormNo == formNo && x.Status == StatusEnum.Enable)
.Select<CodeFormSetRes>()
.First();
}
return DataResult<CodeFormSetRes>.Success(data, MultiLanguageConst.DataQuerySuccess);
}
} }
/// <summary> /// <summary>
/// 根据权限模块获取表单设置列表 /// 根据权限模块获取表单设置列表

Loading…
Cancel
Save