|
@@ -125,8 +125,9 @@ public class OrderController : BaseController
|
|
|
private readonly IRepository<OrderCopy> _orderCopyRepository;
|
|
|
private readonly IRepository<ExternalCitizens> _externalCitizensRepository;
|
|
|
private readonly IRepository<OrderModifyingRecords> _orderModifyingRecordsRepository;
|
|
|
+ private readonly IOrderSendBackAuditApplication _orderSendBackAuditApplication;
|
|
|
|
|
|
- public OrderController(
|
|
|
+ public OrderController(
|
|
|
IOrderDomainService orderDomainService,
|
|
|
IOrderRepository orderRepository,
|
|
|
IWorkflowApplication workflowApplication,
|
|
@@ -180,8 +181,9 @@ public class OrderController : BaseController
|
|
|
IOrderSecondaryHandlingApplication orderSecondaryHandlingApplication,
|
|
|
IRepository<OrderCopy> orderCopyRepository,
|
|
|
IRepository<ExternalCitizens> externalCitizensRepository,
|
|
|
- IRepository<OrderModifyingRecords> orderModifyingRecordsRepository
|
|
|
- )
|
|
|
+ IRepository<OrderModifyingRecords> orderModifyingRecordsRepository,
|
|
|
+ IOrderSendBackAuditApplication orderSendBackAuditApplication
|
|
|
+ )
|
|
|
{
|
|
|
_orderDomainService = orderDomainService;
|
|
|
_orderRepository = orderRepository;
|
|
@@ -237,7 +239,9 @@ public class OrderController : BaseController
|
|
|
_orderCopyRepository = orderCopyRepository;
|
|
|
_externalCitizensRepository = externalCitizensRepository;
|
|
|
_orderModifyingRecordsRepository = orderModifyingRecordsRepository;
|
|
|
- }
|
|
|
+ _orderSendBackAuditApplication = orderSendBackAuditApplication;
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
#region 工单发布
|
|
|
|
|
@@ -3642,34 +3646,52 @@ public class OrderController : BaseController
|
|
|
[HttpGet("order_previous_list")]
|
|
|
public async Task<PagedDto<SendBackDto>> AuditList([FromQuery] SendBackListDto dto)
|
|
|
{
|
|
|
- var query = _orderSendBackAuditRepository.Queryable()
|
|
|
- .Includes(x => x.Order)
|
|
|
- .WhereIF(!string.IsNullOrEmpty(dto.Keyword),
|
|
|
- d => d.Order.Title.Contains(dto.Keyword!) || d.Order.No.Contains(dto.Keyword!))
|
|
|
- .WhereIF(!string.IsNullOrEmpty(dto.Title), d => d.Order.Title.Contains(dto.Title!) )
|
|
|
- .WhereIF(!string.IsNullOrEmpty(dto.No),d => d.Order.No.Contains(dto.No!))
|
|
|
- .WhereIF(!string.IsNullOrEmpty(dto.AcceptTypeCode), d => d.Order.AcceptTypeCode == dto.AcceptTypeCode)
|
|
|
- .WhereIF(!string.IsNullOrEmpty(dto.OrgName), d => d.ApplyOrgName == dto.OrgName)
|
|
|
- .WhereIF(dto.StartTime.HasValue, d => d.CreationTime >= dto.StartTime)
|
|
|
- .WhereIF(dto.EndTime.HasValue, d => d.CreationTime <= dto.EndTime)
|
|
|
- .WhereIF(dto.AuditState == 1, d => d.State == ESendBackAuditState.Apply)
|
|
|
- .WhereIF(dto.AuditState == 2 && !dto.State.HasValue, d => d.State > ESendBackAuditState.Apply)
|
|
|
- .WhereIF(dto.AuditState == 2 && dto.State.HasValue, d => d.State == dto.State)
|
|
|
- .WhereIF(dto.AuditState == 3 && _sessionContext.RequiredOrgId != OrgSeedData.CenterId, x => x.SendBackOrgId.StartsWith(_sessionContext.OrgId))
|
|
|
- .WhereIF(_sessionContext.Roles.Contains("role_sysadmin") == false && dto.AuditState != 3,x => x.SendBackOrgId == _sessionContext.OrgId);// 123 系统管理员
|
|
|
-
|
|
|
- var (total, items) = await query.OrderByDescending(x => x.CreationTime)
|
|
|
- .ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
|
+ var query = _orderSendBackAuditApplication.AuditList(dto);
|
|
|
+
|
|
|
+ var (total, items) = await query.ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
|
|
|
|
return new PagedDto<SendBackDto>(total, _mapper.Map<IReadOnlyList<SendBackDto>>(items));
|
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// 退回详情
|
|
|
- /// </summary>
|
|
|
- /// <param name="id"></param>
|
|
|
- /// <returns></returns>
|
|
|
- [HttpGet("order_previous/{id}")]
|
|
|
+ /// <summary>
|
|
|
+ /// 工单业务退回审批列表导出
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("order_previous_list/_export")]
|
|
|
+ public async Task<FileStreamResult> OrgDataListDetailExport([FromBody] ExportExcelDto<SendBackListDto> dto)
|
|
|
+ {
|
|
|
+ var query = _orderSendBackAuditApplication.AuditList(dto.QueryDto);
|
|
|
+ List<OrderSendBackAudit> data;
|
|
|
+ if (dto.IsExportAll)
|
|
|
+ {
|
|
|
+ data = await query.ToListAsync(HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var (_, items) = await query.ToPagedListAsync(dto.QueryDto, HttpContext.RequestAborted);
|
|
|
+ data = items;
|
|
|
+ }
|
|
|
+
|
|
|
+ var dataDtos = _mapper.Map<ICollection<SendBackDto>>(data);
|
|
|
+
|
|
|
+ dynamic? dynamicClass = DynamicClassHelper.CreateDynamicClass(dto.ColumnInfos);
|
|
|
+
|
|
|
+ var dtos = dataDtos
|
|
|
+ .Select(stu => _mapper.Map(stu, typeof(SendBackDto), dynamicClass))
|
|
|
+ .Cast<object>()
|
|
|
+ .ToList();
|
|
|
+
|
|
|
+ var stream = ExcelHelper.CreateStream(dtos);
|
|
|
+
|
|
|
+ return ExcelStreamResult(stream, "工单退回列表数据");
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 退回详情
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="id"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("order_previous/{id}")]
|
|
|
public async Task<OrderSendBackAudit> OrderSendBackEntity(string id)
|
|
|
{
|
|
|
return await _orderSendBackAuditRepository.Queryable()
|