|
@@ -382,8 +382,6 @@ public class OrderController : BaseController
|
|
throw UserFriendlyException.SameMessage("未找到工单,无法发布");
|
|
throw UserFriendlyException.SameMessage("未找到工单,无法发布");
|
|
|
|
|
|
//新增发布工单
|
|
//新增发布工单
|
|
-
|
|
|
|
-
|
|
|
|
var orderPublish = _mapper.Map<OrderPublish>(dto);
|
|
var orderPublish = _mapper.Map<OrderPublish>(dto);
|
|
orderPublish.OrderId = order.Id;
|
|
orderPublish.OrderId = order.Id;
|
|
orderPublish.No = order.No;
|
|
orderPublish.No = order.No;
|
|
@@ -558,7 +556,10 @@ public class OrderController : BaseController
|
|
[LogFilter("修改发布内容")]
|
|
[LogFilter("修改发布内容")]
|
|
public async Task PublishedModify([FromBody] PublishOrderModifyDto dto)
|
|
public async Task PublishedModify([FromBody] PublishOrderModifyDto dto)
|
|
{
|
|
{
|
|
- var publishOrder = await _orderPublishRepository.GetAsync(dto.Id, HttpContext.RequestAborted);
|
|
|
|
|
|
+ var publishOrder = await _orderPublishRepository.Queryable()
|
|
|
|
+ .Includes(x=>x.Order)
|
|
|
|
+ .Where(x => x.Id == dto.Id)
|
|
|
|
+ .FirstAsync(HttpContext.RequestAborted);
|
|
|
|
|
|
if (publishOrder is null)
|
|
if (publishOrder is null)
|
|
{
|
|
{
|
|
@@ -572,6 +573,8 @@ public class OrderController : BaseController
|
|
history.ArrangeContentAfter = dto.ArrangeContent;
|
|
history.ArrangeContentAfter = dto.ArrangeContent;
|
|
history.ArrangeOpinionBefor = publishOrder.ArrangeOpinion;
|
|
history.ArrangeOpinionBefor = publishOrder.ArrangeOpinion;
|
|
history.ArrangeOpinionAfter = dto.ArrangeOpinion;
|
|
history.ArrangeOpinionAfter = dto.ArrangeOpinion;
|
|
|
|
+ history.PublishStateBefor = publishOrder.PublishState;
|
|
|
|
+ history.PublishStateAfter = dto.PublishState;
|
|
history.No = publishOrder.No;
|
|
history.No = publishOrder.No;
|
|
history.OrderId = publishOrder.OrderId;
|
|
history.OrderId = publishOrder.OrderId;
|
|
history.OrderPublishId = publishOrder.Id;
|
|
history.OrderPublishId = publishOrder.Id;
|
|
@@ -580,9 +583,15 @@ public class OrderController : BaseController
|
|
publishOrder.ArrangeTitle = dto.ArrangeTitle;
|
|
publishOrder.ArrangeTitle = dto.ArrangeTitle;
|
|
publishOrder.ArrangeContent = dto.ArrangeContent;
|
|
publishOrder.ArrangeContent = dto.ArrangeContent;
|
|
publishOrder.ArrangeOpinion = dto.ArrangeOpinion;
|
|
publishOrder.ArrangeOpinion = dto.ArrangeOpinion;
|
|
|
|
+ publishOrder.PublishState = dto.PublishState;
|
|
|
|
|
|
await _orderPublishRepository.UpdateAsync(publishOrder, HttpContext.RequestAborted);
|
|
await _orderPublishRepository.UpdateAsync(publishOrder, HttpContext.RequestAborted);
|
|
await _orderPublishHistoryRepository.AddAsync(history, HttpContext.RequestAborted);
|
|
await _orderPublishHistoryRepository.AddAsync(history, HttpContext.RequestAborted);
|
|
|
|
+
|
|
|
|
+ //推省上
|
|
|
|
+ var publishPublishOrder = _mapper.Map<PublishPublishOrderDto>(publishOrder);
|
|
|
|
+ publishPublishOrder.Order = _mapper.Map<OrderDto>(publishOrder.Order);
|
|
|
|
+ await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderPublishOrder, publishPublishOrder);
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -926,23 +935,16 @@ public class OrderController : BaseController
|
|
public async Task<JudgeVisitRsp> JudgeVisit([FromBody] JudgeVisitReq dto)
|
|
public async Task<JudgeVisitRsp> JudgeVisit([FromBody] JudgeVisitReq dto)
|
|
{
|
|
{
|
|
int error = 0;
|
|
int error = 0;
|
|
- foreach (var id in dto.Ids)
|
|
|
|
- {
|
|
|
|
- var visit = await _orderVisitRepository.Queryable().FirstAsync(d => d.Id == id, HttpContext.RequestAborted);
|
|
|
|
- if (visit != null && visit.VisitState == EVisitState.Visited)
|
|
|
|
- {
|
|
|
|
- visit.JudgeState = dto.IsAgree ? EJudgeState.Agreed : EJudgeState.UnAgreed;
|
|
|
|
- visit.JudgeUserId = _sessionContext.RequiredUserId;
|
|
|
|
- visit.JudgeUserName = _sessionContext.UserName;
|
|
|
|
- visit.JudgeTime = DateTime.Now;
|
|
|
|
- visit.JudgeContent = dto.JudgeContent;
|
|
|
|
- await _orderVisitRepository.UpdateAsync(visit, HttpContext.RequestAborted);
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- error++;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ var list = await _orderVisitRepository.Queryable().Where(x => dto.Ids.Contains(x.Id) && x.VisitState == EVisitState.Visited).ToListAsync(HttpContext.RequestAborted);
|
|
|
|
+ list.ForEach(visit =>
|
|
|
|
+ {
|
|
|
|
+ visit.JudgeState = dto.IsAgree ? EJudgeState.Agreed : EJudgeState.UnAgreed;
|
|
|
|
+ visit.JudgeUserId = _sessionContext.RequiredUserId;
|
|
|
|
+ visit.JudgeUserName = _sessionContext.UserName;
|
|
|
|
+ visit.JudgeTime = DateTime.Now;
|
|
|
|
+ visit.JudgeContent = dto.JudgeContent;
|
|
|
|
+ });
|
|
|
|
+ await _orderVisitRepository.UpdateRangeAsync(list, HttpContext.RequestAborted);
|
|
return new JudgeVisitRsp() { ErrorCount = error, SuccessCount = dto.Ids.Count - error };
|
|
return new JudgeVisitRsp() { ErrorCount = error, SuccessCount = dto.Ids.Count - error };
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2372,6 +2374,7 @@ public class OrderController : BaseController
|
|
var order = await _orderRepository.Queryable()
|
|
var order = await _orderRepository.Queryable()
|
|
.Includes(d => d.OrderExtension)
|
|
.Includes(d => d.OrderExtension)
|
|
.Includes(d => d.OrderDelays)
|
|
.Includes(d => d.OrderDelays)
|
|
|
|
+ .Includes(d=> d.OrderPublish)
|
|
//.Includes(d => d.OrderScreens)
|
|
//.Includes(d => d.OrderScreens)
|
|
.Includes(d => d.OrderVisits, x => x.OrderVisitDetails)
|
|
.Includes(d => d.OrderVisits, x => x.OrderVisitDetails)
|
|
.Includes(d => d.OrderVisits, x => x.Employee)
|
|
.Includes(d => d.OrderVisits, x => x.Employee)
|
|
@@ -2437,6 +2440,11 @@ public class OrderController : BaseController
|
|
|
|
|
|
//dto.CanPrevious = canPrevious;
|
|
//dto.CanPrevious = canPrevious;
|
|
|
|
|
|
|
|
+ if (order.OrderPublish!=null)
|
|
|
|
+ {
|
|
|
|
+ dto.PublishState = order.OrderPublish.PublishState;
|
|
|
|
+ }
|
|
|
|
+
|
|
if (dto.FileJson != null && dto.FileJson.Any())
|
|
if (dto.FileJson != null && dto.FileJson.Any())
|
|
{
|
|
{
|
|
var ids = order.FileJson.Select(x => x.Id).ToList();
|
|
var ids = order.FileJson.Select(x => x.Id).ToList();
|