Explorar el Código

团组汇率
通用 增加 实体类请求参数

leiy hace 1 año
padre
commit
1fadf81e82

+ 11 - 5
OASystem/OASystem.Api/Controllers/BusinessController.cs

@@ -4,6 +4,7 @@ using OASystem.API.OAMethodLib.ALiYun;
 using OASystem.API.OAMethodLib.ExcelOutput;
 using OASystem.Domain.Common;
 using OASystem.Domain.Dtos.Business;
+using OASystem.Domain.Dtos.Financial;
 using OASystem.Domain.Dtos.Groups;
 using OASystem.Domain.Entities.Business;
 using OASystem.Domain.Entities.Groups;
@@ -118,25 +119,30 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> PostGroupTeamRateByDiIdAndCTableId(int portType, int diId,int CTbale)
+        public async Task<IActionResult> PostGroupTeamRateByDiIdAndCTableId(GeneralTeamRateInfoDto dto)
         {
             try
             {
-                if (diId == 0)
+                if (dto == null)
+                {
+                    return Ok(JsonView(false, "请输入参数!"));
+                }
+
+                if (dto.DiId == 0)
                 {
                     return Ok(JsonView(false, "请输入正确的团组Id!"));
                 }
-                if (CTbale == 0)
+                if (dto.CTbale == 0)
                 {
                     return Ok(JsonView(false, "请输入正确的业务类型(CTable)Id!"));
                 }
 
 
-                if (portType == 1 || portType == 2 || portType == 3 )
+                if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3 )
                 {
                     string teamRateInfoSql = string.Format(@"Select sd.Name,tr.* From Grp_TeamRate tr 
                                                      Left Join Sys_SetData  sd On sd.IsDel=0 And sd.STid=16  And tr.CTable = sd.Id 
-                                                     Where tr.IsDel = 0 And tr.DiId = {0} And tr.CTable = {1}", diId,CTbale);
+                                                     Where tr.IsDel = 0 And tr.DiId = {0} And tr.CTable = {1}", dto.DiId,dto.CTbale);
 
                     var teamRateInfo = await _teamRateRep._sqlSugar.SqlQueryable<TeamRateInfoView>(teamRateInfoSql).ToListAsync();
 

+ 17 - 0
OASystem/OASystem.Domain/Dtos/Financial/TeamRateDto.cs

@@ -68,4 +68,21 @@ namespace OASystem.Domain.Dtos.Financial
         /// </summary>
         public List<TeamRateDescView>? teamRates { get; set; }
     }
+
+    /// <summary>
+    /// 通用团组汇率 Dto
+    /// </summary>
+    public class GeneralTeamRateInfoDto:PortDtoBase
+    {
+        /// <summary>
+        /// 团组Id
+        /// </summary>
+        public int DiId { get; set; }
+
+        /// <summary>
+        /// 业务类型Id
+        /// 酒店预定,机票预定,等等
+        /// </summary>
+        public int CTbale { get; set; }
+    }
 }