Browse Source

修改op费用返回参数

wangh 1 year ago
parent
commit
006e8ea94c

+ 38 - 7
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -3529,7 +3529,7 @@ namespace OASystem.API.Controllers
         }
 
         /// <summary>
-        /// 根酒店费用操作(Status:1.新增,2.修改)
+        /// 根酒店费用操作(Status:1.新增,2.修改)
         /// </summary>
         /// <param name="dto"></param>
         /// <returns></returns>
@@ -3553,7 +3553,7 @@ namespace OASystem.API.Controllers
         }
 
         /// <summary>
-        /// region 文件上传
+        ///  文件上传
         /// </summary>
         /// <param name="file"></param>
         /// <returns></returns>
@@ -3840,8 +3840,6 @@ namespace OASystem.API.Controllers
         }
 
 
-        #endregion
-
         /// <summary>
         /// 导出确认单
         /// </summary>
@@ -3856,7 +3854,7 @@ namespace OASystem.API.Controllers
             Grp_DelegationInfo di = _sqlSugar.Queryable<Grp_DelegationInfo>().First(a => a.Id == dto.Id);
 
             //酒店数据
-            List<Grp_HotelReservations> listhoteldata = _sqlSugar.Queryable<Grp_HotelReservations>().Where(a => a.DiId == dto.Id && a.IsDel==0).ToList();
+            List<Grp_HotelReservations> listhoteldata = _sqlSugar.Queryable<Grp_HotelReservations>().Where(a => a.DiId == dto.Id && a.IsDel == 0).ToList();
 
             //利datatable存储
             DataTable dt = new DataTable();
@@ -3961,10 +3959,42 @@ namespace OASystem.API.Controllers
                 return Ok(JsonView(false, "当前文档已打开,请先关闭!"));
                 throw;
             }
-            
+
             //doc.Save(HttpUtility.UrlEncode(strFileName, Encoding.UTF8), Aspose.Words.SaveFormat.Doc, Aspose.Words.SaveType.OpenInWord, Response);
-            
+
+        }
+
+        /// <summary>
+        /// 酒店费用删除
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> DelHotelPrice(DelBaseDto dto)
+        {
+            try
+            {
+                var res = await _hotelPriceRep.SoftDeleteByIdAsync<Grp_HotelReservations>(dto.Id.ToString(), dto.DeleteUserId);
+                if (!res)
+                {
+                    return Ok(JsonView(false, "删除失败"));
+                }
+                var resultC = await _sqlSugar.Updateable<Grp_CreditCardPayment>().Where(a => a.CId == dto.Id && a.IsDel == 0 && a.CTable == 76).SetColumns(a => new Grp_CreditCardPayment()
+                {
+                    IsDel = 1,
+                    DeleteUserId = dto.DeleteUserId,
+                    DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
+                }).ExecuteCommandAsync();
+                return Ok(JsonView(true, "删除成功!"));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, "程序错误!"));
+                throw;
+            }
         }
+        #endregion
 
         #region 团组状态
 
@@ -4060,6 +4090,7 @@ namespace OASystem.API.Controllers
 
         }
 
+        
         #endregion
     }
 }

+ 9 - 0
OASystem/OASystem.Domain/ViewModels/Groups/Grp_CarTouristGuideGroundView.cs

@@ -35,5 +35,14 @@ namespace OASystem.Domain.ViewModels.Groups
         /// 币种
         /// </summary>
         public string CurrencyStr { get; set; }
+
+        /// <summary>
+        /// 支付方式
+        /// </summary>
+        public int PayDid { get; set; }
+        /// <summary>
+        /// 支付方式str
+        /// </summary>
+        public string PayStrd { get; set; }
     }
 }

+ 13 - 2
OASystem/OASystem.Infrastructure/Repositories/Groups/CarTouristGuideGroundRepository.cs

@@ -244,7 +244,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 int endIndex = startIndex + dto.PageSize - 1;
                 if (dto.PortType == 1)
                 {
-                    string sql = string.Format(@"select t.*,s.Name as CurrencyStr,c.IsAuditGM,c.PayPercentage,c.PayMoney from 
+                    string sql = string.Format(@"select t.*,s.Name as CurrencyStr,c.IsAuditGM,c.PayPercentage,c.PayMoney,c.PayDid from 
                                                 Grp_CarTouristGuideGroundReservations t
                                                 left Join Grp_CreditCardPayment c on CTable=79 and c.CId=t.Id  and c.isdel=0
                                                 left Join Sys_SetData s on s.Id=c.PaymentCurrency {0}
@@ -255,13 +255,18 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         item.ServiceQuotedPrice = item.PayMoney;
                         item.PayThenMoney = Math.Round(item.PayPercentage/100 * item.ServiceQuotedPrice, 2);
                         item.RemainingBalance = Math.Round(item.ServiceQuotedPrice- item.PayPercentage / 100 * item.ServiceQuotedPrice);
+                        Sys_SetData s = _sqlSugar.Queryable<Sys_SetData>().First(a=>a.IsDel==0 && a.Id==item.PayDid);
+                        if (s!=null)
+                        {
+                            item.PayStrd = s.Name;
+                        }
                     }
                     return result = new Result() { Code = 0, Msg = "查询成功!", Data = infoViews };
                 }
                 else if (dto.PortType == 2 || dto.PortType == 3)
                 {
                     string sql = string.Format(@"Select * From (	
-                                            Select row_number() over (order by c.IsAuditGM,c.PayPercentage desc) as RowNumber,t.*,s.Name as CurrencyStr,c.IsAuditGM,c.PayPercentage
+                                            Select row_number() over (order by c.IsAuditGM,c.PayPercentage desc) as RowNumber,t.*,s.Name as CurrencyStr,c.IsAuditGM,c.PayPercentage,c.PayDid
                                             from 
                                             Grp_CarTouristGuideGroundReservations t
                                             Join Grp_CreditCardPayment c on CTable=79 and c.CId=t.Id  and c.isdel=0
@@ -271,8 +276,14 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     List<Grp_CarTouristGuideGroundView> grp_CarTourists = _sqlSugar.SqlQueryable<Grp_CarTouristGuideGroundView>(sql).ToList();
                     foreach (var item in grp_CarTourists)
                     {
+                        item.ServiceQuotedPrice = item.PayMoney;
                         item.PayThenMoney = Math.Round(item.PayPercentage / 100 * item.ServiceQuotedPrice, 2);
                         item.RemainingBalance = Math.Round(item.ServiceQuotedPrice - item.PayPercentage / 100 * item.ServiceQuotedPrice);
+                        Sys_SetData s = _sqlSugar.Queryable<Sys_SetData>().First(a => a.IsDel == 0 && a.Id == item.PayDid);
+                        if (s != null)
+                        {
+                            item.PayStrd = s.Name;
+                        }
                     }
                     string CountSql = string.Format(@"Select COUNT(1) as Count From (	
                                                         select t.*,s.Name as CurrencyStr,c.IsAuditGM,c.PayPercentage from