Quellcode durchsuchen

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

leiy vor 1 Jahr
Ursprung
Commit
dede68c5f3

+ 1 - 1
OASystem/OASystem.Domain/Dtos/Groups/AirTicketResDto.cs

@@ -13,8 +13,8 @@ namespace OASystem.Domain.Dtos.Groups
     {
         public int DiId { get; set; } = 0;
         public int UserId { get; set; } = 0;
+        public int IsPaySign { get; set; } = -1;
 
-        
     }
    public class ItineraryAirTicketResDto
     {

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

@@ -15,11 +15,13 @@ namespace OASystem.Domain.Dtos.Groups
         public int CTId { get; set; }
         public int PageIndex { get; set; } = 1;
         public int PageSize { get; set; } = 10;
+        
     }
     public class DecreasePaymentsListDto
     {
         public int UserId { get; set; }
         public int DiId { get; set; }
+        public int IsPaySign { get; set; } = -1;
     }
     /// <summary>
     /// 团组增减款项操作

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

@@ -18,6 +18,8 @@ namespace OASystem.Domain.Dtos.Groups
 
         public int PageIndex { get; set; } = 1;
         public int PageSize { get; set; } = 10;
+
+        public int IsPaySign { get; set; }
     }
 
     /// <summary>

+ 1 - 0
OASystem/OASystem.Domain/Dtos/Groups/VisaPriceDto.cs

@@ -19,6 +19,7 @@ namespace OASystem.Domain.Dtos.Groups
         /// 客户名称
         /// </summary>
         public String VisaClient { get; set; }
+        public int IsPaySign { get; set; }
     }
     public class PostVisaByIdDto 
     {

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

@@ -22,6 +22,7 @@ namespace OASystem.Domain.ViewModels.Groups
 
         public string FlightDescription { get; set; }
         public string ClientNameStr { get; set; }
+        public int IsPay { get; set; }
     }
 
     public class AirGroupCostParameterView

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

@@ -36,5 +36,6 @@ namespace OASystem.Domain.ViewModels.Groups
         public string CreateUserName { get; set; }
         public DateTime CreateTime { get; set; }
         public int isAudit { get; set; }
+        public int IsPay { get; set; }
     }
 }

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

@@ -53,6 +53,7 @@ namespace OASystem.Domain.ViewModels.Groups
         /// 签证描述
         /// </summary>
         public string VisaDescription { get; set; }
+        public int IsPay { get; set; }
     }
 
 }

+ 9 - 3
OASystem/OASystem.Infrastructure/Repositories/Groups/AirTicketResRepository.cs

@@ -93,14 +93,20 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 {
                     UserId = "0";
                 }
