Просмотр исходного кода

公务出访 新增API PostOfficialActivitiesReqReqSampleTips(请示范例提示)

leiy 1 год назад
Родитель
Сommit
04a52c709d

+ 20 - 1
OASystem/OASystem.Api/Controllers/ResourceController.cs

@@ -1750,6 +1750,26 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
         }
 
 
+
+        /// <summary>
+        /// 公务出访
+        /// 请示范例提示 
+        /// Add Time:2024-05-13 13:56:44
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> PostOfficialActivitiesReqReqSampleTips(PostOfficialActivitiesReqReqSampleTipsDto dto)
+        {
+            var res = await _officialActivitiesRep.PostReqReqSampleTips(dto.country, dto.area);
+            if (res.Code == 0)
+            {
+                return Ok(JsonView(true, "操作成功!", res.Data));
+            }
+            return Ok(JsonView(false, res.Msg));
+        }
+
         /// <summary>
         /// 公务出访 (省外办,市外办) File Downlaod
         /// </summary>
@@ -1975,7 +1995,6 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
             else if (num == 9) numStr = "九";
             else if (num == 10) numStr = "十";
 
-
             return numStr;
         }
 

+ 6 - 0
OASystem/OASystem.Domain/Dtos/Resource/OfficialActivitiesDto.cs

@@ -151,4 +151,10 @@ namespace OASystem.Domain.Dtos.Resource
 
         public int[] IdList { get; set; }
     }
+
+    public class PostOfficialActivitiesReqReqSampleTipsDto
+    {
+        public string country { get; set; }
+        public string area { get; set; }
+    }
 }

+ 18 - 1
OASystem/OASystem.Domain/ViewModels/Resource/OfficialActivitiesView.cs

@@ -7,9 +7,26 @@ using System.Threading.Tasks;
 
 namespace OASystem.Domain.ViewModels.Resource
 {
-    public class OfficialActivitiesView:Res_OfficialActivities
+    public class OfficialActivitiesView : Res_OfficialActivities
     {
         public string CreateUserName { get; set; }
         public string OfficialFormName { get; set; }
     }
+
+    /// <summary>
+    /// 请示范例 Tips View
+    /// </summary>
+    public class ReqReqSampleTipsView
+    {
+        public string TeamName { get; set; }
+
+        public string Country { get; set; }
+
+        public string Area { get; set; }
+
+        public string Client { get; set; }
+
+        public string ReqSample { get; set; }
+    }
+
 }

+ 23 - 2
OASystem/OASystem.Infrastructure/Repositories/Resource/OfficialActivitiesRepository.cs

@@ -22,8 +22,6 @@ namespace OASystem.Infrastructure.Repositories.Resource
             _mapper = mapper;
         }
 
-
-
         /// <summary>
         /// 根据Diid查询公务出访数据List
         /// </summary>
@@ -282,5 +280,28 @@ namespace OASystem.Infrastructure.Repositories.Resource
             }
             return result;
         }
+
+        public async Task<Result> PostReqReqSampleTips(string country, string Area)
+        {
+            if (string.IsNullOrEmpty(country)) return new Result() { Code = -1, Msg = "国家为空!" };
+
+            string sqlWhere = string.Empty;
+            if (!string.IsNullOrEmpty(Area)) sqlWhere = string.Format(@$" And oa.Area Like '%{Area}%'");
+
+            string sql = string.Format(@$"Select di.TeamName,oa.Id,oa.Country,oa.Area,oa.Client,oa.ReqSample 
+                                          From Res_OfficialActivities oa With(NoLock)
+                                          Left Join Grp_DelegationInfo di On oa.DiId = di.Id 
+                                          Where oa.IsDel = 0 And oa.Country='{country}' {sqlWhere}");
+
+            //ReqReqSampleTipsView
+            var _views = await _sqlSugar.SqlQueryable< ReqReqSampleTipsView >(sql).ToListAsync();
+            if (_views.Count > 0 )
+            {
+                return new Result() { Code = 0, Msg = "操作成功!", Data = _views };
+            }
+
+            return new Result() { Code = -1, Msg = "暂无相关数据!" };
+        }
+
     }
 }