|
@@ -28,6 +28,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
/// 1.酒店 76
|
|
/// 1.酒店 76
|
|
/// 2.op 79
|
|
/// 2.op 79
|
|
/// 3.其他费用-出行物资 98
|
|
/// 3.其他费用-出行物资 98
|
|
|
|
+ /// 4.保险 82
|
|
/// </param>
|
|
/// </param>
|
|
/// <param name="diId">团组Id</param>
|
|
/// <param name="diId">团组Id</param>
|
|
/// <param name="dataId">数据Id(模块类型主表Id)</param>
|
|
/// <param name="dataId">数据Id(模块类型主表Id)</param>
|
|
@@ -384,7 +385,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
|
|
|
var teNames = setData.Where(x => x.STid == 91).Select(x => x.Name).ToList();
|
|
var teNames = setData.Where(x => x.STid == 91).Select(x => x.Name).ToList();
|
|
var otherFeeDatas = _sqlSugar.Queryable<Grp_DecreasePayments>()
|
|
var otherFeeDatas = _sqlSugar.Queryable<Grp_DecreasePayments>()
|
|
- .InnerJoin<Grp_CreditCardPayment>((dp,ccp) => dp.Id == ccp.CId && ccp.CTable == 98 && ccp.IsDel == 0)
|
|
|
|
|
|
+ .InnerJoin<Grp_CreditCardPayment>((dp, ccp) => dp.Id == ccp.CId && ccp.CTable == 98 && ccp.IsDel == 0)
|
|
.Where((dp, ccp) => dp.IsDel == 0 && dp.DiId == diId)
|
|
.Where((dp, ccp) => dp.IsDel == 0 && dp.DiId == diId)
|
|
.ToList();
|
|
.ToList();
|
|
|
|
|
|
@@ -403,7 +404,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- else if(teNames.Contains(item.PriceName))
|
|
|
|
|
|
+ else if (teNames.Contains(item.PriceName))
|
|
{
|
|
{
|
|
ids.Add(item.Id);
|
|
ids.Add(item.Id);
|
|
}
|
|
}
|
|
@@ -455,6 +456,60 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
|
|
|
#endregion
|
|
#endregion
|
|
}
|
|
}
|
|
|
|
+ else if (feeType == 4)
|
|
|
|
+ {
|
|
|
|
+ #region 保险费用录入自动审核
|
|
|
|
+ var currModule = 82;
|
|
|
|
+ var insuranceType = _sqlSugar.Queryable<Grp_InsuranceCost>().Where(x => x.IsDel == 0 && x.Id != 2).Select(x => x.Id).ToList();
|
|
|
|
+ var insuranceCostData = _sqlSugar.Queryable<Grp_Customers>()
|
|
|
|
+ .LeftJoin<Grp_CreditCardPayment>((c, ccp) => c.Id == ccp.CId && ccp.CTable == 82)
|
|
|
|
+ .Where((c, ccp) => c.IsDel == 0 && c.DiId == diId && insuranceType.Contains(c.Iid))
|
|
|
|
+ .Select((c, ccp) => new
|
|
|
|
+ {
|
|
|
|
+ c.Id,
|
|
|
|
+ CNYPrice = ccp.PayMoney * ccp.DayRate
|
|
|
|
+ })
|
|
|
|
+ .ToList();
|
|
|
|
+ var currInsuranceInfo = insuranceCostData.Where(x => x.Id == dataId).FirstOrDefault();
|
|
|
|
+ if (!insuranceCostData.Any() && currInsuranceInfo == null)
|
|
|
|
+ {
|
|
|
|
+ _view.Msg = $"暂无保险数据,不可自动审核!";
|
|
|
|
+ return _view;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (currInsuranceInfo.CNYPrice == 0.00M)
|
|
|
|
+ {
|
|
|
|
+ _view.Msg = $"保险数据未录入费用信息,不可自动审核!";
|
|
|
|
+ QuashAudit(currModule, diId, dataId);
|
|
|
|
+ return _view;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ var groupBudgetCost = groupInfo.BXCB * groupInfo.BXRS;
|
|
|
|
+ var groupActialCost = insuranceCostData.Sum(x => x.CNYPrice);
|
|
|
|
+
|
|
|
|
+ if (groupActialCost > groupBudgetCost)
|
|
|
|
+ {
|
|
|
|
+ _view.Msg = $"保险费用超出团组成本费用";
|
|
|
|
+ QuashAudit(currModule, diId, dataId);
|
|
|
|
+ return _view;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //自动审核
|
|
|
|
+ var ccpUpdate = _sqlSugar.Updateable<Grp_CreditCardPayment>()
|
|
|
|
+ .SetColumns(it => it.IsAuditGM == 3)
|
|
|
|
+ .SetColumns(it => it.AuditGMOperate == 4)
|
|
|
|
+ .SetColumns(it => it.AuditGMDate == DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"))
|
|
|
|
+ .Where(s => s.DIId == diId && s.CTable == currModule && s.CId == dataId)
|
|
|
|
+ .ExecuteCommand();
|
|
|
|
+ if (ccpUpdate > 0)
|
|
|
|
+ {
|
|
|
|
+ _view.Code = 200;
|
|
|
|
+ _view.Msg = "自动审核执行成功";
|
|
|
|
+ }
|
|
|
|
+ else _view.Msg = "自动审核执行失败";
|
|
|
|
+ return _view;
|
|
|
|
+ #endregion
|
|
|
|
+ }
|
|
else _view.Msg = $"请传入有效的feeType参数";
|
|
else _view.Msg = $"请传入有效的feeType参数";
|
|
|
|
|
|
return _view;
|
|
return _view;
|