|
|
|
@ -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<CodeFormSetRes> GetFormSetInfoByModule(string permissionId, int formNo = 0,string taskStatus="")
|
|
|
|
|
{
|
|
|
|
|
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)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(taskStatus), a => a.TaskStatus == taskStatus)
|
|
|
|
|
.Select<CodeFormSetRes>()
|
|
|
|
|
.First();
|
|
|
|
|
return DataResult<CodeFormSetRes>.Success(data, MultiLanguageConst.DataQuerySuccess);
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(taskStatus))
|
|
|
|
|
{
|
|
|
|
|
var 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);
|
|
|
|
|
}
|
|
|
|
|
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>
|
|
|
|
|
/// 根据权限模块获取表单设置列表
|
|
|
|
|