|
@@ -15,6 +15,7 @@ using Hotline.Settings.Hotspots;
|
|
|
using Hotline.Share.Dtos.File;
|
|
|
using Hotline.Share.Dtos.FlowEngine;
|
|
|
using Hotline.Share.Dtos.Order;
|
|
|
+using Hotline.Share.Dtos.Order.Publish;
|
|
|
using Hotline.Share.Dtos.Users;
|
|
|
using Hotline.Share.Enums.FlowEngine;
|
|
|
using Hotline.Share.Enums.Order;
|
|
@@ -34,6 +35,7 @@ using System.Linq;
|
|
|
using System.Text;
|
|
|
using System.Threading.Tasks;
|
|
|
using XF.Domain.Authentications;
|
|
|
+using XF.Domain.Exceptions;
|
|
|
using XF.Domain.Repository;
|
|
|
|
|
|
namespace Hotline.Application.Tests.Controller;
|
|
@@ -205,8 +207,37 @@ public class OrderControllerTest : TestBase
|
|
|
await _orderController.PublishCancelAsync(new PublishCancelInDto { OrderPublishId = publish.Id });
|
|
|
var visit = await _orderVisitRepository.GetAsync(m => m.OrderId == order.Id);
|
|
|
var publishCount = await _orderPublishRepository.Queryable().Where(m => m.OrderId == order.Id && m.IsDeleted == false).CountAsync();
|
|
|
- publishCount.ShouldBe(0);
|
|
|
- visit.ShouldNotBeNull();
|
|
|
- visit.VisitState.ShouldBe(EVisitState.Visited);
|
|
|
+ publishCount.ShouldBe(0, "发布工单数据已经被删除, 应该是0条");
|
|
|
+ visit.ShouldNotBeNull("回访信息不存在");
|
|
|
+ visit.VisitState.ShouldBe(EVisitState.Visited, "回访状态应该是已回访");
|
|
|
+
|
|
|
+ orderEntity = await _orderRepository.GetAsync(order.Id);
|
|
|
+ orderEntity.Status.ShouldBe(EOrderStatus.Filed);
|
|
|
+ var publishList = await _orderController.PublishOrderList(new QueryOrderPublishDto
|
|
|
+ {
|
|
|
+ PageSize = 1000,
|
|
|
+ QuerySelf = true
|
|
|
+ });
|
|
|
+
|
|
|
+ publishList.Items.Any(m => m.Id == order.Id).ShouldBeTrue("工单发布列表中没有取消的工单");
|
|
|
+ SetZuoXi();
|
|
|
+ // 验证是否能非上次发布人员发布
|
|
|
+ try
|
|
|
+ {
|
|
|
+ await _orderController.PublishOrder(new PublishOrderDto { Id = order.Id });
|
|
|
+ }
|
|
|
+ catch (UserFriendlyException e)
|
|
|
+ {
|
|
|
+ e.Message.Contains("您不能发布").ShouldBeTrue();
|
|
|
+ }
|
|
|
+
|
|
|
+ // 验证被取消前的发布人能否继续发布
|
|
|
+ SetPaiDanYuan();
|
|
|
+ var inDto = _fixture.Create<PublishOrderDto>();
|
|
|
+ inDto.Id = order.Id;
|
|
|
+ await _orderController.PublishOrder(inDto);
|
|
|
+ var published = await _orderPublishRepository.Queryable().Where(m => m.OrderId == order.Id && m.IsDeleted == false).FirstAsync();
|
|
|
+ published.ShouldNotBeNull();
|
|
|
+ published.IsDeleted.ShouldBeFalse();
|
|
|
}
|
|
|
}
|