-                string sql = string.Format(@"Select atr.*,ccp.IsAuditGM,sd1.Name As CTypeName,sd2.Name As PreCurrencyStr,sd3.Name As CurrencyStr
+                string sqlWhere = "";
+                if (dto.IsPaySign != -1)
+                {
+                    sqlWhere += string.Format(@" And ccp.IsPay = {0} ", dto.IsPaySign);
+                }
+
+                string sql = string.Format(@"Select atr.*,ccp.IsAuditGM,sd1.Name As CTypeName,sd2.Name As PreCurrencyStr,sd3.Name As CurrencyStr,ccp.IsPay
                                              From Grp_AirTicketReservations atr
                                              Left Join Grp_CreditCardPayment ccp On atr.Id = ccp.CId  And atr.DIId = ccp.DIId And ccp.IsDel = 0
                                              Left Join Sys_SetData sd1 On sd1.Id = atr.ctype
                                              Left Join Sys_SetData sd2 On sd2.Id = atr.PreCurrency
                                              Left Join Sys_SetData sd3 On sd3.Id = atr.Currency
-                                             Where atr.IsDel = 0 And atr.DIId={0} 
-                                             Order By atr.FlightsDate Asc", dto.DiId);
+                                             Where atr.IsDel = 0 And atr.DIId={0} {1}
+                                             Order By atr.FlightsDate Asc", dto.DiId, sqlWhere);
                 List<AirTicketReservationsView> _AirTicketReservations = _sqlSugar.SqlQueryable<AirTicketReservationsView>(sql).ToList();
 
                 foreach (var item in _AirTicketReservations)

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

@@ -182,11 +182,16 @@ 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);
 
+                TableInitialization.RemoveAll(x => x.Id == 1070 || x.Id == 1071);
+                var weiKuanArr = _TableInitialization.Where(x => x.Id == 1070 || x.Id == 1071).ToList();
+                var weiKuanResultArr = carTouristGuides.Where(x => x.SId == 1070 || x.SId == 1071).ToList();
+                carTouristGuides.RemoveAll(x => x.SId == 1070 || x.SId == 1071);
+
                 foreach (var itemSt in TableInitialization)
                 {
                     var findResult = carTouristGuides.Find(x => x.SId == itemSt.Id);
@@ -320,6 +325,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 var checkedItem = new List<string>();
                 var checkedItemId = new List<int>();
 
+                var isSaveCheck = false;
                 if (string.IsNullOrWhiteSpace(grpCarOp.SelectCheck))
                 {
                     //获取成本选中
@@ -354,6 +360,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 }
                 else
                 {
+                    isSaveCheck = true;
                     var checkedItemThis = grpCarOp.SelectCheck.Split(",").ToList<string>();
                     int number = 0;
                     foreach (var item in checkedItemThis)
@@ -371,7 +378,59 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     }
                 }
 
-                if(dto.PortType == 1)
+                if (grpCarOp.PriceType == 1062) //尾款id
+                {
+                    if (isSaveCheck)
+                    {
+                        checkedItemId.AddRange(weiKuanArr.Select(x => x.Id).ToList());
+                        checkedItem.AddRange(weiKuanArr.Select(x => x.Name).ToList());
+                        checkedItemId = checkedItemId.Distinct().ToList();
+                        checkedItem = checkedItem.Distinct().ToList();
+                    }
+                    else
+                    {
+                        checkedItemId = weiKuanArr.Select(x => x.Id).ToList();
+                        checkedItem = weiKuanArr.Select(x => x.Name).ToList();
+                    }
+                   
+                    var weiPrice = weiKuanResultArr.Find(x => x.SId == 1070);
+                    if (weiPrice != null)
+                    {
+                        weiPrice.SidName = "尾款金额";
+                    }
+                    var weiOther = weiKuanResultArr.Find(x => x.SId == 1071);
+                    if (weiOther != null)
+                    {
+                        weiOther.SidName = "其他额外费用";
+                    }
+                    carTouristGuides.Add(weiPrice ??= new CarTouristGuideGroundReservationsContentView
+                    {
+                        Count = 1,
+                        DatePrice = DateTime.Now,
+                        Price = 0,
+                        PriceContent = "",
+                        SId = 1070,
+                        SidName = "尾款金额",
+                        Units = 0,
+                    });
+                    carTouristGuides.Add(weiOther ??= new CarTouristGuideGroundReservationsContentView
+                    {
+                        Count = 1,
+                        DatePrice = DateTime.Now,
+                        Price = 0,
+                        PriceContent = "",
+                        SId = 1071,
+                        SidName = "其他额外费用",
+                        Units = 0,
+                    });
+                }
+                else
+                {
+                    _TableInitialization.RemoveAll(x => x.Id == 1070 || x.Id == 1071);
+                }
+
+
+                if (dto.PortType == 1)
                 {
                     var data = new
                     {

+ 16 - 4
OASystem/OASystem.Infrastructure/Repositories/Groups/DecreasePaymentsRepository.cs

@@ -42,10 +42,22 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 //List<Grp_GroupsTaskAssignment> gtaUIdList = _sqlSugar.Queryable<Grp_GroupsTaskAssignment>().Where(a => a.DIId == dto.DiId && a.IsDel == 0 && a.CTId == 98).ToList();
                 //UserId = string.Join(",", gtaUIdList.Select(it => it.UId).ToList());
 
-                string sql = string.Format(@"select Id,DiId,PriceName,Price,(select name from Sys_SetData where id=s.Currency) as Currency,FilePath,
-                                            (select CnName from Sys_Users where Id=s.CreateUserId) as 'CreateUserName',CreateTime,(select IsAuditGM from 
-                                            Grp_CreditCardPayment where CTable=98 and CId=s.Id and DiId = {0} and IsDel=0) as 'isAudit' from Grp_DecreasePayments s 
-                                            where DIID={0} and IsDel=0  and s.CreateUserId in ({1}) ", dto.DiId, dto.UserId);
+                //string sql = string.Format(@"select Id,DiId,PriceName,Price,(select name from Sys_SetData where id=s.Currency) as Currency,FilePath,
+                //                            (select CnName from Sys_Users where Id=s.CreateUserId) as 'CreateUserName',CreateTime,(select IsAuditGM from 
+                //                            Grp_CreditCardPayment where CTable=98 and CId=s.Id and DiId = {0} and IsDel=0) as 'isAudit' from Grp_DecreasePayments s 
+                //                            where DIID={0} and IsDel=0  and s.CreateUserId in ({1}) ", dto.DiId, dto.UserId);
+
+                string sqlWhere = "";
+                if (dto.IsPaySign != -1) {
+                    sqlWhere += string.Format(@" And ccp.IsPay = {0} ", dto.IsPaySign);
+                }
+
+                string sql = string.Format(@" Select gdp.Id,gdp.DiId,gdp.PriceName,gdp.Price,sd1.[Name] as Currency,gdp.FilePath,su.CnName as CreateUserName,
+ccp.IsAuditDM as isAudit,ccp.IsPay
+From Grp_DecreasePayments as gdp With(Nolock) Left Join Grp_CreditCardPayment as ccp With(Nolock) On gdp.Id = ccp.CId
+Left Join Sys_SetData as sd1 On gdp.Currency = sd1.Id
+Left Join Sys_Users as su On gdp.CreateUserId = su.Id
+Where gdp.DiId = {0} And ccp.CTable = 98 {2} And ccp.IsDel = 0 And gdp.IsDel = 0 And gdp.CreateUserId in ({1}) ", dto.DiId, dto.UserId, sqlWhere);
                 List<DecreasePaymentsView> _DecreasePayments = await _sqlSugar.SqlQueryable<DecreasePaymentsView>(sql).ToListAsync();
                 if (_DecreasePayments.Count > 0)
                 {

+ 13 - 5
OASystem/OASystem.Infrastructure/Repositories/Groups/TourClientListRepository.cs

@@ -564,7 +564,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                             companyId = companyAdd;
                         }
                     }
-                    
+
                     _DeleClientInfo = new Crm_DeleClient() 
                     {
                         LastName = item.LastName,
@@ -573,9 +573,13 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         CrmCompanyId = companyId,
                         Job = item.Job,
                         Sex = item.Sex,
-                        Phone = item.Phone,
-                        BirthDay = item.BirthDay == null ? null : Convert.ToDateTime(item.BirthDay),
+                        Phone = item.Phone
                     };
+                    string temp_birthDay = "";
+                    DateTime tempDt_Birthday;
+                    bool b_birth = DateTime.TryParse(item.BirthDay, out tempDt_Birthday);
+                    _DeleClientInfo.BirthDay = b_birth ? tempDt_Birthday : null;
+
                     var clientAdd = await _sqlSugar.Insertable(_DeleClientInfo).ExecuteReturnIdentityAsync();
                     if (clientAdd < 0)
                     {
@@ -636,9 +640,13 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         FirstName = item.FirstName,
                         Pinyin = item.Pinyin,
                         Sex = item.Sex,
-                        Phone = item.Phone,
-                        BirthDay = item.BirthDay == null ? null : Convert.ToDateTime(item.BirthDay)
+                        Phone = item.Phone
                     };
+                    string temp_birthDay = "";
+                    DateTime tempDt_Birthday;
+                    bool b_birth = DateTime.TryParse(item.BirthDay, out tempDt_Birthday);
+                    _DeleClient.BirthDay = b_birth ? tempDt_Birthday : null;
+
                     var clientEdit = await _sqlSugar.Updateable(_DeleClient).UpdateColumns(it =>
                                                                                  new
                                                                                  {

+ 17 - 4
OASystem/OASystem.Infrastructure/Repositories/Groups/VisaPriceRepository.cs

@@ -14,6 +14,7 @@ using OASystem.Infrastructure.Tools;
 using Org.BouncyCastle.Asn1.Cms;
 using System;
 using System.Collections.Generic;
+using System.Drawing;
 using System.Linq;
 using System.Security.Cryptography;
 using System.Text;
@@ -69,6 +70,12 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     UserId = "0";
                 }
                 sqlWhere += string.Format(@" And v.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");
@@ -80,9 +87,15 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 int endIndex = startIndex + dto.PageSize - 1;
                 if (dto.PortType==1)
                 {
-                    string sql = string.Format(@"select *,(select IsAuditGM from Grp_CreditCardPayment where CTable=80 and CId=v.Id and IsDel=0) IsAuditGM,
-                                                (select Name from Sys_SetData where isdel=0 and v.VisaCurrency=Id) VisaCurrencyStr from
-                                                Grp_VisaInfo v {0} order by CreateTime desc",sqlWhere);
+                    //string sql = string.Format(@"select *,(select IsAuditGM from Grp_CreditCardPayment where CTable=80 and CId=v.Id and IsDel=0) IsAuditGM,
+                    //                            (select Name from Sys_SetData where isdel=0 and v.VisaCurrency=Id) VisaCurrencyStr from
+                    //                            Grp_VisaInfo v {0} order by CreateTime desc",sqlWhere);
+
+                    string sql = string.Format(@" Select v.*, c.IsAuditGM,c.IsPay,sd1.[Name] as VisaCurrencyStr
+From Grp_VisaInfo as v With(Nolock) Left Join Grp_CreditCardPayment as c With(Nolock) On v.Id = c.CId
+Left Join Sys_SetData as sd1 With(Nolock) On v.VisaCurrency = sd1.Id
+{0} And c.CTable = 80 And c.IsDel = 0 And sd1.IsDel = 0  ", sqlWhere);
+
                     List<VisaInfoView> infoViews = _sqlSugar.SqlQueryable<VisaInfoView>(sql).ToList();
                     var parseIntValue = 0;
                     var CrmIds = (from item in infoViews
@@ -244,7 +257,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     }
                 }
             }
-            catch (Exception)
+            catch (Exception ex)
             {
                 return result = new Result() { Code = -2, Msg = "未知错误" };
                 throw;