浏览代码

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

yuanrf 8 月之前
父节点
当前提交
89d9b4877f

+ 131 - 2
OASystem/OASystem.Api/Controllers/FinancialController.cs

@@ -9,8 +9,10 @@ using MathNet.Numerics.Distributions;
 using Microsoft.EntityFrameworkCore.Query.Internal;
 using NPOI.HPSF;
 using NPOI.HSSF.UserModel;
+using NPOI.SS.Formula.Functions;
 using NPOI.SS.Formula.PTG;
 using NPOI.SS.UserModel;
+using NPOI.Util;
 using NPOI.XSSF.UserModel;
 using OASystem.API.OAMethodLib;
 using OASystem.API.OAMethodLib.File;
@@ -1320,6 +1322,133 @@ namespace OASystem.API.Controllers
             //将此段落加到单元格内
             lshCell.AppendChild(p);
         }
+
+
+        /// <summary>
+        /// 已收账单 
+        /// 提示导入出入境报价费用
+        /// </summary>
+        /// <param name="groupId"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> PostReceivablesImportFee(int groupId)
+        {
+            if (groupId < 1) return Ok(JsonView(false, "请传入有效的GroupId参数!"));
+
+            var _EnterExitCosts =await _sqlSugar.Queryable<Grp_EnterExitCost>()
+                                                .Where(it => it.IsDel == 0 && it.DiId == groupId)
+                                                .FirstAsync();
+            var _DayAndCosts =await _sqlSugar.Queryable<Grp_DayAndCost>()
+                                             .Where(it => it.IsDel == 0 && it.DiId == groupId)
+                                             .ToListAsync();
+            if (_EnterExitCosts == null) return Ok(JsonView(false, "该团组未填写出入境费用;"));
+
+            //数据源
+            var stayDatas = _DayAndCosts.Where(it => it.Type == 1).ToList();          //住宿费
+            var mealDatas = _DayAndCosts.Where(it => it.Type == 2).ToList();          //伙食费
+            var miscellaneousDatas = _DayAndCosts.Where(it => it.Type == 3).ToList(); //公杂费
+            var tainDatas = _DayAndCosts.Where(it => it.Type == 4).ToList();          //培训费
+
+            //筛选 陪同人员 = 1
+            var groupClientList = await _sqlSugar.Queryable<Grp_TourClientList>()
+                                                 .LeftJoin<Crm_DeleClient>((tcl, dc) => tcl.ClientId == dc.Id)
+                                                 .LeftJoin<Crm_CustomerCompany>((tcl, dc, cc) => dc.CrmCompanyId == cc.Id)
+                                                 .LeftJoin<Sys_SetData>((tcl, dc, cc, sd) => tcl.ShippingSpaceTypeId == sd.Id)
+                                                 .Where(tcl => tcl.IsDel == 0 &&
+                                                               tcl.DiId == groupId &&
+                                                               tcl.IsAccompany == 1
+                                                        )
+                                                 .Select((tcl, dc, cc, sd) => new
+                                                 {
+                                                     DiId = tcl.DiId,
+                                                     CompanyId = cc.Id,
+                                                     CompanyName = cc.CompanyFullName,
+                                                     ClienId = dc.Id,
+                                                     ClientName = dc.FirstName + dc.LastName,
+                                                     SpaceId = tcl.ShippingSpaceTypeId,
+                                                     SpaceName = sd.Name
+                                                 })
+                                                 .ToListAsync();
+            if (groupClientList.Count < 1) return Ok(JsonView(false, "该团组未填写接团客户名单;"));
+
+            decimal domesticFeeTotal =0.00M,        //境内费用
+                    economyClassFeeTotal = 0.00M,   //经济舱费用
+                    businessClassFeeTotal = 0.00M,  //公务舱费用
+                    firstClassFeeTotal = 0.00M,     //头等舱费用
+                    stayFeeTotal = 0.00M,           //住宿费
+                    mealsFeeTotal = 0.00M,          //餐食费
+                    miscellaneousFeeTotal = 0.00M,  //公杂费
+                    tainFeeTotal = 0.00M;           //培训费
+
+            //境内费用(其他费用)
+            if (_EnterExitCosts.ChoiceOne == 1) domesticFeeTotal = _EnterExitCosts.InsidePay;
+
+            //住宿费
+            if (_EnterExitCosts.ChoiceThree == 1) stayFeeTotal = stayDatas.Sum(x => x.SubTotal);
+
+            //伙食费
+            if (_EnterExitCosts.ChoiceFour == 1) mealsFeeTotal = mealDatas.Sum(x => x.SubTotal);
+
+            //公杂费
+            if (_EnterExitCosts.ChoiceFive == 1) miscellaneousFeeTotal = miscellaneousDatas.Sum(x => x.SubTotal);
+
+            //培训费
+            if (_EnterExitCosts.ChoiceSix == 1) tainFeeTotal = tainDatas.Sum(x => x.SubTotal);
+
+            decimal otherFeeTotal = domesticFeeTotal + stayFeeTotal + mealsFeeTotal + miscellaneousFeeTotal + tainFeeTotal;
+            //国际旅费合计
+            //经济舱
+            if (_EnterExitCosts.SumJJC == 1) economyClassFeeTotal = _EnterExitCosts.OutsideJJPay + otherFeeTotal;
+            //公务舱
+            if (_EnterExitCosts.SumGWC == 1) businessClassFeeTotal = _EnterExitCosts.OutsideGWPay + otherFeeTotal;
+            //头等舱
+            if (_EnterExitCosts.SumTDC == 1) firstClassFeeTotal = _EnterExitCosts.OutsideTDPay + otherFeeTotal;
+
+            var groupClientListGroup = groupClientList.GroupBy(x => x.CompanyId);
+
+            var _view = new List<ProceedsReceivedNewView>();
+            foreach (var item in groupClientListGroup)
+            {
+                string companyName = item.FirstOrDefault().CompanyName;
+                var airTicketGroup = item.GroupBy(x => x.SpaceId);
+
+                foreach (var airTicket in airTicketGroup)
+                {
+                    int quantity = airTicket.Count();
+                    if (quantity > 0)
+                    {
+                        decimal price = 0.00M;
+                        string spaceName = airTicket.FirstOrDefault()?.SpaceName ?? string.Empty;
+                        if (spaceName.Equals("经济舱")) price = economyClassFeeTotal;
+                        else if (spaceName.Equals("公务舱")) price = businessClassFeeTotal;
+                        else if (spaceName.Equals("头等舱")) price = firstClassFeeTotal;
+
+                        if (price > 0)
+                        {
+                            decimal itemTotal = price * quantity;
+
+                            _view.Add(new ProceedsReceivedNewView()
+                            {
+                                Id = 0,
+                                Diid = groupId,
+                                PriceName = $"{companyName}-{spaceName}",
+                                Price = price,
+                                Count = quantity,
+                                Unit = "人",
+                                ItemSumPrice = itemTotal,
+                                Currency = 836,
+                                Rate = 1.0000M,
+                                AddingWay = 2,
+                                Remark = "由出入境费用导入费用",
+                            });
+                        }
+                    }
+                }
+            }
+
+            return Ok(JsonView(true, "操作成功", _view));
+        }
         #endregion
 
         #region 已收款项
