Browse Source

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

amigotrip 9 months ago
parent
commit
5f0301173e

+ 44 - 34
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -3572,25 +3572,25 @@ namespace OASystem.API.Controllers
         {
         {
             var jw = JsonView(false);
             var jw = JsonView(false);
 
 
-            if (dto.File == null)
+            if (dto.Files == null || dto.Files.Count == 0)
             {
             {
                 jw.Msg = "无文件信息!";
                 jw.Msg = "无文件信息!";
                 return Ok(jw);
                 return Ok(jw);
             }
             }
 
 
-            var nameSp = dto.File.FileName.Split(".");
-            if (nameSp.Length < 2)
-            {
-                jw.Msg = "拓展名称有误!";
-                return Ok(jw);
-            }
+            //var nameSp = dto.File.FileName.Split(".");
+            //if (nameSp.Length < 2)
+            //{
+            //    jw.Msg = "拓展名称有误!";
+            //    return Ok(jw);
+            //}
 
 
-            var existsName = new string[]{ "RAR", "ZIP", "ARJ","GZ","Z","7Z","TAR" };
-            if (!existsName.Contains(nameSp[1].ToUpper()))
-            {
-                jw.Msg = $"请使用指定拓展名!({string.Join("-",existsName)})";
-                return Ok(jw);
-            }
+            //var existsName = new string[]{ "RAR", "ZIP", "ARJ","GZ","Z","7Z","TAR" };
+            //if (!existsName.Contains(nameSp[1].ToUpper()))
+            //{
+            //    jw.Msg = $"请使用指定拓展名!({string.Join("-",existsName)})";
+            //    return Ok(jw);
+            //}
 
 
             var Ctable = _sqlSugar.Queryable<Sys_SetData>().First(x => x.STid == 16 && x.IsDel == 0 && x.Id == dto.Ctable);
             var Ctable = _sqlSugar.Queryable<Sys_SetData>().First(x => x.STid == 16 && x.IsDel == 0 && x.Id == dto.Ctable);
             if (Ctable == null)
             if (Ctable == null)
@@ -3621,38 +3621,49 @@ namespace OASystem.API.Controllers
                     Directory.CreateDirectory(fileBase);
                     Directory.CreateDirectory(fileBase);
                 }
                 }
 
 
-                var saveFilePath = fileBase +"\\"+ dto.File.FileName;
+                List<Grp_GroupModelFile> saveArr = new List<Grp_GroupModelFile>();
 
 
-                Grp_GroupModelFile file = new Grp_GroupModelFile()
+                foreach (var fileStream in dto.Files)
                 {
                 {
-                    Cid = dto.Cid,
-                    CreateTime = DateTime.Now,
-                    CreateUserId = dto.Userid,
-                    Ctable = dto.Ctable,
-                    Diid = dto.Diid,
-                    IsDel = 0,
-                    FilePath = saveFilePath,
-                    FileName = nameSp[0]
-                };
+                    var saveFilePath = fileBase + "\\" + fileStream.FileName;
 
 
-                using (FileStream fs = System.IO.File.Create(saveFilePath))
-                {
-                    dto.File.CopyTo(fs);
-                    fs.Flush();
+                    Grp_GroupModelFile file = new Grp_GroupModelFile()
+                    {
+                        Cid = dto.Cid,
+                        CreateTime = DateTime.Now,
+                        CreateUserId = dto.Userid,
+                        Ctable = dto.Ctable,
+                        Diid = dto.Diid,
+                        IsDel = 0,
+                        FilePath = saveFilePath,
+                        FileName = fileStream.FileName
+                    };
+
+                    using (FileStream fs = System.IO.File.Create(saveFilePath))
+                    {
+                        fileStream.CopyTo(fs);
+                        fs.Flush();
+                    }
+
+                    saveArr.Add(file);
                 }
                 }
 
 
