Browse Source

其他款项-出行物资 --> 自动审核 代码编写、测试、代码优化

LEIYI 1 month ago
parent
commit
7f60ea01d5

+ 25 - 3
OASystem/OASystem.Infrastructure/Repositories/Groups/FeeAuditRepository.cs

@@ -385,10 +385,32 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 var teNames = setData.Where(x => x.STid == 91).Select(x => x.Name).ToList();
                 var otherFeeDatas = _sqlSugar.Queryable<Grp_DecreasePayments>()
                     .InnerJoin<Grp_CreditCardPayment>((dp,ccp) => dp.Id == ccp.CId && ccp.CTable == 98 && ccp.IsDel == 0)
-                    .Where((dp, ccp) => dp.IsDel == 0 && teNames.Contains(dp.PriceName))
+                    .Where((dp, ccp) => dp.IsDel == 0 && dp.DiId == diId)
                     .ToList();
-                decimal otherFeeCNYTotal = otherFeeDatas.Sum(x => x.FeeTotal);  //其他费用出行物资总金额
-                if (groupCostCNYTotal <= 0.00M)
+
+                var ids = new List<int>();
+                foreach (var item in otherFeeDatas)
+                {
+                    if (item.PriceName.Contains("、"))
+                    {
+                        var priceNames = item.PriceName.Split('、');
+                        foreach (var priceName in priceNames)
+                        {
+                            if (teNames.Contains(priceName))
+                            {
+                                ids.Add(item.Id);
+                                continue;
+                            }
+                        }
+                    }
+                    else if(teNames.Contains(item.PriceName))
+                    {
+                        ids.Add(item.Id);
+                    }
+                }
+                ids = ids.Distinct().ToList();
+                decimal otherFeeCNYTotal = otherFeeDatas.Where(x => ids.Contains(x.Id)).Sum(x => x.FeeTotal);  //其他费用出行物资总金额
+                if (otherFeeCNYTotal <= 0.00M)
                 {
                     _view.Msg = $"其他款项出行物资费用数据未填写";
                     QuashAudit(currModule, diId, dataId);