@@ -1772,14 +1901,14 @@ namespace OASystem.API.Controllers
 					  Inner Join Grp_CreditCardPayment ccp On prao.Id = ccp.CId
 					  Where ccp.CTable = 285 And ccp.IsPay = 1 And prao.IsDel = 0 And ccp.IsDel = 0 And prao.DiId = {0}", diId);
                     List<Grp_CreditCardPayment> list_other = _sqlSugar.SqlQueryable<Grp_CreditCardPayment>(sql_other).ToList();
-                    sum_refund = list_other.Sum(s => s.RMBPrice);
+                    sum_refund = list_other.Sum(s => s.PayMoney * s.DayRate);
 
                     //4.超支
                     string sql_extra = string.Format(@" Select c.* From Fin_GroupExtraCost f 
                     Inner join Grp_CreditCardPayment c On f.Id = c.CId 
                     Where c.CTable = 1015 And c.IsPay = 1 And f.IsDel = 0 And c.IsDel = 0 And f.DiId = {0} ", diId);
                     List<Grp_CreditCardPayment> list_extra = _sqlSugar.SqlQueryable<Grp_CreditCardPayment>(sql_extra).ToList();
-                    sum_extra = list_extra.Sum(s => s.RMBPrice);
+                    sum_extra = list_extra.Sum(s => s.PayMoney * s.DayRate);
 
                     item_rst.frPrice = sum_fr.ToString("#0.00");
                     item_rst.extraPrice = sum_extra.ToString("#0.00");

+ 131 - 60
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -27,6 +27,7 @@ using System.Collections;
 using System.Data;
 using System.Diagnostics;
 using System.Globalization;
+using System.IO;
 using System.Reflection.PortableExecutable;
 using Ubiety.Dns.Core;
 using static OASystem.Infrastructure.Repositories.Groups.AirTicketResRepository;
@@ -1222,11 +1223,13 @@ namespace OASystem.API.Controllers
         public async Task<IActionResult> TaskAllocationBulkAdd(TaskAllocationBulkAddDto dto)
         {
             //参数验证
-            if (dto.UserId < 1 ) return Ok(JsonView(false, MsgTips.UserId));
+            if (dto.UserIds.Length < 1 ) return Ok(JsonView(false, $"请选择分配人员!"));
 
-            if (dto.OperateId < 1) return Ok(JsonView(false, MsgTips.OperateId));
+            if (dto.PermissionTypeIds.Length < 1) return Ok(JsonView(false, $"请选择分配类型!"));
 
-            if (dto.GroupIds.Length < 1) return Ok(JsonView(false, "请传入有效的GroupIds数组参数!"));
+            if (dto.GroupIds.Length < 1) return Ok(JsonView(false, "请选择分配团组Id"));
+
+            if (dto.CurrUserId < 1) return Ok(JsonView(false, "请传入有效的CurrUserId数组参数"));
 
             return Ok(await _taskAssignmentRep.TaskAllocationBulkAdd(dto));
         }
@@ -6396,7 +6399,7 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> VisaCommissionInit()
         {
-            return Ok(await _visaCommissionRep._Init());
+            return Ok(await _visaCommissionRep.Init());
         }
 
         /// <summary>
@@ -6405,12 +6408,65 @@ namespace OASystem.API.Controllers
         /// </summary>
         /// <param name="_dto"></param>
         /// <returns></returns>
-        [HttpGet]
+        [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> VisaCommissionItem(VisaCommissionItemDto dto)
+        public async Task<IActionResult> VisaCommissionItem(VisaCommissionItemDto _dto)
         {
             var validator = new VisaCommissionItemDtoValidator();
-            var validatorRes = await validator.ValidateAsync(dto);
+            var validatorRes = await validator.ValidateAsync(_dto);
+            if (!validatorRes.IsValid)
+            {
+                StringBuilder sb = new StringBuilder();
+                foreach (var item in validatorRes.Errors)
+                {
+                    sb.AppendLine(item.ErrorMessage);
+                }
+                return Ok(JsonView(false, sb.ToString()));
+            }
+
+            return Ok(await _visaCommissionRep.Item(_dto));
+        }
+
+        /// <summary>
+        /// 签证提成录入 
+        /// Create
+        /// </summary>
+        /// <param name="_dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> VisaCommissionCreate(VisaCommissionCreateDto _dto)
+        {
+            var validator = new VisaCommissionCreateDtoValidator();
+            var validatorRes = await validator.ValidateAsync(_dto);
+            if (!validatorRes.IsValid)
+            {
+                StringBuilder sb = new StringBuilder();
+                foreach (var item in validatorRes.Errors)
+                {
+                    sb.AppendLine(item.ErrorMessage);
+                }
+                return Ok(JsonView(false, sb.ToString()));
+            }
+
+            return Ok(await _visaCommissionRep.Create(_dto));
+        }
+
+        /// <summary>
+        /// 签证提成录入
+        /// Put(编辑)
+        /// </summary>
+        /// <param name="id"></param>
+        /// <param name="_dto"></param>
+        /// <returns></returns>
+        [HttpPut]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> VisaCommissionEdit(int id,VisaCommissionCreateDto _dto)
+        {
+            if (id < 1) return Ok(JsonView(false, "请输入正确的id参数!"));
+
+            var validator = new VisaCommissionCreateDtoValidator();
+            var validatorRes = await validator.ValidateAsync(_dto);
             if (!validatorRes.IsValid)
             {
                 StringBuilder sb = new StringBuilder();
@@ -6421,10 +6477,29 @@ namespace OASystem.API.Controllers
                 return Ok(JsonView(false, sb.ToString()));
             }
 
-            return Ok(await _visaCommissionRep._Init());
+            return Ok(await _visaCommissionRep.Edit(id,_dto));
+        }
+
+        /// <summary>
+        /// 签证提成录入
+        /// Del
+        /// </summary>
+        /// <param name="id"></param>
+        /// <param name="currUserId"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> VisaCommissionDel(int id,int currUserId)
+        {
+            if (id < 1) return Ok(JsonView(false, "请输入正确的id参数!"));
+            if (currUserId < 1) return Ok(JsonView(false, "请输入正确的currUserId参数!"));
+
+
+            return Ok(await _visaCommissionRep.Del(id, currUserId));
         }
 
 
+
         #endregion
 
         #region op费用录入
@@ -10212,8 +10287,6 @@ ORDER by  gctggrc.id DESC
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> PostHotelAutoAuditTest(int diid,int dataId)
         {
-            
-
             #region 应用推送
 
             try
@@ -10798,45 +10871,7 @@ ORDER by  gctggrc.id DESC
             DocumentBuilder builder = new DocumentBuilder(doc);
             try
             {
-                #region 设置页眉
-
-                string voucherHeaderPath = $"./Images/VoucherHeader.png";
-
-
-                builder.MoveToHeaderFooter(HeaderFooterType.HeaderPrimary);
-
-                //靠右
-                builder.ParagraphFormat.Alignment = ParagraphAlignment.Left;
-                //   设置页脚上下边距
-                builder.PageSetup.HeaderDistance = 42;
-
-                //   添加页眉线
-                Aspose.Words.Border borderHeader = null;
-                try
-                {
-                    borderHeader = builder.ParagraphFormat.Borders.Bottom;
-                }
-                catch (Exception e)
-                {
-                    // TODO Auto-generated catch block
-                    //e.printStackTrace();
-                }
-                borderHeader.Shadow = true;
-                borderHeader.DistanceFromText = 2;
-                borderHeader.LineStyle = Aspose.Words.LineStyle.Single;
-
-
-
-                if (System.IO.File.Exists(voucherHeaderPath))
-                {
-                    //页眉加载图片
-                    var image = Image.FromFile(voucherHeaderPath);
-
-                    builder.InsertImage(image, RelativeHorizontalPosition.Default, 1, RelativeVerticalPosition.Margin, 1, 1.20, 2.70, WrapType.Inline);
-                }
-               
-
-                #endregion
+                
 
 
                 builder.MoveToDocumentStart();
@@ -11218,21 +11253,58 @@ ORDER by  gctggrc.id DESC
                     #endregion
 
                     builder.EndTable();
+
+                    //换行
                     builder.Writeln("");
                     builder.Writeln("");
                 }
 
-                //// 遍历文档中的所有段落
-                //foreach (Paragraph para in doc.GetChildNodes(NodeType.Paragraph, true))
-                //{
-                //    // 设置段落的字体样式
-                //    // 这里我们设置字体为Times New Roman,大小为12,加粗
-                //    para.ParagraphFormat.Style.Font.Name = "微软雅黑";
-                //    para.ParagraphFormat.Style.Font.Size = 12;
-                //    para.ParagraphFormat.Style.Font.Bold = true;
-                //}
 
-                
+
+                #region 设置页眉
+
+                builder.MoveToHeaderFooter(HeaderFooterType.HeaderPrimary);
+                string voucherHeaderPath = $"./Images/VoucherHeader.png";
+                if (System.IO.File.Exists(voucherHeaderPath))
+                {
+                    byte[] imageBytes = System.IO.File.ReadAllBytes(voucherHeaderPath);
+                    //Image image = Image.FromStream(imageBytes, ImageType.Png);
+                    //builder.InsertImage(imageBytes, RelativeHorizontalPosition.Margin, 0, RelativeVerticalPosition.Margin, 0, 81, 36, WrapType.None);
+                    Shape shape = builder.InsertImage(imageBytes);
+
+                    // 调整图片位置
+                    shape.RelativeHorizontalPosition = RelativeHorizontalPosition.Page; // 将图片的水平位置设置为页面
+                    shape.RelativeVerticalPosition = RelativeVerticalPosition.TopMargin; // 将图片的垂直位置设置为页眉上边距
+                    shape.Top = 50; // 将图片距离页眉上边缘的距离
+                    shape.Left = 0; // 将图片距离页面左边缘的距离
+                    shape.Width = 81; // 设置图片宽度
+                    shape.Height = 36; // 设置图片高度
+                }
+
+                //靠右
+                builder.ParagraphFormat.Alignment = ParagraphAlignment.Left;
+                ////   设置页脚上下边距
+                //builder.PageSetup.HeaderDistance = 42;
+
+                //   添加页眉线
+                Aspose.Words.Border borderHeader = null;
+                try
+                {
+                    borderHeader = builder.ParagraphFormat.Borders.Bottom;
+                }
+                catch (Exception e)
+                {
+                    // TODO Auto-generated catch block
+                    //e.printStackTrace();
+                }
+                borderHeader.Shadow = true;
+                borderHeader.DistanceFromText = 2;
+                borderHeader.LineStyle = Aspose.Words.LineStyle.Single;
+
+
+
+                #endregion
+
 
             }
             catch (Exception ex)
@@ -12201,7 +12273,6 @@ ORDER by  gctggrc.id DESC
             return valid;
         }
 
-
         /// <summary>
         /// 接团客户名单
         /// 根据团组Id查询List

+ 13 - 3
OASystem/OASystem.Api/Controllers/ResourceController.cs

@@ -1685,9 +1685,19 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
             dynamic groupInfos = null;
             if (_groupData.Code == 0) groupInfos = _groupData.Data;
 
-            List<Sys_SetData> data = _sqlSugar.Queryable<Sys_SetData>().Where(a => a.IsDel == 0 && a.STid == 38).ToList();
-            List<Grp_DeleFile> _DeleFile = _sqlSugar.Queryable<Grp_DeleFile>().Where(a => a.Diid == dto.DiId && a.IsDel == 0 && a.Category == 970).ToList();
-            return Ok(JsonView(true, "查询成功!", new { Delegation = groupInfos, SetData = data, DeleFile = _DeleFile }));
+            var data = _sqlSugar.Queryable<Sys_SetData>().Where(a => a.IsDel == 0 && a.STid == 38).ToList();
+
+            var natureData = _sqlSugar.Queryable<Sys_SetData>()
+                                      .Where(a => a.IsDel == 0 && a.STid == 86)
+                                      .Select(x => new
+                                      {
+                                          x.Id,
+                                          x.Name
+                                      })
+                                      .ToList();
+
+            var _DeleFile = _sqlSugar.Queryable<Grp_DeleFile>().Where(a => a.Diid == dto.DiId && a.IsDel == 0 && a.Category == 970).ToList();
+            return Ok(JsonView(true, "查询成功!", new { Delegation = groupInfos, SetData = data, Nature = natureData, DeleFile = _DeleFile }));
         }
 
         /// <summary>

