Browse Source

添加三字码Id查询

yuanrf 9 months ago
parent
commit
5fd128e1b9

+ 29 - 0
OASystem/OASystem.Api/Controllers/ResourceController.cs

@@ -563,6 +563,35 @@ namespace OASystem.API.Controllers
                 throw;
             }
         }
+
+
+        /// <summary>
+        ///根据ID查询三字码信息
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult QuerySingleThreeCode(QuerySingleThreeCode dto)
+        {
+            var jw = JsonView(false);
+            var single = _sqlSugar.Queryable<Res_ThreeCode>().First(x => x.Id == dto.ID && x.IsDel == 0);
+            if (single != null)
+            {
+                jw = JsonView(true, "获取成功!", new
+                {
+                    single.Three,
+                    Four = single.Four?.Trim(),
+                    single.AirPort,
+                    single.AirPort_En,
+                    single.City, single.Country,
+                });
+            }
+            else
+            {
+                jw.Msg = "暂无!";
+            }
+
+            return Ok(jw);
+        }
         #endregion
 
         #region 代理出票合作方资料

+ 11 - 0
OASystem/OASystem.Domain/Dtos/Resource/ThreeCodeDto.cs

@@ -17,6 +17,17 @@ namespace OASystem.Domain.Dtos.Resource
         /// </summary>
         public string City { get; set; }
     }
+
+    public class QuerySingleThreeCode
+    {
+
+        /// <summary>
+        /// 三字码id
+        /// </summary>
+        public int ID { get; set;}
+    }
+
+
     public class ThreeCodeOperationDto
     {
         /// <summary>