diff --git a/Myshipping.Application/Entity/TaskManagePlat/TaskManageDbEntity.cs b/Myshipping.Application/Entity/TaskManagePlat/TaskManageDbEntity.cs index 5c0bb34b..a454aa87 100644 --- a/Myshipping.Application/Entity/TaskManagePlat/TaskManageDbEntity.cs +++ b/Myshipping.Application/Entity/TaskManagePlat/TaskManageDbEntity.cs @@ -30,7 +30,7 @@ namespace Myshipping.Application.Entity /// /// 创建人ID /// - public virtual string CreatedUserId { get; set; } + public virtual long CreatedUserId { get; set; } /// /// 创建人名称 @@ -40,7 +40,7 @@ namespace Myshipping.Application.Entity /// /// 修改人ID /// - public virtual string UpdatedUserId { get; set; } + public virtual long UpdatedUserId { get; set; } /// /// 修改人名称 diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index d2fb54a1..c415fb2d 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -2761,10 +2761,11 @@ namespace Myshipping.Application if (!string.IsNullOrWhiteSpace(strCheck)) { - //if (Regex.IsMatch(strCheck, "\\")) - //{ - // strCheck = Regex.Replace(strCheck, "\\", "\\r\\n"); - //} + if (Regex.IsMatch(strCheck, "\\")) + { + strCheck = Regex.Replace(strCheck, "\\", "\n"); + } + throw Oops.Bah($"发送{EDIRouteEnum.PIL.ToString()}校验失败,{strCheck}"); } @@ -2783,10 +2784,10 @@ namespace Myshipping.Application if (!string.IsNullOrWhiteSpace(strCheck)) { - //if (Regex.IsMatch(strCheck, "\\")) - //{ - // strCheck = Regex.Replace(strCheck, "\\", "\\r\\n"); - //} + if (Regex.IsMatch(strCheck, "\\")) + { + strCheck = Regex.Replace(strCheck, "\\", "\n"); + } throw Oops.Bah($"发送{EDIRouteEnum.PIL.ToString()}校验失败,{strCheck}"); } @@ -2815,10 +2816,10 @@ namespace Myshipping.Application if (!string.IsNullOrWhiteSpace(strCheck)) { - //if (Regex.IsMatch(strCheck, "\\")) - //{ - // strCheck = Regex.Replace(strCheck, "\\", "\\r\\n"); - //} + if (Regex.IsMatch(strCheck, "\\")) + { + strCheck = Regex.Replace(strCheck, "\\", "\n"); + } throw Oops.Bah($"发送{EDIRouteEnum.PIL.ToString()}校验失败,{strCheck}"); } @@ -2837,6 +2838,11 @@ namespace Myshipping.Application if (!string.IsNullOrWhiteSpace(strCheck)) { + if (Regex.IsMatch(strCheck, "\\")) + { + strCheck = Regex.Replace(strCheck, "\\", "\n"); + } + throw Oops.Bah($"发送{EDIRouteEnum.PIL.ToString()}校验失败,{strCheck}"); } @@ -2864,10 +2870,10 @@ namespace Myshipping.Application if (!string.IsNullOrWhiteSpace(strCheck)) { - //if (Regex.IsMatch(strCheck, "\\")) - //{ - // strCheck = Regex.Replace(strCheck, "\\", "
"); - //} + if (Regex.IsMatch(strCheck, "\\")) + { + strCheck = Regex.Replace(strCheck, "\\", "\n"); + } throw Oops.Bah($"发送{EDIRouteEnum.PIL.ToString()}校验失败,{strCheck}"); } diff --git a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskUserStatItem.cs b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskUserStatItem.cs new file mode 100644 index 00000000..41febe26 --- /dev/null +++ b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskUserStatItem.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Myshipping.Application +{ + /// + /// 用户任务统计展示 + /// + public class TaskUserStatItem + { + /// + /// 级别分层(1-异常/个人/公共 2-待处理/已完成/已取消/已挂起 3-按照任务类型展示) + /// + public int Level { get; set; } + + /// + /// 排序值 + /// + public int SortNo { get; set; } + + /// + /// 展示代码 + /// + public string Key { get; set; } + + /// + /// 展示名称 + /// + public string Name { get; set; } + + /// + /// 记录条数 + /// + public int Total { get; set; } + + /// + /// 执行KEY + /// + public string ActionKey { get; set; } + + } +} diff --git a/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageService.cs b/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageService.cs index a118def2..92900767 100644 --- a/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageService.cs @@ -30,6 +30,6 @@ namespace Myshipping.Application ///
/// 是否强制计算 /// 返回回执 - Task GetCurrentTotalStat(bool isReCalc = false); + Task> GetCurrentTotalStat(bool isReCalc = false); } } diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs index 726528e9..6468761a 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs @@ -6,11 +6,13 @@ using Furion.RemoteRequest; using Mapster; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.Extensions.Logging; using Myshipping.Application.Entity; using Myshipping.Core; using Myshipping.Core.Entity; using MySqlX.XDevAPI.Common; +using SqlSugar; using System; using System.Collections.Generic; using System.IO; @@ -314,9 +316,9 @@ namespace Myshipping.Application ///
/// 是否强制计算 /// 返回回执 - public async Task GetCurrentTotalStat(bool isReCalc = false) + public async Task> GetCurrentTotalStat(bool isReCalc = false) { - TaskManageOrderResultDto result = new TaskManageOrderResultDto(); + List resultList = new List(); /* 1、首先判断当前登陆人是否有统计记录,如果没有触发统计生成统计记录。 @@ -339,20 +341,25 @@ namespace Myshipping.Application if (!isReCalc) { - //异步统计任务 - } - - + //任务列表分组统计 + var groupList = _taskBaseInfoRepository.AsQueryable() + .Where(t => (t.CreatedUserId == UserManager.UserId && t.IS_PUBLIC == 0) || (t.TenantId == userTendInfo.Tend.Id && t.IS_PUBLIC == 1)) + .GroupBy(p => new { p.TASK_TYPE, p.STATUS, p.IS_EXCEPT, p.IS_PUBLIC }) + .Select(p => new + { + Total = SqlFunc.AggregateCount(p.PK_ID), + TaskType = p + }).ToList(); + } } catch (Exception ex) { - result.succ = false; - result.msg = ex.Message; + throw Oops.Bah($"获取登陆人相关的任务统计信息异常,{0}", ex.Message); } - return result; + return resultList; } } }