+ 3 - 2
OASystem/OASystem.Api/Controllers/StatisticsController.cs

@@ -969,7 +969,8 @@ namespace OASystem.API.Controllers
                 string groupInvitationalFeeSql = string.Format(@"Select ioa.Id As IOAId,ioa.DiId As IOADiId,ioa.InviterArea,ioa.Inviter,ioa.InviteTime,
                                                                  ioa.InviteCost,sd3.Name As InviteCurrency,ioa.SendCost,sd4.Name As SendCurrency,ioa.EventsCost,
                                                                  sd5.Name As EventsCurrency,ioa.TranslateCost,sd6.Name As TranslateCurrency,ccp.PayMoney,
-                                                                 sd7.Name As PaymentCurrency,ccp.RMBPrice As CNYPrice,(((ccp.PayMoney * ccp.DayRate) / ccp.PayPercentage) * 100) As CNYPrice2,ccp.Payee,ccp.AuditGMDate,
+                                                                 sd7.Name As PaymentCurrency,ccp.RMBPrice As CNYPrice,
+                                                                 (((ccp.PayMoney * ccp.DayRate) / ccp.PayPercentage) * 100) As CNYPrice2,ccp.Payee,ccp.AuditGMDate,
                                                                  ccp.OrbitalPrivateTransfer,sd2.Name As PayWay,ccp.IsPay,u.CnName As Applicant,ioa.CreateTime
                                                                  From  Grp_InvitationOfficialActivities ioa
                                                                  Left Join Grp_CreditCardPayment ccp On ccp.isdel = 0 And ccp.CTable = 81 And ioa.Id = ccp.CId
@@ -1071,7 +1072,7 @@ namespace OASystem.API.Controllers
 
                 #region 保险费用
                 List<GroupInsuranceFeeView> groupInsuranceFeeViews = new List<GroupInsuranceFeeView>();
-                string groupInsuranceFeeSql = string.Format(@"Select ic.Id As InsuranceId,ic.Diid As InsuranceDiId,ClientName,ccp.PayMoney,ccp.RMBPrice As CNYPrice,
+                string groupInsuranceFeeSql = string.Format(@"Select ic.Id As InsuranceId,ic.Diid As InsuranceDiId,ClientName,ccp.PayMoney,ccp.PayMoney * ccp.DayRate As CNYPrice,
                                                               sd1.Name As PayMoneyCurrency,ccp.Payee,ccp.AuditGMDate,ccp.OrbitalPrivateTransfer,
                                                               sd2.Name As PayWay,ccp.IsPay,u.CnName As Applicant,ic.CreateTime
                                                               From Grp_Customers ic

二进制
OASystem/OASystem.Api/Images/VoucherHeader.jpg


+ 23 - 2
OASystem/OASystem.Api/OAMethodLib/GeneralMethod.cs

@@ -663,8 +663,7 @@ namespace OASystem.API.OAMethodLib
 
             //81  邀请/公务活动 --> 国交部门(7) 商邀(27) 岗位
             _GroupsTaskAssignments.AddRange(
-                userDatas
-                .Where(it => it.DepId == 7 && it.JobPostId == 27)
+                userDatas.Where(it => it.DepId == 7 && it.JobPostId == 27)
                 .Select(it => new Grp_GroupsTaskAssignment()
                 {
                     DIId = diId,
@@ -674,6 +673,18 @@ namespace OASystem.API.OAMethodLib
                 }).ToList()
             );
 
+            //2024年8月26日16点27分 “邀请公务活动分配给王鸽(UserID:149)”
+            _GroupsTaskAssignments.Add(
+                 new Grp_GroupsTaskAssignment()
+                {
+                    DIId = diId,
+                    CTId = 81,
+                    UId = 149, 
+                    CreateUserId = userId
+                }
+            );
+
+
             //80  签证  --> 国交部门(7) 签证(26) 岗位
             _GroupsTaskAssignments.AddRange(
                 userDatas
@@ -733,6 +744,16 @@ namespace OASystem.API.OAMethodLib
                 }).ToList()
             );
 
+            //2024年8月26日16点27分 “其他款项分配给王鸽(UserID:149)”
+            _GroupsTaskAssignments.Add(new Grp_GroupsTaskAssignment()
+                {
+                    DIId = diId,
+                    CTId = 98,
+                    UId = 149,
+                    CreateUserId = userId
+                }
+            );
+
             //1015 超支费用,285 收款退还  --> 财务部门(ALL)岗位
             _GroupsTaskAssignments.AddRange(
                 userDatas

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

@@ -167,6 +167,11 @@ namespace OASystem.Domain.AutoMappers
 
             #endregion
 
+            #region 签证提成录入
+
+            CreateMap<VisaCommissionCreateDto, Grp_VisaCommission>();
+            #endregion
+
             #endregion
             #region Resource
 

+ 2 - 2
OASystem/OASystem.Domain/Dtos/Groups/TaskAssignmenDto.cs

@@ -56,8 +56,8 @@ namespace OASystem.Domain.Dtos.Groups
     }
     public class TaskAllocationBulkAddDto
     {
-        public int UserId { get; set; }
-        public int OperateId { get; set; }
+        public int[] UserIds { get; set; }
+        public int[] PermissionTypeIds { get; set; }
         public int[] GroupIds { get; set; }
         public int CurrUserId { get; set; }
     }

+ 11 - 0
OASystem/OASystem.Domain/Dtos/Groups/TourClientListDto.cs

@@ -57,6 +57,12 @@ namespace OASystem.Domain.Dtos.Groups
         /// </summary>
         public int DiId { get; set; }
 
+        /// <summary>
+        /// 是否陪同
+        /// 1 否 2 是
+        /// </summary>
+        public int IsAccompany { get; set; } = 1;
+
         /// <summary>
         /// 姓
         /// </summary>
@@ -155,6 +161,11 @@ namespace OASystem.Domain.Dtos.Groups
     /// </summary>
     public class TourClientListInfo
     {
+        /// <summary>
+        /// 是否陪同
+        /// 1 否 2 是
+        /// </summary>
+        public int IsAccompany { get; set; } = 1;
         /// <summary>
         /// 姓
         /// </summary>

+ 48 - 1
OASystem/OASystem.Domain/Dtos/Groups/VisaCommissionDto.cs

@@ -23,8 +23,55 @@ namespace OASystem.Domain.Dtos.Groups
 
             RuleFor(x => x.PortType).InclusiveBetween(from: 1, to: 3)
                                     .WithMessage(MsgTips.Port);
-            RuleFor(x => x.CurrUserId).LessThan(valueToCompare: 1)
+            RuleFor(x => x.CurrUserId).GreaterThan(valueToCompare: 1)
                                       .WithMessage("请输入有效的CurrUserId!");
+            RuleFor(x => x.DiId).GreaterThan(valueToCompare: 1)
+                                .WithMessage("请输入有效的DiId!");
+        }
+    }
+
+    /// <summary>
+    /// Create Dto
+    /// </summary>
+    public class VisaCommissionCreateDto
+    {
+        /// <summary>
+        /// 用户ID
+        /// </summary>
+        public int CurrUserId { get; set; }
+        /// <summary>
+        /// 团组ID
+        /// </summary>
+        public int DiId { get; set; }
+
+        /// <summary>
+        /// 国家
+        /// </summary>
+        public string Country { get; set; }
+
+        /// <summary>
+        /// 数量
+        /// </summary>
+        public int Quantity { get; set; }
+
+        /// <summary>
+        /// 备注
+        /// </summary>
+        public string Remark { get; set; }
+    }
+
+    public class VisaCommissionCreateDtoValidator : AbstractValidator<VisaCommissionCreateDto>
+    {
+        public VisaCommissionCreateDtoValidator()
+        {
+            RuleFor(x => x.CurrUserId).GreaterThan(valueToCompare: 0)
+                                      .WithMessage("请输入有效的CurrUserId!");
+            RuleFor(x => x.DiId).GreaterThan(valueToCompare: 0)
+                                .WithMessage("请输入有效的DiId!");
+            RuleFor(x => x.Country).NotEmpty()
+                                   .WithMessage("国家不能为空!");
+            RuleFor(x => x.Quantity).GreaterThan(valueToCompare: 0)
+                                    .WithMessage("请输入有效的Qauntity!");
         }
     }
 }

