|
@@ -5,6 +5,7 @@ using Hotline.Identity.Accounts;
|
|
|
using Hotline.Identity.Roles;
|
|
|
using Hotline.Repository.SqlSugar.Extensions;
|
|
|
using Hotline.Repository.SqlSugar.Snapshot;
|
|
|
+using Hotline.Settings;
|
|
|
using Hotline.Share.Dtos;
|
|
|
using Hotline.Share.Dtos.Snapshot;
|
|
|
using Hotline.Share.Enums.Snapshot;
|
|
@@ -15,7 +16,14 @@ using Hotline.Tests.Mock;
|
|
|
using Hotline.Users;
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
+using NPOI.SS.Formula.Functions;
|
|
|
using Shouldly;
|
|
|
+using System;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.Linq;
|
|
|
+using System.Text;
|
|
|
+using System.Threading.Tasks;
|
|
|
+using XF.Domain.Cache;
|
|
|
using XF.Domain.Repository;
|
|
|
|
|
|
namespace Hotline.Tests.Application;
|
|
@@ -32,7 +40,7 @@ public class OrderSnapshotApplicationTest : TestBase
|
|
|
private readonly IRedPackRecordRepository _redPackRecordRepository;
|
|
|
private readonly ISnapshotLabelLogRepository _snapshotLabelLogRepository;
|
|
|
|
|
|
- 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) : base(accountRepository, roleRepository, userController, scopeFactory, userRepository, httpContextAccessor, thirdIdentiyService, thirdAccountRepository)
|
|
|
+ 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) : base(accountRepository, roleRepository, userController, scopeFactory, userRepository, httpContextAccessor, thirdIdentiyService, thirdAccountRepository, cacheSettingData)
|
|
|
{
|
|
|
_orderServiceMock = orderServiceMock;
|
|
|
_systemDicDataCacheManager = systemDicDataCacheManager;
|
|
@@ -46,9 +54,35 @@ public class OrderSnapshotApplicationTest : TestBase
|
|
|
_snapshotLabelLogRepository = snapshotLabelLogRepository;
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 随手拍网格员超时:
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [Fact]
|
|
|
+ public async Task SnapshotWorkflow_Guider_Timeout_Test()
|
|
|
+ {
|
|
|
+ SetSettingCache(SettingConstants.OvertimeBack, "0.00027778");
|
|
|
+ var order = _orderServiceMock.CreateSnapshotOrder(SetWeiXin)
|
|
|
+ .办理到网格员(SetZuoXi)
|
|
|
+ .StepHandle(async order =>
|
|
|
+ {
|
|
|
+ Thread.Sleep(30 * 1000);
|
|
|
+ }
|
|
|
+ ).GetCreateResult();
|
|
|
+ order.Id.ShouldNotBeNull();
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 随手拍办理流程:
|
|
|
- /// 到网格员
|
|
|
+ /// 坐席
|
|
|
+ /// 网格员
|
|
|
+ /// 派单员
|
|
|
+ /// 一级部门
|
|
|
+ /// 归档
|
|
|
+ /// 发布工单
|
|
|
+ /// 政法委部门审核网格红包
|
|
|
+ /// 应急局部门审核网格员红包
|
|
|
+ /// 部门审核市民红包
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
[Fact]
|
|
@@ -114,15 +148,16 @@ public class OrderSnapshotApplicationTest : TestBase
|
|
|
.办理到一级部门(SetPaiDanYuan)
|
|
|
.办理到归档(Set一级部门)
|
|
|
.发布工单(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();
|
|
|
- var snapshot = _orderSnapshotRepository.Get(order.Id);
|
|
|
- snapshot.LabelName.ShouldBe(string.Join(',', inputLable.Select(m => m.DicDataName)),"label异常");
|
|
|
- })
|
|
|
+ .StepHandle(async order =>
|
|
|
+ {
|
|
|
+ var log = _snapshotLabelLogRepository.Queryable().Where(m => m.OrderId == order.Id).First();
|
|
|
+ log.ShouldNotBeNull();
|
|
|
+ var snapshot = _orderSnapshotRepository.Get(order.Id);
|
|
|
+ snapshot.LabelName.ShouldBe(string.Join(',', inputLable.Select(m => m.DicDataName)), "label异常");
|
|
|
+ })
|
|
|
.部门审核网格员红包(Set政法委)
|
|
|
.部门审核网格员红包(Set应急管理局)
|
|
|
- .StepHandle(async order =>
|
|
|
+ .StepHandle(async order =>
|
|
|
{
|
|
|
var redPackRecord = _redPackRecordRepository.Queryable()
|
|
|
.Where(m => m.OrderId == order.Id && m.PeopleType == EReadPackUserType.Guider)
|
|
@@ -130,7 +165,8 @@ public class OrderSnapshotApplicationTest : TestBase
|
|
|
redPackRecord.Amount.ShouldNotBe(0);
|
|
|
})
|
|
|
.部门审核市民红包(Set应急管理局)
|
|
|
- .StepHandle(async order => {
|
|
|
+ .StepHandle(async order =>
|
|
|
+ {
|
|
|
var redPackAudit = _redPackAuditRepository.Queryable().Where(m => m.OrderId == order.Id).First();
|
|
|
redPackAudit.Status.ShouldBe(ERedPackAuditStatus.Agree);
|
|
|
var redPackRecord = _redPackRecordRepository.Queryable().Where(m => m.OrderId == order.Id).First();
|