Ver código fonte

重复件-随手拍

qinchaoyue 1 mês atrás
pai
commit
7af636d773

+ 2 - 5
src/Hotline.Api/Controllers/Snapshot/BiSnapshotController.cs

@@ -180,9 +180,6 @@ public class BiSnapshotController : BaseController
     /// <param name="dto"></param>
     /// <returns></returns>
     [HttpGet("duplicate")]
-    public async Task<PagedDto<DuplicateItemsOutDto>> GetDuplicateItemsAsync([FromQuery] GuiderWorkLogsInDto dto)
-    {
-        throw new NotImplementedException(); 
-    }
-    //=> (await _biSnapshotApplication.GetGuiderWorkLogs(dto).ToPagedListAsync(dto)).ToPaged();
+    public async Task<PagedDto<DuplicateItemsOutDto>> GetDuplicateItemsAsync([FromQuery] DuplicateItemsInDto dto)
+    => (await _biSnapshotApplication.GetDuplicateItems(dto).ToPagedListAsync(dto)).ToPaged();
 }

+ 19 - 0
src/Hotline.Application/Snapshot/BiSnapshotApplication.cs

@@ -499,4 +499,23 @@ public class BiSnapshotApplication : IBiSnapshotApplication, IScopeDependency
             .Select(snapshot => new GuiderWorkLogsOutDto(), true);
         return query;
     }
+
+    public ISugarQueryable<DuplicateItemsOutDto> GetDuplicateItems(DuplicateItemsInDto dto)
+    {
+        var query = _orderSnapshotRepository.Queryable(includeDeleted: true)
+            .LeftJoin<Order>((snapshot, order) => order.Id == snapshot.Id)
+            .WhereIF(dto.No.NotNullOrEmpty(), (snapshot, order) => order.No.Contains(dto.No))
+            .WhereIF(dto.Title.NotNullOrEmpty(), (snapshot, order) => order.Title.Contains(dto.Title))
+            .WhereIF(dto.FromName.NotNullOrEmpty(), (snapshot, order) => order.FromName.Contains(dto.FromName))
+            .WhereIF(dto.FromPhone.NotNullOrEmpty(), (snapshot, order) => order.FromPhone.Contains(dto.FromPhone))
+            .WhereIF(dto.BeginCreationTime != null && dto.EndCreationTime != null, (snapshot, order) => order.CreationTime >= dto.BeginCreationTime && order.CreationTime <= dto.EndCreationTime)
+            .WhereIF(dto.BeginExpiredTime != null && dto.EndExpiredTime != null, (snapshot, order) => order.ExpiredTime >= dto.BeginExpiredTime && order.ExpiredTime <= dto.EndExpiredTime)
+            .WhereIF(dto.ActualHandleOrgName.NotNullOrEmpty(), (snapshot, order) => order.ActualHandleOrgName == dto.ActualHandleOrgName)
+            .WhereIF(dto.AcceptType.NotNullOrEmpty(), (snapshot, order) => order.AcceptType == dto.AcceptType)
+            .WhereIF(dto.HotspotName.NotNullOrEmpty(), (snapshot, order) => order.HotspotName == dto.HotspotName)
+            .WhereIF(dto.AcceptorName.NotNullOrEmpty(), (snapshot, order) => order.AcceptorName == dto.AcceptorName)
+            .WhereIF(dto.IndustryId.NotNullOrEmpty(), (snapshot, order) => snapshot.IndustryId == dto.IndustryId)
+            .Select((snapshot, order) => new DuplicateItemsOutDto(), true);
+        return query;
+    }
 }

+ 1 - 0
src/Hotline.Application/Snapshot/IBiSnapshotApplication.cs

@@ -53,4 +53,5 @@ public interface IBiSnapshotApplication
     /// <param name="dto"></param>
     /// <returns></returns>
     ISugarQueryable<GuiderWorkLogsOutDto> GetGuiderWorkLogs(GuiderWorkLogsInDto dto);
+    ISugarQueryable<DuplicateItemsOutDto> GetDuplicateItems(DuplicateItemsInDto dto);
 }

+ 111 - 0
src/Hotline.Share/Dtos/Snapshot/StatisticsDto.cs

@@ -1740,6 +1740,78 @@ public record GuiderWorkLogsInDto : PagedRequest
     public DateTime? EndCreationTime { get; set; }
 }
 
+public record DuplicateItemsInDto : PagedRequest
+{
+    /// <summary>
+    /// 编号
+    /// </summary>
+    public string? No { get; set; }
+
+    /// <summary>
+    /// 标题
+    /// </summary>
+    public string? Title { get; set; }
+
+    /// <summary>
+    /// 来电号码
+    /// </summary>
+    public string? FromPhone { get; set; }
+
+    /// <summary>
+    /// 联系号码
+    /// </summary>
+    public string? Contact { get; set; }
+
+    /// <summary>
+    /// 来电人
+    /// </summary>
+    public string? FromName { get; set; }
+
+    /// <summary>
+    /// 受理时间
+    /// </summary>
+    public DateTime? BeginCreationTime { get; set; }
+
+    /// <summary>
+    /// 受理时间
+    /// </summary>
+    public DateTime? EndCreationTime { get; set; }
+
+    /// <summary>
+    /// 期满时间开始
+    /// </summary>
+    public DateTime? BeginExpiredTime { get; set; }
+
+    /// <summary>
+    /// 期满时间结束
+    /// </summary>
+    public DateTime? EndExpiredTime { get; set; }
+
+    /// <summary>
+    /// 接办部门
+    /// </summary>
+    public string? ActualHandleOrgName { get; set; }
+
+    /// <summary>
+    /// 受理类型
+    /// </summary>
+    public string? AcceptType { get; set; }
+
+    /// <summary>
+    /// 热点类型
+    /// </summary>
+    public string? HotspotName { get; set; }
+
+    /// <summary>
+    /// 受理人
+    /// </summary>
+    public string? AcceptorName { get; set; }
+
+    /// <summary>
+    /// 行业Id
+    /// </summary>
+    public string? IndustryId { get; set; }
+}
 public class DuplicateItemsOutDto 
 {
     /// <summary>
@@ -1752,6 +1824,16 @@ public class DuplicateItemsOutDto
     /// </summary>
     public string? No { get; set; }
 
+    /// <summary>
+    /// 类型
+    /// </summary>
+    public string? OrderSnapshotType { get; set; }
+
+    /// <summary>
+    /// 重复工单Id
+    /// </summary>
+    public List<string>? DuplicateIds { get; set; }
+
     /// <summary>
     /// 标题
     /// </summary>
@@ -1787,4 +1869,33 @@ public class DuplicateItemsOutDto
     /// </summary>
     public DateTime? EndCreationTime { get; set; }
 
+    /// <summary>
+    /// 行业
+    /// </summary>
+    public string IndustryName { get; set; }
+
+    /// <summary>
+    /// 接办部门
+    /// </summary>
+    public string ActualHandleOrgName { get; set; }
+
+    /// <summary>
+    /// 接办时间
+    /// </summary>
+    public DateTime? StartTime { get; set; }
+
+    /// <summary>
+    /// 办结时间
+    /// </summary>
+    public DateTime? FiledTime { get; set; }
+
+    /// <summary>
+    /// 受理类型
+    /// </summary>
+    public string AcceptType { get; set; }
+
+    /// <summary>
+    /// 受理人
+    /// </summary>
+    public string AcceptorName { get; set; }
 }