Browse Source

成本修改为保留所有历史记录

yuanrf 9 months ago
parent
commit
fb5923ac61

+ 1 - 1
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -7175,7 +7175,7 @@ namespace OASystem.API.Controllers
             {
                 _sqlSugar.BeginTran();
                 isTrue = await _GroupCostRepository.
-                    SaveGroupCostList(Grp_groups, dto.Diid); //列表
+                    SaveGroupCostList(Grp_groups, dto.Diid,dto.Userid); //列表
                 isTrue = await _checkBoxs.SaveCheckBoxs(Grp_CheckBoxs, dto.Diid); //选中项
                 isTrue = await _CostTypeHotelNumberRepository.SaveHotelNumber(Grp_HotelNumber, dto.Userid, dto.Diid); //酒店房间数量
                 isTrue = await _GroupCostParameterRepository.SaveAsync(Grp_CostParameters, dto.Userid, dto.Diid); //系数

+ 9 - 2
OASystem/OASystem.Infrastructure/Repositories/Groups/GroupCostRepository.cs

@@ -24,10 +24,17 @@ namespace OASystem.Infrastructure.Repositories.Groups
             return Query(x=> x.IsDel < 1).ToList();
         }
 
-        public async Task<bool> SaveGroupCostList(List<Grp_GroupCost> costList,int diid)
+        public async Task<bool> SaveGroupCostList(List<Grp_GroupCost> costList,int diid, int userid)
         {
             BeginTran();
-            bool isTrue = await DeleteGroupCostList(diid);
+            //注释删除
+            //bool isTrue = await DeleteGroupCostList(diid);
+            bool isTrue = await UpdateAsync(x => x.Diid == diid && x.IsDel == 0, x => new Grp_GroupCost
+            {
+                IsDel = 1,
+                DeleteUserId = userid,
+                DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
+            }) ;
             if (costList.Count > 0)
             {
                 isTrue = Adds(costList) > 0;