Przeglądaj źródła

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

yuanrf 1 dzień temu
rodzic
commit
cbc567a4d4
19 zmienionych plików z 973 dodań i 1094 usunięć
  1. 23 37
      OASystem/OASystem.Api/Controllers/AuthController.cs
  2. 18 18
      OASystem/OASystem.Api/Controllers/BaiduOCRController.cs
  3. 29 30
      OASystem/OASystem.Api/Controllers/BusinessController.cs
  4. 0 1
      OASystem/OASystem.Api/Controllers/CRMController.cs
  5. 14 15
      OASystem/OASystem.Api/Controllers/CallbackController.cs
  6. 220 220
      OASystem/OASystem.Api/Controllers/FinancialController.cs
  7. 417 436
      OASystem/OASystem.Api/Controllers/GroupsController.cs
  8. 0 63
      OASystem/OASystem.Api/HealthChecks/ExampleHealthCheck.cs
  9. 3 52
      OASystem/OASystem.Api/Program.cs
  10. 14 1
      OASystem/OASystem.Domain/ViewModels/CRM/VisaDeleClientView.cs
  11. 47 1
      OASystem/OASystem.Infrastructure/Repositories/CRM/VisaDeleClientRepository.cs
  12. 37 40
      OASystem/OASystem.Infrastructure/Repositories/Financial/PaymentRefundAndOtherMoneyRepository.cs
  13. 0 1
      OASystem/OASystem.Infrastructure/Repositories/Groups/AirTicketResRepository.cs
  14. 36 41
      OASystem/OASystem.Infrastructure/Repositories/Groups/CustomersRepository.cs
  15. 25 35
      OASystem/OASystem.Infrastructure/Repositories/Groups/EnterExitCostDraftRepository.cs
  16. 20 21
      OASystem/OASystem.Infrastructure/Repositories/Groups/EnterExitCostRepository.cs
  17. 36 46
      OASystem/OASystem.Infrastructure/Repositories/Groups/HotelPriceRepository.cs
  18. 27 35
      OASystem/OASystem.Infrastructure/Repositories/Groups/InvitationOfficialActivitiesRepository.cs
  19. 7 1
      OASystem/OASystem.Infrastructure/Repositories/Groups/TourClientListRepository.cs

+ 23 - 37
OASystem/OASystem.Api/Controllers/AuthController.cs

@@ -1,30 +1,17 @@
 
-using OASystem.Infrastructure.Repositories.Login;
-using System.IdentityModel.Tokens.Jwt;
-using System.Security.Claims;
-using OASystem.Domain.Dtos.UserDto;
-using OASystem.API.OAMethodLib;
-using Serilog.Parsing;
-using OASystem.Domain.Dtos.System;
-using System.Drawing.Drawing2D;
-using System.Collections;
-using OASystem.API.OAMethodLib.JuHeAPI;
-using OASystem.API.OAMethodLib.QiYeWeChatAPI;
-using OASystem.Domain.Dtos.QiYeWeChat;
-using OASystem.Domain.Entities.System;
-using TinyPinyin;
-using System.Globalization;
 using Microsoft.AspNetCore.SignalR;
-using OASystem.API.OAMethodLib.Hub.Hubs;
+using OASystem.API.OAMethodLib;
 using OASystem.API.OAMethodLib.Hub.HubClients;
-using static OASystem.API.OAMethodLib.Hub.Hubs.ChatHub;
-using static OASystem.API.OAMethodLib.JWTHelper;
-using OASystem.Domain.Entities.Groups;
-using OASystem.Domain.Entities.Customer;
-using static QRCoder.PayloadGenerator.SwissQrCode;
+using OASystem.API.OAMethodLib.Hub.Hubs;
+using OASystem.API.OAMethodLib.QiYeWeChatAPI;
 using OASystem.Domain.AesEncryption;
-using Microsoft.Extensions.Configuration;
 using OASystem.Domain.Attributes;
