|
@@ -26,6 +26,7 @@ using System.Diagnostics;
|
|
|
using System.Globalization;
|
|
|
using System.IO.Compression;
|
|
|
using NPOI.SS.Formula.Functions;
|
|
|
+using Org.BouncyCastle.Asn1.X509.Qualified;
|
|
|
|
|
|
namespace OASystem.API.Controllers
|
|
|
{
|
|
@@ -48,13 +49,15 @@ namespace OASystem.API.Controllers
|
|
|
private readonly ProceedsReceivedRepository _proceedsReceivedRep; //已收款项仓库
|
|
|
private readonly PaymentRefundAndOtherMoneyRepository _paymentRefundAndOtherMoneyRep; //收款退还与其他款项 仓库
|
|
|
private readonly DelegationInfoRepository _delegationInfoRep; //团组信息 仓库
|
|
|
+ private readonly ForeignReceivablesRepository _foreignReceivablesRepository;
|
|
|
|
|
|
/// <summary>
|
|
|
/// 初始化
|
|
|
/// </summary>
|
|
|
public FinancialController(IMapper mapper, IConfiguration configuration, DailyFeePaymentRepository daiRep, SqlSugarClient sqlSugar, SetDataTypeRepository setDataTypeRep,
|
|
|
TeamRateRepository teamRateRep, ForeignReceivablesRepository ForForeignReceivablesRep, ProceedsReceivedRepository proceedsReceivedRep,
|
|
|
- PaymentRefundAndOtherMoneyRepository paymentRefundAndOtherMoneyRep, HttpClient httpClient, DelegationInfoRepository delegationInfoRep, SetDataRepository setDataRep)
|
|
|
+ PaymentRefundAndOtherMoneyRepository paymentRefundAndOtherMoneyRep, HttpClient httpClient, DelegationInfoRepository delegationInfoRep, SetDataRepository setDataRep,
|
|
|
+ ForeignReceivablesRepository foreignReceivablesRepository)
|
|
|
{
|
|
|
_mapper = mapper;
|
|
|
_config = configuration;
|
|
@@ -68,6 +71,7 @@ namespace OASystem.API.Controllers
|
|
|
_httpClient = httpClient;
|
|
|
_delegationInfoRep = delegationInfoRep;
|
|
|
_setDataRep = setDataRep;
|
|
|
+ _foreignReceivablesRepository = foreignReceivablesRepository;
|
|
|
}
|
|
|
|
|
|
#region 日付申请
|
|
@@ -3151,6 +3155,8 @@ namespace OASystem.API.Controllers
|
|
|
_entity.Remark = dto.remark;
|
|
|
_entity.PriceCount = dto.PriceCount;
|
|
|
_entity.Area = dto.Area;
|
|
|
+ _entity.SupervisorConfirm = dto.SupervisorConfirm;
|
|
|
+ _entity.ManagerConfirm = dto.ManagerConfirm;
|
|
|
|
|
|
DateTime dt_PriceDt;
|
|
|
bool b_PriceDt = DateTime.TryParse(dto.PriceDt, out dt_PriceDt);
|
|
@@ -3226,8 +3232,14 @@ namespace OASystem.API.Controllers
|
|
|
return Ok(JsonView(false, "ccp操作失败"));
|
|
|
}
|
|
|
|
|
|
+ //同步修改收款账单
|
|
|
+ _foreignReceivablesRepository.OverSpSeteceivables(new OverSpSeteceivablesDto
|
|
|
+ {
|
|
|
+ CreateUserId = dto.createUser,
|
|
|
+ DiId = dto.diId,
|
|
|
+ });
|
|
|
|
|
|
- _daiRep.CommitTran();
|
|
|
+ _daiRep.CommitTran();
|
|
|
return Ok(JsonView(true, "操作成功"));
|
|
|
}
|
|
|
|
|
@@ -3457,7 +3469,8 @@ namespace OASystem.API.Controllers
|
|
|
string sql_data = string.Format(@"Select * From (
|
|
|
Select row_number() over (order by f.Id Desc) as RowNumber,f.Id,f.DiId,
|
|
|
f.PriceName,f.PriceType,f.PriceDetailType,CAST(f.Price as varchar)+' '+s.[Name] as PriceStr,f.PriceCount,CAST(f.PriceSum as varchar)+' '+s.[Name] as PriceSumStr,
|
|
|
- f.CreateUserId,f.PriceDt,c.IsAuditGM
|
|
|
+ f.CreateUserId,f.PriceDt,c.IsAuditGM,f.ManagerConfirm,f.SupervisorConfirm,
|
|
|
+ CASE ManagerConfirm WHEN 1 THEN '已确认' ELSE '未确认' END as 'ManagerConfirmStr' , CASE SupervisorConfirm WHEN 1 THEN '已确认' ELSE '未确认' END as 'SupervisorConfirmStr'
|
|
|
From Fin_GroupExtraCost f
|
|
|
Inner Join Grp_CreditCardPayment c On f.Id = c.CId
|
|
|
Inner Join Sys_SetData s On f.PriceCurrency = s.Id
|
|
@@ -3466,7 +3479,8 @@ namespace OASystem.API.Controllers
|
|
|
) temp Where RowNumber Between {1} and {2}", sqlWhere, startIndex, endIndex);
|
|
|
string sql_count = string.Format(@"Select Count(1) as DataCount From (
|
|
|
Select row_number() over (order by f.Id Desc) as RowNumber,f.Id,f.DiId,
|
|
|
- f.PriceName,f.PriceType,f.Price,f.FilePath,f.CreateUserId,f.CreateTime,c.IsAuditGM
|
|
|
+ f.PriceName,f.PriceType,f.Price,f.FilePath,f.CreateUserId,f.CreateTime,c.IsAuditGM,f.ManagerConfirm,f.SupervisorConfirm,
|
|
|
+ CASE ManagerConfirm WHEN 1 THEN '已确认' ELSE '未确认' END as 'ManagerConfirmStr' , CASE SupervisorConfirm WHEN 1 THEN '已确认' ELSE '未确认' END as 'SupervisorConfirmStr'
|
|
|
From Fin_GroupExtraCost f
|
|
|
Inner Join Grp_CreditCardPayment c On f.Id = c.CId
|
|
|
Inner Join Sys_SetData s On f.PriceCurrency = s.Id
|
|
@@ -3905,7 +3919,8 @@ Group by PriceType ", dto.diId);
|
|
|
JoinType.Left, s1.Id == l.toCurr && s1.IsDel == 0,
|
|
|
JoinType.Left, i.Id == l.DiId && i.IsDel == 0
|
|
|
))
|
|
|
- .Where((f, c, s, g) => f.IsDel == 0 && f.DiId == dto.diId)
|
|
|
+ .Where((f, c, s, g) => f.IsDel == 0 && f.DiId == dto.diId &&
|
|
|
+ (f.ManagerConfirm == 1 || f.ManagerConfirm == null || f.SupervisorConfirm == 1 || f.SupervisorConfirm == null))
|
|
|
.Select((f, c, s, g, r, l, s1, i) => new
|
|
|
{
|
|
|
c.PaymentCurrency,
|
|
@@ -4178,6 +4193,74 @@ Group by PriceType ", dto.diId);
|
|
|
return Ok(JsonView(true, "获取成功!", resultArr));
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 退费确认
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ public IActionResult ReturnPremiumConfirm(ReturnPremiumConfirmDto dto)
|
|
|
+ {
|
|
|
+ var jw = JsonView(false);
|
|
|
+ var confirmStatusArr = new Dictionary<int, string>()
|
|
|
+ {
|
|
|
+ {1 ,"ManagerConfirm" },
|
|
|
+ {2 ,"SupervisorConfirm" },
|
|
|
+ };
|
|
|
+ if (dto.DataId < 1 || confirmStatusArr.Keys.Contains(dto.ConfirmId) == false)
|
|
|
+ {
|
|
|
+ jw.Msg = "参数有误!";
|
|
|
+ return Ok(jw);
|
|
|
+ }
|
|
|
+
|
|
|
+ Fin_GroupExtraCost fge = _sqlSugar.Queryable<Fin_GroupExtraCost>().First(it => it.Id == dto.DataId && it.IsDel == 0);
|
|
|
+
|
|
|
+ try
|
|
|
+ {
|
|
|
+ if (fge == null)
|
|
|
+ throw new Exception("数据不存在!");
|
|
|
+
|
|
|
+ fge.GetType().GetProperty(confirmStatusArr[dto.ConfirmId]).SetValue(fge, dto.status);
|
|
|
+
|
|
|
+ var isSaveCollectionStatement = true;
|
|
|
+
|
|
|
+ //确认后,同步修改收款账单
|
|
|
+ foreach (var item in confirmStatusArr.Keys)
|
|
|
+ {
|
|
|
+ var value = fge.GetType().GetProperty(confirmStatusArr[item]).GetValue(fge).ObjToInt();
|
|
|
+ //if (value == 0)
|
|
|
+ //{
|
|
|
+ // isSaveCollectionStatement = false;
|
|
|
+ // break;
|
|
|
+ //}
|
|
|
+ }
|
|
|
+
|
|
|
+ _sqlSugar.BeginTran();
|
|
|
+
|
|
|
+ _sqlSugar.Updateable<Fin_GroupExtraCost>(fge).ExecuteCommand();
|
|
|
+
|
|
|
+ if (isSaveCollectionStatement)
|
|
|
+ {
|
|
|
+ //同步修改收款账单
|
|
|
+ _foreignReceivablesRepository.OverSpSeteceivables(new OverSpSeteceivablesDto
|
|
|
+ {
|
|
|
+ CreateUserId = fge.CreateUserId,
|
|
|
+ DiId = fge.DiId,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ _sqlSugar.RollbackTran();
|
|
|
+ jw.Msg = "Error! " + ex.Message;
|
|
|
+ return Ok(jw);
|
|
|
+ }
|
|
|
+
|
|
|
+ _sqlSugar.CommitTran();
|
|
|
+ jw = JsonView(true, "操作成功!");
|
|
|
+
|
|
|
+ return Ok(jw);
|
|
|
+ }
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
#region 信用卡对账
|