Browse Source

费用审核
DeBug

leiy 1 year ago
parent
commit
9ff7fc6042
1 changed files with 241 additions and 214 deletions
  1. 241 214
      OASystem/OASystem.Api/Controllers/GroupsController.cs

+ 241 - 214
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -35,6 +35,8 @@ using static QRCoder.PayloadGenerator;
 using Bookmark = Aspose.Words.Bookmark;
 using Aspose.Words.Fields;
 using NPOI.POIFS.FileSystem;
+using Microsoft.AspNetCore.Mvc.ViewEngines;
+using OASystem.Domain.ViewModels.QiYeWeChat;
 
 namespace OASystem.API.Controllers
 {
@@ -909,263 +911,288 @@ namespace OASystem.API.Controllers
         /// </summary>
         /// <param name="paras">参数Json字符串</param>
         /// <returns></returns>
-        
+
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> PostSearchGrpCreditCardPayment(Search_GrpCreditCardPaymentDto _dto)
         {
-            #region  参数验证
-            if (_dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
-            if (_dto.PageId < 1) return Ok(JsonView(false, "页面Id为空"));
-            if (_dto.DiId < 1) return Ok(JsonView(false, "团组Id为空"));
+            try
+            {
+                #region  参数验证
+                if (_dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
+                if (_dto.PageId < 1) return Ok(JsonView(false, "页面Id为空"));
+                if (_dto.DiId < 1) return Ok(JsonView(false, "团组Id为空"));
 
-            PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
+                PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
 
-            #region 页面操作权限验证
-            pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(_dto.UserId,_dto.PageId);
+                #region 页面操作权限验证
+                pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(_dto.UserId, _dto.PageId);
 
-            if (pageFunAuthView.CheckAuth == 0) return Ok(JsonView(false, "您没有查看权限"));
-            #endregion
-            
-            #endregion
+                if (pageFunAuthView.CheckAuth == 0) return Ok(JsonView(false, "您没有查看权限"));
+                #endregion
 
-            Grp_CreditCardPaymentView _view = new Grp_CreditCardPaymentView();
+                #endregion
 
-            #region 费用清单
-            var exp = Expressionable.Create<Grp_CreditCardPayment>();
-            exp.AndIF(_dto.AuditStatus != -1, it => it.IsAuditGM == _dto.AuditStatus);
-            exp.AndIF(_dto.Label != -1, it => it.CTable == _dto.Label);
+                Grp_CreditCardPaymentView _view = new Grp_CreditCardPaymentView();
 
-            List<Grp_CreditCardPayment> entityList = _groupRepository
-                .Query<Grp_CreditCardPayment>(s => s.DIId == _dto.DiId && s.IsDel == 0 && s.CreateUserId > 0)
-                .Where(exp.ToExpression())
-                .ToList();
+                #region 费用清单
+                var exp = Expressionable.Create<Grp_CreditCardPayment>();
+                exp.AndIF(_dto.AuditStatus != -1, it => it.IsAuditGM == _dto.AuditStatus);
+                exp.AndIF(_dto.Label != -1, it => it.CTable == _dto.Label);
 
-            
-            List<Grp_CreditCardPaymentDetailView> detailList = new List<Grp_CreditCardPaymentDetailView>();
+                List<Grp_CreditCardPayment> entityList = _groupRepository
+                    .Query<Grp_CreditCardPayment>(s => s.DIId == _dto.DiId && s.IsDel == 0 && s.CreateUserId > 0)
+                    .Where(exp.ToExpression())
+                    .ToList();
 
-            List<CreditCardPaymentCurrencyPriceItem> ccpCurrencyPrices = new List<CreditCardPaymentCurrencyPriceItem>();
-           
-            /*
-             * 币种信息
-             */
 
-            var currencyItems = await _groupRepository.Query<Sys_SetData>(s => s.STid == 66 && s.IsDel == 0).ToListAsync();
+                List<Grp_CreditCardPaymentDetailView> detailList = new List<Grp_CreditCardPaymentDetailView>();
 
-            /*
-             * 用户信息
-             */
+                List<CreditCardPaymentCurrencyPriceItem> ccpCurrencyPrices = new List<CreditCardPaymentCurrencyPriceItem>();
 
-            var userItems = await _groupRepository.Query<Sys_Users>(s => s.IsDel == 0).ToListAsync();
+                /*
+                 *  Label = 98 其他款项
+                 */
 
-            /*
-             * 处理详情数据 
-             */
-            foreach (var entity in entityList)
-            {
-                Grp_CreditCardPaymentDetailView _detail = new Grp_CreditCardPaymentDetailView();
+                List<Grp_DecreasePayments> _DecreasePayments = await _groupRepository
+                                                                    .Query<Grp_DecreasePayments>(s => s.DiId == _dto.DiId && s.IsDel == 0)
+                                                                    .ToListAsync();
+                /*
+                 *  Lable = 85 机票预订
+                 */
 
-                _detail.Id = entity.Id;
+                List<Grp_AirTicketReservations> p_AirTicketReservations = await _groupRepository
+                                                                    .Query<Grp_AirTicketReservations>(s => s.DIId == _dto.DiId && s.IsDel == 0)
+                                                                    .ToListAsync();
 
                 /*
-                 * Bus名称
+                 * 币种信息
                  */
-                _detail.BusName = "";
+
+                var currencyItems = await _groupRepository.Query<Sys_SetData>(s => s.STid == 66 && s.IsDel == 0).ToListAsync();
 
                 /*
-                 *费用所属
+                 * 用户信息
                  */
-                switch (entity.CTable)
-                {
-                    case 85:
-                        Grp_AirTicketReservations jpRes = _groupRepository.Query<Grp_AirTicketReservations>(s => s.Id == entity.CId).First();
-                        if (jpRes != null)
-                        {
-                            string FlightsDescription = jpRes.FlightsDescription;
-                            string PriceDescription = jpRes.PriceDescription;
-                            _detail.PriceMsgContent = "航班号:" + jpRes.FlightsCode + "<br/>城市A-B:" + jpRes.FlightsCity + "<br/>航班描述:" + FlightsDescription.Replace("\r\n", "<br />") + "<br/>" + "价格描述:" + PriceDescription;
-                            _detail.PriceNameContent = "(" + jpRes.FlightsCode + ")";
-                        }
-                        break;
-                    case 79:
-                        _detail.BusName = "待增加";
-                        break;
-                    case 98:
-                        Grp_DecreasePayments gdpRes = _groupRepository.Query<Grp_DecreasePayments>(s => s.Id == entity.CId).First();
-                        if (gdpRes != null)
-                        {
-                            _detail.PriceMsgContent = "备注:" + gdpRes.Remark;
-                            _detail.PriceNameContent = gdpRes.PriceName;
-                        }
-                        break;
-                    default:
-                        break;
-                }
+
+                var userItems = await _groupRepository.Query<Sys_Users>(s => s.IsDel == 0).ToListAsync();
 
                 /*
-                 * 费用模块
-                 */
-                Sys_SetData sdPriceName = _groupRepository.Query<Sys_SetData>(s => s.Id == entity.CTable).First();
+                    * 费用模块
+                    */
+                Sys_SetData sdPriceName = _groupRepository.Query<Sys_SetData>(s => s.Id == _dto.Label).First();
+                string priceModule = string.Empty;
                 if (sdPriceName != null)
                 {
-                    _detail.PriceName = sdPriceName.Name;
+                    priceModule = sdPriceName.Name;
                 }
 
                 /*
-                 * 应付款金额	
+                 * 处理详情数据 
                  */
-                Sys_SetData sdPaymentCurrency_WaitPay = currencyItems.Where(s => s.Id == entity.PaymentCurrency).First();
-                string PaymentCurrency_WaitPay = "Unknown";
-                if (sdPaymentCurrency_WaitPay != null)
+                foreach (var entity in entityList)
                 {
-                    PaymentCurrency_WaitPay = sdPaymentCurrency_WaitPay.Name;
-                }
-                _detail.WaitPay = entity.PayMoney.ConvertToDecimal1() + " " + PaymentCurrency_WaitPay;
+                    Grp_CreditCardPaymentDetailView _detail = new Grp_CreditCardPaymentDetailView();
 
-                /*
-                 * 此次付款金额
-                 */
-                decimal CurrPayStr = 0;
-                if (entity.PayPercentage == 0)
-                {
-                    if (entity.PayThenMoney != 0)
-                        CurrPayStr = (entity.PayThenMoney * entity.DayRate).ConvertToDecimal1();
-                }
-                else
-                {
-                    CurrPayStr = (entity.PayMoney * (decimal.Parse(entity.PayPercentage.ToString("#0.00")) / 100 * entity.DayRate)).ConvertToDecimal1();
-                }
-                _detail.CurrPay = CurrPayStr.ToString("#0.00") + " CNY";
+                    _detail.Id = entity.Id;
 
-                /*
-                 * 剩余尾款
-                 */
-                decimal BalanceStr = 0;
-                if (entity.PayMoney - (CurrPayStr / entity.DayRate) < 0.01M)
-                    BalanceStr = 0;
-                else
-                    BalanceStr = (entity.PayMoney - CurrPayStr / entity.DayRate).ConvertToDecimal1();
+                    /*
+                     * Bus名称
+                     */
+                    _detail.BusName = "";
 
-                _detail.Balance = BalanceStr.ToString("#0.00") + " " + PaymentCurrency_WaitPay;
+                    /*
+                     *费用所属
+                     */
+                    switch (entity.CTable)
+                    {
+                        case 85:
+                            Grp_AirTicketReservations jpRes = _groupRepository.Query<Grp_AirTicketReservations>(s => s.Id == entity.CId).First();
+                            if (jpRes != null)
+                            {
+                                string FlightsDescription = jpRes.FlightsDescription;
+                                string PriceDescription = jpRes.PriceDescription;
+                                _detail.PriceMsgContent = "航班号:" + jpRes.FlightsCode + "<br/>城市A-B:" + jpRes.FlightsCity + "<br/>航班描述:" + FlightsDescription.Replace("\r\n", "<br />") + "<br/>" + "价格描述:" + PriceDescription;
+                                _detail.PriceNameContent = "(" + jpRes.FlightsCode + ")";
+                            }
+                            break;
+                        case 79:
+                            _detail.BusName = "待增加";
+                            break;
+                        case 98:
+                            Grp_DecreasePayments gdpRes = _DecreasePayments.Where(s => s.Id == entity.CId).FirstOrDefault();
+                            if (gdpRes != null)
+                            {
+                                _detail.PriceMsgContent = "备注:" + gdpRes.Remark;
+                                _detail.PriceNameContent = gdpRes.PriceName;
+                            }
+                            break;
+                        default:
+                            break;
+                    }
 
-                /*
-                 * 申请人
-                 */
-                string operatorName = " - ";
-                Sys_Users _opUser = userItems.Where(s => s.Id == entity.CreateUserId).First();
-                if (_opUser != null)
-                {
-                    operatorName = _opUser.CnName;
-                }
-                _detail.OperatorName = operatorName;
+                    _detail.PriceName = priceModule;
 
-                /*
-                * 审核人
-                */
-                string auditOperatorName = "Unknown";
-                if (entity.AuditGMOperate == 0)
-                    auditOperatorName = " - ";
-                else if (entity.AuditGMOperate == 4)
-                    auditOperatorName = "自动审核";
-                else
-                {
-                    Sys_Users _adUser = userItems.Where(s => s.Id == entity.AuditGMOperate).First();
-                    if (_adUser != null)
+                    /*
+                     * 应付款金额	
+                     */
+                    Sys_SetData sdPaymentCurrency_WaitPay = currencyItems.Where(s => s.Id == entity.PaymentCurrency).FirstOrDefault();
+                    string PaymentCurrency_WaitPay = "Unknown";
+                    if (sdPaymentCurrency_WaitPay != null)
                     {
-                        auditOperatorName = _adUser.CnName;
+                        PaymentCurrency_WaitPay = sdPaymentCurrency_WaitPay.Name;
                     }
-                }
-                _detail.AuditOperatorName = auditOperatorName;
+                    _detail.WaitPay = entity.PayMoney.ConvertToDecimal1() + " " + PaymentCurrency_WaitPay;
 
-                /*
-                 * 超预算比例
-                 */
-                string overBudgetStr = "";
+                    /*
+                     * 此次付款金额
+                     */
+                    decimal CurrPayStr = 0;
+                    if (entity.PayPercentage == 0)
+                    {
+                        if (entity.PayThenMoney != 0)
+                            CurrPayStr = (entity.PayThenMoney * entity.DayRate).ConvertToDecimal1();
+                    }
+                    else
+                    {
+                        CurrPayStr = (entity.PayMoney * (decimal.Parse(entity.PayPercentage.ToString("#0.00")) / 100 * entity.DayRate)).ConvertToDecimal1();
+                    }
+                    _detail.CurrPay = CurrPayStr.ToString("#0.00") + " CNY";
+
+                    /*
+                     * 剩余尾款
+                     */
+                    decimal BalanceStr = 0;
+                    if (entity.PayMoney - (CurrPayStr / entity.DayRate) < 0.01M)
+                        BalanceStr = 0;
+                    else
+                        BalanceStr = (entity.PayMoney - CurrPayStr / entity.DayRate).ConvertToDecimal1();
 
-                if (entity.ExceedBudget == -1)
-                    overBudgetStr = sdPriceName.Name + "尚无预算";
-                else if (entity.ExceedBudget == 0)
-                    overBudgetStr = "未超预算";
-                else
-                    overBudgetStr = entity.ExceedBudget.ToString("P");
-                _detail.OverBudget = overBudgetStr;
+                    _detail.Balance = BalanceStr.ToString("#0.00") + " " + PaymentCurrency_WaitPay;
 
+                    /*
+                     * 申请人
+                     */
+                    string operatorName = " - ";
+                    Sys_Users _opUser = userItems.Where(s => s.Id == entity.CreateUserId).FirstOrDefault();
+                    if (_opUser != null)
+                    {
+                        operatorName = _opUser.CnName;
+                    }
+                    _detail.OperatorName = operatorName;
+
+                    /*
+                    * 审核人
+                    */
+                    string auditOperatorName = "Unknown";
+                    if (entity.AuditGMOperate == 0)
+                        auditOperatorName = " - ";
+                    else if (entity.AuditGMOperate == 4)
+                        auditOperatorName = "自动审核";
+                    else
+                    {
+                        Sys_Users _adUser = userItems.Where(s => s.Id == entity.AuditGMOperate).FirstOrDefault();
+                        if (_adUser != null)
+                        {
+                            auditOperatorName = _adUser.CnName;
+                        }
+                    }
+                    _detail.AuditOperatorName = auditOperatorName;
 
-                /*
-                 * 费用总计
-                 */
+                    /*
+                     * 超预算比例
+                     */
+                    string overBudgetStr = "";
 
-                ccpCurrencyPrices.Add(new CreditCardPaymentCurrencyPriceItem()
-                {
-                    CurrencyId = entity.PaymentCurrency,
-                    CurrencyName = PaymentCurrency_WaitPay,
-                    AmountPayable = entity.PayMoney,
-                    ThisPayment = CurrPayStr,
-                    BalancePayment = BalanceStr,
-                    AuditedFunds = CurrPayStr
-                });
+                    if (entity.ExceedBudget == -1)
+                        overBudgetStr = sdPriceName.Name + "尚无预算";
+                    else if (entity.ExceedBudget == 0)
+                        overBudgetStr = "未超预算";
+                    else
+                        overBudgetStr = entity.ExceedBudget.ToString("P");
+                    _detail.OverBudget = overBudgetStr;
 
-                _detail.IsAuditGM = entity.IsAuditGM;
 
-                detailList.Add(_detail);
-            }
+                    /*
+                     * 费用总计
+                     */
+                    ccpCurrencyPrices.Add(new CreditCardPaymentCurrencyPriceItem()
+                    {
+                        CurrencyId = entity.PaymentCurrency,
+                        CurrencyName = PaymentCurrency_WaitPay,
+                        AmountPayable = entity.PayMoney,
+                        ThisPayment = CurrPayStr,
+                        BalancePayment = BalanceStr,
+                        AuditedFunds = CurrPayStr
+                    });
 
-            #endregion
+                    _detail.IsAuditGM = entity.IsAuditGM;
 
-            _view.DetailList = new List<Grp_CreditCardPaymentDetailView>(detailList);
+                    detailList.Add(_detail);
+                }
 
+                #endregion
 
-            /*
-             * 下方描述处理
-             */
+                _view.DetailList = new List<Grp_CreditCardPaymentDetailView>(detailList);
 
-            List<CreditCardPaymentCurrencyPriceItem> nonDuplicat = ccpCurrencyPrices.Where((x, i) => ccpCurrencyPrices.FindIndex(z => z.CurrencyId == x.CurrencyId) == i).ToList();//Lambda表达式去重 
 
-            CreditCardPaymentCurrencyPriceItem ccpCurrencyPrice = nonDuplicat.Where(it => it.CurrencyId == 836).FirstOrDefault();
-            if (ccpCurrencyPrice != null)
-            {
-                int CNYIndex = nonDuplicat.IndexOf(ccpCurrencyPrice);
-                nonDuplicat.MoveItemAtIndexToFront(CNYIndex);
+                /*
+                 * 下方描述处理
+                 */
 
-            }
-            else
-            {
-                nonDuplicat.OrderBy(it => it.CurrencyId).ToList();
-            }
-            string amountPayableStr = string.Format(@"应付款总金额: ");
-            string thisPaymentStr = string.Format(@"此次付款总金额: ");
-            string balancePaymentStr = string.Format(@"目前剩余尾款总金额: ");
-            string auditedFundsStr = string.Format(@"已审费用总额: ");
+                List<CreditCardPaymentCurrencyPriceItem> nonDuplicat = ccpCurrencyPrices.Where((x, i) => ccpCurrencyPrices.FindIndex(z => z.CurrencyId == x.CurrencyId) == i).ToList();//Lambda表达式去重 
 
-            foreach (var item in nonDuplicat)
-            {
-                var strs = ccpCurrencyPrices.Where(it => it.CurrencyId == item.CurrencyId).ToList();
-                if (strs.Count > 0)
+                CreditCardPaymentCurrencyPriceItem ccpCurrencyPrice = nonDuplicat.Where(it => it.CurrencyId == 836).FirstOrDefault();
+                if (ccpCurrencyPrice != null)
                 {
-                    decimal amountPayable = strs.Sum(it => it.AmountPayable);
-                    decimal thisPayment = strs.Sum(it => it.ThisPayment);
-                    decimal balancePayment = strs.Sum(it => it.BalancePayment);
-                    decimal auditedFunds = strs.Sum(it => it.AuditedFunds);
-                    amountPayableStr += string.Format(@"{0}{1}&nbsp;|", amountPayable.ToString("#0.00"), item.CurrencyName);
-                    thisPaymentStr += string.Format(@"{0}{1}&nbsp;|", thisPayment.ToString("#0.00"), item.CurrencyName);
-                    balancePaymentStr += string.Format(@"{0}{1}&nbsp;|", balancePayment.ToString("#0.00"), item.CurrencyName);
-                    auditedFundsStr += string.Format(@"{0}{1}&nbsp;|", auditedFunds.ToString("#0.00"), item.CurrencyName);
+                    int CNYIndex = nonDuplicat.IndexOf(ccpCurrencyPrice);
+                    nonDuplicat.MoveItemAtIndexToFront(CNYIndex);
+
+                }
+                else
+                {
+                    nonDuplicat.OrderBy(it => it.CurrencyId).ToList();
+                }
+                string amountPayableStr = string.Format(@"应付款总金额: ");
+                string thisPaymentStr = string.Format(@"此次付款总金额: ");
+                string balancePaymentStr = string.Format(@"目前剩余尾款总金额: ");
+                string auditedFundsStr = string.Format(@"已审费用总额: ");
+
+                foreach (var item in nonDuplicat)
+                {
+                    var strs = ccpCurrencyPrices.Where(it => it.CurrencyId == item.CurrencyId).ToList();
+                    if (strs.Count > 0)
+                    {
+                        decimal amountPayable = strs.Sum(it => it.AmountPayable);
+                        decimal thisPayment = strs.Sum(it => it.ThisPayment);
+                        decimal balancePayment = strs.Sum(it => it.BalancePayment);
+                        decimal auditedFunds = strs.Sum(it => it.AuditedFunds);
+                        amountPayableStr += string.Format(@"{0}{1}&nbsp;|", amountPayable.ToString("#0.00"), item.CurrencyName);
+                        thisPaymentStr += string.Format(@"{0}{1}&nbsp;|", thisPayment.ToString("#0.00"), item.CurrencyName);
+                        balancePaymentStr += string.Format(@"{0}{1}&nbsp;|", balancePayment.ToString("#0.00"), item.CurrencyName);
+                        auditedFundsStr += string.Format(@"{0}{1}&nbsp;|", auditedFunds.ToString("#0.00"), item.CurrencyName);
+                    }
                 }
-            }
 
-            _view.TotalStr1 = amountPayableStr.Substring(0, amountPayableStr.Length - 1);
-            _view.TotalStr2 = thisPaymentStr.Substring(0, thisPaymentStr.Length - 1);
-            _view.TotalStr3 = balancePaymentStr.Substring(0, balancePaymentStr.Length - 1);
-            _view.TotalStr4 = auditedFundsStr.Substring(0, auditedFundsStr.Length - 1);
+                _view.TotalStr1 = amountPayableStr.Substring(0, amountPayableStr.Length - 1);
+                _view.TotalStr2 = thisPaymentStr.Substring(0, thisPaymentStr.Length - 1);
+                _view.TotalStr3 = balancePaymentStr.Substring(0, balancePaymentStr.Length - 1);
+                _view.TotalStr4 = auditedFundsStr.Substring(0, auditedFundsStr.Length - 1);
 
 
-            var _view1 = new
+                var _view1 = new
+                {
+                    PageFuncAuth = pageFunAuthView,
+                    Data = _view
+                };
+
+                return Ok(JsonView(_view1));
+            }
+            catch (Exception ex)
             {
-                PageFuncAuth = pageFunAuthView,
-                Data = _view
-            };
 
-            return Ok(JsonView(_view1));
+                return Ok(JsonView(false, ex.Message));
+            }
         }
 
 
@@ -3494,10 +3521,10 @@ namespace OASystem.API.Controllers
             {
                 _sqlSugar.BeginTran();
                 isTrue = await _GroupCostRepository.
-                    SaveGroupCostList(Grp_groups,dto.Diid); //列表
-                isTrue = await _checkBoxs.SaveCheckBoxs(Grp_CheckBoxs,dto.Diid); //选中项
-                isTrue = await _CostTypeHotelNumberRepository.SaveHotelNumber(Grp_HotelNumber,dto.Userid,dto.Diid); //酒店房间数量
-                isTrue = await _GroupCostParameterRepository.SaveAsync(Grp_CostParameters , dto.Userid ,dto.Diid); //系数
+                    SaveGroupCostList(Grp_groups, dto.Diid); //列表
+                isTrue = await _checkBoxs.SaveCheckBoxs(Grp_CheckBoxs, dto.Diid); //选中项
+                isTrue = await _CostTypeHotelNumberRepository.SaveHotelNumber(Grp_HotelNumber, dto.Userid, dto.Diid); //酒店房间数量
+                isTrue = await _GroupCostParameterRepository.SaveAsync(Grp_CostParameters, dto.Userid, dto.Diid); //系数
 
                 _sqlSugar.CommitTran();
                 jw = JsonView(true, "保存成功!", isTrue);
@@ -3791,8 +3818,8 @@ namespace OASystem.API.Controllers
                     }
                     throw;
                 }
