Procházet zdrojové kódy

公务出访 省外办,市外办请示模板下载及完善
省外办剩余(op行程单数据未核对)

leiy před 1 rokem
rodič
revize
b4593dc4bc

+ 43 - 32
OASystem/OASystem.Api/Controllers/ResourceController.cs

@@ -1864,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}的请示";
@@ -1874,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)
@@ -1889,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);
 
@@ -1901,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}。";
                 //出访时间
@@ -2035,9 +2046,9 @@ 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;
+                    guestName = guestFirstInfo.LastName.Trim() + guestFirstInfo.FirstName.Trim();
                     guestJob = guestFirstInfo.Job;
-                    guestInfoStr = $@"{guestJob}、{guestName}";
+                    guestInfoStr = $@"{guestJob}、{guestName.Trim()}";
                 }
                 string reqTitle = $@"关于{guestInfoStr}等{guestInfos.Count}人赴{groupInfo.VisitCountry}进行{groupInfo.VisitPurpose}的请示";
                 dic.Add("ReqTitle", reqTitle);
@@ -2048,7 +2059,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
                 string obBackgroundStr = "×××";//出访背景
                 foreach (var ob in obDatas)
                 {
-                    obInfoStr += @$"{ob.Client}{ob.Job}{ob.Contact}、";
+                    obInfoStr += @$"{ob.Client.Trim()}{ob.Job.Trim()}{ob.Contact.Trim()}、";
 
                     //obBackgroundStr += $"{ob.Client}\r\n \t {ob.Setting}\r\n";
 
@@ -2057,7 +2068,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
                 {
                     obInfoStr = obInfoStr.Substring(0, obInfoStr.Length - 1);
                 }
-                string reqSubTitle = $@"应{obInfoStr.Trim()}的邀请,我单位拟派{guestInfoStr.Trim()}等{guestInfos.Count}人于{visitDateStr}赴{groupInfo.VisitCountry}进行{groupInfo.VisitPurpose}。";
+                string reqSubTitle = $@"应{obInfoStr}的邀请,我单位拟派{guestInfoStr}等{guestInfos.Count}人于{visitDateStr}赴{groupInfo.VisitCountry}进行{groupInfo.VisitPurpose}。";
                 dic.Add("ReqSubTitle", reqSubTitle);
 
                 /*

+ 2 - 2
OASystem/OASystem.Api/OAMethodLib/GeneralMethod.cs

@@ -1482,8 +1482,8 @@ namespace OASystem.API.OAMethodLib
                         DateTime arr_dt = Convert.ToDateTime(airData[0].ArrivedDate); //抵达时间
                         DateTime dep_dt = Convert.ToDateTime(airData[1].Day); //离开时间
                         days = (dep_dt - arr_dt).Days;
-                        countryStr += $@"{country}停留{days}日、";
-                        //countryStr += $@"{country}停留  日、";
+                        //countryStr += $@"{country}停留{days}日、";
+                        countryStr += $@"{country}停留  日、";
                     }
                 }
                 if (countryStr.Length > 0) countryStr = countryStr.Substring(0, countryStr.Length - 1);