Browse Source

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

leiy 1 year ago
parent
commit
0065db39a6

+ 153 - 122
OASystem/OASystem.Api/Controllers/BaiduOCRController.cs

@@ -8,6 +8,7 @@ using OASystem.Domain.Dtos.Baidu;
 using OASystem.Domain.Dtos.CRM;
 using OASystem.Domain.Entities.Customer;
 using OASystem.Domain.ViewModels.OCR;
+using Quartz.Util;
 
 namespace OASystem.API.Controllers
 {
@@ -41,162 +42,192 @@ namespace OASystem.API.Controllers
             {
                 return Ok(JsonView("请上传图片base64编码数据!"));
             }
-         
 
             JsonView jw = new JsonView();
-            string api_Response = BaiduApiHelper._apiTableV2(dto.base64img);
-            JObject json = JObject.Parse(api_Response);
-            if (json["tables_result"][0]["body"] != null)
+            try
             {
-               
-                List<BaiduOCR_TableV2> sourceList = JsonConvert.DeserializeObject<List<BaiduOCR_TableV2>>(json["tables_result"][0]["body"].ToString());
-                List<BaiduOCR_TableV2> headerList = sourceList.Where(s => s.row_start == 0).OrderBy(s => s.col_start).ToList();
-                List<BaiduOCR_TableV2> dataList = sourceList.Where(s => s.row_start != 0).ToList();
-                int maxRowIndex = dataList.Max(s => s.row_start);
-                int maxColIndex = headerList.Max(s => s.col_start) + 1;
-                Dictionary<int, string> dicHeader = new Dictionary<int, string>();
-                List<string> listNameStr = new List<string>() { "姓名", "Name" };
-                List<string> listSexStr = new List<string>() { "性别", "Gender" };
-                List<string> listDOBStr = new List<string>() { "D.O.B", "出生年月","生日" };
-                List<string> listIdCard = new List<string>() { "身份证号码", "身份证" };
-                List<string> listOrganizationStr = new List<string>() { "工作单位", "Organization", "单位" };
-                List<string> listJobStr = new List<string>() { "职务", "Title", "职位" };
-                List<string> listMobileStr = new List<string>() { "联系电话", "Mobile" };
-                List<string> listAgeStr = new List<string>() { "年龄", "Age" };
-                for (int i = 0; i < headerList.Count; i++)
+                string api_Response = BaiduApiHelper._apiTableV2(dto.base64img);
+                JObject json = JObject.Parse(api_Response);
+                if (json["tables_result"][0]["body"] != null)
                 {
-                    string words = headerList[i].words.Trim();
-                    if (listNameStr.Exists(s => s == words))
-                    {
-                        dicHeader.Add(i, "Name");
-                    }
-                    else if (listSexStr.Exists(s => s == words))
-                    {
-                        dicHeader.Add(i, "Sex");
-                    }
-                    else if (listDOBStr.Exists(s => s == words))
-                    {
-                        dicHeader.Add(i, "DOB");
-                    }
-                    else if (listIdCard.Exists(s => s == words))
-                    {
-                        dicHeader.Add(i, "IdCard");
-                    }
-                    else if (listOrganizationStr.Exists(s => s == words))
-                    {
-                        dicHeader.Add(i, "Organization");
-                    }
-                    else if (listJobStr.Exists(s => s == words))
-                    {
-                        dicHeader.Add(i, "Job");
-                    }
-                    else if (listMobileStr.Exists(s => s == words))
+
+                    List<BaiduOCR_TableV2> sourceList = JsonConvert.DeserializeObject<List<BaiduOCR_TableV2>>(json["tables_result"][0]["body"].ToString());
+                    List<BaiduOCR_TableV2> headerList = sourceList.Where(s => s.row_start == 0).OrderBy(s => s.col_start).Select(x => new BaiduOCR_TableV2
                     {
-                        dicHeader.Add(i, "Mobile");
-                    }
-                    else if (listAgeStr.Exists(s => s == words))
+                        col_end = x.col_end,
+                        col_start = x.col_start,
+                        row_end = x.row_end,
+                        row_start = x.row_start,
+                        words = Regex.Replace(x.words, "[`~!@#$%^&*()_\\-+=<>?:\"{}|,.\\/;'\\\\[\\]·!#¥(——):;“”‘、,|《。》?、【】[\\]]", string.Empty)
+                    }).ToList();
+                    List<BaiduOCR_TableV2> dataList = sourceList.Where(s => s.row_start != 0).ToList();
+                    int maxRowIndex = dataList.Max(s => s.row_start);
+                    int maxColIndex = headerList.Max(s => s.col_start) + 1;
+                    Dictionary<int, string> dicHeader = new Dictionary<int, string>();
+                    List<string> listNameStr = new List<string>() { "姓名", "Name" };
+                    List<string> listSexStr = new List<string>() { "性别", "Gender" };
+                    List<string> listDOBStr = new List<string>() { "D.O.B", "出生年月", "生日", "出生日期" };
+                    List<string> listIdCard = new List<string>() { "身份证号码", "身份证" };
+                    List<string> listOrganizationStr = new List<string>() { "工作单位", "Organization", "单位", "所在单位及职务" };
+                    List<string> listJobStr = new List<string>() { "职务", "Title", "职位" };
+                    List<string> listMobileStr = new List<string>() { "联系电话", "Mobile" };
+                    List<string> listAgeStr = new List<string>() { "年龄", "Age" };
+                    for (int i = 0; i < headerList.Count; i++)
                     {
-                        dicHeader.Add(i, "Age");
-                    }
+                        string words = headerList[i].words.Trim();
+                        if (listNameStr.Exists(s => s == words))
+                        {
+                            dicHeader.Add(i, "Name");
+                        }
+                        else if (listSexStr.Exists(s => s == words))
+                        {
+                            dicHeader.Add(i, "Sex");
+                        }
+                        else if (listDOBStr.Exists(s => s == words))
+                        {
+                            dicHeader.Add(i, "DOB");
+                        }
+                        else if (listIdCard.Exists(s => s == words))
+                        {
+                            dicHeader.Add(i, "IdCard");
+                        }
+                        else if (listOrganizationStr.Exists(s => s == words))
+                        {
+                            dicHeader.Add(i, "Organization");
+                        }
+                        else if (listJobStr.Exists(s => s == words))
+                        {
+                            dicHeader.Add(i, "Job");
+                        }
+                        else if (listMobileStr.Exists(s => s == words))
+                        {
+                            dicHeader.Add(i, "Mobile");
+                        }
+                        else if (listAgeStr.Exists(s => s == words))
+                        {
+                            dicHeader.Add(i, "Age");
+                        }
 
-                }
+                    }
 
