|
|
@@ -4,6 +4,7 @@ using OASystem.API.OAMethodLib;
|
|
|
using OASystem.Domain.Dtos.Resource;
|
|
|
using OASystem.Domain.Entities.Groups;
|
|
|
using OASystem.Domain.ViewModels.Groups;
|
|
|
+using OASystem.Domain.ViewModels.QiYeWeChat;
|
|
|
using OASystem.Infrastructure.Repositories.Groups;
|
|
|
using Org.BouncyCastle.Utilities;
|
|
|
using Quartz.Util;
|
|
|
@@ -649,7 +650,7 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
#region 酒店资料数据
|
|
|
/// <summary>
|
|
|
- /// 酒店信息查询
|
|
|
+ /// 酒店信息查询 Page
|
|
|
/// </summary>
|
|
|
/// <param name="dto"></param>
|
|
|
/// <returns></returns>
|
|
|
@@ -657,28 +658,98 @@ namespace OASystem.API.Controllers
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> QueryHotelData(QueryHotelDataDto dto)
|
|
|
{
|
|
|
- try
|
|
|
- {
|
|
|
+ string sqlWhere = string.Empty;
|
|
|
+ if (!string.IsNullOrWhiteSpace(dto.Name))
|
|
|
+ {
|
|
|
+ sqlWhere += string.Format(@" And hd.Name like '%{0}%'", dto.Name);
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrWhiteSpace(dto.City) && dto.City != "全部")
|
|
|
+ {
|
|
|
+ sqlWhere += string.Format(@" And hd.City like '%{0}%'", dto.City);
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrWhiteSpace(dto.Contact))
|
|
|
+ {
|
|
|
+ sqlWhere += string.Format(@" And hd.Contact like '%{0}%'", dto.Contact);
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrWhiteSpace(dto.ContactPhone))
|
|
|
+ {
|
|
|
+ sqlWhere += string.Format(@" And hd.ContactPhone like '%{0}%'", dto.ContactPhone);
|
|
|
+ }
|
|
|
+ sqlWhere += string.Format(@" And hd.IsDel={0}", 0);
|
|
|
+ if (!string.IsNullOrEmpty(sqlWhere.Trim()))
|
|
|
+ {
|
|
|
+ Regex r = new Regex("And");
|
|
|
+ sqlWhere = r.Replace(sqlWhere, "Where", 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ string sql = string.Format(@"SELECT
|
|
|
+ *
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ ROW_NUMBER() OVER (
|
|
|
+ ORDER BY
|
|
|
+ hd.CreateTime DESC
|
|
|
+ ) AS Row_Number,
|
|
|
+ hd.Id,
|
|
|
+ hd.City,
|
|
|
+ hd.[Name],
|
|
|
+ hd.Tel,
|
|
|
+ hd.Fax,
|
|
|
+ hd.Contact,
|
|
|
+ hd.ContactPhone,
|
|
|
+ u.CnName AS CreateUserName,
|
|
|
+ hd.CreateTime
|
|
|
+ FROM
|
|
|
+ Res_HotelData hd
|
|
|
+ WITH
|
|
|
+ (NoLock)
|
|
|
+ LEFT JOIN Sys_Users u
|
|
|
+ WITH
|
|
|
+ (NoLock) ON hd.CreateUserId = u.Id {0}
|
|
|
+ ) Temp
|
|
|
+ ", sqlWhere);
|
|
|
|
|
|
- Result hotelData = await _hotelDataRep.QueryHotelData(dto);
|
|
|
- if (hotelData.Code == 0)
|
|
|
- {
|
|
|
- return Ok(JsonView(true, "查询成功", hotelData.Data));
|
|
|
- }
|
|
|
- else
|
|
|
+ if (dto.PortType == 1)
|
|
|
+ {
|
|
|
+ List<HotelDataItemView> HotelDataData = await _sqlSugar.SqlQueryable<HotelDataItemView>(sql).ToListAsync();
|
|
|
+ if (HotelDataData.Count == 0)
|
|
|
{
|
|
|
- return Ok(JsonView(false, hotelData.Msg));
|
|
|
+ return Ok(JsonView(false, "暂无数据"));
|
|
|
}
|
|
|
-
|
|
|
+ return Ok(JsonView(true, "操作成功", HotelDataData));
|
|
|
}
|
|
|
- catch (Exception ex)
|
|
|
+ else if (dto.PortType == 2 || dto.PortType == 3)
|
|
|
{
|
|
|
- return Ok(JsonView(false, "程序错误!"));
|
|
|
- throw;
|
|
|
+ RefAsync<int> total = 0;//REF和OUT不支持异步,想要真的异步这是最优解
|
|
|
+ var data = await _sqlSugar.SqlQueryable<HotelDataItemView>(sql).ToPageListAsync(dto.PageIndex, dto.PageSize, total); //ToPageAsync
|
|
|
+
|
|
|
+ return Ok(JsonView(true, "操作成功", data, total));
|
|
|
}
|
|
|
+ else return Ok(JsonView(false, "请传入PortType参数!1:Web,2:Android,3:IOS"));
|
|
|
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 酒店资料
|
|
|
+ /// 详情
|
|
|
+ /// add time:2024-05-14 11:57:10
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> QueryHotelDataInfo(QueryHotelDataInfoDto dto)
|
|
|
+ {
|
|
|
+ var _view = await _hotelDataRep._Info(dto.PortType,dto.Id);
|
|
|
+ if (_view.Code == 0 )
|
|
|
+ {
|
|
|
+ return Ok(JsonView(true, _view.Msg,_view.Data));
|
|
|
+ }
|
|
|
+
|
|
|
+ return Ok(JsonView(false, _view.Msg));
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 酒店资料下拉框数据
|
|
|
/// </summary>
|
|
|
@@ -722,36 +793,15 @@ namespace OASystem.API.Controllers
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> OperationHotelData(OperationHotelDto dto)
|
|
|
{
|
|
|
- try
|
|
|
- {
|
|
|
- if (dto.City == "")
|
|
|
- {
|
|
|
- return Ok(JsonView(false, "请检查酒店所在城市是否填写!"));
|
|
|
- }
|
|
|
- if (dto.Name == "")
|
|
|
- {
|
|
|
- return Ok(JsonView(false, "请检查酒店名称是否填写!"));
|
|
|
- }
|
|
|
- if (dto.Address == "")
|
|
|
- {
|
|
|
- return Ok(JsonView(false, "请检查酒店地址是否填写正确!"));
|
|
|
- }
|
|
|
- if (dto.Tel == "")
|
|
|
- {
|
|
|
- return Ok(JsonView(false, "请检查酒店联系方式是否填写正确!"));
|
|
|
- }
|
|
|
+ if (string.IsNullOrEmpty(dto.City)) return Ok(JsonView(false, "请检查酒店所在城市是否填写!"));
|
|
|
+ if (string.IsNullOrEmpty(dto.Name)) return Ok(JsonView(false, "请检查酒店名称是否填写!"));
|
|
|
+ if (string.IsNullOrEmpty(dto.Address)) return Ok(JsonView(false, "请检查酒店地址是否填写正确!"));
|
|
|
+ if (string.IsNullOrEmpty(dto.Tel)) return Ok(JsonView(false, "请检查酒店联系方式是否填写正确!"));
|
|
|
+
|
|
|
+ Result result = await _hotelDataRep.OperationHotelData(dto);
|
|
|
+ if (result.Code != 0) return Ok(JsonView(false, result.Msg));
|
|
|
+ return Ok(JsonView(true, result.Msg));
|
|
|
|
|
|
- Result result = await _hotelDataRep.OperationHotelData(dto);
|
|
|
- if (result.Code != 0)
|
|
|
- {
|
|
|
- return Ok(JsonView(false, result.Msg));
|
|
|
- }
|
|
|
- return Ok(JsonView(true, result.Msg));
|
|
|
- }
|
|
|
- catch (Exception ex)
|
|
|
- {
|
|
|
- return Ok(JsonView(false, ex.Message));
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
@@ -1569,20 +1619,13 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> QueryOfficialActivitiesByDiId(OfficialActivitiesByDiIdDto dto)
|
|
|
{
|
|
|
- try
|
|
|
+ Result groupData = await _officialActivitiesRep.QueryOfficialActivitiesByDiId(dto);
|
|
|
+ if (groupData.Code != 0)
|
|
|
{
|
|
|
- Result groupData = await _officialActivitiesRep.QueryOfficialActivitiesByDiId(dto);
|
|
|
- if (groupData.Code != 0)
|
|
|
- {
|
|
|
- return Ok(JsonView(false, groupData.Msg));
|
|
|
- }
|
|
|
- return Ok(JsonView(true, groupData.Msg, groupData.Data));
|
|
|
- }
|
|
|
- catch (Exception ex)
|
|
|
- {
|
|
|
- return Ok(JsonView(false, "程序错误!"));
|
|
|
- throw;
|
|
|
+ return Ok(JsonView(false, groupData.Msg));
|
|
|
}
|
|
|
+ return Ok(JsonView(true, groupData.Msg, groupData.Data));
|
|
|
+
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 根据公务出访数据Id查询数据
|
|
|
@@ -1750,6 +1793,26 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 公务出访
|
|
|
+ /// 请示范例提示
|
|
|
+ /// Add Time:2024-05-13 13:56:44
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> PostOfficialActivitiesReqReqSampleTips(PostOfficialActivitiesReqReqSampleTipsDto dto)
|
|
|
+ {
|
|
|
+ var res = await _officialActivitiesRep.PostReqReqSampleTips(dto.country, dto.area,dto.client);
|
|
|
+ if (res.Code == 0)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(true, "操作成功!", res.Data));
|
|
|
+ }
|
|
|
+ return Ok(JsonView(false, res.Msg));
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 公务出访 (省外办,市外办) File Downlaod
|
|
|
/// </summary>
|
|
|
@@ -1792,7 +1855,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
|
|
|
Dictionary<string, string> dic = new Dictionary<string, string>();
|
|
|
|
|
|
//××(组团单位):接团客户信息团组
|
|
|
- dic.Add("GroupClient", groupInfo.ClientUnit);
|
|
|
+ dic.Add("GroupClient", $"{groupInfo.ClientUnit}\r\n");
|
|
|
|
|
|
//关于××(职务、姓名)等×人赴××(国家或地区)进行×××(出访目的)的请示
|
|
|
string guestName = "";
|
|
|
@@ -1801,8 +1864,8 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
|
|
|
var guestFirstInfo = guestInfos.FirstOrDefault();
|
|
|
if (guestFirstInfo != null)
|
|
|
{
|
|
|
- guestName = guestFirstInfo.LastName + guestFirstInfo.FirstName;
|
|
|
- guestJob = guestFirstInfo.Job;
|
|
|
+ guestName = guestFirstInfo.LastName.Trim() + guestFirstInfo.FirstName.Trim();
|
|
|
+ guestJob = guestFirstInfo.Job.Trim();
|
|
|
guestInfoStr = $@"{guestJob}、{guestName}";
|
|
|
}
|
|
|
string askTitle = $@"关于{guestInfoStr}等{guestInfos.Count}人赴{groupInfo.VisitCountry}进行{groupInfo.VisitPurpose}的请示";
|
|
|
@@ -1811,12 +1874,9 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
|
|
|
//应×××(邀请方名称+邀请人职务和姓名)的邀请,我单位拟派×××(职务、姓名)等×人(人数)于×××年×××月×××日赴×××(国家或地区)进行×××(出访目的)。现请示如下。
|
|
|
string visitDateStr = @$"{groupInfo.VisitDate.Year}年{groupInfo.VisitDate.Month}月{groupInfo.VisitDate.Day}日";
|
|
|
string obInfoStr = "";
|
|
|
- string obBackgroundStr = "×××";//出访背景
|
|
|
foreach (var ob in obDatas)
|
|
|
{
|
|
|
- obInfoStr += @$"{ob.Client}{ob.Job}{ob.Contact}、";
|
|
|
-
|
|
|
- obBackgroundStr += $"{ob.Client}\r\n \t {ob.Setting}\r\n";
|
|
|
+ obInfoStr += @$"{ob.Client.Trim()}{ob.Job.Trim()}{ob.Contact.Trim()}、";
|
|
|
|
|
|
}
|
|
|
if (obInfoStr.Length > 0)
|
|
|
@@ -1826,10 +1886,6 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
|
|
|
string askSubTitle = $@"应{obInfoStr}的邀请,我单位拟派{guestInfoStr}等{guestInfos.Count}人于{visitDateStr}赴{groupInfo.VisitCountry}进行{groupInfo.VisitPurpose}。现请示如下。";
|
|
|
dic.Add("AskSubTitle", askSubTitle);
|
|
|
|
|
|
- //出访背景
|
|
|
- obBackgroundStr = "×××";//出访背景
|
|
|
- dic.Add("OBSetting", obBackgroundStr);
|
|
|
-
|
|
|
//出访目的
|
|
|
dic.Add("VisitPurpose", groupInfo.VisitPurpose);
|
|
|
|
|
|
@@ -1838,34 +1894,52 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
|
|
|
//1.拜访×××(机构名称)×××(姓名、职务)洽谈(或调研、推动等)×××(项目或机构名称等)。(例:拜会×××经济与发展司司长×××,商讨“×××活动”相关筹备工作。)
|
|
|
//2.拜访×××(机构名称)×××(姓名、职务)洽谈(或调研、推动等)×××(项目或机构名称等)。(例:拜会×××经济与发展司司长×××,商讨“×××活动”相关筹备工作。)
|
|
|
|
|
|
- string taskStr = "××××"; ;
|
|
|
- //List<string> countrys = groupInfo.VisitCountry.Split("、").ToList();
|
|
|
- //int countryIndex = 1;
|
|
|
- //foreach (var item in countrys)
|
|
|
- //{
|
|
|
- // string taskTitle = $"({GetToUpperNumber(countryIndex)}){item}\r\n";
|
|
|
+ string visitCountryStr1 = ""; // ××国家(或地区)×天,××国家(或地区)×天
|
|
|
+ string obBackgroundStr = "";//出访背景
|
|
|
+ string taskStr = ""; ; //出访任务
|
|
|
+ var countrys = obDatas.GroupBy(it => it.Country);
|
|
|
+ int countryIndex = 1;
|
|
|
+ foreach (var item in countrys)
|
|
|
+ {
|
|
|
+ visitCountryStr1 += $"{item.Key} 天、";
|
|
|
+ string taskTitle = $"({GetToUpperNumber(countryIndex)}){item.Key}\r\n";
|
|
|
+
|
|
|
+ string taskContent = "";
|
|
|
+ string obBackgroundContent = "";
|
|
|
+ int obIndex = 1;
|
|
|
+ foreach (var obInfo in item.ToList())
|
|
|
+ {
|
|
|
+ string reqSmaple = "";
|
|
|
+ string settingStr = "";
|
|
|
+ if (!string.IsNullOrEmpty(obInfo.ReqSample)) reqSmaple = obInfo.ReqSample;
|
|
|
+ else reqSmaple = "[公务出访请示范例未录入]";
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty(obInfo.Setting)) settingStr = obInfo.Setting;
|
|
|
+ else settingStr = "[公务方背景未录入]";
|
|
|
|
|
|
- // string taskContent = "";
|
|
|
- // var countryObDatas = obDatas.Where(it => it.Client.Contains(item)).ToList();
|
|
|
- // int obIndex = 1;
|
|
|
- // foreach (var obInfo in countryObDatas)
|
|
|
- // {
|
|
|
- // taskContent += $"{obIndex}. 拜访{obInfo.Client}({obInfo.Contact}、{obInfo.Job})洽谈“{groupInfo.VisitPurpose}”相关工作。\r\n";
|
|
|
- // }
|
|
|
+ taskContent += $"{obIndex}. {reqSmaple}\r\n";
|
|
|
+ obBackgroundContent += $"{obIndex}. {obInfo.Client}:{settingStr}\r\n";
|
|
|
+ }
|
|
|
|
|
|
- // taskStr += $"{taskTitle}{taskContent}";
|
|
|
+ taskStr += $"{taskTitle}{taskContent}";
|
|
|
+ obBackgroundStr += $"{taskTitle}{obBackgroundContent}";
|
|
|
+ countryIndex++;
|
|
|
+ }
|
|
|
|
|
|
- // countryIndex++;
|
|
|
- //}
|
|
|
+ //出访背景
|
|
|
+ if (obBackgroundStr.Length < 1) obBackgroundStr = "[公务出访背景未录入]";
|
|
|
+ dic.Add("OBSetting", obBackgroundStr);
|
|
|
|
|
|
//出访任务
|
|
|
+ if (taskStr.Length < 1) taskStr = "[公务出访任务未录入]";
|
|
|
dic.Add("TaskContent", taskStr);
|
|
|
|
|
|
//出访时间
|
|
|
//代表团拟于××年×月×日—×月×日出访,在外停留×天。其中,××国家(或地区)×天,××国家(或地区)×天。
|
|
|
- string visitCountryStr = $"[OP行程单读取]";
|
|
|
+ if (visitCountryStr1.Length > 0) visitCountryStr1 = visitCountryStr1.Substring(0, visitCountryStr1.Length - 1);
|
|
|
+ string visitCountryStr = "";
|
|
|
visitCountryStr = GeneralMethod.GetCountryStandingTime(groupInfo.Id); //计算国家出访天数
|
|
|
-
|
|
|
+ if (visitCountryStr.Equals("[黑屏代码未录入]")) visitCountryStr = visitCountryStr1;
|
|
|
|
|
|
string visitTimeQuantumStr = $"代表团拟于{groupInfo.VisitStartDate.Year}年{groupInfo.VisitStartDate.Month}月{groupInfo.VisitStartDate.Day}日—{groupInfo.VisitEndDate.Month}月{groupInfo.VisitEndDate.Day}日出访,在外停留{groupInfo.VisitDays}天。其中,{visitCountryStr}。";
|
|
|
//出访时间
|
|
|
@@ -1920,7 +1994,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
|
|
|
string sexStr = string.Empty;
|
|
|
if (sex == 0) sexStr = "男";
|
|
|
else if (sex == 1) sexStr = "女";
|
|
|
- else sexStr = "未设置";
|
|
|
+ else sexStr = "-";
|
|
|
builder.Write(sexStr);
|
|
|
|
|
|
builder.MoveToCell(0, i + 1, 2, 0);
|
|
|
@@ -1930,9 +2004,9 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
|
|
|
builder.MoveToCell(0, i + 1, 3, 0);
|
|
|
string birthDay = "";
|
|
|
string birthDayStr = string.Empty;
|
|
|
- if (!string.IsNullOrEmpty(birthDay))
|
|
|
+ if (guestInfo.BirthDay != null)
|
|
|
{
|
|
|
- birthDayStr = Convert.ToDateTime(birthDay).ToString("yyyy-MM-dd");
|
|
|
+ birthDayStr = guestInfo.BirthDay.ToString("yyyy.MM");
|
|
|
}
|
|
|
builder.Write(birthDayStr);
|
|
|
}
|
|
|
@@ -1944,7 +2018,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
|
|
|
}
|
|
|
|
|
|
var fileDir = AppSettingsHelper.Get("WordBasePath");
|
|
|
- string fileName = $"{groupInfo.TeamName}省外办出访请示.docx";
|
|
|
+ string fileName = $"{groupInfo.TeamName}省外办出访请示{DateTime.Now.ToString("yyyyMMddHHmmss")}.docx";
|
|
|
string filePath = fileDir + $@"OfficialActivities/{fileName}";
|
|
|
doc.Save(filePath);
|
|
|
|
|
|
@@ -1953,7 +2027,164 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
|
|
|
}
|
|
|
else if (dto.FileType == 2)
|
|
|
{
|
|
|
+ //载入模板
|
|
|
+ string tempPath = AppSettingsHelper.Get("WordBasePath") + "Template/市外办出访请示 - 模板.docx";
|
|
|
+ var doc = new Document(tempPath);
|
|
|
+ DocumentBuilder builder = new DocumentBuilder(doc);
|
|
|
+
|
|
|
+ //键值对存放数据
|
|
|
+ Dictionary<string, string> dic = new Dictionary<string, string>();
|
|
|
+
|
|
|
+ //××(组团单位):接团客户信息团组
|
|
|
+ dic.Add("GroupClient", $"{groupInfo.ClientUnit}");
|
|
|
+
|
|
|
+ dic.Add("GroupClient1", $"{groupInfo.ClientUnit}");
|
|
|
+ //关于××(职务、姓名)等×人赴××(国家或地区)进行×××(出访目的)的请示
|
|
|
+ string guestName = "";
|
|
|
+ string guestJob = "";
|
|
|
+ string guestInfoStr = "";
|
|
|
+ var guestFirstInfo = guestInfos.FirstOrDefault();
|
|
|
+ if (guestFirstInfo != null)
|
|
|
+ {
|
|
|
+ guestName = guestFirstInfo.LastName.Trim() + guestFirstInfo.FirstName.Trim();
|
|
|
+ guestJob = guestFirstInfo.Job;
|
|
|
+ guestInfoStr = $@"{guestJob}、{guestName.Trim()}";
|
|
|
+ }
|
|
|
+ string reqTitle = $@"关于{guestInfoStr}等{guestInfos.Count}人赴{groupInfo.VisitCountry}进行{groupInfo.VisitPurpose}的请示";
|
|
|
+ dic.Add("ReqTitle", reqTitle);
|
|
|
|
|
|
+ //应×××(邀请方名称+邀请人职务和姓名)的邀请,我单位拟派×××(职务、姓名)等×人(人数)于×××年×××月×××日赴×××(国家或地区)进行×××(出访目的)。
|
|
|
+ string visitDateStr = @$"{groupInfo.VisitDate.Year}年{groupInfo.VisitDate.Month}月{groupInfo.VisitDate.Day}日";
|
|
|
+ string obInfoStr = "";
|
|
|
+ string obBackgroundStr = "×××";//出访背景
|
|
|
+ foreach (var ob in obDatas)
|
|
|
+ {
|
|
|
+ obInfoStr += @$"{ob.Client.Trim()}{ob.Job.Trim()}{ob.Contact.Trim()}、";
|
|
|
+
|
|
|
+ //obBackgroundStr += $"{ob.Client}\r\n \t {ob.Setting}\r\n";
|
|
|
+
|
|
|
+ }
|
|
|
+ if (obInfoStr.Length > 0)
|
|
|
+ {
|
|
|
+ obInfoStr = obInfoStr.Substring(0, obInfoStr.Length - 1);
|
|
|
+ }
|
|
|
+ string reqSubTitle = $@"应{obInfoStr}的邀请,我单位拟派{guestInfoStr}等{guestInfos.Count}人于{visitDateStr}赴{groupInfo.VisitCountry}进行{groupInfo.VisitPurpose}。";
|
|
|
+ dic.Add("ReqSubTitle", reqSubTitle);
|
|
|
+
|
|
|
+ /*
|
|
|
+ * 出访任务
|
|
|
+ * (一)××(国家或地区)
|
|
|
+ * 1.拜访×××(机构名称)×××(姓名、职务)洽谈(或调研、推动等)×××(项目或机构名称等)。(例:拜会×××经济与发展司司长×××,商讨“×××活动”相关筹备工作。)背景:拟拜访机构的优势、拟洽谈项目的前期进展情况等。(例:背景:由×××总领馆联合×××市政府共同举办的“×××活动”将于今年6月在×××举行。)
|
|
|
+ * 2.拜访×××(机构名称)×××(姓名、职务)洽谈(或调研等)×××(项目或机构名称等)。(例:拜会友城×××市市长×××,巩固和发展两市传统友谊,商谈两市未来互动交流合作项目。)背景:拟拜访机构的优势、拟洽谈项目的前期进展情况等。(例:背景:×××年×月,×××市与×××市正式缔结友好城市关系。在此框架下,两市开展了一系列友好互访和商务交流。并于×××年×月共同举办了“×××活动”。)
|
|
|
+ *
|
|
|
+ */
|
|
|
+ string visitCountryStr1 = ""; // ××国家(或地区)×天,××国家(或地区)×天
|
|
|
+ string taskStr = string.Empty ;
|
|
|
+ List<string> countrys = obDatas.Select(it => it.Country).ToList();
|
|
|
+ int countryIndex = 1;
|
|
|
+ foreach (var item in countrys)
|
|
|
+ {
|
|
|
+ visitCountryStr1 += $"{item} 天,";
|
|
|
+ string taskTitle = $"({GetToUpperNumber(countryIndex)}){item ?? "[公务出访国家未填写]"}\r\n";
|
|
|
+
|
|
|
+ string taskContent = "";
|
|
|
+ var countryObDatas = obDatas.Where(it => it.Country.Contains(item)).OrderBy(it => it.Date).ToList();
|
|
|
+ int obIndex = 1;
|
|
|
+ if (countryObDatas.Count == 0) taskContent = "[公务出访未录入]\r\n";
|
|
|
+ else
|
|
|
+ {
|
|
|
+ foreach (var obInfo in countryObDatas)
|
|
|
+ {
|
|
|
+ taskContent += $"{obIndex}.{obInfo.ReqSample ?? "[公务出访请示范例未填写]"}\r\n背景:{obInfo.Setting ?? "[公务出访背景未填写]"}\r\n";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ taskStr += $"{taskTitle}{taskContent}";
|
|
|
+
|
|
|
+ countryIndex++;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (string.IsNullOrEmpty(taskStr)) taskStr = "××××××";
|
|
|
+ if (visitCountryStr1.Length > 0) visitCountryStr1 = visitCountryStr1.Substring(0, visitCountryStr1.Length - 1);
|
|
|
+
|
|
|
+ //出访任务
|
|
|
+ dic.Add("TaskContent", taskStr);
|
|
|
+
|
|
|
+ //出访目的
|
|
|
+ dic.Add("VisitPurpose", groupInfo.VisitPurpose);
|
|
|
+
|
|
|
+ //出访信息
|
|
|
+ //代表团拟于××年×月×日—×月×日出访,在外停留×天。其中,××国家(或地区)×天,××国家(或地区)×天。出访路线:成都—××(出境城市名称)—××(转机不出机场)—××(公务所在城市)……—××(入境城市名称)—成都。(例:成都—法兰克福<转机不出机场>—巴黎—巴塞罗那—阿姆斯特丹<转机不出机场>-成都)出访费用:由××承担(注明由外方或上级机关承担,还是由派员单位在年度安排的预算经费中列支)。
|
|
|
+
|
|
|
+ string tripInfoStr = "";
|
|
|
+ string visitCountryStr = $"[OP行程单读取]";
|
|
|
+ visitCountryStr = GeneralMethod.GetCountryStandingTime(groupInfo.Id); //计算国家出访天数
|
|
|
+ if (visitCountryStr.Equals("[黑屏代码未录入]")) visitCountryStr = visitCountryStr1;
|
|
|
+ string lineStr = GeneralMethod.GetGroupCityLine(groupInfo.Id, "—"); //出访路线
|
|
|
+ tripInfoStr = $"代表团拟于{groupInfo.VisitStartDate.Year}年{groupInfo.VisitStartDate.Month}月{groupInfo.VisitStartDate.Day}日—{groupInfo.VisitEndDate.Month}月{groupInfo.VisitEndDate.Day}日出访,在外停留{groupInfo.VisitDays}天。其中,{visitCountryStr}。出访路线:{lineStr}出访费用:由××承担(注明由外方或上级机关承担,还是由派员单位在年度安排的预算经费中列支)";
|
|
|
+
|
|
|
+
|
|
|
+ dic.Add("TripInfo", tripInfoStr);
|
|
|
+
|
|
|
+
|
|
|
+ #region 填充word模板书签内容
|
|
|
+ foreach (var key in dic.Keys)
|
|
|
+ {
|
|
|
+ builder.MoveToBookmark(key);
|
|
|
+ builder.Write(dic[key]);
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ //获取word里所有表格
|
|
|
+ NodeCollection allTables = doc.GetChildNodes(NodeType.Table, true);
|
|
|
+ //获取所填表格的序数
|
|
|
+ Aspose.Words.Tables.Table tableOne = allTables[0] as Aspose.Words.Tables.Table;
|
|
|
+
|
|
|
+ var rowStart = tableOne.Rows[0]; //获取第1行
|
|
|
+
|
|
|
+ //循环赋值
|
|
|
+ for (int i = 0; i < guestInfos.Count; i++)
|
|
|
+ {
|
|
|
+ var guestInfo = guestInfos[i];
|
|
|
+ builder.MoveToCell(0, i + 1, 0, 0);
|
|
|
+ builder.Write(guestInfo.LastName + guestInfo.FirstName);
|
|
|
+
|
|
|
+ builder.MoveToCell(0, i + 1, 1, 0);
|
|
|
+ int sex = guestInfo.Sex;
|
|
|
+ string sexStr = string.Empty;
|
|
|
+ if (sex == 0) sexStr = "男";
|
|
|
+ else if (sex == 1) sexStr = "女";
|
|
|
+ else sexStr = "未设置";
|
|
|
+ builder.Write(sexStr);
|
|
|
+
|
|
|
+ builder.MoveToCell(0, i + 1, 2, 0);
|
|
|
+ builder.Write(guestInfo.CompanyFullName + guestInfo.Job);
|
|
|
+
|
|
|
+
|
|
|
+ builder.MoveToCell(0, i + 1, 3, 0);
|
|
|
+ DateTime birthDay = guestInfo.BirthDay;
|
|
|
+ string birthDayStr = string.Empty;
|
|
|
+ if (birthDay != null)
|
|
|
+ {
|
|
|
+ birthDayStr = birthDay.ToString("yyyy.MM");
|
|
|
+ }
|
|
|
+ builder.Write(birthDayStr);
|
|
|
+ }
|
|
|
+
|
|
|
+ //删除多余行
|
|
|
+ while (tableOne.Rows.Count > guestInfos.Count + 1)
|
|
|
+ {
|
|
|
+ tableOne.Rows.RemoveAt(guestInfos.Count + 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ var fileDir = AppSettingsHelper.Get("WordBasePath");
|
|
|
+ string fileName = $"{groupInfo.TeamName}市外办出访请示{DateTime.Now.ToString("yyyyMMddHHmmss")}.docx";
|
|
|
+ string filePath = fileDir + $@"OfficialActivities/{fileName}";
|
|
|
+ doc.Save(filePath);
|
|
|
+
|
|
|
+ string Url = $@"{AppSettingsHelper.Get("WordBaseUrl")}Office/Word/OfficialActivities/{fileName}";
|
|
|
+ return Ok(JsonView(true, "操作成功!", Url));
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1975,7 +2206,6 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
|
|
|
else if (num == 9) numStr = "九";
|
|
|
else if (num == 10) numStr = "十";
|
|
|
|
|
|
-
|
|
|
return numStr;
|
|
|
}
|
|
|
|