Browse Source

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

yuanrf 3 months ago
parent
commit
d68e2c361b
25 changed files with 859 additions and 868 deletions
  1. 189 335
      OASystem/OASystem.Api/Controllers/ResourceController.cs
  2. 11 5
      OASystem/OASystem.Api/Controllers/SystemController.cs
  3. 3 0
      OASystem/OASystem.Domain/AesEncryption/EncryptionProcessor.cs
  4. 2 0
      OASystem/OASystem.Domain/AutoMappers/_baseMappingProfile.cs
  5. 23 4
      OASystem/OASystem.Domain/Dtos/Resource/CarDataDto.cs
  6. 6 1
      OASystem/OASystem.Domain/Dtos/Resource/OpAirTicketAgentDto.cs
  7. 10 0
      OASystem/OASystem.Domain/Dtos/Resource/TranslatorLibraryDto.cs
  8. 3 1
      OASystem/OASystem.Domain/Entities/EntityBase.cs
  9. 8 4
      OASystem/OASystem.Domain/Entities/Resource/Res_AirTicketAgent.cs
  10. 34 15
      OASystem/OASystem.Domain/Entities/Resource/Res_CarData.cs
  11. 33 17
      OASystem/OASystem.Domain/Entities/Resource/Res_LocalGuideData.cs
  12. 24 12
      OASystem/OASystem.Domain/Entities/Resource/Res_MediaSuppliers.cs
  13. 19 10
      OASystem/OASystem.Domain/Entities/Resource/Res_TranslatorLibrary.cs
  14. 38 9
      OASystem/OASystem.Domain/ViewModels/Resource/CarDataView.cs
  15. 2 0
      OASystem/OASystem.Domain/ViewModels/Resource/HotelDataView.cs
  16. 18 1
      OASystem/OASystem.Domain/ViewModels/Resource/LocalGuideDataView.cs
  17. 65 0
      OASystem/OASystem.Domain/ViewModels/Resource/MediaSupplierView.cs
  18. 6 1
      OASystem/OASystem.Domain/ViewModels/Resource/Res_LocalGuideData_ListItemView.cs
  19. 44 0
      OASystem/OASystem.Domain/ViewModels/Resource/TranslatorLibraryView.cs
  20. 58 43
      OASystem/OASystem.Infrastructure/Repositories/Groups/CarTouristGuideGroundRepository.cs
  21. 30 36
      OASystem/OASystem.Infrastructure/Repositories/Resource/AirTicketAgentRepository.cs
  22. 86 114
      OASystem/OASystem.Infrastructure/Repositories/Resource/CarDataRepository.cs
  23. 1 1
      OASystem/OASystem.Infrastructure/Repositories/Resource/HotelDataRepository.cs
  24. 106 230
      OASystem/OASystem.Infrastructure/Repositories/Resource/LocalGuideDataRepository.cs
  25. 40 29
      OASystem/OASystem.Infrastructure/Repositories/Resource/MediaSuppliersRepository.cs

+ 189 - 335
OASystem/OASystem.Api/Controllers/ResourceController.cs

@@ -16,7 +16,7 @@ using OASystem.Domain.ViewModels.QiYeWeChat;
 using OASystem.Infrastructure.Repositories.Groups;
 using Org.BouncyCastle.Utilities.Encoders;
 using System.Data;
-using XAct.Users;
+using System.Diagnostics;
 using static OASystem.API.OAMethodLib.JWTHelper;
 using static OpenAI.GPT3.ObjectModels.SharedModels.IOpenAiModels;
 
@@ -111,25 +111,15 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> QueryCarData(QueryCarDataDto dto)
         {
-            try
+            Result LocalGuide = await _carDataRep.QueryCarData(dto);
+            if (LocalGuide.Code == 0)
             {
-                Result LocalGuide = await _carDataRep.QueryCarData(dto);
-                if (LocalGuide.Code == 0)
-                {
-                    return Ok(JsonView(true, "查询成功", LocalGuide.Data));
-                }
-                else
-                {
-                    return Ok(JsonView(false, LocalGuide.Msg));
-                }
+                return Ok(JsonView(true, "查询成功", LocalGuide.Data));
             }
-            catch (Exception)
+            else
             {
-                return Ok(JsonView(false, "程序错误!"));
-                throw;
+                return Ok(JsonView(false, LocalGuide.Msg));
             }
-
-
         }
 
         /// <summary>
@@ -140,31 +130,26 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> QueryCarSelect()
         {
-            try
+            var carData = _carDataRep.QueryDto<Res_CarData, CarDataSelectView>().ToList();
+            if (carData.Count == 0)
             {
-                var CarData = _carDataRep.QueryDto<Res_CarData, CarDataSelectView>().ToList();
-                if (CarData.Count == 0)
-                {
-                    return Ok(JsonView(false, "暂无数据!"));
-                }
-                CarData.Add(new CarDataSelectView { Id = 0, UnitArea = "全部" });
-                CarData = CarData.Where((x, i) => CarData.FindIndex(z => z.UnitArea == x.UnitArea) == i).ToList();
-                CarData = CarData.OrderBy(x => x.Id).ToList();
-                List<CarDataSelectView> data = new List<CarDataSelectView>();
-                foreach (CarDataSelectView car in CarData)
-                {
-                    if (!string.IsNullOrWhiteSpace(car.UnitArea))
-                    {
-                        data.Add(car);
-                    }
-                }
-                return Ok(JsonView(true, "查询成功", data));
+                return Ok(JsonView(false, "暂无数据!"));
             }
-            catch (Exception)
+
+            foreach (var item in carData) EncryptionProcessor.DecryptProperties(item);
+
+            carData.Add(new CarDataSelectView { Id = 0, UnitArea = "全部" });
+            carData = carData.Where((x, i) => carData.FindIndex(z => z.UnitArea == x.UnitArea) == i).ToList();
+            carData = carData.OrderBy(x => x.Id).ToList();
+            var data = new List<CarDataSelectView>();
+            foreach (CarDataSelectView car in carData)
             {
-                return Ok(JsonView(false, "程序错误!"));
-                throw;
+                if (!string.IsNullOrWhiteSpace(car.UnitArea))
+                {
+                    data.Add(car);
+                }
             }
+            return Ok(JsonView(true, "查询成功", data));
         }
 
         /// <summary>
@@ -176,12 +161,12 @@ namespace OASystem.API.Controllers
         public async Task<IActionResult> QuerCarDataDetailById(QueryCarDataDetailDto dto)
         {
             string sql = string.Format(@" Select * From Res_CarData With(Nolock) Where Id = {0} ", dto.Id);
-            CarDataDetailDataView info = _resItemInfoRep._sqlSugar.SqlQueryable<CarDataDetailDataView>(sql).First();
+            var info = _resItemInfoRep._sqlSugar.SqlQueryable<CarDataDetailDataView>(sql).First();
             if (info == null)
             {
                 return Ok(JsonView(false, "未找到相关数据!"));
             }
-
+            EncryptionProcessor.DecryptProperties(info);
             return Ok(JsonView(true, "查询成功", info));
         }
 
@@ -194,43 +179,24 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> AddCarData(AddCarDataDto dto)
         {
-            try
-            {
-                if (dto.UnitArea == "")
-                {
-                    return Ok(JsonView(false, "请检查单位区域是否填写!"));
-                }
-                if (dto.UnitName == "")
-                {
-                    return Ok(JsonView(false, "请检查单位名称是否填写!"));
-                }
-                if (dto.Contact == "")
-                {
-                    return Ok(JsonView(false, "请检查单位联系人是否填写!"));
-                }
-                if (dto.ContactTel == "")
-                {
-                    return Ok(JsonView(false, "请检查联系方式是否填写正确!"));
-                }
-
-                var carDada = _carDataRep.QueryDto<Res_CarData, CarDataView>(a => a.UnitArea == dto.UnitArea && a.UnitName == dto.UnitName && a.Contact == dto.Contact && a.ContactTel == dto.ContactTel).ToList();
-                if (carDada.Count != 0)
-                {
-                    return Ok(JsonView(false, "该信息已存在,请勿重复添加!"));
-                }
-                Res_CarData _CarData = _mapper.Map<Res_CarData>(dto);
-                int id = await _carDataRep.AddAsyncReturnId(_CarData);
-                if (id == 0)
-                {
-                    return Ok(JsonView(false, "添加失败!"));
-                }
-                return Ok(JsonView(true, "添加成功", new { Id = id }));
-            }
-            catch (Exception ex)
-            {
-                return Ok(JsonView(false, "程序错误!"));
-                throw;
-            }
+            if (string.IsNullOrEmpty(dto.UnitArea)) return Ok(JsonView(false, "请检查单位区域是否填写!"));
+            if (string.IsNullOrEmpty(dto.UnitName)) return Ok(JsonView(false, "请检查单位名称是否填写!"));
+            if (string.IsNullOrEmpty(dto.Contact)) return Ok(JsonView(false, "请检查单位联系人是否填写!"));
+            if (string.IsNullOrEmpty(dto.ContactTel)) return Ok(JsonView(false, "请检查联系方式是否填写正确!"));
+
+            var carDadaInfo = _carDataRep
+                .QueryDto<Res_CarData, CarDataView>(a => a.UnitArea == dto.UnitArea &&
+                                                         a.UnitName == dto.UnitName &&
+                                                         a.Contact == dto.Contact &&
+                                                         a.ContactTel == dto.ContactTel
+                                                    )
+                .First();
+            if (carDadaInfo != null) return Ok(JsonView(false, "该信息已存在,请勿重复添加!"));
+            var carData = _mapper.Map<Res_CarData>(dto);
+            EncryptionProcessor.EncryptProperties(carData);
+            int id = await _carDataRep.AddAsyncReturnId(carData);
+            if (id < 1) return Ok(JsonView(false, "添加失败!"));
+            return Ok(JsonView(true, "添加成功", new { Id = id }));
         }
 
         /// <summary>
@@ -241,57 +207,22 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> UpCarData(UpCarDataDto dto)
         {
-            try
-            {
-                if (dto.UnitArea == "")
-                {
-                    return Ok(JsonView(false, "请检查单位区域是否填写!"));
-                }
-                if (dto.UnitName == "")
-                {
-                    return Ok(JsonView(false, "请检查单位名称是否填写!"));
-                }
-                if (dto.Contact == "")
-                {
-                    return Ok(JsonView(false, "请检查单位联系人是否填写!"));
-                }
-                if (dto.ContactTel == "")
-                {
-                    return Ok(JsonView(false, "请检查联系方式是否填写正确!"));
-                }
-                bool res = await _carDataRep.UpdateAsync(a => a.Id == dto.Id, a => new Res_CarData
-                {
-                    UnitArea = dto.UnitArea,
-                    UnitName = dto.UnitName,
-                    Address = dto.Address,
-                    Contact = dto.Contact,
-                    ContactTel = dto.ContactTel,
-                    ContactEmail = dto.ContactEmail,
-                    ContactFax = dto.ContactFax,
-                    CarDes = dto.CarDes,
-                    CarPicPaths = dto.CarPicPaths,
-                    OtherInfo = dto.OtherInfo,
-                    Score = dto.Score,
-                    QualificationScore = dto.QualificationScore,
-                    CarAgeScore = dto.CarAgeScore,
-                    CleanImgScore = dto.CleanImgScore,
-                    SmellScore = dto.SmellScore,
-                    WaterPaperScore = dto.WaterPaperScore,
-                    HardwareScore = dto.HardwareScore,
-                    TimeScore = dto.TimeScore,
-                    SafetyScore = dto.SafetyScore,
-                    DrivingAgeScore = dto.DrivingAgeScore,
-                    Remark = dto.Remark,
-                });
-                if (!res) { return Ok(JsonView(false, "修改失败!")); }
-                return Ok(JsonView(true, "修改成功"));
-            }
-            catch (Exception ex)
-            {
-                return Ok(JsonView(false, "程序错误!"));
-                throw;
-            }
+            if (string.IsNullOrEmpty(dto.UnitArea)) return Ok(JsonView(false, "请检查单位区域是否填写!"));
+            if (string.IsNullOrEmpty(dto.UnitName)) return Ok(JsonView(false, "请检查单位名称是否填写!"));
+            if (string.IsNullOrEmpty(dto.Contact)) return Ok(JsonView(false, "请检查单位联系人是否填写!"));
+            if (string.IsNullOrEmpty(dto.ContactTel)) return Ok(JsonView(false, "请检查联系方式是否填写正确!"));
+
+            var carData = _mapper.Map<Res_CarData>(dto);
+            EncryptionProcessor.EncryptProperties(carData);
+
+            var res = await _sqlSugar.Updateable(carData)
+                .IgnoreColumns(x => new { x.CreateUserId, x.CreateTime, x.DeleteTime, x.DeleteUserId, x.IsDel })
+                .ExecuteCommandAsync();
+
+            if (res < 1) { return Ok(JsonView(false, "修改失败!")); }
+            return Ok(JsonView(true, "修改成功"));
         }
+
         /// <summary>
         /// 车公司信息删除
         /// </summary>
@@ -300,21 +231,26 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> DelCarData(DelCarDataDto dto)
         {
-            try
-            {
-                bool res = await _carDataRep.SoftDeleteByIdAsync<Res_CarData>(dto.Id.ToString(), dto.DeleteUserId);
-                if (!res) { return Ok(JsonView(false, "删除失败!")); }
-                return Ok(JsonView(true, "删除成功"));
-            }
-            catch (Exception ex)
-            {
-                return Ok(JsonView(false, "程序错误!"));
-                throw;
-            }
+            bool res = await _carDataRep.SoftDeleteByIdAsync<Res_CarData>(dto.Id.ToString(), dto.DeleteUserId);
+            if (!res) { return Ok(JsonView(false, "删除失败!")); }
+            return Ok(JsonView(true, "删除成功"));
         }
         #endregion
 
         #region 导游地接资料板块
+
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> LocalGuideBatchEncryption()
+        {
+            var infos = await _sqlSugar.Queryable<Res_LocalGuideData>().ToListAsync();
+            foreach (var item in infos) EncryptionProcessor.EncryptProperties(item);
+
+            var updTotal = await _sqlSugar.Updateable(infos).ExecuteCommandAsync();
+
+            return Ok(JsonView(true));
+        }
+
         /// <summary>
         /// 导游地接资料查询
         /// </summary>
@@ -324,26 +260,15 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> QueryLocalGuide(QueryLocalGuide dto)
         {
-            try
+            Stopwatch stopwatch = Stopwatch.StartNew(); 
+            Result LocalGuide = await _localGuideDataRep.QueryLocalGuide(dto);
+            if (LocalGuide.Code == 0)
             {
-                Result LocalGuide = await _localGuideDataRep.QueryLocalGuide(dto);
-                if (LocalGuide.Code == 0)
-                {
-                    return Ok(JsonView(true, "查询成功", LocalGuide.Data));
-                }
-                else
-                {
-                    return Ok(JsonView(false, LocalGuide.Msg));
-                }
-
+                stopwatch.Stop();
+                return Ok(JsonView(true, $"查询成功!耗时:{stopwatch.ElapsedMilliseconds} 毫秒", LocalGuide.Data));
             }
-            catch (Exception ex)
-            {
-                return Ok(JsonView(false, "程序错误!"));
-                throw;
-            }
-
-
+            stopwatch.Stop();
+            return Ok(JsonView(false, LocalGuide.Msg + $"  耗时:{stopwatch.ElapsedMilliseconds} 毫秒"));
         }
 
         /// <summary>