-                var addResult = _sqlSugar.Insertable<Grp_GroupModelFile>(file).ExecuteCommand();
+                var addResult = _sqlSugar.Insertable<Grp_GroupModelFile>(saveArr).ExecuteCommand();
+
+                //url = AppSettingsHelper.Get("WordBaseUrl") + AppSettingsHelper.Get("GrpFileFtpPath") + path + "\\" + dto.File.FileName
 
 
                 jw = JsonView(true, "保存成功!", new
                 jw = JsonView(true, "保存成功!", new
                 {
                 {
-                    url = AppSettingsHelper.Get("WordBaseUrl") + AppSettingsHelper.Get("GrpFileFtpPath") + path + "\\" + dto.File.FileName
-                });
+                    count = addResult,
+                    filesName = saveArr.Select(x => x.FileName)
+                }) ;
             }
             }
             catch (Exception ex)
             catch (Exception ex)
             {
             {
                 jw = JsonView(false, $"保存失败! ({ex.Message}) ", new
                 jw = JsonView(false, $"保存失败! ({ex.Message}) ", new
                 {
                 {
-                    url = ""
+                    count = 0,
+                    filesName = new string[0],
                 }) ;
                 }) ;
             }
             }
 
 
@@ -3703,8 +3714,7 @@ namespace OASystem.API.Controllers
                 var byts = io.ConvertZipStream(Zips);
                 var byts = io.ConvertZipStream(Zips);
                 var path = "\\GroupModelFiles\\" + groupInfo.TeamName;
                 var path = "\\GroupModelFiles\\" + groupInfo.TeamName;
                 io.ByteToFile(byts, AppSettingsHelper.Get("GrpFileBasePath") + $"{path}\\{groupInfo.TeamName}_.Zip");
                 io.ByteToFile(byts, AppSettingsHelper.Get("GrpFileBasePath") + $"{path}\\{groupInfo.TeamName}_.Zip");
-                //http://132.232.92.186:24/Office/Word/EnterExitCost/File/
-                jw = JsonView(true, "success", new { url = AppSettingsHelper.Get("GrpFileBasePath") + $"\\Office\\Excel\\ExportLocalGuidePriceDetail\\{groupInfo.TeamName}_地接费用明细.zip" });
+                jw = JsonView(true, "success", new { url = AppSettingsHelper.Get("GrpFileBaseUrl") + $"{AppSettingsHelper.Get("GrpFileFtpPath")}{path}\\{groupInfo.TeamName}_.zip" });
             }
             }
             else
             else
             {
             {

+ 1 - 1
OASystem/OASystem.Domain/Dtos/FileDto/FileDto.cs

@@ -27,7 +27,7 @@ namespace OASystem.Domain.Dtos.FileDto
 
 
     public class CommonSaveFileDto
     public class CommonSaveFileDto
     {
     {
-        public IFormFile File { get; set; }
+        public List<IFormFile> Files { get; set; }
         public int Ctable { get; set; }
         public int Ctable { get; set; }
         public int Diid { get; set; }
         public int Diid { get; set; }
 
 

+ 1 - 0
OASystem/OASystem.Domain/ViewModels/Groups/DecreasePaymentsView.cs

@@ -54,6 +54,7 @@ namespace OASystem.Domain.ViewModels.Groups
         public int VisitDays { get; set; }
         public int VisitDays { get; set; }
         public int VisitPNumber { get; set; }
         public int VisitPNumber { get; set; }
         public DateTime CreateTime { get; set; }
         public DateTime CreateTime { get; set; }
+        public string TeamLevSId { get; set; }
     }
     }
 
 
     public class DecreasePaymentsInfoView
     public class DecreasePaymentsInfoView

+ 1 - 0
OASystem/OASystem.Infrastructure/Repositories/Groups/DecreasePaymentsRepository.cs

@@ -78,6 +78,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 }
                 }
 
 
                 string sql = string.Format($@"Select 
                 string sql = string.Format($@"Select 
+                                        (select ssd.name from Sys_SetData ssd  WHERE  ssd.id  = di.TeamLevSId) as TeamLevSId,
                                         di.Id,
                                         di.Id,
 										di.TeamName,
 										di.TeamName,
 										di.ClientUnit,
 										di.ClientUnit,