+ 15 - 0
OASystem/OASystem.Domain/Dtos/Resource/OfficialActivitiesDto.cs

@@ -133,6 +133,21 @@ namespace OASystem.Domain.Dtos.Resource
         /// 请示范例
         /// </summary>
         public string ReqSample { get; set; }
+        /// <summary>
+        /// 邮箱/微信
+        /// </summary>
+        public string? EmailOrWeChat { get; set; }
+        /// <summary>
+        /// 网址
+        /// </summary>
+        public string? Website { get; set; }
+
+        /// <summary>
+        /// 公务性质
+        /// setdata 外键Id 
+        /// </summary>
+        public int NatureId { get; set; }
+
 
     }
 

+ 8 - 0
OASystem/OASystem.Domain/Entities/Groups/Grp_TourClientList.cs

@@ -49,5 +49,13 @@ namespace OASystem.Domain.Entities.Groups
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "varchar(500)")]
         public string? MealSpecialNeeds { get; set; }
+
+        /// <summary>
+        /// 是否陪同
+        /// 1 否 2 是
+        /// 默认:1
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int IsAccompany { get; set; } = 1;
     }
 }

+ 19 - 0
OASystem/OASystem.Domain/Entities/Resource/Res_OfficialActivities.cs

@@ -149,5 +149,24 @@ namespace OASystem.Domain.Entities.Resource
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "nvarchar(500)")]
         public string? ScreenshotOfMailUrl { get; set; }