@@ -354,31 +279,26 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> QueryLocalGuideSelect()
         {
-            try
+            var localGuides = _carDataRep.QueryDto<Res_LocalGuideData, QueryLocalGuideSelectView>().ToList();
+            if (localGuides.Count == 0)
             {
-                var LocalGuide = _carDataRep.QueryDto<Res_LocalGuideData, QueryLocalGuideSelectView>().ToList();
-                if (LocalGuide.Count == 0)
-                {
-                    return Ok(JsonView(false, "暂无数据!"));
-                }
-                LocalGuide.Add(new QueryLocalGuideSelectView { Id = 0, UnitArea = "全部" });
-                LocalGuide = LocalGuide.Where((x, i) => LocalGuide.FindIndex(z => z.UnitArea == x.UnitArea && z.UnitArea != "") == i).ToList();
-                LocalGuide = LocalGuide.OrderBy(x => x.Id).ToList();
-                List<QueryLocalGuideSelectView> data = new List<QueryLocalGuideSelectView>();
-                foreach (QueryLocalGuideSelectView Local in LocalGuide)
-                {
-                    if (!string.IsNullOrWhiteSpace(Local.UnitArea))
-                    {
-                        data.Add(Local);
-                    }
-                }
-                return Ok(JsonView(true, "查询成功", data));
+                return Ok(JsonView(false, "暂无数据!"));
             }
-            catch (Exception)
+
+            foreach (var item in localGuides) EncryptionProcessor.DecryptProperties(item);
+
+            localGuides.Add(new QueryLocalGuideSelectView { Id = 0, UnitArea = "全部" });
+            localGuides = localGuides.Where((x, i) => localGuides.FindIndex(z => z.UnitArea == x.UnitArea && !string.IsNullOrEmpty(z.UnitArea)) == i).ToList();
+            localGuides = localGuides.OrderBy(x => x.Id).ToList();
+            var data = new List<QueryLocalGuideSelectView>();
+            foreach (QueryLocalGuideSelectView Local in localGuides)
             {
-                return Ok(JsonView(false, "程序错误!"));
-                throw;
+                if (!string.IsNullOrWhiteSpace(Local.UnitArea))
+                {
+                    data.Add(Local);
+                }
             }
+            return Ok(JsonView(true, "查询成功", data));
         }
 
         /// <summary>
@@ -390,11 +310,12 @@ namespace OASystem.API.Controllers
         public async Task<IActionResult> QueryLocalGuideDetailById(QueryLocalGuideDetailDto dto)
         {
             string sql = string.Format(@" Select * From Res_LocalGuideData With(Nolock) Where Id = {0} ", dto.Id);
-            LocalGuideDetailDataView info = _resItemInfoRep._sqlSugar.SqlQueryable<LocalGuideDetailDataView>(sql).First();
+            var info = _resItemInfoRep._sqlSugar.SqlQueryable<LocalGuideDetailDataView>(sql).First();
             if (info == null)
             {
                 return Ok(JsonView(false, "未找到相关数据!"));
             }
+            EncryptionProcessor.DecryptProperties(info);
 
             return Ok(JsonView(true, "查询成功", info));
         }
@@ -407,37 +328,17 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> OperationLocalGuide(LocalGuideOperationDto dto)
         {
-            try
-            {
-                if (dto.UnitArea == "")
-                {
-                    return Ok(JsonView(false, "请检查单位区域是否填写!"));
-                }
-                if (dto.UnitName == "")
-                {
-                    return Ok(JsonView(false, "请检查单位名称是否填写!"));
-                }
-                if (dto.Contact == "")
-                {
-                    return Ok(JsonView(false, "请检查单位联系人是否填写!"));
-                }
-                if (dto.ContactTel == "")
-                {
-                    return Ok(JsonView(false, "请检查联系方式是否填写正确!"));
-                }
+            if (string.IsNullOrEmpty(dto.UnitArea)) return Ok(JsonView(false, "请检查单位区域是否填写!"));
+            if (string.IsNullOrEmpty(dto.UnitName)) return Ok(JsonView(false, "请检查单位名称是否填写!"));
+            if (string.IsNullOrEmpty(dto.Contact)) return Ok(JsonView(false, "请检查单位联系人是否填写!"));
+            if (string.IsNullOrEmpty(dto.ContactTel)) return Ok(JsonView(false, "请检查联系方式是否填写正确!"));
 
-                Result result = await _localGuideDataRep.LocalGuideOperation(dto);
-                if (result.Code != 0)
-                {
-                    return Ok(JsonView(false, result.Msg));
-                }
-                return Ok(JsonView(true, result.Msg));
-            }
-            catch (Exception ex)
+            Result result = await _localGuideDataRep.LocalGuideOperation(dto);
+            if (result.Code != 0)
             {
-                return Ok(JsonView(false, "程序错误!"));
-                throw;
+                return Ok(JsonView(false, result.Msg));
             }
+            return Ok(JsonView(true, result.Msg));
         }
 
         /// <summary>
@@ -448,20 +349,12 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> DelLocalGuide(LocalGuideDelDto dto)
         {
-            try
-            {
-                var res = await _localGuideDataRep.SoftDeleteByIdAsync<Res_LocalGuideData>(dto.Id.ToString(), dto.DeleteUserId);
-                if (!res)
-                {
-                    return Ok(JsonView(false, "删除失败"));
-                }
-                return Ok(JsonView(true, "删除成功!"));
-            }
-            catch (Exception ex)
+            var res = await _localGuideDataRep.SoftDeleteByIdAsync<Res_LocalGuideData>(dto.Id.ToString(), dto.DeleteUserId);
+            if (!res)
             {
-                return Ok(JsonView(false, "程序错误!"));
-                throw;
+                return Ok(JsonView(false, "删除失败"));
             }
+            return Ok(JsonView(true, "删除成功!"));
         }
         #endregion
 
@@ -629,6 +522,7 @@ namespace OASystem.API.Controllers
         #endregion
 
         #region 代理出票合作方资料
+
         /// <summary>
         /// 代理出票合作方资料
         /// </summary>
@@ -638,52 +532,39 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> QueryAirTicketAgent(DtoBase dto)
         {
-
-            try
+            var res_AirTicketAgents = _airTicketAgentRep.Query<Res_AirTicketAgent>(a => a.IsDel == 0).ToList();
+            if (res_AirTicketAgents.Count > 1)
             {
-                List<Res_AirTicketAgent> res_AirTicketAgents = _airTicketAgentRep.Query<Res_AirTicketAgent>(a => a.IsDel == 0).ToList();
-                if (res_AirTicketAgents.Count != 0)
+                res_AirTicketAgents = res_AirTicketAgents.OrderByDescending(a => a.CreateTime).ToList();
+                if (dto.PageSize == 0 && dto.PageIndex == 0)
                 {
-                    res_AirTicketAgents = res_AirTicketAgents.OrderByDescending(a => a.CreateTime).ToList();
-                    if (dto.PageSize == 0 && dto.PageIndex == 0)
-                    {
-                        return Ok(JsonView(true, "查询成功!", res_AirTicketAgents));
-                    }
-                    else
-                    {
-                        int count = res_AirTicketAgents.Count;
-                        float totalPage = (float)count / dto.PageSize;//总页数
-                        if (totalPage == 0) totalPage = 1;
-                        else totalPage = (int)Math.Ceiling((double)totalPage);
+                    foreach (var item in res_AirTicketAgents) EncryptionProcessor.DecryptProperties(item);
+                    return Ok(JsonView(true, "查询成功!", res_AirTicketAgents));
+                }
+                else
+                {
+                    int count = res_AirTicketAgents.Count;
+                    float totalPage = (float)count / dto.PageSize;//总页数
+                    if (totalPage == 0) totalPage = 1;
+                    else totalPage = (int)Math.Ceiling((double)totalPage);
 
-                        List<Res_AirTicketAgent> _AirTicketAgent = new List<Res_AirTicketAgent>();
-                        for (int i = 0; i < dto.PageSize; i++)
+                    var _AirTicketAgent = new List<Res_AirTicketAgent>();
+                    for (int i = 0; i < dto.PageSize; i++)
+                    {
+                        var RowIndex = i + (dto.PageIndex - 1) * dto.PageSize;
+                        if (RowIndex < res_AirTicketAgents.Count)
                         {
-                            var RowIndex = i + (dto.PageIndex - 1) * dto.PageSize;
-                            if (RowIndex < res_AirTicketAgents.Count)
-                            {
-                                _AirTicketAgent.Add(res_AirTicketAgents[RowIndex]);
-                            }
-                            else
-                            {
-                                break;
-                            }
+                            EncryptionProcessor.DecryptProperties(res_AirTicketAgents[RowIndex]);
+                            _AirTicketAgent.Add(res_AirTicketAgents[RowIndex]);
                         }
-                        return Ok(JsonView(true, "查询成功!", new { pageCount = count, totalPage = (int)totalPage, pageIndex = dto.PageIndex, pageSize = dto.PageSize, pageSource = _AirTicketAgent }));
-
+                        else break;
                     }
-                }
-                else
-                {
-                    return Ok(JsonView(false, "暂无数据!"));
-                }
+                    return Ok(JsonView(true, "查询成功!", new { pageCount = count, totalPage = (int)totalPage, pageIndex = dto.PageIndex, pageSize = dto.PageSize, pageSource = _AirTicketAgent }));
 
+                }
             }
-            catch (Exception ex)
-            {
-                return Ok(JsonView(false, "程序错误!"));
-                throw;
-            }
+
+            return Ok(JsonView(false, "暂无数据!"));
         }
 
         /// <summary>
@@ -695,33 +576,12 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> OpAirTicketAgent(OpAirTicketAgentDto dto)
         {
-            try
-            {
-
-                if (dto.Account == "")
-                {
-                    return Ok(JsonView(false, "请检查代理商账户是否填写!"));
-                }
-                if (dto.Bank == "")
-                {
-                    return Ok(JsonView(false, "请检查代理商银行是否填写!"));
-                }
-                if (dto.Name == "")
-                {
-                    return Ok(JsonView(false, "请检查代理商名称是否填写正确!"));
-                }
-                Result result = await _airTicketAgentRep.OpAirTicketAgent(dto);
-                if (result.Code != 0)
-                {
-                    return Ok(JsonView(false, result.Msg));
-                }
-                return Ok(JsonView(true, result.Msg));
-            }
-            catch (Exception ex)
-            {
-                return Ok(JsonView(false, "程序错误!"));
-                throw;
-            }
+            if (string.IsNullOrEmpty(dto.Account)) return Ok(JsonView(false, "请检查代理商账户是否填写!"));
+            if (string.IsNullOrEmpty(dto.Bank)) return Ok(JsonView(false, "请检查代理商银行是否填写!"));
+            if (string.IsNullOrEmpty(dto.Name)) return Ok(JsonView(false, "请检查代理商名称是否填写正确!"));
+            Result result = await _airTicketAgentRep.OpAirTicketAgent(dto);
+            if (result.Code != 0) return Ok(JsonView(false, result.Msg));
+            return Ok(JsonView(true, result.Msg));
         }
 
         /// <summary>
@@ -732,20 +592,9 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> DelAirTicketAgent(DelBaseDto dto)
         {
-            try
-            {
-                var res = await _airTicketAgentRep.SoftDeleteByIdAsync<Res_AirTicketAgent>(dto.Id.ToString(), dto.DeleteUserId);
-                if (!res)
-                {
-                    return Ok(JsonView(false, "删除失败"));
-                }
-                return Ok(JsonView(true, "删除成功!"));
-            }
-            catch (Exception ex)
-            {
-                return Ok(JsonView(false, "程序错误!"));
-                throw;
-            }
+            var res = await _airTicketAgentRep.SoftDeleteByIdAsync<Res_AirTicketAgent>(dto.Id.ToString(), dto.DeleteUserId);
+            if (!res) return Ok(JsonView(false, "删除失败"));
+            return Ok(JsonView(true, "删除成功!"));
         }
 
         #endregion
@@ -764,19 +613,19 @@ namespace OASystem.API.Controllers
             string sqlWhere = string.Empty;
             if (!string.IsNullOrWhiteSpace(dto.Name))
             {
-                sqlWhere += string.Format(@" And hd.Name like '%{0}%'", dto.Name);
+                sqlWhere += string.Format(@" And hd.Name like '%{0}%'", AesEncryptionHelper.Encrypt(dto.Name));
             }
             if (!string.IsNullOrWhiteSpace(dto.City) && dto.City != "全部")
             {
-                sqlWhere += string.Format(@" And hd.City like '%{0}%'", dto.City);
+                sqlWhere += string.Format(@" And hd.City like '%{0}%'", AesEncryptionHelper.Encrypt(dto.City));
             }
             if (!string.IsNullOrWhiteSpace(dto.Contact))
             {
-                sqlWhere += string.Format(@" And hd.Contact like '%{0}%'", dto.Contact);
+                sqlWhere += string.Format(@" And hd.Contact like '%{0}%'", AesEncryptionHelper.Encrypt(dto.Contact));
             }
             if (!string.IsNullOrWhiteSpace(dto.ContactPhone))
             {
-                sqlWhere += string.Format(@" And hd.ContactPhone like '%{0}%'", dto.ContactPhone);
+                sqlWhere += string.Format(@" And hd.ContactPhone like '%{0}%'", AesEncryptionHelper.Encrypt(dto.ContactPhone));
             }
             sqlWhere += string.Format(@" And hd.IsDel={0}", 0);
             if (!string.IsNullOrEmpty(sqlWhere.Trim()))
