|
@@ -62,6 +62,7 @@ public class OrderController : BaseController
|
|
|
private readonly IRepository<OrderUrge> _orderUrgeRepository;
|
|
|
private readonly IFileRepository _fileRepository;
|
|
|
private readonly IRepository<OrderScreen> _orderScreenRepository;
|
|
|
+ private readonly IRepository<OrderPublishHistory> _orderPublishHistoryRepository;
|
|
|
|
|
|
|
|
|
public OrderController(
|
|
@@ -84,11 +85,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
|
|
|
+ IRepository<OrderScreen> orderScreenRepository,
|
|
|
+ IRepository<OrderPublishHistory> orderPublishHistoryRepository
|
|
|
)
|
|
|
{
|
|
|
_orderDomainService = orderDomainService;
|
|
@@ -115,6 +117,7 @@ public class OrderController : BaseController
|
|
|
_orderUrgeRepository = orderUrgeRepository;
|
|
|
_fileRepository = fileRepository;
|
|
|
_orderScreenRepository = orderScreenRepository;
|
|
|
+ _orderPublishHistoryRepository = orderPublishHistoryRepository;
|
|
|
|
|
|
}
|
|
|
|
|
@@ -291,7 +294,53 @@ public class OrderController : BaseController
|
|
|
return pubentity;
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 修改发布内容
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [Permission(EPermission.PublishedModify)]
|
|
|
+ [HttpPost("published-order-modify")]
|
|
|
+ public async Task PublishedModify([FromBody]PublishOrderModifyDto dto)
|
|
|
+ {
|
|
|
+ var publishOrder = await _orderPublishRepository.GetAsync(dto.Id, HttpContext.RequestAborted);
|
|
|
+
|
|
|
+ if(publishOrder is null)
|
|
|
+ {
|
|
|
+ throw UserFriendlyException.SameMessage("无效数据");
|
|
|
+ }
|
|
|
+
|
|
|
+ var history = new OrderPublishHistory();
|
|
|
+ history.ArrangeTitleBefor = publishOrder.ArrangeTitle;
|
|
|
+ history.ArrangeTitleAfter = dto.ArrangeTitle;
|
|
|
+ history.ArrangeContentBefor = publishOrder.ArrangeContent;
|
|
|
+ history.ArrangeContentAfter = dto.ArrangeContent;
|
|
|
+ history.ArrangeOpinionBefor = publishOrder.ArrangeOpinion;
|
|
|
+ history.ArrangeOpinionAfter = dto.ArrangeOpinion;
|
|
|
+ history.No = publishOrder.No;
|
|
|
+ history.OrderId = publishOrder.OrderId;
|
|
|
+ history.OrderPublishId = publishOrder.Id;
|
|
|
+
|
|
|
|
|
|
+ publishOrder.ArrangeTitle = dto.ArrangeTitle;
|
|
|
+ publishOrder.ArrangeContent = dto.ArrangeContent;
|
|
|
+ publishOrder.ArrangeOpinion = dto.ArrangeOpinion;
|
|
|
+
|
|
|
+ await _orderPublishRepository.UpdateAsync(publishOrder, HttpContext.RequestAborted);
|
|
|
+ await _orderPublishHistoryRepository.AddAsync(history, HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 发布修改记录
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="id"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [Permission(EPermission.QueryPublishedHistory)]
|
|
|
+ [HttpGet("published-history-list/{id}")]
|
|
|
+ public async Task<List<OrderPublishHistory>> QueryPublishedHistory(string id)
|
|
|
+ {
|
|
|
+ return await _orderPublishHistoryRepository.Queryable().Where(x => x.OrderPublishId == id).OrderByDescending(x=>x.CreationTime).ToListAsync(HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
#endregion
|
|
|
|
|
|
#region 工单回访
|