可用资金 从山证搬迁
This commit is contained in:
@@ -12,6 +12,7 @@ namespace YLErp.Web.App
|
||||
private readonly IYcLogger _logger;
|
||||
private readonly CancellationTokenSource _cts = new CancellationTokenSource();
|
||||
private KafkaConsumerHelper _kafkaConsumer;
|
||||
private IYLCache _yLCache;
|
||||
private IKafkaProduce kafkaProduceHelper;
|
||||
private string onRspAccountCapitalTopicTopic = string.Empty;
|
||||
public ClientBalanceTask(IKafkaProduce kafkaProduce, IYLCache yLCache)
|
||||
@@ -68,8 +69,10 @@ namespace YLErp.Web.App
|
||||
Result result = new Result();
|
||||
try
|
||||
{
|
||||
var cb = ClientAssetDataService.GetClientLatestBalance(null, lastBalanceDate, req.clientId, false, false, false);
|
||||
cb.AvailableAmount = cb.AmountFund + cb.TotalCredit + cb.PayableMargin + cb.GuaranteesTotalAmount;
|
||||
var cbs = new RealTimeClientBanlanceService(new OptUserInfo(0, "实时客户资金服务", OptUserFrom.Service)).GetBanlances(new List<int>() { req.clientId }, lastBalanceDate.AddDays(1), calcDate: valuedateBLL.ValueDate);
|
||||
var cb = cbs.FirstOrDefault();
|
||||
var AvailableMoney = cb.AmountFund + cb.TotalCredit + cb.PayableMargin + cb.GuaranteesTotalAmount;
|
||||
cb.AvailableAmount = AvailableMoney - cb.FrozenMarginMoney;
|
||||
var obj = new ClientBalanceForTrsResponse
|
||||
{
|
||||
TotalAmountTotal = cb.RoundedTotalAmountTotal,
|
||||
@@ -79,10 +82,15 @@ namespace YLErp.Web.App
|
||||
DaliyPnl = Math.Round(cb.DaliyPnl, 2),
|
||||
ClientId = req.clientId,
|
||||
ClientType = cb.ClientType,
|
||||
Credit=cb.TotalCredit
|
||||
Credit = cb.TotalCredit,
|
||||
AvailableMoney = AvailableMoney
|
||||
};
|
||||
result.success = true;
|
||||
result.obj = obj;
|
||||
if (_yLCache != null)
|
||||
{
|
||||
_yLCache.StringSet<ClientBalanceForTrsResponse>("ClientBalance:" + cb.ClientId, obj);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user