|
|
@@ -1842,6 +1842,45 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
|
|
|
List<TourClientListByDiIdView> guestInfos = new List<TourClientListByDiIdView>();
|
|
|
if (guestResult.Result.Code == 0) guestInfos = guestResult.Result.Data as List<TourClientListByDiIdView>;
|
|
|
|
|
|
+ string visitCountrys = ""; //××国家(或地区)×天,××国家(或地区)×天
|
|
|
+ string countryStayStr = ""; // xx、xx、xx
|
|
|
+ //出入境费用 住宿类型
|
|
|
+ var dayCostDatas = _sqlSugar.Queryable<Grp_DayAndCost>().Where(it => it.IsDel == 0 && it.DiId == dto.DiId && it.Type == 1).ToList();
|
|
|
+ if (dayCostDatas.Count > 0)
|
|
|
+ {
|
|
|
+ List<int> nationalIds = dayCostDatas.Select(it => it.NationalTravelFeeId).ToList();
|
|
|
+ var nationalDatas = _sqlSugar.Queryable<Grp_NationalTravelFee>().Where(it => nationalIds.Contains(it.Id)).ToList();
|
|
|
+ var nationalDataGroupByCountry = nationalDatas.GroupBy(it => it.Country);
|
|
|
+ foreach (var item in nationalDataGroupByCountry)
|
|
|
+ {
|
|
|
+ visitCountrys += $"{item.Key}、";
|
|
|
+ int stayDays = nationalIds.Where(it => it == item.ToList()[0].Id).Count();
|
|
|
+ countryStayStr += $"{item.Key}{stayDays}天,";
|
|
|
+ }
|
|
|
+
|
|
|
+ if (visitCountrys.Length > 0) visitCountrys = visitCountrys.Substring(0, visitCountrys.Length - 1);
|
|
|
+ if (countryStayStr.Length > 0) countryStayStr = countryStayStr.Substring(0, countryStayStr.Length - 1);
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ visitCountrys = groupInfo.VisitCountry;
|
|
|
+ countryStayStr = GeneralMethod.GetCountryStandingTime(groupInfo.Id); //计算国家出访天数
|
|
|
+ }
|
|
|
+
|
|
|
+ //出访人数
|
|
|
+ int visitPeopleNum = groupInfo.VisitPNumber;
|
|
|
+ int visitDaysNum = groupInfo.VisitDays;
|
|
|
+
|
|
|
+ //出访单位
|
|
|
+ string obInfoStr = "";
|
|
|
+ foreach (var ob in obDatas) obInfoStr += @$"{ob.Client.Trim()}{ob.Job.Trim()}{ob.Contact.Trim()}、";
|
|
|
+ if (obInfoStr.Length > 0) obInfoStr = obInfoStr.Substring(0, obInfoStr.Length - 1);
|
|
|
+ obInfoStr = obInfoStr ?? "[公务出访未录入]";
|
|
|
+
|
|
|
+ //出访路线
|
|
|
+ string lineStr = GeneralMethod.GetGroupCityLine(groupInfo.Id, "—");
|
|
|
+
|
|
|
if (dto.FileType == 1)
|
|
|
{
|
|
|
//载入模板
|
|
|
@@ -1866,22 +1905,14 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
|
|
|
guestJob = guestFirstInfo.Job.Trim();
|
|
|
guestInfoStr = $@"{guestJob}、{guestName}";
|
|
|
}
|
|
|
- string askTitle = $@"关于{guestInfoStr}等{guestInfos.Count}人赴{groupInfo.VisitCountry}进行{groupInfo.VisitPurpose}的请示";
|
|
|
+ guestInfoStr = guestInfoStr ?? "[接团客户名单未录入]";
|
|
|
+ string askTitle = $@"关于{guestInfoStr }等{visitPeopleNum}人赴{visitCountrys}进行{groupInfo.VisitPurpose}的请示";
|
|
|
dic.Add("AskTitle", askTitle);
|
|
|
|
|
|
//应×××(邀请方名称+邀请人职务和姓名)的邀请,我单位拟派×××(职务、姓名)等×人(人数)于×××年×××月×××日赴×××(国家或地区)进行×××(出访目的)。现请示如下。
|
|
|
string visitDateStr = @$"{groupInfo.VisitDate.Year}年{groupInfo.VisitDate.Month}月{groupInfo.VisitDate.Day}日";
|
|
|
- string obInfoStr = "";
|
|
|
- foreach (var ob in obDatas)
|
|
|
- {
|
|
|
- obInfoStr += @$"{ob.Client.Trim()}{ob.Job.Trim()}{ob.Contact.Trim()}、";
|
|
|
-
|
|
|
- }
|
|
|
- if (obInfoStr.Length > 0)
|
|
|
- {
|
|
|
- obInfoStr = obInfoStr.Substring(0, obInfoStr.Length - 1);
|
|
|
- }
|
|
|
- string askSubTitle = $@"应{obInfoStr}的邀请,我单位拟派{guestInfoStr}等{guestInfos.Count}人于{visitDateStr}赴{groupInfo.VisitCountry}进行{groupInfo.VisitPurpose}。现请示如下。";
|
|
|
+
|
|
|
+ string askSubTitle = $@"应{obInfoStr}的邀请,我单位拟派{guestInfoStr}等{visitPeopleNum}人于{visitDateStr}赴{visitCountrys}进行{groupInfo.VisitPurpose}。现请示如下。";
|
|
|
dic.Add("AskSubTitle", askSubTitle);
|
|
|
|
|
|
//出访目的
|
|
|
@@ -1892,14 +1923,12 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
|
|
|
//1.拜访×××(机构名称)×××(姓名、职务)洽谈(或调研、推动等)×××(项目或机构名称等)。(例:拜会×××经济与发展司司长×××,商讨“×××活动”相关筹备工作。)
|
|
|
//2.拜访×××(机构名称)×××(姓名、职务)洽谈(或调研、推动等)×××(项目或机构名称等)。(例:拜会×××经济与发展司司长×××,商讨“×××活动”相关筹备工作。)
|
|
|
|
|
|
- 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 = "";
|
|
|
@@ -1935,38 +1964,18 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
|
|
|
|
|
|
//出访时间
|
|
|
//代表团拟于××年×月×日—×月×日出访,在外停留×天。其中,××国家(或地区)×天,××国家(或地区)×天。
|
|
|
- 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}。";
|
|
|
+ string visitTimeQuantumStr = $"代表团拟于{groupInfo.VisitStartDate.Year}年{groupInfo.VisitStartDate.Month}月{groupInfo.VisitStartDate.Day}日—{groupInfo.VisitEndDate.Month}月{groupInfo.VisitEndDate.Day}日出访,在外停留{visitDaysNum}天。其中,{countryStayStr}。";
|
|
|
//出访时间
|
|
|
dic.Add("TimeQuantum", visitTimeQuantumStr);
|
|
|
|
|
|
//出访路线
|
|
|
//成都—××(出境城市名称)—××(转机不出机场)—××(公务所在城市)……—××(入境城市名称)—成都。(例:成都—法兰克福<转机不出机场>—巴黎—巴塞罗那—阿姆斯特丹<转机不出机场>-成都)
|
|
|
- string lineStr = GeneralMethod.GetGroupCityLine(groupInfo.Id, "—");
|
|
|
+
|
|
|
dic.Add("Line", lineStr);
|
|
|
|
|
|
//scheduling //行程安排
|
|
|
string schedulingStr = $"[OP行程单暂未生成]";
|
|
|
|
|
|
- #region op行程 数据库读取
|
|
|
- //var tripInfo = _sqlSugar.Queryable<Grp_TravelList>().Where(it => it.IsDel == 0 && it.Diid == groupInfo.Id).OrderBy(it => it.Days).ToList();
|
|
|
-
|
|
|
- //if (tripInfo.Count > 0)
|
|
|
- //{
|
|
|
- // schedulingStr = "";
|
|
|
-
|
|
|
- // foreach (var item in tripInfo)
|
|
|
- // {
|
|
|
- // schedulingStr += $"{item.Date}({item.WeekDay})\r\n{item.Trip}\r\n";
|
|
|
- // }
|
|
|
- //}
|
|
|
-
|
|
|
- #endregion
|
|
|
-
|
|
|
#region op行程 根据黑屏代码录入
|
|
|
|
|
|
var opTripView = GeneralMethod.GetBriefStroke(groupInfo.Id);
|
|
|
@@ -2069,25 +2078,14 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
|
|
|
guestJob = guestFirstInfo.Job;
|
|
|
guestInfoStr = $@"{guestJob}、{guestName.Trim()}";
|
|
|
}
|
|
|
- string reqTitle = $@"关于{guestInfoStr}等{guestInfos.Count}人赴{groupInfo.VisitCountry}进行{groupInfo.VisitPurpose}的请示";
|
|
|
+ string reqTitle = $@"关于{guestInfoStr}等{visitPeopleNum}人赴{visitCountrys}进行{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}。";
|
|
|
+ string reqSubTitle = $@"应{obInfoStr}的邀请,我单位拟派{guestInfoStr}等{visitPeopleNum}人于{visitDateStr}赴{visitCountrys}进行{groupInfo.VisitPurpose}。";
|
|
|
dic.Add("ReqSubTitle", reqSubTitle);
|
|
|
|
|
|
/*
|
|
|
@@ -2097,13 +2095,13 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
|
|
|
* 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 = "";
|
|
|
@@ -2127,7 +2125,6 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
|
|
|
}
|
|
|
|
|
|
if (string.IsNullOrEmpty(taskStr)) taskStr = "××××××";
|
|
|
- if (visitCountryStr1.Length > 0) visitCountryStr1 = visitCountryStr1.Substring(0, visitCountryStr1.Length - 1);
|
|
|
|
|
|
//出访任务
|
|
|
dic.Add("TaskContent", taskStr);
|
|
|
@@ -2139,11 +2136,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
|
|
|
//代表团拟于××年×月×日—×月×日出访,在外停留×天。其中,××国家(或地区)×天,××国家(或地区)×天。出访路线:成都—××(出境城市名称)—××(转机不出机场)—××(公务所在城市)……—××(入境城市名称)—成都。(例:成都—法兰克福<转机不出机场>—巴黎—巴塞罗那—阿姆斯特丹<转机不出机场>-成都)出访费用:由××承担(注明由外方或上级机关承担,还是由派员单位在年度安排的预算经费中列支)。
|
|
|
|
|
|
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}出访费用:由××承担(注明由外方或上级机关承担,还是由派员单位在年度安排的预算经费中列支)";
|
|
|
+ tripInfoStr = $"代表团拟于{groupInfo.VisitStartDate.Year}年{groupInfo.VisitStartDate.Month}月{groupInfo.VisitStartDate.Day}日—{groupInfo.VisitEndDate.Month}月{groupInfo.VisitEndDate.Day}日出访,在外停留{visitDaysNum}天。其中,{countryStayStr}。出访路线:{lineStr}。出访费用:由××承担(注明由外方或上级机关承担,还是由派员单位在年度安排的预算经费中列支)";
|
|
|
|
|
|
|
|
|
dic.Add("TripInfo", tripInfoStr);
|