Browse Source

查询交易状态接口修改,春洲站不使用挂枪时间查询

DOVER-GLOBAL\11047086 1 year ago
parent
commit
1133343887

+ 2 - 3
src/MS.Services/Account/AccountService.cs

@@ -1175,10 +1175,9 @@ SELECT subquery.belong_to,subquery.accountId, count(*) count from (SELECT trx.ac
         /// <exception cref="NotImplementedException"></exception>
         public async Task<IEnumerable<string>> GetBuids()
         {
-            var businessUnitInfos = await _AccountingContext.GetRepository<BusinessUnitInfo>().GetAll()
+            var businessUnitInfos =await _AccountingContext.GetRepository<BusinessUnitInfo>().GetAll()
                 .Where(p => !p.BuName.Contains("集团")).Where(o => !o.BuName.Contains("公司")).ToListAsync();
-            if (businessUnitInfos != null && businessUnitInfos.Any())
-            {
+            if (businessUnitInfos!=null&&businessUnitInfos.Any()) {
                 return businessUnitInfos.Select(p => p.Id.ToString()).ToList();
             }
             return null;

+ 9 - 5
src/MS.WebApi/Controllers/ReportController.cs

@@ -144,37 +144,41 @@ namespace MS.WebApi.Controllers
             var buids =await _AccountService.GetBuids();
             _logger.LogInformation($"buids 个数 {buids}  time:{DateTime.Now}");
             var bassAddress = _configuration.GetSection(ReportServerUrl).Value;
-            HttpClient httpClient = new HttpClient();
-            httpClient.BaseAddress=new Uri(bassAddress);
+          
             foreach (var buid in buids)
             {
                 //日执行
                 if (type == 1 || type == 9999)
                 {
-                    
+                    HttpClient httpClient = new HttpClient();
+                    httpClient.BaseAddress = new Uri(bassAddress);
                     var url = $"/api/Report/BusinessScopeReportTimeJob?pageNumber=0&pageCount=5&reportType=day&startTime={DateTime.Now.AddDays(-5)}&key=TK2024Cache&buid={buid}";
                     if (type == 9999)
                     {
                         url = $"/api/Report/BusinessScopeReportTimeJob?pageNumber=0&pageCount=80&reportType=day&startTime={DateTime.Now.AddMonths(-3)}&key=TK2024Cache&buid={buid}";
                     }
                     var result=await httpClient.GetAsync(url);
-                    _logger.LogInformation($"{buid}日报表 统计执行完成 {result.StatusCode}-{result.Content.ToString()}  time:{DateTime.Now}");
+                    _logger.LogInformation($"{buid}日报表 统计执行完成 {result.StatusCode}-{await result.Content.ReadAsStringAsync()}  time:{DateTime.Now}");
                 }
                 //周执行
                 if (type == 2 || type == 9999)
                 {
+                    HttpClient httpClient = new HttpClient();
+                    httpClient.BaseAddress = new Uri(bassAddress);
                     var url = $"/api/Report/BusinessScopeReportTimeJob?pageNumber=0&pageCount=2&reportType=week&startTime={DateTime.Now.AddDays(-20)}&key=TK2024Cache&buid={buid}";
                     if (type == 9999)
                     {
                         url = $"/api/Report/BusinessScopeReportTimeJob?pageNumber=0&pageCount=20&reportType=week&startTime={DateTime.Now.AddMonths(-6)}&key=TK2024Cache&buid={buid}";
                     }
                     var result = await httpClient.GetAsync(url);
-                    _logger.LogInformation($"{buid}周报表 统计执行完成 {result.StatusCode}-{result.Content.ToString()}  time:{DateTime.Now}");
+                    _logger.LogInformation($"{buid} week 周报表 统计执行完成 {result.StatusCode}-{result.Content.ToString()}  time:{DateTime.Now}");
 
                 }
                 //月执行
                 if (type == 3 || type == 9999)
                 {
+                    HttpClient httpClient = new HttpClient();
+                    httpClient.BaseAddress = new Uri(bassAddress);
                     var url = $"/api/Report/BusinessScopeReportTimeJob?pageNumber=0&pageCount=2&reportType=month&startTime={DateTime.Now.AddMonths(-2)}&key=TK2024Cache&buid={buid}";
                     if (type == 9999)
                     {