Browse Source

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

yuanrf 10 months ago
parent
commit
af62c8202d

+ 10 - 11
OASystem/OASystem.Api/Controllers/FinancialController.cs

@@ -939,7 +939,8 @@ namespace OASystem.API.Controllers
                             if (cityInfo.City.Contains("全部城市") || cityInfo.City.Contains("其他城市"))
                             {
                                 item.Place = cityInfo.Country;
-                            }else item.Place = cityInfo.City;
+                            }
+                            else item.Place = cityInfo.City;
                         }
                     }
 
@@ -1193,7 +1194,7 @@ namespace OASystem.API.Controllers
                             }
                         }
                         //MemoryStream outSteam = new MemoryStream();
-                        string filsPath = AppSettingsHelper.Get("WordBasePath") + $"ForeignReceivables/File/{ClientItem.Key.Replace("\n","")}.docx";
+                        string filsPath = AppSettingsHelper.Get("WordBasePath") + $"ForeignReceivables/File/{ClientItem.Key.Replace("\n", "")}.docx";
                         doc.Save(filsPath);
                         filesToZip.Add(filsPath);
                         //streams.Add(ClientItem.Key + ".docx", outSteam.ToArray());
@@ -1903,7 +1904,7 @@ namespace OASystem.API.Controllers
                 tree_Group_DailyFeePaymentResult groupResult = PayRequest_GroupPaymentByDateRange(dto.Status, checkedView.GroupIds, dto.beginDt, dto.endDt);
 
                 stopwatch.Stop();
-                return Ok(JsonView(true, $"查询成功!耗时{stopwatch.ElapsedMilliseconds/1000}s", new { daily = dailyResult, group = groupResult }));
+                return Ok(JsonView(true, $"查询成功!耗时{stopwatch.ElapsedMilliseconds / 1000}s", new { daily = dailyResult, group = groupResult }));
             }
             catch (Exception ex)
             {
@@ -2085,7 +2086,7 @@ namespace OASystem.API.Controllers
                         CNYSubTotalAmount = ((payInfo.DayRate * payInfo.PayMoney) / 100) * payInfo.PayPercentage //此次付款金额
                     };
 
-                    string remaksDescription = $"【{childInfo.PayType}】【{childInfo.ModuleName}】{rouNumber}、[申请人:{childInfo.Applicant}][收款方:{childInfo.Payee}]{priName}[{payInfo.ConsumptionPatterns}] {childInfo.PayCurrCode} {payInfo.PayMoney.ToString("#0.00")}、CNY:{childInfo.CNYSubTotalAmount.ToString("#0.00")}";
+                    string remaksDescription = $"【{childInfo.PayType}】【{childInfo.ModuleName}】{rouNumber}、[申请人:{childInfo.Applicant}][收款方:{childInfo.Payee}]{priName},{payInfo.OtherBankName},{payInfo.OtherSideNo}[{payInfo.ConsumptionPatterns}] {childInfo.PayCurrCode} {payInfo.PayMoney.ToString("#0.00")}、CNY:{childInfo.CNYSubTotalAmount.ToString("#0.00")}";
 
                     childInfo.RemaksDescription = remaksDescription;
                     childList.Add(childInfo);
@@ -2177,7 +2178,7 @@ namespace OASystem.API.Controllers
                     if (sd_transfer != null)
                     {
                         item.transferParentId = sd_transfer.STid;
-                        item.transferParentIdStr = sd_transfer.STid == 62 ? "公转" : sd_transfer.STid == 63 ? "私转" : "";
+                        item.transferParentIdStr = sd_transfer.STid == 0 ? "公转" : sd_transfer.STid == 1 ? "私转" : "";
                     }
                 }
                 else