-                List<BaiduClientOCRView> ClientArr = new List<BaiduClientOCRView>();
-                for (int i = 1; i <= maxRowIndex; i++)
-                {
-                    BaiduClientOCRView client = new BaiduClientOCRView();
-                    for (int j = 0; j < maxColIndex; j++)
+                    List<BaiduClientOCRView> ClientArr = new List<BaiduClientOCRView>();
+                    for (int i = 1; i <= maxRowIndex; i++)
                     {
-                        var item = dataList.First(s => s.row_start == i && s.col_start == j);
-                        string words = item.words.Replace("\\n", "");
-                        string values = dicHeader[j];
-
-                        if (values.Equals("Name"))
+                        BaiduClientOCRView client = new BaiduClientOCRView();
+                        for (int j = 0; j < maxColIndex; j++)
                         {
-                            if (Regex.Matches(words, "[a-zA-Z]").Count < 1)
+                            var item = dataList.First(s => s.row_start == i && s.col_start == j);
+                            string words = item.words.Replace("\\n", "");
+                            string values = string.Empty;
+                            try
+                            {
+                                values = dicHeader[j];
+                            }
+                            catch (Exception)
                             {
-                                string lastName = words.Substring(0, 1);
-                                string name = words.Substring(1);
-                                client.LastName = lastName;
-                                client.FirstName = name;
-                                string lastNamePinYin = lastName.GetTotalPingYin()[0].ToUpper();
-                                string firstNamePinYin = "";
-
-                                for (int n = 0; n < name.Length; n++)
+                               throw new Exception("有未能识别的列头请检查 : " + JsonConvert.SerializeObject(headerList.Select(x => x.words)));
+                            }
+
+                            if (words.IsNullOrWhiteSpace())
+                            {
+                                continue;
+                            }
+
+                            if (values.Equals("Name"))
+                            {
+                                if (Regex.Matches(words, "[a-zA-Z]").Count < 1)
                                 {
-                                    firstNamePinYin += name[n].ToString().GetTotalPingYin()[0].ToUpper() + " ";
+                                    string lastName = words.Substring(0, 1);
+                                    string name = words.Substring(1);
+                                    client.LastName = lastName;
+                                    client.FirstName = name;
+                                    string lastNamePinYin = lastName.GetTotalPingYin()[0].ToUpper();
+                                    string firstNamePinYin = "";
+
+                                    for (int n = 0; n < name.Length; n++)
+                                    {
+                                        firstNamePinYin += name[n].ToString().GetTotalPingYin()[0].ToUpper() + " ";
+                                    }
+
+                                    client.Pinyin = lastNamePinYin + "/" + firstNamePinYin;
+                                }
+                                else
+                                {
+                                    Regex regForeign = new Regex("[a-zA-Z]+[\\s][a-zA-Z]+");
+                                    if (regForeign.IsMatch(words))
+                                    {
+                                        string[] names = words.Split(' ');
+                                        client.LastName = names[1];
+                                        client.FirstName = names[0];
+                                    }
+                                    else
+                                    {
+                                        client.FirstName = words;
+                                    }
                                 }
-
-                                client.Pinyin = lastNamePinYin + "/"+ firstNamePinYin;
                             }
-                            else
+                            else if (values.Equals("Sex"))
                             {
-                                Regex regForeign = new Regex("[a-zA-Z]+[\\s][a-zA-Z]+");
-                                if (regForeign.IsMatch(words))
+                                client.Sex = words == "男" ? 0 : 1;
+                            }
+                            else if (values.Equals("DOB"))
+                            {
+                                client.Birthday = words.Replace(".", "-");
+                                DateTime time = new DateTime();
+                                if (DateTime.TryParse(client.Birthday, out time))
                                 {
-                                    string[] names = words.Split(' ');
-                                    client.LastName = names[1];
-                                    client.FirstName = names[0];
+                                    client.Birthday = time.ToString("yyyy-MM-dd");
                                 }
                                 else
                                 {
-                                    client.FirstName = words;
+                                    client.Birthday = "";
                                 }
+
                             }
-                        }
-                        else if (values.Equals("Sex"))
-                        {
-                            client.Sex = words;
-                        }
-                        else if (values.Equals("DOB"))
-                        {
-                            client.Birthday = words;
-                            DateTime time = new DateTime();
-                            if (DateTime.TryParse(client.Birthday, out time))
+                            else if (values.Equals("IdCard"))
                             {
-                                client.Birthday = time.ToString("yyyy-MM-dd");
+                                client.IDcard = words;
                             }
-                            else
+                            else if (values.Equals("Organization"))
                             {
-                                client.Birthday = "";
+                                client.CompanyFullName = words;
+                            }
+                            else if (values.Equals("Job"))
+                            {
+                                client.Job = words;
+                            }
+                            else if (values.Equals("Mobile"))
+                            {
+                                client.Phone = words;
                             }
-
-                        }
-                        else if (values.Equals("IdCard"))
-                        {
-                            client.IDcard = words;
-                        }
-                        else if (values.Equals("Organization"))
-                        {
-                            client.CompanyFullName = words;
-                        }
-                        else if (values.Equals("Job"))
-                        {
-                            client.Job = words;
                         }
-                        else if (values.Equals("Mobile"))
+
+                        if(!(client.FirstName + client.LastName + client.Pinyin + client.CompanyFullName + client.Job + client.Phone + client.Birthday).IsNullOrWhiteSpace())
                         {
-                            client.Phone = words;
+                            ClientArr.Add(client);
                         }
                     }
+                    jw.Code = 200;
+                    jw.Msg = "获取成功!";
+                    jw.Data = ClientArr;
 
-                    ClientArr.Add(client);
                 }
