Browse Source

部分代码修改

yuanrf 10 months ago
parent
commit
5c917c8a55

+ 7 - 3
OASystem/OASystem.Api/Controllers/BaiduOCRController.cs

@@ -68,8 +68,8 @@ namespace OASystem.API.Controllers
                     List<string> listSexStr = new List<string>() { "性别", "gender", "sex" };
                     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> 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++)
@@ -125,7 +125,7 @@ namespace OASystem.API.Controllers
                             }
                             catch (Exception)
                             {
-                               throw new Exception("有未能识别的列请检查 : " + JsonConvert.SerializeObject(headerList.Select(x => x.words)));
+                               throw new Exception("有未能识别的列请检查 : " + JsonConvert.SerializeObject(headerList.Select(x => x.words)));
                             }
 
                             if (words.IsNullOrWhiteSpace())
@@ -204,6 +204,10 @@ namespace OASystem.API.Controllers
 
                         if(!(client.FirstName + client.LastName + client.Pinyin + client.CompanyFullName + client.Job + client.Phone + client.Birthday).IsNullOrWhiteSpace())
                         {
+                            if (string.IsNullOrWhiteSpace(client.CompanyFullName))
+                            {
+                                client.CompanyFullName = "暂无";
+                            }
                             ClientArr.Add(client);
                         }
                     }

+ 113 - 0
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -5219,6 +5219,119 @@ namespace OASystem.API.Controllers
             return Ok(jw);
         }
 
+        #region OP行程单
+
+        /// <summary>
+        /// OP行程单初始化
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult InitOpTravel(InitOpTravelDto dto)
+        {
+            var jw = JsonView(false);
+            var groupList = _sqlSugar.Queryable<Grp_DelegationInfo>().Where(x => x.IsDel == 0).OrderByDescending(x => x.Id).ToList();
+            var group = groupList.First();
+            var diid = dto.Diid == -1 ? group?.Id : dto.Diid;
+
+            if (group == null)
+            {
+                jw.Msg = "暂无团组!";
+                return Ok(jw);
+            }
+
+            if (groupList.Find(x=>x.Id == diid) == null)
+            {
+                jw.Msg = "请输入正确的团组ID!";
+                return Ok(jw);
+            }
+
+            string city = string.Empty;
+            var blackCode = _sqlSugar.Queryable<Air_TicketBlackCode>().Where(x => x.IsDel == 0 && x.DiId == diid).ToList();
+            if (blackCode.Count > 0)
+            {
+                var black = blackCode.First();
+                black.BlackCode = black.BlackCode == null ? "" : black.BlackCode;
+                var blackSp = Regex.Split(black.BlackCode,"\r\n");
+                if (blackSp.Length > 0)
+                {
+                    try
+                    {
+                        var cityArrCode = new List<string>(20);
+                        foreach (var item in blackSp)
+                        {
+                            var itemSp = item.Split('.')[1].Split(' ').Where(x => !string.IsNullOrWhiteSpace(x)).ToList();
+                            var IndexSelect = itemSp[2];
+                            var startCity = IndexSelect.Substring(0, 3);
+                            var endCity = IndexSelect.Substring(3, 3);
+                            cityArrCode.Add(startCity.ToUpper());
+                            cityArrCode.Add(startCity.ToUpper());
+                        }
+                        string sql = $"SELECT * FROM Res_ThreeCode rtc WHERE UPPER(rtc.Three) in ({string.Join(",", cityArrCode)}) ";
+                        var cityArr = _sqlSugar.SqlQueryable<Res_ThreeCode>(sql).ToList();
+                        foreach (var item in cityArrCode)
+                        {
+                            var find =  cityArr.Find(x => x.Three.ToUpper() == item.ToUpper());
+                            if (find != null)
+                            {
+                                city += find.City + "/";
+                            }
+                            else
+                            {
+                                city += item + "三字码未收入/";
+                            }
+                        }
+                    }
+                    catch (Exception e)
+                    {
+                        city = "黑屏代码格式不正确!";
+                    }
+                }
+
+            }
+
+
+            var OpTravelList =  _sqlSugar.Queryable<Grp_TravelList>().Where(x=>x.Diid == dto.Diid && x.IsDel == 0).OrderBy(x=>x.Date).Select(x=> new TravelArrView
+            {
+                Date = x.Date,
+                Days = x.Days,
+                Diffgroup = x.Diffgroup,
+                Diid = x.Diid,
+                Traffic_First = x.Traffic_First,
+                Traffic_Second = x.Traffic_Second,
+                Trip = x.Trip,
+                WeekDay = x.WeekDay
+            }).ToList();
+
+            jw.Data = new
+            {
+                groupList = groupList.Select(x => new
+                {
+                    x.Id,
+                    x.TeamName,
+                    x.TourCode
+                }).ToList(),
+                groupInfo = new
+                {
+                    group.VisitDays,
+                    group.TourCode,
+                    group.VisitPNumber,
+                    group.TeamName,
+                    city
+                },
+                OpTravelList
+            };
+            jw.Code = 200;
+            jw.Msg = "操作成功!";
+
+            return Ok(jw);
+        }
+
+
+
+        #endregion
+
+
         #endregion
 
         #region 团组成本

