Browse Source

Merge branch 'develop' of http://132.232.92.186:3000/XinXiBu/OA2023 into develop

yuanrf 1 year ago
parent
commit
3e1275d891

+ 3 - 1
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -147,7 +147,9 @@ namespace OASystem.API.Controllers
             var result = await _grpScheduleRep._sqlSugar.Insertable(_detail).ExecuteReturnIdentityAsync();
             if (result > 0)
             {
-                return Ok(JsonView(true, "添加成功!"));
+                Grp_ScheduleDetailView _result = await _grpScheduleRep.GetInsertBackData(result);
+
+                return Ok(JsonView(true, "添加成功!", _result));
             }
 
             return Ok(JsonView(false, "添加失败!"));

+ 3 - 5
OASystem/OASystem.Api/Controllers/TencentOCRController.cs

@@ -124,8 +124,6 @@ namespace OASystem.API.Controllers
             };
 
             #region word生成 返回地址
-            string tempPath = string.Format("{0}", "C:\\Server\\File\\OA2023\\Office\\Word\\TencentOCR\\Template\\ocr_身份证(人像面).doc");
-
             Dictionary<string, object> dic = new Dictionary<string, object>();
             dic.Add("Name", iDCardOCRView.Name);
             dic.Add("Sex", iDCardOCRView.Sex);
@@ -136,11 +134,11 @@ namespace OASystem.API.Controllers
             dic.Add("Authority", iDCardOCRView.Authority);
             dic.Add("ValidDate", iDCardOCRView.ValidDate);
 
-            string downPath = string.Format("{0}.doc",dic["Name"].ToString() + "身份证(人像面)" + DateTime.Now.ToString("yyyyMMddHHmmss"));
+            string fileName = string.Format("{0}.doc", dic["Name"].ToString() + "身份证(人像面)" + DateTime.Now.ToString("yyyyMMddHHmmss"));
 
-            string serverPathh = AsposeHelper.ExpertWordToModel(tempPath, downPath, dic, null);
+            string serverPath = AsposeHelper.ExpertWordToModel("ocr_身份证(人像面).doc", "TencentOCR", fileName, dic, null);
 
-            iDCardOCRView.DownUrl = serverPathh.Replace("C:", "http:\\132.232.92.186");
+            iDCardOCRView.DownUrl = serverPath;
             #endregion
 
             return Ok(JsonView(iDCardOCRView));

+ 1 - 1
OASystem/OASystem.Api/OAMethodLib/ExcelOutput/Excel_BusConfItemList.cs

@@ -68,7 +68,7 @@ Where bcil.Id={0}
             string diName = _DelegationInfo != null ? _DelegationInfo.TeamName : "未知团组" + _entity.Diid;
 
             WorkbookDesigner designer = new WorkbookDesigner();
-            designer.Workbook = new Workbook(AppSettingsHelper.Get("ExcelBasePath") + "Model/会务物料清单模板.xlsx");
+            designer.Workbook = new Workbook(AppSettingsHelper.Get("ExcelBasePath") + "Template/会务物料清单模板.xlsx");
             designer.SetDataSource("Export", _confItemList);
             designer.SetDataSource("ExportDiName", diName);
             designer.SetDataSource("ExportOutputDt", DateTime.Now.ToString("yyyy-MM-dd"));

+ 63 - 35
OASystem/OASystem.Api/OAMethodLib/File/AsposeHelper.cs

@@ -1,5 +1,8 @@
-using Aspose.Words;
+using Aspose.Cells;
+using Aspose.Words;
+using System.Collections.Generic;
 using System.Data;
+using System.IO;
 using System.Web;
 using Ubiety.Dns.Core;
 
@@ -16,12 +19,13 @@ namespace OASystem.API.OAMethodLib.File
         /// <summary>
         /// 根据Word模板进行数据的导出Word操作
         /// </summary>
-        /// <param name="tempPath">模板路径</param>
-        /// <param name="outputFileName">保存文件名称</param>
+        /// <param name="tempFileName">模板文件名称</param>
+        /// <param name="saveFolderName">保存文件名称</param>
         /// <param name="dic">数据源 key 对应 value</param>
         /// <param name="listDt">需要循环的数据DataTable  多个注意DataTableName </param>
         /// <returns>返回的文档路径</returns>