-
-                jw.Code = 200;
-                jw.Msg = "获取成功!";
-                jw.Data = ClientArr;
-
-            }
-            else if (json["error_code"] != null)
-            {
-                jw.Data = new string[0];
-                jw.Msg = "百度接口异常!";
+                else if (json["error_code"] != null)
+                {
+                    jw.Data = new string[0];
+                    jw.Msg = "百度接口异常!";
+                }
+                else
+                {
+                    jw.Data = new string[0];
+                    jw.Msg = "百度接口异常!";
+                }
             }
-            else
+            catch (Exception ex)
             {
+                jw.Code = 400;
+                jw.Msg = "程序异常!" + ex.Message;
                 jw.Data = new string[0];
-                jw.Msg = "百度接口异常!";
             }
 
             return Ok(jw);

+ 21 - 0
OASystem/OASystem.Api/Controllers/BusinessController.cs

@@ -360,6 +360,27 @@ namespace OASystem.API.Controllers
                                 teamRateDescViews.Add(rateDescView);
                             }
                         }
+                        else
+                        {
+                            if (!string.IsNullOrEmpty(item.Remark))
+                            {
+                                string[] currency1 = item.Remark.Split(":");
+                                string[] currency2 = currency1[0].Split("(");
+
+                                string currencyCode = currency2[1].Replace(")", "").TrimEnd();
+                                SetDataInfoView dataInfoView = new SetDataInfoView();
+                                dataInfoView = currencyDatas.Where(it => it.Name == currencyCode).FirstOrDefault();
+                                int currencyId = currencyDatas.Where(it => it.Name == currencyCode).FirstOrDefault().Id;
+                                TeamRateDescAddCurrencyIdView rateDescView = new TeamRateDescAddCurrencyIdView()
+                                {
+                                    CurrencyId = dataInfoView.Id,
+                                    CurrencyCode = currencyCode,
+                                    CurrencyName = currency2[0],
+                                    Rate = decimal.Parse(currency1[1]),
+                                };
+                                teamRateDescViews.Add(rateDescView);
+                            }
+                        }
 
                         #endregion
 

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

