Browse Source

日付申请和国交各版块列表增加是否付款

jiangjc 10 months ago
parent
commit
b5c2b8894c

+ 2 - 0
OASystem/OASystem.Domain/Dtos/Groups/CarTouristGuideGroundDto.cs

@@ -15,6 +15,8 @@ namespace OASystem.Domain.Dtos.Groups
         /// 团组Id
         /// </summary>
         public int DiId { get; set; }
+
+        public int IsPaySign { get; set; } = -1;
     }
     /// <summary>
     /// 根据id查询单挑数据

+ 2 - 0
OASystem/OASystem.Domain/Dtos/Groups/HotelReservationsDto.cs

@@ -13,6 +13,8 @@ namespace OASystem.Domain.Dtos.Groups
     public class HotelReservationItemDto : UserPageFuncDtoBase
     {
         public int DiId { get; set; }
+
+        public int IsPaySign { get; set; }
     }
 
     /// <summary>

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

@@ -128,5 +128,6 @@ namespace OASystem.Domain.ViewModels.Groups
         /// 费用类型
         /// </summary>
         public string priceTypeStr { get; set; }
+        public int IsPay { get; set; }
     }
 }

+ 1 - 0
OASystem/OASystem.Domain/ViewModels/Groups/HotelReservationsByDiIdView.cs

@@ -99,6 +99,7 @@ namespace OASystem.Domain.ViewModels.Groups
                 return auditStatus;
             } }
 
+        public int IsPay { get; set; }
     }
 
     /// <summary>

+ 2 - 0
OASystem/OASystem.Domain/ViewModels/Groups/InvitationOfficialActivitiesView.cs

@@ -93,5 +93,7 @@ namespace OASystem.Domain.ViewModels.Groups
         /// 是否审核
         /// </summary>
         public int IsAudit { get; set; }
+
+        public int IsPay { get; set; }
     }
 }

+ 66 - 56
OASystem/OASystem.Infrastructure/Repositories/Groups/CarTouristGuideGroundRepository.cs

