|
@@ -91,6 +91,7 @@ using System.Diagnostics.PerformanceData;
|
|
using System.Drawing.Printing;
|
|
using System.Drawing.Printing;
|
|
using OASystem.Domain.Dtos.FileDto;
|
|
using OASystem.Domain.Dtos.FileDto;
|
|
using Microsoft.VisualBasic;
|
|
using Microsoft.VisualBasic;
|
|
|
|
+using Microsoft.EntityFrameworkCore.Query.Internal;
|
|
|
|
|
|
namespace OASystem.API.Controllers
|
|
namespace OASystem.API.Controllers
|
|
{
|
|
{
|
|
@@ -3600,6 +3601,7 @@ namespace OASystem.API.Controllers
|
|
Diid = dto.Diid,
|
|
Diid = dto.Diid,
|
|
IsDel = 0,
|
|
IsDel = 0,
|
|
FilePath = saveFilePath,
|
|
FilePath = saveFilePath,
|
|
|
|
+ FileName = nameSp[0]
|
|
};
|
|
};
|
|
|
|
|
|
using (FileStream fs = System.IO.File.Create(saveFilePath))
|
|
using (FileStream fs = System.IO.File.Create(saveFilePath))
|
|
@@ -3626,6 +3628,61 @@ namespace OASystem.API.Controllers
|
|
return Ok(jw);
|
|
return Ok(jw);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ [HttpPost]
|
|
|
|
+
|
|
|
|
+ public IActionResult QueryGroupModelFile(QueryGroupModelFileDto dto)
|
|
|
|
+ {
|
|
|
|
+ var dbQuery = _sqlSugar.Queryable<Grp_GroupModelFile>().Where(x => x.IsDel == 0 && x.Cid == dto.Cid && x.Ctable == dto.Ctable && x.Diid == dto.Diid).ToList();
|
|
|
|
+ return Ok(JsonView(true, "success", dbQuery.Select(x => x.FileName)));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ [HttpPost]
|
|
|
|
+ public IActionResult ExportGroupZip(ExportGroupZipDto dto)
|
|
|
|
+ {
|
|
|
|
+ var jw = JsonView(false);
|
|
|
|
+ var groupInfo = _sqlSugar.Queryable<Grp_DelegationInfo>().First(x => x.IsDel == 0 && x.Id == dto.Diid);
|
|
|
|
+ if (groupInfo == null)
|
|
|
|
+ {
|
|
|
|
+ jw.Msg = "团组信息不存在!";
|
|
|
|
+ return Ok(jw);
|
|
|
|
+ }
|
|
|
|
+ var dbQuery = _sqlSugar.Queryable<Grp_GroupModelFile>().Where(x => x.IsDel == 0 && x.Diid == dto.Diid).ToList();
|
|
|
|
+
|
|
|
|
+ Dictionary<string, Stream> Zips = new Dictionary<string, Stream>();
|
|
|
|
+
|
|
|
|
+ foreach (var item in dbQuery)
|
|
|
|
+ {
|
|
|
|
+ using (FileStream fileStream = new FileStream(item.FilePath, FileMode.Open, FileAccess.Read))
|
|
|
|
+ {
|
|
|
|
+ byte[] bytes = new byte[fileStream.Length];
|
|
|
|
+ fileStream.Read(bytes, 0, bytes.Length);
|
|
|
|
+ fileStream.Close();
|
|
|
|
+ Stream stream = new MemoryStream(bytes);
|
|
|
|
+ Zips.Add(item.FileName, stream);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ groupInfo.TeamName = Regex.Replace(groupInfo.TeamName, @"[^\w\.@-]", "",
|
|
|
|
+ RegexOptions.None, TimeSpan.FromSeconds(1.5));
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ if (Zips.Count > 0)
|
|
|
|
+ {
|
|
|
|
+ IOOperatorHelper io = new IOOperatorHelper();
|
|
|
|
+ var byts = io.ConvertZipStream(Zips);
|
|
|
|
+ var path = "\\GroupModelFiles\\" + groupInfo.TeamName;
|
|
|
|
+ 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" });
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ jw.Msg = "暂无生成文件!";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return Ok(jw);
|
|
|
|
+ }
|
|
|
|
+
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
#region 团组英文资料
|
|
#region 团组英文资料
|