@@ -1818,6 +1818,28 @@ namespace OASystem.API.Controllers
             }
         }
 
+        /// <summary>
+        /// 根据团号获取客户信息
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public IActionResult QueryClientInfoByDIID(QueryClientInfoByDIIDDto dto)
+        {
+            var jw = JsonView(false);
+            if (dto.DIID < 1)
+            {
+                jw.Msg += "请输入正确的diid";
+                return Ok(jw);
+            }
+            string sql = string.Format("select b.Id,b.Pinyin,b.lastName,b.firstName,b.phone from  Grp_TourClientList a, Crm_DeleClient b where a.clientid = b.id and a.isdel = 0 and a.diid = {0}",dto.DIID);
+            var arr = _sqlSugar.SqlQueryable<SimplClientInfo>(sql).ToList();
+            jw = JsonView(true, "获取成功!", arr);
+
+            return Ok(jw); 
+        }
+
         /// <summary>
         /// 机票费用录入,删除
         /// </summary>
@@ -1830,7 +1852,7 @@ namespace OASystem.API.Controllers
             try
             {
                 var res = await _airTicketResRep.SoftDeleteByIdAsync<Grp_AirTicketReservations>(dto.Id.ToString(), dto.DeleteUserId);
-                if (!res)
+                if (res)
                 {
                     var result = await _sqlSugar.Updateable<Grp_CreditCardPayment>().Where(a => a.CId == dto.Id && a.CTable == 85).SetColumns(a => new Grp_CreditCardPayment()
                     {
@@ -1838,9 +1860,9 @@ namespace OASystem.API.Controllers
                         DeleteUserId = dto.DeleteUserId,
                         DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
                     }).ExecuteCommandAsync();
-                    return Ok(JsonView(false, "删除失败"));
+                    return Ok(JsonView(true, "删除成功!"));
                 }
-                return Ok(JsonView(true, "删除成功!"));
+                return Ok(JsonView(false, "删除失败!"));
             }
             catch (Exception ex)
             {

+ 6 - 0
OASystem/OASystem.Domain/Dtos/Groups/AirTicketResDto.cs

@@ -34,6 +34,12 @@ namespace OASystem.Domain.Dtos.Groups
     {
         public int Id { get; set; }
     }
+
+    public class QueryClientInfoByDIIDDto
+    {
+        public int DIID { get; set; }
+    }
+
     public class AirTicketResOpDto
     {
         /// <summary>

+ 9 - 0
OASystem/OASystem.Domain/ViewModels/Groups/TourClientListView.cs

@@ -186,4 +186,13 @@ namespace OASystem.Domain.ViewModels.Groups
         /// </summary>
         public string? CompanyFullName { get; set; }
     }
+
+    public class SimplClientInfo
+    {
+        public int Id { get; set; }
+        public string Pinyin { get; set; }
+        public string LastName { get; set; }
+        public string FirstName { get; set; }
+        public string Phone { get;set; }
+    }
 }

+ 1 - 1
OASystem/OASystem.Domain/ViewModels/OCR/BaiduClientOCRView.cs

