Browse Source

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

jiangjc 2 months ago
parent
commit
e4c93bdbc7
1 changed files with 13 additions and 3 deletions
  1. 13 3
      OASystem/OASystem.Api/Controllers/ResourceController.cs

+ 13 - 3
OASystem/OASystem.Api/Controllers/ResourceController.cs

@@ -2604,6 +2604,13 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
 
             var startTime_bool = DateTime.TryParse(dto.StartTime, out DateTime startTime_parse);
             var endTime_bool = DateTime.TryParse(dto.EndTime, out DateTime endTime_parse);
+
+            if(startTime_parse > endTime_parse)
+            {
+                jw.Msg = "开始实际不能大于结束时间!";
+                return Ok(jw);
+            }
+
             if (startTime_bool && endTime_bool)
             {
                 //处理时间模板
@@ -2632,6 +2639,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
                 if (Query_DB.Count > 0)
                 {
                     //打开excel
+                    var ftpPath = AppSettingsHelper.Get("ExcelFtpPath");
                     var fileBasePath = AppSettingsHelper.Get("ExcelBasePath");
                     var fileName = "公务出访信息.docx";
 
@@ -2664,11 +2672,13 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
                     designer.SetDataSource("title", title);
                     designer.SetDataSource(dtSource);
                     designer.Process();
+                    
+                    var exportSerevePath = fileBasePath + "ExportOfficialActivitiesInfo/" + title + ".xlsx";
+                    var exportFtpPaht = ftpPath + "ExportOfficialActivitiesInfo/" + title + ".xlsx";
 
-                    var exportPath = fileBasePath + "ExportOfficialActivitiesInfo/" + title + ".xlsx";
                     //保存文件
-                    designer.Workbook.Save(exportPath);
-                    jw.Data = AppSettingsHelper.Get("ExcelBaseUrl") + exportPath;
+                    designer.Workbook.Save(exportSerevePath);
+                    jw.Data = AppSettingsHelper.Get("ExcelBaseUrl") + exportFtpPaht;
                     jw.Code = 200;
                     jw.Msg = "获取成功!";
                 }