@@ -19,14 +19,14 @@ using System.Reflection;
 
 namespace OASystem.Infrastructure.Repositories.Groups
 {
-    public class CarTouristGuideGroundRepository:BaseRepository<Grp_CarTouristGuideGroundReservations, Grp_CarTouristGuideGroundReservationsContent>
+    public class CarTouristGuideGroundRepository : BaseRepository<Grp_CarTouristGuideGroundReservations, Grp_CarTouristGuideGroundReservationsContent>
     {
         private readonly IMapper _mapper;
         private readonly CheckBoxsRepository _checkRep;
         private readonly SetDataRepository _setDataRep;
         private readonly DailyFeePaymentRepository _daiRep;    //日付申请仓库
 
-        public CarTouristGuideGroundRepository(SqlSugarClient sqlSugar, IMapper mapper , CheckBoxsRepository checkRep, SetDataRepository setDataRep, DailyFeePaymentRepository daiRep)
+        public CarTouristGuideGroundRepository(SqlSugarClient sqlSugar, IMapper mapper, CheckBoxsRepository checkRep, SetDataRepository setDataRep, DailyFeePaymentRepository daiRep)
             : base(sqlSugar)
         {
             _mapper = mapper;
@@ -45,7 +45,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 Grp_CarTouristGuideGroundReservations grp_CarTouristGuide = _mapper.Map<Grp_CarTouristGuideGroundReservations>(dto);
                 if (dto.Status == 1)//添加
                 {
-                    Grp_CarTouristGuideGroundReservations grp_CarTouristGuideGround = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservations>().First(a => a.IsDel == 0 && a.Area == dto.Area && a.BusName == dto.BusName && a.ServiceGuide == dto.ServiceGuide && a.DiId==dto.DiId && a.BusTel==dto.BusTel && a.ServiceTel==dto.ServiceTel);
+                    Grp_CarTouristGuideGroundReservations grp_CarTouristGuideGround = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservations>().First(a => a.IsDel == 0 && a.Area == dto.Area && a.BusName == dto.BusName && a.ServiceGuide == dto.ServiceGuide && a.DiId == dto.DiId && a.BusTel == dto.BusTel && a.ServiceTel == dto.ServiceTel);
                     if (grp_CarTouristGuideGround != null)
                     {
                         return result = new Result() { Code = -1, Msg = "该笔费用已存在,请勿重复添加!" };
@@ -97,7 +97,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         result = new Result() { Code = -1, Msg = "修改失败,请稍后重试!" };
                     }
                 }
-                if (id!=0)
+                if (id != 0)
                 {
                     Res_LocalGuideData _LocalGuideDataCar = _sqlSugar.Queryable<Res_LocalGuideData>().First(a => a.UnitName == dto.BusName && a.ContactTel == dto.BusTel && a.IsDel == 0);
                     if (_LocalGuideDataCar == null)
@@ -120,7 +120,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         int cId = await _sqlSugar.Insertable(res_LocalGuideService).ExecuteReturnIdentityAsync();
                     }
                 }
-                
+
                 CommitTran();
             }
             catch (Exception ex)
@@ -182,7 +182,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 List<SetDataInfoView> _TableInitialization = _mapper.Map<List<SetDataInfoView>>(TableInitialization);
 
                 List<Sys_SetData> ssd = _sqlSugar.Queryable<Sys_SetData>().Where(x => x.STid == 78).ToList();
-                List<SetDataInfoView> ssdv = _mapper.Map<List<Sys_SetData>,List<SetDataInfoView>>(ssd);
+                List<SetDataInfoView> ssdv = _mapper.Map<List<Sys_SetData>, List<SetDataInfoView>>(ssd);
 
                 List<Grp_CarTouristGuideGroundReservationsContent> grp_CarTouristsContent = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservationsContent>().Where(a => a.IsDel == 0 && a.CTGGRId == dto.Id).ToList();
                 List<CarTouristGuideGroundReservationsContentView> carTouristGuides = _mapper.Map<List<CarTouristGuideGroundReservationsContentView>>(grp_CarTouristsContent);
@@ -194,13 +194,13 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     {
                         carTouristGuides.Add(new CarTouristGuideGroundReservationsContentView
                         {
-                             SId = itemSt.Id,
-                             Count = 1,
-                             SidName = itemSt.Name,
+                            SId = itemSt.Id,
+                            Count = 1,
+                            SidName = itemSt.Name,
                         });
                     }
                 }
