leiy 1 year ago
parent
commit
42d760e74d

+ 12 - 3
OASystem/OASystem.Api/Controllers/ResourceController.cs

@@ -4,6 +4,7 @@ using OASystem.API.OAMethodLib;
 using OASystem.Domain.Dtos.Resource;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.ViewModels.Groups;
+using OASystem.Domain.ViewModels.QiYeWeChat;
 using OASystem.Infrastructure.Repositories.Groups;
 using Org.BouncyCastle.Utilities;
 using Quartz.Util;
@@ -709,13 +710,21 @@ namespace OASystem.API.Controllers
                                            ) Temp
                                          ", sqlWhere);
 
-            if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3)
+            if (dto.PortType == 1)
+            {
+                List<HotelDataItemView> HotelDataData = await _sqlSugar.SqlQueryable<HotelDataItemView>(sql).ToListAsync();
+                if (HotelDataData.Count == 0)
+                {
+                    return Ok(JsonView(false, "暂无数据"));
+                }
+                return Ok(JsonView(true, "操作成功", HotelDataData));
+            }
+            else if (dto.PortType == 2 || dto.PortType == 3)
             {
                 RefAsync<int> total = 0;//REF和OUT不支持异步,想要真的异步这是最优解
                 var data = await _sqlSugar.SqlQueryable<HotelDataItemView>(sql).ToPageListAsync(dto.PageIndex, dto.PageSize, total); //ToPageAsync
 
-                return Ok(JsonView(true, "操作成功", data,total));
-
+                return Ok(JsonView(true, "操作成功", data, total));
             }
             else return Ok(JsonView(false, "请传入PortType参数!1:Web,2:Android,3:IOS"));
 

+ 1 - 1
OASystem/OASystem.Infrastructure/Repositories/Resource/HotelDataRepository.cs

@@ -3,7 +3,6 @@ using OASystem.Domain;
 using OASystem.Domain.Dtos.Groups;
 using OASystem.Domain.Dtos.Resource;
 using OASystem.Domain.Entities.Resource;
-using OASystem.Domain.ViewModels.Groups;
 using OASystem.Domain.ViewModels.Resource;
 using System;
 using System.Collections.Generic;
@@ -72,5 +71,6 @@ namespace OASystem.Infrastructure.Repositories.Resource
                 return result = new Result() { Code = -1, Msg = "请传入Status参数,1添加 2修改!" };
             }
         }
+
     }
 }