|
@@ -100,7 +100,7 @@ public class OrderController : BaseController
|
|
|
private readonly ITypedCache<EnterpriseVo> _cacheResponse;
|
|
|
|
|
|
|
|
|
- public OrderController(
|
|
|
+ public OrderController(
|
|
|
IOrderDomainService orderDomainService,
|
|
|
IOrderRepository orderRepository,
|
|
|
IWorkflowApplication workflowApplication,
|
|
@@ -147,7 +147,7 @@ public class OrderController : BaseController
|
|
|
IPushDomainService pushDomainService,
|
|
|
ILogger<OrderController> logger,
|
|
|
ITypedCache<EnterpriseVo> cacheResponse
|
|
|
- )
|
|
|
+ )
|
|
|
{
|
|
|
_orderDomainService = orderDomainService;
|
|
|
_orderRepository = orderRepository;
|
|
@@ -195,16 +195,16 @@ public class OrderController : BaseController
|
|
|
_enterpriseService = enterpriseService;
|
|
|
_pushDomainService = pushDomainService;
|
|
|
_cacheResponse = cacheResponse;
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
- #region 工单发布
|
|
|
+ #region 工单发布
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// 查询(工单发布)
|
|
|
- /// </summary>
|
|
|
- /// <param name="dto"></param>
|
|
|
- /// <returns></returns>
|
|
|
- [HttpGet("publish")]
|
|
|
+ /// <summary>
|
|
|
+ /// 查询(工单发布)
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("publish")]
|
|
|
public async Task<PagedDto<PublishDto>> PublishOrderList([FromQuery] QueryOrderPublishDto dto)
|
|
|
{
|
|
|
var (total, items) = await _orderRepository.Queryable()
|
|
@@ -237,7 +237,7 @@ public class OrderController : BaseController
|
|
|
[Permission(EPermission.PublishOrder)]
|
|
|
[HttpPost("publish")]
|
|
|
[LogFilter("发布工单")]
|
|
|
- public async Task PublishOrder([FromBody] PublishOrderDto dto)
|
|
|
+ public async Task PublishOrder([FromBody] PublishOrderDto dto)
|
|
|
{
|
|
|
//验证订单
|
|
|
var order = await _orderRepository.GetAsync(dto.Id, HttpContext.RequestAborted);
|
|
@@ -417,7 +417,7 @@ public class OrderController : BaseController
|
|
|
[Permission(EPermission.PublishedModify)]
|
|
|
[HttpPost("published-order-modify")]
|
|
|
[LogFilter("修改发布内容")]
|
|
|
- public async Task PublishedModify([FromBody] PublishOrderModifyDto dto)
|
|
|
+ public async Task PublishedModify([FromBody] PublishOrderModifyDto dto)
|
|
|
{
|
|
|
var publishOrder = await _orderPublishRepository.GetAsync(dto.Id, HttpContext.RequestAborted);
|
|
|
|
|
@@ -566,7 +566,7 @@ public class OrderController : BaseController
|
|
|
[Permission(EPermission.Visit)]
|
|
|
[HttpPost("visit")]
|
|
|
[LogFilter("工单回访")]
|
|
|
- public async Task Visit([FromBody] VisitDto dto)
|
|
|
+ public async Task Visit([FromBody] VisitDto dto)
|
|
|
{
|
|
|
//var visit = await _orderVisitRepository.GetAsync(dto.Id, HttpContext.RequestAborted);
|
|
|
var visit = await _orderVisitRepository.Queryable()
|
|
@@ -618,8 +618,23 @@ public class OrderController : BaseController
|
|
|
if (first != null)
|
|
|
{
|
|
|
//推省上
|
|
|
- //_capPublisher.Publish(EventNames.HotlineOrderVisited,
|
|
|
- // new PublishVisitDto()
|
|
|
+ await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderVisited,
|
|
|
+ new PublishVisitDto()
|
|
|
+ {
|
|
|
+ Order = orderDto,
|
|
|
+ No = visit.No,
|
|
|
+ VisitType = visit.VisitType,
|
|
|
+ VisitName = visit.CreatorName,
|
|
|
+ VisitTime = visit.VisitTime,
|
|
|
+ VisitRemark = first.VisitContent,
|
|
|
+ AreaCode = visit.Order.AreaCode!,
|
|
|
+ SubjectResultSatifyCode = first.OrgProcessingResults.Key,
|
|
|
+ FirstSatisfactionCode = visit.Order.FirstVisitResultCode!,
|
|
|
+ ClientGuid = ""
|
|
|
+ }, cancellationToken: HttpContext.RequestAborted);
|
|
|
+ //try
|
|
|
+ //{
|
|
|
+ // await _provinceService.SubmitVisitInfo(new PublishVisitDto()
|
|
|
// {
|
|
|
// Order = orderDto,
|
|
|
// No = visit.No,
|
|
@@ -631,27 +646,12 @@ public class OrderController : BaseController
|
|
|
// SubjectResultSatifyCode = first.OrgProcessingResults.Key,
|
|
|
// FirstSatisfactionCode = visit.Order.FirstVisitResultCode!,
|
|
|
// ClientGuid = ""
|
|
|
- // });
|
|
|
- try
|
|
|
- {
|
|
|
- await _provinceService.SubmitVisitInfo(new PublishVisitDto()
|
|
|
- {
|
|
|
- Order = orderDto,
|
|
|
- No = visit.No,
|
|
|
- VisitType = visit.VisitType,
|
|
|
- VisitName = visit.CreatorName,
|
|
|
- VisitTime = visit.VisitTime,
|
|
|
- VisitRemark = first.VisitContent,
|
|
|
- AreaCode = visit.Order.AreaCode!,
|
|
|
- SubjectResultSatifyCode = first.OrgProcessingResults.Key,
|
|
|
- FirstSatisfactionCode = visit.Order.FirstVisitResultCode!,
|
|
|
- ClientGuid = ""
|
|
|
- }, HttpContext.RequestAborted);
|
|
|
- }
|
|
|
- catch (Exception e)
|
|
|
- {
|
|
|
- _logger.LogError("_provinceService.SubmitVisitInfo throw exception: {ex}", e.Message);
|
|
|
- }
|
|
|
+ // }, HttpContext.RequestAborted);
|
|
|
+ //}
|
|
|
+ //catch (Exception e)
|
|
|
+ //{
|
|
|
+ // _logger.LogError("_provinceService.SubmitVisitInfo throw exception: {ex}", e.Message);
|
|
|
+ //}
|
|
|
}
|
|
|
|
|
|
if (first != null)
|
|
@@ -730,7 +730,7 @@ public class OrderController : BaseController
|
|
|
[Permission(EPermission.ApplyOrderVisit)]
|
|
|
[HttpPost("visitapply/add")]
|
|
|
[LogFilter("新增工单二次回访申请")]
|
|
|
- public async Task ApplyOrderVisit([FromBody] AddVisitApplyDto dto)
|
|
|
+ public async Task ApplyOrderVisit([FromBody] AddVisitApplyDto dto)
|
|
|
{
|
|
|
var orderVisitApply = _mapper.Map<OrderVisitApply>(dto);
|
|
|
//验证是否可以申请二次回访
|
|
@@ -768,7 +768,7 @@ public class OrderController : BaseController
|
|
|
[Permission(EPermission.ExaminOrderVisit)]
|
|
|
[HttpPost("visitapply/examin")]
|
|
|
[LogFilter("新增工单二次回访审核")]
|
|
|
- public async Task ExaminOrderVisit([FromBody] ExaminOrderVisitDto dto)
|
|
|
+ public async Task ExaminOrderVisit([FromBody] ExaminOrderVisitDto dto)
|
|
|
{
|
|
|
//获取二次回访申请
|
|
|
var visitApplyModel = await _orderVisitApplyRepository.GetAsync(dto.Id, HttpContext.RequestAborted);
|
|
@@ -938,7 +938,7 @@ public class OrderController : BaseController
|
|
|
/// </summary>
|
|
|
[HttpPost("redo")]
|
|
|
[LogFilter("新增工单重办")]
|
|
|
- public async Task<string> AddRedo([FromBody] OrderRedoStartFlowDto dto)
|
|
|
+ public async Task<string> AddRedo([FromBody] OrderRedoStartFlowDto dto)
|
|
|
{
|
|
|
var redo = _mapper.Map<OrderRedo>(dto.Data);
|
|
|
redo.CreatorName = _sessionContext.UserName ?? string.Empty;
|
|
@@ -1020,7 +1020,7 @@ public class OrderController : BaseController
|
|
|
//[Permission(EPermission.ApplyDelay)]
|
|
|
[HttpPost("delay")]
|
|
|
[LogFilter("新增工单延期申请")]
|
|
|
- public async Task ApplyDelay([FromBody] DelayStartFlowDto dto)
|
|
|
+ public async Task ApplyDelay([FromBody] DelayStartFlowDto dto)
|
|
|
{
|
|
|
var delaydto = dto.Data;
|
|
|
|
|
@@ -1239,10 +1239,10 @@ public class OrderController : BaseController
|
|
|
}
|
|
|
if (dto.Status.HasValue && dto.Status == EScreenStatus.MyHandle)
|
|
|
{
|
|
|
- query.Where(x => (x.Status != EScreenStatus.Apply )
|
|
|
- && SqlFunc.JsonListObjectAny(x.Workflow.HandlerUsers, "Key",
|
|
|
- _sessionContext.RequiredUserId));
|
|
|
- }
|
|
|
+ query.Where(x => (x.Status != EScreenStatus.Apply)
|
|
|
+ && SqlFunc.JsonListObjectAny(x.Workflow.HandlerUsers, "Key",
|
|
|
+ _sessionContext.RequiredUserId));
|
|
|
+ }
|
|
|
var (total, items) = await query
|
|
|
//.WhereIF(dto.Status.HasValue && dto.Status == EScreenStatus.MyHandle,
|
|
|
// x => x.Status != EScreenStatus.Apply && x.CreatorId == _sessionContext.UserId)
|
|
@@ -1261,7 +1261,7 @@ public class OrderController : BaseController
|
|
|
[Permission(EPermission.ApplyScreen)]
|
|
|
[HttpPost("screen/startflow")]
|
|
|
[LogFilter("开始工单甄别流程")]
|
|
|
- public async Task StartFlow([FromBody] ScreenStartFlowDto dto)
|
|
|
+ public async Task StartFlow([FromBody] ScreenStartFlowDto dto)
|
|
|
{
|
|
|
var screenAny = await _orderScreenRepository.AnyAsync(x =>
|
|
|
x.VisitDetailId == dto.Data.VisitDetailId &&
|
|
@@ -1371,8 +1371,8 @@ public class OrderController : BaseController
|
|
|
rspModel.IsCanHandle = model.Workflow.CanHandle(_sessionContext.RequiredUserId, _sessionContext.RequiredOrgId);
|
|
|
if (rspModel.FileJson != null && rspModel.FileJson.Any())
|
|
|
{
|
|
|
- var ids = rspModel.FileJson.Select(x => x.Id).ToList();
|
|
|
- rspModel.Files = await _fileRepository.GetFilesAsync(ids, HttpContext.RequestAborted);
|
|
|
+ var ids = rspModel.FileJson.Select(x => x.Id).ToList();
|
|
|
+ rspModel.Files = await _fileRepository.GetFilesAsync(ids, HttpContext.RequestAborted);
|
|
|
}
|
|
|
return rspModel;
|
|
|
}
|
|
@@ -1411,7 +1411,7 @@ public class OrderController : BaseController
|
|
|
[Permission(EPermission.ApplySupervise)]
|
|
|
[HttpPost("supervise/apply")]
|
|
|
[LogFilter("新增工单督办")]
|
|
|
- public async Task ApplySupervise([FromBody] ApplyOrderSuperviseDto dto)
|
|
|
+ public async Task ApplySupervise([FromBody] ApplyOrderSuperviseDto dto)
|
|
|
{
|
|
|
if (!dto.SuperviseOrgDtos.Any())
|
|
|
throw UserFriendlyException.SameMessage("请选择被督办部门");
|
|
@@ -1447,25 +1447,25 @@ public class OrderController : BaseController
|
|
|
if (supervise != null)
|
|
|
{
|
|
|
var superviseDto = _mapper.Map<SuperviseOrderDto>(supervise);
|
|
|
- //_capPublisher.Publish(EventNames.HotlineOrderSuperviseCourse, new PublishSuperviseDto()
|
|
|
- //{
|
|
|
- // Order = orderDto,
|
|
|
- // Supervise = superviseDto,
|
|
|
- // ClientGuid = ""
|
|
|
- //});
|
|
|
- try
|
|
|
+ await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderSuperviseCourse, new PublishSuperviseDto()
|
|
|
{
|
|
|
- await _provinceService.SendSuperviseProcessInfo(new PublishSuperviseDto()
|
|
|
- {
|
|
|
- Order = orderDto,
|
|
|
- Supervise = superviseDto,
|
|
|
- ClientGuid = ""
|
|
|
- }, HttpContext.RequestAborted);
|
|
|
- }
|
|
|
- catch (Exception e)
|
|
|
- {
|
|
|
- _logger.LogError("_provinceService.SendSuperviseProcessInfo throw exception: {ex}", e.Message);
|
|
|
- }
|
|
|
+ Order = orderDto,
|
|
|
+ Supervise = superviseDto,
|
|
|
+ ClientGuid = ""
|
|
|
+ });
|
|
|
+ //try
|
|
|
+ //{
|
|
|
+ // await _provinceService.SendSuperviseProcessInfo(new PublishSuperviseDto()
|
|
|
+ // {
|
|
|
+ // Order = orderDto,
|
|
|
+ // Supervise = superviseDto,
|
|
|
+ // ClientGuid = ""
|
|
|
+ // }, HttpContext.RequestAborted);
|
|
|
+ //}
|
|
|
+ //catch (Exception e)
|
|
|
+ //{
|
|
|
+ // _logger.LogError("_provinceService.SendSuperviseProcessInfo throw exception: {ex}", e.Message);
|
|
|
+ //}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1478,7 +1478,7 @@ public class OrderController : BaseController
|
|
|
/// <returns></returns>
|
|
|
[HttpPost("supervise/reply")]
|
|
|
[LogFilter("回复工单督办")]
|
|
|
- public async Task ReplySupervise([FromBody] ReplyOrderSuperviseDto dto)
|
|
|
+ public async Task ReplySupervise([FromBody] ReplyOrderSuperviseDto dto)
|
|
|
{
|
|
|
//验证是否存在督办
|
|
|
var supervise = await _orderSuperviseRepository.GetAsync(dto.Id, HttpContext.RequestAborted);
|
|
@@ -1501,25 +1501,25 @@ public class OrderController : BaseController
|
|
|
{
|
|
|
var orderDto = _mapper.Map<OrderDto>(order);
|
|
|
var superviseDto = _mapper.Map<SuperviseOrderDto>(supervise);
|
|
|
- //_capPublisher.Publish(EventNames.HotlineOrderSuperviseCourse, new PublishSuperviseDto()
|
|
|
- //{
|
|
|
- // Order = orderDto,
|
|
|
- // Supervise = superviseDto,
|
|
|
- // ClientGuid = ""
|
|
|
- //});
|
|
|
- try
|
|
|
- {
|
|
|
- await _provinceService.SendSuperviseProcessInfo(new PublishSuperviseDto()
|
|
|
- {
|
|
|
- Order = orderDto,
|
|
|
- Supervise = superviseDto,
|
|
|
- ClientGuid = ""
|
|
|
- }, HttpContext.RequestAborted);
|
|
|
- }
|
|
|
- catch (Exception e)
|
|
|
+ await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderSuperviseCourse, new PublishSuperviseDto()
|
|
|
{
|
|
|
- _logger.LogError("_provinceService.SendSuperviseProcessInfo throw exception: {ex}", e.Message);
|
|
|
- }
|
|
|
+ Order = orderDto,
|
|
|
+ Supervise = superviseDto,
|
|
|
+ ClientGuid = ""
|
|
|
+ }, cancellationToken: HttpContext.RequestAborted);
|
|
|
+ //try
|
|
|
+ //{
|
|
|
+ // await _provinceService.SendSuperviseProcessInfo(new PublishSuperviseDto()
|
|
|
+ // {
|
|
|
+ // Order = orderDto,
|
|
|
+ // Supervise = superviseDto,
|
|
|
+ // ClientGuid = ""
|
|
|
+ // }, HttpContext.RequestAborted);
|
|
|
+ //}
|
|
|
+ //catch (Exception e)
|
|
|
+ //{
|
|
|
+ // _logger.LogError("_provinceService.SendSuperviseProcessInfo throw exception: {ex}", e.Message);
|
|
|
+ //}
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1529,8 +1529,8 @@ public class OrderController : BaseController
|
|
|
/// <param name="dto"></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost("supervise/sign")]
|
|
|
- [LogFilter("签收工单督办")]
|
|
|
- public async Task SignSupervise([FromBody] SignOrderSuperviseDto dto)
|
|
|
+ [LogFilter("签收工单督办")]
|
|
|
+ public async Task SignSupervise([FromBody] SignOrderSuperviseDto dto)
|
|
|
{
|
|
|
//验证是否存在督办
|
|
|
var supervise = await _orderSuperviseRepository.GetAsync(dto.Id, HttpContext.RequestAborted);
|
|
@@ -1546,25 +1546,25 @@ public class OrderController : BaseController
|
|
|
{
|
|
|
var orderDto = _mapper.Map<OrderDto>(order);
|
|
|
var superviseDto = _mapper.Map<SuperviseOrderDto>(supervise);
|
|
|
- //_capPublisher.Publish(EventNames.HotlineOrderSuperviseCourse, new PublishSuperviseDto()
|
|
|
- //{
|
|
|
- // Order = orderDto,
|
|
|
- // Supervise = superviseDto,
|
|
|
- // ClientGuid = ""
|
|
|
- //});
|
|
|
- try
|
|
|
+ await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderSuperviseCourse, new PublishSuperviseDto()
|
|
|
{
|
|
|
- await _provinceService.SendSuperviseProcessInfo(new PublishSuperviseDto()
|
|
|
- {
|
|
|
- Order = orderDto,
|
|
|
- Supervise = superviseDto,
|
|
|
- ClientGuid = ""
|
|
|
- }, HttpContext.RequestAborted);
|
|
|
- }
|
|
|
- catch (Exception e)
|
|
|
- {
|
|
|
- _logger.LogError("_provinceService.SendSuperviseProcessInfo throw exception: {ex}", e.Message);
|
|
|
- }
|
|
|
+ Order = orderDto,
|
|
|
+ Supervise = superviseDto,
|
|
|
+ ClientGuid = ""
|
|
|
+ }, cancellationToken: HttpContext.RequestAborted);
|
|
|
+ //try
|
|
|
+ //{
|
|
|
+ // await _provinceService.SendSuperviseProcessInfo(new PublishSuperviseDto()
|
|
|
+ // {
|
|
|
+ // Order = orderDto,
|
|
|
+ // Supervise = superviseDto,
|
|
|
+ // ClientGuid = ""
|
|
|
+ // }, HttpContext.RequestAborted);
|
|
|
+ //}
|
|
|
+ //catch (Exception e)
|
|
|
+ //{
|
|
|
+ // _logger.LogError("_provinceService.SendSuperviseProcessInfo throw exception: {ex}", e.Message);
|
|
|
+ //}
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1584,13 +1584,13 @@ public class OrderController : BaseController
|
|
|
if (orderSupervise != null)
|
|
|
{
|
|
|
orderSuperviseDto = _mapper.Map<OrderSuperviseDto>(orderSupervise);
|
|
|
- if (orderSuperviseDto.FileJson != null && orderSuperviseDto.FileJson.Any())
|
|
|
- {
|
|
|
- var ids = orderSuperviseDto.FileJson.Select(x => x.Id).ToList();
|
|
|
- var files = await _fileRepository.GetFilesAsync(ids, HttpContext.RequestAborted);
|
|
|
- orderSuperviseDto.Files = files.Where(x => x.Classify == "督办申请").ToList();
|
|
|
- orderSuperviseDto.ReplyFiles = files.Where(x => x.Classify == "督办回复").ToList();
|
|
|
- }
|
|
|
+ if (orderSuperviseDto.FileJson != null && orderSuperviseDto.FileJson.Any())
|
|
|
+ {
|
|
|
+ var ids = orderSuperviseDto.FileJson.Select(x => x.Id).ToList();
|
|
|
+ var files = await _fileRepository.GetFilesAsync(ids, HttpContext.RequestAborted);
|
|
|
+ orderSuperviseDto.Files = files.Where(x => x.Classify == "督办申请").ToList();
|
|
|
+ orderSuperviseDto.ReplyFiles = files.Where(x => x.Classify == "督办回复").ToList();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return orderSuperviseDto;
|
|
@@ -1630,7 +1630,7 @@ public class OrderController : BaseController
|
|
|
[Permission(EPermission.ApplyUrge)]
|
|
|
[HttpPost("urge/apply")]
|
|
|
[LogFilter("新增工单催办")]
|
|
|
- public async Task ApplyUrge([FromBody] ApplyOrderUrgeDto dto)
|
|
|
+ public async Task ApplyUrge([FromBody] ApplyOrderUrgeDto dto)
|
|
|
{
|
|
|
if (!dto.UrgeOrgDtos.Any())
|
|
|
throw UserFriendlyException.SameMessage("请选择被催办部门");
|
|
@@ -1683,7 +1683,7 @@ public class OrderController : BaseController
|
|
|
/// <returns></returns>
|
|
|
[HttpPost("urge/reply")]
|
|
|
[LogFilter("回复工单催办")]
|
|
|
- public async Task ReplyUrge([FromBody] ReplyOrderUrgeDto dto)
|
|
|
+ public async Task ReplyUrge([FromBody] ReplyOrderUrgeDto dto)
|
|
|
{
|
|
|
//验证是否存在催办
|
|
|
var urge = await _orderUrgeRepository.GetAsync(dto.Id, HttpContext.RequestAborted);
|
|
@@ -1710,7 +1710,7 @@ public class OrderController : BaseController
|
|
|
/// <returns></returns>
|
|
|
[HttpPost("urge/sign")]
|
|
|
[LogFilter("签收工单催办")]
|
|
|
- public async Task SignUrge([FromBody] SignOrderUrgeDto dto)
|
|
|
+ public async Task SignUrge([FromBody] SignOrderUrgeDto dto)
|
|
|
{
|
|
|
//验证是否存在催办
|
|
|
var urge = await _orderUrgeRepository.GetAsync(dto.Id, HttpContext.RequestAborted);
|
|
@@ -1740,10 +1740,10 @@ public class OrderController : BaseController
|
|
|
orderUrgeDto = _mapper.Map<OrderUrgeDto>(orderUrge);
|
|
|
if (orderUrgeDto.FileJson != null && orderUrgeDto.FileJson.Any())
|
|
|
{
|
|
|
- var ids = orderUrgeDto.FileJson.Select(x => x.Id).ToList();
|
|
|
- orderUrgeDto.Files = await _fileRepository.GetFilesAsync(ids, HttpContext.RequestAborted);
|
|
|
+ var ids = orderUrgeDto.FileJson.Select(x => x.Id).ToList();
|
|
|
+ orderUrgeDto.Files = await _fileRepository.GetFilesAsync(ids, HttpContext.RequestAborted);
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
return orderUrgeDto;
|
|
|
}
|
|
@@ -1858,10 +1858,10 @@ public class OrderController : BaseController
|
|
|
|
|
|
if (dto.FileJson != null && dto.FileJson.Any())
|
|
|
{
|
|
|
- var ids = order.FileJson.Select(x => x.Id).ToList();
|
|
|
- var files = await _fileRepository.GetFilesAsync(ids, HttpContext.RequestAborted);
|
|
|
+ var ids = order.FileJson.Select(x => x.Id).ToList();
|
|
|
+ var files = await _fileRepository.GetFilesAsync(ids, HttpContext.RequestAborted);
|
|
|
dto.Files = files.Where(x => x.Classify == "办理上传" && string.IsNullOrEmpty(x.FlowKey)).ToList();
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
var call = await _trCallRecordRepository.Queryable().Where(x => x.CallAccept == order.CallId).FirstAsync();
|
|
|
if (call != null) dto.RecordingFileUrl = call.RecordingFileUrl;
|
|
@@ -1884,11 +1884,11 @@ public class OrderController : BaseController
|
|
|
[Permission(EPermission.OrderAdd)]
|
|
|
[HttpPost]
|
|
|
[LogFilter("新增工单")]
|
|
|
- public async Task<string> Add([FromBody] AddOrderDto dto)
|
|
|
+ public async Task<string> Add([FromBody] AddOrderDto dto)
|
|
|
{
|
|
|
//todo dto validation
|
|
|
|
|
|
- if(!string.IsNullOrEmpty(dto.CallId))
|
|
|
+ if (!string.IsNullOrEmpty(dto.CallId))
|
|
|
{
|
|
|
var exists = await _orderRepository.AnyAsync(d => d.CallId == dto.CallId, HttpContext.RequestAborted);
|
|
|
if (exists)
|
|
@@ -1950,7 +1950,7 @@ public class OrderController : BaseController
|
|
|
/// <returns></returns>
|
|
|
[HttpDelete("{id}")]
|
|
|
[LogFilter("删除工单")]
|
|
|
- public async Task Remove(string id)
|
|
|
+ public async Task Remove(string id)
|
|
|
{
|
|
|
var order = await _orderRepository.GetAsync(id, HttpContext.RequestAborted);
|
|
|
if (order == null) return;
|
|
@@ -1967,7 +1967,7 @@ public class OrderController : BaseController
|
|
|
[Permission(EPermission.OrderUpdate)]
|
|
|
[HttpPut]
|
|
|
[LogFilter("更新工单")]
|
|
|
- public async Task Update([FromBody] UpdateOrderDto dto)
|
|
|
+ public async Task Update([FromBody] UpdateOrderDto dto)
|
|
|
{
|
|
|
var order = await _orderRepository.Queryable()
|
|
|
.FirstAsync(d => d.Id == dto.Id);
|
|
@@ -2265,7 +2265,7 @@ public class OrderController : BaseController
|
|
|
[Permission(EPermission.ApplySendBack)]
|
|
|
[HttpPost("send_back/apply")]
|
|
|
[LogFilter("新增工单退回申请")]
|
|
|
- public async Task ApplyUrge([FromBody] OrderSendBackAddDto dto)
|
|
|
+ public async Task ApplyUrge([FromBody] OrderSendBackAddDto dto)
|
|
|
{
|
|
|
//验证工单是否可以申请
|
|
|
var order = await _orderRepository.GetAsync(dto.OrderId, HttpContext.RequestAborted);
|
|
@@ -2297,7 +2297,7 @@ public class OrderController : BaseController
|
|
|
[Permission(EPermission.AuditSendBack)]
|
|
|
[HttpPost("send_back/audit")]
|
|
|
[LogFilter("审核工单退回申请")]
|
|
|
- public async Task ReplyUrge([FromBody] AuditOrderSendBackDto dto)
|
|
|
+ public async Task ReplyUrge([FromBody] AuditOrderSendBackDto dto)
|
|
|
{
|
|
|
//验证是否存在退回
|
|
|
var sendBack = await _orderSendBackRepository.GetAsync(dto.Id, HttpContext.RequestAborted);
|
|
@@ -2316,18 +2316,18 @@ public class OrderController : BaseController
|
|
|
var order = await _orderRepository.GetAsync(sendBack.OrderId);
|
|
|
var sendBackDto = _mapper.Map<OrderSendBackDto>(sendBack);
|
|
|
var OrderDto = _mapper.Map<OrderDto>(order);
|
|
|
- //_capPublisher.Publish(EventNames.HotlineOrderSendBackApplyed,
|
|
|
- // new PublishOrderSendBackDto() { Order = OrderDto, SendBack = sendBackDto, ClientGuid = "" });
|
|
|
- try
|
|
|
- {
|
|
|
- await _provinceService.GetCaseBackApply(
|
|
|
- new PublishOrderSendBackDto { Order = OrderDto, SendBack = sendBackDto, ClientGuid = "" },
|
|
|
- HttpContext.RequestAborted);
|
|
|
- }
|
|
|
- catch (Exception e)
|
|
|
- {
|
|
|
- _logger.LogError("_provinceService.GetCaseBackApply throw exception: {ex}", e.Message);
|
|
|
- }
|
|
|
+ await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderFlowPrevious,
|
|
|
+ new PublishOrderSendBackDto() { Order = OrderDto, SendBack = sendBackDto, ClientGuid = "" });
|
|
|
+ //try
|
|
|
+ //{
|
|
|
+ // await _provinceService.GetCaseBackApply(
|
|
|
+ // new PublishOrderSendBackDto { Order = OrderDto, SendBack = sendBackDto, ClientGuid = "" },
|
|
|
+ // HttpContext.RequestAborted);
|
|
|
+ //}
|
|
|
+ //catch (Exception e)
|
|
|
+ //{
|
|
|
+ // _logger.LogError("_provinceService.GetCaseBackApply throw exception: {ex}", e.Message);
|
|
|
+ //}
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2356,7 +2356,7 @@ public class OrderController : BaseController
|
|
|
[Permission(EPermission.ApplySpecial)]
|
|
|
[HttpPost("special")]
|
|
|
[LogFilter("新增工单特提")]
|
|
|
- public async Task Add([FromBody] OrderSpecialAddDto dto)
|
|
|
+ public async Task Add([FromBody] OrderSpecialAddDto dto)
|
|
|
{
|
|
|
var specialAny = await _orderSpecialRepository.Queryable().Where(x => x.OrderId == dto.OrderId && x.State == 0)
|
|
|
.AnyAsync();
|
|
@@ -2365,7 +2365,7 @@ public class OrderController : BaseController
|
|
|
var screen = await _orderScreenRepository.Queryable().Where(x => x.OrderId == dto.OrderId && (int)x.Status < 2).AnyAsync();
|
|
|
if (screen) throw UserFriendlyException.SameMessage("工单存在甄别中的信息!");
|
|
|
|
|
|
- var model = _mapper.Map<OrderSpecial>(dto);
|
|
|
+ var model = _mapper.Map<OrderSpecial>(dto);
|
|
|
model.OrgId = _sessionContext.OrgId;
|
|
|
model.OrgName = _sessionContext.OrgName;
|
|
|
if (!dto.Audit) model.State = 1;
|
|
@@ -2398,7 +2398,7 @@ public class OrderController : BaseController
|
|
|
publishHistory.ArrangeContentBefor = publish.ArrangeContent;
|
|
|
publishHistory.ArrangeOpinionAfter = publish.ArrangeOpinion;
|
|
|
publishHistory.ArrangeOpinionBefor = publish.ArrangeOpinion;
|
|
|
- await _orderPublishHistoryRepository.AddAsync(publishHistory, HttpContext.RequestAborted);
|
|
|
+ await _orderPublishHistoryRepository.AddAsync(publishHistory, HttpContext.RequestAborted);
|
|
|
await _orderPublishRepository.RemoveAsync(publish, false, HttpContext.RequestAborted);
|
|
|
}
|
|
|
|
|
@@ -2413,17 +2413,20 @@ public class OrderController : BaseController
|
|
|
if (order != null && ("001170".Equals(order.CurrentHandleOrgCode) ||
|
|
|
"001180".Equals(order.CurrentHandleOrgCode)))
|
|
|
{
|
|
|
- try
|
|
|
- {
|
|
|
- await _provinceService.RevokeOrder(
|
|
|
- new PublishSpecialDto
|
|
|
- { Order = _mapper.Map<OrderDto>(order), Special = _mapper.Map<OrderSpecialDto>(model) },
|
|
|
- HttpContext.RequestAborted);
|
|
|
- }
|
|
|
- catch (Exception e)
|
|
|
- {
|
|
|
- _logger.LogError("_provinceService.RevokeOrder throw exception: {ex}", e.Message);
|
|
|
- }
|
|
|
+ await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderFlowRecalled,
|
|
|
+ new PublishSpecialDto { Order = _mapper.Map<OrderDto>(order), Special = _mapper.Map<OrderSpecialDto>(model) }, cancellationToken: HttpContext.RequestAborted);
|
|
|
+
|
|
|
+ //try
|
|
|
+ //{
|
|
|
+ // await _provinceService.RevokeOrder(
|
|
|
+ // new PublishSpecialDto
|
|
|
+ // { Order = _mapper.Map<OrderDto>(order), Special = _mapper.Map<OrderSpecialDto>(model) },
|
|
|
+ // HttpContext.RequestAborted);
|
|
|
+ //}
|
|
|
+ //catch (Exception e)
|
|
|
+ //{
|
|
|
+ // _logger.LogError("_provinceService.RevokeOrder throw exception: {ex}", e.Message);
|
|
|
+ //}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -2436,7 +2439,7 @@ public class OrderController : BaseController
|
|
|
[Permission(EPermission.AuditSpecial)]
|
|
|
[HttpPut("special")]
|
|
|
[LogFilter("审批工单特提")]
|
|
|
- public async Task Update([FromBody] AuditOrderSpecialDto dto)
|
|
|
+ public async Task Update([FromBody] AuditOrderSpecialDto dto)
|
|
|
{
|
|
|
var special = await _orderSpecialRepository.GetAsync(dto.Id);
|
|
|
if (special is null) throw UserFriendlyException.SameMessage("无效特提审批信息!");
|
|
@@ -2471,7 +2474,7 @@ public class OrderController : BaseController
|
|
|
publishHistory.ArrangeContentBefor = publish.ArrangeContent;
|
|
|
publishHistory.ArrangeOpinionAfter = publish.ArrangeOpinion;
|
|
|
publishHistory.ArrangeOpinionBefor = publish.ArrangeOpinion;
|
|
|
- await _orderPublishHistoryRepository.AddAsync(publishHistory, HttpContext.RequestAborted);
|
|
|
+ await _orderPublishHistoryRepository.AddAsync(publishHistory, HttpContext.RequestAborted);
|
|
|
await _orderPublishRepository.RemoveAsync(publish, false, HttpContext.RequestAborted);
|
|
|
}
|
|
|
|
|
@@ -2486,17 +2489,20 @@ public class OrderController : BaseController
|
|
|
if (order != null && ("001170".Equals(order.CurrentHandleOrgCode) ||
|
|
|
"001180".Equals(order.CurrentHandleOrgCode)))
|
|
|
{
|
|
|
- try
|
|
|
- {
|
|
|
- await _provinceService.RevokeOrder(
|
|
|
- new PublishSpecialDto
|
|
|
- { Order = _mapper.Map<OrderDto>(order), Special = _mapper.Map<OrderSpecialDto>(special) },
|
|
|
- HttpContext.RequestAborted);
|
|
|
- }
|
|
|
- catch (Exception e)
|
|
|
- {
|
|
|
- _logger.LogError("_provinceService.RevokeOrder throw exception: {ex}", e.Message);
|
|
|
- }
|
|
|
+ await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderFlowRecalled,
|
|
|
+ new PublishSpecialDto { Order = _mapper.Map<OrderDto>(order), Special = _mapper.Map<OrderSpecialDto>(special) }, cancellationToken: HttpContext.RequestAborted);
|
|
|
+
|
|
|
+ //try
|
|
|
+ //{
|
|
|
+ // await _provinceService.RevokeOrder(
|
|
|
+ // new PublishSpecialDto
|
|
|
+ // { Order = _mapper.Map<OrderDto>(order), Special = _mapper.Map<OrderSpecialDto>(special) },
|
|
|
+ // HttpContext.RequestAborted);
|
|
|
+ //}
|
|
|
+ //catch (Exception e)
|
|
|
+ //{
|
|
|
+ // _logger.LogError("_provinceService.RevokeOrder throw exception: {ex}", e.Message);
|
|
|
+ //}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -2581,10 +2587,10 @@ public class OrderController : BaseController
|
|
|
itemDto = _mapper.Map<OrderSpecialDto>(item);
|
|
|
if (itemDto.FileJson != null && itemDto.FileJson.Any())
|
|
|
{
|
|
|
- var ids = itemDto.FileJson.Select(x => x.Id).ToList();
|
|
|
- itemDto.Files = await _fileRepository.GetFilesAsync(ids, HttpContext.RequestAborted);
|
|
|
+ var ids = itemDto.FileJson.Select(x => x.Id).ToList();
|
|
|
+ itemDto.Files = await _fileRepository.GetFilesAsync(ids, HttpContext.RequestAborted);
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
return itemDto;
|
|
|
}
|
|
@@ -2616,7 +2622,7 @@ public class OrderController : BaseController
|
|
|
/// <returns></returns>
|
|
|
[HttpPost("citizen")]
|
|
|
[LogFilter("新增市民信息")]
|
|
|
- public async Task Add([FromBody] CitizenAddDto dto)
|
|
|
+ public async Task Add([FromBody] CitizenAddDto dto)
|
|
|
{
|
|
|
var citizen =
|
|
|
await _citizenRepository.CountAsync(x => x.PhoneNumber == dto.PhoneNumber, HttpContext.RequestAborted);
|
|
@@ -2633,7 +2639,7 @@ public class OrderController : BaseController
|
|
|
[Permission(EPermission.DeleteCitizen)]
|
|
|
[HttpDelete("citizen")]
|
|
|
[LogFilter("删除市民信息")]
|
|
|
- public async Task Delete([FromBody] CitizenDeleteDto dto)
|
|
|
+ public async Task Delete([FromBody] CitizenDeleteDto dto)
|
|
|
{
|
|
|
await _citizenRepository.RemoveAsync(x => x.Id == dto.Id);
|
|
|
}
|
|
@@ -2646,7 +2652,7 @@ public class OrderController : BaseController
|
|
|
[Permission(EPermission.UpdateCitizen)]
|
|
|
[HttpPut("citizen")]
|
|
|
[LogFilter("更新市民信息")]
|
|
|
- public async Task Update([FromBody] CitizenUpdateDto dto)
|
|
|
+ public async Task Update([FromBody] CitizenUpdateDto dto)
|
|
|
{
|
|
|
var citizen = await _citizenRepository.GetAsync(dto.Id, HttpContext.RequestAborted);
|
|
|
if (citizen is null)
|
|
@@ -2792,7 +2798,7 @@ public class OrderController : BaseController
|
|
|
/// <returns></returns>
|
|
|
[HttpPost("repeatable_event")]
|
|
|
[LogFilter("新增重复性事件")]
|
|
|
- public async Task Add([FromBody] RepeatableEventAddDto dto)
|
|
|
+ public async Task Add([FromBody] RepeatableEventAddDto dto)
|
|
|
{
|
|
|
var repeatable = _mapper.Map<RepeatableEvent>(dto);
|
|
|
var repeatableId = await _repeatableEventRepository.AddAsync(repeatable, HttpContext.RequestAborted);
|
|
@@ -2811,7 +2817,7 @@ public class OrderController : BaseController
|
|
|
/// <returns></returns>
|
|
|
[HttpDelete("repeatable_event")]
|
|
|
[LogFilter("删除重复性事件")]
|
|
|
- public async Task Delete([FromBody] RepeatableEventDeleteDto dto)
|
|
|
+ public async Task Delete([FromBody] RepeatableEventDeleteDto dto)
|
|
|
{
|
|
|
await _repeatableEventRepository.RemoveAsync(x => x.Id == dto.Id);
|
|
|
await _repeatableEventDetailRepository.RemoveAsync(x => x.RepeatableId == dto.Id);
|
|
@@ -2824,7 +2830,7 @@ public class OrderController : BaseController
|
|
|
/// <returns></returns>
|
|
|
[HttpDelete("repeatable_event_detail/{id}")]
|
|
|
[LogFilter("删除重复性事件")]
|
|
|
- public async Task Delete([FromBody] string id)
|
|
|
+ public async Task Delete([FromBody] string id)
|
|
|
{
|
|
|
await _repeatableEventDetailRepository.RemoveAsync(x => x.Id == id);
|
|
|
}
|
|
@@ -2837,7 +2843,7 @@ public class OrderController : BaseController
|
|
|
[Permission(EPermission.UpdateRepeatableEvent)]
|
|
|
[HttpPut("repeatable_event")]
|
|
|
[LogFilter("更新重复性事件")]
|
|
|
- public async Task Update([FromBody] RepeatableEventUpdateDto dto)
|
|
|
+ public async Task Update([FromBody] RepeatableEventUpdateDto dto)
|
|
|
{
|
|
|
var repeatable = await _repeatableEventRepository.GetAsync(dto.Id, HttpContext.RequestAborted);
|
|
|
if (repeatable is null)
|
|
@@ -2905,7 +2911,7 @@ public class OrderController : BaseController
|
|
|
[Permission(EPermission.AddOrderWord)]
|
|
|
[HttpPost("order_word")]
|
|
|
[LogFilter("新增工单词库")]
|
|
|
- public async Task Add([FromBody] OrderWordAddDto dto)
|
|
|
+ public async Task Add([FromBody] OrderWordAddDto dto)
|
|
|
{
|
|
|
var word = _mapper.Map<OrderWord>(dto);
|
|
|
await _orderWrodRepository.AddAsync(word, HttpContext.RequestAborted);
|
|
@@ -2919,7 +2925,7 @@ public class OrderController : BaseController
|
|
|
[Permission(EPermission.DeleteOrderWord)]
|
|
|
[HttpDelete("order_word")]
|
|
|
[LogFilter("删除工单词库")]
|
|
|
- public async Task Delete([FromBody] OrderWordDeleteDto dto)
|
|
|
+ public async Task Delete([FromBody] OrderWordDeleteDto dto)
|
|
|
{
|
|
|
await _orderRepository.RemoveOrderWrodBatchAsync(dto.Ids, HttpContext.RequestAborted);
|
|
|
}
|
|
@@ -2932,7 +2938,7 @@ public class OrderController : BaseController
|
|
|
[Permission(EPermission.UpdateOrderWord)]
|
|
|
[HttpPut("order_word")]
|
|
|
[LogFilter("更新工单词库")]
|
|
|
- public async Task Update([FromBody] OrderWordUpdateDto dto)
|
|
|
+ public async Task Update([FromBody] OrderWordUpdateDto dto)
|
|
|
{
|
|
|
var word = await _orderWrodRepository.GetAsync(dto.Id, HttpContext.RequestAborted);
|
|
|
if (word is null)
|
|
@@ -2998,7 +3004,7 @@ public class OrderController : BaseController
|
|
|
[Permission(EPermission.AddOrderObserve)]
|
|
|
[HttpPost("order_observe")]
|
|
|
[LogFilter("新增工单观察")]
|
|
|
- public async Task Add([FromBody] OrderObserveAddDto dto)
|
|
|
+ public async Task Add([FromBody] OrderObserveAddDto dto)
|
|
|
{
|
|
|
var ids = dto.OrderIds.Select(x => x.OrderId).ToList();
|
|
|
var list = await _orderObserveRepository.Queryable().In(x => x.OrderId, ids).Select(x => x.OrderId)
|
|
@@ -3018,7 +3024,7 @@ public class OrderController : BaseController
|
|
|
/// <returns></returns>
|
|
|
[HttpDelete("order_observe")]
|
|
|
[LogFilter("删除工单观察")]
|
|
|
- public async Task Delete([FromBody] OrderObserveDeleteDto dto)
|
|
|
+ public async Task Delete([FromBody] OrderObserveDeleteDto dto)
|
|
|
{
|
|
|
await _orderRepository.RemoveOrderObserveBatchAsync(dto.Ids, HttpContext.RequestAborted);
|
|
|
}
|
|
@@ -3030,7 +3036,7 @@ public class OrderController : BaseController
|
|
|
/// <returns></returns>
|
|
|
[HttpPut("order_observe")]
|
|
|
[LogFilter("更新工单观察")]
|
|
|
- public async Task Update([FromBody] OrderObserveUpdateDto dto)
|
|
|
+ public async Task Update([FromBody] OrderObserveUpdateDto dto)
|
|
|
{
|
|
|
var word = await _orderObserveRepository.GetAsync(dto.Id, HttpContext.RequestAborted);
|
|
|
if (word is null)
|
|
@@ -3083,7 +3089,7 @@ public class OrderController : BaseController
|
|
|
[Permission(EPermission.AddOrderFinality)]
|
|
|
[HttpPost("order_finality")]
|
|
|
[LogFilter("新增工单终结")]
|
|
|
- public async Task Add([FromBody] OrderFinalityAddDto dto)
|
|
|
+ public async Task Add([FromBody] OrderFinalityAddDto dto)
|
|
|
{
|
|
|
var ids = dto.OrderIds.Select(x => x.OrderId).ToList();
|
|
|
var list = await _orderFinalityRepository.Queryable().In(x => x.OrderId, ids).Select(x => x.OrderId)
|
|
@@ -3103,7 +3109,7 @@ public class OrderController : BaseController
|
|
|
/// <returns></returns>
|
|
|
[HttpDelete("order_finality")]
|
|
|
[LogFilter("删除工单终结")]
|
|
|
- public async Task Delete([FromBody] OrderFinalityDeleteDto dto)
|
|
|
+ public async Task Delete([FromBody] OrderFinalityDeleteDto dto)
|
|
|
{
|
|
|
await _orderRepository.RemoveOrderFinalityBatchAsync(dto.Ids, HttpContext.RequestAborted);
|
|
|
}
|
|
@@ -3115,7 +3121,7 @@ public class OrderController : BaseController
|
|
|
/// <returns></returns>
|
|
|
[HttpPut("order_finality")]
|
|
|
[LogFilter("更新工单终结")]
|
|
|
- public async Task Update([FromBody] OrderFinalityUpdateDto dto)
|
|
|
+ public async Task Update([FromBody] OrderFinalityUpdateDto dto)
|
|
|
{
|
|
|
var word = await _orderFinalityRepository.GetAsync(dto.Id, HttpContext.RequestAborted);
|
|
|
if (word is null)
|
|
@@ -3213,7 +3219,7 @@ public class OrderController : BaseController
|
|
|
/// </summary>
|
|
|
[HttpPost("sign/{orderId}")]
|
|
|
[LogFilter("工单签收")]
|
|
|
- public async Task Sign(string orderId)
|
|
|
+ public async Task Sign(string orderId)
|
|
|
{
|
|
|
var order = await _orderRepository.GetAsync(orderId, HttpContext.RequestAborted);
|
|
|
if (order == null)
|