+ 49 - 0
OASystem/OASystem.Domain/Dtos/Groups/CarTouristGuideGroundDto.cs

@@ -190,4 +190,53 @@ namespace OASystem.Domain.Dtos.Groups
         ///// </summary>
         //public string Remark { get; set; }
     }
+
+
+    public class InitOpTravelDto
+    {
+        public int Diid { get; set;}
+    }
+
+    public class TravelArrView
+    {
+        /// <summary>
+        ///  团组ID
+        /// </summary>
+        public int Diid { get; set; }
+
+        /// <summary>
+        ///  天数
+        /// </summary>
+        public int Days { get; set; }
+
+        /// <summary>
+        ///  日期
+        /// </summary>
+        public string Date { get; set; }
+
+        /// <summary>
+        ///  星期
+        /// </summary>
+        public string WeekDay { get; set; }
+
+        /// <summary>
+        ///  当日第1个交通工具
+        /// </summary>
+        public string Traffic_First { get; set; }
+
+        /// <summary>
+        ///   当日第2个交通工具
+        /// </summary>
+        public string Traffic_Second { get; set; }
+
+        /// <summary>
+        ///  行程       
+        /// </summary>
+        public string Trip { get; set; }
+
+        /// <summary>
+        /// 区分属于第几次保存
+        /// </summary>
+        public int Diffgroup { get; set; }
+    }
 }

+ 16 - 9
OASystem/OpWin/Home.cs

@@ -47,7 +47,7 @@ namespace OpWin
         {
             comb_Delegation.ValueMember = "Id";
             comb_Delegation.DisplayMember = "TeamName";
-            soure = Db.Queryable<Grp_DelegationInfo>().ToList();
+            soure = Db.Queryable<Grp_DelegationInfo>().Where(x=>x.IsDel == 0).ToList();
             comb_Delegation.Items.AddRange(soure.ToArray());
             comb_Delegation.DropDownHeight = 200;
         }
@@ -67,9 +67,9 @@ namespace OpWin
             }
             catch (Exception)
             {
-                lblOutputResult.Text = "请正确的选择团组!";
+                lblOutputResult.Text = "请选择正确的团组!";
                 lblOutputResult.ForeColor = Color.Black;
-                MessageBox.Show("请正确的选择团组!");
+                MessageBox.Show("请选择正确的团组!");
                 return;
             }
 
@@ -90,9 +90,9 @@ namespace OpWin
 
             if (di == null)
             {
-                lblOutputResult.Text = "请正确的选择团组!";
+                lblOutputResult.Text = "请选择正确的团组!";
                 lblOutputResult.ForeColor = Color.Black;
-                MessageBox.Show("请正确的选择团组!");
+                MessageBox.Show("请选择正确的团组!");
                 return;
             }
 
@@ -4817,7 +4817,7 @@ namespace OpWin
 
                 //查询该三字码所对应城市的数据
                 //ThreeCode Pre_TC = tcs.getByThree(Pre_citycode);
-                Res_ThreeCode Pre_TC = Db.Queryable<Res_ThreeCode>().First(x => x.Three == Pre_citycode.ToUpper() && x.IsDel == 0 );
+                Res_ThreeCode Pre_TC = Db.Queryable<Res_ThreeCode>().First(x => x.Three.ToUpper() == Pre_citycode.ToUpper() && x.IsDel == 0 );
 
                 //验证是否存在三字码
                 if (Pre_TC == null)
@@ -4861,7 +4861,7 @@ namespace OpWin
         Res_AirCompany getByShortCode(string ShortCode)
         {
             //return this.excuteType("select * from AirCompany where Isdel=0 and ShortCode=@ShortCode", new SqlParameter("@ShortCode", ShortCode.ToUpper()));
-            return Db.Queryable<Res_AirCompany>().First(x => x.ShortCode == ShortCode.ToUpper() && x.IsDel == 0);
+            return Db.Queryable<Res_AirCompany>().First(x => x.ShortCode.ToUpper() == ShortCode.ToUpper() && x.IsDel == 0);
         }
 
         public class GoogleMapApiResult
@@ -5092,15 +5092,22 @@ namespace OpWin
             {
                 this.comb_Delegation.Items.AddRange(bindList.ToArray());
             }
+            else
+            {
+                this.comb_Delegation.Items.Add(new Grp_DelegationInfo { TeamName = "", Id = -1 });
+            }
+           
             cb.SelectionStart = cb.Text.Length;  // 设置光标位置,若不设置:光标位置始终保持在第一列,造成输入关键词的倒序排列
             cb.Cursor = Cursors.Default; //保持鼠标指针原来状态,有时候鼠标指针会被下拉框覆盖,所以要进行一次设置
-            cb.MaxDropDownItems = 8; // 自动弹出下拉框
-            
+            cb.MaxDropDownItems = 8; // 自动弹出下拉框            
         }
 
 
         private void comb_Delegation_MouseClick(object sender, MouseEventArgs e)
         {
+            comb_Delegation.Text = "";
+            comb_Delegation_TextUpdate(sender, e);
+            comb_Delegation.DropDownHeight = 200;
             comb_Delegation.DroppedDown = true;
         }
     }