From 27ac42327ab0183656bed36002cafbfdcc0137f0 Mon Sep 17 00:00:00 2001 From: zhangxiaofeng <1939543722@qq.com> Date: Thu, 1 Aug 2024 09:22:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=8F=B0=E5=8F=B0=E8=B4=A6?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TaskPlat/Method/TaskManageService.cs | 96 +++++++++---------- .../DS.WMS.TaskApi/appsettings.json | 2 + 2 files changed, 49 insertions(+), 49 deletions(-) diff --git a/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageService.cs b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageService.cs index 37b5c458..c10762b7 100644 --- a/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageService.cs +++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageService.cs @@ -1337,7 +1337,7 @@ namespace DS.WMS.Core.TaskPlat.Method //任务列表分组统计 var groupList = await tenantDb.Queryable() .LeftJoin((t, a) => t.Id == a.TaskId) - .Where((t, a) => t.IS_PUBLIC == 1 || (t.IS_PUBLIC == 0 && (t.CreateBy == userId || a.UserId == userId))) + .Where((t, a) => t.IS_PUBLIC == 1 || (t.IS_PUBLIC == 0 && a.Status != null && (t.CreateBy == userId || a.UserId == userId))) .GroupBy((t, a) => new { t.TASK_TYPE, t.STATUS, a.Status, t.IS_PUBLIC }) .Select((t, a) => new { @@ -1447,18 +1447,18 @@ namespace DS.WMS.Core.TaskPlat.Method .Select(t => new { Key = t.Key, Total = t.ToList().Sum(p => p.Total) }) .ToList().ForEach(t => { - TaskStatusEnum currEnum = (TaskStatusEnum)System.Enum.Parse(typeof(TaskStatusEnum), t.Key); - - nextList.Add(new TaskUserStatItemNext + if (Enum.TryParse(t.Key, out TaskStatusEnum currEnum)) { - TopKey = TaskStatLevelEnum.PERSON.ToString(), - Key = currEnum.ToString(), - Name = currEnum.EnumDescription(), - Total = t.Total, - SortNo = (int)currEnum, - ActionKey = $"{TaskStatLevelEnum.PERSON.ToString()}#{currEnum.ToString()}" - }); - + nextList.Add(new TaskUserStatItemNext + { + TopKey = TaskStatLevelEnum.PERSON.ToString(), + Key = currEnum.ToString(), + Name = currEnum.EnumDescription(), + Total = t.Total, + SortNo = (int)currEnum, + ActionKey = $"{TaskStatLevelEnum.PERSON}#{currEnum}" + }); + } }); if (nextList.Count > 0) @@ -1468,20 +1468,19 @@ namespace DS.WMS.Core.TaskPlat.Method .Select(t => new { Key = t.Key, Total = t.ToList().Sum(p => p.Total) }) .ToList().ForEach(t => { - //TaskBusiTypeEnum currEnum = (TaskBusiTypeEnum)System.Enum.Parse(typeof(TaskBusiTypeEnum), t.Key.TaskType); - TaskBaseTypeEnum currEnum = (TaskBaseTypeEnum)System.Enum.Parse(typeof(TaskBaseTypeEnum), t.Key.TaskType); - - resultInfo.LevelTree.Add(new TaskUserStatItemTree + if (Enum.TryParse(t.Key.TaskType, out TaskBaseTypeEnum currEnum)) { - TopKey = TaskStatLevelEnum.PERSON.ToString(), - NextKey = t.Key.AStatus, - Key = currEnum.ToString(), - Name = currEnum.EnumDescription(), - Total = t.Total, - SortNo = (int)currEnum, - ActionKey = $"{TaskStatLevelEnum.PERSON.ToString()}#{t.Key.AStatus}#{currEnum.ToString()}" - }); - + resultInfo.LevelTree.Add(new TaskUserStatItemTree + { + TopKey = TaskStatLevelEnum.PERSON.ToString(), + NextKey = t.Key.AStatus, + Key = currEnum.ToString(), + Name = currEnum.EnumDescription(), + Total = t.Total, + SortNo = (int)currEnum, + ActionKey = $"{TaskStatLevelEnum.PERSON}#{t.Key.AStatus}#{currEnum}" + }); + } }); } #endregion @@ -1504,18 +1503,18 @@ namespace DS.WMS.Core.TaskPlat.Method .Select(t => new { Key = t.Key, Total = t.ToList().Sum(p => p.Total) }) .ToList().ForEach(t => { - TaskStatusEnum currEnum = (TaskStatusEnum)System.Enum.Parse(typeof(TaskStatusEnum), t.Key); - - nextList.Add(new TaskUserStatItemNext + if (Enum.TryParse(t.Key, out TaskStatusEnum currEnum)) { - TopKey = TaskStatLevelEnum.PUBLIC.ToString(), - Key = currEnum.ToString(), - Name = currEnum.EnumDescription(), - Total = t.Total, - SortNo = (int)currEnum, - ActionKey = $"{TaskStatLevelEnum.PUBLIC.ToString()}#{currEnum.ToString()}" - }); - + nextList.Add(new TaskUserStatItemNext + { + TopKey = TaskStatLevelEnum.PUBLIC.ToString(), + Key = currEnum.ToString(), + Name = currEnum.EnumDescription(), + Total = t.Total, + SortNo = (int)currEnum, + ActionKey = $"{TaskStatLevelEnum.PUBLIC}#{currEnum}" + }); + } }); if (nextList.Count > 0) @@ -1525,20 +1524,19 @@ namespace DS.WMS.Core.TaskPlat.Method .Select(t => new { Key = t.Key, Total = t.ToList().Sum(p => p.Total) }) .ToList().ForEach(t => { - //TaskBusiTypeEnum currEnum = (TaskBusiTypeEnum)System.Enum.Parse(typeof(TaskBusiTypeEnum), t.Key.TaskType); - TaskBaseTypeEnum currEnum = (TaskBaseTypeEnum)System.Enum.Parse(typeof(TaskBaseTypeEnum), t.Key.TaskType); - - resultInfo.LevelTree.Add(new TaskUserStatItemTree + if (Enum.TryParse(t.Key.TaskType, out TaskBaseTypeEnum currEnum)) { - TopKey = TaskStatLevelEnum.PUBLIC.ToString(), - NextKey = t.Key.TStatus, - Key = currEnum.ToString(), - Name = currEnum.EnumDescription(), - Total = t.Total, - SortNo = (int)currEnum, - ActionKey = $"{TaskStatLevelEnum.PUBLIC.ToString()}#{t.Key.TStatus}#{currEnum.ToString()}" - }); - + resultInfo.LevelTree.Add(new TaskUserStatItemTree + { + TopKey = TaskStatLevelEnum.PUBLIC.ToString(), + NextKey = t.Key.TStatus, + Key = currEnum.ToString(), + Name = currEnum.EnumDescription(), + Total = t.Total, + SortNo = (int)currEnum, + ActionKey = $"{TaskStatLevelEnum.PUBLIC}#{t.Key.TStatus}#{currEnum}" + }); + } }); } #endregion diff --git a/ds-wms-service/DS.WMS.TaskApi/appsettings.json b/ds-wms-service/DS.WMS.TaskApi/appsettings.json index 7f9bd9f5..bbd06327 100644 --- a/ds-wms-service/DS.WMS.TaskApi/appsettings.json +++ b/ds-wms-service/DS.WMS.TaskApi/appsettings.json @@ -21,6 +21,7 @@ "DefaultDbConnId": "1288018625843826688", "DefaultDbType": 0, "DefaultDbString": "server=rm-m5e06xxqpa68a68ry5o.mysql.rds.aliyuncs.com;port=3306;uid=rulesengine_admin;pwd=Rule1qaz2wsx!QAZ;database=shippingweb8_dev", + //"DefaultDbString": "server=60.209.125.238;port=32006;uid=root;pwd=Djy@Mysql.test;database=shippingweb8_dev", "DBS": [ { "ConnId": "1288018625843826680", @@ -28,6 +29,7 @@ "Enabled": false, "HitRate": 40, "Connection": "server=rm-m5e06xxqpa68a68ry5o.mysql.rds.aliyuncs.com;port=3306;uid=rulesengine_admin;pwd=Rule1qaz2wsx!QAZ;database=shippingweb8_log" + // "Connection": "server=60.209.125.238;port=32006;uid=root;pwd=Djy@Mysql.test;database=shippingweb8_log" } ] },