|
@@ -240,6 +240,7 @@ public class OrderController : BaseController
|
|
|
orderVisit.OrderId = order.Id;
|
|
|
orderVisit.VisitState = EVisitState.WaitForVisit;
|
|
|
orderVisit.PublishTime = DateTime.Now;
|
|
|
+ orderVisit.IsCanHandle = true;
|
|
|
string visitId = await _orderVisitRepository.AddAsync(orderVisit);
|
|
|
|
|
|
//新增回访信息
|
|
@@ -634,13 +635,13 @@ public class OrderController : BaseController
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.Keyword), x => x.OrderVisit.Order.No.Contains(dto.Keyword))
|
|
|
.Where(x => x.OrderVisit.VisitState == EVisitState.Visited && (x.OrderVisit.VisitType == EVisitType.SmsVisit || x.OrderVisit.VisitType == EVisitType.ChipVoiceVisit))
|
|
|
.Where(x => SqlFunc.JsonField(x.OrgProcessingResults, "Key") == "1" || SqlFunc.JsonField(x.OrgProcessingResults, "Key") == "2")
|
|
|
+ .Where(x => x.OrderVisit.IsCanHandle)
|
|
|
.Where(x => x.VisitTarget == EVisitTarget.Org)
|
|
|
.OrderByDescending(x => x.OrderVisit.VisitTime)
|
|
|
.ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
|
return new PagedDto<OrderCanVisitAgainDto>(total, _mapper.Map<IReadOnlyList<OrderCanVisitAgainDto>>(items));
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/// <summary>
|
|
|
/// 二次回访申请
|
|
|
/// </summary>
|
|
@@ -662,6 +663,14 @@ public class OrderController : BaseController
|
|
|
if (orderModel?.CounterSignType != null)
|
|
|
throw UserFriendlyException.SameMessage("会签件不能申请二次回访");
|
|
|
|
|
|
+ var orderVisitModel = await _orderVisitRepository.GetAsync(x => x.Id == dto.OrderVisitId && x.IsCanHandle, HttpContext.RequestAborted);
|
|
|
+ if (orderVisitModel == null)
|
|
|
+ throw UserFriendlyException.SameMessage("当前状态不能进行二次回访");
|
|
|
+
|
|
|
+
|
|
|
+ orderVisitModel.IsCanHandle = false;
|
|
|
+ await _orderVisitRepository.UpdateAsync(orderVisitModel, HttpContext.RequestAborted);
|
|
|
+
|
|
|
orderVisitApply.EmployeeId = _sessionContext.RequiredUserId;
|
|
|
orderVisitApply.VisitApplyState = EVisitApplyState.Examining;
|
|
|
await _orderVisitApplyRepository.AddAsync(orderVisitApply, HttpContext.RequestAborted);
|
|
@@ -715,6 +724,7 @@ public class OrderController : BaseController
|
|
|
visitModelNew.CreatorOrgLevel = 0;
|
|
|
visitModelNew.AreaId = string.Empty;
|
|
|
visitModelNew.VisitState = EVisitState.WaitForVisit;
|
|
|
+ visitModelNew.IsCanHandle = false;
|
|
|
|
|
|
var id = await _orderVisitRepository.AddAsync(visitModelNew, HttpContext.RequestAborted);
|
|
|
var visitModelDetail = await _orderVisitedDetailRepository.Queryable().Where(x => x.VisitId == visitModel.Id).ToListAsync(HttpContext.RequestAborted);
|
|
@@ -741,6 +751,12 @@ public class OrderController : BaseController
|
|
|
visitApplyModel.ExaminOpinion = dto.ExaminOpinion;
|
|
|
visitApplyModel.ExaminTime = DateTime.Now;
|
|
|
await _orderVisitApplyRepository.UpdateAsync(visitApplyModel, HttpContext.RequestAborted);
|
|
|
+ var visitModel = await _orderVisitRepository.GetAsync(visitApplyModel.OrderVisitId, HttpContext.RequestAborted);
|
|
|
+ if (visitModel!=null)
|
|
|
+ {
|
|
|
+ visitModel.IsCanHandle = true;
|
|
|
+ await _orderVisitRepository.UpdateAsync(visitModel, HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -919,7 +935,11 @@ public class OrderController : BaseController
|
|
|
[HttpPost("delay")]
|
|
|
public async Task ApplyDelay([FromBody] DelayStartFlowDto dto)
|
|
|
{
|
|
|
- var delaydto = _mapper.Map<ApplyDelayDto>(dto.Data);
|
|
|
+ var delaydto = dto.Data;
|
|
|
+
|
|
|
+ if (string.IsNullOrEmpty(dto.Workflow.Opinion))
|
|
|
+ throw UserFriendlyException.SameMessage("办理意见不能为空!");
|
|
|
+
|
|
|
//验证工单是否可以申请
|
|
|
var order = await _orderRepository.GetAsync(delaydto.OrderId, HttpContext.RequestAborted);
|
|
|
if (order is null)
|
|
@@ -943,6 +963,9 @@ public class OrderController : BaseController
|
|
|
model.ApplyOrgCode = _sessionContext.OrgId;
|
|
|
model.BeforeDelay = order.ExpiredTime;
|
|
|
model.DelayState = EDelayState.Examining;
|
|
|
+ model.DelayReason = dto.Workflow.Opinion;
|
|
|
+ model.FileIds = dto.Workflow.Additions;
|
|
|
+
|
|
|
if (model.BeforeDelay != null)
|
|
|
{
|
|
|
model.AfterDelay = _timeLimitDomainService.CalcEndTime(model.BeforeDelay.Value, delaydto.DelayUnit, delaydto.DelayNum, false)?.EndTime;//todo
|
|
@@ -1269,16 +1292,60 @@ public class OrderController : BaseController
|
|
|
return rspModel;
|
|
|
}
|
|
|
|
|
|
- #endregion
|
|
|
-
|
|
|
- #region 工单督办
|
|
|
-
|
|
|
/// <summary>
|
|
|
- /// 工单督办列表
|
|
|
- /// </summary>
|
|
|
- /// <param name="dto"></param>
|
|
|
- /// <returns></returns>
|
|
|
- [Permission(EPermission.SuperviseOrderList)]
|
|
|
+ /// 省工单督办结果
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("screen/province/result")]
|
|
|
+ public async Task ScreenProvinceResultAsync([FromBody] ProvinceScreenResult dto)
|
|
|
+ {
|
|
|
+ var orderScreen = await _orderScreenRepository.Queryable()
|
|
|
+ .Includes(d => d.Order)
|
|
|
+ .Includes(d => d.Workflow)
|
|
|
+ .FirstAsync(d => d.Order.ProvinceNo == dto.CaseSerial && d.Status == EScreenStatus.Approval,
|
|
|
+ HttpContext.RequestAborted);
|
|
|
+ if (orderScreen is null)
|
|
|
+ throw new UserFriendlyException("无效省工单编号");
|
|
|
+ var pass = "1".Equals(dto.AuditResult);
|
|
|
+ if (pass)
|
|
|
+ {
|
|
|
+ var nextDtos =
|
|
|
+ await _workflowApplication.GetNextStepsAsync(orderScreen.WorkflowId, HttpContext.RequestAborted);
|
|
|
+ var nextStep = nextDtos.Steps.FirstOrDefault(d => d.Key == "end");
|
|
|
+ if (nextStep is null)
|
|
|
+ throw new UserFriendlyException("未查询到结束节点");
|
|
|
+
|
|
|
+ var nextDto = new NextWorkflowDto
|
|
|
+ {
|
|
|
+ WorkflowId = orderScreen.WorkflowId,
|
|
|
+ NextStepCode = nextStep.Key,
|
|
|
+ NextStepName = nextStep.Value,
|
|
|
+ NextMainHandler = nextStep.Key,
|
|
|
+ Opinion = dto.AuditOpinion
|
|
|
+ };
|
|
|
+ await _workflowApplication.NextAsync(nextDto, HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var rejectDto = new RejectDto
|
|
|
+ {
|
|
|
+ WorkflowId = orderScreen.WorkflowId,
|
|
|
+ Opinion = dto.AuditOpinion,
|
|
|
+ };
|
|
|
+ await _workflowApplication.RejectAsync(rejectDto, HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 工单督办
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 工单督办列表
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [Permission(EPermission.SuperviseOrderList)]
|
|
|
[HttpGet("supervise")]
|
|
|
public async Task<PagedDto<SuperviseOrderDto>> SuperviseList([FromQuery] SuperviseListDto dto)
|
|
|
{
|
|
@@ -1316,7 +1383,7 @@ public class OrderController : BaseController
|
|
|
var model = _mapper.Map<OrderSupervise>(dto);
|
|
|
model.OrgId = item.OrgId;
|
|
|
model.OrgName = item.OrgName;
|
|
|
- model.CreatorOrgName = _sessionContext.OrgName;
|
|
|
+ model.LaunchOrgName = _sessionContext.OrgName;
|
|
|
model.CrUser = _sessionContext.UserName;
|
|
|
model.State = 0;
|
|
|
var id = await _orderSuperviseRepository.AddAsync(model, HttpContext.RequestAborted);
|
|
@@ -1428,16 +1495,40 @@ public class OrderController : BaseController
|
|
|
.FirstAsync(x => x.Id == id);
|
|
|
}
|
|
|
|
|
|
- #endregion
|
|
|
-
|
|
|
- #region 工单催办
|
|
|
-
|
|
|
/// <summary>
|
|
|
- /// 工单催办列表
|
|
|
+ /// 省上督办
|
|
|
/// </summary>
|
|
|
/// <param name="dto"></param>
|
|
|
/// <returns></returns>
|
|
|
- [Permission(EPermission.UrgeOrderList)]
|
|
|
+ [HttpPost("supervise/province")]
|
|
|
+ public async Task ProvinceOrderSupervise([FromBody] ProvinceOrderSuperviseDto dto)
|
|
|
+ {
|
|
|
+ var order = await _orderRepository.Queryable().Where(x => x.ProvinceNo == dto.CaseSerial).FirstAsync();
|
|
|
+ var org = await _organizeRepository.Queryable().Where(x => x.Name == dto.SuperviseRsvDept).FirstAsync();
|
|
|
+ var model = new OrderSupervise
|
|
|
+ {
|
|
|
+ OrderId = order.Id,
|
|
|
+ ReplyLimitTime = dto.SuperviseReturnDate,
|
|
|
+ OrgId = org.Id,
|
|
|
+ OrgName = org.Name,
|
|
|
+ LaunchOrgName = dto.SuperviseSendDept,
|
|
|
+ State = 0,
|
|
|
+ ApplyContent = dto.SuperviseContent,
|
|
|
+ CrUser = dto.SupervisePerson,
|
|
|
+ SuperviseSerial = dto.SuperviseSerial
|
|
|
+ };
|
|
|
+ await _orderSuperviseRepository.AddAsync(model, HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 工单催办
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 工单催办列表
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [Permission(EPermission.UrgeOrderList)]
|
|
|
[HttpGet("urge")]
|
|
|
public async Task<PagedDto<UrgeOrderDto>> UrgeList([FromQuery] UrgeListDto dto)
|
|
|
{
|
|
@@ -1563,16 +1654,36 @@ public class OrderController : BaseController
|
|
|
.FirstAsync(x => x.Id == id);
|
|
|
}
|
|
|
|
|
|
- #endregion
|
|
|
-
|
|
|
- #region 工单办理
|
|
|
-
|
|
|
/// <summary>
|
|
|
- /// 工单列表
|
|
|
+ /// 省上催办
|
|
|
/// </summary>
|
|
|
/// <param name="dto"></param>
|
|
|
/// <returns></returns>
|
|
|
- [Permission(EPermission.OrderQuery)]
|
|
|
+ [HttpPost("urge/province")]
|
|
|
+ public async Task ProvinceOrderUrge([FromBody] ProvinceOrderUrgeDto dto)
|
|
|
+ {
|
|
|
+ var order = await _orderRepository.Queryable().Where(x => x.ProvinceNo == dto.CaseSerial).FirstAsync();
|
|
|
+ var model = new OrderUrge
|
|
|
+ {
|
|
|
+ OrderId = order.Id,
|
|
|
+ ApplyContent = dto.RemindReasion,
|
|
|
+ CrUser = dto.RemindName,
|
|
|
+ State = 0,
|
|
|
+ CreationTime = dto.RemindTime
|
|
|
+ };
|
|
|
+ await _orderUrgeRepository.AddAsync(model, HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 工单办理
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 工单列表
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [Permission(EPermission.OrderQuery)]
|
|
|
[HttpGet]
|
|
|
public async Task<PagedDto<OrderDto>> Query([FromQuery] QueryOrderDto dto)
|
|
|
{
|