|
|
@@ -1691,7 +1691,7 @@ namespace OASystem.API.Controllers
|
|
|
.ExecuteCommandAsync();
|
|
|
|
|
|
//默认创建倒推表
|
|
|
- await _invertedListRep._Create(4, dto.Diid, msg);
|
|
|
+ await _invertedListRep.Create(4, dto.Diid, msg);
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
@@ -1770,7 +1770,7 @@ namespace OASystem.API.Controllers
|
|
|
.ExecuteCommandAsync();
|
|
|
|
|
|
//默认创建倒推表
|
|
|
- await _invertedListRep._Create(dto.UserId, dto.Id, msg);
|
|
|
+ await _invertedListRep.Create(dto.UserId, dto.Id, msg);
|
|
|
}
|
|
|
}
|
|
|
#endregion
|
|
|
@@ -1816,7 +1816,7 @@ namespace OASystem.API.Controllers
|
|
|
}
|
|
|
|
|
|
//默认创建倒推表
|
|
|
- await _invertedListRep._Create(dto.UserId, diId);
|
|
|
+ await _invertedListRep.Create(dto.UserId, diId);
|
|
|
|
|
|
//默认创建签证流程
|
|
|
await _visaProcessRep.Create(dto.UserId, diId);
|
|
|
@@ -2014,7 +2014,7 @@ namespace OASystem.API.Controllers
|
|
|
#endregion
|
|
|
|
|
|
//默认创建倒推表
|
|
|
- await _invertedListRep._Create(dto.UserId, diId);
|
|
|
+ await _invertedListRep.Create(dto.UserId, diId);
|
|
|
|
|
|
//默认创建签证流程
|
|
|
await _visaProcessRep.Create(dto.UserId, diId);
|
|
|
@@ -2220,9 +2220,8 @@ namespace OASystem.API.Controllers
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
-
|
|
|
//默认创建倒推表
|
|
|
- await _invertedListRep._Create(dto.UserId, diId);
|
|
|
+ await _invertedListRep.Create(dto.UserId, diId);
|
|
|
}
|
|
|
else if (dto.Status == 2)
|
|
|
{
|
|
|
@@ -28790,7 +28789,7 @@ AirHotelPrice
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> PostInvertedListInit()
|
|
|
{
|
|
|
- var viewData = await _invertedListRep._Init();
|
|
|
+ var viewData = await _invertedListRep.Init();
|
|
|
if (viewData.Code != 0)
|
|
|
{
|
|
|
return Ok(JsonView(false, viewData.Msg));
|
|
|
@@ -28809,7 +28808,7 @@ AirHotelPrice
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> PostInvertedListInfo(InvertedListCreateDto dto)
|
|
|
{
|
|
|
- var viewData = await _invertedListRep._Info(dto.PortType, dto.DiId);
|
|
|
+ var viewData = await _invertedListRep.Info(dto.PortType, dto.DiId);
|
|
|
if (viewData.Code != 0)
|
|
|
{
|
|
|
return Ok(JsonView(false, viewData.Msg));
|
|
|
@@ -28829,7 +28828,7 @@ AirHotelPrice
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> PostInvertedListCreate(InvertedListCreateDto dto)
|
|
|
{
|
|
|
- var viewData = await _invertedListRep._Create(dto.PortType, dto.DiId);
|
|
|
+ var viewData = await _invertedListRep.Create(dto.PortType, dto.DiId);
|
|
|
if (viewData.Code != 0)
|
|
|
{
|
|
|
return Ok(JsonView(false, viewData.Msg));
|
|
|
@@ -28848,7 +28847,7 @@ AirHotelPrice
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> PostInvertedListUpdate(InvertedListUpdateDto dto)
|
|
|
{
|
|
|
- var viewData = await _invertedListRep._Update(dto);
|
|
|
+ var viewData = await _invertedListRep.Update(dto);
|
|
|
if (viewData.Code != 0)
|
|
|
{
|
|
|
return Ok(JsonView(false, viewData.Msg));
|
|
|
@@ -28868,7 +28867,7 @@ AirHotelPrice
|
|
|
public async Task<IActionResult> PostInvertedListFileDownload(InvertedListFileDownloadDto dto)
|
|
|
{
|
|
|
|
|
|
- var info2 = await _invertedListRep._Info(1, dto.DiId);
|
|
|
+ var info2 = await _invertedListRep.Info(1, dto.DiId);
|
|
|
if (info2.Code != 0)
|
|
|
{
|
|
|
return Ok(JsonView(false, "倒推表数据未生成,请先生成倒退表数据!"));
|
|
|
@@ -29071,7 +29070,6 @@ AirHotelPrice
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
-
|
|
|
var fileDir = AppSettingsHelper.Get("WordBasePath");
|
|
|
string fileName = $"{teamName}团出行准备流程表{CommonFun.GUID}.doc";
|
|
|
string filePath = fileDir + $@"InvertedList/{fileName}";
|
|
|
@@ -29080,6 +29078,182 @@ AirHotelPrice
|
|
|
return Ok(JsonView(true, "操作成功!", Url));
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 倒推表
|
|
|
+ /// File Download
|
|
|
+ /// 客户版
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> PostInvertedListClientFileDownload(InvertedListFileDownloadDto dto)
|
|
|
+ {
|
|
|
+ var info2 = await _invertedListRep.Info(1, dto.DiId);
|
|
|
+ if (info2.Code != 0)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "倒推表数据未生成,请先生成倒退表数据!"));
|
|
|
+ }
|
|
|
+ var info1 = info2.Data as InvertedListInfoView;
|
|
|
+ var info = await _invertedListRep._sqlSugar.Queryable<Grp_DelegationInfo>().Where(it => it.Id == dto.DiId).FirstAsync();
|
|
|
+ string teamName = "";
|
|
|
+ if (info != null) teamName = info.TeamName;
|
|
|
+
|
|
|
+
|
|
|
+ var tempPath = $"{AppSettingsHelper.Get("WordBasePath")}Template/倒退表模板20250121.doc";
|
|
|
+ var doc = new Document();
|
|
|
+ var builder = new DocumentBuilder(doc);
|
|
|
+
|
|
|
+ #region New Insert
|
|
|
+
|
|
|
+ string titleFont = $"仿宋",
|
|
|
+ contentFont = $"仿宋";
|
|
|
+
|
|
|
+ var fontColor = Color.FromArgb(64, 64, 64);
|
|
|
+ //设置标题 团组名称
|
|
|
+ builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;
|
|
|
+ builder.Font.Name = titleFont;
|
|
|
+ builder.Font.Color = fontColor;
|
|
|
+ builder.Font.Size = 12;
|
|
|
+ builder.Font.Bold = true;
|
|
|
+ builder.Writeln(teamName);
|
|
|
+ //设置副标题 团组出访时间
|
|
|
+ builder.Font.Size = 12;
|
|
|
+ builder.Writeln("出发时间:" + info1.AirportdDropOffDt.ConvertToDatetime());
|
|
|
+ builder.Writeln();
|
|
|
+
|
|
|
+ var backgroundColor = Color.FromArgb(199, 199, 199);
|
|
|
+
|
|
|
+ var table = builder.StartTable();
|
|
|
+
|
|
|
+ builder.InsertCell();
|
|
|
+ builder.CellFormat.Shading.BackgroundPatternColor = backgroundColor;
|
|
|
+ builder.CellFormat.Borders.LineStyle = Aspose.Words.LineStyle.Single;
|
|
|
+ builder.CellFormat.Borders.LineWidth = 1;
|
|
|
+ builder.CellFormat.Borders.Color = Color.FromArgb(183, 183, 183);
|
|
|
+
|
|
|
+ table.FirstRow.FirstCell.CellFormat.Width = 20; // 单位为百分比
|
|
|
+ builder.RowFormat.Height = 40;
|
|
|
+ builder.CellFormat.VerticalAlignment = CellVerticalAlignment.Center;
|
|
|
+ builder.Font.Name = contentFont;
|
|
|
+ builder.Font.Size = 12;
|
|
|
+ builder.Font.Bold = true;
|
|
|
+ builder.Font.Color = fontColor;
|
|
|
+ builder.Write("时间");
|
|
|
+
|
|
|
+ builder.InsertCell();
|
|
|
+ table.FirstRow.FirstCell.CellFormat.Width = 30; // 单位为百分比
|
|
|
+ builder.Write("流程");
|
|
|
+
|
|
|
+ builder.InsertCell();
|
|
|
+ table.FirstRow.FirstCell.CellFormat.Width = 50; // 单位为百分比
|
|
|
+ builder.Write("说明");
|
|
|
+ builder.EndRow();
|
|
|
+
|
|
|
+ //报批资料准备
|
|
|
+ if (info1.IsSelectedAirportd)
|
|
|
+ {
|
|
|
+ InvertedListFileDownloadSetRow(builder, contentFont, info1.Client_ApprovalDataDt.ConvertToDatetime(), "报批资料准备", info1.ApprovalDataRemark);
|
|
|
+ }
|
|
|
+ //报批/提供送签资料
|
|
|
+ if (info1.IsSelectedApprovalData)
|
|
|
+ {
|
|
|
+ InvertedListFileDownloadSetRow(builder, contentFont, info1.Client_ApprovalDt.ConvertToDatetime(), "报批/提供送签资料", info1.ApprovalRemark);
|
|
|
+ }
|
|
|
+ //出批件护照办理
|
|
|
+ if (info1.IsSelectedIssueApproval)
|
|
|
+ {
|
|
|
+ InvertedListFileDownloadSetRow(builder, contentFont, info1.Client_IssueApprovalDt.ConvertToDatetime(), "出批件\r\n护照办理", info1.IssueApprovalRemark);
|
|
|
+ }
|
|
|
+ //签证资料准备
|
|
|
+ if (info1.IsSelectedVisaInfo)
|
|
|
+ {
|
|
|
+ InvertedListFileDownloadSetRow(builder, contentFont, info1.Client_VisaInformationDt.ConvertToDatetime(), "签证资料准备", info1.VisaInformationRemark);
|
|
|
+ }
|
|
|
+ //送签
|
|
|
+ if (info1.IsSelectedSendVisa)
|
|
|
+ {
|
|
|
+ InvertedListFileDownloadSetRow(builder, contentFont, info1.Client_SendVisaDt.ConvertToDatetime(), "送签", info1.SendVisaRemark);
|
|
|
+ }
|
|
|
+ //出签
|
|
|
+ if (info1.IsSelectedIssueVisa)
|
|
|
+ {
|
|
|
+ InvertedListFileDownloadSetRow(builder, contentFont, info1.Client_IssueVisaDt.ConvertToDatetime(), "出签", info1.IssueVisaRemark);
|
|
|
+ }
|
|
|
+
|
|
|
+ //机票
|
|
|
+ if (info1.IsSelectedAirTicket)
|
|
|
+ {
|
|
|
+ if (string.IsNullOrEmpty(info1.Client_AirTicketDt)) info1.Client_AirTicketDt = info1.Client_IssueVisaDt;
|
|
|
+
|
|
|
+ InvertedListFileDownloadSetRow(builder, contentFont, info1.Client_AirTicketDt.ConvertToDatetime(), "机票", info1.AirTicketRemark);
|
|
|
+ }
|
|
|
+ //酒店
|
|
|
+ if (info1.IsSelectedHotel)
|
|
|
+ {
|
|
|
+ if (string.IsNullOrEmpty(info1.Client_HotelDt)) info1.Client_HotelDt = info1.Client_IssueVisaDt;
|
|
|
+ InvertedListFileDownloadSetRow(builder, contentFont, info1.Client_HotelDt.ConvertToDatetime(), "酒店", info1.HotelRemark);
|
|
|
+ }
|
|
|
+
|
|
|
+ //开行前会
|
|
|
+ if (info1.IsSelectedPreTripMeeting)
|
|
|
+ {
|
|
|
+ InvertedListFileDownloadSetRow(builder, contentFont, info1.Client_PreTripMeetingDt.ConvertToDatetime(), "开行前会", info1.PreTripMeetingRemark);
|
|
|
+ }
|
|
|
+ //送机
|
|
|
+ if (info1.IsSelectedAirportdDropOff)
|
|
|
+ {
|
|
|
+ InvertedListFileDownloadSetRow(builder, contentFont, info1.Client_AirportdDropOffDt.ConvertToDatetime(), "送机", info1.AirportdDropOffRemark);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ builder.EndTable();
|
|
|
+
|
|
|
+ //table.PreferredWidth = PreferredWidth.FromPercent(100.00);
|
|
|
+ //table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
|
|
+ for (int i = 0; i < table.Rows.Count; i++)
|
|
|
+ {
|
|
|
+ var row = table.Rows[i];
|
|
|
+ //设置宽度
|
|
|
+ row.Cells[0].CellFormat.Width = 20.00;
|
|
|
+ row.Cells[1].CellFormat.Width = 30.00;
|
|
|
+ row.Cells[2].CellFormat.Width = 50.00;
|
|
|
+ if (i != 0)
|
|
|
+ {
|
|
|
+ //边框设置
|
|
|
+ InvertedListFileDownloadSetBorders(row.Cells, 0);
|
|
|
+ InvertedListFileDownloadSetBorders(row.Cells, 1);
|
|
|
+ InvertedListFileDownloadSetBorders(row.Cells, 2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ #region 页脚插入图片
|
|
|
+
|
|
|
+ // 创建页脚
|
|
|
+ Aspose.Words.HeaderFooter footer = new Aspose.Words.HeaderFooter(doc, HeaderFooterType.FooterPrimary);
|
|
|
+ doc.FirstSection.HeadersFooters.Add(footer);
|
|
|
+
|
|
|
+ Paragraph para = new Paragraph(doc);
|
|
|
+ para.ParagraphFormat.Alignment = ParagraphAlignment.Right;
|
|
|
+ footer.AppendChild(para);
|
|
|
+
|
|
|
+ builder.MoveTo(para);
|
|
|
+
|
|
|
+ string imagePath = "./Images/FMGJ_Log.png";
|
|
|
+ builder.InsertImage(imagePath);
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ var fileDir = AppSettingsHelper.Get("WordBasePath");
|
|
|
+ string fileName = $"{teamName}团出行准备流程表(客户版){CommonFun.GUID}.doc";
|
|
|
+ string filePath = fileDir + $@"InvertedList/{fileName}";
|
|
|
+ doc.Save(filePath);
|
|
|
+ string Url = $@"{AppSettingsHelper.Get("WordBaseUrl")}Office/Word/InvertedList/{fileName}";
|
|
|
+ return Ok(JsonView(true, "操作成功!", Url));
|
|
|
+ }
|
|
|
+
|
|
|
private void InvertedListFileDownloadSetRow(DocumentBuilder builder, string fontName, string dateTime, string content, string reamrk)
|
|
|
{
|
|
|
var fontColor = Color.FromArgb(64, 64, 64);
|