|
@@ -44,8 +44,9 @@ public class OrderSnapshotApplicationTest : TestBase
|
|
|
private readonly ISnapshotLabelLogRepository _snapshotLabelLogRepository;
|
|
|
private readonly IRedPackApplication _redPackApplication;
|
|
|
private readonly IOrderRepository _orderRepository;
|
|
|
+ private readonly IIndustryCaseRepository _industryCaseRepository;
|
|
|
|
|
|
- public OrderSnapshotApplicationTest(IAccountRepository accountRepository, IRepository<Role> roleRepository, UserController userController, IServiceScopeFactory scopeFactory, IRepository<User> userRepository, IHttpContextAccessor httpContextAccessor, IThirdIdentiyService thirdIdentiyService, IThirdAccountRepository thirdAccountRepository, OrderServiceMock orderServiceMock, ISystemDicDataCacheManager systemDicDataCacheManager, IOrderSnapshotRepository orderSnapshotRepository, IOrderSnapshotApplication orderSnapshotApplication, ISnapshotApplication snapshotApplication, IIndustryLogRepository industryLogRepository, ICommunityInfoRepository communityInfoRepository, IRedPackAuditRepository redPackAuditRepository, IRedPackRecordRepository redPackRecordRepository, ISnapshotLabelLogRepository snapshotLabelLogRepository, ITypedCache<SystemSetting> cacheSettingData, IRedPackApplication redPackApplication, IOrderRepository orderRepository, ThirdAccounSupplierFactory thirdAccountDomainFactory) : base(accountRepository, roleRepository, userController, scopeFactory, userRepository, httpContextAccessor, thirdIdentiyService, thirdAccountRepository, cacheSettingData, thirdAccountDomainFactory)
|
|
|
+ public OrderSnapshotApplicationTest(IAccountRepository accountRepository, IRepository<Role> roleRepository, UserController userController, IServiceScopeFactory scopeFactory, IRepository<User> userRepository, IHttpContextAccessor httpContextAccessor, IThirdIdentiyService thirdIdentiyService, IThirdAccountRepository thirdAccountRepository, OrderServiceMock orderServiceMock, ISystemDicDataCacheManager systemDicDataCacheManager, IOrderSnapshotRepository orderSnapshotRepository, IOrderSnapshotApplication orderSnapshotApplication, ISnapshotApplication snapshotApplication, IIndustryLogRepository industryLogRepository, ICommunityInfoRepository communityInfoRepository, IRedPackAuditRepository redPackAuditRepository, IRedPackRecordRepository redPackRecordRepository, ISnapshotLabelLogRepository snapshotLabelLogRepository, ITypedCache<SystemSetting> cacheSettingData, IRedPackApplication redPackApplication, IOrderRepository orderRepository, ThirdAccounSupplierFactory thirdAccountDomainFactory, IIndustryCaseRepository industryCaseRepository) : base(accountRepository, roleRepository, userController, scopeFactory, userRepository, httpContextAccessor, thirdIdentiyService, thirdAccountRepository, cacheSettingData, thirdAccountDomainFactory)
|
|
|
{
|
|
|
_orderServiceMock = orderServiceMock;
|
|
|
_systemDicDataCacheManager = systemDicDataCacheManager;
|
|
@@ -59,6 +60,7 @@ public class OrderSnapshotApplicationTest : TestBase
|
|
|
_snapshotLabelLogRepository = snapshotLabelLogRepository;
|
|
|
_redPackApplication = redPackApplication;
|
|
|
_orderRepository = orderRepository;
|
|
|
+ _industryCaseRepository = industryCaseRepository;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -99,6 +101,7 @@ public class OrderSnapshotApplicationTest : TestBase
|
|
|
SetSettingCache(SettingConstants.OvertimeBack, "4");
|
|
|
var snapshotLabels = _systemDicDataCacheManager.SnapshotOrderLabel;
|
|
|
var inputLable = snapshotLabels.Where(m => m.DicDataValue == "bss").ToList();
|
|
|
+ var industryCase = await _industryCaseRepository.Queryable().Where(m => m.IsEnable == true).FirstAsync();
|
|
|
var order = _orderServiceMock.CreateSnapshotOrder(SetWeiXin)
|
|
|
.办理到网格员(SetZuoXi)
|
|
|
.StepHandle(async (order, mock) =>
|
|
@@ -121,7 +124,7 @@ public class OrderSnapshotApplicationTest : TestBase
|
|
|
.Where(m => m.Id == order.Id)
|
|
|
.ExecuteCommandAsync();
|
|
|
orderSnapshot = await _orderSnapshotRepository.GetAsync(order.Id);
|
|
|
- var replyDto = mock.GetGuiderSystemInDto(orderSnapshot.NetworkENumber);
|
|
|
+ var replyDto = mock.GetGuiderSystemInDto(orderSnapshot.NetworkENumber);
|
|
|
await _snapshotApplication.SaveGuiderSystemReplyAsync(replyDto, CancellationToken.None);
|
|
|
orderSnapshot = await _orderSnapshotRepository.GetAsync(order.Id);
|
|
|
orderSnapshot.CommunityName.ShouldNotBeNull();
|
|
@@ -140,13 +143,17 @@ public class OrderSnapshotApplicationTest : TestBase
|
|
|
})
|
|
|
.办理到派单员(Set班长)
|
|
|
.办理到一级部门(SetPaiDanYuan)
|
|
|
- .办理到归档(Set一级部门)
|
|
|
+ .办理到归档(Set一级部门, data =>
|
|
|
+ {
|
|
|
+ data.IsDangerDepartment = true;
|
|
|
+ data.IndustryCase = industryCase.Id;
|
|
|
+ })
|
|
|
.发布工单(SetZuoXi, inputLable.Select(m => new Kv(m.DicDataName, m.DicDataName)).ToList())
|
|
|
.StepHandle(async order =>
|
|
|
{
|
|
|
var log = _snapshotLabelLogRepository.Queryable().Where(m => m.OrderId == order.Id).First();
|
|
|
log.ShouldNotBeNull();
|
|
|
- await _orderSnapshotApplication.UpdateIsEmphasisAsync(new UpdateIsEmphasisInDto { Ids = [order.Id]});
|
|
|
+ await _orderSnapshotApplication.UpdateIsEmphasisAsync(new UpdateIsEmphasisInDto { Ids = [order.Id] });
|
|
|
var snapshot = _orderSnapshotRepository.Get(order.Id);
|
|
|
snapshot.LabelName.ShouldBe(string.Join(',', inputLable.Select(m => m.DicDataName)), "label异常");
|
|
|
snapshot.IsEmphasis.ShouldBe(true);
|
|
@@ -169,9 +176,9 @@ public class OrderSnapshotApplicationTest : TestBase
|
|
|
redPackRecord.ShouldNotBeNull();
|
|
|
})
|
|
|
.部门审核特殊红包(Set应急管理局)
|
|
|
- .StepHandle(async order =>
|
|
|
+ .StepHandle(async order =>
|
|
|
{
|
|
|
- var baseData = await _redPackApplication.GetRedPackRecordBaseDataAsync(order.Id);
|
|
|
+ var baseData = await _redPackApplication.GetRedPackRecordBaseDataAsync(order.Id);
|
|
|
baseData.AuditType.ShouldNotBeNull();
|
|
|
baseData.AuditTypeCode.ShouldNotBeNull();
|
|
|
baseData.Amount.ShouldNotBeNull();
|