@@ -25,7 +25,7 @@ namespace OASystem.Domain.ViewModels.OCR
         /// <summary>
         /// 性别
         /// </summary>
-        public string Sex { get; set; }
+        public int Sex { get; set; }
         /// <summary>
         /// 生日
         /// </summary>

+ 27 - 6
OASystem/OASystem.Infrastructure/Repositories/Groups/AirTicketResRepository.cs

@@ -232,14 +232,18 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 AirGroupCostParameterView _AirgroupCostParameter = _mapper.Map<AirGroupCostParameterView>(_GroupCostParameter);
                 for (int i = 0; i <_AirTicketReservations.Count; i++)
                 {
-                  string [] ClientArr=  _AirTicketReservations[i].ClientName.Split(',');
+                  string [] ClientArr=  _AirTicketReservations[i].ClientName.Split(',').Where(x=>!string.IsNullOrWhiteSpace(x)).ToArray();
                     
                     foreach (var item in ClientArr)
                     {
-                        Crm_GroupCustomer crm_GroupCustomer = _sqlSugar.Queryable<Crm_GroupCustomer>().Where(a => a.IsDel==0 && a.Id==int.Parse(item)).First();
-                        _AirTicketReservations[i].ClientNameStr+=crm_GroupCustomer.Pinyin+',';
+                        Crm_DeleClient DeleClient = _sqlSugar.Queryable<Crm_DeleClient>().Where(a => a.IsDel==0 && a.Id==int.Parse(item)).First();
+                        _AirTicketReservations[i].ClientNameStr+= DeleClient.Pinyin+',';
                     }
-                    _AirTicketReservations[i].ClientNameStr=_AirTicketReservations[i].ClientNameStr.Substring(0, _AirTicketReservations[i].ClientNameStr.Length-1);
+                    if (_AirTicketReservations[i].ClientNameStr is not null)
+                    {
+                        _AirTicketReservations[i].ClientNameStr = _AirTicketReservations[i].ClientNameStr.Substring(0, _AirTicketReservations[i].ClientNameStr.Length - 1);
+                    }
+                    
                 }
 
                 if (dto.PortType==1)
@@ -301,6 +305,11 @@ namespace OASystem.Infrastructure.Repositories.Groups
             Result result = new Result() { Code = -2, Msg = "未知错误" };
             try
             {
+                if (dto.DiId < 1)
+                {
+                    dto.DiId = -1;
+                }
+
                 #region 团组下拉框
 
 
@@ -347,20 +356,32 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 List<Res_AirTicketAgent> _AirTicketAgents = _sqlSugar.Queryable<Res_AirTicketAgent>().Where(a => a.IsDel == 0).ToList();
 
                 #endregion
+
+                #region 客人名单下拉框
+                if (dto.DiId == -1)
+                {
+                    var dele = _AirTicketAgents.FirstOrDefault();
+                    dto.DiId = dele != null ? dele.Id : dto.DiId;
+                }
+                string sqlClient = string.Format("select b.Id,b.Pinyin,b.lastName,b.firstName,b.phone from  Grp_TourClientList a, Crm_DeleClient b where a.clientid = b.id and a.isdel = 0 and a.diid = {0}", dto.DiId);
+                var clientArr = _sqlSugar.SqlQueryable<SimplClientInfo>(sqlClient).ToList();
+                #endregion
+
                 var data = new
                 {
                     TicketClass = _TicketClassa,
                     Payment = _Payment,
                     CardType = _CardType,
                     GroupName = grp_NameView,
-                    AirTicketAgents = _AirTicketAgents
+                    AirTicketAgents = _AirTicketAgents,
+                    clientArr
                 };
+
                 return result = new Result() { Code = 0, Msg = "查询成功!", Data = data };
             }
             catch (Exception ex)
             {
                 return result = new Result() { Code = -2, Msg = "程序错误" };
-                throw;
             }
         }
 

+ 22 - 7
OASystem/OASystem.Infrastructure/Repositories/Groups/DelegationInfoRepository.cs

@@ -282,7 +282,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         List<Crm_CustomerCert> _CustomerCerts = await _sqlSugar.Queryable<Crm_CustomerCert>().Where(it => it.IsDel == 0 && it.SdId == 773).ToListAsync(); // 身份证类型证件信息
                         List<Crm_CustomerCompany> CompanyArr = await _sqlSugar.Queryable<Crm_CustomerCompany>().Where(it => it.IsDel == 0).ToListAsync();
                         var TourClientListInfoArr = new List<TourClientListProcessInfo>();
