|
@@ -40,6 +40,7 @@ using System.ComponentModel.DataAnnotations;
|
|
|
using System.Data;
|
|
|
using System.Diagnostics;
|
|
|
using System.Globalization;
|
|
|
+using System.IO;
|
|
|
using System.IO.Compression;
|
|
|
using System.Text.Json;
|
|
|
using System.Text.RegularExpressions;
|
|
@@ -15211,6 +15212,46 @@ FROM
|
|
|
//自动审核
|
|
|
await _feeAuditRep.FeeAutomaticAudit(2, dto.DiId, dto.CTGGRId);
|
|
|
|
|
|
+ #region 尾款自动审核
|
|
|
+ var opinfos = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservations>()
|
|
|
+ .First(x => x.IsDel == 0 && x.DiId == dto.DiId && x.Id == dto.CTGGRId);
|
|
|
+ if (opinfos.PriceType == 1062)
|
|
|
+ {
|
|
|
+ var isAuto = false;
|
|
|
+ //找对应的首付款
|
|
|
+ var firstPrice = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservations>()
|
|
|
+ .InnerJoin<Grp_CreditCardPayment>((x,a) => a.IsDel == 0 && a.CTable == 79 && a.CId == x.Id && a.DIId == x.DiId && (a.IsAuditGM == 1 || a.IsAuditGM == 3 ))
|
|
|
+ .First(x => x.IsDel == 0 && x.DiId == dto.DiId && x.PriceName == opinfos.PriceName &&
|
|
|
+ x.ServiceStartTime == opinfos.ServiceStartTime && x.ServiceEndTime == opinfos.ServiceEndTime && x.Area == opinfos.Area &&
|
|
|
+ x.PriceType == 1061 && x.DiId == dto.DiId);
|
|
|
+
|
|
|
+ if (firstPrice!= null && !(opinfos.SelectCheck.Contains("超时") || opinfos.SelectCheck.Contains("超支")) && firstPrice.CId == opinfos.CId)
|
|
|
+ {
|
|
|
+ var cprice = _sqlSugar.Queryable<Grp_CreditCardPayment>().First(x => x.IsDel == 0 && x.CId == firstPrice.Id && x.CTable == 79);
|
|
|
+ var balance = firstPrice.ServiceQuotedPrice * (100 - cprice.PayPercentage) / 100;
|
|
|
+ if (balance >= opinfos.ServiceQuotedPrice)
|
|
|
+ {
|
|
|
+ isAuto = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if (isAuto)
|
|
|
+ {
|
|
|
+ var execCount = _sqlSugar.Updateable<Grp_CreditCardPayment>()
|
|
|
+ .SetColumns(a => new Grp_CreditCardPayment
|
|
|
+ {
|
|
|
+ IsAuditGM = 3, //自动审核通过
|
|
|
+ AuditGMOperate = 4,
|
|
|
+ AuditGMDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
|
|
|
+ })
|
|
|
+ .Where(a => a.CId == dto.CTGGRId && a.CTable == 79 && a.DIId == dto.DiId)
|
|
|
+ .ExecuteCommand();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+
|
|
|
#region 应用推送
|
|
|
try
|
|
|
{
|
|
@@ -26477,11 +26518,19 @@ ORDER BY
|
|
|
.Where(x => x.IsDel == 0 && x.STid == 21)
|
|
|
.Select(x => new { x.Id, Text = x.Name })
|
|
|
.ToListAsync();
|
|
|
+
|
|
|
+ var hwids = _sqlSugar.Queryable<Sys_SetData>()
|
|
|
+ .Where(x => x.IsDel == 0 && x.STid == 10 && x.Name.Contains("会务活动"))
|
|
|
+ .Select(x => x.Id)
|
|
|
+ .ToList();
|
|
|
+
|
|
|
+ //仅检索会务团组
|
|
|
var groupList = await _sqlSugar.Queryable<Grp_DelegationInfo>()
|
|
|
- .Where(x => x.IsDel == 0)
|
|
|
+ .Where(x => x.IsDel == 0 && hwids.Contains(x.TeamDid))
|
|
|
.OrderByDescending(x => x.VisitDate)
|
|
|
.Select(x => new { x.Id, x.TeamName })
|
|
|
.ToListAsync();
|
|
|
+
|
|
|
var currenyList = await GeneralMethod.PostGroupTeamRateByDiIdAndCTableId(1, di.Id, 98);
|
|
|
var userList = await _sqlSugar.Queryable<Sys_Users>()
|
|
|
.Where(x => x.IsDel == 0)
|