@@ -815,20 +664,7 @@ namespace OASystem.API.Controllers
 
             if (dto.PortType == 1)
             {
-                var HotelDataData = await _sqlSugar.SqlQueryable<HotelDataItemView>(sql)
-                    //.Select(x => new {
-                    //    x.Row_Number,
-                    //    x.Id,
-                    //    City = AesEncryptionHelper.Decrypt(x.City),
-                    //    Name = AesEncryptionHelper.Decrypt(x.Name),
-                    //    Tel = AesEncryptionHelper.Decrypt(x.Tel),
-                    //    Fax = AesEncryptionHelper.Decrypt(x.Fax),
-                    //    Contact = AesEncryptionHelper.Decrypt(x.Contact),
-                    //    x.CreateUserName,
-                    //    ContactPhone = AesEncryptionHelper.Decrypt(x.ContactPhone),
-                    //    x.CreateTime
-                    //})
-                    .ToListAsync();
+                var HotelDataData = await _sqlSugar.SqlQueryable<HotelDataItemView>(sql).ToListAsync();
 
                 if (HotelDataData.Count == 0)
                 {
@@ -844,6 +680,7 @@ namespace OASystem.API.Controllers
             {
                 RefAsync<int> total = 0;//REF和OUT不支持异步,想要真的异步这是最优解
                 var data = await _sqlSugar.SqlQueryable<HotelDataItemView>(sql).ToPageListAsync(dto.PageIndex, dto.PageSize, total); //ToPageAsync
+                foreach (var item in data) EncryptionProcessor.DecryptProperties(item);
 
                 return Ok(JsonView(true, "操作成功", data, total));
             }
@@ -886,11 +723,18 @@ namespace OASystem.API.Controllers
                 {
                     return Ok(JsonView(false, "暂无数据!"));
                 }
+
+                //解密
+                foreach (var item in HotelData)
+                {
+                    EncryptionProcessor.DecryptProperties(item);
+                }
+
                 HotelData.Add(new QueryHotelDataSelect { Id = 0, City = "全部" });
                 HotelData = HotelData.Where((x, i) => HotelData.FindIndex(z => z.City == x.City && z.City != "") == i).ToList();
                 HotelData = HotelData.OrderBy(x => x.Id).ToList();
-                List<QueryHotelDataSelect> data = new List<QueryHotelDataSelect>();
-                foreach (QueryHotelDataSelect Hotel in HotelData)
+                var data = new List<QueryHotelDataSelect>();
+                foreach (var Hotel in HotelData)
                 {
                     if (!string.IsNullOrWhiteSpace(Hotel.City))
                     {
@@ -1797,7 +1641,9 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
 
             var _DeleFile = _sqlSugar.Queryable<Grp_DeleFile>().Where(a => a.Diid == dto.DiId && a.IsDel == 0 && a.Category == 970).ToList();
 
-            var translatorData = _sqlSugar.Queryable<Res_TranslatorLibrary>().Where(a => a.IsDel == 0).Select(x => new { x.Id, x.Name }).ToList();
+            var translatorData = _sqlSugar.Queryable<Res_TranslatorLibrary>().Where(a => a.IsDel == 0).Select(x => new TranslatorLibraryNameView() { Id = x.Id, Name = x.Name }).ToList();
+            foreach (var item in translatorData) EncryptionProcessor.DecryptProperties(item);
+
             return Ok(JsonView(true, "查询成功!", new { Delegation = groupInfos, SetData = data, DeleFile = _DeleFile , TranslatorData = translatorData }));
         }
 
@@ -3828,6 +3674,7 @@ WHERE
 
         #region 翻译人员
 
+
         /// <summary>
         /// 翻译人员库
         /// Init
@@ -3886,6 +3733,8 @@ WHERE
 
             var info = await _translatorRep.Query(x => x.Id == id).FirstAsync();
 
+            EncryptionProcessor.DecryptProperties(info);
+
             var view = _mapper.Map<TranslatorLibraryInfoView>(info);
 
             //var data1 = await _sqlSugar.Queryable<Grp_OfficialDutyLinkTranslator>().Where(x => x.TranslatorId == id).Select(x => x.Id).ToArrayAsync();
@@ -3911,30 +3760,33 @@ WHERE
         {
             if (dto.PortType < 1 || dto.PortType > 3) return Ok(JsonView(false, MsgTips.Port));
 
+            var name = AesEncryptionHelper.Encrypt(dto.Name);
+
             RefAsync<int> total = 0;
             var view = await _sqlSugar.Queryable<Res_TranslatorLibrary>()
                 .Where(x => x.IsDel == 0)
-                .WhereIF(!string.IsNullOrEmpty(dto.Name), x => x.Name.Contains(dto.Name))
-                .Select(x => new
+                .WhereIF(!string.IsNullOrEmpty(name), x => x.Name.Contains(name))
+                .Select(x => new TranslatorLibraryItemView()
                 {
-                    x.Id,
-                    x.Area,
-                    x.Name,
+                    Id = x.Id,
+                    Area = x.Area,
+                    Name = x.Name,
                     Sex = x.Sex == 0 ? "未设置" : x.Sex == 1 ? "男" : "女",
-                    x.Tel,
-                    x.Email,
-                    x.WechatNo,
-                    x.Language,
-                    x.Price,
-                    //x.Currency,
+                    Tel = x.Tel,
+                    Email = x.Email,
+                    WechatNo = x.WechatNo,
+                    Language = x.Language,
+                    Price = x.Price,
                     Currency = SqlFunc.Subqueryable<Sys_SetData>().Where(x1 => x1.Id == x.Currency).Select(x1 => x1.Name) ?? "-",
                     CreateUserName = SqlFunc.Subqueryable<Sys_Users>().Where(x1 => x1.Id == x.CreateUserId).Select(x1 => x1.CnName) ?? "-",
-                    x.CreateTime,
-                    x.Remark
+                    CreateTime = x.CreateTime,
+                    Remark = x.Remark
                 })
                 .OrderByDescending(x => x.CreateTime)
                 .ToPageListAsync(dto.PageIndex, dto.PageSize, total);
 
+            foreach (var item in view) EncryptionProcessor.DecryptProperties(item);
+
             return Ok(JsonView(view, total));
         }
 
@@ -3995,6 +3847,7 @@ WHERE
 
             #region 参数处理
 
+            EncryptionProcessor.EncryptProperties(dto);
             var translatorInfo = _mapper.Map<Res_TranslatorLibrary>(dto);
 
             #endregion
@@ -4010,7 +3863,7 @@ WHERE
                 translatorInfo.CreateUserId = currUserInfo.UserId;
                 if (fileNames.Count > 0)
                 {
-                    translatorInfo.Files = JsonConvert.SerializeObject(fileNames);
+                    translatorInfo.Files = AesEncryptionHelper.Encrypt(JsonConvert.SerializeObject(fileNames));
                 }
 
                 var id = await _translatorRep.AddAsync(translatorInfo);
@@ -4061,7 +3914,7 @@ WHERE
                 }
                 if (fileNames.Count > 0)
                 {
-                    translatorInfo.Files = JsonConvert.SerializeObject(fileNames);
+                    translatorInfo.Files = AesEncryptionHelper.Encrypt(JsonConvert.SerializeObject(fileNames));
                 }
 
                 var upd = await _translatorRep
@@ -4279,14 +4132,15 @@ WHERE
             if (dto.Id < 1) return Ok(JsonView(false, MsgTips.Port));
 
             var id = dto.Id;
-            var info = await _insuranceCostRep.Query(x => x.Id == id)
+            var info = await _sqlSugar.Queryable<Res_BasicInsuranceCost>()
+                .Where(x => x.Id == id && x.IsDel == 0)
                 .Select(x => new {
                     x.Id,
                     x.IsSchengen,
                     x.CountryName,
                     x.Cost,
                     x.Remark,
-                    CreateUserName = SqlFunc.Subqueryable<Sys_Users>().Where(s => s.Id == x.CreateUserId).Select(s => s.CnName).FirstOrDefault(),
+                    CreateUserName = SqlFunc.Subqueryable<Sys_Users>().Where(s => s.Id == x.CreateUserId).Select(s => s.CnName),
                     x.CreateTime
                 })
                 .FirstAsync();
@@ -4313,7 +4167,7 @@ WHERE
                 .LeftJoin<Sys_Users>((bic,u) => bic.CreateUserId == u.Id)
                 .Where((bic, u) => bic.IsDel == 0)
                 .WhereIF(!string.IsNullOrEmpty(dto.Search), (bic, u) => bic.CountryName.Contains(dto.Search))
-                .OrderBy((bic, u) => bic.Id)
+                .OrderByDescending((bic, u) => bic.Id)
                 .Select((bic, u) => new {
                     bic.Id,
                     bic.IsSchengen,

+ 11 - 5
OASystem/OASystem.Api/Controllers/SystemController.cs

@@ -15,6 +15,7 @@ using static Quartz.Logging.OperationName;
 using static OASystem.API.OAMethodLib.JWTHelper;
 using System.Runtime.Intrinsics.Arm;
 using OASystem.Domain.Dtos.Statistics;
+using OASystem.Domain.AesEncryption;
 
 namespace OASystem.API.Controllers
 {
@@ -2311,6 +2312,8 @@ And u.UId = {0} And u.FId = 1 ", dto.UserId);
                             lgd.CreateTime,
                         })
                         .ToListAsync();
+
+                    foreach (var item in opTourGuideData) EncryptionProcessor.DecryptProperties(item);
                     var opTourGuideDataGroups = opTourGuideData.GroupBy(x => x.CreateUserId)
                         .Select(g => new {
                             uId = g.Key,
@@ -2332,18 +2335,19 @@ And u.UId = {0} And u.FId = 1 ", dto.UserId);
                     var opCarData = await _sqlSugar.Queryable<Res_CarData>()
                         .LeftJoin<Sys_Users>((cd, u) => cd.CreateUserId == u.Id)
                         .Where((cd, u) => cd.IsDel == 0 && cd.CreateTime >= startDateTime && cd.CreateTime <= endDateTime)
-                        .Select((cd, u) => new
+                        .Select((cd, u) => new CarDataMsgTipsView()
                         {
-                            Area = cd.UnitArea,
+                            Area =  cd.UnitArea,
                             Client = cd.UnitName,
-                            cd.Contact,
+                            Contact = cd.Contact,
                             Job = "",
                             Tel = cd.ContactTel,
-                            cd.CreateUserId,
+                            CreateUserId = cd.CreateUserId,
                             CreatleUserName = u.CnName,
-                            cd.CreateTime,
+                            CreateTime = cd.CreateTime,
                         })
                         .ToListAsync();
+                    foreach (var item in opCarData) EncryptionProcessor.DecryptProperties(item);
                     var opCarDataGroups = opCarData.GroupBy(x => x.CreateUserId)
                         .Select(g => new {
                             uId = g.Key,
@@ -2959,6 +2963,8 @@ And u.UId = {0} And u.FId = 1 ", dto.UserId);
                                 lgd.CreateTime,
                             })
                             .ToListAsync();
+                        foreach (var item in opTourGuideData) EncryptionProcessor.DecryptProperties(item);
+
                         var opTourGuideDataGroups = opTourGuideData.GroupBy(x => x.CreateUserId)
                             .Select(g => new {
                                 uId = g.Key,

+ 3 - 0
OASystem/OASystem.Domain/AesEncryption/EncryptionProcessor.cs

@@ -8,6 +8,9 @@ using System.Threading.Tasks;
 
 namespace OASystem.Domain.AesEncryption
 {
+    /// <summary>
+    /// AES 加密/解密
+    /// </summary>
     public static class EncryptionProcessor
     {
        

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

@@ -198,11 +198,13 @@ namespace OASystem.Domain.AutoMappers
             #region 车公司资料
             CreateMap<Res_CarData, CarDataView>();
             CreateMap<AddCarDataDto, Res_CarData>();
+            CreateMap<UpCarDataDto, Res_CarData>();
             CreateMap<Res_CarData, CarDataSelectView>();
             #endregion
             #region 导游地接资料
             CreateMap<Res_LocalGuideData, LocalGuideDataView>();
             CreateMap<LocalGuideOperationDto, Res_LocalGuideData>();
+            CreateMap<Res_LocalGuideData, Res_LocalGuideData_ListItemView>();
             #endregion
             #region 机场三字码资料
             CreateMap<Res_ThreeCode, ThreeCodeView>();

+ 23 - 4
OASystem/OASystem.Domain/Dtos/Resource/CarDataDto.cs

@@ -1,4 +1,5 @@
-using System;
+using OASystem.Domain.Attributes;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -169,52 +170,61 @@ namespace OASystem.Domain.Dtos.Resource
         /// <summary>
         /// 区域
         /// </summary>
+        [Encrypted]
         public string UnitArea { get; set; }
 
         /// <summary>
         /// 公司名称
         /// </summary>
+        [Encrypted]
         public string UnitName { get; set; }
 
         /// <summary>
         /// 地址
         /// </summary>
+        [Encrypted]
         public string Address { get; set; }
 
         /// <summary>
         /// 联系人
         /// </summary>
+        [Encrypted]
         public string Contact { get; set; }
         /// <summary>
         /// 联系方式
         /// </summary>
+        [Encrypted]
         public string ContactTel { get; set; }
 
         /// <summary>
         /// 联系人邮箱
         /// </summary>
+        [Encrypted]
         public string ContactEmail { get; set; }
 
         /// <summary>
         /// 联系人传真
         /// </summary>
+        [Encrypted]
         public string ContactFax { get; set; }
 
         /// <summary>
         /// 车描述
         /// </summary>
+        [Encrypted]
         public string CarDes { get; set; }
 
         /// <summary>
         /// 车图片路径
         /// 存储多个 使用/r/n
         /// </summary>
+        [Encrypted]
         public string CarPicPaths { get; set; }
 
-
         /// <summary>
         /// 其他信息
         /// </summary>
+        [Encrypted]
         public string OtherInfo { get; set; }
 
         /// <summary>
@@ -226,60 +236,69 @@ namespace OASystem.Domain.Dtos.Resource
         /// 相关的车辆资质
         /// A B C  选择
         /// </summary>
+        [Encrypted]
         public string QualificationScore { get; set; }
 
         /// <summary>
         /// 车辆2-4年新,VIP及以上需要2年新
         /// A B C  选择
         /// </summary>
+        [Encrypted]
         public string CarAgeScore { get; set; }
 
         /// <summary>
         /// 车身干净,无文字图片等
         /// A B C  选择
         /// </summary>
+        [Encrypted]
         public string CleanImgScore { get; set; }
 
         /// <summary>
         /// 车内整洁、无异味
         /// A B C  选择
         /// </summary>
+        [Encrypted]
         public string SmellScore { get; set; }
 
         /// <summary>
         /// 提前备水,纸巾等
         /// A B C  选择
         /// </summary>
+        [Encrypted]
         public string WaterPaperScore { get; set; }
 
         /// <summary>
         /// 车辆配置高(皮座椅等)
         /// A B C  选择
         /// </summary>
+        [Encrypted]
         public string HardwareScore { get; set; }
 
         /// <summary>
         /// 时间概念强
         /// A B C  选择
         /// </summary>
+        [Encrypted]
         public string TimeScore { get; set; }
 
         /// <summary>
         /// 安全意识高
         /// A B C  选择
         /// </summary>
+        [Encrypted]
         public string SafetyScore { get; set; }
 
         /// <summary>
         /// 司机驾龄时间长,提前熟悉路线
         /// A B C  选择
         /// </summary>
+        [Encrypted]
         public string DrivingAgeScore { get; set; }
-       
+
         /// <summary>
         /// 备注
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(500)")]
+        [Encrypted]
         public string Remark { get; set; }
     }
 

+ 6 - 1
OASystem/OASystem.Domain/Dtos/Resource/OpAirTicketAgentDto.cs

@@ -1,4 +1,5 @@
-using System;
+using OASystem.Domain.Attributes;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -22,14 +23,17 @@ namespace OASystem.Domain.Dtos.Resource
         /// <summary>
         /// 代理商名称
         /// </summary>
+        [Encrypted]
         public string Name { get; set; }
         /// <summary>
         /// 代理商账户
         /// </summary>
+        [Encrypted]
         public string Account { get; set; }
         /// <summary>
         /// 代理商银行
         /// </summary>
+        [Encrypted]
         public string Bank { get; set; }
         /// <summary>
         /// 创建者Id
@@ -38,6 +42,7 @@ namespace OASystem.Domain.Dtos.Resource
         /// <summary>
         /// 备注
         /// </summary>
+        [Encrypted]
         public string Remark { get; set; }
     }
 }

+ 10 - 0
OASystem/OASystem.Domain/Dtos/Resource/TranslatorLibraryDto.cs

@@ -1,4 +1,5 @@
 using Microsoft.AspNetCore.Http;
+using OASystem.Domain.Attributes;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -35,11 +36,13 @@ namespace OASystem.Domain.Dtos.Resource
         /// <summary>
         /// 所在地区
         /// </summary>
+        [Encrypted]
         public string Area { get; set; }
 
         /// <summary>
         /// 姓名
         /// </summary>
+        [Encrypted]
         public string Name { get; set; }
 
         /// <summary>
@@ -51,31 +54,37 @@ namespace OASystem.Domain.Dtos.Resource
         /// 照片
         /// 传输图片转base64字符串
         /// </summary>
+        [Encrypted]
         public string Photo { get; set; }
 
         /// <summary>
         /// 联系电话
         /// </summary>
+        [Encrypted]
         public string Tel { get; set; }
 
         /// <summary>
         /// 邮箱号
         /// </summary>
+        [Encrypted]
         public string Email { get; set; }
 
         /// <summary>
         /// 微信号
         /// </summary>
+        [Encrypted]
         public string WechatNo { get; set; }
 
         /// <summary>
         /// 其他社交账号
         /// </summary>
+        [Encrypted]
         public string OtherSocialAccounts { get; set; }
 
         /// <summary>
         /// 语种
         /// </summary>
+        [Encrypted]
         public string Language { get; set; }
 
         /// <summary>
@@ -96,6 +105,7 @@ namespace OASystem.Domain.Dtos.Resource
         /// <summary>
         /// 备注
         /// </summary>
+        [Encrypted]
         public string Remark { get; set; }
     }
 }

+ 3 - 1
OASystem/OASystem.Domain/Entities/EntityBase.cs

@@ -1,4 +1,5 @@
-using System.ComponentModel.DataAnnotations.Schema;
+using OASystem.Domain.Attributes;
+using System.ComponentModel.DataAnnotations.Schema;
 
 namespace OASystem.Domain.Entities
 {
@@ -35,6 +36,7 @@ namespace OASystem.Domain.Entities
         /// <summary>
         /// 备注
         /// </summary>
+        [Encrypted]
         [SugarColumn(IsNullable = true, ColumnDataType = "varchar(500)")]
         public string Remark { get; set; }
         /// <summary>

+ 8 - 4
OASystem/OASystem.Domain/Entities/Resource/Res_AirTicketAgent.cs

@@ -1,4 +1,5 @@
-using System;
+using OASystem.Domain.Attributes;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -15,17 +16,20 @@ namespace OASystem.Domain.Entities.Resource
         /// <summary>
         /// 代理商名称
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(100)")]
+        [Encrypted]
+        [SugarColumn(IsNullable = true, ColumnDataType = "nvarchar(200)")]
         public string Name { get; set; }
         /// <summary>
         /// 代理商账户
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(100)")]
+        [Encrypted]
+        [SugarColumn(IsNullable = true, ColumnDataType = "nvarchar(200)")]
         public string Account { get; set; }
         /// <summary>
         /// 代理商银行
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(100)")]
+        [Encrypted]
+        [SugarColumn(IsNullable = true, ColumnDataType = "nvarchar(200)")]
         public string Bank { get; set; }
     }
 }

+ 34 - 15
OASystem/OASystem.Domain/Entities/Resource/Res_CarData.cs

@@ -1,4 +1,5 @@
-using System;
+using OASystem.Domain.Attributes;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -15,48 +16,56 @@ namespace OASystem.Domain.Entities.Resource
         /// <summary>
         /// 区域
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
+        [Encrypted]
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(100)")]
         public string UnitArea { get; set; }
 
         /// <summary>
         /// 公司名称
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(100)")]
+        [Encrypted]
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(300)")]
         public string UnitName { get; set; }
 
         /// <summary>
         /// 地址
         /// </summary>
+        [Encrypted]
         [SugarColumn(IsNullable = true, ColumnDataType = "varchar(200)")]        
         public string Address { get; set; }
 
         /// <summary>
         /// 联系人
         /// </summary>
+        [Encrypted]
         [SugarColumn(IsNullable = true,ColumnDataType = "varchar(50)")]
         public string Contact { get; set; }
 
         /// <summary>
         /// 联系人手机号
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(20)")] 
+        [Encrypted]
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")] 
         public string ContactTel { get; set; }
 
         /// <summary>
         /// 联系人邮箱
         /// </summary>
+        [Encrypted]
         [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
         public string ContactEmail { get; set; }
 
         /// <summary>
         /// 联系人传真
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(20)")]
+        [Encrypted]
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
         public string ContactFax { get; set; }
 
         /// <summary>
         /// 车描述
         /// </summary>
+        [Encrypted]
         [SugarColumn(IsNullable = true, ColumnDataType = "varchar(200)")]
         public string CarDes { get; set; }
 
@@ -64,13 +73,14 @@ namespace OASystem.Domain.Entities.Resource
         /// 车图片路径
         /// 存储多个 使用/r/n
         /// </summary>
+        [Encrypted]
         [SugarColumn(IsNullable = true, ColumnDataType = "varchar(200)")]
         public string CarPicPaths { get; set; }
 
-
         /// <summary>
         /// 其他信息
         /// </summary>
+        [Encrypted]
         [SugarColumn(IsNullable = true, ColumnDataType = "varchar(500)")]
         public string OtherInfo { get; set; }
 
@@ -84,63 +94,72 @@ namespace OASystem.Domain.Entities.Resource
         /// 相关的车辆资质
         /// A B C  选择
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(10)")]
+        [Encrypted]
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
         public string QualificationScore { get; set; }
 
         /// <summary>
         /// 车辆2-4年新,VIP及以上需要2年新
         /// A B C  选择
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(10)")]
+        [Encrypted]
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
         public string CarAgeScore { get; set; }
 
         /// <summary>
         /// 车身干净,无文字图片等
         /// A B C  选择
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(10)")]
+        [Encrypted]
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
         public string CleanImgScore { get; set; }
 
         /// <summary>
         /// 车内整洁、无异味
         /// A B C  选择
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(10)")]
+        [Encrypted]
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
         public string SmellScore { get; set; }
 
         /// <summary>
         /// 提前备水,纸巾等
         /// A B C  选择
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(10)")]
+        [Encrypted]
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
         public string WaterPaperScore { get; set; }
 
         /// <summary>
         /// 车辆配置高(皮座椅等)
         /// A B C  选择
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(10)")]
+        [Encrypted]
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
         public string HardwareScore { get; set; }
 
         /// <summary>
         /// 时间概念强
         /// A B C  选择
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(10)")]
+        [Encrypted]
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
         public string TimeScore { get; set; }
 
         /// <summary>
         /// 安全意识高
         /// A B C  选择
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(10)")]
+        [Encrypted]
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
         public string SafetyScore { get; set; }
 
         /// <summary>
         /// 司机驾龄时间长,提前熟悉路线
         /// A B C  选择
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(10)")]
+        [Encrypted]
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
         public string DrivingAgeScore { get; set; }
     }
 }

+ 33 - 17
OASystem/OASystem.Domain/Entities/Resource/Res_LocalGuideData.cs

@@ -1,4 +1,5 @@
-using System;
+using OASystem.Domain.Attributes;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -16,49 +17,57 @@ namespace OASystem.Domain.Entities.Resource
         /// <summary>
         /// 区域
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(100)")]
+        [Encrypted]
+        [SugarColumn(IsNullable = true, ColumnDataType = "nvarchar(200)")]
         public string UnitArea { get; set; }
 
         /// <summary>
         /// 公司名称
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(100)")]
+        [Encrypted]
+        [SugarColumn(IsNullable = true, ColumnDataType = "nvarchar(200)")]
         public string UnitName { get; set; }
 
         /// <summary>
         /// 地址
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(225)")]
+        [Encrypted]
+        [SugarColumn(IsNullable = true, ColumnDataType = "nvarchar(500)")]
         public string Address { get; set; }
 
         /// <summary>
         /// 联系人
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
+        [Encrypted]
+        [SugarColumn(IsNullable = true, ColumnDataType = "nvarchar(100)")]
         public string Contact { get; set; }
 
         /// <summary>
         /// 联系人手机号
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
+        [Encrypted]
+        [SugarColumn(IsNullable = true, ColumnDataType = "nvarchar(100)")]
         public string ContactTel { get; set; }
 
         /// <summary>
         /// 联系人邮箱
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
+        [Encrypted]
+        [SugarColumn(IsNullable = true, ColumnDataType = "nvarchar(100)")]
         public string ContactEmail { get; set; }
 
         /// <summary>
         /// 联系人传真
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
+        [Encrypted]
+        [SugarColumn(IsNullable = true, ColumnDataType = "nvarchar(100)")]
         public string ContactFax { get; set; }
 
         /// <summary>
         /// 其他信息
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(500)")]
+        [Encrypted]
+        [SugarColumn(IsNullable = true, ColumnDataType = "nvarchar(max)")]
         public string OtherInfo { get; set; }
 
         /// <summary>
@@ -71,49 +80,56 @@ namespace OASystem.Domain.Entities.Resource
         /// 着装得体
         /// A B C  选择
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(10)")]
+        [Encrypted]
+        [SugarColumn(IsNullable = true, ColumnDataType = "nvarchar(50)")]
         public string SuitScore { get; set; }
 
         /// <summary>
         /// 服务意识强度
         /// A B C  选择
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(10)")]
+        [Encrypted]
+        [SugarColumn(IsNullable = true, ColumnDataType = "nvarchar(50)")]
         public string ServeScore { get; set; }
 
         /// <summary>
         /// 讲解水平专业
         /// A B C  选择
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(10)")]
+        [Encrypted]
+        [SugarColumn(IsNullable = true, ColumnDataType = "nvarchar(50)")]
         public string TalkProScore { get; set; }
 
         /// <summary>
         /// 时间概念强度
         /// A B C  选择
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(10)")]
+        [Encrypted]
+        [SugarColumn(IsNullable = true, ColumnDataType = "nvarchar(50)")]
         public string TimeScore { get; set; }
 
         /// <summary>
         /// 配合能力强,服从安排
         /// A B C  选择
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(10)")]
+        [Encrypted]
+        [SugarColumn(IsNullable = true, ColumnDataType = "nvarchar(50)")]
         public string FitScore { get; set; }
 
         /// <summary>
         /// 应变能力强
         /// A B C  选择
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(10)")]
+        [Encrypted]
+        [SugarColumn(IsNullable = true, ColumnDataType = "nvarchar(50)")]
         public string StrainScore { get; set; }
 
         /// <summary>
         /// 当地语言和中文表达流畅
         /// A B C  选择
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(10)")]
+        [Encrypted]
+        [SugarColumn(IsNullable = true, ColumnDataType = "nvarchar(50)")]
         public string LocalAndChineseScore { get; set; }
 
         /// <summary>
@@ -123,6 +139,6 @@ namespace OASystem.Domain.Entities.Resource
         public int StaffType { get; set; }
 
         [SugarColumn(IsNullable = true, ColumnDataType = "dateTime")]
-        public DateTime LastUpdate { get; set; }
+        public DateTime LastUpdate { get; set; } = DateTime.Now;
     }
 }

+ 24 - 12
OASystem/OASystem.Domain/Entities/Resource/Res_MediaSuppliers.cs

@@ -1,4 +1,5 @@
-using System;
+using OASystem.Domain.Attributes;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -21,37 +22,43 @@ namespace OASystem.Domain.Entities.Resource
         /// <summary>
         /// 省份
         /// </summary>
-        [SugarColumn(ColumnDescription = "省份", ColumnName = "Privince", IsNullable = true, ColumnDataType = "varchar(120)")]
+        [Encrypted]
+        [SugarColumn(ColumnDescription = "省份", ColumnName = "Privince", IsNullable = true, ColumnDataType = "nvarchar(240)")]
         public string Privince { get; set; }
 
         /// <summary>
         /// 城市
         /// </summary>
-        [SugarColumn(ColumnDescription = "城市", ColumnName = "City", IsNullable = true, ColumnDataType = "varchar(120)")]
+        [Encrypted]
+        [SugarColumn(ColumnDescription = "城市", ColumnName = "City", IsNullable = true, ColumnDataType = "nvarchar(240)")]
         public string City { get; set; }
 
         /// <summary>
         /// 单位名称
         /// </summary>
-        [SugarColumn(ColumnDescription = "单位名称", ColumnName = "UnitName", IsNullable = true, ColumnDataType = "varchar(200)")]
+        [Encrypted]
+        [SugarColumn(ColumnDescription = "单位名称", ColumnName = "UnitName", IsNullable = true, ColumnDataType = "nvarchar(400)")]
         public string UnitName { get; set; }
 
         /// <summary>
         /// 单位缩写
         /// </summary>
-        [SugarColumn(ColumnDescription = "单位缩写", ColumnName = "UnitAbbreviation", IsNullable = true, ColumnDataType = "varchar(200)")]
+        [Encrypted]
+        [SugarColumn(ColumnDescription = "单位缩写", ColumnName = "UnitAbbreviation", IsNullable = true, ColumnDataType = "nvarchar(400)")]
         public string UnitAbbreviation { get; set; }
 
         /// <summary>
         /// 单位地址
         /// </summary>
-        [SugarColumn(ColumnDescription = "单位地址", ColumnName = "UnitAddress", IsNullable = true, ColumnDataType = "varchar(120)")]
+        [Encrypted]
+        [SugarColumn(ColumnDescription = "单位地址", ColumnName = "UnitAddress", IsNullable = true, ColumnDataType = "nvarchar(240)")]
         public string UnitAddress { get; set; }
 
         /// <summary>
         /// 单位联系人
         /// </summary>
-        [SugarColumn(ColumnDescription = "单位联系人", ColumnName = "Contact", IsNullable = true, ColumnDataType = "varchar(100)")]
+        [Encrypted]
+        [SugarColumn(ColumnDescription = "单位联系人", ColumnName = "Contact", IsNullable = true, ColumnDataType = "nvarchar(200)")]
         public string Contact { get; set; }
 
         /// <summary>
@@ -63,30 +70,35 @@ namespace OASystem.Domain.Entities.Resource
         /// <summary>
         /// 联系人职位
         /// </summary>
-        [SugarColumn(ColumnDescription = "联系人职位", ColumnName = "Post", IsNullable = true, ColumnDataType = "varchar(100)")]
+        [Encrypted]
+        [SugarColumn(ColumnDescription = "联系人职位", ColumnName = "Post", IsNullable = true, ColumnDataType = "nvarchar(200)")]
         public string Post { get; set; }
 
         /// <summary>
         /// 联系人电话
         /// </summary>
-        [SugarColumn(ColumnDescription = "联系人电话", ColumnName = "Tel", IsNullable = true, ColumnDataType = "varchar(100)")]
+        [Encrypted]
+        [SugarColumn(ColumnDescription = "联系人电话", ColumnName = "Tel", IsNullable = true, ColumnDataType = "nvarchar(200)")]
         public string Tel { get; set; }
 
         /// <summary>
         /// 联系人邮箱
         /// </summary>
-        [SugarColumn(ColumnDescription = "联系人邮箱", ColumnName = "Email", IsNullable = true, ColumnDataType = "varchar(100)")]
+        [Encrypted]
+        [SugarColumn(ColumnDescription = "联系人邮箱", ColumnName = "Email", IsNullable = true, ColumnDataType = "nvarchar(200)")]
         public string Email { get; set; }
 
         /// <summary>
         /// 联系人微信
         /// </summary>
-        [SugarColumn(ColumnDescription = "联系人微信", ColumnName = "WeChat", IsNullable = true, ColumnDataType = "varchar(100)")]
+        [Encrypted]
+        [SugarColumn(ColumnDescription = "联系人微信", ColumnName = "WeChat", IsNullable = true, ColumnDataType = "nvarchar(200)")]
         public string WeChat { get; set; }
         /// <summary>
         /// 传真
         /// </summary>
-        [SugarColumn(ColumnDescription = "传真", ColumnName = "Fax", IsNullable = true, ColumnDataType = "varchar(100)")]
+        [Encrypted]
+        [SugarColumn(ColumnDescription = "传真", ColumnName = "Fax", IsNullable = true, ColumnDataType = "nvarchar(200)")]
         public string Fax { get; set; }
 
     }

+ 19 - 10
OASystem/OASystem.Domain/Entities/Resource/Res_TranslatorLibrary.cs

@@ -1,4 +1,5 @@
-using System;
+using OASystem.Domain.Attributes;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -15,13 +16,15 @@ namespace OASystem.Domain.Entities.Resource
         /// <summary>
         /// 所在地区
         /// </summary>
-        [SugarColumn(ColumnDescription = "所在地区", IsNullable = true, ColumnDataType = "nvarchar(100)")]
+        [Encrypted]
+        [SugarColumn(ColumnDescription = "所在地区", IsNullable = true, ColumnDataType = "nvarchar(200)")]
         public string Area { get; set; }
 
         /// <summary>
         /// 姓名
         /// </summary>
-        [SugarColumn(ColumnDescription = "翻译人员姓名", IsNullable = true, ColumnDataType = "nvarchar(100)")]
+        [Encrypted]
+        [SugarColumn(ColumnDescription = "翻译人员姓名", IsNullable = true, ColumnDataType = "nvarchar(200)")]
         public string Name { get; set; }
 
         /// <summary>
@@ -33,38 +36,43 @@ namespace OASystem.Domain.Entities.Resource
         /// <summary>
         /// 照片
         /// </summary>
+        [Encrypted]
         [SugarColumn(ColumnDescription = "照片", IsNullable = true, ColumnDataType = "nvarchar(max)")]
         public string Photo { get; set; }
 
-
         /// <summary>
         /// 联系电话
         /// </summary>
-        [SugarColumn(ColumnDescription = "联系电话", IsNullable = true, ColumnDataType = "varchar(50)")]
+        [Encrypted]
+        [SugarColumn(ColumnDescription = "联系电话", IsNullable = true, ColumnDataType = "nvarchar(100)")]
         public string Tel { get; set; }
 
         /// <summary>
         /// 邮箱号
         /// </summary>
-        [SugarColumn(ColumnDescription = "邮箱号", IsNullable = true, ColumnDataType = "varchar(50)")]
+        [Encrypted]
+        [SugarColumn(ColumnDescription = "邮箱号", IsNullable = true, ColumnDataType = "nvarchar(100)")]
         public string Email { get; set; }
 
         /// <summary>
         /// 微信号
         /// </summary>
-        [SugarColumn(ColumnDescription = "微信号", IsNullable = true, ColumnDataType = "varchar(50)")]
+        [Encrypted]
+        [SugarColumn(ColumnDescription = "微信号", IsNullable = true, ColumnDataType = "nvarchar(100)")]
         public string WechatNo { get; set; }
 
         /// <summary>
         /// 其他社交账号
         /// </summary>
-        [SugarColumn(ColumnDescription = "其他社交账号", IsNullable = true, ColumnDataType = "varchar(200)")]
+        [Encrypted]
+        [SugarColumn(ColumnDescription = "其他社交账号", IsNullable = true, ColumnDataType = "nvarchar(500)")]
         public string OtherSocialAccounts { get; set; }
 
         /// <summary>
         /// 语种
         /// </summary>
-        [SugarColumn(ColumnDescription = "语种", IsNullable = true, ColumnDataType = "varchar(50)")]
+        [Encrypted]
+        [SugarColumn(ColumnDescription = "语种", IsNullable = true, ColumnDataType = "nvarchar(100)")]
         public string Language { get; set; }
 
         /// <summary>
@@ -82,7 +90,8 @@ namespace OASystem.Domain.Entities.Resource
         /// <summary>
         /// 简历或其他证书
         /// </summary>
-        [SugarColumn(ColumnDescription = "简历或其他证书", IsNullable = true, ColumnDataType = "varchar(200)")]
+        [Encrypted]
+        [SugarColumn(ColumnDescription = "简历或其他证书", IsNullable = true, ColumnDataType = "text")]
         public string Files { get; set; }
 
     }

