|
@@ -172,6 +172,7 @@ namespace Hotline.Api.Controllers
|
|
|
if (item is null)
|
|
|
throw UserFriendlyException.SameMessage("无效质检项目");
|
|
|
_mapper.Map(dto, item);
|
|
|
+ item.LastModificationName = _sessionContext.UserName;
|
|
|
await _qualiteyItem.UpdateAsync(item, HttpContext.RequestAborted);
|
|
|
}
|
|
|
|
|
@@ -187,6 +188,7 @@ namespace Hotline.Api.Controllers
|
|
|
var (total, items) = await _qualiteyItem.Queryable()
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.Name), d => d.Name.Contains(dto.Name!))
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.GroupingName), d => d.GroupingName.Contains(dto.GroupingName!))
|
|
|
+ .WhereIF(dto.IsEnable.HasValue,d=>d.IsEnable == dto.IsEnable)
|
|
|
.OrderByDescending(x => x.CreationTime)
|
|
|
.ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
|
return new PagedDto<QualityItemDto>(total, _mapper.Map<IReadOnlyList<QualityItemDto>>(items));
|
|
@@ -274,8 +276,8 @@ namespace Hotline.Api.Controllers
|
|
|
if (template is null)
|
|
|
throw UserFriendlyException.SameMessage("无效质检模版");
|
|
|
_mapper.Map(dto, template);
|
|
|
+ template.LastModificationName = _sessionContext.UserName;
|
|
|
await _qualityTemplate.UpdateAsync(template, HttpContext.RequestAborted);
|
|
|
-
|
|
|
List<QualityTemplateDetail> details = await _qualiteyTemplateDetail.Queryable().Where(x => x.TemplateId == dto.Id).ToListAsync();
|
|
|
await _qualiteyTemplateDetail.RemoveRangeAsync(details, HttpContext.RequestAborted);
|
|
|
foreach (var item in dto.TemplateDetails)
|
|
@@ -299,6 +301,7 @@ namespace Hotline.Api.Controllers
|
|
|
.Includes(x => x.QualityTemplates)
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.Name), d => d.Name.Contains(dto.Name!))
|
|
|
.WhereIF(dto.Grouping.HasValue, d => d.Grouping == dto.Grouping)
|
|
|
+ .WhereIF(dto.IsEnable.HasValue, d => d.IsEnable == dto.IsEnable)
|
|
|
.OrderByDescending(x => x.CreationTime)
|
|
|
.ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
|
return new PagedDto<QualityTemplateDto>(total, _mapper.Map<IReadOnlyList<QualityTemplateDto>>(items));
|
|
@@ -382,11 +385,12 @@ namespace Hotline.Api.Controllers
|
|
|
[HttpPut("prohibited")]
|
|
|
public async Task Update([FromBody] ProhibitedUpdateDto dto)
|
|
|
{
|
|
|
- var template = await _qualiteyProhibited.GetAsync(dto.Id, HttpContext.RequestAborted);
|
|
|
- if (template is null)
|
|
|
+ var prohibited = await _qualiteyProhibited.GetAsync(dto.Id, HttpContext.RequestAborted);
|
|
|
+ if (prohibited is null)
|
|
|
throw UserFriendlyException.SameMessage("无效质检模版");
|
|
|
- _mapper.Map(dto, template);
|
|
|
- await _qualiteyProhibited.UpdateAsync(template, HttpContext.RequestAborted);
|
|
|
+ _mapper.Map(dto, prohibited);
|
|
|
+ prohibited.LastModificationName = _sessionContext.UserName;
|
|
|
+ await _qualiteyProhibited.UpdateAsync(prohibited, HttpContext.RequestAborted);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|