-                
+
                 var groupResult = carTouristGuides.GroupBy(x => x.SId).ToDictionary(x => x.Key, x => x.ToList());
                 foreach (var item in groupResult.Keys)
                 {
@@ -242,7 +242,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     if (groupResult[item].Count != day)
                     {
 
-                        for (var m = 0; m< groupResult[item].Count; m++)
+                        for (var m = 0; m < groupResult[item].Count; m++)
                         {
                             for (var m1 = 0; m1 < dayResult.Count; m1++)
                             {
@@ -294,7 +294,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     _CreditCardPayment.PaymentCurrencyName = _sqlSugar.Queryable<Sys_SetData>().First(a => a.Id == _CreditCardPayment.PaymentCurrency).Name;
                     if (_CreditCardPayment.OrbitalPrivateTransfer == 0) _CreditCardPayment.OrbitalPrivateTransferStr = "公转";
                     else _CreditCardPayment.OrbitalPrivateTransferStr = "私转";
-                } 
+                }
 
                 Dictionary<string, string> soureDic = new Dictionary<string, string>()
                 {
@@ -341,7 +341,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                                 else
                                 {
                                     checkedItem.Add(soureKey);
-                                    checkedItemId.Add(_TableInitialization.Find(x=>x.Name == soureKey)!.Id);
+                                    checkedItemId.Add(_TableInitialization.Find(x => x.Name == soureKey)!.Id);
                                 }
                             }
                         }
@@ -358,7 +358,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     int number = 0;
                     foreach (var item in checkedItemThis)
                     {
-                        if (!int.TryParse(item,out number))
+                        if (!int.TryParse(item, out number))
                         {
                             checkedItemId.Add(_TableInitialization.Find(x => x.Name == item)!.Id);
                             checkedItem.Add(item);
@@ -371,7 +371,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     }
                 }
 
-                if(dto.PortType == 1)
+                if (dto.PortType == 1)
                 {
                     var data = new
                     {
@@ -388,7 +388,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                     return result = new Result() { Code = 0, Msg = "查询成功", Data = data };
 
-                } else if(dto.PortType == 2)
+                }
+                else if (dto.PortType == 2)
                 {
                     var data = new
                     {
@@ -403,7 +404,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 }
 
                 return result = new Result() { Code = -1, Msg = "请传入有效portType" };
-}
+            }
             catch (Exception ex)
             {
                 return result = new Result() { Code = -2, Msg = "未知错误" };
@@ -415,27 +416,27 @@ namespace OASystem.Infrastructure.Repositories.Groups
         /// </summary>
         /// <param name="dto"></param>
         /// <returns></returns>
-        public  Result OpCarTouristGuideGroundContentById(CarTouristGuideGroundIdDto dto)
+        public Result OpCarTouristGuideGroundContentById(CarTouristGuideGroundIdDto dto)
         {
             Result result = new Result() { Code = -2, Msg = "未知错误" };
             try
             {
 
-               
-                List<Grp_CarTouristGuideGroundReservationsContent> grp_CarTouristsContent = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservationsContent>().Where(a=>a.IsDel==0 && a.CTGGRId==dto.Id).ToList();
+
+                List<Grp_CarTouristGuideGroundReservationsContent> grp_CarTouristsContent = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservationsContent>().Where(a => a.IsDel == 0 && a.CTGGRId == dto.Id).ToList();
                 List<CarTouristGuideGroundReservationsContentView> carTouristGuides = _mapper.Map<List<CarTouristGuideGroundReservationsContentView>>(grp_CarTouristsContent);
 
                 foreach (var item in carTouristGuides)
                 {
-                    item.SidName= _sqlSugar.Queryable<Sys_SetData>().First(a => a.Id == item.SId).Name;
+                    item.SidName = _sqlSugar.Queryable<Sys_SetData>().First(a => a.Id == item.SId).Name;
                 }
                 Grp_CreditCardPayment CreditCardPayment = _sqlSugar.Queryable<Grp_CreditCardPayment>().First(a => a.CId == dto.Id && a.IsDel == 0 && a.CTable == 79);
                 CarTouristCreditCardPaymentView _CreditCardPayment = _mapper.Map<CarTouristCreditCardPaymentView>(CreditCardPayment);
-                if (_CreditCardPayment!=null)
+                if (_CreditCardPayment != null)
                 {
                     _CreditCardPayment.PayName = _sqlSugar.Queryable<Sys_SetData>().First(a => a.Id == _CreditCardPayment.PayDId).Name;
                     _CreditCardPayment.PaymentCurrencyName = _sqlSugar.Queryable<Sys_SetData>().First(a => a.Id == _CreditCardPayment.PaymentCurrency).Name;
-                    if (_CreditCardPayment.OrbitalPrivateTransfer==0) _CreditCardPayment.OrbitalPrivateTransferStr = "公转";
+                    if (_CreditCardPayment.OrbitalPrivateTransfer == 0) _CreditCardPayment.OrbitalPrivateTransferStr = "公转";
                     else _CreditCardPayment.OrbitalPrivateTransferStr = "私转";
                 }
                 var data = new
@@ -448,7 +449,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
             }
             catch (Exception ex)
             {
-                return result = new Result() { Code = -2, Msg = "未知错误(" + ex.Message+")" };
+                return result = new Result() { Code = -2, Msg = "未知错误(" + ex.Message + ")" };
             }
         }
 
@@ -483,8 +484,14 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 {
                     UserId = "0";
                 }
-                
+
                 sqlWhere += string.Format(@" And t.CreateUserId in ({0})", UserId);
+
+                if (dto.IsPaySign != -1)
+                {
+                    sqlWhere += string.Format(@" And c.IsPay = {0} ", dto.IsPaySign);
+                }
+
                 if (!string.IsNullOrEmpty(sqlWhere.Trim()))
                 {
                     Regex r = new Regex("And");
@@ -507,20 +514,20 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                 if (dto.PortType == 1)
                 {
-                    string sql = string.Format(@"select t.*,(select Name from Sys_SetData where isdel = 0 and id = t.priceType) as 'priceTypeStr',s.Name as CurrencyStr,c.IsAuditGM,c.PayPercentage,c.PayMoney,c.PayDid from 
+                    string sql = string.Format(@"select t.*,(select Name from Sys_SetData where isdel = 0 and id = t.priceType) as 'priceTypeStr',s.Name as CurrencyStr,c.IsAuditGM,c.PayPercentage,c.PayMoney,c.PayDid,c.IsPay 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}
                                                 order by c.IsAuditGM,c.PayPercentage desc", sqlWhere);
                     List<Grp_CarTouristGuideGroundView> infoViews = _sqlSugar.SqlQueryable<Grp_CarTouristGuideGroundView>(sql).ToList();
 
-                    
+
 
                     foreach (var item in infoViews)
                     {
-                        if(!regex.IsMatch(item.Area))
+                        if (!regex.IsMatch(item.Area))
                         {
-                            for(int i = 0; i < data.Count; i++)
+                            for (int i = 0; i < data.Count; i++)
                             {
                                 if (item.Area.Equals(data[i].Id.ToString()))
                                 {
@@ -536,21 +543,22 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                         if (item.OrbitalPrivateTransfer == 0) item.OrbitalPrivateTransferStr = "公转";
                         else if (item.OrbitalPrivateTransfer == 1) item.OrbitalPrivateTransferStr = "私转";
-                        
+
                         item.ServiceStartTime = Convert.ToDateTime(item.ServiceStartTime).ToString("yyyy-MM-dd");
                         item.ServiceEndTime = Convert.ToDateTime(item.ServiceEndTime).ToString("yyyy-MM-dd");
                         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,2);
+                        item.PayThenMoney = Math.Round(item.PayPercentage / 100 * item.ServiceQuotedPrice, 2);
+                        item.RemainingBalance = Math.Round(item.ServiceQuotedPrice - item.PayPercentage / 100 * item.ServiceQuotedPrice, 2);
                         if (item.IsAuditGM == 0) item.IsAuditGMStr = "未审核";
                         else if (item.IsAuditGM == 1) item.IsAuditGMStr = "已通过";
                         else if (item.IsAuditGM == 2) item.IsAuditGMStr = "未通过";
                         else if (item.IsAuditGM == 3) item.IsAuditGMStr = "自动审核";
-                        Sys_SetData s = _sqlSugar.Queryable<Sys_SetData>().First(a=>a.IsDel==0 && a.Id==item.PayDid);
-                        if (s!=null)
+                        Sys_SetData s = _sqlSugar.Queryable<Sys_SetData>().First(a => a.IsDel == 0 && a.Id == item.PayDid);
+                        if (s != null)
                         {
                             item.PayStrd = s.Name;
-                        }else item.PayStrd ="未选择";
+                        }
+                        else item.PayStrd = "未选择";
                     }
                     return result = new Result() { Code = 0, Msg = "查询成功!", Data = infoViews };
                 }
@@ -593,7 +601,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         else if (item.IsAuditGM == 3) item.IsAuditGMStr = "自动审核";
                         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,2);
+                        item.RemainingBalance = Math.Round(item.ServiceQuotedPrice - item.PayPercentage / 100 * item.ServiceQuotedPrice, 2);
                         Sys_SetData s = _sqlSugar.Queryable<Sys_SetData>().First(a => a.IsDel == 0 && a.Id == item.PayDid);
                         if (s != null)
                         {
@@ -661,7 +669,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 if (carTouristList.Count > 0)
                 {
                     #region load
-                    
+
                     //车超时费
                     //餐费和三公经费那个表做完匹配后也放进超支表里
                     DataTable tb = new DataTable();
@@ -681,12 +689,12 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     });
 
                     //限制只能选择地区
-                    var opSingle = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservations>().First(x=>x.Id == dto.CTGGRId);
+                    var opSingle = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservations>().First(x => x.Id == dto.CTGGRId);
                     var opSingleCityId = 0;
                     Grp_NationalTravelFee cityPrice = null;
 
                     //三公费用
-                    if (int.TryParse(opSingle.Area,out opSingleCityId))
+                    if (int.TryParse(opSingle.Area, out opSingleCityId))
                     {
                         cityPrice = _sqlSugar.Queryable<Grp_NationalTravelFee>().Where(x =>
                          x.Id == opSingleCityId
@@ -815,7 +823,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                                     payType = dto.PayDId,
                                     costSign = dto.OrbitalPrivateTransfer
                                 });
-                                isTrue =  resultThis.Code == 0 ?  true : false;
+                                isTrue = resultThis.Code == 0 ? true : false;
                             }
                             else
                             {
@@ -852,13 +860,13 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                 foreach (var item in carTouristList)
                 {
-                   
-                    Grp_CarTouristGuideGroundReservationsContent QueryData = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservationsContent>().First(a => a.SId == item.SId && a.Id == item.Id && a.DiId == item.DiId && a.IsDel==0);
-                    if (QueryData==null)
+
+                    Grp_CarTouristGuideGroundReservationsContent QueryData = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservationsContent>().First(a => a.SId == item.SId && a.Id == item.Id && a.DiId == item.DiId && a.IsDel == 0);
+                    if (QueryData == null)
                     {
                         int id = await _sqlSugar.Insertable(item).ExecuteReturnIdentityAsync();
                         if (id == 0)
-                        { 
+                        {
                             RollbackTran();
                             return result = new Result() { Code = -2, Msg = "添加失败" };
                         }
@@ -876,7 +884,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                             Units = item.Units,
                         }).ExecuteCommandAsync();
 
-                        if (CTable==0)
+                        if (CTable == 0)
                         {
                             RollbackTran();
                             return result = new Result() { Code = -1, Msg = "修改失败,请稍后重试!" };
@@ -891,17 +899,19 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 Grp_CreditCardPayment c = new Grp_CreditCardPayment();
                 c.PaymentCurrency = dto.Currency;
 
-                for (int i = 0; i < dto.SelectCheck.Count; i++) {
+                for (int i = 0; i < dto.SelectCheck.Count; i++)
+                {
                     if (!regex.IsMatch(dto.SelectCheck[i]))
                     {
-                        for(int j = 0; j < carTouristList.Count; j++)
+                        for (int j = 0; j < carTouristList.Count; j++)
                         {
                             if (int.Parse(dto.SelectCheck[i]) == carTouristList[j].SId)
                             {
                                 c.PayMoney += carTouristList[j].Price * carTouristList[j].Count;
                             }
                         }
-                    } else
+                    }
+                    else
                     {
                         c.PayMoney = carTouristList.Sum(x => x.Price * x.Count);
                         break;
@@ -909,15 +919,15 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 }
 
                 c.PayPercentage = dto.PayPercentage;
-                c.ConsumptionDate= DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+                c.ConsumptionDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                 c.CTable = 79;
                 c.CId = dto.CTGGRId;
                 c.IsAuditGM = 0;
-                c.PayDId=dto.PayDId;
+                c.PayDId = dto.PayDId;
                 c.DIId = dto.DiId;
                 c.OrbitalPrivateTransfer = dto.OrbitalPrivateTransfer;
-                c.Payee=dto.Payee;
-                c.CreateUserId=dto.CreateUserId;
+                c.Payee = dto.Payee;
+                c.CreateUserId = dto.CreateUserId;
                 if (c.PayDId == 72)
                 {
                     c.IsPay = 1;
@@ -955,10 +965,10 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     }
                 }
 
-                Grp_CreditCardPayment grp_CreditCard = _sqlSugar.Queryable<Grp_CreditCardPayment>().First(a=>a.CId==dto.CTGGRId && a.IsDel==0 && a.CTable==79 && a.DIId==dto.DiId);
-                if (grp_CreditCard!=null)//修改
+                Grp_CreditCardPayment grp_CreditCard = _sqlSugar.Queryable<Grp_CreditCardPayment>().First(a => a.CId == dto.CTGGRId && a.IsDel == 0 && a.CTable == 79 && a.DIId == dto.DiId);
+                if (grp_CreditCard != null)//修改
                 {
-                    int CTable = await _sqlSugar.Updateable<Grp_CreditCardPayment>().Where(a => a.CId == dto.CTGGRId && a.CTable == 79 && a.DIId==dto.DiId).SetColumns(a => new Grp_CreditCardPayment
+                    int CTable = await _sqlSugar.Updateable<Grp_CreditCardPayment>().Where(a => a.CId == dto.CTGGRId && a.CTable == 79 && a.DIId == dto.DiId).SetColumns(a => new Grp_CreditCardPayment
                     {
                         PaymentCurrency = c.PaymentCurrency,
                         PayMoney = c.PayMoney,
@@ -1001,7 +1011,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     RollbackTran();
                     return result = new Result() { Code = -2, Msg = "修改失败" };
                 }
-                result = new Result() { Code =0, Msg = "保存成功" };
+                result = new Result() { Code = 0, Msg = "保存成功" };
                 CommitTran();
             }
             catch (Exception ex)

+ 1 - 1
OASystem/OASystem.Infrastructure/Repositories/Groups/HotelPriceRepository.cs

@@ -613,7 +613,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
             string sql = string.Format(@"Select row_number() over(order by hr.CreateTime Desc) as Row_Number,
 										 hr.Id,hr.DiId,sd1.Name As GuestType,hr.ReservationsNo,hr.HotelName,hr.CheckInDate,hr.CheckOutDate,
 										 ccp.PayMoney, ccp.PaymentCurrency,sd2.Name PayCurrency,hr.CreateUserId,u.CnName As CreateUserName,
-										 hr.CreateTime,ccp.IsAuditGM
+										 hr.CreateTime,ccp.IsAuditGM,ccp.IsPay
 										 From Grp_HotelReservations  hr
 										 Inner Join Grp_CreditCardPayment ccp On hr.DiId = ccp.DIId And hr.Id = ccp.CId 
 										 And ccp.CTable = 76

+ 28 - 11
OASystem/OASystem.Infrastructure/Repositories/Groups/InvitationOfficialActivitiesRepository.cs

@@ -145,23 +145,40 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     UserId = "0";
                 }
                 sqlWhere += string.Format(@" And i.CreateUserId in ({0})", UserId);
+
+                if (dto.IsPaySign != -1) {
+                    sqlWhere += string.Format(@" And ccp.IsPay = {0} ", dto.IsPaySign);
+                }
+
                 if (!string.IsNullOrEmpty(sqlWhere.Trim()))
                 {
                     Regex r = new Regex("And");
                     sqlWhere = r.Replace(sqlWhere, "Where", 1);
                 }
                 //10011
-                string sql = string.Format(@"Select Id,DiId,InviterArea,Inviter,InviteTime,
-                                             InviteCost,(Select Name From Sys_SetData Where id=i.InviteCurrency And IsDel=0) As InviteCurrency,
-                                             SendCost,(Select Name From Sys_SetData Where id=i.SendCurrency And IsDel=0) As SendCurrency,
-                                             EventsCost,(Select Name From Sys_SetData Where id=i.EventsCurrency And IsDel=0) As EventsCurrency,
-                                             TranslateCost,(Select Name From Sys_SetData Where id=i.TranslateCurrency And IsDel=0) As TranslateCurrency,
-                                             IsGoOfficaiaBussiness,
-                                             (Select PayMoney From Grp_CreditCardPayment Where CTable=81 And CId=i.Id  And IsDel=0) As PayMoney,
-                                             (Select (Select Name From Sys_SetData Where Id =ccp.PaymentCurrency And IsDel=0 ) As PaymentCurrency 
-                                               From Grp_CreditCardPayment ccp Where CTable=81 And CId=i.Id  And IsDel=0) As PaymentCurrency,
-                                             (Select IsAuditGM From Grp_CreditCardPayment Where CTable=81 And CId=i.Id  And IsDel=0) As IsAudit,
-                                             Attachment From Grp_InvitationOfficialActivities i {0} Order By i.id  Desc", sqlWhere);
+                //string sql = string.Format(@"Select Id,DiId,InviterArea,Inviter,InviteTime,
+                //                             InviteCost,(Select Name From Sys_SetData Where id=i.InviteCurrency And IsDel=0) As InviteCurrency,
+                //                             SendCost,(Select Name From Sys_SetData Where id=i.SendCurrency And IsDel=0) As SendCurrency,
+                //                             EventsCost,(Select Name From Sys_SetData Where id=i.EventsCurrency And IsDel=0) As EventsCurrency,
+                //                             TranslateCost,(Select Name From Sys_SetData Where id=i.TranslateCurrency And IsDel=0) As TranslateCurrency,
+                //                             IsGoOfficaiaBussiness,
+                //                             (Select PayMoney From Grp_CreditCardPayment Where CTable=81 And CId=i.Id  And IsDel=0) As PayMoney,
+                //                             (Select (Select Name From Sys_SetData Where Id =ccp.PaymentCurrency And IsDel=0 ) As PaymentCurrency 
+                //                               From Grp_CreditCardPayment ccp Where CTable=81 And CId=i.Id  And IsDel=0) As PaymentCurrency,
+                //                             (Select IsAuditGM From Grp_CreditCardPayment Where CTable=81 And CId=i.Id  And IsDel=0) As IsAudit,
+                //                             Attachment From Grp_InvitationOfficialActivities i {0} Order By i.id  Desc", sqlWhere);
+
+                string sql = string.Format(@" Select i.Id,i.DiId,i.InviterArea,i.Inviter,i.InviteTime,i.InviteCost,sd1.[Name] as InviteCurrency
+,i.SendCost,sd2.[Name] as SendCurrency,i.EventsCost,sd3.[Name] as EventsCurrency,i.TranslateCost,sd4.[Name] as TranslateCurrency
+,i.IsGoOfficaiaBussiness,ccp.PayMoney,sd5.[Name] as PaymentCurrency,IsAuditGM as IsAudit,i.Attachment,ccp.IsPay
+From Grp_InvitationOfficialActivities as i With(Nolock) Inner Join Grp_CreditCardPayment as ccp With(Nolock) On i.Id = ccp.CId
+Left Join Sys_SetData as sd1 On i.InviteCurrency = sd1.Id 
+Left Join Sys_SetData as sd2 On i.SendCurrency = sd2.Id 
+Left Join Sys_SetData as sd3 On i.EventsCurrency = sd3.Id 
+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();
                 if (_DecreasePayments.Count != 0)
                 {