@@ -2187,7 +2188,7 @@ namespace OASystem.API.Controllers
                     {
                         item.transferTypeIdStr = sd_transfer.Name;
                         item.transferParentId = sd_transfer.STid;
-                        item.transferParentIdStr = sd_transfer.STid == 62 ? "公转" : sd_transfer.STid == 63 ? "私转" : "";
+                        item.transferParentIdStr = sd_transfer.STid == 0 ? "公转" : sd_transfer.STid == 1 ? "私转" : "";
                         dic_setData.Add(item.transferTypeId, sd_transfer.Name);
                     }
                 }
@@ -2206,8 +2207,8 @@ namespace OASystem.API.Controllers
                 }
             }
 
-            decimal total_gz = DailyFeePaymentData.Where(s => s.transferParentId == 62).Sum(d => d.SumPrice ?? 0M);
-            decimal total_sz = DailyFeePaymentData.Where(s => s.transferParentId == 63).Sum(d => d.SumPrice ?? 0M);
+            decimal total_gz = DailyFeePaymentData.Where(s => s.transferParentId == 0).Sum(d => d.SumPrice ?? 0M);
+            decimal total_sz = DailyFeePaymentData.Where(s => s.transferParentId == 1).Sum(d => d.SumPrice ?? 0M);
 
             var result = new tree_Fin_DailyFeePaymentResult() { gz = total_gz, sz = total_sz, dataList = DailyFeePaymentData };
 
@@ -2640,7 +2641,7 @@ namespace OASystem.API.Controllers
                 string rst = AppSettingsHelper.Get("ExcelBaseUrl") + AppSettingsHelper.Get("ExcelFtpPath") + fileName;
                 stopwatch.Stop();
 
-                return Ok(JsonView(true, $"操作成功!{stopwatch.ElapsedMilliseconds/1000}s", new { url = rst }));
+                return Ok(JsonView(true, $"操作成功!{stopwatch.ElapsedMilliseconds / 1000}s", new { url = rst }));
 
             }
             catch (Exception ex)
@@ -3009,8 +3010,6 @@ namespace OASystem.API.Controllers
                         item.PriceDt = dtTemp_PriceDt.ToString("yyyy-MM-dd");
                     }
 
-
-
                     //费用类型
                     if (dic_setData.ContainsKey(item.PriceType))
                     {

+ 9 - 4
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -2136,7 +2136,11 @@ namespace OASystem.API.Controllers
                             }
                             else
                             {
-                                item.BankNo = item.BankType + ":" + item.BankNo?.Substring(0, 3);
+                                if (!string.IsNullOrEmpty(item.BankType))
+                                {
+                                    item.BankNo = item.BankType + ":" + item.BankNo?.Substring(0, 3);
+                                }
+                                
                             }
                             item.PrePrice = System.Decimal.Round(item.PrePrice, 2);
                             item.Price = System.Decimal.Round(item.Price, 2);
@@ -2163,11 +2167,14 @@ namespace OASystem.API.Controllers
             }
             catch (Exception ex)
             {
-                return Ok(JsonView(false, "程序错误!"));
+                return Ok(JsonView(false, ex.Message));
                 throw;
             }
         }
+        
+        
         Dictionary<string, string> transDic = new Dictionary<string, string>();
+
         /// <summary>
         /// 行程单导出
         /// </summary>
@@ -2892,8 +2899,6 @@ namespace OASystem.API.Controllers
             }
         }
 
-
-
         #endregion
 
         #region 文件上传、删除

+ 49 - 4
OASystem/OASystem.Infrastructure/Repositories/Financial/ProceedsReceivedRepository.cs

@@ -2,6 +2,7 @@
 using OASystem.Domain;
 using OASystem.Domain.Dtos.Financial;
 using OASystem.Domain.Entities.Financial;
+using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.ViewModels.Financial;
 using System;
 using System.Collections.Generic;
@@ -293,11 +294,11 @@ namespace OASystem.Infrastructure.Repositories.Financial
                             SectionTime = item.SectionTime,
                             Price = item.Price,
                             Currency = item.Currency,
-                            ReceivablesType= item.ReceivablesType,
+                            ReceivablesType = item.ReceivablesType,
                             Client = item.Client,