+ 38 - 9
OASystem/OASystem.Domain/ViewModels/Resource/CarDataView.cs

@@ -1,4 +1,5 @@
-using OASystem.Domain.Entities;
+using OASystem.Domain.Attributes;
+using OASystem.Domain.Entities;
 using OASystem.Domain.Entities.Resource;
 using System;
 using System.Collections.Generic;
@@ -15,6 +16,7 @@ namespace OASystem.Domain.ViewModels.Resource
     public class CarDataSelectView
     {
         public int Id { get; set; }
+        [Encrypted]
         public string UnitArea { get; set; }
     }
 
@@ -31,115 +33,142 @@ namespace OASystem.Domain.ViewModels.Resource
         /// <summary>
         /// 区域
         /// </summary>
+        [Encrypted]
         public string UnitArea { get; set; }
 
         /// <summary>
         /// 公司名称
         /// </summary>
+        [Encrypted]
         public string UnitName { get; set; }
 
         /// <summary>
         /// 地址
         /// </summary>
+        [Encrypted]
         public string Address { get; set; }
 
-
-
-
         /// <summary>
         /// 联系人
         /// </summary>
+        [Encrypted]
         public string Contact { get; set; }
 
         /// <summary>
         /// 联系人手机号
         /// </summary>
+        [Encrypted]
         public string ContactTel { get; set; }
 
         /// <summary>
         /// 联系人邮箱
         /// </summary>
