|
@@ -139,9 +139,11 @@ public class TestController : BaseController
|
|
|
private readonly ICalcExpireTime _expireTime;
|
|
|
private readonly ICallNativeRepository _callNativeRepository;
|
|
|
private readonly IRepository<OldSendProData> _oldSendProDataRepository;
|
|
|
+ private readonly IOrderScreenRepository _orderScreenRepository;
|
|
|
+ private readonly IRepository<OrderVisit> _orderVisitRepository;
|
|
|
|
|
|
|
|
|
- public TestController(
|
|
|
+ public TestController(
|
|
|
//INewRockClient client,
|
|
|
ILogger<TestController> logger,
|
|
|
//IAuthorizeGenerator authorizeGenerator,
|
|
@@ -193,7 +195,10 @@ ICallApplication callApplication,
|
|
|
ICalcExpireTime expireTime
|
|
|
,
|
|
|
ICallNativeRepository callNativeRepository,
|
|
|
- IRepository<OldSendProData> oldSendProDataRepository)
|
|
|
+ IRepository<OldSendProData> oldSendProDataRepository,
|
|
|
+ IOrderScreenRepository orderScreenRepository,
|
|
|
+ IRepository<OrderVisit> orderVisitRepository
|
|
|
+ )
|
|
|
{
|
|
|
_logger = logger;
|
|
|
//_authorizeGenerator = authorizeGenerator;
|
|
@@ -243,7 +248,9 @@ ICallApplication callApplication,
|
|
|
_expireTime = expireTime;
|
|
|
_callNativeRepository = callNativeRepository;
|
|
|
_oldSendProDataRepository = oldSendProDataRepository;
|
|
|
- }
|
|
|
+ _orderScreenRepository = orderScreenRepository;
|
|
|
+ _orderVisitRepository = orderVisitRepository;
|
|
|
+ }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 修改泸州省工单编码区域
|
|
@@ -987,12 +994,36 @@ ICallApplication callApplication,
|
|
|
}
|
|
|
|
|
|
[HttpGet("t4")]
|
|
|
- public async Task<string> Test4()
|
|
|
+ [AllowAnonymous]
|
|
|
+ public async Task<string> Test4()
|
|
|
{
|
|
|
- return DateTime.Now.ToString("O");
|
|
|
+ var a = await _expireTime.CalcWorkTimeToDecimal(DateTime.Parse("2024-12-17 22:33:22"), DateTime.Parse("2024-12-18 10:29:53"), false);
|
|
|
+ return DateTime.Now.ToString("O");
|
|
|
}
|
|
|
|
|
|
- [AllowAnonymous]
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 批量处理甄别耗时问题
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("order_screen_timeconsuming")]
|
|
|
+ [AllowAnonymous]
|
|
|
+ public async Task OrderScreenTimeConsuming()
|
|
|
+ {
|
|
|
+ var screens = await _orderScreenRepository.Queryable().ToListAsync();
|
|
|
+ foreach (var item in screens)
|
|
|
+ {
|
|
|
+ var visit = await _orderVisitRepository.Queryable().Where(x=>x.Id == item.VisitId).FirstAsync();
|
|
|
+ if (visit != null)
|
|
|
+ {
|
|
|
+ var time = await _expireTime.CalcWorkTimeToDecimal(visit.VisitTime.Value, item.CreationTime, false);
|
|
|
+ await _orderScreenRepository.Updateable().SetColumns(x => new OrderScreen { TimeConsuming = time }).Where(x => x.Id == item.Id).ExecuteCommandAsync();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ [AllowAnonymous]
|
|
|
[HttpGet("t5")]
|
|
|
public async Task<string> GetUserAllowAnonymous()
|
|
|
{
|
|
@@ -1321,4 +1352,5 @@ ICallApplication callApplication,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
}
|