|
@@ -38,7 +38,6 @@ namespace Hotline.Api.Controllers
|
|
|
private readonly IRepository<EnforcementOrdersHandler> _enforcementOrdersHandlerRepository;
|
|
|
private readonly IEnforcementApplication _enforcementApplication;
|
|
|
private readonly IRepository<Order> _orderRepository;
|
|
|
- private readonly IRepository<LawEnforcementAgencies> _lawEnforcementAgenciesRepository;
|
|
|
|
|
|
/// <summary>
|
|
|
///
|
|
@@ -86,7 +85,6 @@ namespace Hotline.Api.Controllers
|
|
|
_enforcementOrdersHandlerRepository = enforcementOrdersHandlerRepository;
|
|
|
_enforcementApplication = enforcementApplication;
|
|
|
_orderRepository = orderRepository;
|
|
|
- _lawEnforcementAgenciesRepository = lawEnforcementAgenciesRepository;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -106,12 +104,12 @@ namespace Hotline.Api.Controllers
|
|
|
await _judicialManagementOrdersService.AddAsync(order, true, HttpContext.RequestAborted);
|
|
|
|
|
|
//处理执法部门
|
|
|
- if (dto.LawEnforcementAgencies != null && dto.LawEnforcementAgencies.Any())
|
|
|
+ if (dto.EnforcementOrdersHandler != null && dto.EnforcementOrdersHandler.Any())
|
|
|
{
|
|
|
- List<LawEnforcementAgencies> lawEnforcementAgencies = new();
|
|
|
- foreach (var item in dto.LawEnforcementAgencies)
|
|
|
+ List<EnforcementOrdersHandler> enforcementOrdersHandlers = new();
|
|
|
+ foreach (var item in dto.EnforcementOrdersHandler)
|
|
|
{
|
|
|
- lawEnforcementAgencies.Add(new LawEnforcementAgencies
|
|
|
+ enforcementOrdersHandlers.Add(new EnforcementOrdersHandler
|
|
|
{
|
|
|
OrderId = order.Id,
|
|
|
OrderNo = order.No,
|
|
@@ -120,8 +118,8 @@ namespace Hotline.Api.Controllers
|
|
|
OrgName = item.Key
|
|
|
});
|
|
|
}
|
|
|
- if (lawEnforcementAgencies != null && lawEnforcementAgencies.Any())
|
|
|
- await _lawEnforcementAgenciesRepository.AddRangeAsync(lawEnforcementAgencies, HttpContext.RequestAborted);
|
|
|
+ if (enforcementOrdersHandlers != null && enforcementOrdersHandlers.Any())
|
|
|
+ await _enforcementOrdersHandlerRepository.AddRangeAsync(enforcementOrdersHandlers, HttpContext.RequestAborted);
|
|
|
}
|
|
|
return order.Id;
|
|
|
}
|
|
@@ -148,12 +146,12 @@ namespace Hotline.Api.Controllers
|
|
|
await _judicialManagementOrdersRepository.UpdateAsync(order, HttpContext.RequestAborted);
|
|
|
|
|
|
//处理执法部门
|
|
|
- if (dto.LawEnforcementAgencies != null && dto.LawEnforcementAgencies.Any())
|
|
|
+ if (dto.EnforcementOrdersHandler != null && dto.EnforcementOrdersHandler.Any())
|
|
|
{
|
|
|
- List<LawEnforcementAgencies> lawEnforcementAgencies = new();
|
|
|
- foreach (var item in dto.LawEnforcementAgencies)
|
|
|
+ List<EnforcementOrdersHandler> enforcementOrdersHandlers = new();
|
|
|
+ foreach (var item in dto.EnforcementOrdersHandler)
|
|
|
{
|
|
|
- lawEnforcementAgencies.Add(new LawEnforcementAgencies
|
|
|
+ enforcementOrdersHandlers.Add(new EnforcementOrdersHandler
|
|
|
{
|
|
|
OrderId = order.Id,
|
|
|
OrderNo = order.No,
|
|
@@ -161,10 +159,10 @@ namespace Hotline.Api.Controllers
|
|
|
OrgCode = item.Value,
|
|
|
OrgName = item.Key
|
|
|
});
|
|
|
- if (lawEnforcementAgencies != null && lawEnforcementAgencies.Any())
|
|
|
+ if (enforcementOrdersHandlers != null && enforcementOrdersHandlers.Any())
|
|
|
{
|
|
|
- await _lawEnforcementAgenciesRepository.RemoveAsync(p => p.OrderId == order.Id, false, HttpContext.RequestAborted);
|
|
|
- await _lawEnforcementAgenciesRepository.AddRangeAsync(lawEnforcementAgencies, HttpContext.RequestAborted);
|
|
|
+ await _enforcementOrdersHandlerRepository.RemoveAsync(p => p.OrderId == order.Id, false, HttpContext.RequestAborted);
|
|
|
+ await _enforcementOrdersHandlerRepository.AddRangeAsync(enforcementOrdersHandlers, HttpContext.RequestAborted);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -190,45 +188,45 @@ namespace Hotline.Api.Controllers
|
|
|
await _judicialManagementOrdersRepository.UpdateAsync(order, HttpContext.RequestAborted);
|
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// 关联执法部门
|
|
|
- /// </summary>
|
|
|
- /// <param name="dto"></param>
|
|
|
- /// <returns></returns>
|
|
|
- [HttpPut("associated_law_enforcement_gencies")]
|
|
|
- [LogFilter("关联执法部门")]
|
|
|
- public async Task AssociatedLawEnforcementAgencies([FromBody] AssociatedLawEnforcementAgenciesDto dto)
|
|
|
- {
|
|
|
- if (dto.LawEnforcementAgencies == null || dto.LawEnforcementAgencies.Count == 0)
|
|
|
- throw UserFriendlyException.SameMessage("请选择执法部门");
|
|
|
-
|
|
|
- var order = await _judicialManagementOrdersRepository.GetAsync(dto.Id, HttpContext.RequestAborted);
|
|
|
- if (order == null)
|
|
|
- throw UserFriendlyException.SameMessage("工单查询失败");
|
|
|
- //处理执法部门
|
|
|
- if (dto.LawEnforcementAgencies != null && dto.LawEnforcementAgencies.Any())
|
|
|
- {
|
|
|
- List<LawEnforcementAgencies> lawEnforcementAgencies = new();
|
|
|
- foreach (var item in dto.LawEnforcementAgencies)
|
|
|
- {
|
|
|
- lawEnforcementAgencies.Add(new LawEnforcementAgencies
|
|
|
- {
|
|
|
- OrderId = order.Id,
|
|
|
- OrderNo = order.No,
|
|
|
- OrderSoure = EOrderSoure.Enforcement,
|
|
|
- OrgCode = item.Value,
|
|
|
- OrgName = item.Key
|
|
|
- });
|
|
|
- }
|
|
|
- if (lawEnforcementAgencies != null && lawEnforcementAgencies.Any())
|
|
|
- {
|
|
|
- await _lawEnforcementAgenciesRepository.AddRangeAsync(lawEnforcementAgencies, HttpContext.RequestAborted);
|
|
|
- order.LawEnforcementAgencies = dto.LawEnforcementAgencies;
|
|
|
- await _judicialManagementOrdersRepository.UpdateAsync(order, HttpContext.RequestAborted);
|
|
|
- }
|
|
|
- }
|
|
|
+ ///// <summary>
|
|
|
+ ///// 关联执法部门
|
|
|
+ ///// </summary>
|
|
|
+ ///// <param name="dto"></param>
|
|
|
+ ///// <returns></returns>
|
|
|
+ //[HttpPut("associated_law_enforcement_gencies")]
|
|
|
+ //[LogFilter("关联执法部门")]
|
|
|
+ //public async Task AssociatedLawEnforcementAgencies([FromBody] AssociatedLawEnforcementAgenciesDto dto)
|
|
|
+ //{
|
|
|
+ // if (dto.LawEnforcementAgencies == null || dto.LawEnforcementAgencies.Count == 0)
|
|
|
+ // throw UserFriendlyException.SameMessage("请选择执法部门");
|
|
|
+
|
|
|
+ // var order = await _judicialManagementOrdersRepository.GetAsync(dto.Id, HttpContext.RequestAborted);
|
|
|
+ // if (order == null)
|
|
|
+ // throw UserFriendlyException.SameMessage("工单查询失败");
|
|
|
+ // //处理执法部门
|
|
|
+ // if (dto.LawEnforcementAgencies != null && dto.LawEnforcementAgencies.Any())
|
|
|
+ // {
|
|
|
+ // List<LawEnforcementAgencies> lawEnforcementAgencies = new();
|
|
|
+ // foreach (var item in dto.LawEnforcementAgencies)
|
|
|
+ // {
|
|
|
+ // lawEnforcementAgencies.Add(new LawEnforcementAgencies
|
|
|
+ // {
|
|
|
+ // OrderId = order.Id,
|
|
|
+ // OrderNo = order.No,
|
|
|
+ // OrderSoure = EOrderSoure.Enforcement,
|
|
|
+ // OrgCode = item.Value,
|
|
|
+ // OrgName = item.Key
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // if (lawEnforcementAgencies != null && lawEnforcementAgencies.Any())
|
|
|
+ // {
|
|
|
+ // await _enforcementOrdersHandlerRepository.AddRangeAsync(lawEnforcementAgencies, HttpContext.RequestAborted);
|
|
|
+ // order.LawEnforcementAgencies = dto.LawEnforcementAgencies;
|
|
|
+ // await _judicialManagementOrdersRepository.UpdateAsync(order, HttpContext.RequestAborted);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
- }
|
|
|
+ //}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 查询工单详情
|
|
@@ -258,7 +256,8 @@ namespace Hotline.Api.Controllers
|
|
|
dto.ExpiredTime = data.ExpiredTime;
|
|
|
dto.IsResolved = data.IsResolved;
|
|
|
dto.FileOpinion = data.FileOpinion;
|
|
|
- dto.CenterOpinion = data.CenterToOrgOpinion;
|
|
|
+ dto.CenterOpinion = data.CenterToOrgOpinion;
|
|
|
+ dto.EnforcementOrdersHandler = order.EnforcementOrdersHandler;
|
|
|
}
|
|
|
}
|
|
|
|