浏览代码

修复成本save bug

yuanrf 10 月之前
父节点
当前提交
e9efea3d09
共有 1 个文件被更改,包括 12 次插入0 次删除
  1. 12 0
      OASystem/OASystem.Infrastructure/Repositories/Groups/GroupCostParameterRepository.cs

+ 12 - 0
OASystem/OASystem.Infrastructure/Repositories/Groups/GroupCostParameterRepository.cs

@@ -41,9 +41,21 @@ namespace OASystem.Infrastructure.Repositories.Groups
             try
             {
                 BeginTran();
+                var mainCost = GetGroupCostParameterMainByDiid(diid) ?? new Grp_GroupCostParameter
+                {
+                    IsShare = 0
+                };
                 isTrue = await DeleteGroupCostParameterListByDiid(diid, Userid);
                 if (List.Count > 0)
                 {
+                    foreach (var item in List)
+                    {
+                        if (item.CostType == "A")
+                        {
+                            item.IsShare = mainCost.IsShare;
+                            break;
+                        }
+                    }
                     List.ForEach(x => { x.CreateUserId = Userid; x.CreateTime = DateTime.Now; });
                     isTrue = Adds(List) > 0;
                 }