-
+                        var timeParam = new DateTime();
                         foreach (var item in _DeleClients)
                         {
                             var param = new TourClientListProcessInfo();
@@ -295,7 +295,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                             param.IDCardNo = clientIDInfo.CertNo;
                             param.Remark = item.Remark;
-                            param.BirthDay = clientInfo.BirthDay.Length > 10 ? clientInfo.BirthDay.Substring(0, 10).Replace("/", "-").Trim() : "";
+                            param.BirthDay = DateTime.TryParse(clientInfo.BirthDay, out timeParam) ? timeParam.ToString("yyyy-MM-dd") : "";
                             param.FirstName = clientInfo.FirstName;
                             param.LastName = clientInfo.LastName;
                             param.CompanyFullName = Company.CompanyFullName;
@@ -314,8 +314,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                         GroupProcessOperationDtoParam.PortType = dto.PortType;
                         GroupProcessOperationDtoParam.TourClientListInfos = TourClientListInfoArr;
-                        GroupProcessOperationDtoParam.VisitDate = GroupProcessOperationDtoParam.VisitDate.Length > 10 ? GroupProcessOperationDtoParam.VisitDate.Substring(0, 10).Replace("/","-").Trim() : "";
-                        GroupProcessOperationDtoParam.TontractTime = GroupProcessOperationDtoParam.TontractTime.Length > 10 ? GroupProcessOperationDtoParam.TontractTime.Substring(0, 10).Replace("/","-").Trim() : "";
+                        GroupProcessOperationDtoParam.VisitDate = DateTime.TryParse(GroupProcessOperationDtoParam.VisitDate, out timeParam) ? timeParam.ToString("yyyy-MM-dd") : "";
+                        GroupProcessOperationDtoParam.TontractTime = DateTime.TryParse(GroupProcessOperationDtoParam.TontractTime, out timeParam) ? timeParam.ToString("yyyy-MM-dd") : "";
 
                         result.Data = GroupProcessOperationDtoParam;
                     }
@@ -396,6 +396,17 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
             if (dto.PortType == 1 || dto.PortType == 2) //web
             {
+
+                #region 添加出访起止时间
+                var startTime = new DateTime();
+                var endTime = new DateTime();
+                if (DateTime.TryParse(dto.VisitDate, out startTime))
+                {
+                    endTime = startTime.AddDays(dto.VisitDays);
+                }
+                #endregion
+
+
                 if (dto.Status == 1) //添加
                 {
                     string selectSql = string.Format(@"Select * From Grp_DelegationInfo 
@@ -478,7 +489,9 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         DeleteTime = new DateTime(1990, 1, 1).ToString("yyyy-MM-dd HH:mm:ss"),
                         OpRoyaltyLv = dto.OpRoyaltyLv,
                         OpRoyaltyRemark=dto.opRoyaltyRemark,
-                        Officialneeds = dto.Officialneeds
+                        Officialneeds = dto.Officialneeds,
+                        VisitStartDate = startTime, 
+                        VisitEndDate = endTime,
                     };
 
                     var addId = await _sqlSugar.Insertable(delegationInfo).ExecuteReturnIdentityAsync();
@@ -524,7 +537,9 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         PayDay = dto.PayDay,
                         OpRoyaltyLv = dto.OpRoyaltyLv,
                         OpRoyaltyRemark = dto.opRoyaltyRemark,
-                        Officialneeds = dto.Officialneeds
+                        Officialneeds = dto.Officialneeds,
+                        VisitStartDate = startTime,
+                        VisitEndDate = endTime,
                     });
 
                     if (updateStatus)
@@ -660,7 +675,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
 
             string teamCode = "";
-            if (dto.PortType == 1 || dto.PortType == 2) //web
+            if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3) //web
             {
 
                 string teamCodeSql = string.Format("Select TourCode From Grp_DelegationInfo");

+ 1 - 0
OASystem/OASystem.Infrastructure/Repositories/System/SystemMenuPermissionRepository.cs

@@ -69,6 +69,7 @@ namespace OASystem.Infrastructure.Repositories.System
         public Result QueryMenuLoad(int uid,int PortType)
         {
             Result result = new Result();
+            result.Data = new string [0];
 
             if (uid != 0)
             {