Bladeren bron

Merge branch 'develop' of http://132.232.92.186:3000/XinXiBu/OA2023 into develop

Lyyyi 17 uur geleden
bovenliggende
commit
1e54acaaf6

+ 72 - 0
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -26379,6 +26379,12 @@ ORDER BY
             .Where(x => x.IsDel == 0 && x.STid == 119)
             .Select(x => new { x.Id, Text = x.Name })
             .ToListAsync();
+            var FileType = new[]
+            {
+                new { Id = 0 , Name = "成本下载" },
+                new { Id = 1 , Name = "报价下载" },
+                new { Id = 2 , Name = "总表下载" },
+            };
 
             var GM = new List<int>();
             var permissionControlDB = _sqlSugar.Queryable<Sys_SetData>().First(x => x.Id == 1448)?.Remark;
@@ -26617,6 +26623,72 @@ ORDER BY
 
             return Ok(JsonView(true, "操作成功!", count));
         }
+
+        /// <summary>
+        /// 团组会务成本文件下载
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        public async Task<IActionResult> ConferenceAffairsFileDown(ConferenceAffairsFileDownDto Dto)
+        {
+            var FileType = new[]
+            {
+                new { Id = 0 , Name = "成本下载" },
+                new { Id = 1 , Name = "报价下载" },
+                new { Id = 2 , Name = "总表下载" },
+            };
+
+            if (Dto.GroupId < 1) return Ok(JsonView(false, "请传入有效的Id"));
+            if (Dto.FileTypeId < 0 || Dto.FileTypeId > 2) return Ok(JsonView(false, "请传入有效的文件类型"));
+
+            var di = _sqlSugar.Queryable<Grp_DelegationInfo>()
+                     .Where(x => x.IsDel == 0 && x.Id == Dto.GroupId)
+                     .Select<DelegationEasyView>()
+                     .First();
+
+            var main = _sqlSugar.Queryable<Grp_ConferenceAffairsCost>()
+                     .First(x => x.Diid == Dto.GroupId && x.IsDel == 0);
+            var chi = _sqlSugar.Queryable<Grp_ConferenceAffairsCostChild>()
+                     .Where(x => x.Diid == Dto.GroupId && x.IsDel == 0 && x.ConferenceAffairsCostId == main.Id);
+
+            if (main == null)
+            {
+                return Ok(JsonView(false, "团组会务成本信息不存在!"));
+            }
+
+            if (Dto.FileTypeId == 0)
+            {
+
+            }
+            else if (Dto.FileTypeId == 1)
+            {
+                //报价下载
+                var filePath = $"{AppSettingsHelper.Get("GrpFileBasePath")}ConferenceAffairs/Quote/{main.Diid}/";
+                if (!Directory.Exists(filePath))
+                {
+                    Directory.CreateDirectory(filePath);
+                }
+                var fileName = $"报价单_{di.TeamName}_{DateTime.Now.ToString("yyyyMMddHHmmss")}.xlsx";
+                var fullPath = Path.Combine(filePath, fileName);
+
+
+            }
+            else if (Dto.FileTypeId == 2)
+            {
+                //总表下载
+                var filePath = $"{AppSettingsHelper.Get("GrpFileBasePath")}ConferenceAffairs/Total/{main.Diid}/";
+                if (!Directory.Exists(filePath))
+                {
+                    Directory.CreateDirectory(filePath);
+                }
+                var fileName = $"总表_{di.TeamName}_{DateTime.Now.ToString("yyyyMMddHHmmss")}.xlsx";
+                var fullPath = Path.Combine(filePath, fileName);
+
+
+            } 
+
+            throw new NotImplementedException("文件下载功能尚未实现!");
+        }
         #endregion
 
         #region 团组签证流程

+ 6 - 0
OASystem/OASystem.Domain/Dtos/Groups/ConferenceAffairsInIt.cs

@@ -65,4 +65,10 @@ namespace OASystem.Domain.Dtos.Groups
         /// </summary>
         public int CreateUserId { get; set; }
     }
+
+    public class ConferenceAffairsFileDownDto
+    {
+        public int FileTypeId { get; set; }
+        public int GroupId { get; set; }
+    }
 }