|
@@ -64,7 +64,7 @@ public class OrderController : BaseController
|
|
|
private readonly IRepository<OrderScreen> _orderScreenRepository;
|
|
|
|
|
|
|
|
|
- public OrderController(
|
|
|
+ public OrderController(
|
|
|
IOrderDomainService orderDomainService,
|
|
|
IOrderRepository orderRepository,
|
|
|
IWorkflowApplication workflowApplication,
|
|
@@ -84,12 +84,12 @@ public class OrderController : BaseController
|
|
|
IRepository<OrderDelay> orderDelayRepository,
|
|
|
ITimeLimitApplication timeLimitApplication,
|
|
|
ISystemSettingCacheManager systemSettingCacheManager,
|
|
|
- IRepository<OrderRedo> orderRedoRepository,
|
|
|
- IRepository<OrderSupervise> orderSuperviseRepository,
|
|
|
- IRepository<OrderUrge> orderUrgeRepository,
|
|
|
+ IRepository<OrderRedo> orderRedoRepository,
|
|
|
+ IRepository<OrderSupervise> orderSuperviseRepository,
|
|
|
+ IRepository<OrderUrge> orderUrgeRepository,
|
|
|
IFileRepository fileRepository,
|
|
|
IRepository<OrderScreen> orderScreenRepository
|
|
|
- )
|
|
|
+ )
|
|
|
{
|
|
|
_orderDomainService = orderDomainService;
|
|
|
_orderRepository = orderRepository;
|
|
@@ -113,10 +113,10 @@ public class OrderController : BaseController
|
|
|
_orderRedoRepository = orderRedoRepository;
|
|
|
_orderSuperviseRepository = orderSuperviseRepository;
|
|
|
_orderUrgeRepository = orderUrgeRepository;
|
|
|
- _fileRepository = fileRepository;
|
|
|
- _orderScreenRepository = orderScreenRepository;
|
|
|
+ _fileRepository = fileRepository;
|
|
|
+ _orderScreenRepository = orderScreenRepository;
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
#region 工单发布
|
|
|
|
|
@@ -532,109 +532,109 @@ public class OrderController : BaseController
|
|
|
.FirstAsync(x => x.Id == id);
|
|
|
}
|
|
|
|
|
|
- #endregion
|
|
|
-
|
|
|
- #region 工单甄别
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 工单甄别列表
|
|
|
- /// </summary>
|
|
|
- /// <param name="dto"></param>
|
|
|
- /// <returns></returns>
|
|
|
- [Permission(EPermission.OrderScreenList)]
|
|
|
- [HttpGet("screen")]
|
|
|
- public async Task<PagedDto<OrderScreen>> ScreenList([FromQuery] ScreenListDto dto)
|
|
|
- {
|
|
|
- var (total, items) = await _orderScreenRepository.Queryable()
|
|
|
- .Includes(x => x.Visit,d=>d.Order)
|
|
|
- .WhereIF(!string.IsNullOrEmpty(dto.Keyword), d => d.Visit.Order.Title.Contains(dto.Keyword!) || d.Visit.Order.No.Contains(dto.Keyword!))
|
|
|
- .WhereIF(dto.Status == EScreenStatus.Apply || dto.Status == EScreenStatus.Approval || dto.Status == EScreenStatus.End, x => x.Status == dto.Status)
|
|
|
- .WhereIF(dto.CreationTimeStart.HasValue, d => d.CreationTime >= dto.CreationTimeStart)
|
|
|
- .WhereIF(dto.CreationTimeEnd.HasValue, d => d.CreationTime <= dto.CreationTimeEnd)
|
|
|
- .OrderByDescending(x => x.CreationTime)
|
|
|
- .ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
|
- return new PagedDto<OrderScreen>(total, items);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 开始工单甄别流程
|
|
|
- /// </summary>
|
|
|
- [Permission(EPermission.ApplyScreen)]
|
|
|
- [HttpPost("screen/startflow")]
|
|
|
- public async Task StartFlow([FromBody] ScreenStartFlowDto dto)
|
|
|
- {
|
|
|
- var model = _mapper.Map<OrderScreen>(dto.Data);
|
|
|
- model.Status = EScreenStatus.Apply;
|
|
|
- var id = await _orderScreenRepository.AddAsync(model, HttpContext.RequestAborted);
|
|
|
- if (dto.Data.Files.Any()) await _fileRepository.AddFileAsync(dto.Data.Files, id, HttpContext.RequestAborted);
|
|
|
- try
|
|
|
- {
|
|
|
- var startDto = _mapper.Map<StartWorkflowDto>(dto.Workflow);
|
|
|
- startDto.DefinitionModuleCode = WorkflowModuleConsts.OrderHandle;
|
|
|
- startDto.Title = dto.Data.Content;
|
|
|
- await _workflowApplication.StartWorkflowAsync(startDto, id, HttpContext.RequestAborted);
|
|
|
- }
|
|
|
- catch (Exception e)
|
|
|
- {
|
|
|
- await Remove(id);
|
|
|
- throw new UserFriendlyException($"工单开启甄别流程失败!, {e.Message}", "工单开启甄别流程失败");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 查询工单甄别流程开启参数
|
|
|
- /// </summary>
|
|
|
- /// <returns></returns>
|
|
|
- [HttpGet("screen/startflow")]
|
|
|
- public async Task<DefinedStepDto> GetScreenFlowStartOptionsAsync()
|
|
|
- {
|
|
|
- return await _workflowApplication.GetStartOptionsAsync(WorkflowModuleConsts.OrderScreen, HttpContext.RequestAborted);
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 列表页面基础数据
|
|
|
- /// </summary>
|
|
|
- /// <returns></returns>
|
|
|
- [HttpGet("screen/base")]
|
|
|
- public async Task<object> ScreenBaseData()
|
|
|
- {
|
|
|
- var rsp = new
|
|
|
- {
|
|
|
- ScreenStatus = EnumExts.GetDescriptions<EScreenStatus>(),
|
|
|
- ScreenType = await _systemDomainService.GetSysDicDataByCodeAsync(SysDicTypeConsts.ScreenType),
|
|
|
- };
|
|
|
- return rsp;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 甄别详情
|
|
|
- /// </summary>
|
|
|
- /// <param name="id"></param>
|
|
|
- /// <returns></returns>
|
|
|
- [Permission(EPermission.ScreenEntity)]
|
|
|
- [HttpGet("screen/{id}")]
|
|
|
- public async Task<OrderScreen> ScreenEntity(string id)
|
|
|
- {
|
|
|
- return await _orderScreenRepository.Queryable()
|
|
|
- .Includes(x => x.Visit, d=>d.Order)
|
|
|
- .FirstAsync(x => x.Id == id);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- #endregion
|
|
|
-
|
|
|
- #region 工单督办
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 工单督办列表
|
|
|
- /// </summary>
|
|
|
- /// <param name="dto"></param>
|
|
|
- /// <returns></returns>
|
|
|
- [Permission(EPermission.SuperviseOrderList)]
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 工单甄别
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 工单甄别列表
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [Permission(EPermission.OrderScreenList)]
|
|
|
+ [HttpGet("screen")]
|
|
|
+ public async Task<PagedDto<OrderScreen>> ScreenList([FromQuery] ScreenListDto dto)
|
|
|
+ {
|
|
|
+ var (total, items) = await _orderScreenRepository.Queryable()
|
|
|
+ .Includes(x => x.Visit, d => d.Order)
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.Keyword), d => d.Visit.Order.Title.Contains(dto.Keyword!) || d.Visit.Order.No.Contains(dto.Keyword!))
|
|
|
+ .WhereIF(dto.Status == EScreenStatus.Apply || dto.Status == EScreenStatus.Approval || dto.Status == EScreenStatus.End, x => x.Status == dto.Status)
|
|
|
+ .WhereIF(dto.CreationTimeStart.HasValue, d => d.CreationTime >= dto.CreationTimeStart)
|
|
|
+ .WhereIF(dto.CreationTimeEnd.HasValue, d => d.CreationTime <= dto.CreationTimeEnd)
|
|
|
+ .OrderByDescending(x => x.CreationTime)
|
|
|
+ .ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
|
+ return new PagedDto<OrderScreen>(total, items);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 开始工单甄别流程
|
|
|
+ /// </summary>
|
|
|
+ [Permission(EPermission.ApplyScreen)]
|
|
|
+ [HttpPost("screen/startflow")]
|
|
|
+ public async Task StartFlow([FromBody] ScreenStartFlowDto dto)
|
|
|
+ {
|
|
|
+ var model = _mapper.Map<OrderScreen>(dto.Data);
|
|
|
+ model.Status = EScreenStatus.Apply;
|
|
|
+ var id = await _orderScreenRepository.AddAsync(model, HttpContext.RequestAborted);
|
|
|
+ if (dto.Data.Files.Any()) await _fileRepository.AddFileAsync(dto.Data.Files, id, HttpContext.RequestAborted);
|
|
|
+ try
|
|
|
+ {
|
|
|
+ var startDto = _mapper.Map<StartWorkflowDto>(dto.Workflow);
|
|
|
+ startDto.DefinitionModuleCode = WorkflowModuleConsts.OrderHandle;
|
|
|
+ startDto.Title = dto.Data.Content;
|
|
|
+ await _workflowApplication.StartWorkflowAsync(startDto, id, HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ await Remove(id);
|
|
|
+ throw new UserFriendlyException($"工单开启甄别流程失败!, {e.Message}", "工单开启甄别流程失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 查询工单甄别流程开启参数
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("screen/startflow")]
|
|
|
+ public async Task<DefinedStepDto> GetScreenFlowStartOptionsAsync()
|
|
|
+ {
|
|
|
+ return await _workflowApplication.GetStartOptionsAsync(WorkflowModuleConsts.OrderScreen, HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 列表页面基础数据
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("screen/base")]
|
|
|
+ public async Task<object> ScreenBaseData()
|
|
|
+ {
|
|
|
+ var rsp = new
|
|
|
+ {
|
|
|
+ ScreenStatus = EnumExts.GetDescriptions<EScreenStatus>(),
|
|
|
+ ScreenType = await _systemDomainService.GetSysDicDataByCodeAsync(SysDicTypeConsts.ScreenType),
|
|
|
+ };
|
|
|
+ return rsp;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 甄别详情
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="id"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [Permission(EPermission.ScreenEntity)]
|
|
|
+ [HttpGet("screen/{id}")]
|
|
|
+ public async Task<OrderScreen> ScreenEntity(string id)
|
|
|
+ {
|
|
|
+ return await _orderScreenRepository.Queryable()
|
|
|
+ .Includes(x => x.Visit, d => d.Order)
|
|
|
+ .FirstAsync(x => x.Id == id);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 工单督办
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 工单督办列表
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [Permission(EPermission.SuperviseOrderList)]
|
|
|
[HttpGet("supervise")]
|
|
|
public async Task<PagedDto<SuperviseOrderDto>> SuperviseList([FromQuery] SuperviseListDto dto)
|
|
|
{
|
|
@@ -644,7 +644,7 @@ public class OrderController : BaseController
|
|
|
.WhereIF(dto.SuperviseState > 0, x => x.State == dto.SuperviseState)
|
|
|
.WhereIF(dto.CreationTimeStart.HasValue, d => d.CreationTime >= dto.CreationTimeStart)
|
|
|
.WhereIF(dto.CreationTimeEnd.HasValue, d => d.CreationTime <= dto.CreationTimeEnd)
|
|
|
- .OrderByDescending(x => x.CreationTime)
|
|
|
+ .OrderByDescending(x => x.CreationTime)
|
|
|
.ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
|
|
|
|
return new PagedDto<SuperviseOrderDto>(total, _mapper.Map<IReadOnlyList<SuperviseOrderDto>>(items));
|
|
@@ -670,7 +670,7 @@ public class OrderController : BaseController
|
|
|
var id = await _orderSuperviseRepository.AddAsync(model, HttpContext.RequestAborted);
|
|
|
if (dto.Files.Any()) await _fileRepository.AddFileAsync(dto.Files, id, HttpContext.RequestAborted);
|
|
|
return id;
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 回复督办
|
|
@@ -692,7 +692,7 @@ public class OrderController : BaseController
|
|
|
supervise.ReplyTime = DateTime.Now;
|
|
|
supervise.State = 1;
|
|
|
if (dto.Files.Any()) await _fileRepository.AddFileAsync(dto.Files, supervise.Id, HttpContext.RequestAborted);
|
|
|
- await _orderSuperviseRepository.UpdateAsync(supervise, HttpContext.RequestAborted);
|
|
|
+ await _orderSuperviseRepository.UpdateAsync(supervise, HttpContext.RequestAborted);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -746,7 +746,7 @@ public class OrderController : BaseController
|
|
|
.WhereIF(dto.SuperviseState > 0, x => x.State == dto.SuperviseState)
|
|
|
.WhereIF(dto.CreationTimeStart.HasValue, d => d.CreationTime >= dto.CreationTimeStart)
|
|
|
.WhereIF(dto.CreationTimeEnd.HasValue, d => d.CreationTime <= dto.CreationTimeEnd)
|
|
|
- .OrderByDescending(x => x.CreationTime)
|
|
|
+ .OrderByDescending(x => x.CreationTime)
|
|
|
.ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
|
|
|
|
return new PagedDto<UrgeOrderDto>(total, _mapper.Map<IReadOnlyList<UrgeOrderDto>>(items));
|
|
@@ -769,10 +769,10 @@ public class OrderController : BaseController
|
|
|
var model = _mapper.Map<OrderUrge>(dto);
|
|
|
model.CreatorOrgName = _sessionContext.OrgName;
|
|
|
model.State = 0;
|
|
|
- var id = await _orderUrgeRepository.AddAsync(model, HttpContext.RequestAborted);
|
|
|
- if (dto.Files.Any()) await _fileRepository.AddFileAsync(dto.Files, id, HttpContext.RequestAborted);
|
|
|
- return id;
|
|
|
- }
|
|
|
+ var id = await _orderUrgeRepository.AddAsync(model, HttpContext.RequestAborted);
|
|
|
+ if (dto.Files.Any()) await _fileRepository.AddFileAsync(dto.Files, id, HttpContext.RequestAborted);
|
|
|
+ return id;
|
|
|
+ }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 回复催办
|
|
@@ -794,7 +794,7 @@ public class OrderController : BaseController
|
|
|
urge.ReplyTime = DateTime.Now;
|
|
|
urge.State = 1;
|
|
|
if (dto.Files.Any()) await _fileRepository.AddFileAsync(dto.Files, urge.Id, HttpContext.RequestAborted);
|
|
|
- await _orderUrgeRepository.UpdateAsync(urge, HttpContext.RequestAborted);
|
|
|
+ await _orderUrgeRepository.UpdateAsync(urge, HttpContext.RequestAborted);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -950,7 +950,7 @@ public class OrderController : BaseController
|
|
|
var order = _mapper.Map<Order>(dto);
|
|
|
var orderNo = await _orderDomainService.AddAsync(order, HttpContext.RequestAborted);
|
|
|
if (dto.Files.Any()) await _fileRepository.AddFileAsync(dto.Files, orderNo, HttpContext.RequestAborted);
|
|
|
- return orderNo;
|
|
|
+ return orderNo;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -1068,7 +1068,7 @@ public class OrderController : BaseController
|
|
|
{
|
|
|
var rsp = new
|
|
|
{
|
|
|
- AcceptTypeOptions = EnumExts.GetDescriptions<EAcceptType>(),
|
|
|
+ AcceptTypeOptions = await _systemDomainService.GetSysDicDataByCodeAsync(SysDicTypeConsts.AcceptType),//EnumExts.GetDescriptions<EAcceptType>(),
|
|
|
ChannelOptions = _sysDicDataCacheManager.GetSysDicDataCache(TimeLimitBaseDataConsts.SourceChannel),
|
|
|
OrgsOptions = await _organizeRepository.GetOrgJson(),
|
|
|
EmergencyLevelOptions = EnumExts.GetDescriptions<EEmergencyLevel>(),
|
|
@@ -1088,7 +1088,7 @@ public class OrderController : BaseController
|
|
|
var rsp = new
|
|
|
{
|
|
|
ChannelOptions = _sysDicDataCacheManager.GetSysDicDataCache(TimeLimitBaseDataConsts.SourceChannel),
|
|
|
- AcceptTypeOptions = EnumExts.GetDescriptions<EAcceptType>(),
|
|
|
+ AcceptTypeOptions = await _systemDomainService.GetSysDicDataByCodeAsync(SysDicTypeConsts.AcceptType),
|
|
|
EmergencyLevelOptions = EnumExts.GetDescriptions<EEmergencyLevel>(),
|
|
|
PushTypeOptions = await _systemDomainService.GetSysDicDataByCodeAsync(SysDicTypeConsts.PushType),
|
|
|
GenderOptions = EnumExts.GetDescriptions<EGender>(),
|