-        public static string ExpertWordToModel(string tempPath, string outputFileName, Dictionary<string,object> dic, List<DataTable>? listDt)
+        public static string ExpertWordToModel(string tempFileName, string saveFolderName, string saveFilName, Dictionary<string,object> dic,
+            List<DataTable>? listDt)
         {
             try
             {
@@ -36,6 +40,7 @@ namespace OASystem.API.OAMethodLib.File
                     fieldValues.Add(dic[key]);
                 }
 
+                string tempPath = string.Format("{0}/Word/Template/{1}", AppSettingsHelper.Get("OfficeTempBasePath"), tempFileName);
                 //载入模板
                 Document doc = new Document(tempPath);
                 doc.MailMerge.Execute(fieldNames.ToArray(), fieldValues.ToArray());
@@ -53,15 +58,24 @@ namespace OASystem.API.OAMethodLib.File
                 
                 //合并模版,相当于页面的渲染
                 doc.MailMerge.Execute(new[] { "PageCount" }, new object[] { doc.PageCount });
-                //保存合并后的文档
 
-                string outputPath = string.Format("C:\\Server\\File\\OA2023\\Office\\Word\\TencentOCR\\Save\\{0}", outputFileName);
-                doc.Save(outputPath); 
-                return outputPath; //返回下载地址
+                string path = string.Format("{0}/Word/{1}", AppSettingsHelper.Get("OfficeTempBasePath"), saveFolderName);
+
+                if (!System.IO.Directory.Exists(path))
+                {
+                    System.IO.Directory.CreateDirectory(path);//不存在就创建文件夹
+                }
+
+                string saveFilePath = string.Format("{0}{1}", path, saveFilName);
+
+                //保存合并后的文档
+                doc.Save(saveFilePath); 
+                saveFilePath = saveFilePath.Replace("C:", AppSettingsHelper.Get("OfficeBaseUrl")); //返回下载地址
+                return saveFilePath; //返回下载地址
             }
-            catch (Exception er)
+            catch (Exception ex)
             {
-                return er.Message;
+                return ex.Message;
             }
         }
         
@@ -78,50 +92,64 @@ namespace OASystem.API.OAMethodLib.File
         /// <summary>
         /// 根据Word模板进行数据的导出Word操作
         /// </summary>
-        /// <param name="tempPath">模板路径</param>
-        /// <param name="outputPath">保存路径</param>
+        /// <param name="tempFileName">Excel模板文件名称</param>
+        /// <param name="saveFolderName">保存文件夹名称</param>
+        /// <param name="saveFilName">保存文件名称</param>
         /// <param name="dic">数据源 key 对应 value</param>
         /// <param name="listDt">需要循环的数据DataTable  多个注意DataTableName </param>
         /// <returns>返回的文档路径</returns>
-        public static string ExpertExcelToModel(string tempPath, string outputFileName, Dictionary<string, object> dic, List<DataTable>? listDt)
+        public static string ExpertExcelToModel(string tempFileName, string saveFolderName, string saveFilName, Dictionary<string, object> dic,
+            List<DataTable>? listDt)
         {
             try
             {
-                removeWatermark();//加载监听,用于去除水印
-
-                List<string> fieldNames = new List<string>();  //字段名字符串数组
-                List<object> fieldValues = new List<object>(); //字段值数组
-
-                foreach (string key in dic.Keys)
-                {
-                    fieldNames.Add(key);
-                    fieldValues.Add(dic[key]);
-                }
+                string tempPath = string.Format("{0}/Excel/Template/{1}",AppSettingsHelper.Get("OfficeTempBasePath"), tempFileName);
 
                 //载入模板
-                Document doc = new Document(tempPath);
-                doc.MailMerge.Execute(fieldNames.ToArray(), fieldValues.ToArray());
-                //将我们获得的DataTable类型的数据:EduDataTable放入doc方法中做处理
+                Workbook wbook = new Workbook(tempPath);
+                //默认第一个工作表
+                Worksheet wSheet = wbook.Worksheets[0]; 
+                WorkbookDesigner designer = new WorkbookDesigner(wbook);
+
+                //数据源 多个
                 if (listDt != null && listDt.Count > 0)
                 {
-                    foreach (DataTable dt in listDt)
+                    foreach (var item in listDt)
                     {
-                        if (dt != null && dt.Rows.Count > 0)
+                        if (item.Rows.Count > 0)
                         {
-                            doc.MailMerge.ExecuteWithRegions(dt);
+                            designer.SetDataSource(item.TableName, item);
                         }
                     }
                 }
 
-                //合并模版,相当于页面的渲染
-                doc.MailMerge.Execute(new[] { "PageCount" }, new object[] { doc.PageCount });
+                //报表单位
+                if (dic.Count > 0)
+                {
+                    foreach (var item in dic)
+                    {
+                        designer.SetDataSource(item.Key, item.Value);
+                    }
+                }
+               
+                designer.Process();
+
+                string path = string.Format("{0}/Excel/{1}", AppSettingsHelper.Get("OfficeTempBasePath"), saveFolderName);
+
+                if (!System.IO.Directory.Exists(path))
+                {
+                    System.IO.Directory.CreateDirectory(path);//不存在就创建文件夹
+                }
+                string saveFilePath = string.Format("{0}{1}", path, saveFilName);
+
                 //保存合并后的文档
-                doc.Save(outputFileName);
-                return outputFileName; //返回下载地址
+                wbook.Save(saveFilePath);
+                saveFilePath = saveFilePath.Replace("C:", AppSettingsHelper.Get("OfficeBaseUrl")); //返回下载地址
+                return saveFilePath; //返回下载地址
             }
-            catch (Exception er)
+            catch (Exception ex)
             {
-                return er.Message;
+                return ex.Message;
             }
         }
 