+
+        /// <summary>
+        /// 邮箱/微信
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(200)")]
+        public string? EmailOrWeChat { get; set; }
+
+        /// <summary>
+        /// 网址
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(100)")]
+        public string? Website { get; set; }
+
+        /// <summary>
+        /// 公务性质
+        /// setdata 外键Id 
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int NatureId { get; set; } 
     }
 }

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

@@ -26,6 +26,12 @@ namespace OASystem.Domain.ViewModels.Groups
     {
         public int Id { get; set; }
 
+        /// <summary>
+        /// 是否陪同
+        /// 1 否 2 是
+        /// </summary>
+        public int IsAccompany { get; set; }
+
         /// <summary>
         /// 姓
         /// </summary>
@@ -59,6 +65,16 @@ namespace OASystem.Domain.ViewModels.Groups
 
         public DateTime BirthDay { get; set; }
 
+        /// <summary>
+        /// 操作人
+        /// </summary>
+        public string Operator { get; set; }
+
+        /// <summary>
+        /// 操作时间
+        /// </summary>
+        public DateTime OperatingTime { get; set; }
+
     }
 
     /// <summary>
@@ -70,6 +86,12 @@ namespace OASystem.Domain.ViewModels.Groups
     {
         public int Id { get; set; }
 
+        /// <summary>
+        /// 是否陪同
+        /// 1 否 2 是
+        /// </summary>
+        public int IsAccompany { get; set; }
+
         /// <summary>
         /// 姓
         /// </summary>

+ 13 - 3
OASystem/OASystem.Domain/ViewModels/Resource/OfficialActivitiesView.cs

@@ -11,7 +11,10 @@ namespace OASystem.Domain.ViewModels.Resource
     public class OfficialActivitiesView : Res_OfficialActivities
     {
 
-        public List<string> ScreenshotOfMailUrls { get {
+        public List<string> ScreenshotOfMailUrls
+        {
+            get
+            {
 
                 List<string> urls = new List<string>();
                 urls = !string.IsNullOrEmpty(ScreenshotOfMailUrl)
@@ -19,11 +22,18 @@ namespace OASystem.Domain.ViewModels.Resource
                     : new List<string>();
 
                 List<string> urls1 = new List<string>();
-                urls.ForEach(x => {
+                urls.ForEach(x =>
+                {
                     urls1.Add("http://132.232.92.186:24/" + x);
                 });
                 return urls1;
-            } }
+            }
+        }
+
+        /// <summary>
+        /// 性质
+        /// </summary>
+        public string NatureName { get; set; }
 
         public string CreateUserName { get; set; }
         public string OfficialFormName { get; set; }

+ 29 - 20
OASystem/OASystem.Infrastructure/Repositories/Groups/TaskAssignmentRepository.cs

@@ -276,7 +276,11 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
             var data = await _sqlSugar.Queryable<Grp_DelegationInfo>()
                 .Where(it => it.IsDel == 0 && it.VisitDate >= beginDt && it.VisitDate <= endDt)
-                .Select(it => it.Id)
+                .Select(it => new
+                {
+                    it.Id,
+                    it.TeamName
+                })
                 .ToListAsync();
 
             _view.Code = StatusCodes.Status200OK;
@@ -287,7 +291,6 @@ namespace OASystem.Infrastructure.Repositories.Groups
             return _view;
         }
 
-
         /// <summary>
         /// 团组任务分配 
         /// 批量分配 
@@ -299,35 +302,41 @@ namespace OASystem.Infrastructure.Repositories.Groups
         {
             JsonView _view = new JsonView() { Code = StatusCodes.Status400BadRequest, Msg = "其他错误" };
 
-            int ctid = dto.OperateId,
-                uid = dto.UserId;
-
             var infos = await _sqlSugar.Queryable<Grp_GroupsTaskAssignment>()
-                                       .Where(x => x.IsDel == 0 && x.CTId == ctid && x.UId == uid && dto.GroupIds.Contains(x.DIId))
-                                       .Select(x => x.DIId)
+                                       .Where(x => x.IsDel == 0 &&
+                                                   dto.PermissionTypeIds.Contains(x.CTId) &&
+                                                   dto.UserIds.Contains(x.UId) &&
+                                                   dto.GroupIds.Contains(x.DIId)
+                                             )
                                        .ToListAsync();
-
             int addCount = 0,
                 unAddCount = 0;
             List<Grp_GroupsTaskAssignment> _GroupsTaskAssignments = new List<Grp_GroupsTaskAssignment>();
-            foreach (var item in dto.GroupIds)
+
+            foreach (var userId in dto.UserIds)
             {
-                if (!infos.Contains(item))
+                foreach (var permissionTypeId in dto.PermissionTypeIds)
                 {
-                    _GroupsTaskAssignments.Add(new Grp_GroupsTaskAssignment()
+                    foreach (var groupId in dto.GroupIds)
                     {
-                        DIId = item,
-                        CTId = ctid,
-                        UId = uid,
-                        CreateUserId = dto.CurrUserId,
-                        CreateTime = DateTime.UtcNow,
-                    });
-                    addCount++;
+                        var info = infos.Find(x => x.UId == userId && x.CTId == permissionTypeId && x.DIId == groupId);
+                        if (info == null)
+                        {
+                            _GroupsTaskAssignments.Add(new Grp_GroupsTaskAssignment()
+                            {
+                                DIId = groupId,
+                                CTId = permissionTypeId,
+                                UId = userId,
+                                CreateUserId = dto.CurrUserId,
+                                CreateTime = DateTime.UtcNow,
+                            });
+                            addCount++;
+                        }
+                        else unAddCount++;
+                    }
                 }
-                else unAddCount++;
             }
 
-
             if (_GroupsTaskAssignments.Count > 0)
             {
                 var add = await _sqlSugar.Insertable<Grp_GroupsTaskAssignment>(_GroupsTaskAssignments)

+ 86 - 30
OASystem/OASystem.Infrastructure/Repositories/Groups/TourClientListRepository.cs

@@ -72,16 +72,40 @@ namespace OASystem.Infrastructure.Repositories.Groups
         {
             if (portId == 1 || portId == 2 || portId == 3 ) // 1 web 2 Android 3 ios
             {
-                string sql = string.Format(@"Select tcl.Id,tcl.DiId,temp.* From Grp_TourClientList tcl
-                                                 Left Join 
-	                                                 (Select dc.Id As DcId,dc.LastName,dc.FirstName,ccom.CompanyFullName,dc.Job,
-                                                     cc.CertNo As IDCardNo,dc.Sex,dc.BirthDay
-	                                                 From Crm_DeleClient dc
-	                                                 Left Join Crm_CustomerCompany ccom On dc.CrmCompanyId = ccom.Id  And ccom.IsDel = 0
-	                                                 Left Join Crm_CustomerCert cc On dc.Id = cc.DcId And cc.SdId = 773 And cc.IsDel = 0
-	                                                 Where dc.IsDel = 0) temp 
-                                                 On temp.DcId =tcl.ClientId  
-                                                 Where tcl.IsDel = 0 And tcl.DiId = {0}", diId);
+                string sql = string.Format(@"
+SELECT
+  tcl.Id,
+  tcl.DiId,
+  tcl.IsAccompany,
+  temp.*,
+  u.CnName AS Operator,
+  tcl.CreateTime AS OperatingTime
+FROM
+  Grp_TourClientList tcl
+  LEFT JOIN (
+    SELECT
+      dc.Id AS DcId,
+      dc.LastName,
+      dc.FirstName,
+      ccom.CompanyFullName,
+      dc.Job,
+      cc.CertNo AS IDCardNo,
+      dc.Sex,
+      dc.BirthDay
+    FROM
+      Crm_DeleClient dc
+      LEFT JOIN Crm_CustomerCompany ccom ON dc.CrmCompanyId = ccom.Id
+      AND ccom.IsDel = 0
+      LEFT JOIN Crm_CustomerCert cc ON dc.Id = cc.DcId
+      AND cc.SdId = 773
+      AND cc.IsDel = 0
+    WHERE
+      dc.IsDel = 0
+  ) temp ON temp.DcId = tcl.ClientId
+  LEFT JOIN Sys_Users u ON tcl.CreateUserId = u.Id
+WHERE
+  tcl.IsDel = 0
+  AND tcl.DiId = {0}", diId);
                 var data = await _sqlSugar.SqlQueryable<TourClientListByDiIdView>(sql).ToListAsync();
                 _result.Code = 0;
                 _result.Data = data;
@@ -151,27 +175,58 @@ namespace OASystem.Infrastructure.Repositories.Groups
         {
             if (portId == 1 || portId == 2 || portId == 3) // 1 web 2 Android 3 ios
             {
-                string sql = string.Format(@"Select tcl.Id,tcl.DiId,temp.*,tcl.ShippingSpaceTypeId,tcl.ShippingSpaceSpecialNeeds,
-                                             tcl.HotelSpecialNeeds,tcl.MealSpecialNeeds,tcl.Remark
-                                             From Grp_TourClientList tcl
-                                             Left Join 
-	                                             (Select dc.Id As DcId,dc.LastName,dc.FirstName,dc.Pinyin,dc.Sex,ccom.CompanyFullName,dc.Job,
-	                                                 cc1.CertNo As IDCardNo,dc.Phone,dc.BirthDay,cc2.PassportType,cc2.CertNo As PassportNo,cc2.Country,
-	                                                 cc2.Area,cc2.IssueDt,cc2.ExpiryDt
-	                                                 From Crm_DeleClient dc
-	                                                 Left Join Crm_CustomerCompany ccom On dc.CrmCompanyId = ccom.Id  And ccom.IsDel = 0
-	                                                 Left Join Crm_CustomerCert cc1 On dc.Id = cc1.DcId And cc1.SdId = 773 And cc1.IsDel = 0
-	                                                 Left Join Crm_CustomerCert cc2 On dc.Id = cc2.DcId And cc2.SdId = 774 And cc2.IsDel = 0
-	                                                 Where dc.IsDel = 0) temp 
-                                             On temp.DcId =tcl.ClientId  
-                                             Where tcl.IsDel = 0 And tcl.Id = {0}", id);
+                string sql = string.Format(@"
+SELECT
+  tcl.Id,
+  tcl.DiId,
+  tcl.IsAccompany,
+  temp.*,
+  tcl.ShippingSpaceTypeId,
+  tcl.ShippingSpaceSpecialNeeds,
+  tcl.HotelSpecialNeeds,
+  tcl.MealSpecialNeeds,
+  tcl.Remark
+FROM
+  Grp_TourClientList tcl
+  LEFT JOIN (
+    SELECT
+      dc.Id AS DcId,
+      dc.LastName,
+      dc.FirstName,
+      dc.Pinyin,
+      dc.Sex,
+      ccom.CompanyFullName,
+      dc.Job,
+      cc1.CertNo AS IDCardNo,
+      dc.Phone,
+      dc.BirthDay,
+      cc2.PassportType,
+      cc2.CertNo AS PassportNo,
+      cc2.Country,
+      cc2.Area,
+      cc2.IssueDt,
+      cc2.ExpiryDt
+    FROM
+      Crm_DeleClient dc
+      LEFT JOIN Crm_CustomerCompany ccom ON dc.CrmCompanyId = ccom.Id
+      AND ccom.IsDel = 0
+      LEFT JOIN Crm_CustomerCert cc1 ON dc.Id = cc1.DcId
+      AND cc1.SdId = 773
+      AND cc1.IsDel = 0
+      LEFT JOIN Crm_CustomerCert cc2 ON dc.Id = cc2.DcId
+      AND cc2.SdId = 774
+      AND cc2.IsDel = 0
+    WHERE
+      dc.IsDel = 0
+  ) temp ON temp.DcId = tcl.ClientId
+WHERE
+  tcl.IsDel = 0
+  AND tcl.Id = {0}", id);
                 var data = await _sqlSugar.SqlQueryable<TourClientListDetailsView>(sql).FirstAsync();
                 if (data != null) 
                 {
 
-                    data.BirthDay = data.BirthDay.DateFormat("yyyy-MM-dd");
-                    //data.IssueDt = data.IssueDt.DateFormat("yyyy-MM-dd");
-                    //data.ExpiryDt = data.ExpiryDt.DateFormat("yyyy-MM-dd");
+                    data.BirthDay = data.BirthDay?.DateFormat("yyyy-MM-dd") ?? "";
                     _result.Code = 0;
                     _result.Data = data;
                 }
@@ -448,13 +503,14 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 //团组客户信息名单操作
                 Grp_TourClientList _TourClientList = new Grp_TourClientList()
                 {
+                    IsAccompany = dto.IsAccompany,
                     DiId = dto.DiId,
                     ClientId = clientId,
                     ShippingSpaceTypeId = dto.ShippingSpaceTypeId,
                     ShippingSpaceSpecialNeeds = dto.ShippingSpaceSpecialNeeds,
                     HotelSpecialNeeds = dto.HotelSpecialNeeds,
                     MealSpecialNeeds = dto.MealSpecialNeeds,
-                    Remark = dto.Remark,
+                    Remark = dto.Remark ?? "",
                     CreateUserId = dto.UserId
                 };
 
@@ -475,6 +531,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     var certEdit = await _sqlSugar.Updateable(_TourClientList).UpdateColumns(it =>
                                                                                 new
                                                                                 {
+                                                                                    it.IsAccompany,
                                                                                     it.ClientId,
                                                                                     it.ShippingSpaceTypeId,
                                                                                     it.ShippingSpaceSpecialNeeds,
@@ -673,6 +730,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 Grp_TourClientList _TourClientList = new Grp_TourClientList()
                 {
                     DiId = _DiId,
+                    IsAccompany = item.IsAccompany,
                     ClientId = clientId,
                     ShippingSpaceTypeId = item.ShippingSpaceTypeId,
                     CreateUserId = _UserId,
@@ -682,7 +740,6 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     Remark = item.Remark
                 };
 
-
                 //判断现有团组客户名单是否存在该客户
                 var QuerFirstClient = _sqlSugar.Queryable<Grp_TourClientList>().First(x => x.ClientId == _TourClientList.ClientId && x.DiId == _TourClientList.DiId && x.IsDel == 0);
                 if (QuerFirstClient != null)
@@ -1012,7 +1069,6 @@ namespace OASystem.Infrastructure.Repositories.Groups
             return _result;
         }
 
-
         /// <summary>
         /// 分割客户名称
         /// </summary>

+ 140 - 2
OASystem/OASystem.Infrastructure/Repositories/Groups/VisaCommissionRepository.cs

@@ -1,4 +1,5 @@
 using AutoMapper;
+using OASystem.Domain.Dtos.Groups;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.ViewModels.Groups;
 using System;
@@ -25,14 +26,151 @@ namespace OASystem.Infrastructure.Repositories.Groups
         }
 
         /// <summary>
-        /// 基础数据
+        /// Init
         /// </summary>
         /// <returns></returns>
-        public async Task<JsonView> _Init()
+        public async Task<JsonView> Init()
         {
             var groupInfo = await _groupRep.GetGroupNameList(new Domain.Dtos.Groups.GroupNameDto() { PortType = 1 });
 
             return new JsonView() { Code = StatusCodes.Status200OK, Msg = "操作成功!", Data = new { GroupData = groupInfo.Data } };
         }
+
+        /// <summary>
+        /// Item
+        /// </summary>
+        /// <returns></returns>
+        public async Task<JsonView> Item(VisaCommissionItemDto _dto)
+        {
+            var data = await _sqlSugar.Queryable<Grp_VisaCommission>()
+                                      .Where(x => x.IsDel == 0 && x.DiId == _dto.DiId && x.UId == _dto.CurrUserId)
+                                      .Select(x => new
+                                      {
+                                          x.Id,
+                                          x.Country,
+                                          x.Quantity,
+                                          x.Remark
+                                      })
+                                      .ToListAsync();
+
+            var groupInfo = await _sqlSugar.Queryable<Grp_DelegationInfo>().Where(x => x.IsDel == 0 && x.Id == _dto.DiId).FirstAsync();
+            if (groupInfo != null)
+            {
+                string[] countryArray = _groupRep.GroupSplitCountry(groupInfo.VisitCountry).ToArray();
+                foreach (string country in countryArray)
+                {
+                    if (data.Find(x => country.Equals(x.Country)) == null)
+                    {
+                        data.Add(new
+                        {
+                            Id = 0,
+                            Country = country,
+                            Quantity = 0,
+                            Remark = ""
+                        });
+                    }
+                }
+            }
+            return new JsonView() { Code = StatusCodes.Status200OK, Msg = "操作成功!", Data = data };
+        }
+
+
+        /// <summary>
+        /// Create
+        /// </summary>
+        /// <returns></returns>
+        public async Task<JsonView> Create(VisaCommissionCreateDto _dto)
+        {
+            var _view = new JsonView() { Code = StatusCodes.Status400BadRequest, Msg = "操作失败!" };
+
+            //添加查重
+            var info = await _sqlSugar.Queryable<Grp_VisaCommission>()
+                                      .Where(x => x.IsDel == 0 && x.DiId == _dto.DiId && x.Country.Equals(_dto.Country))
+                                      .FirstAsync();
+            //if (info != null)
+            //{
+            //    _view.Code = StatusCodes.Status400BadRequest;
+            //    _view.Msg = "该数据已存在请勿重新添加!";
+
+            //    return _view;
+            //}
+
+            var createInfo =  _mapper.Map<Grp_VisaCommission>(_dto);
+            createInfo.CreateUserId = _dto.CurrUserId;
+            createInfo.UId = _dto.CurrUserId;
+
+
+            var createStatus = await _sqlSugar.Insertable<Grp_VisaCommission>(createInfo)
+                                              .ExecuteCommandAsync();
+            if (createStatus > 0)
+            {
+                _view.Code = StatusCodes.Status200OK;
+                _view.Msg = "操作成功!";
+                return _view;
+            }
+            return _view;
+        }
+
+
+        /// <summary>
+        /// Edit
+        /// </summary>
+        /// <param name="id"></param>
+        /// <param name="_dto"></param>
+        /// <returns></returns>
+        public async Task<JsonView> Edit(int id,VisaCommissionCreateDto _dto)
+        {
+            var _view = new JsonView() { Code = StatusCodes.Status204NoContent, Msg = "操作失败!" };
+
+            var editInfo = _mapper.Map<Grp_VisaCommission>(_dto);
+            editInfo.CreateUserId = _dto.CurrUserId;
+            editInfo.UId = _dto.CurrUserId;
+
+            var editStatus = await _sqlSugar.Updateable<Grp_VisaCommission>(editInfo)
+                                            .UpdateColumns(x => new
+                                            {
+                                                x.Country,
+                                                x.Quantity,
+                                                x.Remark
+                                            })
+                                            .Where(x => x.Id == id)
+                                            .ExecuteCommandAsync();
+            if (editStatus > 0)
+            {
+                _view.Code = StatusCodes.Status200OK;
+                _view.Msg = "操作成功!";
+                return _view;
+            }
+            return _view;
+        }
+
+        /// <summary>
+        /// Del
+        /// </summary>
+        /// <param name="id"></param>
+        /// <param name="currUserId"></param>
+        /// <returns></returns>
+        public async Task<JsonView> Del(int id,int currUserId)
+        {
+            var _view = new JsonView() { Code = StatusCodes.Status204NoContent, Msg = "操作失败!" };
+
+            var editStatus = await _sqlSugar.Updateable<Grp_VisaCommission>()
+                                            .SetColumns(x => new Grp_VisaCommission
+                                            {
+                                                DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
+                                                DeleteUserId = currUserId,
+                                            })
+                                            .Where(x => x.Id == id)
+                                            .ExecuteCommandAsync();
+            if (editStatus > 0)
+            {
+                _view.Code = StatusCodes.Status200OK;
+                _view.Msg = "操作成功!";
+                return _view;
+            }
+            return _view;
+        }
+
+
     }
 }

+ 6 - 1
OASystem/OASystem.Infrastructure/Repositories/Resource/OfficialActivitiesRepository.cs

@@ -44,6 +44,7 @@ namespace OASystem.Infrastructure.Repositories.Resource
             }
             string sql = string.Format(@"
 SELECT
+  sd1.Name AS NatureName,
   *,
   u.CnName AS CreateUserName,
   sd.Name AS OfficialFormName
@@ -51,6 +52,7 @@ FROM
   Res_OfficialActivities o
   LEFT JOIN Sys_SetData sd ON o.OfficialForm = sd.Id
   LEFT JOIN Sys_Users u ON o.CreateUserId = u.Id
+  LEFT JOIN Sys_SetData sd1 ON o.NatureId = sd1.Id
 {0}
 ORDER BY
   o.CreateTime desc
@@ -216,7 +218,7 @@ FROM
 
             if (dto.Status == 1)//添加
             {
-                var res_InvitationOfficial = await _sqlSugar.Queryable< Res_OfficialActivities >().FirstAsync(x=>x.Client == dto.Client && x.Address == dto.Address && x.IsDel == 0 && x.DiId == dto.DiId);
+                var res_InvitationOfficial = await _sqlSugar.Queryable<Res_OfficialActivities>().FirstAsync(x => x.Client == dto.Client && x.Address == dto.Address && x.IsDel == 0 && x.DiId == dto.DiId);
 
                 if (res_InvitationOfficial != null)
                 {
@@ -268,6 +270,9 @@ FROM
                     Remark = dto.Remark,
                     IsPay = dto.IsPay,
                     IsSubmitApproval = dto.IsSubmitApproval,
+                    EmailOrWeChat = dto.EmailOrWeChat,
+                    Website = dto.Website,
+                    NatureId = dto.NatureId,
                 });
                 if (res)
                 {