-                            CustomerName= item.CustomerName,
+                            CustomerName = item.CustomerName,
                             CustomerTel = item.CustomerTel,
-                            Remark= item.Remark
+                            Remark = item.Remark
                         });
                         if (!res)
                         {
@@ -306,7 +307,7 @@ namespace OASystem.Infrastructure.Repositories.Financial
                         }
                         updateCount++;
                     }
-                   _sqlSugar.CommitTran();
+                    _sqlSugar.CommitTran();
                     //updateCount = x.AsUpdateable.IgnoreColumns(p => new
                     //{
                     //    p.SectionTime,
@@ -321,8 +322,52 @@ namespace OASystem.Infrastructure.Repositories.Financial
                 }
                 result.Code = 0;
                 result.Msg = string.Format(@"操作成功!添加:{0}条;更新:{1};", addCount, updateCount);
+
+
+                //修改团组状态
+                int diId = dto.DiId;
+                decimal sum_fr = 0M;
+                decimal sum_pr = 0M;
+                decimal sum_refund = 0M; //收款退还
+                decimal sum_extra = 0M; //超支费用
+
+                //1.应收
+                string sql_fr = string.Format(@" Select * From Fin_ForeignReceivables Where IsDel=0 And Diid={0} ", diId);
+                List<Fin_ForeignReceivables> list_fr = _sqlSugar.SqlQueryable<Fin_ForeignReceivables>(sql_fr).ToList();
+                sum_fr = list_fr.Sum(s => s.ItemSumPrice);
+
+                //2.已收
+                string sql_pr = string.Format(@" Select * From Fin_ProceedsReceived Where IsDel=0 And Diid={0} ", diId);
+                List<Fin_ProceedsReceived> list_pr = _sqlSugar.SqlQueryable<Fin_ProceedsReceived>(sql_pr).ToList();
+                sum_pr = list_pr.Sum(s => s.Price);
+
+                //3.收款退还
+                string sql_other = string.Format(@"Select * From  Fin_PaymentRefundAndOtherMoney prao
+					  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);
+
+                //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);
+
+                decimal balance = ((sum_fr + sum_extra) - (sum_pr - sum_refund));
+
+                if (balance <= 0)
+                {
+                    bool res = await UpdateAsync<Grp_DelegationInfo>(s => s.Id == dto.DiId, s => new Grp_DelegationInfo
+                    {
+                        IsSure = 1
+                    });
+                }
             }
 
+
+
             return result;
         }
 

+ 16 - 10
OASystem/OASystem.Infrastructure/Repositories/Groups/AirTicketResRepository.cs

@@ -93,10 +93,14 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 {
                     UserId = "0";
                 }
