tangjiang пре 2 недеља
родитељ
комит
15a8b689d8
1 измењених фајлова са 6 додато и 2 уклоњено
  1. 6 2
      src/Hotline.Application/StatisticalReport/OrderReportApplication.cs

+ 6 - 2
src/Hotline.Application/StatisticalReport/OrderReportApplication.cs

@@ -346,6 +346,10 @@ namespace Hotline.Application.StatisticalReport
             if (string.IsNullOrEmpty(dto.ParentOrgCode) && dto.OrgCode == _sessionContext.RequiredOrgId)
                 dto.ParentOrgCode = _sessionContext.RequiredOrgId;
 
+            bool isEmpy = false;
+            if (string.IsNullOrEmpty(dto.ParentOrgCode))
+                isEmpy = true;
+
             if (string.IsNullOrEmpty(dto.ParentOrgCode) && string.IsNullOrEmpty(dto.OrgCode))
                 dto.ParentOrgCode = _sessionContext.RequiredOrgId;
 
@@ -362,7 +366,7 @@ namespace Hotline.Application.StatisticalReport
                                .WhereIF(dto.OrgCode != "001" && !string.IsNullOrEmpty(dto.OrgCode) && dto.OrgCode != dto.ParentOrgCode, o => o.ActualHandleOrgCode.StartsWith(dto.OrgCode))
                                .WhereIF(dto.OrgCode != "001" && !string.IsNullOrEmpty(dto.OrgCode) && dto.OrgCode == dto.ParentOrgCode, o => o.ActualHandleOrgCode == dto.OrgCode)
 
-                               .WhereIF(dto.ParentOrgCode == "001" && string.IsNullOrEmpty(dto.OrgCode) && !string.IsNullOrEmpty(dto.ParentOrgCode),
+                               .WhereIF(dto.ParentOrgCode == "001" && isEmpy == false && string.IsNullOrEmpty(dto.OrgCode) && !string.IsNullOrEmpty(dto.ParentOrgCode),
                                o => o.ActualHandleOrgCode == dto.ParentOrgCode)
                                .WhereIF(dto.ParentOrgCode != "001" && string.IsNullOrEmpty(dto.OrgCode) && !string.IsNullOrEmpty(dto.ParentOrgCode),
                                o => o.ActualHandleOrgCode.StartsWith(dto.ParentOrgCode))
@@ -381,7 +385,7 @@ namespace Hotline.Application.StatisticalReport
                              .WhereIF(dto.OrgCode != "001" && !string.IsNullOrEmpty(dto.OrgCode) && dto.OrgCode != dto.ParentOrgCode, (t, o) => t.HandlerOrgId.StartsWith(dto.OrgCode))
                              .WhereIF(dto.OrgCode != "001" && !string.IsNullOrEmpty(dto.OrgCode) && dto.OrgCode == dto.ParentOrgCode, (t, o) => t.HandlerOrgId == dto.OrgCode)
 
-                             .WhereIF(dto.ParentOrgCode == "001" && string.IsNullOrEmpty(dto.OrgCode) && !string.IsNullOrEmpty(dto.ParentOrgCode),
+                             .WhereIF(dto.ParentOrgCode == "001" && isEmpy == false && string.IsNullOrEmpty(dto.OrgCode) && !string.IsNullOrEmpty(dto.ParentOrgCode),
                                (t, o) => t.HandlerOrgId == dto.ParentOrgCode)
                                .WhereIF(dto.ParentOrgCode != "001" && string.IsNullOrEmpty(dto.OrgCode) && !string.IsNullOrEmpty(dto.ParentOrgCode),
                               (t, o) => t.HandlerOrgId.StartsWith(dto.ParentOrgCode))