+        [Encrypted]
         public string ContactEmail { get; set; }
 
         /// <summary>
         /// 联系人传真
         /// </summary>
+        [Encrypted]
         public string ContactFax { get; set; }
 
         /// <summary>
         /// 其他信息
         /// </summary>
+        [Encrypted]
         public string OtherInfo { get; set; }
 
-
-
-
         /// <summary>
         /// 车描述
         /// </summary>
+        [Encrypted]
         public string CarDes { get; set; }
 
         /// <summary>
         /// 车图片路径
         /// 存储多个 使用/r/n
         /// </summary>
+        [Encrypted]
         public string CarPicPaths { get; set; }
 
-
-        
         /// <summary>
         /// 相关的车辆资质
         /// A B C  选择
         /// </summary>
+        [Encrypted]
         public string QualificationScore { get; set; }
 
         /// <summary>
         /// 车辆2-4年新,VIP及以上需要2年新
         /// A B C  选择
         /// </summary>
+        [Encrypted]
         public string CarAgeScore { get; set; }
 
         /// <summary>
         /// 车身干净,无文字图片等
         /// A B C  选择
         /// </summary>
+        [Encrypted]
         public string CleanImgScore { get; set; }
 
         /// <summary>
         /// 车内整洁、无异味
         /// A B C  选择
         /// </summary>
+        [Encrypted]
         public string SmellScore { get; set; }
 
         /// <summary>
         /// 提前备水,纸巾等
         /// A B C  选择
         /// </summary>
+        [Encrypted]
         public string WaterPaperScore { get; set; }
 
         /// <summary>
         /// 车辆配置高(皮座椅等)
         /// A B C  选择
         /// </summary>
+        [Encrypted]
         public string HardwareScore { get; set; }
 
         /// <summary>
         /// 时间概念强
         /// A B C  选择
         /// </summary>
+        [Encrypted]
         public string TimeScore { get; set; }
 
         /// <summary>
         /// 安全意识高
         /// A B C  选择
         /// </summary>
+        [Encrypted]
         public string SafetyScore { get; set; }
 
         /// <summary>
         /// 司机驾龄时间长,提前熟悉路线
         /// A B C  选择
         /// </summary>
+        [Encrypted]
         public string DrivingAgeScore { get; set; }
 
     }
+
+    public class CarDataMsgTipsView
+    {
+        [Encrypted]
+        public string Area { get; set; }
+        [Encrypted]
+        public string Client { get; set; }
+        [Encrypted]
+        public string Contact { get; set; }
+        public string Job { get; set; }
+        [Encrypted]
+        public string Tel { get; set; }
+        public int CreateUserId { get; set; }
+        public string CreatleUserName { get; set; }
+        public DateTime CreateTime { get; set; }
+    }
 }

+ 2 - 0
OASystem/OASystem.Domain/ViewModels/Resource/HotelDataView.cs

@@ -16,9 +16,11 @@ namespace OASystem.Domain.ViewModels.Resource
         /// id
         /// </summary>
         public int Id { get; set; }
+
         /// <summary>
         /// 城市名
         /// </summary>
+        [Encrypted]
         public string City { get; set; }
     }
 

+ 18 - 1
OASystem/OASystem.Domain/ViewModels/Resource/LocalGuideDataView.cs

@@ -1,4 +1,5 @@
-using OASystem.Domain.Entities.Resource;
+using OASystem.Domain.Attributes;
+using OASystem.Domain.Entities.Resource;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -13,6 +14,7 @@ namespace OASystem.Domain.ViewModels.Resource
     public class QueryLocalGuideSelectView
     {
         public int Id { get; set; }
+        [Encrypted]
         public string UnitArea { get; set; }
     }
 
@@ -33,83 +35,98 @@ namespace OASystem.Domain.ViewModels.Resource
         /// <summary>
         /// 区域
         /// </summary>
+        [Encrypted]
         public string UnitArea { get; set; }
 
         /// <summary>
         /// 公司名称
         /// </summary>
+        [Encrypted]
         public string UnitName { get; set; }
 
         /// <summary>
         /// 地址
         /// </summary>
+        [Encrypted]
         public string Address { get; set; }
 
         /// <summary>
         /// 联系人
         /// </summary>
+        [Encrypted]
         public string Contact { get; set; }
 
         /// <summary>
         /// 联系人手机号
         /// </summary>
+        [Encrypted]
         public string ContactTel { get; set; }
 
         /// <summary>
         /// 联系人邮箱
         /// </summary>
+        [Encrypted]
         public string ContactEmail { get; set; }
 
         /// <summary>
         /// 联系人传真
         /// </summary>
+        [Encrypted]
         public string ContactFax { get; set; }
 
         /// <summary>
         /// 其他信息
         /// </summary>
+        [Encrypted]
         public string OtherInfo { get; set; }
 
         /// <summary>
         /// 着装得体
         /// A B C  选择
         /// </summary>
+        [Encrypted]
         public string SuitScore { get; set; }
 
         /// <summary>
         /// 服务意识强度
         /// A B C  选择
         /// </summary>
+        [Encrypted]
         public string ServeScore { get; set; }
 
         /// <summary>
         /// 讲解水平专业
         /// A B C  选择
         /// </summary>
+        [Encrypted]
         public string TalkProScore { get; set; }
 
         /// <summary>
         /// 时间概念强度
         /// A B C  选择
         /// </summary>
+        [Encrypted]
         public string TimeScore { get; set; }
 
         /// <summary>
         /// 配合能力强,服从安排
         /// A B C  选择
         /// </summary>
+        [Encrypted]
         public string FitScore { get; set; }
 
         /// <summary>
         /// 应变能力强
         /// A B C  选择
         /// </summary>
+        [Encrypted]
         public string StrainScore { get; set; }
 
         /// <summary>
         /// 当地语言和中文表达流畅
         /// A B C  选择
         /// </summary>
+        [Encrypted]
         public string LocalAndChineseScore { get; set; }
     }
 }

+ 65 - 0
OASystem/OASystem.Domain/ViewModels/Resource/MediaSupplierView.cs

@@ -0,0 +1,65 @@
+using OASystem.Domain.Attributes;
+using OASystem.Domain.Entities.Resource;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.ViewModels.Resource
+{
+    public class MediaSupplierView : Res_MediaSuppliers
+    {
+    }
+
+    public class MediaSupplierInfoView
+    {
+        public int Id { get; set; }
+        public int TypeId { get; set; }
+        [Encrypted]
+        public string Privince { get; set; }
+        [Encrypted]
+        public string City { get; set; }
+        [Encrypted]
+        public string UnitName { get; set; }
+        [Encrypted]
+        public string UnitAbbreviation { get; set; }
+        [Encrypted]
+        public string UnitAddress { get; set; }
+        [Encrypted]
+        public string Contact { get; set; }
+        public int Sex { get; set; }
+        [Encrypted]
+        public string Post { get; set; }
+        [Encrypted]
+        public string Fax { get; set; }
+        [Encrypted]
+        public string Tel { get; set; }
+        [Encrypted]
+        public string Email { get; set; }
+        [Encrypted]
+        public string WeChat { get; set; }
+        [Encrypted]
+        public string Remark { get; set; }
+    }
+
+    public class PageItemView
+    {
+        public int Id { get; set; }
+        [Encrypted]
+        public string Privince { get; set; }
+        [Encrypted]
+        public string City { get; set; }
+        [Encrypted]
+        public string UnitName { get; set; }
+        [Encrypted]
+        public string Contact { get; set; }
+        public int Sex { get; set; }
+        [Encrypted]
+        public string Post { get; set; }
+        [Encrypted]
+        public string Tel { get; set; }
+        public string CreateUserName { get; set; }
+        public DateTime CreateTime { get; set; }
+    }
+}

+ 6 - 1
OASystem/OASystem.Domain/ViewModels/Resource/Res_LocalGuideData_ListItemView.cs

@@ -1,4 +1,5 @@
-using System;
+using OASystem.Domain.Attributes;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -16,21 +17,25 @@ namespace OASystem.Domain.ViewModels.Resource
         /// <summary>
         /// 单位区域
         /// </summary>
+        [Encrypted]
         public string UnitArea { get; set; }
 
         /// <summary>
         /// 单位名称
         /// </summary>
+        [Encrypted]
         public string UnitName { get; set; }
 
         /// <summary>
         /// 联系人
         /// </summary>
+        [Encrypted]
         public string Contact { get; set; }
 
         /// <summary>
         /// 联系电话
         /// </summary>
+        [Encrypted]
         public string ContactTel { get; set; }
 
         /// <summary>

+ 44 - 0
OASystem/OASystem.Domain/ViewModels/Resource/TranslatorLibraryView.cs

@@ -1,4 +1,5 @@
 using Newtonsoft.Json;
+using OASystem.Domain.Attributes;
 using OASystem.Domain.Entities.Resource;
 using System;
 using System.Collections.Generic;
@@ -125,4 +126,47 @@ namespace OASystem.Domain.ViewModels.Resource
         public string FileName { get; set; }
         public string FilePathName { get; set; }
     }
+
+    public class TranslatorLibraryItemView 
+    {
+        public int Id { get; set; }
+
+        [Encrypted]
+        public string Area { get; set; }
+
+        [Encrypted]
+        public string Name { get; set; }
+
+        public string Sex { get; set; }
+        [Encrypted]
+        public string Tel { get; set; }
+
+        [Encrypted]
+        public string Email { get; set; }
+
+        [Encrypted]
+        public string WechatNo { get; set; }
+
+        [Encrypted]
+        public string Language { get; set; }
+
+        public decimal Price { get; set; }
+
+        public string Currency { get; set; }
+
+        public string CreateUserName { get; set; }
+
+        public DateTime CreateTime { get; set; }
+        [Encrypted]
+        public string Remark { get; set; }
+    }
+
+
+    public class TranslatorLibraryNameView
+    {
+        public int Id { get; set; }
+
+        [Encrypted]
+        public string Name { get; set; }
+    }
 }

+ 58 - 43
OASystem/OASystem.Infrastructure/Repositories/Groups/CarTouristGuideGroundRepository.cs

@@ -4,6 +4,7 @@ using NPOI.SS.Formula.Functions;
 using NPOI.SS.UserModel;
 using NPOI.Util;
 using OASystem.Domain;
+using OASystem.Domain.AesEncryption;
 using OASystem.Domain.Dtos.Financial;
 using OASystem.Domain.Dtos.Groups;
 using OASystem.Domain.Dtos.QiYeWeChat;
