Procházet zdrojové kódy

新增出入境费用文件类型获取方法

在 `GroupsController.cs` 中新增 `EnterExitCostFileOwner` 异步方法,根据省份 ID 获取出入境费用的文件类型列表,并进行了参数验证和数据返回。同时更新了 `EnterExitCostDraftFileOwner` 方法的注释,修正了拼写错误。

在 `EnterExitCostRepository.cs` 中修改返回消息内容,提升可读性和准确性。
LEIYI před 1 týdnem
rodič
revize
39a2263d90

+ 26 - 1
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -5640,6 +5640,31 @@ FROM
             }));
         }
 
+        /// <summary>
+        /// 团组模块 - 出入境费用 - 文件类型list 跟据省份Id获取
+        /// </summary>
+        /// <returns></returns>
+        [HttpGet("{provinceId}")]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> EnterExitCostFileOwner([FromRoute] int provinceId = 122)
+        {
+            //验证城市归属并给默认值
+            if (provinceId < 1) provinceId = 122;
+
+            /*
+             * 122 四川
+             * 108 贵州
+             * 103 重庆
+             * 132 云南
+             */
+            (SetDataInfoView[] wordTypeData, SetDataInfoView[] excelTypeData) = await _enterExitCostDraftRep.FileOwner(provinceId);
+
+            return Ok(JsonView(true, "查询成功!", new
+            {
+                WordTypeData = wordTypeData,
+                ExcelTypeData = excelTypeData,
+            }));
+        }
 
         /// <summary>
         /// 团组模块 - 出入境费用 
@@ -7769,7 +7794,7 @@ FROM
         }
 
         /// <summary>
-        /// 团组模块 - 出入境费用-草稿 - 文件类型list 据省份Id获取
+        /// 团组模块 - 出入境费用-草稿 - 文件类型list 据省份Id获取
         /// </summary>
         /// <returns></returns>
         [HttpGet("{provinceId}")]

+ 1 - 1
OASystem/OASystem.Domain/ViewModels/Groups/EnterExitCostDraftView.cs

@@ -37,7 +37,7 @@ namespace OASystem.Domain.ViewModels.Groups
         /// <summary>
         /// 归属省份Id
         /// </summary>
-        public int ProvinceId { get; set; }
+        public int ProvinceId { get; set; } = 122;
 
         /// <summary>
         /// 团组Id

+ 1 - 1
OASystem/OASystem.Infrastructure/Repositories/Groups/EnterExitCostRepository.cs

@@ -650,7 +650,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                             info.City.Contains(dto.City));
                     if (isNul != null)
                     {
-                        result.Msg = "该国家 城市已存在,请勿重复添加!";
+                        result.Msg = "该国家或者城市已存在,请勿重复添加!";
                         return result;
                     }