-               
-                
+
+
             }
             catch (Exception ex)
             {
@@ -3819,12 +3846,12 @@ namespace OASystem.API.Controllers
                 if (!string.IsNullOrEmpty(h.DetermineNo))
                 {
                     string strFileName = "HotelStatement/";
-                    Grp_DelegationInfo dele= _sqlSugar.Queryable<Grp_DelegationInfo>().First(a => a.Id == h.DiId && a.IsDel == 0);
+                    Grp_DelegationInfo dele = _sqlSugar.Queryable<Grp_DelegationInfo>().First(a => a.Id == h.DiId && a.IsDel == 0);
                     if (dele != null)
                         strFileName += dele.TourCode;
 
-                    
-                     //载入模板
+
+                    //载入模板
                     string sss = AppSettingsHelper.Get("WordBasePath") + "Template/酒店预订模板.doc";
 
                     Document doc = new Document(sss);
@@ -3835,7 +3862,7 @@ namespace OASystem.API.Controllers
 
                         //这里可以创建个DataTable循环添加书签的值,这里提示一下就不多做修改了
                         //入住卷预定号码
-                       
+
                         if (doc.Range.Bookmarks["VNO"] != null)
                         {
                             Bookmark mark = doc.Range.Bookmarks["VNO"];
@@ -3898,7 +3925,7 @@ namespace OASystem.API.Controllers
                             {
                                 mark.Text = h.HotelFax;
                             }
-                            
+
                         }
                         //入住时间
                         if (doc.Range.Bookmarks["CIn"] != null)
@@ -3932,7 +3959,7 @@ namespace OASystem.API.Controllers
                         if (doc.Range.Bookmarks["NOTE"] != null)
                         {
                             Bookmark mark = doc.Range.Bookmarks["NOTE"];
-                            Sys_SetData ss = _sqlSugar.Queryable<Sys_SetData>().First(a=>a.Id==h.ReservationsWebsite);
+                            Sys_SetData ss = _sqlSugar.Queryable<Sys_SetData>().First(a => a.Id == h.ReservationsWebsite);
                             if (ss != null)
                                 mark.Text = ss.Name;
                         }
@@ -3974,20 +4001,20 @@ namespace OASystem.API.Controllers
 
                         strFileName += "VOUCHER.doc";
 
-                        var fileDir = AppSettingsHelper.Get("WordBasePath")+ strFileName;
+                        var fileDir = AppSettingsHelper.Get("WordBasePath") + strFileName;
                         doc.Save(fileDir);
                         string Url = AppSettingsHelper.Get("WordBaseUrl") + "Office/Word/" + strFileName;
                         return Ok(JsonView(true, "成功!", Url));
 
                         //保存为doc,并打开 
-                        
+
                     }
                     catch (Exception ex)
                     {
 
                         throw;
                     }
-                    
+
                 }
                 else
                 {
@@ -3998,7 +4025,7 @@ namespace OASystem.API.Controllers
             {
                 return Ok(JsonView(false, "酒店确定号码未填写,无法生成Voucher!"));
             }
-            
+
         }
 
 
@@ -4448,8 +4475,8 @@ namespace OASystem.API.Controllers
                         return Ok(JsonView(false, "失败!"));
                     }
                 }
-                
-                
+
+
             }
             catch (Exception ex)
             {