+ 0 - 146
OASystem/OASystem.Api/OAMethodLib/File/NPOIHelper.cs

@@ -1,146 +0,0 @@
-//using NPOI.XWPF.UserModel;
-
-namespace OASystem.API.OAMethodLib.NPOI
-{
-    /// <summary>
-    /// word / excel 
-    /// </summary>
-    public class NPOIHelper
-    {
-        //#region Word
-        ///// <summary>
-        ///// 输出模板docx文档(使用字典)
-        ///// </summary>
-        ///// <param name="tempFilePath">docx文件路径</param>
-        ///// <param name="outPath">输出文件路径</param>
-        ///// <param name="data">字典数据源</param>
-        //public static void Export(string tempFilePath, string outPath, Dictionary<string, string> data)
-        //{
-        //    try
-        //    {
-        //        using (FileStream stream = File.OpenRead(tempFilePath ))
-        //        {
-        //            XWPFDocument doc = new XWPFDocument(stream);
-        //            //遍历段落                  
-        //            foreach (var para in doc.Paragraphs)
-        //            {
-        //                ReplaceKey(para, data);
-        //            }
-
-        //            //遍历表格      
-        //            foreach (var table in doc.Tables)
-        //            {
-        //                foreach (var row in table.Rows)
-        //                {
-        //                    foreach (var cell in row.GetTableCells())
-        //                    {
-        //                        foreach (var para in cell.Paragraphs)
-        //                        {
-        //                            ReplaceKey(para, data);
-        //                        }
-        //                    }
-        //                }
-        //            }
-
-        //            //写文件
-        //            FileStream outFile = new FileStream(outPath, FileMode.Create);
-        //            doc.Write(outFile);
-        //            outFile.Close();
-        //        }
-        //    }
-        //    catch (Exception ex)
-        //    {
-
-        //        throw;
-        //    }
-            
-        //}
-        //private static void ReplaceKey(XWPFParagraph para, Dictionary<string, string> data)
-        //{
-        //    string text = "";
-        //    foreach (var run in para.Runs)
-        //    {
-        //        text = run.ToString();
-        //        foreach (var key in data.Keys)
-        //        {
-        //            //$$模板中数据占位符为$KEY$
-        //            if (text.Contains($"${key}$"))
-        //            {
-        //                text = text.Replace($"${key}$", data[key]);
-        //            }
-        //        }
-        //        run.SetText(text, 0);
-        //    }
-        //}
-
-        ///// <summary>
-        ///// 输出模板docx文档(使用反射)
-        ///// </summary>
-        ///// <param name="tempFilePath">docx文件路径</param>
-        ///// <param name="outPath">输出文件路径</param>
-        ///// <param name="data">对象数据源</param>
-        //public static void ExportObjet(string tempFilePath, string outPath, object data)
-        //{
-        //    using (FileStream stream = File.OpenRead(tempFilePath))
-        //    {
-        //        XWPFDocument doc = new XWPFDocument(stream);
-        //        //遍历段落                  
-        //        foreach (var para in doc.Paragraphs)
-        //        {
-        //            ReplaceKeyObjet(para, data);
-        //        }
-        //        //遍历表格      
-        //        foreach (var table in doc.Tables)
-        //        {
-        //            foreach (var row in table.Rows)
-        //            {
-        //                foreach (var cell in row.GetTableCells())
-        //                {
-        //                    foreach (var para in cell.Paragraphs)
-        //                    {
-        //                        ReplaceKeyObjet(para, data);
-        //                    }
-        //                }
-        //            }
-        //        }
-        //        //写文件
-        //        FileStream outFile = new FileStream(outPath, FileMode.Create);
-        //        doc.Write(outFile);
-        //        outFile.Close();
-        //    }
-        //}
-        //private static void ReplaceKeyObjet(XWPFParagraph para, object model)
-        //{
-        //    string text = "";
-        //    Type t = model.GetType();
-        //    PropertyInfo[] pi = t.GetProperties();
-        //    foreach (var run in para.Runs)
-        //    {
-        //        text = run.ToString();
-        //        foreach (PropertyInfo p in pi)
-        //        {
-        //            //$$模板中数据占位符为$KEY$
-        //            string key = $"${p.Name}$";
-        //            if (text.Contains(key))
-        //            {
-        //                try
-        //                {
-        //                    text = text.Replace(key, p.GetValue(model, null).ToString());
-        //                }
-        //                catch (Exception ex)
-        //                {
-        //                    //可能有空指针异常
-        //                    text = text.Replace(key, "");
-        //                }
-        //            }
-        //        }
-        //        run.SetText(text, 0);
-        //    }
-        //}
-        //#endregion
-
-
-
-
-    }
-}

