|
@@ -2,6 +2,7 @@
|
|
|
using Hotline.Caching.Interfaces;
|
|
|
using Hotline.FlowEngine.WorkflowModules;
|
|
|
using Hotline.JudicialManagement;
|
|
|
+using Hotline.Orders;
|
|
|
using Hotline.Repository.SqlSugar.Extensions;
|
|
|
using Hotline.Settings;
|
|
|
using Hotline.Settings.TimeLimits;
|
|
@@ -11,6 +12,7 @@ using Hotline.Share.Enums.Order;
|
|
|
using MapsterMapper;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
using System.Diagnostics.Eventing.Reader;
|
|
|
+using XF.Domain.Authentications;
|
|
|
using XF.Domain.Exceptions;
|
|
|
using XF.Domain.Repository;
|
|
|
using XF.Utility.EnumExtensions;
|
|
@@ -27,6 +29,7 @@ namespace Hotline.Api.Controllers
|
|
|
private readonly IWorkflowApplication _workflowApplication;
|
|
|
private readonly ISystemDicDataCacheManager _sysDicDataCacheManager;
|
|
|
private readonly IRepository<SystemOrganize> _systemOrganizeRepository;
|
|
|
+ private readonly ISessionContext _sessionContext;
|
|
|
|
|
|
public EnforcementOrderController(IRepository<EnforcementOrderHander> enforcementOrderHanderRepository,
|
|
|
IRepository<EnforcementOrders> enforcementOrdersRepository,
|
|
@@ -35,7 +38,8 @@ namespace Hotline.Api.Controllers
|
|
|
IMapper mapper,
|
|
|
IWorkflowApplication workflowApplication,
|
|
|
ISystemDicDataCacheManager sysDicDataCacheManager,
|
|
|
- IRepository<SystemOrganize> systemOrganizeRepository)
|
|
|
+ IRepository<SystemOrganize> systemOrganizeRepository,
|
|
|
+ ISessionContext sessionContext)
|
|
|
{
|
|
|
_enforcementOrderHanderRepository = enforcementOrderHanderRepository;
|
|
|
_enforcementOrdersRepository = enforcementOrdersRepository;
|
|
@@ -45,6 +49,7 @@ namespace Hotline.Api.Controllers
|
|
|
_workflowApplication = workflowApplication;
|
|
|
_sysDicDataCacheManager = sysDicDataCacheManager;
|
|
|
_systemOrganizeRepository = systemOrganizeRepository;
|
|
|
+ _sessionContext = sessionContext;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -94,7 +99,17 @@ namespace Hotline.Api.Controllers
|
|
|
.OrderByDescending(d => d.CreationTime)
|
|
|
.ToPagedListAsync(dto, HttpContext.RequestAborted);
|
|
|
|
|
|
- return new PagedDto<EnforcementOrderListDto>(total, _mapper.Map<IReadOnlyList<EnforcementOrderListDto>>(items));
|
|
|
+ var data = _mapper.Map<List<EnforcementOrderListDto>>(items);
|
|
|
+
|
|
|
+ if (_sessionContext.RequiredOrgId == "001188")
|
|
|
+ {
|
|
|
+ foreach (var item in data)
|
|
|
+ {
|
|
|
+ if (item.IsTheClueTrue.HasValue)
|
|
|
+ item.IsShowUpdateButton = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return new PagedDto<EnforcementOrderListDto>(total, data);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -142,8 +157,11 @@ namespace Hotline.Api.Controllers
|
|
|
if (dto.OrderIds == null || dto.OrderIds.Count == 0)
|
|
|
throw UserFriendlyException.SameMessage("工单不能为空");
|
|
|
|
|
|
- if (string.IsNullOrEmpty(dto.EventTypeId) || string.IsNullOrEmpty(dto.EventTypeName))
|
|
|
- throw UserFriendlyException.SameMessage("事项不能为空");
|
|
|
+ if (dto.IsTheClueTrue.HasValue && dto.IsTheClueTrue.Value == true)
|
|
|
+ {
|
|
|
+ if (string.IsNullOrEmpty(dto.EventTypeId) || string.IsNullOrEmpty(dto.EventTypeName))
|
|
|
+ throw UserFriendlyException.SameMessage("事项不能为空");
|
|
|
+ }
|
|
|
|
|
|
foreach (var item in dto.OrderIds)
|
|
|
{
|
|
@@ -155,7 +173,7 @@ namespace Hotline.Api.Controllers
|
|
|
|
|
|
if (!string.IsNullOrEmpty(dto.EventTypeName))
|
|
|
order.EventTypeName = dto.EventTypeName;
|
|
|
- else
|
|
|
+ else
|
|
|
order.EventTypeName = null;
|
|
|
|
|
|
if (!string.IsNullOrEmpty(dto.EventTypeId))
|
|
@@ -182,6 +200,21 @@ namespace Hotline.Api.Controllers
|
|
|
return await _judicialComplaintsEventTypeRepository.Queryable().ToTreeAsync(it => it.Children, it => it.ParentId, null, it => it.Id);
|
|
|
}
|
|
|
|
|
|
+ ///// <summary>
|
|
|
+ /////
|
|
|
+ ///// </summary>
|
|
|
+ ///// <param name="StartDate"></param>
|
|
|
+ ///// <param name="EndDate"></param>
|
|
|
+ ///// <returns></returns>
|
|
|
+ //[HttpGet("departmental_processing_statistics")]
|
|
|
+ //public async Task<object> GetDepartmentalProcessingStatisticsAsync(DateTime StartDate, DateTime EndDate)
|
|
|
+ //{
|
|
|
+
|
|
|
+ // EndDate = EndDate.AddDays(1).AddSeconds(-1);
|
|
|
+ // await _enforcementOrdersRepository.Queryable()
|
|
|
+ // .LeftJoin<Order>
|
|
|
+
|
|
|
|
|
|
+ //}
|
|
|
}
|
|
|
}
|