+using OASystem.Domain.Dtos.UserDto;
+using OASystem.Domain.Entities.Customer;
+using OASystem.Domain.Entities.Groups;
+using OASystem.Infrastructure.Repositories.Login;
+using System.IdentityModel.Tokens.Jwt;
+using static OASystem.API.OAMethodLib.JWTHelper;
 
 namespace OASystem.API.Controllers
 {
@@ -104,7 +91,7 @@ namespace OASystem.API.Controllers
                 {
                     if (noLoginAuth.Contains(userInfo.CnName)) return Ok(JsonView(false, "NO ACCESS!!"));
                 }
-                
+
                 //其他市场部人员 限制登录时间段
                 var currentDateTime = DateTime.Now;
                 var startTime = DateTime.Parse(_config["ApiAccessTime:StartTime"]);
@@ -135,8 +122,8 @@ namespace OASystem.API.Controllers
             //_hubContext.Login(uId, uName);
             var view = new LoginView
             {
-                UserInfo = userData == null ? null : userData.Data,
-                AuthData = authData == null ? null : authData.Data,
+                UserInfo = userData?.Data,
+                AuthData = authData?.Data,
                 UnReadCount = unReadCount,
                 AnnouncementUnReadCount = announcementUnReadCount
             };
@@ -236,8 +223,8 @@ namespace OASystem.API.Controllers
             //_hubContext.Login(uId, uName);
             var view = new LoginView
             {
-                UserInfo = userData == null ? null : userData.Data,
-                AuthData = authData == null ? null : authData.Data,
+                UserInfo = userData?.Data,
+                AuthData = authData?.Data,
                 UnReadCount = unReadCount,
                 AnnouncementUnReadCount = announcementUnReadCount
             };
@@ -313,7 +300,7 @@ namespace OASystem.API.Controllers
 
             var companyDetails = _loginRep._sqlSugar.SqlQueryable<CompanyDetailsView>(sql).ToList();
 
-            List<CompanyDetailsView1> detailsView1 = new List<CompanyDetailsView1>();
+            var detailsView1 = new List<CompanyDetailsView1>();
 
             if (companyDetails.Count > 0)
             {
@@ -322,22 +309,21 @@ namespace OASystem.API.Controllers
 
                 detailsView1 = companyDetails1.Select(it =>
                 {
-                    CompanyDetailsView1 itemCompany = new CompanyDetailsView1();
-                    List<DepDetailsView> depDetailsView = new List<DepDetailsView>();
+                    var itemCompany = new CompanyDetailsView1();
+                    var depDetailsView = new List<DepDetailsView>();
 
                     var companyDetails2 = companyDetails.GroupBy(it => it.DepId).Select(it => it.First()).ToList();
                     //部门
                     depDetailsView = companyDetails2.Where(depIt => depIt.CompanyId == it.CompanyId).Select(depIt =>
                     {
 
-                        DepDetailsView depDetails = new DepDetailsView();
-                        List<JobDetailsView> jobDetails = new List<JobDetailsView>();
+                        var depDetails = new DepDetailsView();
+                        var jobDetails = new List<JobDetailsView>();
 
                         //岗位
                         jobDetails = companyDetails.Where(jobIt => jobIt.DepId == depIt.DepId).Select(jobIt =>
                         {
-
-                            JobDetailsView jobDetail = new JobDetailsView()
+                            var jobDetail = new JobDetailsView()
                             {
                                 JobId = jobIt.JobId,
                                 JobName = jobIt.JobName,
@@ -915,7 +901,7 @@ namespace OASystem.API.Controllers
         {
             var _sqlsugar = _loginRep._sqlSugar;
             var groups = await _sqlsugar.Queryable<Grp_DelegationInfo>()
-                .Where(x => x.IsDel == 0 && x.VisitDate >= Convert.ToDateTime("2024-01-01") && x.VisitDate<= Convert.ToDateTime("2024-12-31"))
+                .Where(x => x.IsDel == 0 && x.VisitDate >= Convert.ToDateTime("2024-01-01") && x.VisitDate <= Convert.ToDateTime("2024-12-31"))
                 .Select(x => new { x.Id, x.TeamName, x.ClientUnit, x.ClientName, x.VisitDate })
                 .ToListAsync();
 
@@ -929,7 +915,7 @@ namespace OASystem.API.Controllers
             foreach (var group in groups)
             {
                 var clientName = group.ClientName;
-                var clientInfo = newClients.Find(x => !string.IsNullOrEmpty(clientName) && !string.IsNullOrEmpty(x.Contact) &&  clientName.Contains(x.Contact));
+                var clientInfo = newClients.Find(x => !string.IsNullOrEmpty(clientName) && !string.IsNullOrEmpty(x.Contact) && clientName.Contains(x.Contact));
                 if (clientInfo != null)
                 {
                     datas.Add(new NewClientInfo()
@@ -943,7 +929,7 @@ namespace OASystem.API.Controllers
                         Phone = clientInfo?.Phone ?? "",
                     });
                 }
-               
+
             }
 
             datas = datas.OrderBy(x => x.VisitDate).ToList();

+ 18 - 18
OASystem/OASystem.Api/Controllers/BaiduOCRController.cs

@@ -45,7 +45,7 @@ namespace OASystem.API.Controllers
                 return Ok(JsonView("请上传图片base64编码数据!"));
             }
 
-            JsonView jw = new JsonView();
+            var jw = new JsonView();
             try
             {
                 string api_Response = BaiduApiHelper._apiTableV2(dto.base64img);
@@ -65,16 +65,16 @@ namespace OASystem.API.Controllers
                     List<BaiduOCR_TableV2> dataList = sourceList.Where(s => s.row_start != 0).ToList();
                     int maxRowIndex = dataList.Max(s => s.row_start);
                     int maxColIndex = headerList.Max(s => s.col_start) + 1;
-                    Dictionary<int, string> dicHeader = new Dictionary<int, string>();
-                    List<string> listNameStr = new List<string>() { "姓名", "name", "姓 名" };
-                    List<string> listSexStr = new List<string>() { "性别", "gender", "sex" };
-                    List<string> listDOBStr = new List<string>() { "D.O.B", "出生年月", "生日", "出生日期", "出生年月日" };
-                    List<string> listIdCard = new List<string>() { "身份证号码", "身份证", "身份证号" };
-                    List<string> listOrganizationStr = new List<string>() { "工作单位", "organization", "单位", "所在单位" };
-                    List<string> listJobStr = new List<string>() { "职务", "title", "职位", "所在单位及职务", "单位及职务", "职务或职称" };
-                    List<string> listMobileStr = new List<string>() { "联系电话", "mobile" };
-                    List<string> listAgeStr = new List<string>() { "年龄", "age" };
-                    List<string> listBeiZhu = new List<string>() { "备注", "本团职务" };
+                    var dicHeader = new Dictionary<int, string>();
+                    var listNameStr = new List<string>() { "姓名", "name", "姓 名" };
+                    var listSexStr = new List<string>() { "性别", "gender", "sex" };
+                    var listDOBStr = new List<string>() { "D.O.B", "出生年月", "生日", "出生日期", "出生年月日" };
+                    var listIdCard = new List<string>() { "身份证号码", "身份证", "身份证号" };
+                    var listOrganizationStr = new List<string>() { "工作单位", "organization", "单位", "所在单位" };
+                    var listJobStr = new List<string>() { "职务", "title", "职位", "所在单位及职务", "单位及职务", "职务或职称" };
+                    var listMobileStr = new List<string>() { "联系电话", "mobile" };
+                    var listAgeStr = new List<string>() { "年龄", "age" };
+                    var listBeiZhu = new List<string>() { "备注", "本团职务" };
 
 
                     try
@@ -195,10 +195,10 @@ namespace OASystem.API.Controllers
                         }
                     }
 
-                    List<BaiduClientOCRView> ClientArr = new List<BaiduClientOCRView>();
+                    var ClientArr = new List<BaiduClientOCRView>();
                     for (int i = 1; i <= maxRowIndex; i++)
                     {
-                        BaiduClientOCRView client = new BaiduClientOCRView();
+                        var client = new BaiduClientOCRView();
                         for (int j = 0; j < maxColIndex; j++)
                         {
                             var item = dataList.First(s => s.row_start == i && s.col_start == j);
@@ -238,7 +238,7 @@ namespace OASystem.API.Controllers
                                 }
                                 else
                                 {
-                                    Regex regForeign = new Regex("[a-zA-Z]+[\\s][a-zA-Z]+");
+                                    var regForeign = new Regex("[a-zA-Z]+[\\s][a-zA-Z]+");
                                     if (regForeign.IsMatch(words))
                                     {
                                         string[] names = words.Split(' ');
@@ -258,7 +258,7 @@ namespace OASystem.API.Controllers
                             else if (values.Equals("DOB"))
                             {
                                 client.Birthday = words.Replace(".", "-");
-                                DateTime time = new DateTime();
+                                var time = new DateTime();
                                 if (DateTime.TryParse(client.Birthday, out time))
                                 {
                                     client.Birthday = time.ToString("yyyy-MM-dd");
@@ -314,12 +314,12 @@ namespace OASystem.API.Controllers
                 }
                 else if (json["error_code"] != null)
                 {
-                    jw.Data = new string[0];
+                    jw.Data = Array.Empty<string>();
                     jw.Msg = "百度接口异常!";
                 }
                 else
                 {
-                    jw.Data = new string[0];
+                    jw.Data = Array.Empty<string>();
                     jw.Msg = "百度接口异常!";
                 }
             }
@@ -327,7 +327,7 @@ namespace OASystem.API.Controllers
             {
                 jw.Code = 400;
                 jw.Msg = "程序异常!" + ex.Message;
-                jw.Data = new string[0];
+                jw.Data = Array.Empty<string>();
             }
 
             return Ok(jw);

+ 29 - 30
OASystem/OASystem.Api/Controllers/BusinessController.cs

@@ -102,7 +102,7 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> PostGroupDirectionalClassificationInit()
         {
-            Result result = new Result();
+            var result = new Result();
             result = await _setDataRep.GetSetDataBySTId(_setDataRep, 16); //团组指向分类
             if (result.Code != 0)
             {
@@ -111,26 +111,26 @@ namespace OASystem.API.Controllers
 
             List<SetDataInfoView> _view1 = JsonConvert.DeserializeObject<List<SetDataInfoView>>(JsonConvert.SerializeObject(result.Data));
 
-            SetDataInfoView xc_view = new SetDataInfoView();//77	行程 //移除行程
+            var xc_view = new SetDataInfoView();//77	行程 //移除行程
             xc_view = _view1.Where(it => it.Id == 77).FirstOrDefault();
             if (xc_view != null) { _view1.Remove(xc_view); };
 
-            List<SetDataInfoView> _view = new List<SetDataInfoView>();
+           var _view = new List<SetDataInfoView>();
             //_view.Insert(0, new SetDataInfoView { Id = -1, Name = "所有模块" });
 
-            SetDataInfoView qz_view = new SetDataInfoView();//80	签证
+            var qz_view = new SetDataInfoView();//80	签证
             qz_view = _view1.Where(it => it.Id == 80).FirstOrDefault();
             if (qz_view != null) { _view.Insert(0, qz_view); _view1.Remove(qz_view); };
 
-            SetDataInfoView jpyd_view = new SetDataInfoView();//85	机票预订
+            var jpyd_view = new SetDataInfoView();//85	机票预订
             jpyd_view = _view1.Where(it => it.Id == 85).FirstOrDefault();
             if (jpyd_view != null) { _view.Insert(1, jpyd_view); _view1.Remove(jpyd_view); };
 
-            SetDataInfoView jdyd_view = new SetDataInfoView();//76	酒店预订
+            var jdyd_view = new SetDataInfoView();//76	酒店预订
             jdyd_view = _view1.Where(it => it.Id == 76).FirstOrDefault();
             if (jdyd_view != null) { _view.Insert(2, jdyd_view); _view1.Remove(jdyd_view); };
 
-            SetDataInfoView jdzc_view = new SetDataInfoView();//751	酒店早餐
+            var jdzc_view = new SetDataInfoView();//751	酒店早餐
             jdzc_view = _view1.Where(it => it.Id == 751).FirstOrDefault();
             if (jdzc_view != null)
             {
@@ -138,25 +138,30 @@ namespace OASystem.API.Controllers
                 //_view.Insert(3, jdzc_view); _view1.Remove(jdzc_view);
             };
 
-            SetDataInfoView cdy_view = new SetDataInfoView();//79	车/导游地接
+            var cdy_view = new SetDataInfoView();//79	车/导游地接
             cdy_view = _view1.Where(it => it.Id == 79).FirstOrDefault();
-            if (cdy_view != null) { _view.Insert(3, cdy_view); _view1.Remove(cdy_view); };
+            if (cdy_view != null) { _view.Insert(3, cdy_view); _view1.Remove(cdy_view); }
+            ;
 
-            SetDataInfoView yqgw_view = new SetDataInfoView();//81	邀请/公务活动
+            var yqgw_view = new SetDataInfoView();//81	邀请/公务活动
             yqgw_view = _view1.Where(it => it.Id == 81).FirstOrDefault();
-            if (yqgw_view != null) { _view.Insert(4, yqgw_view); _view1.Remove(yqgw_view); };
+            if (yqgw_view != null) { _view.Insert(4, yqgw_view); _view1.Remove(yqgw_view); }
+            ;
 
-            SetDataInfoView bx_view = new SetDataInfoView();//82	团组客户保险
+            var bx_view = new SetDataInfoView();//82	团组客户保险
             bx_view = _view1.Where(it => it.Id == 82).FirstOrDefault();
-            if (bx_view != null) { _view.Insert(5, bx_view); _view1.Remove(bx_view); };
+            if (bx_view != null) { _view.Insert(5, bx_view); _view1.Remove(bx_view); }
+            ;
 
-            SetDataInfoView qtkx_view = new SetDataInfoView();//98	其他款项
+            var qtkx_view = new SetDataInfoView();//98	其他款项
             qtkx_view = _view1.Where(it => it.Id == 98).FirstOrDefault();
-            if (qtkx_view != null) { _view.Insert(6, qtkx_view); _view1.Remove(qtkx_view); };
+            if (qtkx_view != null) { _view.Insert(6, qtkx_view); _view1.Remove(qtkx_view); }
+            ;
 
-            SetDataInfoView skth_view = new SetDataInfoView();//285	收款退还与其他款项
+            var skth_view = new SetDataInfoView();//285	收款退还与其他款项
             skth_view = _view1.Where(it => it.Id == 285).FirstOrDefault();
-            if (skth_view != null) { _view.Insert(7, skth_view); _view1.Remove(skth_view); };
+            if (skth_view != null) { _view.Insert(7, skth_view); _view1.Remove(skth_view); }
+            ;
 
             if (_view1.Count > 0)
             {
@@ -311,8 +316,8 @@ namespace OASystem.API.Controllers
 
                 if (dto.PageId == 0) return Ok(JsonView(false, "页面Id不能为0!"));
 
-                List<CTableCorrelationPageDatas> data = AppSettingsHelper.Get<CTableCorrelationPageDatas>("CTableCorrelationPageDatas");
-                CTableCorrelationPageDatas correlationPageDatas = new CTableCorrelationPageDatas();
+                var data = AppSettingsHelper.Get<CTableCorrelationPageDatas>("CTableCorrelationPageDatas");
+                var correlationPageDatas = new CTableCorrelationPageDatas();
 
                 foreach (var item in data)
                 {
@@ -351,14 +356,8 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> PostConferenceList()
         {
-            List<Grp_DelegationInfo> listSource = _busRep.Query<Grp_DelegationInfo>(s => s.TeamDid == 691 && s.IsDel == 0).ToList();
-            List<GroupNameView> viewList = new List<GroupNameView>();
-            foreach (var group in listSource)
-            {
-                GroupNameView _view = new GroupNameView();
-                _view.Id = group.Id;
-                _view.GroupName = group.TeamName;
-            }
+            var listSource = _busRep.Query<Grp_DelegationInfo>(s => s.TeamDid == 691 && s.IsDel == 0).ToList();
+            var viewList = listSource.Select(x => new GroupNameView() { Id = x.Id,GroupName=x.TeamName }).ToList();
 
             return Ok(JsonView(viewList));
         }
@@ -372,7 +371,7 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> PostConfItemList(int ConfId)
         {
-            Bus_ConfItemListView view = new Bus_ConfItemListView();
+            var view = new Bus_ConfItemListView();
 
             Bus_ConfItemListInfo _confListInfo = await _busRep.Query<Bus_ConfItemListInfo>(s => s.Diid == ConfId).FirstAsync();
             if (_confListInfo != null)
@@ -546,7 +545,7 @@ Where c.ConfListId = {0}", ConfId);
         {
             try
             {
-                Crm_TableOperationRecord _TableOperationRecord = new Crm_TableOperationRecord()
+                var _TableOperationRecord = new Crm_TableOperationRecord()
                 {
                     TableName = _dto.TableName,
                     PortType = _dto.PortType,
@@ -630,7 +629,7 @@ Where c.ConfListId = {0}", ConfId);
                 return Ok(jw);
             }
 
-            List<string> values = new List<string>();
+            var values = new List<string>();
             foreach (var item in dto.originalText)
             {
                 var val = item.GetTotalPingYin();

+ 0 - 1
OASystem/OASystem.Api/Controllers/CRMController.cs

@@ -240,7 +240,6 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> DelCustomerCerts(DelBaseDto dto)
         {
-
             var result = await _customerCertRep.SoftDeleteByIdAsync<Crm_CustomerCert>(dto.Id.ToString(), dto.DeleteUserId);
             if (!result)
             {

+ 14 - 15
OASystem/OASystem.Api/Controllers/CallbackController.cs

@@ -34,12 +34,14 @@ namespace OASystem.API.Controllers
         public async Task<ActionResult> ApproveCallBack(string msg_signature, string timestamp, string nonce, string echostr)
         {
             _logger.LogInformation("【企业微信】【通讯录助手】【回调】进入回调");
-            ApproveCallBackInputDTO input = new ApproveCallBackInputDTO();
-            input.msg_signature = msg_signature;
-            input.timestamp = timestamp;
-            input.nonce = nonce;
-            input.echostr = echostr;
-            _logger.LogInformation("【企业微信】【通讯录助手】【回调】【参数】" + input.ToJson());
+            var input = new ApproveCallBackInputDTO
+            {
+                msg_signature = msg_signature,
+                timestamp = timestamp,
+                nonce = nonce,
+                echostr = echostr
+            };
+            _logger.LogInformation("【企业微信】【通讯录助手】【回调】【参数】:{Input}", input.ToJson());
             if (HttpContext.Request.Method == System.Net.Http.HttpMethod.Get.Method)
             {
                 var model = await VerifyURLCallBack(input);
@@ -61,18 +63,17 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         private async Task<string> VerifyURLCallBack(ApproveCallBackInputDTO input)
         {
-            int ret = 0;
             string sEchoStr = "";
             try
             {
                 //企业微信官方加解密校验解析类
-                Tencent.WXBizMsgCrypt wxcpt = new Tencent.WXBizMsgCrypt(_qiYeWechat_Token, _qiYeWechat_EncodingAESKey, _qiYeWechat_CorpId);
+                var wxcpt = new Tencent.WXBizMsgCrypt(_qiYeWechat_Token, _qiYeWechat_EncodingAESKey, _qiYeWechat_CorpId);
                 string sReqMsgSig = input.msg_signature;
                 string sReqTimeStamp = input.timestamp;
                 string sReqNonce = input.nonce;
                 string sReqEchostr = input.echostr;
                 //企业微信官方验证URL
-                ret = wxcpt.VerifyURL(sReqMsgSig, sReqTimeStamp, sReqNonce, sReqEchostr, ref sEchoStr);
+                var ret = wxcpt.VerifyURL(sReqMsgSig, sReqTimeStamp, sReqNonce, sReqEchostr, ref sEchoStr);
                 if (ret != 0)
                 {
                     throw new Exception($"ERR: VerifyURL fail, ret: {ret}");
@@ -81,6 +82,7 @@ namespace OASystem.API.Controllers
             }
             catch (Exception ex)
             {
+                _logger.LogError(ex, "【企业微信】【通讯录助手】【回调】验证URL失败");
                 return ex.Message;
             }
         }
@@ -92,12 +94,11 @@ namespace OASystem.API.Controllers
         private async Task<string> ApproveCallBack(Stream context, ApproveCallBackInputDTO input)
         {
             var sReqData = "";
-            int ret = 0;
             string sMsg = "";
             try
             {
                 //企业微信官方加解密校验解析类
-                Tencent.WXBizMsgCrypt wxcpt = new Tencent.WXBizMsgCrypt(_qiYeWechat_Token, _qiYeWechat_EncodingAESKey, _qiYeWechat_CorpId);
+                var wxcpt = new Tencent.WXBizMsgCrypt(_qiYeWechat_Token, _qiYeWechat_EncodingAESKey, _qiYeWechat_CorpId);
                 string sReqMsgSig = input.msg_signature;
                 string sReqTimeStamp = input.timestamp;
                 string sReqNonce = input.nonce;
@@ -109,7 +110,7 @@ namespace OASystem.API.Controllers
                 }
                 //回调数据
                 // 解析之后的明文
-                ret = wxcpt.DecryptMsg(sReqMsgSig, sReqTimeStamp, sReqNonce, sReqData, ref sMsg);
+                var ret = wxcpt.DecryptMsg(sReqMsgSig, sReqTimeStamp, sReqNonce, sReqData, ref sMsg);
                 if (ret != 0)
                 {
                     throw new Exception($"ERR: Decrypt Fail, ret: {ret}");
@@ -120,12 +121,10 @@ namespace OASystem.API.Controllers
             }
             catch (Exception ex)
             {
+                _logger.LogError(ex, "【企业微信】【通讯录助手】【回调】解密失败");
                 throw new Exception(ex.Message);
             }
         }
-
-
-
         #endregion
     }
 }

Plik diff jest za duży
+ 220 - 220
OASystem/OASystem.Api/Controllers/FinancialController.cs


Plik diff jest za duży
+ 417 - 436
OASystem/OASystem.Api/Controllers/GroupsController.cs


+ 0 - 63
OASystem/OASystem.Api/HealthChecks/ExampleHealthCheck.cs

@@ -1,63 +0,0 @@
-using Microsoft.Extensions.Diagnostics.HealthChecks;
-
-namespace OASystem.API.HealthChecks
-{
-    public class ExampleHealthCheck : IHealthCheck
-    {
-        public Task<HealthCheckResult> CheckHealthAsync(
-            HealthCheckContext context,
-            CancellationToken cancellationToken = default)
-        {
-            // Here you would check the health of your dependencies
-            // For example, check database connection, external services, etc.
-            var isHealthy = true; // Replace with actual health check logic
-
-            if (isHealthy)
-            {
-                return Task.FromResult(
-                    HealthCheckResult.Healthy("A healthy result."));
-            }
-
-            return Task.FromResult(
-                new HealthCheckResult(
-                    context.Registration.FailureStatus, "An unhealthy result."));
-        }
-    }
-
-    public class DatabaseHealthCheck : IHealthCheck
-    {
-        public async Task<HealthCheckResult> CheckHealthAsync(
-            HealthCheckContext context,
-            CancellationToken cancellationToken = default)
-        {
-            try
-            {
-                // 模拟数据库检查
-                await Task.Delay(100, cancellationToken);
-                return HealthCheckResult.Healthy("Database is OK");
-            }
-            catch (Exception ex)
-            {
-                return HealthCheckResult.Unhealthy("Database failure", ex);
-            }
-        }
-    }
-
-    public class ApiHealthCheck : IHealthCheck
-    {
-        private readonly HttpClient _httpClient;
-
-        public ApiHealthCheck(HttpClient httpClient) => _httpClient = httpClient;
-
-        public async Task<HealthCheckResult> CheckHealthAsync(
-            HealthCheckContext context,
-            CancellationToken cancellationToken = default)
-        {
-            var response = await _httpClient.GetAsync("ping", cancellationToken);
-            return response.IsSuccessStatusCode
-                ? HealthCheckResult.Healthy("API is responsive")
-                : HealthCheckResult.Degraded($"API response: {response.StatusCode}");
-        }
-    }
-
-}

+ 3 - 52
OASystem/OASystem.Api/Program.cs

@@ -1,10 +1,7 @@
-using HealthChecks.UI.Client;
-using Microsoft.AspNetCore.Diagnostics.HealthChecks;
 using Microsoft.AspNetCore.Http.Connections;
 using Microsoft.AspNetCore.Http.Features;
 using Microsoft.AspNetCore.Server.Kestrel.Core;
 using Microsoft.Extensions.DependencyInjection.Extensions;
-using OASystem.API.HealthChecks;
 using OASystem.API.Middlewares;
 using OASystem.API.OAMethodLib;
 using OASystem.API.OAMethodLib.AMapApi;
@@ -19,6 +16,7 @@ using Quartz.Impl;
 using Quartz.Spi;
 using QuzrtzJob.Factory;
 using Serilog.Events;
+using System.Diagnostics;
 
 Console.Title = $"FMGJ OASystem Server";
 var builder = WebApplication.CreateBuilder(args);
@@ -341,25 +339,6 @@ Log.Logger = new LoggerConfiguration()
 builder.Host.UseSerilog();
 #endregion
 
-#region 健康检查服务
-
-//// Add health checks
-//builder.Services.AddHealthChecks()
-//    .AddCheck<ExampleHealthCheck>("example_health_check")
-//    .AddCheck<DatabaseHealthCheck>("database")
-//    .AddCheck<ApiHealthCheck>("external_api",
-//        tags: new[] { "infrastructure" });
-
-//builder.Services.AddHealthChecksUI(options =>
-//{
-//    options.AddHealthCheckEndpoint("API", "/health");
-//    options.AddHealthCheckEndpoint("External Service", "https://other-service/health"); // 外部服务
-//}).AddInMemoryStorage();
-
-//builder.Services.AddEndpointsApiExplorer();
-
-#endregion
-
 #region 引入注册Autofac Module
 builder.Host.UseServiceProviderFactory(new AutofacServiceProviderFactory());
 var hostBuilder = builder.Host.ConfigureContainer<ContainerBuilder>(builder =>
@@ -440,8 +419,6 @@ var app = builder.Build();
 //自定义异常中间件
 app.UseMiddleware<ExceptionHandlingMiddleware>();
 
-
-
 //serilog日志 请求中间管道
 app.UseSerilogRequestLogging(options =>
 {
@@ -564,36 +541,10 @@ app.MapHub<ChatHub>("/ChatHub", options =>
 
 #endregion
 
-#region 配置健康检查端点
-
-//app.MapHealthChecks("/health", new HealthCheckOptions
-//{
-//    ResponseWriter = async (context, report) =>
-//    {
-//        var result = new
-//        {
-//            Status = report.Status.ToString(),
-//            Checks = report.Entries.Select(e => new {
-//                Name = e.Key,
-//                Status = e.Value.Status.ToString(),
-//                Description = e.Value.Description
-//            }),
-//            Duration = report.TotalDuration
-//        };
-//        await context.Response.WriteAsJsonAsync(result);
-//    }
-//});
-
-//// 健康检查UI仪表板(可视化界面)
-//app.MapHealthChecksUI(options =>
-//{
-//    options.UIPath = "/health-ui"; // 访问路径
-//    options.ApiPath = "/health-ui-api"; // API路径(供UI前端调用)
-//});
-#endregion
-
 app.MapControllerRoute(
     name: "default",
     pattern: "{controller=Home}/{action=Index}/{id?}");
 
+
+
 app.Run();

+ 14 - 1
OASystem/OASystem.Domain/ViewModels/CRM/VisaDeleClientView.cs

@@ -107,5 +107,18 @@ namespace OASystem.Domain.ViewModels.CRM
         public string IdNo { get; set; }
     }
 
-   
+
+
+    #region 签证客户资料 New
+
+
+    #region 新西兰、澳大利亚签证申请资料表
+
+
+    #endregion
+
+
+
+    #endregion
+
 }

+ 47 - 1
OASystem/OASystem.Infrastructure/Repositories/CRM/VisaDeleClientRepository.cs

@@ -26,6 +26,7 @@ namespace OASystem.Infrastructure.Repositories.CRM
     public class VisaDeleClientRepository : BaseRepository<Crm_DeleClient, VisaDeleClientView>
     {
         private readonly IMapper _mapper;
+        private readonly JsonView _jv = new() { Code = StatusCodes.Status400BadRequest, Msg = "操作失败!" };
         public VisaDeleClientRepository(SqlSugarClient sqlSugar,IMapper mapper) :
             base(sqlSugar)
         {
@@ -72,7 +73,6 @@ namespace OASystem.Infrastructure.Repositories.CRM
             return result;
         }
 
-
         /// <summary>
         /// 签证客户操作
         /// </summary>
@@ -510,5 +510,51 @@ namespace OASystem.Infrastructure.Repositories.CRM
             }
             return result;
         }
+
+
+        #region 签证客户资料 New 2025-06-04
+
+
+        #region 新西兰、澳大利亚签证申请
+        /// <summary>
+        /// 新西兰、澳大利亚签证申请资料表 Add
+        /// </summary>
+        /// <returns></returns>
+        public async Task<JsonView> AddTemp1()
+        {
+
+
+            return _jv;
+        }
+        #endregion
+
+
+
+        /// <summary>
+        /// 通过kimi api 获取签证申请资料并操作
+        /// </summary>
+        /// <returns></returns>
+        public async Task<JsonView> KIMIAPIOP()
+        {
+            return _jv;
+        }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+        #endregion
     }
 }

+ 37 - 40
OASystem/OASystem.Infrastructure/Repositories/Financial/PaymentRefundAndOtherMoneyRepository.cs

@@ -1,28 +1,19 @@
 using AutoMapper;
-using Newtonsoft.Json;
-using NPOI.SS.Formula.Functions;
 using OASystem.Domain;
 using OASystem.Domain.Dtos;
 using OASystem.Domain.Dtos.Financial;
-using OASystem.Domain.Dtos.UserDto;
 using OASystem.Domain.Entities.Financial;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.ViewModels.Financial;
 using OASystem.Infrastructure.Repositories.Groups;
 using OASystem.Infrastructure.Repositories.System;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Security.Cryptography;
-using System.Text;
-using System.Threading.Tasks;
 
 namespace OASystem.Infrastructure.Repositories.Financial
 {
     /// <summary>
     /// 财务 - 收款退还与其他款项
     /// </summary>
-    public class PaymentRefundAndOtherMoneyRepository:BaseRepository<Fin_PaymentRefundAndOtherMoney, Fin_PaymentRefundAndOtherMoneyView>
+    public class PaymentRefundAndOtherMoneyRepository : BaseRepository<Fin_PaymentRefundAndOtherMoney, Fin_PaymentRefundAndOtherMoneyView>
     {
         private readonly IMapper _mapper;
         private readonly Result _result;
@@ -48,7 +39,7 @@ namespace OASystem.Infrastructure.Repositories.Financial
         /// </summary>
         /// <param name="diId"></param>
         /// <returns></returns>
-        public async Task<Result> _ItemByDiId(int diId)
+        public async Task<Result> ItemByDiId(int diId)
         {
             string sql = string.Format(@"Select prom.Id,prom.PriceName,prom.Price,sd.Name As CurrencyCode,
 					                     prom.Remark,u.CnName As CreateUserName,prom.CreateTime,ccp.IsAuditGM,
@@ -76,9 +67,10 @@ namespace OASystem.Infrastructure.Repositories.Financial
         /// </summary>
         /// <param name="diId"></param>
         /// <returns></returns>
-        public async Task<Result> _Del(PaymentRefundAndOtherMoneyDelDto dto)
+        public async Task<Result> Del(PaymentRefundAndOtherMoneyDelDto dto)
         {
-            Fin_PaymentRefundAndOtherMoney _PaymentRefundAndOtherMoney = new Fin_PaymentRefundAndOtherMoney() { 
+            var _PaymentRefundAndOtherMoney = new Fin_PaymentRefundAndOtherMoney()
+            {
                 Id = dto.Id,
                 DeleteUserId = dto.UserId,
                 DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
@@ -86,18 +78,17 @@ namespace OASystem.Infrastructure.Repositories.Financial
             };
 
             _sqlSugar.BeginTran();
-            var prom_del = await _sqlSugar.Updateable( _PaymentRefundAndOtherMoney )
-                                     .UpdateColumns(it => new { it.DeleteUserId,it.DeleteTime,it.IsDel })
-                                     .WhereColumns(it => new { it.Id})
+            var prom_del = await _sqlSugar.Updateable(_PaymentRefundAndOtherMoney)
+                                     .UpdateColumns(it => new { it.DeleteUserId, it.DeleteTime, it.IsDel })
+                                     .WhereColumns(it => new { it.Id })
                                      .ExecuteCommandAsync();
 
-
-            Fin_PaymentRefundAndOtherMoney _PaymentRefundAndOtherMoneyInfo = new Fin_PaymentRefundAndOtherMoney();
-            _PaymentRefundAndOtherMoneyInfo = await _sqlSugar.Queryable<Fin_PaymentRefundAndOtherMoney>().Where(it => it.Id == dto.Id).FirstAsync();
+            var _PaymentRefundAndOtherMoneyInfo = await _sqlSugar.Queryable<Fin_PaymentRefundAndOtherMoney>().Where(it => it.Id == dto.Id).FirstAsync();
 
             if (_PaymentRefundAndOtherMoneyInfo != null)
             {
-                Grp_CreditCardPayment _CreditCardPayment = new Grp_CreditCardPayment() {
+                var _CreditCardPayment = new Grp_CreditCardPayment()
+                {
                     CId = _PaymentRefundAndOtherMoneyInfo.Id,
                     DIId = _PaymentRefundAndOtherMoneyInfo.DiId,
                     DeleteUserId = dto.UserId,
@@ -108,11 +99,11 @@ namespace OASystem.Infrastructure.Repositories.Financial
 
                 var ccp_del = await _sqlSugar.Updateable(_CreditCardPayment)
                                      .UpdateColumns(it => new { it.DeleteUserId, it.DeleteTime, it.IsDel })
-                                     .WhereColumns(it => new { it.CId,it.DIId })
+                                     .WhereColumns(it => new { it.CId, it.DIId })
                                      .ExecuteCommandAsync();
             }
 
-            if (prom_del > 0 )
+            if (prom_del > 0)
             {
                 _result.Code = 0;
                 _result.Msg = "操作成功!";
@@ -125,29 +116,33 @@ namespace OASystem.Infrastructure.Repositories.Financial
             _sqlSugar.CommitTran();
             return _result;
         }
-        
+
         /// <summary>
         /// 详情 数据源
         /// </summary>
         /// <param name="diId"></param>
         /// <returns></returns>
-        public async Task<Result> _InfoDataSource(PortDtoBase dto)
+        public async Task<Result> InfoDataSource(PortDtoBase dto)
         {
             if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3)  //1 Web 2 Android 3 Ios
             {
 
-                var  setDatas = _sqlSugar.Queryable<Sys_SetData>().Where(it => it.IsDel == 0).ToList();
+                var setDatas = _sqlSugar.Queryable<Sys_SetData>().Where(it => it.IsDel == 0).ToList();
                 dynamic _currencyData = null, _payTypeData = null;
                 _currencyData = setDatas.Where(it => it.STid == 66).Select(it => new { it.Id, it.Name, it.Remark }); //币种类型
                 _payTypeData = setDatas.Where(it => it.STid == 14).Select(it => new { it.Id, it.Name, it.Remark }); //支付类型
 
-                List<dynamic> _priceTypeDatas = new List<dynamic>();
-                _priceTypeDatas.Add(new { Id = 0, Name = "其他", Remark = "" });
-                _priceTypeDatas.Add(new { Id = 1, Name = "退多付款", Remark = "" });
+                var _priceTypeDatas = new List<dynamic>
+                {
+                    new { Id = 0, Name = "其他", Remark = "" },
+                    new { Id = 1, Name = "退多付款", Remark = "" }
+                };
 
-                List<dynamic> _orbitalPrivateTransferDatas = new List<dynamic>();
-                _orbitalPrivateTransferDatas.Add(new { Id = 0, Name = "公转", Remark = "" });
-                _orbitalPrivateTransferDatas.Add(new { Id = 1, Name = "私转", Remark = "" });
+                var _orbitalPrivateTransferDatas = new List<dynamic>
+                {
+                    new { Id = 0, Name = "公转", Remark = "" },
+                    new { Id = 1, Name = "私转", Remark = "" }
+                };
 
                 dynamic _InfoDataSource = new
                 {
@@ -174,10 +169,10 @@ namespace OASystem.Infrastructure.Repositories.Financial
         /// </summary>
         /// <param name="diId"></param>
         /// <returns></returns>
-        public async Task<JsonView> _Info(PaymentRefundAndOtherMoneyInfoDto dto)
+        public async Task<JsonView> Info(PaymentRefundAndOtherMoneyInfoDto dto)
         {
             var _view = new JsonView() { Code = StatusCodes.Status204NoContent };
-           
+
             if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3)  //1 Web 2 Android 3 Ios
             {
                 var data = await _sqlSugar.Queryable<Fin_PaymentRefundAndOtherMoney>()
@@ -220,13 +215,14 @@ namespace OASystem.Infrastructure.Repositories.Financial
         /// </summary>
         /// <param name="diId"></param>
         /// <returns></returns>
-        public async Task<JsonView> _AddOrEdit(PaymentRefundAndOtherMoneyAddOrEditDto dto)
+        public async Task<JsonView> AddOrEdit(PaymentRefundAndOtherMoneyAddOrEditDto dto)
         {
             var _view = new JsonView() { Code = StatusCodes.Status204NoContent };
             if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3)  //1 Web 2 Android 3 Ios
             {
                 #region 参数处理
-                Fin_PaymentRefundAndOtherMoney _PaymentRefundAndOtherMoney = new Fin_PaymentRefundAndOtherMoney() { 
+                var _PaymentRefundAndOtherMoney = new Fin_PaymentRefundAndOtherMoney()
+                {
                     //Id = dto.Id,
                     DiId = dto.DiId,
                     PriceName = dto.PriceName.Trim(),
@@ -235,7 +231,7 @@ namespace OASystem.Infrastructure.Repositories.Financial
                     PayType = dto.PayType,
                     //PriceType = dto.PriceType,
                     CreateUserId = dto.UserId,
-                    Remark = dto.Remark 
+                    Remark = dto.Remark
                 };
 
                 //处理团组汇率
@@ -281,7 +277,8 @@ namespace OASystem.Infrastructure.Repositories.Financial
                 int ispay = 0;
                 if (dto.PayDId == 72) ispay = 1;
 
-                Grp_CreditCardPayment _CreditCardPayment = new Grp_CreditCardPayment() {
+                var _CreditCardPayment = new Grp_CreditCardPayment()
+                {
                     //Id = dto.CcpId,
                     //CId = dto.CcpId,
                     DIId = dto.DiId,
@@ -356,7 +353,7 @@ WHERE
   AND ccp.IsDel = 0
   AND ccp.DIId = prom.DiId
   AND ccp.DIId = {0}
-  AND prom.PriceName = '{1}'", _PaymentRefundAndOtherMoney.DiId,_PaymentRefundAndOtherMoney.PriceName);
+  AND prom.PriceName = '{1}'", _PaymentRefundAndOtherMoney.DiId, _PaymentRefundAndOtherMoney.PriceName);
                     //var data = await _sqlSugar.SqlQueryable<Fin_PaymentRefundAndOtherMoneyInfoView>(sql).FirstAsync();
 
                     //if (data != null)
@@ -364,7 +361,7 @@ WHERE
                     //    _view.Msg = "费用名称已存在,请勿重新添加!";
                     //    return _view;
                     //}
-                   
+
                     #endregion
 
                     _sqlSugar.BeginTran();
@@ -424,7 +421,7 @@ WHERE
                                                        it.OrbitalPrivateTransfer,
                                                        it.OtherSideNo,
                                                        it.OtherBankName
-                                                       
+
                                                    })
                                                    .WhereColumns(it => new { it.Id })
                                                    .ExecuteCommandAsync();

+ 0 - 1
OASystem/OASystem.Infrastructure/Repositories/Groups/AirTicketResRepository.cs

@@ -995,7 +995,6 @@ namespace OASystem.Infrastructure.Repositories.Groups
         }
         public  string Processing(string str)//处理这段英文的方法
         {
-
             if (string.IsNullOrEmpty(str)) { return ""; }
 
             string[] strArray;

+ 36 - 41
OASystem/OASystem.Infrastructure/Repositories/Groups/CustomersRepository.cs

@@ -1,5 +1,4 @@
 using AutoMapper;
-using NPOI.POIFS.Crypt.Dsig;
 using OASystem.Domain;
 using OASystem.Domain.AesEncryption;
 using OASystem.Domain.Dtos.Financial;
@@ -7,16 +6,8 @@ using OASystem.Domain.Dtos.Groups;
 using OASystem.Domain.Entities.Customer;
 using OASystem.Domain.Entities.Financial;
 using OASystem.Domain.Entities.Groups;
-using OASystem.Domain.ViewModels.Financial;
 using OASystem.Domain.ViewModels.Groups;
-using OASystem.Domain.ViewModels.QiYeWeChat;
 using OASystem.Infrastructure.Tools;
-using SqlSugar;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 
 namespace OASystem.Infrastructure.Repositories.Groups
 {
@@ -38,10 +29,10 @@ namespace OASystem.Infrastructure.Repositories.Groups
         /// <returns></returns>
         public async Task<Result> CustomersByDiId(CustomersByDiIdDto dto)
         {
-            Result result = new Result() { Code = -2, Msg = "未知错误" };
-           
+            var result = new Result() { Code = -2, Msg = "未知错误" };
+
             string UserId = "";
-            List<Grp_GroupsTaskAssignment> gtaUIdList = _sqlSugar.Queryable<Grp_GroupsTaskAssignment>().Where(a => a.DIId == dto.DiId && a.IsDel == 0 && a.CTId == 82).ToList();
+            var gtaUIdList = _sqlSugar.Queryable<Grp_GroupsTaskAssignment>().Where(a => a.DIId == dto.DiId && a.IsDel == 0 && a.CTId == 82).ToList();
             foreach (Grp_GroupsTaskAssignment gta in gtaUIdList)
                 UserId += gta.UId + ",";
 
@@ -71,10 +62,10 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                 var parseIntValue = 0;
                 var CrmIds = (from item in Customers
-                                where item.ClientName.Contains(",") || int.TryParse(item.ClientName, out parseIntValue)
-                                select item.ClientName).ToList();
+                              where item.ClientName.Contains(",") || int.TryParse(item.ClientName, out parseIntValue)
+                              select item.ClientName).ToList();
                 var strCrmIds = string.Join(',', CrmIds);
-                List<Crm_DeleClient> clietArr = new List<Crm_DeleClient>();
+                var clietArr = new List<Crm_DeleClient>();
                 if (!string.IsNullOrWhiteSpace(strCrmIds))
                 {
                     sql = string.Format("SELECT * FROM Crm_DeleClient cdc where id in ({0}) and IsDel  = 0", strCrmIds);
@@ -152,10 +143,10 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                 var parseIntValue = 0;
                 var CrmIds = (from item in Customers
-                                where item.ClientName.Contains(",") || int.TryParse(item.ClientName, out parseIntValue)
-                                select item.ClientName).ToList();
+                              where item.ClientName.Contains(",") || int.TryParse(item.ClientName, out parseIntValue)
+                              select item.ClientName).ToList();
                 var strCrmIds = string.Join(',', CrmIds);
-                List<Crm_DeleClient> clietArr = new List<Crm_DeleClient>();
+                var clietArr = new List<Crm_DeleClient>();
                 if (!string.IsNullOrWhiteSpace(strCrmIds))
                 {
                     sql = string.Format("SELECT * FROM Crm_DeleClient cdc where id in ({0}) and IsDel  = 0", strCrmIds);
@@ -183,7 +174,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         var name = string.Empty;
                         var i = 0;
 
-                        while (i < splitArr.Count())
+                        while (i < splitArr.Length)
                         {
                             if (int.TryParse(splitArr[i], out parseIntValue))
                             {
@@ -193,7 +184,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                             i++;
 
-                            if (i < splitArr.Count())
+                            if (i < splitArr.Length)
                             {
                                 name += "[*TuT*]";
                             }
@@ -235,11 +226,13 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 if (totalPage == 0) totalPage = 1;
                 else totalPage = (int)Math.Ceiling((double)totalPage);
 
-                ListViewBase<CustomersView> rst = new ListViewBase<CustomersView>();
-                rst.DataList = Customers;
-                rst.DataCount = count;
-                rst.CurrPageIndex = dto.PageIndex;
-                rst.CurrPageSize = dto.PageSize;
+                var rst = new ListViewBase<CustomersView>
+                {
+                    DataList = Customers,
+                    DataCount = count,
+                    CurrPageIndex = dto.PageIndex,
+                    CurrPageSize = dto.PageSize
+                };
                 return result = new Result() { Code = 0, Msg = "查询成功!", Data = rst };
 
             }
@@ -247,12 +240,12 @@ namespace OASystem.Infrastructure.Repositories.Groups
             {
                 return result = new Result() { Code = -2, Msg = "请传入PortType参数,1 Web 2 Android 3 IOS" };
             }
-           
+
         }
 
         public async Task<Result> CustomersById(CustomersByIdDto dto)
         {
-            Result result = new Result() { Code = -2, Msg = "未知错误" };
+            var result = new Result() { Code = -2, Msg = "未知错误" };
             try
             {
                 Grp_Customers grp_Customers = _sqlSugar.Queryable<Grp_Customers>().First(a => a.Id == dto.Id && a.IsDel == 0);
@@ -313,11 +306,9 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
         public async Task<Result> CustomersInitialize(CustomersInitializeDto dto)
         {
-            Result result = new Result() { Code = -2, Msg = "未知错误" };
+            var result = new Result() { Code = -2, Msg = "未知错误" };
             try
             {
-
-
                 List<Sys_SetData> Payment = _sqlSugar.Queryable<Sys_SetData>().Where(a => a.STid == 14 && a.IsDel == 0).ToList();
                 List<SetDataInfoView> _Payment = _mapper.Map<List<SetDataInfoView>>(Payment);
 
@@ -327,13 +318,15 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                 //保险名称
                 List<Grp_InsuranceCost> _InsuranceCosts = _sqlSugar.Queryable<Grp_InsuranceCost>().Where(a => a.IsDel == 0).ToList();
-                List<InsuranceCostView> insuranceCostViews = new List<InsuranceCostView>();
+                var insuranceCostViews = new List<InsuranceCostView>();
                 foreach (var item in _InsuranceCosts)
                 {
-                    InsuranceCostView costView = new InsuranceCostView();
-                    costView.Id = item.Id;
-                    costView.GName = item.GName;
-                    costView.Balance = 0.00M;
+                    var costView = new InsuranceCostView
+                    {
+                        Id = item.Id,
+                        GName = item.GName,
+                        Balance = 0.00M
+                    };
                     string CountSql = string.Format(@"select sum(InsuranceCosts) as CountCost from Grp_Customers where isdel=0 and Iid=" + item.Id);
                     DataCountCost dataCount = _sqlSugar.SqlQueryable<DataCountCost>(CountSql).First();
                     costView.Balance = Math.Round(item.RechargeCost - dataCount.CountCost, 2);
@@ -341,10 +334,12 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 }
 
                 //币种
-                GeneralTeamRateInfoDto PostGroupTeamRatedto = new GeneralTeamRateInfoDto();
-                PostGroupTeamRatedto.DiId = dto.DiId;
-                PostGroupTeamRatedto.CTable = 82;
-                PostGroupTeamRatedto.PortType = dto.PortType;
+                var  PostGroupTeamRatedto = new GeneralTeamRateInfoDto()
+                {
+                    DiId = dto.DiId,
+                    CTable = 82,
+                    PortType = dto.PortType
+                };
 
                 var _teamRate = await _teamRateRep.PostGroupTeamRateItemByDiIdAndCTableId(dto.PortType, dto.DiId, 82);
 
@@ -368,7 +363,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
         public async Task<Result> OpCustomers(OpCustomersDto dto)
         {
-            Result result = new Result() { Code = -2, Msg = "未知错误" };
+            var result = new Result() { Code = -2, Msg = "未知错误" };
 
             BeginTran();
             int id = dto.Id;
@@ -389,7 +384,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
             c.RMBPrice = cus.InsuranceCosts;
             c.DayRate = 1;
             Grp_TeamRate _TeamRate = _sqlSugar.Queryable<Grp_TeamRate>().First(a => a.DiId == dto.DiId && a.IsDel == 0 && a.CTable == 82);
-            List<CurrencyInfo> currencyInfos = new List<CurrencyInfo>();
+            var currencyInfos = new List<CurrencyInfo>();
             if (_TeamRate != null)
             {
                 Sys_SetData _SetData = _sqlSugar.Queryable<Sys_SetData>().First(a => a.IsDel == 0 && a.Id == cus.Currency);

+ 25 - 35
OASystem/OASystem.Infrastructure/Repositories/Groups/EnterExitCostDraftRepository.cs

@@ -1,17 +1,10 @@
 using AutoMapper;
-using EyeSoft.Collections.Generic;
 using OASystem.Domain;
 using OASystem.Domain.Dtos.Groups;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.ViewModels.Groups;
 using OASystem.Infrastructure.Repositories.System;
 using OASystem.Infrastructure.Tools;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Threading.Tasks;
 
 namespace OASystem.Infrastructure.Repositories.Groups
 {
@@ -36,7 +29,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
         /// <returns></returns>
         public async Task<List<PermissionViewUserview>> PermissionViewUsersAsync()
         {
-           // 添加市场部人员
+            // 添加市场部人员
             var viewPermissionData = await _sqlSugar.Queryable<Sys_Users>()
                 .LeftJoin<Sys_Department>((u, d) => u.DepId == d.Id)
                 .Where((u, d) => u.IsDel == 0 && u.HrAudit == 1 && d.DepName.Equals("市场部"))
@@ -115,27 +108,24 @@ namespace OASystem.Infrastructure.Repositories.Groups
             /*
              * 市场部 朱姝 默认添加贵州、重庆、云南的出入境费用查看权限
              */
-            if (currUserId == 380)
-            {
-                var cityPerm = new List<string>()
+            var cityPerm = new List<string>()
                 {
                     "贵州", "重庆", "云南"
                 };
-                var draftInfo = await _sqlSugar.Queryable<Grp_EnterExitCostDraft>().FirstAsync(x => x.Id == draftId && x.IsDel == 0);
-                if (draftInfo != null)
+            var draftInfo = await _sqlSugar.Queryable<Grp_EnterExitCostDraft>().FirstAsync(x => x.Id == draftId && x.IsDel == 0);
+            if (draftInfo != null)
+            {
+                //1.通过团组名称判断是否包含城市
+                if (cityPerm.Any(x => draftInfo.DraftName.Contains(x)))
                 {
-                    //1.通过团组名称判断是否包含城市
-                    if (cityPerm.Any(x => draftInfo.DraftName.Contains(x)))
-                    {
-                        feeBasePermIds.Add(currUserId);
-                    }
-                    //2.通过城市Id判断是否包含城市
-                    else
-                    {
-                        var draftProvince = await _sqlSugar.Queryable<Sys_Cities>()
-                                .FirstAsync(x => x.Id == draftInfo.ProvinceId && cityPerm.Contains(x.Name_CN) && x.IsDel == 0);
-                        if (draftProvince != null) feeBasePermIds.Add(currUserId);
-                    }
+                    feeBasePermIds.Add(380);
+                }
+                //2.通过城市Id判断是否包含城市
+                else
+                {
+                    var draftProvince = await _sqlSugar.Queryable<Sys_Cities>()
+                            .FirstAsync(x => x.Id == draftInfo.ProvinceId && cityPerm.Contains(x.Name_CN) && x.IsDel == 0);
+                    if (draftProvince != null) feeBasePermIds.Add(380);
                 }
             }
 
@@ -171,7 +161,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
         public async Task<(bool, bool)> PermissionValidationAsync(int darftId, int userId, int permission = 1)
         {
             //参数验证
-            if (darftId < 1) return (false,false);
+            if (darftId < 1) return (false, false);
             var permissionIds = new List<int>() { 1, 2, 3, 4, 5 };
             if (!permissionIds.Contains(permission)) return (false, false);
 
@@ -191,9 +181,9 @@ namespace OASystem.Infrastructure.Repositories.Groups
             var info = await _sqlSugar.Queryable<Grp_EnterExitCostDraftPermission>()
                 .Where(it => it.DraftId == darftId && it.UserId == userId && it.Permission == permission)
                 .FirstAsync();
-            if (info != null) return(true, false);
+            if (info != null) return (true, false);
 
-            return  (false, false);
+            return (false, false);
         }
 
         /// <summary>
@@ -209,7 +199,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
             var enterExitCostInfoView = new EnterExitCostDraftInfoView();
 
-            if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3) 
+            if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3)
             {
                 if (enterExitCostDraftData != null)
                 {
@@ -308,7 +298,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
         /// <returns></returns>
         public async Task<Result> EnterExitCostDraftOp(EnterExitCostDraftOpDto dto)
         {
-            Result result = new Result() { Code = -1, Msg = "操作失败!" };
+            var result = new Result() { Code = -1, Msg = "操作失败!" };
 
             if (dto.SumJJC == 0) dto.OutsideJJPay = 0;
             if (dto.SumGWC == 0) dto.OutsideGWPay = 0;
@@ -355,7 +345,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     if (isNull != null) //修改
                     {
                         enterExitId = isNull.Id;
-                        (bool viewPerm,bool assignPerm)  = await PermissionValidationAsync(enterExitCost.Id, dto.UserId);
+                        (bool viewPerm, bool assignPerm) = await PermissionValidationAsync(enterExitCost.Id, dto.UserId);
                         if (!viewPerm)
                         {
                             _sqlSugar.RollbackTran();
@@ -389,7 +379,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         dto.DayOtherPriceData.Select(x => { x.Id = 0; return x; }).ToList();
 
                         //初始化权限(查看、编辑)
-                        await InitPerm(enterExitId,dto.UserId);
+                        await InitPerm(enterExitId, dto.UserId);
                     }
 
                     if (enterExitId > 0)
@@ -425,7 +415,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                                     SetDataId = x.SetDataId,
                                     SubTotal = x.SubTotal,
                                     Remark = x.Remark,
-                                    
+
                                 })
                                 .ToList();
                             var updateList1 = dto.DayOtherPriceData
@@ -481,7 +471,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
         /// <returns></returns>
         public async Task<Result> EnterExitCostDraftSubItemDel(EnterExitCostDraftSubItemDelDto dto)
         {
-            Result result = new Result();
+            var result = new Result();
 
             var data = new Grp_DayAndCostDraft()
             {
@@ -509,7 +499,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
         /// <returns></returns>
         public async Task<Result> OneClickEmpty(int id, int userId)
         {
-            Result result = new Result() { Code = -1, Msg = "操作成功!" };
+            var result = new Result() { Code = -1, Msg = "操作成功!" };
 
             if (id < 1) return result = new Result() { Code = -1, Msg = "请传入有效的Id参数!" };
             if (userId < 1) return result = new Result() { Code = -1, Msg = "请传入有效的UserId参数!" };

+ 20 - 21
OASystem/OASystem.Infrastructure/Repositories/Groups/EnterExitCostRepository.cs

@@ -121,34 +121,33 @@ namespace OASystem.Infrastructure.Repositories.Groups
             /*
              * 市场部 朱姝 默认添加贵州、重庆、云南的出入境费用查看权限
              */
-            if (currUserId == 380)
+
+            var cityPerm = new List<string>()
+            {
+                "贵州", "重庆", "云南"
+            };
+            var groupInfo = await _sqlSugar.Queryable<Grp_DelegationInfo>().FirstAsync(x => x.Id == groupId && x.IsDel == 0);
+            if (groupInfo != null)
             {
-                var cityPerm = new List<string>()
+                //1.通过团组名称判断是否包含城市
+                if (cityPerm.Any(x => groupInfo.TeamName.Contains(x)))
                 {
-                    "贵州", "重庆", "云南"
-                };
-                var groupInfo = await _sqlSugar.Queryable<Grp_DelegationInfo>().FirstAsync(x => x.Id == groupId && x.IsDel == 0);
-                if (groupInfo != null)
+                    feeBasePermIds.Add(380);
+                }
+                //2.通过城市Id判断是否包含城市
+                else 
                 {
-                    //1.通过团组名称判断是否包含城市
-                    if (cityPerm.Any(x => groupInfo.TeamName.Contains(x)))
+                    var groupCity = await _sqlSugar.Queryable<Sys_Cities>().FirstAsync(x => x.Id == groupInfo.CityId && x.IsDel == 0);
+                    if (groupCity != null)
                     {
-                        feeBasePermIds.Add(currUserId);
+                        var groupProvince = await _sqlSugar.Queryable<Sys_Cities>()
+                            .FirstAsync(x => x.Id == groupCity.ParentId && cityPerm.Contains(x.Name_CN) && x.IsDel == 0);
+                        if (groupProvince != null) feeBasePermIds.Add(380);
                     }
-                    //2.通过城市Id判断是否包含城市
-                    else 
-                    {
-                        var groupCity = await _sqlSugar.Queryable<Sys_Cities>().FirstAsync(x => x.Id == groupInfo.CityId && x.IsDel == 0);
-                        if (groupCity != null)
-                        {
-                            var groupProvince = await _sqlSugar.Queryable<Sys_Cities>()
-                                .FirstAsync(x => x.Id == groupCity.ParentId && cityPerm.Contains(x.Name_CN) && x.IsDel == 0);
-                            if (groupProvince != null) feeBasePermIds.Add(currUserId);
-                        }
-                    }    
-                }
+                }    
             }
 
+
             if (feeBasePermIds.Any())
             {
                 var permissions = new List<Grp_EnterExitCostPermission>();

+ 36 - 46
OASystem/OASystem.Infrastructure/Repositories/Groups/HotelPriceRepository.cs

@@ -1,26 +1,11 @@
 using AutoMapper;
-using MathNet.Numerics.Statistics.Mcmc;
-using MySqlX.XDevAPI.Common;
-using NPOI.SS.Formula.Functions;
 using OASystem.Domain;
-using OASystem.Domain.Dtos.Financial;
 using OASystem.Domain.Dtos.Groups;
 using OASystem.Domain.Dtos.Resource;
-using OASystem.Domain.Entities.Financial;
 using OASystem.Domain.Entities.Groups;
-using OASystem.Domain.ViewModels.Financial;
 using OASystem.Domain.ViewModels.Groups;
 using OASystem.Infrastructure.Repositories.Resource;
 using OASystem.Infrastructure.Tools;
-using Org.BouncyCastle.Asn1.Ocsp;
-using SqlSugar;
-using StackExchange.Redis;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using static NPOI.HSSF.Util.HSSFColor;
 using Result = OASystem.Domain.Result;
 
 namespace OASystem.Infrastructure.Repositories.Groups
@@ -33,8 +18,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
         private readonly TeamRateRepository _teamRateRep;
         private readonly TourClientListRepository _tourClientListRep;
         private readonly HotelDataRepository _hotelDataRep;
-        public HotelPriceRepository(SqlSugarClient sqlSugar, IMapper mapper, TeamRateRepository teamRateRep, TourClientListRepository tourClientListRep, HotelDataRepository hotelDataRep) 
-            :base(sqlSugar)
+        public HotelPriceRepository(SqlSugarClient sqlSugar, IMapper mapper, TeamRateRepository teamRateRep, TourClientListRepository tourClientListRep, HotelDataRepository hotelDataRep)
+            : base(sqlSugar)
         {
             this._mapper = mapper;
             _result = new Result() { Code = -1, Msg = MsgTips.Fail };
@@ -50,7 +35,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
         /// </summary>
         /// <param name="dto"></param>
         /// <returns></returns>
-        public async Task<JsonView> _ItemsByDiId(int portType,int diId)
+        public async Task<JsonView> ItemsByDiId(int portType, int diId)
         {
 
             string sql = string.Format(@"Select row_number() over(order by hr.CheckInDate asc) as Row_Number,
@@ -87,7 +72,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
         /// </summary>
         /// <param name="dto"></param>
         /// <returns></returns>
-        public async Task<JsonView> _BasicsDataInit(int portType, int diId)
+        public async Task<JsonView> BasicsDataInit(int portType, int diId)
         {
             List<Sys_SetData> _dataSouruce = await _sqlSugar.Queryable<Sys_SetData>().Where(a => a.IsDel == 0).ToListAsync();
 
@@ -116,7 +101,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 var _teamRateView = await _teamRateRep.PostGroupTeamRateItemByDiIdAndCTableId(portType, diId, 76);
 
                 string _CheckVolumeNo = string.Empty;
-                var checkVoumeNoData = _CreateCheckVolumeNo(diId);
+                var checkVoumeNoData = CreateCheckVolumeNo(diId);
                 if (checkVoumeNoData.Result.Code == 0)
                 {
                     _CheckVolumeNo = checkVoumeNoData.Result.Data;
@@ -127,8 +112,9 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                 //三公国家费用标准
                 var countrys = await _sqlSugar.Queryable<Grp_NationalTravelFee>()
-                    .Where(x => x.IsDel == 0 )
-                    .Select(x => new {
+                    .Where(x => x.IsDel == 0)
+                    .Select(x => new
+                    {
                         x.Id,
                         x.Country,
                         x.City
@@ -164,7 +150,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
         /// </summary>
         /// <param name="DiId"></param>
         /// <returns></returns>
-        public async Task<Result> _CreateCheckVolumeNo(int DiId)
+        public async Task<Result> CreateCheckVolumeNo(int DiId)
         {
             var groupInfo = await _sqlSugar.Queryable<Grp_DelegationInfo>().Where(it => it.Id == DiId && it.IsDel == 0).FirstAsync();
             if (groupInfo != null)
@@ -200,9 +186,9 @@ namespace OASystem.Infrastructure.Repositories.Groups
         /// </summary>
         /// <param name="dto"></param>
         /// <returns></returns>
-        public async Task<JsonView> _Details(int portType, int id)
+        public async Task<JsonView> Details(int portType, int id)
         {
-            if (id < 0 )
+            if (id < 0)
             {
                 _view.Msg = string.Format(@"请输入正确的Id!");
                 return _view;
@@ -263,16 +249,16 @@ namespace OASystem.Infrastructure.Repositories.Groups
         /// Add Or Edit
         /// </summary>
         /// <returns></returns>
-        public async Task<JsonView> _AddOrEdit(HotelReservationsAddOrEditDto _dto)
+        public async Task<JsonView> AddOrEdit(HotelReservationsAddOrEditDto _dto)
         {
             var _view = new JsonView() { Code = 400, Msg = MsgTips.Fail };
             int portType = _dto.PortType;
             if (portType == 1 || portType == 2 || portType == 3)
             {
-                Grp_HotelReservations _HotelReservations = new Grp_HotelReservations();
-                List<Grp_HotelReservationsContent> _HotelReservationsContents = new List<Grp_HotelReservationsContent>();
+                var _HotelReservations = new Grp_HotelReservations();
+                var _HotelReservationsContents = new List<Grp_HotelReservationsContent>();
 
-                Grp_CreditCardPayment _CreditCardPayment = new Grp_CreditCardPayment();
+                var _CreditCardPayment = new Grp_CreditCardPayment();
 
                 #region 参数处理
                 _HotelReservations = _mapper.Map<Grp_HotelReservations>(_dto);
@@ -311,10 +297,11 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                 #endregion
 
-                _HotelReservationsContents.ForEach(it => {
+                _HotelReservationsContents.ForEach(it =>
+                {
                     it.CreateUserId = _dto.UserId;
                     it.DiId = _dto.DiId;
-                    
+
                     it.HrId = _HotelReservations.Id;
 
                     //2025-04-07 第四次更改 PayDId == 72(刷卡) IsPay == 1
@@ -323,7 +310,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     if (!string.IsNullOrEmpty(it.ConsumptionDate))
                     {
                         if (DateTime.TryParse(it.ConsumptionDate, out DateTime dt))
-                        { 
+                        {
                             it.ConsumptionDate = dt.ToString("yyyy-MM-dd");
                         }
                     }
@@ -337,7 +324,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 if (portType == 2 || portType == 3)
                 {
                     string checkNo = string.Empty;
-                    Result checkNoRes = await _CreateCheckVolumeNo(_dto.DiId);
+                    Result checkNoRes = await CreateCheckVolumeNo(_dto.DiId);
                     if (checkNoRes.Code == 0)
                     {
                         checkNo = checkNoRes.Data;
@@ -392,12 +379,13 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         return _view;
                     }
 
-                    _HotelReservationsContents.ForEach(it => {
+                    _HotelReservationsContents.ForEach(it =>
+                    {
                         it.HrId = hotelId;
                     });
 
                     int hotelSubId = await _sqlSugar.Insertable<Grp_HotelReservationsContent>(_HotelReservationsContents).ExecuteReturnIdentityAsync();
-                    if (hotelSubId < 0) 
+                    if (hotelSubId < 0)
                     {
                         _sqlSugar.RollbackTran(); //回滚
                         _view.Msg = "酒店预定详细信息添加失败";
@@ -443,7 +431,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                     _view.Msg = "操作成功!";
                     _view.Code = 200;
-                    _view.Data = new { ccpId = ccpId, sign = 1, hotelId = hotelId };
+                    _view.Data = new { ccpId, sign = 1, hotelId };
                     _sqlSugar.CommitTran(); // 提交
 
                     return _view;
@@ -506,7 +494,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     {
                         int hotelSubUpdate = await _sqlSugar
                             .Updateable<Grp_HotelReservationsContent>(updateHotelSubData)
-                            .IgnoreColumns(it => new {
+                            .IgnoreColumns(it => new
+                            {
                                 it.DiId,
                                 it.HrId,
                                 it.CreateUserId,
@@ -518,7 +507,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                             .ExecuteCommandAsync();
                         if (hotelSubUpdate > 0) hotelSubStatus = true;
                     }
-                    
+
                     if (!hotelSubStatus)
                     {
                         _view.Msg = "酒店预定子表信息修改失败!";
@@ -528,9 +517,9 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                     var hotelInfo = await _sqlSugar
                         .Queryable<Grp_CreditCardPayment>()
-                        .Where(it => it.DIId == _dto.DiId && 
-                                    it.CId == _dto.Id && 
-                                    it.CTable == 76 && 
+                        .Where(it => it.DIId == _dto.DiId &&
+                                    it.CId == _dto.Id &&
+                                    it.CTable == 76 &&
                                     it.IsDel == 0
                         )
                         .FirstAsync();
@@ -573,7 +562,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                     _view.Msg = "操作成功!";
                     _view.Code = 200;
-                    _view.Data = new { ccpId = _CreditCardPayment.Id, sign = 2 ,hotelId = _HotelReservations.Id };
+                    _view.Data = new { ccpId = _CreditCardPayment.Id, sign = 2, hotelId = _HotelReservations.Id };
                     _sqlSugar.CommitTran(); // 提交
                     return _view;
                 }
@@ -590,10 +579,10 @@ namespace OASystem.Infrastructure.Repositories.Groups
         /// Del
         /// </summary>
         /// <returns></returns>
-        public async Task<JsonView> _Del(int id,int userId)
+        public async Task<JsonView> Del(int id, int userId)
         {
             _sqlSugar.BeginTran();
-            Grp_HotelReservations _HotelReservations = new Grp_HotelReservations()
+            var _HotelReservations = new Grp_HotelReservations()
             {
                 Id = id,
                 IsDel = 1,
@@ -612,7 +601,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
             if (hrStatus < 0)
             {
                 _sqlSugar.RollbackTran();
-                return new JsonView() { Code = 400,Msg = MsgTips.Fail };
+                return new JsonView() { Code = 400, Msg = MsgTips.Fail };
             }
 
             int hrSubStatus = await _sqlSugar.Updateable<Grp_HotelReservationsContent>()
@@ -621,7 +610,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
                                              .SetColumns(it => it.DeleteTime == DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"))
                                              .Where(it => it.HrId == id).ExecuteCommandAsync();
 
-            var ccpInfp = new Grp_CreditCardPayment() {
+            var ccpInfp = new Grp_CreditCardPayment()
+            {
                 CId = id,
                 CTable = 76,
                 IsDel = 1,

+ 27 - 35
OASystem/OASystem.Infrastructure/Repositories/Groups/InvitationOfficialActivitiesRepository.cs

@@ -1,23 +1,11 @@
 using AutoMapper;
-using MathNet.Numerics.Statistics.Mcmc;
 using Newtonsoft.Json;
-using NPOI.SS.Formula.Eval;
-using NPOI.SS.Formula.Functions;
 using OASystem.Domain;
 using OASystem.Domain.AesEncryption;
 using OASystem.Domain.Dtos.Groups;
-using OASystem.Domain.Entities.Financial;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.Entities.Resource;
 using OASystem.Domain.ViewModels.Groups;
-using OASystem.Domain.ViewModels.QiYeWeChat;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Security.Cryptography;
-using System.Text;
-using System.Threading.Tasks;
-using static NPOI.HSSF.Util.HSSFColor;
 
 namespace OASystem.Infrastructure.Repositories.Groups
 {
@@ -36,13 +24,13 @@ namespace OASystem.Infrastructure.Repositories.Groups
         /// <returns></returns>
         public async Task<Result> InvitationOfficialActivitiesById(InvitationOfficialActivitiesByIdDto dto)
         {
-            Result result = new Result() { Code = -2, Msg = "程序错误" };
+            var result = new Result() { Code = -2, Msg = "程序错误" };
             try
             {
                 var grp_Invitation = _sqlSugar.Queryable<Grp_InvitationOfficialActivities>().First(a => a.Id == dto.Id && a.IsDel == 0);
-                Grp_CreditCardPayment grp_CreditCard = _sqlSugar.Queryable<Grp_CreditCardPayment>().First(a => a.CId == dto.Id && a.IsDel == 0 && a.CTable==81);
-                Res_InvitationOfficialActivityData res_InvitationOfficialActivityData = new Res_InvitationOfficialActivityData();
-                if (grp_Invitation!=null)
+                var grp_CreditCard = _sqlSugar.Queryable<Grp_CreditCardPayment>().First(a => a.CId == dto.Id && a.IsDel == 0 && a.CTable == 81);
+                var res_InvitationOfficialActivityData = new Res_InvitationOfficialActivityData();
+                if (grp_Invitation != null)
                 {
                     var exists = new EncryptionMatching
                     {
@@ -61,7 +49,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         res_InvitationOfficialActivityData = _sqlSugar.Queryable<Res_InvitationOfficialActivityData>()
                                                                 .First(a => a.Country == exists.InviterArea && a.UnitName == exists.Inviter && a.IsDel == 0);
                     }
-                  
+
                     EncryptionProcessor.DecryptProperties(res_InvitationOfficialActivityData);
                     if (dto.PortType == 1)
                     {
@@ -139,10 +127,10 @@ namespace OASystem.Infrastructure.Repositories.Groups
         /// <returns></returns>
         public async Task<Result> InvitationOfficialActivitiesList(InvitationOfficialActivitiesListDto dto)
         {
-            Result result = new Result() { Code = -2, Msg = "未知错误" };
+            var result = new Result() { Code = -2, Msg = "未知错误" };
             try
             {
-                ListViewBase<InvitationOfficialActivitiesView> rst = new ListViewBase<InvitationOfficialActivitiesView>() { ReceiveDt=DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") };
+                var rst = new ListViewBase<InvitationOfficialActivitiesView>() { ReceiveDt = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") };
                 string sqlWhere = string.Empty;
                 if (!string.IsNullOrWhiteSpace(dto.Inviter))
                 {
@@ -169,13 +157,14 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 sqlWhere += string.Format(@" And i.CreateUserId in ({0})", UserId);
 
                 //雷怡 2024-05-08 16:19 更改默认值 IsPaySign = -1
-                if (dto.IsPaySign != -1) {
+                if (dto.IsPaySign != -1)
+                {
                     sqlWhere += string.Format(@" And ccp.IsPay = {0} ", dto.IsPaySign);
                 }
 
                 if (!string.IsNullOrEmpty(sqlWhere.Trim()))
                 {
-                    Regex r = new Regex("And");
+                    var r = new Regex("And");
                     sqlWhere = r.Replace(sqlWhere, "Where", 1);
                 }
                 //10011
@@ -202,7 +191,7 @@ Left Join Sys_SetData as sd4 On i.TranslateCurrency = sd4.Id
 Left Join Sys_SetData as sd5 On ccp.PaymentCurrency = sd5.Id
 {0} And ccp.CTable = 81
 Order By i.id  Desc ", sqlWhere);
-                List<InvitationOfficialActivitiesView> _DecreasePayments = await _sqlSugar.SqlQueryable<InvitationOfficialActivitiesView>(sql).ToListAsync();
+                var _DecreasePayments = await _sqlSugar.SqlQueryable<InvitationOfficialActivitiesView>(sql).ToListAsync();
                 if (_DecreasePayments.Count != 0)
                 {
                     if (dto.PageIndex != 0 && dto.PageSize != 0)
@@ -213,7 +202,7 @@ Order By i.id  Desc ", sqlWhere);
                         if (totalPage == 0) totalPage = 1;
                         else totalPage = (int)Math.Ceiling((double)totalPage);
 
-                        List<InvitationOfficialActivitiesView> invitationOfficialActivities = new List<InvitationOfficialActivitiesView>();
+                        var invitationOfficialActivities = new List<InvitationOfficialActivitiesView>();
                         for (int i = 0; i < dto.PageSize; i++)
                         {
                             var RowIndex = i + (dto.PageIndex - 1) * dto.PageSize;
@@ -226,7 +215,7 @@ Order By i.id  Desc ", sqlWhere);
                                 break;
                             }
                         }
-                        
+
                         rst.DataList = invitationOfficialActivities;
                         rst.DataCount = count;
                         rst.CurrPageIndex = dto.PageIndex;
@@ -254,7 +243,7 @@ Order By i.id  Desc ", sqlWhere);
                     {
                         return result = new Result() { Code = 0, Msg = "暂无数据!", Data = _DecreasePayments };
                     }
-                   
+
                 }
             }
             catch (Exception ex)
@@ -267,18 +256,18 @@ Order By i.id  Desc ", sqlWhere);
         /// Info Page Basic Data
         /// </summary>
         /// <returns></returns>
-        public async Task<Result> _InitBasicData()
+        public async Task<Result> InitBasicData()
         {
-            Result result = new Result() { Code = -2, Msg = "程序错误!" };
+            var result = new Result() { Code = -2, Msg = "程序错误!" };
 
             var setDatas = _sqlSugar.Queryable<Sys_SetData>().Where(it => it.IsDel == 0).ToList();
 
             //支付方式
-            var _payTypeDatas = setDatas.Where(it => it.STid == 14).Select(it => new  { Id = it.Id, Name = it.Name, Remark = it.Remark }).ToList();
+            var _payTypeDatas = setDatas.Where(it => it.STid == 14).Select(it => new { it.Id, it.Name, it.Remark }).ToList();
 
             ///转账标识
             var _costIdentificationDatas = new List<dynamic>()
-            { 
+            {
                 new { Id = 0,Name = "公转" },
                 new { Id = 1,Name = "私转" }
             };
@@ -286,7 +275,8 @@ Order By i.id  Desc ", sqlWhere);
             //卡类型
             var _cardTypeDatas = setDatas.Where(it => it.STid == 15).Select(it => new SetDataCurrencyInfoView { Id = it.Id, Name = it.Name, Remark = it.Remark }).ToList();
 
-            var data = new { 
+            var data = new
+            {
                 PayTypeData = _payTypeDatas,
                 CostIdentificationData = _costIdentificationDatas,
                 CardTypeData = _cardTypeDatas
@@ -296,7 +286,7 @@ Order By i.id  Desc ", sqlWhere);
             result.Data = data;
             return result;
         }
-        
+
         /// <summary>
         /// 商邀费用操作(Status:1.新增,2.修改)
         /// </summary>
@@ -304,7 +294,7 @@ Order By i.id  Desc ", sqlWhere);
         /// <returns></returns>
         public async Task<Result> OpInvitationOfficialActivities(OpInvitationOfficialActivitiesDto dto, Func<int, int, int, Task<Result>> fn)
         {
-            Result result = new Result() { Code = -2, Msg = "程序错误!" };
+            var result = new Result() { Code = -2, Msg = "程序错误!" };
             BeginTran();
 
             string filePath = string.Empty;
@@ -332,8 +322,10 @@ Order By i.id  Desc ", sqlWhere);
                 id = await AddAsyncReturnId(grp_Invitation);
 
                 #region C表数据添加
-                Grp_CreditCardPayment C = new Grp_CreditCardPayment();
-                C.PayDId = dto.PayDId;
+                var C = new Grp_CreditCardPayment
+                {
+                    PayDId = dto.PayDId
+                };
 
                 //2025-04-07 第四次更改 PayDId == 72(刷卡) IsPay == 1
                 if (C.PayDId == 72) C.IsPay = 1;
@@ -411,7 +403,7 @@ Order By i.id  Desc ", sqlWhere);
             else//修改
             {
                 var thisTime = new DateTime();
-                DateTime.TryParse(dto.InviteTime, out thisTime);
+                var dtBool = DateTime.TryParse(dto.InviteTime, out thisTime);
                 bool res = await UpdateAsync(a => a.Id == grp_Invitation.Id, a => new Grp_InvitationOfficialActivities
                 {
                     DiId = dto.DiId,

+ 7 - 1
OASystem/OASystem.Infrastructure/Repositories/Groups/TourClientListRepository.cs

@@ -1116,7 +1116,7 @@ WHERE
         {
             string clientStr = "";
             if (string.IsNullOrEmpty(ids)) return clientStr;
-            List<int> intList = new List<int>();
+            var intList = new List<int>();
 
 
 
@@ -1145,6 +1145,12 @@ WHERE
 
             if (infos.Count > 0)
             {
+                //解密
+                infos.ForEach(x => { 
+                    x.FirstName = AesEncryptionHelper.Decrypt(x.FirstName);
+                    x.LastName = AesEncryptionHelper.Decrypt(x.LastName);
+                });
+
                 var infos1 = infos.Select(it => it.LastName + it.FirstName).ToList();
                 clientStr = string.Join(",", infos1);
             }