+ 4 - 0
OASystem/OASystem.Api/OAMethodLib/GroupStepForDelegation.cs

@@ -4,6 +4,7 @@ using OASystem.Domain.Common;
 using OASystem.Domain.Dtos.Groups;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.Enums;
+using OASystem.Domain.ViewModels.Groups;
 using OASystem.Infrastructure.Repositories.Groups;
 using System.Configuration;
 using static OpenAI.GPT3.ObjectModels.SharedModels.IOpenAiModels;
@@ -467,6 +468,9 @@ Where d.Id={0} And u.Id not in({1})", DepartmentCode.IC, _groupConfig.FilterUser
 
         #endregion
 
+
+        
+
     }
 
 

+ 3 - 1
OASystem/OASystem.Api/appsettings.json

@@ -104,6 +104,8 @@
     }
   ],
   "ExcelBaseUrl": "http://132.232.92.186/",
-  "ExcelBasePath": "C:/Server/File/OA2023/Office/Excel/"
+  "ExcelBasePath": "C:/Server/File/OA2023/Office/Excel/",
+  "OfficeBaseUrl": "http://132.232.92.186/",
+  "OfficeTempBasePath": "C:/Server/File/OA2023/Office/"
 
 }

+ 2 - 0
OASystem/OASystem.Domain/AutoMappers/_baseMappingProfile.cs

@@ -122,6 +122,8 @@ namespace OASystem.Domain.AutoMappers
             #endregion
             #region 客户资料板块
             CreateMap<DeleClient, Crm_DeleClient>();
+            CreateMap<CustomerFamily,Crm_VisaCustomerFamily>();
+            CreateMap<CustomerCerts, Crm_CustomerCert>();
             #endregion
             #endregion
 

+ 62 - 0
OASystem/OASystem.Domain/Dtos/CRM/DeleClientAddDto.cs

@@ -20,6 +20,8 @@ namespace OASystem.Domain.Dtos.CRM
         /// </summary>
         public DeleClient DeleClient { get; set; }
         public List<CustomerFamily> CustomerFamily { get; set; }
+
+        public List<CustomerCerts> CustomerCert { get; set; }
     } 
     /// <summary>
     /// 客户资料修改
@@ -579,6 +581,66 @@ namespace OASystem.Domain.Dtos.CRM
         /// </summary>
         public string Remark { get; set; }
     }
