添加字段

Uat_Study
DK 2022-03-29 10:04:32 +08:00
parent a96de2f416
commit f68f496197
3 changed files with 75 additions and 18 deletions

View File

@ -26,7 +26,20 @@ namespace IRaCIS.Core.Application.ViewModel
public string ModuleTypeId { get; set; }
public string OptTypeId { get; set; }
public string ChildrenTypeId { get; set; }
}
public string ConfigType { get; set; }
public bool? IsShowParent { get; set; }
public string ChildrenTypeValue { get; set; }
public string ChildrenTypeValueCN { get; set; }
public string ModuleTypeValue { get; set; }
public string ModuleTypeValueCN { get; set; }
public string OptTypeValue { get; set; }
public string OptTypeValueCN { get; set; }
}
///<summary>FrontAuditConfigQuery 列表查询参数模型</summary>
public class FrontAuditConfigQuery
@ -69,7 +82,12 @@ namespace IRaCIS.Core.Application.ViewModel
public string ModuleTypeId { get; set; }
public string OptTypeId { get; set; }
public string ChildrenTypeId { get; set; }
}
public string ConfigType { get; set; }
public bool? IsShowParent { get; set; }
}
}

View File

@ -31,21 +31,55 @@ namespace IRaCIS.Core.Application.Service
/// </summary>
/// <param name="iq"></param>
/// <returns></returns>
[HttpPost]
public async Task<List<FrontAuditConfigView>> GetFrontAuditConfigList(FrontAuditConfigQuery iq)
{
var query = _repository.GetQueryable<FrontAuditConfig>()
var query = from data in _repository.GetQueryable<FrontAuditConfig>()
join childrenType in _repository.GetQueryable<Dictionary>() on data.ChildrenTypeId equals childrenType.Id.ToString() into childrenTypetemp
from leftchildrenType in childrenTypetemp.DefaultIfEmpty()
join ModuleType in _repository.GetQueryable<Dictionary>() on data.ModuleTypeId equals ModuleType.Id.ToString() into ModuleTypetemp
from leftModuleType in ModuleTypetemp.DefaultIfEmpty()
join OptTypeId in _repository.GetQueryable<Dictionary>() on data.OptTypeId equals OptTypeId.Id.ToString() into OptTypeIdtemp
from leftOptTypeId in OptTypeIdtemp.DefaultIfEmpty()
select new FrontAuditConfigView()
{
IsShowParent = data.IsShowParent,
ChildrenTypeId = data.ChildrenTypeId,
Code = data.Code,
ConfigType = data.ConfigType,
CreateTime = data.CreateTime,
CreateUserId = data.CreateUserId,
Description = data.Description,
IsConfig = data.IsConfig,
IsEnable = data.IsEnable,
ModuleTypeId = data.ModuleTypeId,
Id = data.Id,
ParentId = data.ParentId,
UpdateTime = data.UpdateTime,
Value = data.Value,
ChildrenTypeValueCN = leftchildrenType.ValueCN,
ModuleTypeValue = leftModuleType.Value,
ModuleTypeValueCN = leftModuleType.ValueCN,
OptTypeId = data.Value,
OptTypeValue = leftOptTypeId.Value,
OptTypeValueCN = leftOptTypeId.ValueCN,
UpdateUserId = data.UpdateUserId,
ValueCN = data.ValueCN,
ChildrenTypeValue = leftchildrenType.Value,
};
query = query
.WhereIf(!iq.Value.IsNullOrEmpty(), x => x.Value == iq.Value)
.WhereIf(!iq.Value.IsNullOrEmpty(), x => x.ValueCN == iq.ValueCN)
.WhereIf(!iq.Value.IsNullOrEmpty(), x => x.Description == iq.Description)
.WhereIf(!iq.Value.IsNullOrEmpty(), x => x.OptTypeId == iq.OptTypeId)
.WhereIf(!iq.Value.IsNullOrEmpty(), x => x.Code == iq.Code)
.WhereIf(!iq.Value.IsNullOrEmpty(), x => x.ChildrenTypeId == iq.ChildrenTypeId);
.WhereIf(!iq.Value.IsNullOrEmpty(), x => x.ValueCN == iq.ValueCN)
.WhereIf(!iq.Value.IsNullOrEmpty(), x => x.Description == iq.Description)
.WhereIf(!iq.Value.IsNullOrEmpty(), x => x.OptTypeId == iq.OptTypeId)
.WhereIf(!iq.Value.IsNullOrEmpty(), x => x.Code == iq.Code)
.WhereIf(!iq.Value.IsNullOrEmpty(), x => x.ChildrenTypeId == iq.ChildrenTypeId);
var frontAuditConfigQueryable = query
.ProjectTo<FrontAuditConfigView>(_mapper.ConfigurationProvider);
return await frontAuditConfigQueryable.ToListAsync();
return await query.ToListAsync();
}
@ -62,6 +96,10 @@ namespace IRaCIS.Core.Application.Service
// CreateMap< FrontAuditConfig,FrontAuditConfigAddOrEdit>().ReverseMap();
addOrEditFrontAuditConfig.CreateTime= DateTime.Now;
addOrEditFrontAuditConfig.UpdateTime= DateTime.Now;
addOrEditFrontAuditConfig.CreateUserId = _userInfo.Id;
addOrEditFrontAuditConfig.UpdateUserId= _userInfo.Id;
var entity = await _repository.InsertOrUpdateAsync<FrontAuditConfig, FrontAuditConfigAddOrEdit>(addOrEditFrontAuditConfig, true);

View File

@ -15,9 +15,6 @@ namespace IRaCIS.Core.Domain.Models
[Table("FrontAuditConfig")]
public class FrontAuditConfig : Entity, IAuditUpdate, IAuditAdd
{
/// <summary>
/// Value
/// </summary>
@ -98,6 +95,10 @@ namespace IRaCIS.Core.Domain.Models
/// </summary>
public string ChildrenTypeId { get; set; }
}
public bool? IsShowParent { get; set; }
public string ConfigType { get; set; }
}
}