瀏覽代碼

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

leiy 10 月之前
父節點
當前提交
6f1bc4d1ca

+ 1 - 1
OASystem/OASystem.Domain/Dtos/Financial/DailyFeePaymentDto.cs

@@ -135,7 +135,7 @@ namespace OASystem.Domain.Dtos.Financial
         /// <summary>
         /// 数量
         /// </summary>
-        public int Quantity { get; set; }
+        public decimal Quantity { get; set; }
 
         /// <summary>
         /// 单价

+ 2 - 2
OASystem/OASystem.Domain/Entities/Financial/Fin_DailyFeePaymentContent.cs

@@ -27,8 +27,8 @@ namespace OASystem.Domain.Entities.Financial
         /// <summary>
         /// 数量
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
-        public int Quantity { get; set; }
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(18,2)")]
+        public decimal Quantity { get; set; }
 
         /// <summary>
         /// 单价

+ 4 - 4
OASystem/OASystem.Domain/ViewModels/Financial/Fin_DailyFeePaymentView.cs

@@ -170,7 +170,7 @@ namespace OASystem.Domain.ViewModels.Financial
         /// <summary>
         /// 数量单价
         /// </summary>
-        public int Quantity { get; set; }
+        public decimal Quantity { get; set; }
 
         /// <summary>
         /// 费用单价
@@ -359,7 +359,7 @@ namespace OASystem.Domain.ViewModels.Financial
         public string transferParentIdStr { get; set; }
     }
 
-    public class tree_Fin_DailyFeePaymentResult : tree_Fin_DailyFeePaymentPageListView 
+    public class tree_Fin_DailyFeePaymentResult : tree_Fin_DailyFeePaymentPageListView
     {
         public decimal gz { get; set; } = 0M;
         public decimal sz { get; set; } = 0M;
@@ -371,7 +371,7 @@ namespace OASystem.Domain.ViewModels.Financial
     /// <summary>
     /// 团组相关费用
     /// </summary>
-    public class tree_Group_DailyFeePaymentResult 
+    public class tree_Group_DailyFeePaymentResult
     {
         public decimal gz { get; set; } = 0M;
         public decimal sz { get; set; } = 0M;
@@ -409,7 +409,7 @@ namespace OASystem.Domain.ViewModels.Financial
     public class CompanyInfo
     {
         public int Id { get; set; }
-        public string   ConpanyName { get; set; }
+        public string ConpanyName { get; set; }
     }
 
     public class Group_DailyFeePaymentContentInfolView

+ 35 - 12
OASystem/OASystem.Infrastructure/Repositories/Financial/ProceedsReceivedRepository.cs

@@ -15,7 +15,7 @@ namespace OASystem.Infrastructure.Repositories.Financial
     /// 财务 - 团组已收款项
     /// 雷怡 2023.08.16 15:24
     /// </summary>
-    public class ProceedsReceivedRepository:BaseRepository<Fin_ProceedsReceived,Fin_ProceedsReceivedView>
+    public class ProceedsReceivedRepository : BaseRepository<Fin_ProceedsReceived, Fin_ProceedsReceivedView>
     {
         private readonly IMapper _mapper;
 
@@ -62,7 +62,7 @@ namespace OASystem.Infrastructure.Repositories.Financial
 
 
             var groupReceivablesList = await _sqlSugar.Queryable<Fin_ProceedsReceived>()
-                .Where(fr => fr.IsDel == 0 && diids.Contains(fr.Diid)) .ToListAsync();
+                .Where(fr => fr.IsDel == 0 && diids.Contains(fr.Diid)).ToListAsync();
 
             result.Code = 0;
             result.Msg = "查询成功!";
@@ -284,17 +284,40 @@ namespace OASystem.Infrastructure.Repositories.Financial
                 {
                     var x = _sqlSugar.Storageable(_ProceedsReceived).ToStorage();
                     addCount = x.AsInsertable.ExecuteCommand();        //不存在插入
-                    updateCount = x.AsUpdateable.IgnoreColumns(p => new
+
+                    _sqlSugar.BeginTran();
+                    foreach (var item in _ProceedsReceived)
                     {
-                        p.SectionTime,
-                        p.Price,
-                        p.Currency,
-                        p.ReceivablesType,
-                        p.Client,
-                        p.CustomerName,
-                        p.CustomerTel,
-                        p.Remark
-                    }).ExecuteCommand();    //存在更新
+                        bool res = await UpdateAsync<Fin_ProceedsReceived>(s => s.Id == item.Id, s => new Fin_ProceedsReceived
+                        {
+                            SectionTime = item.SectionTime,
+                            Price = item.Price,
+                            Currency = item.Currency,
+                            ReceivablesType= item.ReceivablesType,
+                            Client = item.Client,
+                            CustomerName= item.CustomerName,
+                            CustomerTel = item.CustomerTel,
+                            Remark= item.Remark
+                        });
+                        if (!res)
+                        {
+                            _sqlSugar.RollbackTran();
+                            break;
+                        }
+                        updateCount++;
+                    }
+                   _sqlSugar.CommitTran();
+                    //updateCount = x.AsUpdateable.IgnoreColumns(p => new
+                    //{
+                    //    p.SectionTime,
+                    //    p.Price,
+                    //    p.Currency,
+                    //    p.ReceivablesType,
+                    //    p.Client,
+                    //    p.CustomerName,
+                    //    p.CustomerTel,
+                    //    p.Remark
+                    //}).ExecuteCommand();    //存在更新
                 }
                 result.Code = 0;
                 result.Msg = string.Format(@"操作成功!添加:{0}条;更新:{1};", addCount, updateCount);

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

@@ -44,7 +44,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                 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 IsDel=0) as 'isAudit' from Grp_DecreasePayments s 
+                                            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);
                 List<DecreasePaymentsView> _DecreasePayments = await _sqlSugar.SqlQueryable<DecreasePaymentsView>(sql).ToListAsync();
                 if (_DecreasePayments.Count > 0)