+    /// <summary>
+    /// 证件信息修改
+    /// </summary>
+    public class CustomerCerts
+    {
+        /// <summary>
+        /// 编号
+        /// </summary>
+        public int Id { get; set; }
+        /// <summary>
+        /// 客户信息表Id
+        /// </summary>
+        public int DcId { get; set; }
+        /// <summary>
+        /// 证件类型表Id
+        /// </summary>
+        public int SdId { get; set; }
+        /// <summary>
+        /// 证件号
+        /// </summary>
+        public string CertNo { get; set; }
+        /// <summary>
+        /// 签发国
+        /// </summary>
+        public string Country { get; set; }
+
+        /// <summary>
+        /// 签发地区
+        /// </summary>
+        public string Area { get; set; }
+
+        /// <summary>
+        /// 目的地国家
+        /// </summary>
+        public string TargetCountry { get; set; }
+
+        /// <summary>
+        /// 有效期起始时间
+        /// </summary>
+        public DateTime IssueDt { get; set; }
+        /// <summary>
+        /// 有效期截止时间
+        /// </summary>
+        public DateTime ExpiryDt { get; set; }
+
+        /// <summary>
+        /// 身份证户籍地址
+        /// </summary>
+        public string IDCardAddress { get; set; }
+        /// <summary>
+        /// 创建者Id
+        /// </summary>
+        public int CreateUserId { get; set; }
+       
+        /// <summary>
+        /// 备注
+        /// </summary>
+        public string Remark { get; set; }
+        
+    }
     public class SetCrmUpdPassIdCardOCRDto
     {
         public int UserId { get; set; }

+ 70 - 14
OASystem/OASystem.Infrastructure/Repositories/CRM/VisaDeleClientRepository.cs

@@ -1,5 +1,6 @@
 
 using AutoMapper;
+using Newtonsoft.Json;
 using OASystem.Domain;
 using OASystem.Domain.Dtos;
 using OASystem.Domain.Dtos.CRM;
@@ -26,7 +27,8 @@ namespace OASystem.Infrastructure.Repositories.CRM
         public VisaDeleClientRepository(SqlSugarClient sqlSugar,IMapper mapper) :
             base(sqlSugar)
         {
-            _mapper = mapper;
+            this._mapper = mapper;
+           
         }
 
         /// <summary>
@@ -151,6 +153,7 @@ namespace OASystem.Infrastructure.Repositories.CRM
            Result result = new Result() { Code = -2, Msg = "未知错误" };
             try
             {
+                int deleId = 0;
                 if (dto.Status==1)//添加
                 {
                     string selectSql = string.Format(@"select * from Crm_DeleClient where  LastName+FirstName='{0}' and Phone='{1}' and IsDel='{2}'"
@@ -158,7 +161,7 @@ namespace OASystem.Infrastructure.Repositories.CRM
                     var DeleClient = await _sqlSugar.SqlQueryable<Crm_DeleClient>(selectSql).FirstAsync();//查询是否存在
                     if (DeleClient != null)
                     {
-                        return result = new Result() { Code = -1, Msg = "该客户已存在,请勿重复添加!" };
+                        result = new Result() { Code = -1, Msg = "该客户已存在,请勿重复添加!" };
 
                     }
                     else//不存在,可添加
@@ -167,16 +170,17 @@ namespace OASystem.Infrastructure.Repositories.CRM
                         int id = await AddAsyncReturnId(_CountryFeeCost);
                         if (id == 0)
                         {
-                            return result = new Result() { Code = -1, Msg = "添加失败!" };
+                            result = new Result() { Code = -1, Msg = "添加失败!" };
 
                         }
-
-                        return result = new Result() { Code = 0, Msg = "添加成功!", Data = new { Id = id } };
-                        //进行其他表炒作
+                        result = new Result() { Code = 0, Msg = "添加成功!" };
+                        deleId = id;
+                        
                     }
                 }
                 else if (dto.Status == 2)//修改
                 {
+                    deleId=dto.DeleClient.Id;
                     bool res = await UpdateAsync(a => a.Id == dto.DeleClient.Id, a => new Crm_DeleClient
                     {
                         LastName = dto.DeleClient.LastName,
@@ -272,23 +276,75 @@ namespace OASystem.Infrastructure.Repositories.CRM
                     });
                     if (!res)
                     {
-                        return result = new Result() { Code = -1, Msg = "修改失败!" };
+                        result = new Result() { Code = -1, Msg = "修改失败!" };
                     }
-                    foreach (var item in dto.CustomerFamily)
+                    result = new Result() { Code = 0, Msg = "修改成功!" };
+                    
+                }
+                //进行其他表炒作
+                if (result.Code == 0)
+                {//家庭成员信息
+                    foreach (CustomerFamily item in dto.CustomerFamily)
                     {
-                        if (item.Id!=0)//修改
+                        Crm_VisaCustomerFamily Crm_VisaCustomerFamily = _mapper.Map<Crm_VisaCustomerFamily>(item);
+                        Crm_VisaCustomerFamily.DcId = deleId;
+                        if (item.Id != 0)//修改
                         {
+                            int res = await _sqlSugar.Updateable<Crm_VisaCustomerFamily>().Where(a => a.Id == Crm_VisaCustomerFamily.Id).SetColumns(a => new Crm_VisaCustomerFamily
+                            {
+                                Appellation = Crm_VisaCustomerFamily.Appellation,
+                                Name = Crm_VisaCustomerFamily.Name,
+                                BirthDay = Crm_VisaCustomerFamily.BirthDay,
+                                BirthPlace = Crm_VisaCustomerFamily.BirthPlace,
+                                Politics = Crm_VisaCustomerFamily.Politics,
+                                Client = Crm_VisaCustomerFamily.Client,
+                                Address = Crm_VisaCustomerFamily.Address,
+                                IsEu = Crm_VisaCustomerFamily.IsEu,
+                                NameSnd = Crm_VisaCustomerFamily.NameSnd,
+                                BirthDaySnd = Crm_VisaCustomerFamily.BirthDaySnd,
+                                Nationality = Crm_VisaCustomerFamily.Nationality,
+                                IDCard = Crm_VisaCustomerFamily.IDCard,
+                                Reletionship = Crm_VisaCustomerFamily.Reletionship,
+                                IsUSA = Crm_VisaCustomerFamily.IsUSA,
+                                Remark = Crm_VisaCustomerFamily.Remark,
+                            }).ExecuteCommandAsync();
+                        }
+                        else if (item.Id == 0)//添加
+                        {
+                           int sss= await _sqlSugar.Insertable(Crm_VisaCustomerFamily).ExecuteReturnIdentityAsync();
+                        }
+                    }
 
+                    //证件表信息
+                    foreach (CustomerCerts item in dto.CustomerCert)
+                    {
+                        Crm_CustomerCert CustomerCert = _mapper.Map<Crm_CustomerCert>(item);
+                        CustomerCert.DcId = deleId;
+                        if (item.Id != 0)//修改
+                        {
+                            int res = await _sqlSugar.Updateable<Crm_CustomerCert>().Where(a => a.Id == CustomerCert.Id).SetColumns(a => new Crm_CustomerCert
+                            {
+                                DcId=CustomerCert.DcId,
+                                SdId = CustomerCert.DcId,
+                                CertNo = CustomerCert.CertNo,
+                                Country = CustomerCert.Country,
+                                Area = CustomerCert.Area,
+                                TargetCountry = CustomerCert.TargetCountry,
+                                IssueDt = CustomerCert.IssueDt,
+                                ExpiryDt = CustomerCert.ExpiryDt,
+                                IDCardAddress = CustomerCert.IDCardAddress,
+                                CreateUserId = CustomerCert.CreateUserId,
+                                Remark = CustomerCert.Remark,
+                            }).ExecuteCommandAsync();
                         }
-                        else//添加
+                        else if (item.Id == 0)//添加
                         {
-                            
+                            int sss = await _sqlSugar.Insertable(CustomerCert).ExecuteReturnIdentityAsync();
                         }
                     }
-                   return  result = new Result() { Code = 0, Msg = "修改成功!" };
-                    //进行其他表操作
                 }
-                
+
+
             }
             catch (Exception)
             {

+ 27 - 0
OASystem/OASystem.Infrastructure/Repositories/Groups/GrpScheduleRepository.cs

@@ -49,6 +49,33 @@ namespace OASystem.Infrastructure.Repositories.Groups
             return sql;
         }
 
+        #region 获取添加后的新数据
+        public async Task<Grp_ScheduleDetailView> GetInsertBackData(int detailId)
+        {
+            Grp_ScheduleDetailInfo item = await _sqlSugar.Queryable<Grp_ScheduleDetailInfo>().FirstAsync(s => s.Id == detailId);
+            if (item != null)
+            {
+                Grp_ScheduleDetailView temp = new Grp_ScheduleDetailView();
+                temp.Duty = item.Duty;
+                temp.Exception = item.Exception;
+                temp.ExpectBeginDt = item.ExpectBeginDt;
+                temp.ExpectEndDt = item.ExpectEndDt;
+                temp.DetailId = item.Id;
+                temp.JobContent = item.JobContent;
+                temp.Level = item.SLevel;
+                temp.RealEndDt = item.RealEndDt;
+                temp.Remark = item.Remark;
+                temp.Root = item.ParentStep;
+                temp.Step = item.Step;
+                temp.StepStatus = item.StepStatus;
+
+                return temp;
+            }
+
+            return null;
+        }
+        #endregion
+
         /// <summary>
         /// 获取团组流程数据单个对象
         /// </summary>