-                string sql = string.Format(@"select a.*,c.IsAuditGM,(select Name from Sys_SetData where Id=a.cType) as 'CTypeName',(select Name from 
-                                                Sys_SetData where Id=a.PreCurrency) as 'PreCurrencyStr',(select Name from Sys_SetData where Id=a.Currency)
-                                                as 'CurrencyStr' from Grp_AirTicketReservations a,Grp_CreditCardPayment c where  a.id=c.CId  and a.isdel={1} and c.IsDel={1}
-                                                and a.DIId={0} and c.DIId={0} and c.CTable=85 and a.CreateUserId in({2}) Order By a.CreateTime desc", dto.DiId, 0,UserId);
+                string sql = string.Format(@"Select atr.*,ccp.IsAuditGM,sd1.Name As CTypeName,sd2.Name As PreCurrencyStr,sd3.Name As CurrencyStr
+                                             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.CreateTime desc", dto.DiId);
                 List<AirTicketReservationsView> _AirTicketReservations = _sqlSugar.SqlQueryable<AirTicketReservationsView>(sql).ToList();
 
                 foreach (var item in _AirTicketReservations)
@@ -877,12 +881,14 @@ namespace OASystem.Infrastructure.Repositories.Groups
             Result result = new Result() { Code = -2, Msg = "未知错误" };
             try
             {
-                string sql = string.Format(@"select d.TourCode,d.TeamName,a.FlightsCity,a.FlightsCode,a.FlightsDescription,(select Name from Sys_SetData where Id=a.cType) as 'CTypeName',a.ClientName,a.ClientNum,
-                                a.PrePrice,a.Price,(select Name from Sys_SetData where Id=c.PayDId) as 'PayType', case when 
-                                c.OrbitalPrivateTransfer=0 then '公转' when c.OrbitalPrivateTransfer=1 then '私转' end as OrbitalPrivateTransfer,c.BankNo,c.CreateTime,
-                                c.Payee,a.PriceDescription,(select Name from Sys_SetData where Id=a.Currency) as 'CurrencyStr',(select Name from Sys_SetData where Id=c.CTDId) as BankType
-                                from Grp_AirTicketReservations a,Grp_CreditCardPayment c ,Grp_DelegationInfo d where  a.id=c.CId and d.Id=a.DIId  and a.isdel=0
-                                and a.DIId={0} Order By a.CreateTime desc", dto.DiId, 0);
+                string sql = string.Format(@"Select atr.*,ccp.IsAuditGM,sd1.Name As 'CTypeName',sd2.Name As 'PreCurrencyStr',sd3.Name  As CurrencyStr
+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} And atr.CreateUserId = {1}
+Order By atr.CreateTime desc", dto.DiId, dto.UserId);
                 List<AirTicketReservationsPayView> _AirTicketReservations = _sqlSugar.SqlQueryable<AirTicketReservationsPayView>(sql).ToList();
                 if (_AirTicketReservations.Count != 0)
                 {

+ 124 - 19
OASystem/OASystem.Infrastructure/Repositories/Groups/EnterExitCostRepository.cs

@@ -138,19 +138,86 @@ namespace OASystem.Infrastructure.Repositories.Groups
         { 
             Result result = new Result() { Code =-1,Msg="操作失败!" };
 
+            #region MyRegion
+            //var enterExitCost = _mapper.Map<Grp_EnterExitCost>(dto);
+            ////enterExitCost.InsidePay = enterExitCost.Visa + enterExitCost.YiMiao + enterExitCost.HeSuan + enterExitCost.Service + enterExitCost.Safe + enterExitCost.Ticket;
+            //var quarterageData = _mapper.Map<List<Grp_DayAndCost>>(dto.QuarterageData);  //住宿费 1
+            //quarterageData = quarterageData.Select(it => { it.CreateUserId = dto.UserId; return it; }).ToList();
+
+            //var boardWagesData = _mapper.Map<List<Grp_DayAndCost>>(dto.BoardWagesData);  //伙食费 2
+            //boardWagesData = boardWagesData.Select(it => { it.CreateUserId = dto.UserId; return it; }).ToList();
+
+            //var miscellaneousFeeData = _mapper.Map<List<Grp_DayAndCost>>(dto.MiscellaneousFeeData);  //公杂费 3
+            //miscellaneousFeeData = miscellaneousFeeData.Select(it => { it.CreateUserId = dto.UserId; return it; }).ToList();
+
+            //var trainingExpenseData = _mapper.Map<List<Grp_DayAndCost>>(dto.TrainingExpenseData);    //培训费 4
+            //trainingExpenseData = trainingExpenseData.Select(it => { it.CreateUserId = dto.UserId; return it; }).ToList();
+
+
+            ////处理币种string
+            //enterExitCost.CurrencyRemark = CommonFun.GetCurrencyChinaToString(dto.Currencys);
+            //enterExitCost.CreateUserId = dto.UserId;
+
+            //_sqlSugar.BeginTran();
+
+            //if (dto.PortType == 1)
+            //{
+            //    try
+            //    {
+            //        var enterExit = _sqlSugar.Storageable<Grp_EnterExitCost>(enterExitCost).ToStorage();
+
+            //        var enterExitadd = enterExit.AsInsertable.ExecuteCommand();   //不存在插入
+            //        var enterExitedit = enterExit.AsUpdateable.IgnoreColumns(it => new { it.DiId, it.CreateUserId, it.CreateTime, it.IsDel }).ExecuteCommand();   //存在更新
+
+            //        var quarterage = _sqlSugar.Storageable<Grp_DayAndCost>(quarterageData).ToStorage();  //住宿费 1
+            //        var quarterageadd = quarterage.AsInsertable.ExecuteCommand();   //不存在插入                             
+            //        var quarterageedit = quarterage.AsUpdateable.IgnoreColumns(it => new { it.DiId, it.Type, it.CreateUserId, it.CreateTime, it.IsDel }).ExecuteCommand();   //存在更新
+
+            //        var boardWages = _sqlSugar.Storageable<Grp_DayAndCost>(boardWagesData).ToStorage();  //伙食费 2
+            //        var boardWagesadd = boardWages.AsInsertable.ExecuteCommand();   //不存在插入
+            //        var boardWagesedit = boardWages.AsUpdateable.IgnoreColumns(it => new { it.DiId, it.Type, it.CreateUserId, it.CreateTime, it.IsDel }).ExecuteCommand();   //存在更新
+
+            //        var miscellaneousFee = _sqlSugar.Storageable<Grp_DayAndCost>(miscellaneousFeeData).ToStorage(); //公杂费 3
+            //        var miscellaneousFeeedd = miscellaneousFee.AsInsertable.ExecuteCommand();   //不存在插入
+            //        var miscellaneousFeeedit = miscellaneousFee.AsUpdateable.IgnoreColumns(it => new { it.DiId, it.Type, it.CreateUserId, it.CreateTime, it.IsDel }).ExecuteCommand();   //存在更新
+
+            //        var trainingExpense = _sqlSugar.Storageable<Grp_DayAndCost>(trainingExpenseData).ToStorage();    //培训费 4
+            //        var trainingExpenseadd = trainingExpense.AsInsertable.ExecuteCommand();   //不存在插入
+            //        var trainingExpenseedit = trainingExpense.AsUpdateable.IgnoreColumns(it => new { it.DiId, it.Type, it.CreateUserId, it.CreateTime, it.IsDel }).ExecuteCommand();   //存在更新
+
+            //        _sqlSugar.CommitTran();
+            //        result.Code = 0;
+            //        result.Msg = "操作成功!";
+            //    }
+            //    catch (Exception ex)
+            //    {
+            //        _sqlSugar.RollbackTran();
+            //        result.Msg = ex.Message;
+            //    }
+            //}
+            //else result.Msg = ErrorMsg.Error_Port_Msg;
+            #endregion
+
             var enterExitCost = _mapper.Map<Grp_EnterExitCost>(dto);
             //enterExitCost.InsidePay = enterExitCost.Visa + enterExitCost.YiMiao + enterExitCost.HeSuan + enterExitCost.Service + enterExitCost.Safe + enterExitCost.Ticket;
+
+            List<Grp_DayAndCost> subData = new List<Grp_DayAndCost>();
             var quarterageData = _mapper.Map<List<Grp_DayAndCost>>(dto.QuarterageData);  //住宿费 1
             quarterageData = quarterageData.Select(it => { it.CreateUserId = dto.UserId; return it; }).ToList();
+            if (quarterageData.Count > 0) subData.AddRange(quarterageData);
 
             var boardWagesData = _mapper.Map<List<Grp_DayAndCost>>(dto.BoardWagesData);  //伙食费 2
             boardWagesData = boardWagesData.Select(it => { it.CreateUserId = dto.UserId; return it; }).ToList();
+            if (boardWagesData.Count > 0) subData.AddRange(boardWagesData);
 
             var miscellaneousFeeData = _mapper.Map<List<Grp_DayAndCost>>(dto.MiscellaneousFeeData);  //公杂费 3
             miscellaneousFeeData = miscellaneousFeeData.Select(it => { it.CreateUserId = dto.UserId; return it; }).ToList();
+            if (miscellaneousFeeData.Count > 0) subData.AddRange(miscellaneousFeeData);
 
             var trainingExpenseData = _mapper.Map<List<Grp_DayAndCost>>(dto.TrainingExpenseData);    //培训费 4
             trainingExpenseData = trainingExpenseData.Select(it => { it.CreateUserId = dto.UserId; return it; }).ToList();
+            if (trainingExpenseData.Count > 0) subData.AddRange(trainingExpenseData);
+
 
 
             //处理币种string
@@ -163,30 +230,67 @@ namespace OASystem.Infrastructure.Repositories.Groups
             {
                 try
                 {
-                    var enterExit = _sqlSugar.Storageable<Grp_EnterExitCost>(enterExitCost).ToStorage();
-                    
-                    var enterExitadd = enterExit.AsInsertable.ExecuteCommand();   //不存在插入
-                    var enterExitedit = enterExit.AsUpdateable.IgnoreColumns(it => new { it.DiId, it.CreateUserId, it.CreateTime, it.IsDel }).ExecuteCommand();   //存在更新
-
-                    var quarterage = _sqlSugar.Storageable<Grp_DayAndCost>(quarterageData).ToStorage();  //住宿费 1
-                    var quarterageadd  =quarterage.AsInsertable.ExecuteCommand();   //不存在插入                             
-                    var quarterageedit = quarterage.AsUpdateable.IgnoreColumns(it => new { it.DiId, it.Type, it.CreateUserId, it.CreateTime, it.IsDel }).ExecuteCommand();   //存在更新
-
-                    var boardWages = _sqlSugar.Storageable<Grp_DayAndCost>(boardWagesData).ToStorage();  //伙食费 2
-                    var boardWagesadd  =boardWages.AsInsertable.ExecuteCommand();   //不存在插入
-                    var boardWagesedit = boardWages.AsUpdateable.IgnoreColumns(it => new { it.DiId, it.Type, it.CreateUserId, it.CreateTime, it.IsDel }).ExecuteCommand();   //存在更新
-
-                    var miscellaneousFee = _sqlSugar.Storageable<Grp_DayAndCost>(miscellaneousFeeData).ToStorage(); //公杂费 3
-                    var miscellaneousFeeedd  =miscellaneousFee.AsInsertable.ExecuteCommand();   //不存在插入
-                    var miscellaneousFeeedit = miscellaneousFee.AsUpdateable.IgnoreColumns(it => new { it.DiId, it.Type, it.CreateUserId, it.CreateTime, it.IsDel }).ExecuteCommand();   //存在更新
+                    int enterExitId = 0;
+                    if (enterExitCost.Id > 0) //修改
+                    {
+                        var updateId = _sqlSugar.Updateable<Grp_EnterExitCost>(enterExitCost)
+                                                .IgnoreColumns(it => new { it.DeleteUserId, it.DeleteTime, it.CreateUserId, it.CreateTime, it.IsDel })
+                                                .ExecuteCommand();
+                        if (updateId > 0)
+                        {
+                            enterExitId = enterExitCost.Id;
+                        }
+                        else
+                        {
+                            _sqlSugar.RollbackTran();
+                            result.Msg = "修改操作失败!";
+                            return result;
+
+                        }
+                    }
+                    else
+                    { //添加
+                        enterExitId = _sqlSugar.Insertable<Grp_EnterExitCost>(enterExitCost).ExecuteReturnIdentity();
+                        if (enterExitId < 1)
+                        {
+                            result.Msg = "添加操作失败!";
+                            return result;
+                        }
+                    }
 
-                    var trainingExpense = _sqlSugar.Storageable<Grp_DayAndCost>(trainingExpenseData).ToStorage();    //培训费 4
-                    var trainingExpenseadd  =trainingExpense.AsInsertable.ExecuteCommand();   //不存在插入
-                    var trainingExpenseedit = trainingExpense.AsUpdateable.IgnoreColumns(it => new { it.DiId, it.Type, it.CreateUserId, it.CreateTime, it.IsDel }).ExecuteCommand();   //存在更新
+                    if (enterExitId > 0)
+                    {
+                        foreach (var item in subData)
+                        {
+                            if (item.Id > 0) //修改
+                            {
+                                var updateId = _sqlSugar.Updateable<Grp_DayAndCost>(item)
+                                                        .IgnoreColumns(it => new { it.DiId, it.Type, it.CreateUserId, it.CreateTime, it.IsDel })
+                                                        .ExecuteCommand();
+                                if (updateId < 1)
+                                {
+                                    _sqlSugar.RollbackTran();
+                                    result.Msg = "修改操作失败!";
+                                    return result;
+                                }
+                            }
+                            else
+                            {  //添加
+                                var updateId = _sqlSugar.Insertable<Grp_DayAndCost>(item).ExecuteCommand();
+                                if (updateId < 1)
+                                {
+                                    _sqlSugar.RollbackTran();
+                                    result.Msg = "添加操作失败!";
+                                    return result;
+                                }
+                            }
+                        }
+                    }
 
                     _sqlSugar.CommitTran();
                     result.Code = 0;
                     result.Msg = "操作成功!";
+
                 }
                 catch (Exception ex)
                 {
@@ -196,6 +300,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
             }
             else result.Msg = ErrorMsg.Error_Port_Msg;
 
+
             return result;
         }
 

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

@@ -219,7 +219,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
             }
             catch (Exception ex)
             {
-                return result = new Result() { Code = -2, Msg = "未知错误" };
+                return result = new Result() { Code = -2, Msg = ex.Message };
             }
         }
 

+ 10 - 10
OASystem/OASystem.Infrastructure/Repositories/Groups/TourClientListRepository.cs

@@ -192,11 +192,11 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 return _result;
             }
 
-            if (string.IsNullOrEmpty(dto.IDCardNo))
-            {
-                _result.Msg = "客户身份证No为空!";
-                return _result;
-            }
+            //if (string.IsNullOrEmpty(dto.IDCardNo))
+            //{
+            //    _result.Msg = "客户身份证No为空!";
+            //    return _result;
+            //}
 
             if (dto.ShippingSpaceTypeId < 0)
             {
@@ -211,10 +211,10 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 _sqlSugar.BeginTran();
                 int clientId = -1;
                 int crmCompanyId = -1;
-                var clientInfo = await _sqlSugar.Queryable<Crm_DeleClient>().Where(it => it.IsDel == 0 &&
-                                                                                         it.LastName.Equals(dto.LastName) &&
-                                                                                         it.FirstName.Equals(dto.FirstName) &&
-                                                                                         it.Phone.Equals(dto.Phone)
+                var clientInfo = await _sqlSugar.Queryable<Crm_DeleClient>().Where(it => it.IsDel == 0 
+                                                                                         && it.LastName.Equals(dto.LastName) 
+                                                                                         && it.FirstName.Equals(dto.FirstName) 
+                                                                                         //&& it.Phone.Equals(dto.Phone)
                                                                                    ).FirstAsync();
 
                 Crm_CustomerCompany _CustomerCompany = new Crm_CustomerCompany()
@@ -271,7 +271,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     if (companyInfo != null)
                     {
                         crmCompanyId = companyInfo.Id;
-                        if (!companyInfo.CompanyFullName.Equals(dto.CompanyFullName))
+                        if (companyInfo.CompanyFullName.Equals(dto.CompanyFullName))
                         {
                             companyInfo.CompanyFullName = dto.CompanyFullName;
                             var companyEdit = await _sqlSugar.Updateable(companyInfo).UpdateColumns(it =>