@@ -53,13 +54,13 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 if (dto.Status == 1)//添加
                 {
                     var grp_CarTouristGuideGround = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservations>()
-                                                             .First(a => a.IsDel == 0 && 
-                                                                         a.Area == dto.Area && 
-                                                                         a.BusName == dto.BusName && 
-                                                                         a.ServiceGuide == dto.ServiceGuide && 
-                                                                         a.DiId == dto.DiId && 
-                                                                         a.BusTel == dto.BusTel && 
-                                                                         a.ServiceTel == dto.ServiceTel && 
+                                                             .First(a => a.IsDel == 0 &&
+                                                                         a.Area == dto.Area &&
+                                                                         a.BusName == dto.BusName &&
+                                                                         a.ServiceGuide == dto.ServiceGuide &&
+                                                                         a.DiId == dto.DiId &&
+                                                                         a.BusTel == dto.BusTel &&
+                                                                         a.ServiceTel == dto.ServiceTel &&
                                                                          a.PriceName == dto.PriceName
                                                              );
                     if (grp_CarTouristGuideGround != null)
@@ -115,16 +116,28 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 }
                 if (id != 0)
                 {
-                    Res_LocalGuideData _LocalGuideDataCar = _sqlSugar.Queryable<Res_LocalGuideData>().First(a => a.UnitName == dto.BusName && a.ContactTel == dto.BusTel && a.IsDel == 0);
+                    var _LocalGuideDataCar = _sqlSugar.Queryable<Res_LocalGuideData>()
+                        .First(a =>
+                            a.UnitName == AesEncryptionHelper.Encrypt(dto.BusName) &&
+                            a.ContactTel == AesEncryptionHelper.Encrypt(dto.BusTel) &&
+                            a.IsDel == 0
+                            );
                     if (_LocalGuideDataCar == null)
                     {
-                        Res_LocalGuideData res_LocalGuideCar = new Res_LocalGuideData();
+                        var res_LocalGuideCar = new Res_LocalGuideData();
                         res_LocalGuideCar.UnitName = dto.BusName;
                         res_LocalGuideCar.ContactTel = dto.BusTel;
                         res_LocalGuideCar.CreateUserId = dto.CreateUserId;
+
+                        EncryptionProcessor.EncryptProperties(res_LocalGuideCar);
                         int cId = await _sqlSugar.Insertable(res_LocalGuideCar).ExecuteReturnIdentityAsync();
                     }
-                    Res_LocalGuideData _LocalGuideDataService = _sqlSugar.Queryable<Res_LocalGuideData>().First(a => a.UnitName == dto.ServiceCompany && a.ContactTel == dto.ServiceTel && a.IsDel == 0);
+                    var _LocalGuideDataService = _sqlSugar.Queryable<Res_LocalGuideData>()
+                        .First(a => 
+                        a.UnitName == AesEncryptionHelper.Encrypt(dto.ServiceCompany) && 
+                        a.ContactTel == AesEncryptionHelper.Encrypt(dto.ServiceTel) && 
+                        a.IsDel == 0
+                        );
                     if (_LocalGuideDataService == null)
                     {
                         Res_LocalGuideData res_LocalGuideService = new Res_LocalGuideData();
@@ -133,6 +146,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         res_LocalGuideService.ContactTel = dto.ServiceTel;
                         res_LocalGuideService.Contact = dto.ServiceTel;
                         res_LocalGuideService.CreateUserId = dto.CreateUserId;
+                        EncryptionProcessor.EncryptProperties(res_LocalGuideService);
                         int cId = await _sqlSugar.Insertable(res_LocalGuideService).ExecuteReturnIdentityAsync();
                     }
                 }
@@ -179,14 +193,14 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 int day = ts.Days;
 
                 var diid = Query<Grp_GroupsTaskAssignment>(a => a.IsDel == 0 && a.UId == dto.UserId && a.CTId == 79)
-                    .Select(x=>x.DIId)
+                    .Select(x => x.DIId)
                     .Distinct()
                     .ToList();
 
                 //团组下拉框
-                List<Grp_DelegationInfo> _Delegations = diid.Any() 
+                List<Grp_DelegationInfo> _Delegations = diid.Any()
                     ? _sqlSugar.Queryable<Grp_DelegationInfo>()
-                        .Where(x => x.IsDel == 0 && diid.Contains(x.Id)).ToList() 
+                        .Where(x => x.IsDel == 0 && diid.Contains(x.Id)).ToList()
                     : new List<Grp_DelegationInfo>();
                 List<ShareGroupInfoIIView> grp_Delegations = _mapper.Map<List<ShareGroupInfoIIView>>(_Delegations);
 
@@ -203,9 +217,10 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 List<SetDataInfoView> ssdv = _mapper.Map<List<Sys_SetData>, List<SetDataInfoView>>(ssd);
 
                 var carTouristGuides = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservationsContent>()
-                                             .LeftJoin<Sys_SetData>((a,b) => b.IsDel == 0 && a.SId == b.Id)
+                                             .LeftJoin<Sys_SetData>((a, b) => b.IsDel == 0 && a.SId == b.Id)
                                              .Where(a => a.IsDel == 0 && a.CTGGRId == dto.Id)
-                                             .Select((a, b) => new CarTouristGuideGroundReservationsContentView {
+                                             .Select((a, b) => new CarTouristGuideGroundReservationsContentView
+                                             {
                                                  SId = a.SId,
                                                  Id = a.Id,
                                                  Count = a.Count,
@@ -217,9 +232,9 @@ namespace OASystem.Infrastructure.Repositories.Groups
                                              })
                                              .ToList();
 
-                var weikuanSign = new int[] { 1070, 1071,};
+                var weikuanSign = new int[] { 1070, 1071, };
                 TableInitialization.RemoveAll(x => weikuanSign.Contains(x.Id));
-                var weiKuanArr = _TableInitialization.Where(x => weikuanSign.Contains(x.Id) ).ToList();
+                var weiKuanArr = _TableInitialization.Where(x => weikuanSign.Contains(x.Id)).ToList();
                 var weiKuanResultArr = carTouristGuides.Where(x => weikuanSign.Contains(x.SId)).ToList();
                 carTouristGuides.RemoveAll(x => weikuanSign.Contains(x.SId));
 
@@ -301,7 +316,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 carTouristGuides = groupResult.Values.SelectMany(sublist => sublist).OrderBy(x => x.SId).ThenBy(x => x.DatePrice).ToList();
 
                 var _CreditCardPayment = _sqlSugar.Queryable<Grp_CreditCardPayment, Sys_SetData, Sys_SetData>(
-                    (g, s1, s2) => new JoinQueryInfos (
+                    (g, s1, s2) => new JoinQueryInfos(
                         JoinType.Left, g.PayDId == s1.Id,
                         JoinType.Left, g.PaymentCurrency == s2.Id
                     ))
@@ -464,7 +479,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 //三公费用金额以及币种
                 var boolParse = int.TryParse(grpCarOp.Area, out int natiId);
                 var NationalTravelFee = _sqlSugar.Queryable<Grp_NationalTravelFee>()
-                    .LeftJoin<Sys_SetData>((a, b) => a.Currency == b.Id )
+                    .LeftJoin<Sys_SetData>((a, b) => a.Currency == b.Id)
                     .Where((a, b) => a.IsDel == 0 && b.IsDel == 0)
                     .Select((a, b) => new
                     {
@@ -484,12 +499,12 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 };
 
                 var bankCard = _sqlSugar.Queryable<Sys_SetData>().Where(x => x.IsDel == 0 && x.STid == 15)
-                    .Select(x=> new
-                            {
-                                x.Id,
-                                x.Name
-                            })
-                    .OrderByDescending(x=>x.Id)
+                    .Select(x => new
+                    {
+                        x.Id,
+                        x.Name
+                    })
+                    .OrderByDescending(x => x.Id)
                     .ToList();
 
                 if (dto.PortType == 1)
@@ -806,7 +821,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 #region 旧数据处理
                 string time = DateTime.Now.ToString("yyyy-MM-dd HH:mm ss");
                 var ids = carTouristList.Select(x1 => x1.Id);
-                _ = _sqlSugar.Updateable<Grp_CarTouristGuideGroundReservationsContent>().Where(x => x.DiId == dto.DiId && x.CTGGRId == dto.CTGGRId  && !ids.Contains(x.Id) && x.IsDel == 0).SetColumns(x => new Grp_CarTouristGuideGroundReservationsContent
+                _ = _sqlSugar.Updateable<Grp_CarTouristGuideGroundReservationsContent>().Where(x => x.DiId == dto.DiId && x.CTGGRId == dto.CTGGRId && !ids.Contains(x.Id) && x.IsDel == 0).SetColumns(x => new Grp_CarTouristGuideGroundReservationsContent
                 {
                     IsDel = 1,
                     DeleteTime = time,
@@ -854,9 +869,9 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     };
 
                     List<Tuple<int, string, int, decimal>> arr = new List<Tuple<int, string, int, decimal>>();
-                    arr.Add(new Tuple<int, string, int,decimal>(1074, "早餐超支费用", 1077, 1M));  // sid name setdataid 系数
-                    arr.Add(new Tuple<int, string, int,decimal>(1075, "午餐超支费用", 1078, 1M));
-                    arr.Add(new Tuple<int, string, int,decimal>(1076, "晚餐超支费用", 1079, 1M));
+                    arr.Add(new Tuple<int, string, int, decimal>(1074, "早餐超支费用", 1077, 1M));  // sid name setdataid 系数
+                    arr.Add(new Tuple<int, string, int, decimal>(1075, "午餐超支费用", 1078, 1M));
+                    arr.Add(new Tuple<int, string, int, decimal>(1076, "晚餐超支费用", 1079, 1M));
                     arr.Add(new Tuple<int, string, int, decimal>(982, "车超时费用", 1050, 2.4M));
                     arr.Add(new Tuple<int, string, int, decimal>(1059, "导游超时费用", 1072, 1M));
                     arr.Add(new Tuple<int, string, int, decimal>(1085, "景点门票超支费用", 1086, 1.2M));
@@ -890,7 +905,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                             PriceDetailType = item.Item3,
                             Remark = x.PriceContent,
                             Area = opSingleCityId
-                        
+
                         }).ToList();
 
                         if (a.Count > 0)
@@ -945,26 +960,26 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         {
                             remake += $"{start.ToString("M/d")}午餐和晚餐,";
                             exitMealCount += 2;
-                            price += (aMeal * 2  * di.VisitPNumber) - (mealPriceWu * dto.Rate) - (mealPriceWan * dto.Rate);
+                            price += (aMeal * 2 * di.VisitPNumber) - (mealPriceWu * dto.Rate) - (mealPriceWan * dto.Rate);
                         }
                         else if (isExistsWu)
                         {
                             remake += $"{start.ToString("M/d")}午餐,";
                             exitMealCount += 1;
-                            price += (aMeal  * di.VisitPNumber) - (mealPriceWu * dto.Rate);
+                            price += (aMeal * di.VisitPNumber) - (mealPriceWu * dto.Rate);
                         }
                         else if (isExistsWan)
                         {
                             remake += $"{start.ToString("M/d")}晚餐,";
                             exitMealCount += 1;
-                            price += (aMeal * di.VisitPNumber)  - (mealPriceWan * dto.Rate);
+                            price += (aMeal * di.VisitPNumber) - (mealPriceWan * dto.Rate);
                         }
 
                         start = start.AddDays(1);
                         //day++;
                     }
 
-                    var priceTypeArr = new int[] { 1061 , 1069 };
+                    var priceTypeArr = new int[] { 1061, 1069 };
 
                     if (exitMealCount > 0 && priceTypeArr.Contains(opSingle.PriceType))
                     {
@@ -981,10 +996,10 @@ namespace OASystem.Infrastructure.Repositories.Groups
                             DiId = dto.DiId,
                             FilePath = string.Empty,
                             IsDel = 0,
-                            PriceCount = di.VisitPNumber * exitMealCount * -1 ,
+                            PriceCount = di.VisitPNumber * exitMealCount * -1,
                             Price = priceInt,
                             PriceDt = opSingle.ServiceStartTime.ObjToDate(),
-                            PriceCurrency = findSetDataCurr == null ? dto.toCurr: findSetDataCurr.Id ,
+                            PriceCurrency = findSetDataCurr == null ? dto.toCurr : findSetDataCurr.Id,
                             PriceSum = (di.VisitPNumber * exitMealCount * -1) * priceInt,
                             PriceName = di.TeamName + "-" + priceCity + "-" + $"退餐费(地接导入)",
                             PriceType = 1028,
@@ -994,7 +1009,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         });
                     }
 
-                    var needToConfirm = new int[] { 1088, 1050 }; 
+                    var needToConfirm = new int[] { 1088, 1050 };
 
                     if (groupExtraCostsArr.Count > 0)
                     {
@@ -1071,8 +1086,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                         _foreignReceivablesRepository.OverSpSeteceivables(new OverSpSeteceivablesDto
                         {
-                             CreateUserId = dto.CreateUserId,
-                             DiId = dto.DiId,
+                            CreateUserId = dto.CreateUserId,
+                            DiId = dto.DiId,
                         });
                     }
 
@@ -1133,7 +1148,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 Regex regex = new Regex("^[\u4e00-\u9fa5]{0,}$");
 
                 #region 修改C表数据
-                
+
                 Grp_CreditCardPayment c = new Grp_CreditCardPayment();
                 c.PaymentCurrency = dto.Currency;
                 for (int i = 0; i < dto.SelectCheck.Count; i++)
@@ -1282,7 +1297,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
             catch (Exception ex)
             {
                 RollbackTran();
-                result = new Result() { Code = -2, Msg = $"接口异常!({ex.Message})"};
+                result = new Result() { Code = -2, Msg = $"接口异常!({ex.Message})" };
             }
             return result;
         }
@@ -1405,7 +1420,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
             if (costDto.costSign != 3)
             {
                 //获取新汇率  int diId,int CId, int currencyId
-                Result rate =  await _setDataRep.PostCurrencyByDiid(costDto.diId, 1015, costDto.currency);
+                Result rate = await _setDataRep.PostCurrencyByDiid(costDto.diId, 1015, costDto.currency);
 
                 if (rate.Code == 0)
                 {
@@ -1524,7 +1539,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
             Result rt = new Result();
             foreach (var item in dto)
             {
-                await  _daiRep.UpdateAsync<Fin_GroupExtraCost>(s => s.PriceName == item.priceName && s.DiId == item.diId, 
+                await _daiRep.UpdateAsync<Fin_GroupExtraCost>(s => s.PriceName == item.priceName && s.DiId == item.diId,
                     s => new Fin_GroupExtraCost
                     {
                         IsDel = 1,

+ 30 - 36
OASystem/OASystem.Infrastructure/Repositories/Resource/AirTicketAgentRepository.cs

@@ -1,5 +1,6 @@
 using AutoMapper;
 using OASystem.Domain;
+using OASystem.Domain.AesEncryption;
 using OASystem.Domain.Dtos.Resource;
 using OASystem.Domain.Entities.Resource;
 using OASystem.Domain.ViewModels.Resource;
@@ -22,52 +23,45 @@ namespace OASystem.Infrastructure.Repositories.Groups
         public async Task<Result> OpAirTicketAgent(OpAirTicketAgentDto dto)
         {
             Result result = new Result() { Code = -2, Msg = "未知错误" };
-            try
+
+            EncryptionProcessor.EncryptProperties(dto);
+
+            if (dto.Status == 1)//添加
             {
-                if (dto.Status == 1)//添加
+                var res_AirTicket = await Query<Res_AirTicketAgent>(a => a.IsDel == 0 && a.Account == dto.Account && a.Name == dto.Name && a.Bank == dto.Bank).FirstAsync();
+                if (res_AirTicket != null)
                 {
-                   Res_AirTicketAgent res_AirTicket=await Query<Res_AirTicketAgent>(a=>a.IsDel==0 && a.Account==dto.Account && a.Name==dto.Name && a.Bank==dto.Bank).FirstAsync();
-                    if (res_AirTicket!=null)
-                    {
-                        return result = new Result() { Code = -1, Msg = "该代理商已存在,请勿重复添加!" };
-                    }
-                    else
-                    {
-                        Res_AirTicketAgent _AirTicketAgent = _mapper.Map<Res_AirTicketAgent>(dto);
-                        int id = await AddAsyncReturnId(_AirTicketAgent);
-                        if (id == 0)
-                        {
-                            return result = new Result() { Code = -1, Msg = "添加失败!" };
-
-                        }
-                        return result = new Result() { Code = 0, Msg = "添加成功!", Data = new { Id = id } };
-                    }
+                    return result = new Result() { Code = -1, Msg = "该代理商已存在,请勿重复添加!" };
                 }
-                else if (dto.Status == 2)//修改
+                else
                 {
-                    bool res = await UpdateAsync(a => a.Id == dto.Id, a => new Res_AirTicketAgent
+                    var _AirTicketAgent = _mapper.Map<Res_AirTicketAgent>(dto);
+                    int id = await AddAsyncReturnId(_AirTicketAgent);
+                    if (id == 0)
                     {
-                        Name = dto.Name,
-                        Bank = dto.Bank,
-                        Account = dto.Account,
-                        CreateUserId = dto.CreateUserId,
-                        Remark = dto.Remark,
-                    });
-                    if (!res)
-                    {
-                        return result = new Result() { Code = -1, Msg = "修改失败!" };
+                        return result = new Result() { Code = -1, Msg = "添加失败!" };
+
                     }
-                    return result = new Result() { Code = 0, Msg = "修改成功!" };
-                }
-                else
-                {
-                    return result = new Result() { Code = -1, Msg = "请传入Status参数,1添加 2修改!" };
+                    return result = new Result() { Code = 0, Msg = "添加成功!", Data = new { Id = id } };
                 }
             }
-            catch (Exception ex)
+            else if (dto.Status == 2)//修改
             {
-                return result = new Result() { Code = -2, Msg = "程序错误!" };
+                bool res = await UpdateAsync(a => a.Id == dto.Id, a => new Res_AirTicketAgent
+                {
+                    Name = dto.Name,
+                    Bank = dto.Bank,
+                    Account = dto.Account,
+                    CreateUserId = dto.CreateUserId,
+                    Remark = dto.Remark,
+                });
+                if (!res)
+                {
+                    return result = new Result() { Code = -1, Msg = "修改失败!" };
+                }
+                return result = new Result() { Code = 0, Msg = "修改成功!" };
             }
+            return result = new Result() { Code = -1, Msg = "请传入Status参数,1添加 2修改!" };
         }
     }
 }

+ 86 - 114
OASystem/OASystem.Infrastructure/Repositories/Resource/CarDataRepository.cs

@@ -1,8 +1,10 @@
 using AutoMapper;
 using OASystem.Domain;
+using OASystem.Domain.AesEncryption;
 using OASystem.Domain.Dtos.Resource;
 using OASystem.Domain.Entities.Resource;
 using OASystem.Domain.ViewModels.Resource;
+using XAct;
 
 namespace OASystem.Infrastructure.Repositories.Resource
 {
@@ -21,138 +23,108 @@ namespace OASystem.Infrastructure.Repositories.Resource
         /// <returns></returns>
         public async Task<Result> QueryCarData(QueryCarDataDto dto)
         {
-            Result result = new Result() { Code = -2, Msg = "未知错误" };
-            try
+            string sqlWhere = string.Empty;
+            if (!string.IsNullOrWhiteSpace(dto.UnitName)) sqlWhere += string.Format(@" And UnitName like '%{0}%'", AesEncryptionHelper.Encrypt(dto.UnitName));
+            if (!string.IsNullOrWhiteSpace(dto.UnitArea) && dto.UnitArea != "全部") sqlWhere += string.Format(@" And UnitArea like '%{0}%'", AesEncryptionHelper.Encrypt(dto.UnitArea));
+            if (!string.IsNullOrWhiteSpace(dto.Contact)) sqlWhere += string.Format(@" And Contact like '%{0}%'", AesEncryptionHelper.Encrypt(dto.Contact));
+            if (!string.IsNullOrWhiteSpace(dto.ContactTel)) sqlWhere += string.Format(@" And ContactTel like '%{0}%'", AesEncryptionHelper.Encrypt(dto.ContactTel));
+
+            sqlWhere += string.Format(@" And IsDel={0}", 0);
+            if (!string.IsNullOrEmpty(sqlWhere.Trim()))
             {
-                string sqlWhere = string.Empty;
-                if (!string.IsNullOrWhiteSpace(dto.UnitName))
-                {
-                    sqlWhere += string.Format(@" And UnitName like '%{0}%'", dto.UnitName);
-                }
-                if (!string.IsNullOrWhiteSpace(dto.UnitArea) && dto.UnitArea!="全部")
-                {
-                    sqlWhere += string.Format(@" And UnitArea like '%{0}%'", dto.UnitArea);
-                }
-                if (!string.IsNullOrWhiteSpace(dto.Contact))
-                {
-                    sqlWhere += string.Format(@" And Contact like '%{0}%'", dto.Contact);
-                }
-                if (!string.IsNullOrWhiteSpace(dto.ContactTel))
-                {
-                    sqlWhere += string.Format(@" And ContactTel like '%{0}%'", dto.ContactTel);
-                }
-                sqlWhere += string.Format(@" And IsDel={0}", 0);
-                if (!string.IsNullOrEmpty(sqlWhere.Trim()))
+                Regex r = new Regex("And");
+                sqlWhere = r.Replace(sqlWhere, "Where", 1);
+            }
+            if (dto.PortType == 1)
+            {
+                string sql = string.Format(@"select * from Res_CarData {0}", sqlWhere);
+                var carDatas = await _sqlSugar.SqlQueryable<Res_CarData>(sql).ToListAsync();
+                if (carDatas.Count == 0) return  new Result() { Code = -1, Msg = "暂无数据" };
+
+                carDatas = carDatas.OrderByDescending(x => x.CreateTime).ToList();
+
+                if (dto.PageSize == 0 && dto.PageIndex == 0)
                 {
-                    Regex r = new Regex("And");
-                    sqlWhere = r.Replace(sqlWhere, "Where", 1);
+                    foreach (var item in carDatas) EncryptionProcessor.DecryptProperties(item);
+                    return new Result()
+                    {
+                        Code = 0,
+                        Msg = "查询成功",
+                        Data = carDatas,
+                    };
                 }
-                if (dto.PortType == 1)
+                else
                 {
-                    string sql = string.Format(@"select * from Res_CarData {0}", sqlWhere);
-                    List<Res_CarData> CarData = await _sqlSugar.SqlQueryable<Res_CarData>(sql).ToListAsync();
-                    if (CarData.Count==0)
-                    {
-                        return result = new Result() { Code = -1, Msg = "暂无数据" };
-                    }
-                    CarData= CarData.OrderByDescending(x => x.CreateTime).ToList();
+                    int count = carDatas.Count;
+                    float totalPage = (float)count / dto.PageSize;//总页数
+                    if (totalPage == 0) totalPage = 1;
+                    else totalPage = (int)Math.Ceiling((double)totalPage);
 
-                    if (dto.PageSize==0 && dto.PageIndex==0)
+                    var ListData = new List<Res_CarData>();
+                    for (int i = 0; i < dto.PageSize; i++)
                     {
-                        return result = new Result()
-                        {
-                            Code = 0,
-                            Msg = "查询成功",
-                            Data = CarData,
-                        };
-                    }
-                    else
-                    {
-                        int count = CarData.Count;
-                        float totalPage = (float)count / dto.PageSize;//总页数
-                        if (totalPage == 0) totalPage = 1;
-                        else totalPage = (int)Math.Ceiling((double)totalPage);
-
-                        List<Res_CarData> ListData = new List<Res_CarData>();
-                        for (int i = 0; i < dto.PageSize; i++)
-                        {
-                            var RowIndex = i + (dto.PageIndex - 1) * dto.PageSize;
-                            if (RowIndex < CarData.Count)
-                            {
-                                ListData.Add(CarData[RowIndex]);
-                            }
-                            else
-                            {
-                                break;
-                            }
+                        var RowIndex = i + (dto.PageIndex - 1) * dto.PageSize;
+                        if (RowIndex < carDatas.Count) {
+                            EncryptionProcessor.DecryptProperties(carDatas[RowIndex]);
+                            ListData.Add(carDatas[RowIndex]);
                         }
-                        return result = new Result()
-                        {
-                            Code = 0,
-                            Msg = "查询成功",
-                            Data = new { pageCount = count, totalPage = (int)totalPage, pageIndex = dto.PageIndex, pageSize = dto.PageSize, pageSource = ListData },
-                        };
+                        else break;
                     }
-                    
+
+                    return new Result()
+                    {
+                        Code = 0,
+                        Msg = "查询成功",
+                        Data = new { pageCount = count, totalPage = (int)totalPage, pageIndex = dto.PageIndex, pageSize = dto.PageSize, pageSource = ListData },
+                    };
                 }
-                else if (dto.PortType == 2)
+            }
+            else if (dto.PortType == 2 || dto.PortType == 3)
+            {
+                string sql = string.Format(@"select * from Res_CarData {0}", sqlWhere);
+                var carDatas = await _sqlSugar.SqlQueryable<Res_CarData>(sql).ToListAsync();
+                if (carDatas.Count == 0) return new Result() { Code = -1, Msg = "暂无数据" };
+
+                carDatas = carDatas.OrderByDescending(x => x.CreateTime).ToList();
+
+                if (dto.PageSize == 0 || dto.PageIndex == 0)
                 {
-                    string sql = string.Format(@"select * from Res_CarData {0}", sqlWhere);
-                    List<Res_CarData> CarData = await _sqlSugar.SqlQueryable<Res_CarData>(sql).ToListAsync();
-                    if (CarData.Count == 0)
+                    foreach (var item in carDatas) EncryptionProcessor.DecryptProperties(item);
+                    return new Result()
                     {
-                        return result = new Result() { Code = -1, Msg = "暂无数据" };
-                    }
-                    CarData = CarData.OrderByDescending(x => x.CreateTime).ToList();
+                        Code = 0,
+                        Msg = "查询成功",
+                        Data = carDatas,
+                    };
+                }
+                else
+                {
+                    int count = carDatas.Count;
+                    float totalPage = (float)count / dto.PageSize;//总页数
+                    if (totalPage == 0) totalPage = 1;
+                    else totalPage = (int)Math.Ceiling((double)totalPage);
 
-                    if (dto.PageSize == 0 || dto.PageIndex == 0)
-                    {
-                        return result = new Result()
-                        {
-                            Code = 0,
-                            Msg = "查询成功",
-                            Data = CarData,
-                        };
-                    }
-                    else
+                    var ListData = new List<Res_CarData>();
+                    for (int i = 0; i < dto.PageSize; i++)
                     {
-                        int count = CarData.Count;
-                        float totalPage = (float)count / dto.PageSize;//总页数
-                        if (totalPage == 0) totalPage = 1;
-                        else totalPage = (int)Math.Ceiling((double)totalPage);
-
-                        List<Res_CarData> ListData = new List<Res_CarData>();
-                        for (int i = 0; i < dto.PageSize; i++)
+                        var RowIndex = i + (dto.PageIndex - 1) * dto.PageSize;
+                        if (RowIndex < carDatas.Count)
                         {
-                            var RowIndex = i + (dto.PageIndex - 1) * dto.PageSize;
-                            if (RowIndex < CarData.Count)
-                            {
-                                ListData.Add(CarData[RowIndex]);
-                            }
-                            else
-                            {
-                                break;
-                            }
+                            EncryptionProcessor.DecryptProperties(carDatas[RowIndex]);
+                            ListData.Add(carDatas[RowIndex]);
                         }
-                        return result = new Result()
-                        {
-                            Code = 0,
-                            Msg = "查询成功",
-                            Data = new { pageCount = count, totalPage = ((int)totalPage).ToString(), pageIndex = dto.PageIndex, pageSize = dto.PageSize, pageSource = ListData },
-                        };
+                        else break;
                     }
+
+                    return new Result()
+                    {
+                        Code = 0,
+                        Msg = "查询成功",
+                        Data = new { pageCount = count, totalPage = ((int)totalPage).ToString(), pageIndex = dto.PageIndex, pageSize = dto.PageSize, pageSource = ListData },
+                    };
                 }
-                else
-                {
-                    return result = new Result() { Code = -2, Msg = "请传入PortType参数!1:Web,2:Android,3:IOS" };
-                }
-            }
-            catch (Exception)
-            {
-                return result;
-                throw;
             }
-            
+            else return new Result() { Code = -2, Msg = MsgTips.Port };
         }
     }
 }

+ 1 - 1
OASystem/OASystem.Infrastructure/Repositories/Resource/HotelDataRepository.cs

@@ -71,7 +71,7 @@ WHERE
             {
                 string selectSql = string.Format(@"select * from Res_HotelData where Name='{0}' and IsDel='{1}'"
                                                    , dto.Name, 0);
-                var HotelData = await _sqlSugar.Queryable<Res_HotelData>().Where(x => x.IsDel == 0 && x.Name.Contains(dto.Name)).FirstAsync();//查询是否存在
+                var HotelData = await _sqlSugar.Queryable<Res_HotelData>().Where(x => x.IsDel == 0 && x.Name.Contains(AesEncryptionHelper.Encrypt(dto.Name))).FirstAsync();//查询是否存在
                 if (HotelData != null)
                 {
                     return result = new Result() { Code = -1, Msg = "该信息已存在,请勿重复添加!" };

+ 106 - 230
OASystem/OASystem.Infrastructure/Repositories/Resource/LocalGuideDataRepository.cs

@@ -1,9 +1,11 @@
 using AutoMapper;
 using OASystem.Domain;
+using OASystem.Domain.AesEncryption;
 using OASystem.Domain.Dtos.Resource;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.Entities.Resource;
 using OASystem.Domain.ViewModels.Resource;
+using Org.BouncyCastle.Utilities;
 using SqlSugar.Extensions;
 using System;
 using System.Collections.Generic;
@@ -22,268 +24,142 @@ namespace OASystem.Infrastructure.Repositories.Resource
         }
         public async Task<Result> LocalGuideOperation(LocalGuideOperationDto dto)
         {
-            Result result = new Result() { Code = -2, Msg = "未知错误" };
-            try
-            {
-                if (dto.Status == 1)//添加
-                {
-                    string selectSql = string.Format(@"select * from Res_LocalGuideData where UnitArea='{0}' and UnitName='{1}' and Contact='{2}' and ContactTel='{3}'"
-                                                       , dto.UnitArea, dto.UnitName, dto.Contact, dto.ContactTel);
-                    var LocalGuideData = await _sqlSugar.SqlQueryable<Res_LocalGuideData>(selectSql).FirstAsync();//查询是否存在
-                    if (LocalGuideData != null)
-                    {
-                        return result = new Result() { Code = -1, Msg = "该信息已存在,请勿重复添加!" };
+            var localGuideDat = _mapper.Map<Res_LocalGuideData>(dto);
+            localGuideDat.LastUpdate = DateTime.Now;
+            EncryptionProcessor.EncryptProperties(localGuideDat);
 
-                    }
-                    else//不存在,可添加
-                    {
-                        Res_LocalGuideData _LocalGuideDat = _mapper.Map<Res_LocalGuideData>(dto);
-                        _LocalGuideDat.LastUpdate = DateTime.Now;
-                        int id = await AddAsyncReturnId(_LocalGuideDat);
-                        if (id == 0)
-                        {
-                            return result = new Result() { Code = -1, Msg = "添加失败!" };
-
-                        }
-                        result = new Result() { Code = 0, Msg = "添加成功!", Data = new { Id = id } };
-                    }
-                }
-                else if (dto.Status == 2)//修改
-                {
-                    DateTime dtLastUpdate = DateTime.Now;
-                    bool res = await UpdateAsync(a => a.Id == dto.Id, a => new Res_LocalGuideData
-                    {
-                        UnitArea = dto.UnitArea,
-                        UnitName = dto.UnitName,
-                        Address = dto.Address,
-                        Contact = dto.Contact,
-                        ContactTel = dto.ContactTel,
-                        ContactEmail = dto.ContactEmail,
-                        ContactFax = dto.ContactFax,
-                        OtherInfo = dto.OtherInfo,
-                        Score = dto.Score,
-                        SuitScore = dto.SuitScore,
-                        ServeScore = dto.ServeScore,
-                        TalkProScore = dto.TalkProScore,
-                        TimeScore = dto.TimeScore,
-                        FitScore = dto.FitScore,
-                        StrainScore = dto.StrainScore,
-                        LocalAndChineseScore = dto.LocalAndChineseScore,
-                        StaffType = dto.StaffType,
-                        Remark = dto.Remark,
-                        LastUpdate = dtLastUpdate
-                    });
-                    if (!res)
-                    {
-                        return result = new Result() { Code = -1, Msg = "修改失败!" };
-                    }
-                    result = new Result() { Code = 0, Msg = "修改成功!" };
-                }
-                else
+            if (dto.Status == 1)//添加
+            {
+                string selectSql = string.Format(@"select * from Res_LocalGuideData where UnitArea='{0}' and UnitName='{1}' and Contact='{2}' and ContactTel='{3}'",
+                                                   AesEncryptionHelper.Encrypt(dto.UnitArea),
+                                                   AesEncryptionHelper.Encrypt(dto.UnitName),
+                                                   AesEncryptionHelper.Encrypt(dto.Contact),
+                                                   AesEncryptionHelper.Encrypt(dto.ContactTel));
+                var LocalGuideData = await _sqlSugar.SqlQueryable<Res_LocalGuideData>(selectSql).FirstAsync();//查询是否存在
+                if (LocalGuideData != null) return new Result() { Code = -1, Msg = "该信息已存在,请勿重复添加!" };
+                else//不存在,可添加
                 {
-                    return result = new Result() { Code = -1, Msg = "请传入Status参数,1添加 2修改!" };
+                    int id = await AddAsyncReturnId(localGuideDat);
+                    if (id == 0) return new Result() { Code = -1, Msg = "添加失败!" };
+                    return new Result() { Code = 0, Msg = "添加成功!", Data = new { Id = id } };
                 }
             }
-            catch (Exception ex)
+            else if (dto.Status == 2)//修改
             {
-                return result = new Result() { Code = -2, Msg = "程序错误!" };
+                var res = await _sqlSugar.Updateable(localGuideDat).IgnoreColumns(x => new { x.IsDel, x.CreateUserId, x.CreateTime, x.DeleteUserId, x.DeleteTime }).ExecuteCommandAsync();
+
+                if (res < 1)
+                {
+                    return new Result() { Code = -1, Msg = "修改失败!" };
+                }
+                return new Result() { Code = 0, Msg = "修改成功!" };
             }
-            return result;
+
+            return new Result() { Code = -1, Msg = "请传入Status参数,1添加 2修改!" };
         }
 
         public async Task<Result> QueryLocalGuide(QueryLocalGuide dto)
         {
             Result result = new Result() { Code = -2, Msg = "未知错误" };
-            try
+
+            var localGuideDatas = await _sqlSugar.Queryable<Res_LocalGuideData>().Where(x => x.IsDel == 0).ToListAsync();
+
+            string unitName = dto.UnitName, unitArea = dto.UnitArea, contact = dto.Contact, contactTel = dto.ContactTel;
+
+            int pageSize = dto.PageSize, pageIndex = dto.PageIndex;
+
+            //处理要查询的字段解密
+            foreach (var item in localGuideDatas)
             {
-                string sqlWhere = string.Empty;
-                if (!string.IsNullOrWhiteSpace(dto.UnitName))
-                {
-                    sqlWhere += string.Format(@" And UnitName like '%{0}%'", dto.UnitName);
-                }
-                if (!string.IsNullOrWhiteSpace(dto.UnitArea) && dto.UnitArea != "全部")
+                if (!string.IsNullOrEmpty(unitName)) AesEncryptionHelper.Decrypt(unitName);
+                if (!string.IsNullOrEmpty(unitArea)) AesEncryptionHelper.Decrypt(unitName);
+                if (!string.IsNullOrEmpty(contact)) AesEncryptionHelper.Decrypt(unitName);
+                if (!string.IsNullOrEmpty(contactTel)) AesEncryptionHelper.Decrypt(unitName);
+            }
+            localGuideDatas = localGuideDatas
+                .WhereIF(!string.IsNullOrEmpty(unitName),x => x.UnitName.Contains(unitName))
+                .WhereIF(!string.IsNullOrEmpty(unitArea), x => x.UnitArea.Contains(unitArea))
+                .WhereIF(!string.IsNullOrEmpty(contact), x => x.Contact.Contains(contact))
+                .WhereIF(!string.IsNullOrEmpty(contactTel), x => x.ContactTel.Contains(contactTel))
+                .ToList();
+
+            if (dto.PortType == 1 || dto.PortType == 2)
+            {
+                if (localGuideDatas.Count == 0)
                 {
-                    sqlWhere += string.Format(@" And UnitArea like '%{0}%'", dto.UnitArea);
+                    return result = new Result() { Code = 0, Msg = "暂无数据" };
                 }
-                if (!string.IsNullOrWhiteSpace(dto.Contact))
+                localGuideDatas = localGuideDatas.OrderByDescending(x => x.CreateTime).ToList();
+
+                if (dto.PageSize == 0 || dto.PageIndex == 0)
                 {
-                    sqlWhere += string.Format(@" And Contact like '%{0}%'", dto.Contact);
+                    foreach (var item in localGuideDatas) EncryptionProcessor.DecryptProperties(item);
+
+                    return result = new Result()
+                    {
+                        Code = 0,
+                        Msg = "查询成功",
+                        Data = localGuideDatas,
+                    };
                 }
-                if (!string.IsNullOrWhiteSpace(dto.ContactTel))
+                else
                 {
-                    sqlWhere += string.Format(@" And ContactTel like '%{0}%'", dto.ContactTel);
+                    int totalItems = localGuideDatas.Count(); 
+                    int totalPages = (int)Math.Ceiling((double)totalItems / pageSize);
+                    int skip = (pageIndex - 1) * pageSize;
+
+                    var pageSource = localGuideDatas.Skip(skip).Take(pageSize).ToList();
+                    foreach (var item in pageSource) EncryptionProcessor.DecryptProperties(item);
+                    return result = new Result()
+                    {
+                        Code = 0,
+                        Msg = "查询成功",
+                        Data = new { pageCount = totalItems, totalPage = totalPages, pageIndex = dto.PageIndex, pageSize = dto.PageSize, pageSource = pageSource },
+                    };
                 }
-                sqlWhere += string.Format(@" And IsDel={0}", 0);
-                if (!string.IsNullOrEmpty(sqlWhere.Trim()))
+
+            }
+            else if (dto.PortType == 3)
+            {
+                if (localGuideDatas.Count == 0)
                 {
-                    Regex r = new Regex("And");
-                    sqlWhere = r.Replace(sqlWhere, "Where", 1);
+                    return result = new Result() { Code = 0, Msg = "暂无数据" };
                 }
-                if (dto.PortType == 1)
-                {
-                    string sql = string.Format(@"select * from Res_LocalGuideData {0}", sqlWhere);
-                    List<Res_LocalGuideData> LocalGuideData = await _sqlSugar.SqlQueryable<Res_LocalGuideData>(sql).ToListAsync();
-                    if (LocalGuideData.Count == 0)
-                    {
-                        return result = new Result() { Code = 0, Msg = "暂无数据" };
-                    }
-                    LocalGuideData = LocalGuideData.OrderByDescending(x => x.CreateTime).ToList();
+                localGuideDatas = localGuideDatas.OrderByDescending(x => x.CreateTime).ToList();
 
-                    if (dto.PageSize == 0 || dto.PageIndex == 0)
-                    {
-                        return result = new Result()
-                        {
-                            Code = 0,
-                            Msg = "查询成功",
-                            Data = LocalGuideData,
-                        };
-                    }
-                    else
+                if (dto.PageSize == 0 && dto.PageIndex == 0)
+                {
+                    foreach (var item in localGuideDatas) EncryptionProcessor.DecryptProperties(item);
+                    return result = new Result()
                     {
-                        int count = LocalGuideData.Count;
-                        float totalPage = (float)count / dto.PageSize;//总页数
-                        if (totalPage == 0) totalPage = 1;
-                        else totalPage = (int)Math.Ceiling((double)totalPage);
-
-                        List<Res_LocalGuideData> ListData = new List<Res_LocalGuideData>();
-                        for (int i = 0; i < dto.PageSize; i++)
-                        {
-                            var RowIndex = i + (dto.PageIndex - 1) * dto.PageSize;
-                            if (RowIndex < LocalGuideData.Count)
-                            {
-                                ListData.Add(LocalGuideData[RowIndex]);
-                            }
-                            else
-                            {
-                                break;
-                            }
-                        }
-                        return result = new Result()
-                        {
-                            Code = 0,
-                            Msg = "查询成功",
-                            Data = new { pageCount = count, totalPage = (int)totalPage, pageIndex = dto.PageIndex, pageSize = dto.PageSize, pageSource = ListData },
-                        };
-                    }
-
+                        Code = 0,
+                        Msg = "查询成功",
+                        Data = localGuideDatas,
+                    };
                 }
-                else if (dto.PortType == 2)
+                else
                 {
-                    string sql = string.Format(@"select * from Res_LocalGuideData {0}", sqlWhere);
-                    List<Res_LocalGuideData> LocalGuideData = await _sqlSugar.SqlQueryable<Res_LocalGuideData>(sql).ToListAsync();
-                    //2024-05-11 修改,取消该判断,避免前端报错
-                    //if (LocalGuideData.Count == 0)
-                    //{
-                    //    return result = new Result() { Code = 0, Msg = "暂无数据" };
-                    //}
-                    LocalGuideData = LocalGuideData.OrderByDescending(x => x.CreateTime).ToList();
 
-                    if (dto.PageSize == 0 && dto.PageIndex == 0)
-                    {
-                        return result = new Result()
-                        {
-                            Code = 0,
-                            Msg = "查询成功",
-                            Data = LocalGuideData,
-                        };
-                    }
-                    else
-                    {
-                        int count = LocalGuideData.Count;
-                        float totalPage = (float)count / dto.PageSize;//总页数
-                        if (totalPage == 0) totalPage = 1;
-                        else totalPage = (int)Math.Ceiling((double)totalPage);
+                    int totalItems = localGuideDatas.Count();
+                    int totalPages = (int)Math.Ceiling((double)totalItems / pageSize);
+                    int skip = (pageIndex - 1) * pageSize;
 
-                        List<Res_LocalGuideData> ListData = new List<Res_LocalGuideData>();
-                        for (int i = 0; i < dto.PageSize; i++)
-                        {
-                            var RowIndex = i + (dto.PageIndex - 1) * dto.PageSize;
-                            if (RowIndex < LocalGuideData.Count)
-                            {
-                                ListData.Add(LocalGuideData[RowIndex]);
-                            }
-                            else
-                            {
-                                break;
-                            }
-                        }
-                        return result = new Result()
-                        {
-                            Code = 0,
-                            Msg = "查询成功",
-                            Data = new { pageCount = count, totalPage = (int)totalPage, pageIndex = dto.PageIndex, pageSize = dto.PageSize, pageSource = ListData },
-                        };
-                    }
-                }
-                else if (dto.PortType == 3)
-                {
-                    string sql = string.Format(@"select Id,UnitArea,UnitName,Contact,ContactTel,Score,LastUpdate from Res_LocalGuideData {0}", sqlWhere);
-                    List<Res_LocalGuideData> LocalGuideData = await _sqlSugar.SqlQueryable<Res_LocalGuideData>(sql).ToListAsync();
-                    if (LocalGuideData.Count == 0)
-                    {
-                        return result = new Result() { Code = 0, Msg = "暂无数据" };
-                    }
-                    LocalGuideData = LocalGuideData.OrderByDescending(x => x.CreateTime).ToList();
+                    var pageSource = localGuideDatas.Skip(skip).Take(pageSize).ToList();
 
-                    if (dto.PageSize == 0 && dto.PageIndex == 0)
-                    {
-                        return result = new Result()
-                        {
-                            Code = 0,
-                            Msg = "查询成功",
-                            Data = LocalGuideData,
-                        };
-                    }
-                    else
-                    {
-                        int count = LocalGuideData.Count;
-                        float totalPage = (float)count / dto.PageSize;//总页数
-                        if (totalPage == 0) totalPage = 1;
-                        else totalPage = (int)Math.Ceiling((double)totalPage);
+                    foreach (var item in pageSource) EncryptionProcessor.DecryptProperties(item); ;
 
-                        List<Res_LocalGuideData_ListItemView> ListData = new List<Res_LocalGuideData_ListItemView>();
-                        for (int i = 0; i < dto.PageSize; i++)
-                        {
-                            var RowIndex = i + (dto.PageIndex - 1) * dto.PageSize;
-                            if (RowIndex < LocalGuideData.Count)
-                            {
-                                Res_LocalGuideData_ListItemView temp = new Res_LocalGuideData_ListItemView()
-                                {
-                                    Contact = LocalGuideData[RowIndex].Contact,
-                                    ContactTel = LocalGuideData[RowIndex].ContactTel,
-                                    Id = LocalGuideData[RowIndex].Id,
-                                    Score = LocalGuideData[RowIndex].Score,
-                                    UnitArea = LocalGuideData[RowIndex].UnitArea,
-                                    UnitName = LocalGuideData[RowIndex].UnitName
-                                };
-                                temp.LastUpdateStr = LocalGuideData[RowIndex].CreateTime.ToString("yyyy-MM-dd");
+                    var pageSoure1 = _mapper.Map<Res_LocalGuideData_ListItemView>(pageSource);
 
-                                ListData.Add(temp);
-                            }
-                            else
-                            {
-                                break;
-                            }
-                        }
-                        return result = new Result()
-                        {
-                            Code = 0,
-                            Msg = "查询成功",
-                            Data = new { pageCount = count, totalPage = (int)totalPage, pageIndex = dto.PageIndex, pageSize = dto.PageSize, pageSource = ListData },
-                        };
-                    }
-                }
-                else
-                {
-                    return result = new Result() { Code = -2, Msg = "请传入PortType参数!1:Web,2:Android,3:IOS" };
+                    return result = new Result()
+                    {
+                        Code = 0,
+                        Msg = "查询成功",
+                        Data = new { pageCount = totalItems, totalPage = pageSource, pageIndex = dto.PageIndex, pageSize = dto.PageSize, pageSource = pageSoure1 },
+                    };
                 }
             }
-            catch (Exception)
-            {
-                return result;
-                throw;
-            }
 
+            return result = new Result() { Code = -2, Msg = "请传入PortType参数!1:Web,2:Android,3:IOS" };
         }
 
     }

+ 40 - 29
OASystem/OASystem.Infrastructure/Repositories/Resource/MediaSuppliersRepository.cs

@@ -8,6 +8,8 @@ using AutoMapper;
 using OASystem.Domain.Dtos.Resource;
 using EyeSoft.Extensions;
 using OASystem.Domain;
+using OASystem.Domain.ViewModels.Resource;
+using OASystem.Domain.AesEncryption;
 
 namespace OASystem.Infrastructure.Repositories.Resource
 {
@@ -33,7 +35,10 @@ namespace OASystem.Infrastructure.Repositories.Resource
         {
             var result = new JsonView() { Code = 400, Msg = "操作失败" };
 
-            var typeData = await _sqlSugar.Queryable<Sys_SetData>().Where(x => x.IsDel == 0 && x.STid == 21).Select(x => new { x.Id, Text = x.Name }).ToListAsync();
+            var typeData = await _sqlSugar.Queryable<Sys_SetData>()
+                .Where(x => x.IsDel == 0 && x.STid == 21)
+                .Select(x => new { x.Id, Text = x.Name })
+                .ToListAsync();
             result.Code = 200;
             result.Data = typeData;
             return result;
@@ -54,26 +59,28 @@ namespace OASystem.Infrastructure.Repositories.Resource
 
             var info = await _sqlSugar.Queryable<Res_MediaSuppliers>()
                 .Where(x => x.IsDel == 0 && x.Id == dto.Id)
-                .Select(x => new
+                .Select(x => new MediaSupplierInfoView()
                 {
-                    x.Id,
-                    x.TypeId,
-                    x.Privince,
-                    x.City,
-                    x.UnitName,
-                    x.UnitAbbreviation,
-                    x.UnitAddress,
-                    x.Contact,
-                    x.Sex,
-                    x.Post,
-                    x.Fax,
-                    x.Tel,
-                    x.Email,
-                    x.WeChat,
-                    x.Remark
+                    Id = x.Id,
+                    TypeId = x.TypeId,
+                    Privince = x.Privince,
+                    City = x.City,
+                    UnitName = x.UnitName,
+                    UnitAbbreviation = x.UnitAbbreviation,
+                    UnitAddress = x.UnitAddress,
+                    Contact = x.Contact,
+                    Sex = x.Sex,
+                    Post = x.Post,
+                    Fax = x.Fax,
+                    Tel = x.Tel,
+                    Email = x.Email,
+                    WeChat = x.WeChat,
+                    Remark = x.Remark
                 })
                 .FirstAsync();
 
+            EncryptionProcessor.DecryptProperties(info);
+
             result.Code = 200;
             result.Data = info;
             result.Msg = MsgTips.Succeed;
@@ -91,7 +98,6 @@ namespace OASystem.Infrastructure.Repositories.Resource
 
             if (!_portIds.Contains(dto.PortType)) { result.Msg = MsgTips.Port; return result; }
 
-
             var typeLabel = new List<int>();
             if (!string.IsNullOrEmpty(dto.TypeLabel))
             {
@@ -106,7 +112,7 @@ namespace OASystem.Infrastructure.Repositories.Resource
                                .ToList();
             }
 
-            var search = dto.Search;
+            var search = AesEncryptionHelper.Encrypt(dto.Search);
             RefAsync<int> total = 0;
             var infos = await _sqlSugar.Queryable<Res_MediaSuppliers>()
                 .LeftJoin<Sys_Users>((ms, u) => ms.CreateUserId == u.Id)
@@ -114,21 +120,23 @@ namespace OASystem.Infrastructure.Repositories.Resource
                 .WhereIF(typeLabel.Count > 0 , (ms, u) => typeLabel.Contains(ms.TypeId))
                 .WhereIF(!string.IsNullOrEmpty(search), (ms, u) => ms.UnitName.Contains(search) || ms.Contact.Contains(search) || ms.Tel.Contains(search))
                 .OrderByDescending((ms, u) => ms.CreateTime)
-                .Select((ms, u) => new
+                .Select((ms, u) => new PageItemView()
                 {
-                    ms.Id,
-                    ms.Privince,
-                    ms.City,
-                    ms.UnitName,
-                    ms.Contact,
-                    ms.Sex,
-                    ms.Post,
-                    ms.Tel,
+                    Id = ms.Id,
+                    Privince = ms.Privince,
+                    City = ms.City,
+                    UnitName = ms.UnitName,
+                    Contact = ms.Contact,
+                    Sex = ms.Sex,
+                    Post = ms.Post,
+                    Tel = ms.Tel,
                     CreateUserName = u.CnName,
-                    ms.CreateTime
+                    CreateTime = ms.CreateTime
                 })
                 .ToPageListAsync(dto.PageIndex, dto.PageSize, total);
 
+            foreach (var info in infos) EncryptionProcessor.DecryptProperties(info);
+
             result.Msg = MsgTips.Succeed;
             result.Code = 200;
             result.Data = infos;
@@ -151,6 +159,9 @@ namespace OASystem.Infrastructure.Repositories.Resource
 
             var info = _mapper.Map<Res_MediaSuppliers>(dto);
             info.CreateUserId = userId;
+
+            EncryptionProcessor.DecryptProperties(info);
+
             if (info.Id < 1) //添加
             {
                 var add = await _sqlSugar.Insertable(info).ExecuteCommandAsync();