|
@@ -7,6 +7,7 @@ using OASystem.Domain.Dtos.Groups;
|
|
|
using OASystem.Domain.Entities.Customer;
|
|
|
using OASystem.Domain.Entities.Financial;
|
|
|
using OASystem.Domain.Entities.Groups;
|
|
|
+using OASystem.Domain.Entities.Resource;
|
|
|
using OASystem.Domain.ViewModels.Financial;
|
|
|
using OASystem.Domain.ViewModels.Groups;
|
|
|
using OASystem.Infrastructure.Repositories.System;
|
|
@@ -297,22 +298,17 @@ Left Join Sys_SetData as sd With(Nolock) On c.PayDId = sd.Id
|
|
|
/// <returns></returns>
|
|
|
public async Task<Result> PostVisaById(PostVisaByIdDto dto)
|
|
|
{
|
|
|
- Result result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
- try
|
|
|
- {
|
|
|
- Grp_VisaInfo _VisaInfo = _sqlSugar.Queryable<Grp_VisaInfo>().First(a => a.Id == dto.Id && a.IsDel == 0);
|
|
|
- Grp_CreditCardPayment _CreditCardPayment = _sqlSugar.Queryable<Grp_CreditCardPayment>().First(a => a.CId == dto.Id && a.IsDel == 0 && a.CTable == 80);
|
|
|
- var data = new
|
|
|
- {
|
|
|
- VisaInfo = _VisaInfo,
|
|
|
- CreditCardPayment = _CreditCardPayment
|
|
|
- };
|
|
|
- return result = new Result() { Code = 0, Msg = "暂无数据!", Data = data };
|
|
|
- }
|
|
|
- catch (Exception ex)
|
|
|
+ var result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
+
|
|
|
+ Grp_VisaInfo _VisaInfo = _sqlSugar.Queryable<Grp_VisaInfo>().First(a => a.Id == dto.Id && a.IsDel == 0);
|
|
|
+ Grp_CreditCardPayment _CreditCardPayment = _sqlSugar.Queryable<Grp_CreditCardPayment>().First(a => a.CId == dto.Id && a.IsDel == 0 && a.CTable == 80);
|
|
|
+ var data = new
|
|
|
{
|
|
|
- return result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
- }
|
|
|
+ VisaInfo = _VisaInfo,
|
|
|
+ CreditCardPayment = _CreditCardPayment
|
|
|
+ };
|
|
|
+ return result = new Result() { Code = 0, Msg = "暂无数据!", Data = data };
|
|
|
+
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 签证费用录入操作(Status:1.新增,2.修改)
|
|
@@ -339,8 +335,32 @@ Left Join Sys_SetData as sd With(Nolock) On c.PayDId = sd.Id
|
|
|
|
|
|
c.RMBPrice = c.PayMoney;
|
|
|
c.DayRate = 1.0000M;
|
|
|
- Grp_TeamRate _TeamRate = _sqlSugar.Queryable<Grp_TeamRate>().First(a => a.DiId == dto.DiId && a.IsDel == 0 && a.CTable == 80);
|
|
|
- List<CurrencyInfo> currencyInfos = new List<CurrencyInfo>();
|
|
|
+
|
|
|
+ #region 自动审核处理
|
|
|
+ var isAutoAudit = false;
|
|
|
+ if (dto.IsThird == 0)
|
|
|
+ {
|
|
|
+ var visaFeeInfo = _sqlSugar.Queryable<Res_CountryFeeCost>().Where(x => x.IsDel == 0 && x.VisaCountry.Equals(dto.Area)).First();
|
|
|
+ if (visaFeeInfo != null) {
|
|
|
+
|
|
|
+ var visaFeePrice = visaFeeInfo.VisaPrice;
|
|
|
+ if (dto.AgencyFeeType == 1) visaFeePrice += visaFeeInfo.PettyBusinessAgencyFee;
|
|
|
+ else if (dto.AgencyFeeType == 2) visaFeePrice += visaFeeInfo.GrandBusinessAgencyFee;
|
|
|
+ var visaFeeTotalPrice = visaFeePrice * dto.VisaNumber;
|
|
|
+ if (dto.VisaPrice <= visaFeeTotalPrice)
|
|
|
+ {
|
|
|
+ isAutoAudit = true;
|
|
|
+ c.IsAuditGM = 3;
|
|
|
+ c.AuditGMOperate = 4; //系统管理员
|
|
|
+ c.AuditGMDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ var _TeamRate = _sqlSugar.Queryable<Grp_TeamRate>().First(a => a.DiId == dto.DiId && a.IsDel == 0 && a.CTable == 80);
|
|
|
+ var currencyInfos = new List<CurrencyInfo>();
|
|
|
if (_TeamRate != null)
|
|
|
{
|
|
|
Sys_SetData _SetData = _sqlSugar.Queryable<Sys_SetData>().First(a => a.IsDel == 0 && a.Id == c.PaymentCurrency);
|
|
@@ -358,13 +378,14 @@ Left Join Sys_SetData as sd With(Nolock) On c.PayDId = sd.Id
|
|
|
|
|
|
if (dto.Status == 1)//添加
|
|
|
{
|
|
|
- Grp_VisaInfo grp_Visa = _sqlSugar.Queryable<Grp_VisaInfo>()
|
|
|
- .First(a => a.IsDel == 0 &&
|
|
|
- a.VisaDescription.Equals(dto.VisaDescription) &&
|
|
|
- a.VisaCurrency == dto.VisaCurrency &&
|
|
|
- a.VisaPrice == dto.VisaPrice &&
|
|
|
- a.VisaClient == dto.VisaClient
|
|
|
- );
|
|
|
+ var grp_Visa = _sqlSugar.Queryable<Grp_VisaInfo>()
|
|
|
+ .First(a => a.IsDel == 0 &&
|
|
|
+ a.DIId == dto.DiId &&
|
|
|
+ a.VisaDescription.Equals(dto.VisaDescription) &&
|
|
|
+ a.VisaCurrency == dto.VisaCurrency &&
|
|
|
+ a.VisaPrice == dto.VisaPrice &&
|
|
|
+ a.VisaClient == dto.VisaClient
|
|
|
+ );
|
|
|
if (grp_Visa != null)
|
|
|
{
|
|
|
return result = new Result() { Code = -1, Msg = "该笔费用已存在,请勿重复添加!" };
|
|
@@ -433,8 +454,10 @@ Left Join Sys_SetData as sd With(Nolock) On c.PayDId = sd.Id
|
|
|
BankNo = c.BankNo,
|
|
|
CardholderName = c.CardholderName,
|
|
|
Remark = c.Remark,
|
|
|
-
|
|
|
})
|
|
|
+ .SetColumnsIF(isAutoAudit, x => x.IsAuditGM == 3)
|
|
|
+ .SetColumnsIF(isAutoAudit, x => x.AuditGMOperate == 4)
|
|
|
+ .SetColumnsIF(isAutoAudit, x => x.AuditGMDate == DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"))
|
|
|
.ExecuteCommandAsync();
|
|
|
|
|
|
var ccp = Query<Grp_CreditCardPayment>(a => a.CId == grp_Visa1.Id && a.CTable == 80).First();
|