|
@@ -11,7 +11,9 @@ using Hotline.Share.Dtos.Bigscreen;
|
|
|
using Hotline.Share.Dtos.CallCenter;
|
|
|
using Hotline.Share.Dtos.Order;
|
|
|
using Hotline.Share.Enums.CallCenter;
|
|
|
+using Hotline.Share.Enums.FlowEngine;
|
|
|
using Hotline.Share.Enums.Order;
|
|
|
+using Hotline.Share.Enums.Settings;
|
|
|
using Hotline.Share.Requests;
|
|
|
using MapsterMapper;
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
@@ -21,6 +23,7 @@ using XF.Domain.Authentications;
|
|
|
using XF.Domain.Constants;
|
|
|
using XF.Domain.Exceptions;
|
|
|
using XF.Domain.Repository;
|
|
|
+using XF.Utility.EnumExtensions;
|
|
|
|
|
|
namespace Hotline.Api.Controllers.Bi
|
|
|
{
|
|
@@ -1195,21 +1198,33 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
var IsCenter = _sessionContext.OrgIsCenter;
|
|
|
|
|
|
var orderData = await _orderRepository.Queryable()
|
|
|
- .LeftJoin<SystemOrganize>((it, o) => it.OrgLevelOneCode == o.Id)
|
|
|
- .Where((it, o) => it.CreationTime >= StartDate && it.CreationTime <= EndDate && it.Status >= EOrderStatus.Filed)
|
|
|
- .WhereIF(TypeCode == 1, (it, o) => it.OrgLevelOneCode == "001")
|
|
|
- .WhereIF(TypeCode == 2, (it, o) => it.OrgLevelOneCode != "001")
|
|
|
- .WhereIF(IsCenter == false, (it, o) => it.OrgLevelOneCode.StartsWith(_sessionContext.RequiredOrgId))
|
|
|
+ // .LeftJoin<SystemOrganize>((it, o) => it.OrgLevelOneCode == o.Id)
|
|
|
+ .Where(it => it.CreationTime >= StartDate && it.CreationTime <= EndDate && it.Status >= EOrderStatus.Filed)
|
|
|
+
|
|
|
+ .Select(it => new
|
|
|
+ {
|
|
|
+ OrgCode = IsCenter == false ? it.ActualHandleOrgCode : it.OrgLevelOneCode,
|
|
|
+ it.AcceptTypeCode,
|
|
|
+ it.FileDurationWorkday,
|
|
|
+ it.AllDuration
|
|
|
+ })
|
|
|
+ .MergeTable()
|
|
|
+ .LeftJoin<SystemOrganize>((it, o) => it.OrgCode == o.Id)
|
|
|
+
|
|
|
+ .WhereIF(TypeCode == 1, (it, o) => it.OrgCode == "001")
|
|
|
+ .WhereIF(TypeCode == 2, (it, o) => it.OrgCode != "001")
|
|
|
+ .WhereIF(IsCenter == false, (it, o) => it.OrgCode.StartsWith(_sessionContext.RequiredOrgId))
|
|
|
+
|
|
|
.GroupBy((it, o) => new
|
|
|
{
|
|
|
- it.OrgLevelOneCode,
|
|
|
+ it.OrgCode,
|
|
|
o.Name,
|
|
|
o.OrgType
|
|
|
})
|
|
|
.Select((it, o) => new DepartmentAcceptanceTypeStatisticsDto
|
|
|
{
|
|
|
- OrgName = it.OrgLevelOneCode == "001" ? "热线中心" : o.Name,
|
|
|
- OrgCode = it.OrgLevelOneCode,
|
|
|
+ OrgName = it.OrgCode == "001" ? "热线中心" : o.Name,
|
|
|
+ OrgCode = it.OrgCode,
|
|
|
OrgType = (int)o.OrgType == 2 ? "区县部门" : "市直部门",
|
|
|
ZxAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "10", 1, 0)),
|
|
|
ZxAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "10" && it.AllDuration != null, it.AllDuration, 0)),
|
|
@@ -1244,6 +1259,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
return orderData;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 部门受理类型统计周期--明细列表
|
|
|
/// </summary>
|
|
@@ -1567,20 +1583,22 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
/// <param name="dto"></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpGet("reTransact")]
|
|
|
- public async Task<PagedDto<OrderReTransactVo>> OrderReTransact([FromQuery] ReportPagedRequest dto)
|
|
|
+ public async Task<PagedDto<OrderReTransactVo>> OrderReTransact([FromQuery] QueryOrderReTransactRequest dto)
|
|
|
{
|
|
|
if (!dto.StartTime.HasValue || !dto.EndTime.HasValue)
|
|
|
throw UserFriendlyException.SameMessage("请选择时间!");
|
|
|
-
|
|
|
- var (total, items) = await _orderSpecialDetailRepository.Queryable()
|
|
|
+ dto.EndTime = dto.EndTime.Value.AddDays(1).AddSeconds(-1);
|
|
|
+ var (total, items) = await _orderSpecialDetailRepository.Queryable()
|
|
|
.Includes(x=>x.OrderSpecial)
|
|
|
- .Where(x => x.OrderSpecial.ESpecialType == ESpecialType.ReTransact)
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.OrgName), x => x.OrgName.Contains(dto.OrgName!))
|
|
|
+ .Where(x => x.OrderSpecial.ESpecialType == ESpecialType.ReTransact)
|
|
|
.Where(x => x.OrderSpecial.CreationTime >= dto.StartTime)
|
|
|
.Where(x => x.OrderSpecial.CreationTime <= dto.EndTime)
|
|
|
- .GroupBy(x => new { x.OrgId, x.OrgName })
|
|
|
+ .GroupBy(x => new { Time = x.OrderSpecial.CreationTime.ToString("yyyy-MM-dd"), x.OrgId, x.OrgName })
|
|
|
.Select(x => new OrderReTransactVo
|
|
|
{
|
|
|
- OrgId = x.OrgId,
|
|
|
+ Time = x.OrderSpecial.CreationTime.ToString("yyyy-MM-dd"),
|
|
|
+ OrgId = x.OrgId,
|
|
|
OrgName = x.OrgName,
|
|
|
Num = SqlFunc.AggregateCount(1)
|
|
|
}).MergeTable()
|
|
@@ -1600,9 +1618,12 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
{
|
|
|
if (!dto.StartTime.HasValue || !dto.EndTime.HasValue)
|
|
|
throw UserFriendlyException.SameMessage("请选择时间!");
|
|
|
+ dto.EndTime = dto.EndTime.Value.AddDays(1).AddSeconds(-1);
|
|
|
var (total, items) = await _orderSpecialDetailRepository.Queryable()
|
|
|
- .Includes(x => x.OrderSpecial)
|
|
|
+ .Includes(x => x.OrderSpecial,s=>s.Order)
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.OrgName),x=>x.OrgName.Contains(dto.OrgName!))
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.ErrorName), x => x.ErrorName.Contains(dto.ErrorName!))
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.No), x => x.OrderSpecial!.Order!.No!.Contains(dto.No!))
|
|
|
.Where(x => x.OrderSpecial.ESpecialType == ESpecialType.ReTransact)
|
|
|
.Where(x => x.OrderSpecial.CreationTime >= dto.StartTime)
|
|
|
.Where(x => x.OrderSpecial.CreationTime <= dto.EndTime)
|
|
@@ -1610,7 +1631,20 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
return new PagedDto<OrderSpecialDto>(total, _mapper.Map<IReadOnlyList<OrderSpecialDto>>(items));
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 获取基本信息
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="id"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("reTransact_base")]
|
|
|
+ public async Task<object> ReTransactBaseData()
|
|
|
+ {
|
|
|
+ var rsp = new
|
|
|
+ {
|
|
|
+ ReTransactErrorType = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.ReTransactErrorType),
|
|
|
+ };
|
|
|
+ return rsp;
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
- }
|
|
|
+ }
|
|
|
}
|