|
@@ -25,6 +25,8 @@ using Hotline.Orders;
|
|
|
using Hotline.Share.Dtos.Order;
|
|
|
using Hotline.Share.Dtos.FlowEngine.Definition;
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
+using Hotline.Caching.Services;
|
|
|
+using Hotline.Settings.TimeLimits;
|
|
|
|
|
|
namespace Hotline.Api.Controllers;
|
|
|
|
|
@@ -51,6 +53,7 @@ public class WorkflowController : BaseController
|
|
|
private readonly IMapper _mapper;
|
|
|
private readonly ISystemDicDataCacheManager _systemDicDataCacheManager;
|
|
|
private readonly IFileRepository _fileRepository;
|
|
|
+ private readonly ISystemDicDataCacheManager _sysDicDataCacheManager;
|
|
|
|
|
|
public WorkflowController(
|
|
|
IDefinitionDomainService definitionDomainService,
|
|
@@ -70,7 +73,8 @@ public class WorkflowController : BaseController
|
|
|
IMapper mapper,
|
|
|
ISystemDicDataCacheManager systemDicDataCacheManager,
|
|
|
IFileRepository fileRepository,
|
|
|
- IRepository<WorkflowCountersignMember> workflowCountersignMemberRepository
|
|
|
+ IRepository<WorkflowCountersignMember> workflowCountersignMemberRepository,
|
|
|
+ ISystemDicDataCacheManager sysDicDataCacheManager
|
|
|
)
|
|
|
{
|
|
|
_definitionDomainService = definitionDomainService;
|
|
@@ -91,6 +95,7 @@ public class WorkflowController : BaseController
|
|
|
_systemDicDataCacheManager = systemDicDataCacheManager;
|
|
|
_fileRepository = fileRepository;
|
|
|
_workflowCountersignMemberRepository = workflowCountersignMemberRepository;
|
|
|
+ _sysDicDataCacheManager = sysDicDataCacheManager;
|
|
|
}
|
|
|
|
|
|
#region definition
|
|
@@ -563,13 +568,12 @@ public class WorkflowController : BaseController
|
|
|
.Includes(x => x.Members)
|
|
|
.LeftJoin<Workflow>((c, w) => c.WorkflowId == w.Id)
|
|
|
.InnerJoin<Order>((c, w, o) => w.ExternalId == o.Id)
|
|
|
- // .WhereIF(!_sessionContext.OrgIsCenter, (c, w, o) => c.Members.Any(m => m.Key == _sessionContext.OrgId || m.Key == _sessionContext.RequiredOrgId))
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.Title), (c, w, o) => o.Title.Contains(dto.Title))
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.OrderNo), (c, w, o) => o.No.Contains(dto.OrderNo))
|
|
|
.WhereIF(dto.AcceptTypes.Any(), (c, w, o) => dto.AcceptTypes.Contains(o.AcceptTypeCode)) //受理类型
|
|
|
.WhereIF(dto.Channels.Any(), (c, w, o) => dto.Channels.Contains(o.SourceChannelCode)) //来源渠道
|
|
|
.WhereIF(dto.HotspotIds.Any(), (c, w, o) => dto.HotspotIds.Contains(o.HotspotId)) //热点类型
|
|
|
- .WhereIF(dto.OrgCodes.Any(), (c, w, o) => dto.OrgCodes.Contains(c.FinisherOrgAreaCode)) //接办部门
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.OrgName), (c, w, o) => c.FinisherOrgName.Contains(dto.OrgName)) //接办部门
|
|
|
.WhereIF(dto.CounterSignType != null, (c, w, o) => c.CounterSignType == dto.CounterSignType) //会签类型
|
|
|
;
|
|
|
|
|
@@ -614,9 +618,6 @@ public class WorkflowController : BaseController
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //if (dto.IsOnlyStarter)
|
|
|
- // query = query.Where((c, w, o) => c.StarterId == _sessionContext.RequiredUserId);
|
|
|
- // dto.CounterSignCount = await _workflowCountersignRepository.Queryable().Where(p => p.WorkflowId == dto.WorkflowId).CountAsync();
|
|
|
var items = await query
|
|
|
.OrderByDescending((c, w, o) => o.ExpiredTime)
|
|
|
.Select((c, w, o) => new { c, o })
|
|
@@ -633,6 +634,22 @@ public class WorkflowController : BaseController
|
|
|
return new PagedDto<WorkflowCountersignDto>(total, dtos);
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ ///
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("order-countersign-base-data")]
|
|
|
+ public async Task<object> QueryOrderCountersignsBaseData()
|
|
|
+ {
|
|
|
+
|
|
|
+ return new
|
|
|
+ {
|
|
|
+ CounterSignType = EnumExts.GetDescriptions<ECounterSignType>(),
|
|
|
+ ChannelOptions = _sysDicDataCacheManager.GetSysDicDataCache(TimeLimitBaseDataConsts.SourceChannel),
|
|
|
+ AcceptTypeOptions = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.AcceptType),
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
}
|