#TRS-ZS-58 收盘操作:删除从衡泰获取数据等等功能
This commit is contained in:
@@ -220,6 +220,7 @@ namespace YLErp.Configuration
|
||||
public bool Is东莞 => ErpElement.Company == CompanyEnum.东莞;
|
||||
|
||||
public bool Is山西固收 => ErpElement.Company == CompanyEnum.山西固收;
|
||||
public bool Is浙商 => ErpElement.Company == CompanyEnum.浙商;
|
||||
/// <summary>
|
||||
/// 衡泰内证账号
|
||||
/// </summary>
|
||||
|
||||
@@ -42,18 +42,10 @@ namespace YLErp.Model
|
||||
/// </summary>
|
||||
public string HedgingAccountTopic { get; set; }
|
||||
/// <summary>
|
||||
/// 账户资金请求topic
|
||||
/// </summary>
|
||||
public string ReqAccountCapitalTopic { get; set; }
|
||||
/// <summary>
|
||||
/// 账户资金请求返回topic
|
||||
/// </summary>
|
||||
public string OnRspAccountCapitalTopic { get; set; }
|
||||
/// <summary>
|
||||
/// 收益互换交易推送请求topic
|
||||
/// </summary>
|
||||
public string ReqInterestRateSwapInsertTopic { get; set; }
|
||||
/// <summary>
|
||||
/// 互换自动簿记消费者topic
|
||||
/// </summary>
|
||||
public string OnRspInterestRateSwapInsertTopic { get; set; }
|
||||
|
||||
@@ -339,19 +339,6 @@ namespace YLErp.Modules.ClientModule
|
||||
SetDBModelOpt(dbmodel);
|
||||
|
||||
DbContext.SaveChanges();
|
||||
if (client.ProcessStatus == "已开户")
|
||||
{
|
||||
var dataType= SwapPushDataEnum.客户资金账户新增;
|
||||
if (!isAdd)
|
||||
{
|
||||
dataType = SwapPushDataEnum.客户资金账户修改;
|
||||
}
|
||||
if (doInvalid)
|
||||
{
|
||||
dataType = SwapPushDataEnum.客户资金账户删除;
|
||||
}
|
||||
new PushLogService(UserInfo).AddLog(dbmodel.ClientId ?? 0, dataType, client.Number);
|
||||
}
|
||||
return dbmodel;
|
||||
}
|
||||
|
||||
|
||||
@@ -416,7 +416,6 @@ namespace YLErp.Modules.ClientModule
|
||||
OptName = UserName,
|
||||
OptDate = OptDate
|
||||
});
|
||||
new PushLogService(this.OptUser).AddLog(client.id, SwapPushDataEnum.客户创建, SwapPushDataEnum.客户修改, client.Number);
|
||||
DbContext.SaveChanges();
|
||||
new EtradingRuleService(this.OptUser).SendEtradingRuleToKafka(client.Number);
|
||||
new ClientKafkaService().Send(client, oldClient);
|
||||
|
||||
@@ -336,10 +336,6 @@ namespace YLErp.Modules.ClientModule
|
||||
//增加评估日志
|
||||
AddClientAssessmentLog(dbModel, changeStr, isAddNew);
|
||||
SaveClientCustomerManage(dbModel.id,req.CustomerManagerId);
|
||||
if (dbModel.ProcessStatus=="已开户")
|
||||
{
|
||||
new PushLogService(UserInfo).AddLog(dbModel.id, SwapPushDataEnum.客户创建, SwapPushDataEnum.客户修改, dbModel.Number);
|
||||
}
|
||||
return dbModel;
|
||||
}
|
||||
/// <summary>
|
||||
|
||||
@@ -1,262 +0,0 @@
|
||||
using BaseOUDAL;
|
||||
using OfficeOpenXml;
|
||||
using Org.BouncyCastle.Ocsp;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Dynamic.Core;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using YLErp.BLL;
|
||||
using YLErp.DBModels;
|
||||
using YLErp.Model;
|
||||
using YLErp.Modules.DataCompare.Dto;
|
||||
using YLErp.Modules.SwapModule;
|
||||
using YLErp.Office;
|
||||
|
||||
namespace YLErp.Modules.DataCompare
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据比较服务
|
||||
/// </summary>
|
||||
public class DataCompareService: YLBaseService
|
||||
{
|
||||
public DataCompareService(OptUserInfo userInfo) : base(userInfo)
|
||||
{
|
||||
}
|
||||
|
||||
public SearchListResult<HengTaiCompareData> QueryNeedCompareData(QueryNeedCompareDataRequest req)
|
||||
{
|
||||
var predicate = PredicateBuilder.Create<trade>(x => true);
|
||||
if (!string.IsNullOrEmpty(req.TradeNumber))
|
||||
{
|
||||
predicate = predicate.And(x => x.TradeNumber.Contains(req.TradeNumber));
|
||||
}
|
||||
if (req.AssetId!=null&&req.AssetId.Count>0)
|
||||
{
|
||||
predicate = predicate.And(p => req.AssetId.Contains(p.AssetId));
|
||||
}
|
||||
|
||||
var predicateSwap = PredicateBuilder.Create<eod_swap>(d => d.ValueDate == req.ValueDate);
|
||||
if (req.ShowException)
|
||||
{
|
||||
predicateSwap = predicateSwap.And(p => !p.IsSkipEod);
|
||||
}
|
||||
|
||||
var query = from a in DbContext.trade.Where(predicate)
|
||||
join b in DbContext.eod_swap.Where(predicateSwap) on a.id equals b.SwapTradeId
|
||||
where a.TradeDate<=req.ValueDate || (a.TradeStatus==ConsTrade.已平仓&&a.UnWindDate<=req.ValueDate)
|
||||
select new HengTaiCompareData
|
||||
{
|
||||
id=a.id,
|
||||
ValueDate = req.ValueDate,
|
||||
TradeNumber = a.TradeNumber,
|
||||
AssetId = a.AssetId,
|
||||
StartDate = a.StartDate,
|
||||
TradeStatus =(b.ValueDate>=a.UnWindDate&& a.TradeStatus == ConsTrade.已平仓) ? ConsTrade.已平仓 : ConsTrade.确认成交,
|
||||
TradeDate = a.TradeDate,
|
||||
EndDate = a.ExerciseDate,
|
||||
StructType = a.TradeType,
|
||||
QuoteCurrency = a.QuoteCurrency,
|
||||
ClientName = a.ClientName,
|
||||
TraderName = a.TraderName,
|
||||
SwapType = a.StructureType,
|
||||
StockEqvNotional = b.NotionalValue,
|
||||
StockEqvNotionalV2 = b.IsSkipEod ? b.NotionalValue : null,
|
||||
Pv = b.IsSkipEod ? b.HTPostionValue : b.PostionValue,
|
||||
PvV2 = b.IsSkipEod ? b.HTPostionValue : null,
|
||||
AssetName = a.AssetBookName,
|
||||
CheckResult = b.IsSkipEod,
|
||||
VTradingFee=b.VTradingFee
|
||||
};
|
||||
|
||||
if (string.IsNullOrEmpty(req.sidx))
|
||||
{
|
||||
req.sidx = "id";
|
||||
req.sord = "desc";
|
||||
}
|
||||
return query.ToSearchList(req);
|
||||
}
|
||||
|
||||
|
||||
public DateTime GetLastCloseDate()
|
||||
{
|
||||
var model=DbContext.eodStatus.AsNoTracking().OrderByDescending(p => p.ValueDate).FirstOrDefault();
|
||||
if (model != null)
|
||||
{
|
||||
return model.ValueDate;
|
||||
}
|
||||
return valuedateBLL.SystemDate.ValueDate;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public SearchListResult<OnlyHengTaiDataDto> QueryOnlyHengTaiData(QueryNeedCompareDataRequest req)
|
||||
{
|
||||
var predicate = PredicateBuilder.Create<reg_valuation_end_of_day>(x => x.NPV_DATE.Equals(req.ValueDate.ToString("yyyy-MM-dd")));
|
||||
if (!string.IsNullOrEmpty(req.TradeNumber))
|
||||
{
|
||||
predicate = predicate.And(x => x.EXT_NO.Contains(req.TradeNumber));
|
||||
}
|
||||
var tradeNumberQuery = from a in DbContext.trade.AsNoTracking()
|
||||
select a.TradeNumber;
|
||||
predicate = predicate.And(p => !tradeNumberQuery.Contains(p.EXT_NO));
|
||||
|
||||
var query = from a in DbContext.reg_valuation_end_of_day.Where(predicate)
|
||||
select new OnlyHengTaiDataDto
|
||||
{
|
||||
id=a.id,
|
||||
ValueDate=req.ValueDate,
|
||||
StockEqvNotionalV2=a.ORDCOUNT,
|
||||
PvV2=a.NPV,
|
||||
TradeNumber=a.EXT_NO,
|
||||
EndDateStr=a.SETDATE_TERMINATE,
|
||||
StartDateStr=a.START_DATE
|
||||
};
|
||||
|
||||
if (string.IsNullOrEmpty(req.sidx))
|
||||
{
|
||||
req.sidx = "id";
|
||||
req.sord = "desc";
|
||||
}
|
||||
return query.ToSearchList(req);
|
||||
}
|
||||
|
||||
|
||||
public byte[] ExprotExcel(QueryNeedCompareDataRequest req)
|
||||
{
|
||||
|
||||
|
||||
var predicate = PredicateBuilder.Create<trade>(x => true);
|
||||
if (!string.IsNullOrEmpty(req.TradeNumber))
|
||||
{
|
||||
predicate = predicate.And(x => x.TradeNumber.Contains(req.TradeNumber));
|
||||
}
|
||||
if (req.AssetId != null && req.AssetId.Count > 0)
|
||||
{
|
||||
predicate = predicate.And(p => req.AssetId.Contains(p.AssetId));
|
||||
}
|
||||
|
||||
var predicateSwap = PredicateBuilder.Create<eod_swap>(d => d.ValueDate == req.ValueDate);
|
||||
if (req.ShowException)
|
||||
{
|
||||
predicateSwap = predicateSwap.And(p => !p.IsSkipEod);
|
||||
}
|
||||
|
||||
List<HengTaiCompareData> dataList = (from a in DbContext.trade.Where(predicate)
|
||||
join b in DbContext.eod_swap.Where(predicateSwap) on a.id equals b.SwapTradeId
|
||||
select new HengTaiCompareData
|
||||
{
|
||||
id = a.id,
|
||||
ValueDate = req.ValueDate,
|
||||
TradeNumber = a.TradeNumber,
|
||||
AssetId = a.AssetId,
|
||||
StartDate = a.StartDate,
|
||||
TradeStatus = a.TradeStatus,
|
||||
TradeDate = a.TradeDate,
|
||||
EndDate = a.ExerciseDate,
|
||||
StructType = a.TradeType,
|
||||
QuoteCurrency = a.QuoteCurrency,
|
||||
ClientName = a.ClientName,
|
||||
TraderName = a.TraderName,
|
||||
SwapType = a.StructureType,
|
||||
StockEqvNotional = b.NotionalValue,
|
||||
StockEqvNotionalV2 = b.IsSkipEod ? b.NotionalValue : null,
|
||||
Pv = b.IsSkipEod ? b.HTPostionValue : b.PostionValue,
|
||||
PvV2 = b.IsSkipEod ? b.HTPostionValue : null,
|
||||
VTradingFee=b.VTradingFee,
|
||||
AssetName = a.AssetBookName,
|
||||
CheckResult = b.IsSkipEod
|
||||
}).OrderByDescending(p=>p.id).ToList();
|
||||
|
||||
var predicate2 = PredicateBuilder.Create<reg_valuation_end_of_day>(x => x.NPV_DATE.Equals(req.ValueDate.ToString("yyyy-MM-dd")));
|
||||
if (!string.IsNullOrEmpty(req.TradeNumber))
|
||||
{
|
||||
predicate2 = predicate2.And(x => x.EXT_NO.Contains(req.TradeNumber));
|
||||
}
|
||||
var tradeNumberQuery = from a in DbContext.trade.AsNoTracking()
|
||||
select a.TradeNumber;
|
||||
predicate2 = predicate2.And(p => !tradeNumberQuery.Contains(p.EXT_NO));
|
||||
|
||||
var list2 = (from a in DbContext.reg_valuation_end_of_day.Where(predicate2)
|
||||
select new OnlyHengTaiDataDto
|
||||
{
|
||||
id = a.id,
|
||||
ValueDate = req.ValueDate,
|
||||
StockEqvNotionalV2 = a.ORDCOUNT,
|
||||
PvV2 = a.NPV,
|
||||
TradeNumber = a.EXT_NO,
|
||||
EndDateStr = a.SETDATE_TERMINATE,
|
||||
StartDateStr = a.START_DATE
|
||||
}).OrderByDescending(p => p.id).ToList();
|
||||
|
||||
|
||||
var tplFilePath = OtcAppContext.MapPath("/App_Docs");
|
||||
var sourceFileName = Path.Combine(tplFilePath, "导出模板", "与衡泰对账导出模板.xlsx");
|
||||
var modelDict = new Dictionary<string, object>();
|
||||
var model = new { list = dataList };
|
||||
|
||||
var modelDict2 = new Dictionary<string, object>();
|
||||
var model2 = new { list = list2 };
|
||||
|
||||
modelDict.Add("本系统中的合约", model);
|
||||
modelDict.Add("仅衡泰中有的合约", model2);
|
||||
ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
|
||||
return new ExcelTemplateGenerator().SetTemplateFile(sourceFileName).SetTemplateData(modelDict).Output();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取清算时间
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
public LiquidationTimeDto GetLiquidationTime(QueryNeedCompareDataRequest req)
|
||||
{
|
||||
var res = new LiquidationTimeDto();
|
||||
res.SystemLiquidationTime = "未清算";
|
||||
res.HengTaiLiquidationTime = "未同步";
|
||||
var model = DbContext.eodStatus.Where(p=>p.ValueDate==req.ValueDate).AsNoTracking().OrderByDescending(p => p.OptDate).FirstOrDefault();
|
||||
if(model!=null&&model.OptDate!=null)
|
||||
{
|
||||
res.SystemLiquidationTime = model.OptDate.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
var model2 = DbContext.reg_valuation_end_of_day.Where(p => p.NPV_DATE.Equals(req.ValueDate.ToString("yyyy-MM-dd"))).OrderByDescending(p => p.create_time).FirstOrDefault();
|
||||
if (model2 != null)
|
||||
{
|
||||
res.HengTaiLiquidationTime = model2.create_time.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
return res;
|
||||
}
|
||||
/// <summary>
|
||||
/// 校验日期区间是否有获取衡泰估值
|
||||
/// </summary>
|
||||
/// <param name="startDate"></param>
|
||||
/// <param name="endDate"></param>
|
||||
/// <exception cref="Exception"></exception>
|
||||
public string CheckHTDataByDate(DateTime startDate,DateTime endDate)
|
||||
{
|
||||
|
||||
var regList = DbContext.reg_valuation_end_of_day.FromSqlRaw($"select * from reg_valuation_end_of_day where NPV_DATE>='{startDate.ToString("yyyy-MM-dd")}' and NPV_DATE<='{endDate.ToString("yyyy-MM-dd")}'").ToList();
|
||||
var allDays = (endDate - startDate).Days;
|
||||
if (regList.Count==0)
|
||||
{
|
||||
return $"{startDate.ToString("yyyy-MM-dd")}未获取衡泰估值";
|
||||
}
|
||||
for (int i=0;i< allDays;i++)
|
||||
{
|
||||
var valueDate = valuedateBLL.GetNonHoliday(startDate.AddDays(i));
|
||||
if (!regList.Any(x=>x.NPV_DATE.Equals(valueDate.ToString("yyyy-MM-dd"))))
|
||||
{
|
||||
return $"{valueDate.ToString("yyyy-MM-dd")}未获取衡泰估值";
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
public string GetHTLastDate()
|
||||
{
|
||||
var regValue= DbContext.reg_valuation_end_of_day.OrderByDescending(o=>o.NPV_DATE).FirstOrDefault();
|
||||
return regValue == null ? "未获取衡泰估值" : regValue.NPV_DATE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace YLErp.Modules.SwapModule.Interface
|
||||
{
|
||||
public interface IPushHTService
|
||||
{
|
||||
void PushTrade();
|
||||
void PushClient();
|
||||
|
||||
void PushSingle(PushLog pushLog);
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using YLErp.Abstract;
|
||||
using YLErp.Modules.SwapModule.Interface;
|
||||
|
||||
namespace YLErp.Modules.SwapModule
|
||||
{
|
||||
public class PushHTService : IPushHTService
|
||||
{
|
||||
private IKafkaProduce kafkaProduceHelper;
|
||||
public PushHTService(IKafkaProduce kafkaProduce)
|
||||
{
|
||||
kafkaProduceHelper = kafkaProduce;
|
||||
}
|
||||
/// <summary>
|
||||
/// 推送交易相关
|
||||
/// </summary>
|
||||
public void PushTrade()
|
||||
{
|
||||
SwapPushService pushService = new SwapPushService(OptUserInfo.SystemUser);
|
||||
pushService.SetKafKaProduce(kafkaProduceHelper);
|
||||
pushService.PushTrade();
|
||||
pushService.PushTradeUpdate();
|
||||
pushService.PushUnwind();
|
||||
pushService.PushRepealUnwind();
|
||||
}
|
||||
/// <summary>
|
||||
/// 推送客户信息相关
|
||||
/// </summary>
|
||||
public void PushClient()
|
||||
{
|
||||
SwapPushService pushService = new SwapPushService(OptUserInfo.SystemUser);
|
||||
pushService.SetKafKaProduce(kafkaProduceHelper);
|
||||
pushService.PushClient();
|
||||
pushService.PushClientBank();
|
||||
// pushService.PushClientCash();
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 重推
|
||||
/// </summary>
|
||||
/// <param name="pushLog"></param>
|
||||
public void PushSingle(PushLog pushLog)
|
||||
{
|
||||
SwapPushService pushService = new SwapPushService(OptUserInfo.SystemUser);
|
||||
pushService.SetKafKaProduce(kafkaProduceHelper);
|
||||
pushService.RePushLog( pushLog);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,296 +0,0 @@
|
||||
using BaseOUDAL;
|
||||
using MoreLinq;
|
||||
using OfficeOpenXml.FormulaParsing.ExpressionGraph;
|
||||
using Org.BouncyCastle.Ocsp;
|
||||
using Snowflake.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using YLErp.DBModels;
|
||||
using YLErp.DBModels.Enums;
|
||||
using YLErp.Model;
|
||||
|
||||
namespace YLErp.Modules.SwapModule
|
||||
{
|
||||
/// <summary>
|
||||
/// 推送记录服务
|
||||
/// </summary>
|
||||
public class PushLogService: YLBaseService
|
||||
{
|
||||
public PushLogService(OptUserInfo optUser) : base(optUser)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public PushLog AddLog(long dataId,SwapPushDataEnum dataEnum,string dataNumber)
|
||||
{
|
||||
PushLog pushLog= new PushLog();
|
||||
pushLog.data_id = dataId;
|
||||
pushLog.data_type = (int)dataEnum;
|
||||
pushLog.SetCreator(UserId);
|
||||
pushLog.data_state = (int)SwapPushDataStateEnum.待推送;
|
||||
pushLog.data_number = dataNumber;
|
||||
pushLog.SetUpdator(UserId);
|
||||
if (pushLog.id==0)
|
||||
{
|
||||
var worker = new IdWorker(1, 1);
|
||||
pushLog.id = worker.NextId();
|
||||
DbContext.push_log.Add(pushLog);
|
||||
}
|
||||
pushLog.odata_no = pushLog.id.ToString();
|
||||
DbContext.SaveChanges();
|
||||
return pushLog;
|
||||
}
|
||||
/// <summary>
|
||||
/// 添加记录,当该编号下已经产生推送过的记录时
|
||||
/// </summary>
|
||||
/// <param name="dataId"></param>
|
||||
/// <param name="dataEnum"></param>
|
||||
/// <param name="dataNumber"></param>
|
||||
public void AddLogWithCheck(long dataId, SwapPushDataEnum dataEnum, string dataNumber)
|
||||
{
|
||||
var pushLogs = DbContext.push_log.Where(x=>x.data_number.StartsWith(dataNumber) && x.data_state != (int)SwapPushDataStateEnum.待推送).ToList();
|
||||
if (!pushLogs.Any())
|
||||
{
|
||||
return;
|
||||
}
|
||||
PushLog pushLog = new PushLog();
|
||||
pushLog.data_id = dataId;
|
||||
pushLog.data_type = (int)dataEnum;
|
||||
pushLog.SetCreator(UserId);
|
||||
pushLog.data_state = (int)SwapPushDataStateEnum.待推送;
|
||||
pushLog.data_number = dataNumber;
|
||||
pushLog.SetUpdator(UserId);
|
||||
if (pushLog.id == 0)
|
||||
{
|
||||
var worker = new IdWorker(1, 1);
|
||||
pushLog.id = worker.NextId();
|
||||
DbContext.push_log.Add(pushLog);
|
||||
}
|
||||
pushLog.odata_no = pushLog.id.ToString();
|
||||
DbContext.SaveChanges();
|
||||
}
|
||||
public PushLog AddLog(long dataId, SwapPushDataEnum addDataEnum, SwapPushDataEnum upDataEnum, string dataNumber)
|
||||
{
|
||||
var pushLogs = DbContext.push_log.Where(x=>x.data_id==dataId).ToList();
|
||||
var dataType= (int)addDataEnum;
|
||||
if (pushLogs.Count>0)
|
||||
{
|
||||
var addpushLog= pushLogs.FirstOrDefault(x=>x.data_type==(int)addDataEnum);
|
||||
if (addpushLog!=null)
|
||||
{
|
||||
if (addpushLog.data_state == 0)
|
||||
{
|
||||
return addpushLog;
|
||||
}
|
||||
dataType= (int)upDataEnum;
|
||||
}
|
||||
var uppushLog = pushLogs.FirstOrDefault(x => x.data_state == 0 && x.data_type == (int)upDataEnum);
|
||||
if (uppushLog!=null)
|
||||
{
|
||||
return uppushLog;
|
||||
}
|
||||
}
|
||||
var pushLog=new PushLog();
|
||||
pushLog.data_id = dataId;
|
||||
pushLog.data_type = dataType;
|
||||
pushLog.SetCreator(UserId);
|
||||
pushLog.data_state = (int)SwapPushDataStateEnum.待推送;
|
||||
pushLog.data_number = dataNumber;
|
||||
pushLog.SetUpdator(UserId);
|
||||
if (pushLog.id == 0)
|
||||
{
|
||||
var worker = new IdWorker(1, 1);
|
||||
pushLog.id = worker.NextId();
|
||||
DbContext.push_log.Add(pushLog);
|
||||
}
|
||||
pushLog.odata_no = pushLog.id.ToString();
|
||||
DbContext.SaveChanges();
|
||||
return pushLog;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重置删除log
|
||||
/// </summary>
|
||||
/// <param name="dataNumber"></param>
|
||||
public void DeleteLog(string dataNumber)
|
||||
{
|
||||
var pushLogs = DbContext.push_log.Where(x=>x.data_number.StartsWith(dataNumber)&&x.data_state== (int)SwapPushDataStateEnum.待推送);
|
||||
DbContext.push_log.RemoveRange(pushLogs);
|
||||
DbContext.SaveChanges();
|
||||
}
|
||||
public void DeleteLogWithUnwind(string dataNumber)
|
||||
{
|
||||
var pushLogs = DbContext.push_log.Where(x => x.data_number.StartsWith(dataNumber) && x.data_state == (int)SwapPushDataStateEnum.待推送&&x.data_type>=(int)SwapPushDataEnum.合约终止);
|
||||
DbContext.push_log.RemoveRange(pushLogs);
|
||||
DbContext.SaveChanges();
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存kafka消费回执记录
|
||||
/// </summary>
|
||||
/// <param name="serial_no"></param>
|
||||
/// <param name="dataEnum"></param>
|
||||
/// <param name="dataStateEnum"></param>
|
||||
/// <param name="dataResp"></param>
|
||||
/// <returns></returns>
|
||||
public PushLog SaveConsumerLog(string serial_no,string extNo, SwapPushDataEnum dataEnum, SwapPushDataStateEnum dataStateEnum,string dataReq,string dealResult)
|
||||
{
|
||||
if (string.IsNullOrEmpty(serial_no))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
var pushLog = GetLogBySerialNo(serial_no, (int)dataEnum);
|
||||
if (pushLog==null)
|
||||
{
|
||||
pushLog = new PushLog();
|
||||
}
|
||||
pushLog.data_type = (int)dataEnum;
|
||||
pushLog.odata_no = serial_no;
|
||||
pushLog.data_state = (int)dataStateEnum;
|
||||
pushLog.data_req = dataReq;
|
||||
pushLog.data_number = extNo;
|
||||
pushLog.data_resp = dealResult;
|
||||
pushLog.SetUpdator(UserId);
|
||||
if (pushLog.id == 0)
|
||||
{
|
||||
var worker = new IdWorker(1, 1);
|
||||
pushLog.id = worker.NextId();
|
||||
pushLog.SetCreator(UserId);
|
||||
DbContext.push_log.Add(pushLog);
|
||||
}
|
||||
DbContext.SaveChanges();
|
||||
return pushLog;
|
||||
}
|
||||
|
||||
public PushLog GetLogBySerialNo(string serial_no,int dataEnum)
|
||||
{
|
||||
var pushLog = DbContext.push_log.FirstOrDefault(x=>x.odata_no== serial_no&&x.data_type==dataEnum);
|
||||
return pushLog;
|
||||
}
|
||||
public void DeleteLog(long logId)
|
||||
{
|
||||
PushLog pushLog = DbContext.push_log.FirstOrDefault(x => x.id == logId);
|
||||
if (pushLog == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
DbContext.push_log.Remove(pushLog);
|
||||
DbContext.SaveChanges();
|
||||
}
|
||||
public void DeleteLogs(List<long> logIds)
|
||||
{
|
||||
var pushLogs = DbContext.push_log.Where(x => logIds.Contains(x.id)).ToList();
|
||||
if (pushLogs.Count() == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
DbContext.push_log.RemoveRange(pushLogs);
|
||||
DbContext.SaveChanges();
|
||||
}
|
||||
public void UpdateLogReq(long logId,string req)
|
||||
{
|
||||
PushLog pushLog = DbContext.push_log.FirstOrDefault(x => x.id==logId);
|
||||
if (pushLog == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
pushLog.data_req = req;
|
||||
pushLog.data_state = (int)SwapPushDataStateEnum.推送中;
|
||||
pushLog.SetUpdator(UserId);
|
||||
DbContext.SaveChanges();
|
||||
}
|
||||
public PushLog UpdateLogResp(long logId, string resp,int dataState)
|
||||
{
|
||||
PushLog pushLog = DbContext.push_log.FirstOrDefault(x => x.id == logId);
|
||||
if (pushLog == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
pushLog.data_resp = resp;
|
||||
pushLog.data_state = dataState;
|
||||
pushLog.SetUpdator(UserId);
|
||||
DbContext.SaveChanges();
|
||||
return pushLog;
|
||||
}
|
||||
public List<PushLog> GetPushLogs(List<int> dataEnums,List<int> dataStates)
|
||||
{
|
||||
var predicate = PredicateBuilder.Create<PushLog>(x => dataEnums.Contains(x.data_type));
|
||||
if (dataStates!=null&& dataStates.Any())
|
||||
{
|
||||
predicate = predicate.And(x=> dataStates.Contains(x.data_state));
|
||||
}
|
||||
return GetPushLogs(predicate);
|
||||
}
|
||||
public List<PushLog> GetPushLogs(Expression<Func<PushLog,bool>> expression)
|
||||
{
|
||||
return DbContext.push_log.Where(expression).ToList();
|
||||
}
|
||||
public SearchListResult<PushLog> SearchList(PushLogQueryRequest req)
|
||||
{
|
||||
var predicate = PredicateBuilder.Create<PushLog>(x => true);
|
||||
if (!string.IsNullOrEmpty(req.data_number))
|
||||
{
|
||||
predicate = predicate.And(x=>x.data_number.Contains(req.data_number));
|
||||
}
|
||||
if (req.data_states!=null&& req.data_states.Count()>0)
|
||||
{
|
||||
predicate = predicate.And(x => req.data_states.Contains(x.data_state));
|
||||
}
|
||||
if (req.data_types != null && req.data_types.Count() > 0)
|
||||
{
|
||||
predicate = predicate.And(x => req.data_types.Contains(x.data_type));
|
||||
}
|
||||
if (req.OptDateStart.HasValue)
|
||||
{
|
||||
predicate = predicate.And(x => x.update_time>= req.OptDateStart);
|
||||
}
|
||||
if (req.OptDateEnd.HasValue)
|
||||
{
|
||||
req.OptDateEnd= req.OptDateEnd.Value.AddDays(1).AddSeconds(-1);
|
||||
predicate = predicate.And(x => x.update_time <= req.OptDateEnd);
|
||||
}
|
||||
var query = DbContext.push_log.Where(predicate);
|
||||
if (string.IsNullOrEmpty(req.sidx))
|
||||
{
|
||||
req.sidx = "id";
|
||||
req.sord = "desc";
|
||||
}
|
||||
return query.ToSearchList(req);
|
||||
}
|
||||
|
||||
public PushLog ReSetLog(long logId)
|
||||
{
|
||||
PushLog pushLog = DbContext.push_log.FirstOrDefault(x => x.id == logId);
|
||||
if (pushLog == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
pushLog.data_resp = null;
|
||||
pushLog.data_req = null;
|
||||
pushLog.data_state = (int)SwapPushDataStateEnum.待推送;
|
||||
pushLog.SetUpdator(UserId);
|
||||
DbContext.SaveChanges();
|
||||
return pushLog;
|
||||
}
|
||||
|
||||
public PushLog GetLogByDataId(long dataId)
|
||||
{
|
||||
return DbContext.push_log.FirstOrDefault(x => x.data_id == dataId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取日终估值最新同步时间
|
||||
/// </summary>
|
||||
/// <param name="valuedate"></param>
|
||||
/// <returns></returns>
|
||||
public string GetLastSettmentTime(DateTime valuedate)
|
||||
{
|
||||
var nextDate = valuedate.AddDays(1);
|
||||
var lastpushLog = DbContext.push_log.Where(x => x.data_type == (int)SwapPushDataEnum.日终估值获取 && x.data_state == (int)SwapPushDataStateEnum.接收处理成功 && x.create_time > valuedate&&x.create_time< nextDate).OrderByDescending(o => o.create_time).FirstOrDefault();
|
||||
return lastpushLog == null ? $"{valuedate:yyyy-MM-dd}数据未同步": lastpushLog.create_time.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -757,21 +757,6 @@ namespace YLErp.Modules.SwapModule
|
||||
td.StockEqvNotional -= Convert.ToDouble(unwindData.CloseNotionalValue);
|
||||
td.TradeAmount -= Convert.ToDouble(unwindData.CloseQty);
|
||||
DbContext.SaveChanges();
|
||||
new PushLogService(UserInfo).AddLog(eventId, SwapPushDataEnum.合约终止, td.TradeNumber);
|
||||
var positions = DbContext.swap_position.Where(x => x.IsInitial && x.SwapTradeId == unwindData.SwapTradeId && !x.Invalid);
|
||||
foreach (var f in flowList)
|
||||
{
|
||||
var position = positions.FirstOrDefault(x => x.id == f.PositionId);
|
||||
if (f.PositionType > 0)
|
||||
{
|
||||
new PushLogService(UserInfo).AddLog(f.id, SwapPushDataEnum.互换资产平仓, position.PosiNumber);
|
||||
}
|
||||
else if (f.InterestMode == (int)InterestModeEnum.初始预付金 || f.InterestMode == (int)InterestModeEnum.追加预付金)
|
||||
{
|
||||
new PushLogService(UserInfo).AddLog(f.id, SwapPushDataEnum.互换预付金平仓, position.PosiNumber);
|
||||
}
|
||||
|
||||
}
|
||||
trans.Commit();
|
||||
cofirm = true;
|
||||
}
|
||||
@@ -1058,27 +1043,6 @@ namespace YLErp.Modules.SwapModule
|
||||
td.TradeAmount -= Convert.ToDouble(unwindData.CloseQty);
|
||||
td.Notional = td.TradeAmount;
|
||||
DbContext.SaveChanges();
|
||||
if (addLog)
|
||||
{
|
||||
new PushLogService(UserInfo).AddLog(eventId, SwapPushDataEnum.合约终止, td.TradeNumber);
|
||||
var positions = DbContext.swap_position.Where(x => x.IsInitial && x.SwapTradeId == unwindData.SwapTradeId && !x.Invalid);
|
||||
foreach (var f in flowList)
|
||||
{
|
||||
var position = positions.FirstOrDefault(x => x.id == f.PositionId);
|
||||
if (position != null)
|
||||
{
|
||||
if (f.PositionType > 0)
|
||||
{
|
||||
new PushLogService(UserInfo).AddLog(f.id, SwapPushDataEnum.互换资产平仓, position.PosiNumber);
|
||||
}
|
||||
else if (f.InterestMode == (int)InterestModeEnum.初始预付金 || f.InterestMode == (int)InterestModeEnum.追加预付金)
|
||||
{
|
||||
new PushLogService(UserInfo).AddLog(f.id, SwapPushDataEnum.互换预付金平仓, position.PosiNumber);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 计算平仓总额
|
||||
@@ -1281,22 +1245,8 @@ namespace YLErp.Modules.SwapModule
|
||||
td.TradeAmount -= Convert.ToDouble(swapEvent.unwindData.CloseQty);
|
||||
}
|
||||
td.StockEqvNotional -= Convert.ToDouble(swapEvent.unwindData.CloseNotionalValue);
|
||||
new PushLogService(UserInfo).AddLog(swapEvent.id, SwapPushDataEnum.合约终止, td.TradeNumber);
|
||||
var positions = DbContext.swap_position.Where(x => x.IsInitial && x.SwapTradeId == td.id && !x.Invalid);
|
||||
foreach (var f in flowList)
|
||||
{
|
||||
var position = positions.FirstOrDefault(x => x.id == f.PositionId);
|
||||
if (f.PositionType > 0)
|
||||
{
|
||||
new PushLogService(UserInfo).AddLog(f.id, SwapPushDataEnum.互换资产平仓, position.PosiNumber);
|
||||
}
|
||||
else if (f.InterestMode == (int)InterestModeEnum.初始预付金 || f.InterestMode == (int)InterestModeEnum.追加预付金)
|
||||
{
|
||||
new PushLogService(UserInfo).AddLog(f.id, SwapPushDataEnum.互换预付金平仓, position.PosiNumber);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
td.UnWindDate = swapEvent.unwindData.UnwindDate;
|
||||
UpdateInitalPosition(flowList, swapEvent.unwindData, eventType);
|
||||
DbContext.SaveChanges();
|
||||
|
||||
@@ -528,7 +528,7 @@ namespace YLErp.Modules.SwapModule
|
||||
decimal allPosiNotionalValue = 0;
|
||||
decimal longNotionalValue = realPositions.Where(s => s.PositionType == (int)PositionTypeFlag.Long).Sum(s => s.PosiNotionalValue);//剩余多头名义本金规模
|
||||
decimal shortNotionalValue = realPositions.Where(s => s.PositionType == (int)PositionTypeFlag.Short).Sum(s => s.PosiNotionalValue);//剩余空头名义本金规模
|
||||
PushLogService pushService = new PushLogService(UserInfo);
|
||||
|
||||
foreach (var eventGroup in eventQuery.GroupBy(g => g.PositionId))//持仓标的腿合成持仓
|
||||
{
|
||||
var eventList = eventGroup.ToList();
|
||||
@@ -603,18 +603,6 @@ namespace YLErp.Modules.SwapModule
|
||||
dividendIn = dividendIn + x.DividendIn;
|
||||
|
||||
x.DataState = (int)SwapFlowDateStateEnum.完成;
|
||||
if (ratio > 0)
|
||||
{
|
||||
if (fposition == null)
|
||||
{
|
||||
pushService.AddLog(position.id, swapInsertEnum, position.PosiNumber);
|
||||
}
|
||||
pushService.AddLog(position.id, swapPosiEnum, position.PosiNumber + "-01");
|
||||
}
|
||||
else
|
||||
{
|
||||
pushService.AddLog(x.id, SwapPushDataEnum.互换资产平仓, position.PosiNumber);
|
||||
}
|
||||
});
|
||||
tdCloseQty += closeQty;
|
||||
if (eventFlow.EventType == 1)//最后一条是开仓
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -138,22 +138,6 @@ namespace YLErp.Modules.SwapModule
|
||||
var positions = DbContext.swap_position.Where(x => x.SwapTradeId == td.id && x.IsInitial && !x.Invalid).ToList();
|
||||
td.swap_positions = positions.Where(x => marginModes.Contains(x.InterestMode)).ToList();
|
||||
var posiPositions = positions.Where(x => x.PosiDirection > 0).ToList();
|
||||
var pushLogService = new PushLogService(UserInfo);
|
||||
pushLogService.AddLog(td.id, SwapPushDataEnum.收益互换交易新增, SwapPushDataEnum.收益互换交易修改, td.TradeNumber);
|
||||
if (posiPositions.Any())
|
||||
{
|
||||
foreach (var position in posiPositions)
|
||||
{
|
||||
pushLogService.AddLog(position.id, SwapPushDataEnum.互换资产交易新增, SwapPushDataEnum.互换资产交易修改, position.PosiNumber);
|
||||
}
|
||||
}
|
||||
if (td.swap_positions.Any())
|
||||
{
|
||||
foreach (var position in td.swap_positions)
|
||||
{
|
||||
pushLogService.AddLog(position.id, SwapPushDataEnum.预付金交易新增, SwapPushDataEnum.预付金交易修改, position.PosiNumber);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 校验 定义文件型债券收益互换 持仓标的只能存在一笔
|
||||
@@ -216,25 +200,7 @@ namespace YLErp.Modules.SwapModule
|
||||
DeleteTradeDetials(id);
|
||||
DeleteTradeCashInCashOut(id);
|
||||
DbContext.SaveChanges();
|
||||
if (addLog)
|
||||
{
|
||||
var pushService = new PushLogService(UserInfo);
|
||||
pushService.DeleteLog(tradeNumber);
|
||||
if (dbTrade.StructureType == "多空组合")
|
||||
{
|
||||
var swapPosiList = DbContext.swap_position.Where(x => x.IsInitial && x.SwapTradeId == id && !x.Invalid).AsNoTracking().ToList();
|
||||
var posiList = swapPosiList.Where(x => x.PosiDirection > 0 || x.InterestMode == (int)InterestModeEnum.固定值).ToList();
|
||||
foreach (var item in posiList)
|
||||
{
|
||||
pushService.AddLogWithCheck(item.id, SwapPushDataEnum.合约撤单, item.PosiNumber);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pushService.AddLogWithCheck(dbTrade.id, SwapPushDataEnum.合约撤单, tradeNumber);
|
||||
}
|
||||
}
|
||||
// new SwapFlowService(this).DeleteSwapFlow(id, dbTrade.TradeDate.Value, false);
|
||||
|
||||
}
|
||||
private void DeleteTradeDetials(int tradeId)
|
||||
{
|
||||
@@ -1648,7 +1614,6 @@ namespace YLErp.Modules.SwapModule
|
||||
{
|
||||
DeleteTradeCashInCashOut(tradeId);
|
||||
DeleteTradeDetials(tradeId);
|
||||
new PushLogService(UserInfo).DeleteLogWithUnwind(td.TradeNumber);
|
||||
DbContext.SaveChanges();
|
||||
if (del)
|
||||
{
|
||||
@@ -1661,10 +1626,8 @@ namespace YLErp.Modules.SwapModule
|
||||
var tradeNumber = td.TradeNumber;
|
||||
td.TradeNumber = td.TradeNumber.Insert(0, "XX");
|
||||
td.OptDate = OptDate;
|
||||
new PushLogService(UserInfo).DeleteLog(tradeNumber);
|
||||
swapEventService.AddSwapEventDate(valueDate, tradeId, (int)SwapEventTypeEnum.删除, string.Empty, 0, false);
|
||||
DbContext.SaveChanges();
|
||||
new PushLogService(UserInfo).AddLogWithCheck(td.id, SwapPushDataEnum.合约撤单, tradeNumber);
|
||||
trans.Commit();
|
||||
return;
|
||||
}
|
||||
@@ -1772,7 +1735,7 @@ namespace YLErp.Modules.SwapModule
|
||||
var eodSwapPositionList = DbContext.eod_swap_position.Where(x => x.ValueDate == preDay && x.SwapTradeId == td.id).ToList();
|
||||
var swapFlowEvents = DbContext.swap_flow_event.Where(x => x.SwapTradeId == td.id && x.EventDate >= valueDate && x.DataState > (int)SwapFlowDateStateEnum.废弃).ToList();
|
||||
var positions = swapPositions.Where(x => x.PosiDirection > 0 && !x.IsInitial).ToList();
|
||||
var pushService = new PushLogService(UserInfo);
|
||||
|
||||
foreach (var posi in positions)
|
||||
{
|
||||
var eodPosi = eodSwapPositionList.FirstOrDefault(x => x.PositionId == posi.PositionId);
|
||||
@@ -1814,14 +1777,10 @@ namespace YLErp.Modules.SwapModule
|
||||
{
|
||||
var positions = swapPositions.Where(x => !x.IsInitial || x.InterestDirection == 0).ToList();
|
||||
var orignPositions = swapPositions.Where(x => x.IsInitial && x.InterestDirection > 0).ToList();
|
||||
var pushService = new PushLogService(UserInfo);
|
||||
|
||||
foreach (var item in positions)
|
||||
{
|
||||
item.Invalid = true;
|
||||
if ((item.PosiDirection > 0 || item.InterestMode == (int)InterestModeEnum.固定值) && item.IsInitial)
|
||||
{
|
||||
pushService.AddLog(item.id, SwapPushDataEnum.合约撤单, item.PosiNumber);
|
||||
}
|
||||
}
|
||||
//DbContext.swap_position.RemoveRange(positions);
|
||||
foreach (var item in orignPositions)
|
||||
|
||||
@@ -369,27 +369,9 @@ namespace YLErp.Modules.TradeModule.DealModule
|
||||
swapEventService.AddSwapEventDate(openDate.Value, td.id, (int)SwapEventTypeEnum.确认交易, "", 0, true, history);
|
||||
if (addlog)
|
||||
{
|
||||
var pushLogService = new PushLogService(UserInfo);
|
||||
var swapInsertEnum = SwapPushDataEnum.收益互换交易新增;
|
||||
var posiInsertEnum = SwapPushDataEnum.互换资产交易新增;
|
||||
var marginInsertEnum = SwapPushDataEnum.预付金交易新增;
|
||||
pushLogService.AddLog(td.id, swapInsertEnum, td.TradeNumber);
|
||||
if (posiPositions.Any())
|
||||
{
|
||||
foreach (var position in posiPositions)
|
||||
{
|
||||
pushLogService.AddLog(position.id, posiInsertEnum, position.PosiNumber);
|
||||
}
|
||||
|
||||
}
|
||||
if (td.swap_positions.Any())
|
||||
{
|
||||
foreach (var position in td.swap_positions)
|
||||
{
|
||||
pushLogService.AddLog(position.id, marginInsertEnum, position.PosiNumber);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -74,4 +74,8 @@
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Modules\SwapModule\Interface\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -55,7 +55,6 @@ namespace YLErp.Web.App.KafkaTask
|
||||
{
|
||||
var service = new SwapConsumerService(OptUserInfo.SystemUser);
|
||||
service.SetKafKaProduce(kafkaProduceHelper);
|
||||
service.ConsumerCashNotice(_cashNoticeConsumer);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
using YLErp.Modules.SwapModule;
|
||||
|
||||
namespace YLErp.Web.App.KafkaTask
|
||||
{
|
||||
public class ClientBankConsumerKafkaTask : IHostedService, IDisposable
|
||||
{
|
||||
private readonly IYcLogger _logger;
|
||||
private readonly CancellationTokenSource _cts = new CancellationTokenSource();
|
||||
private string onRspCounterPartyCashAccoutInsertTopic = string.Empty;
|
||||
private string onRspCounterPartyCashAccoutInsertTopicGroupId = string.Empty;
|
||||
private KafkaConsumerHelper _rspCounterPartyCashAccoutInsertConsumer;
|
||||
public ClientBankConsumerKafkaTask()
|
||||
{
|
||||
_logger = LogFactory.GetLogger("ClientBankConsumerKafkaTask");
|
||||
onRspCounterPartyCashAccoutInsertTopic = Environment.GetEnvironmentVariable("KafkaConfig_OnRspCounterPartyCashAccoutInsertTopic");
|
||||
onRspCounterPartyCashAccoutInsertTopicGroupId = Environment.GetEnvironmentVariable("KafkaConfig_OnRspCounterPartyCashAccoutInsertTopicGroupId");
|
||||
_rspCounterPartyCashAccoutInsertConsumer = new KafkaConsumerHelper(onRspCounterPartyCashAccoutInsertTopicGroupId, onRspCounterPartyCashAccoutInsertTopic);
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
_cts.Dispose();
|
||||
}
|
||||
|
||||
public Task StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.Info("ConsumerClientBank started");
|
||||
Task.Run(() => ExecuteTask(_cts.Token), _cts.Token);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public async Task StopAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.Info("ConsumerClientBank stoped");
|
||||
_cts.Cancel();
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
private async Task ExecuteTask(CancellationToken cancellationToken)
|
||||
{
|
||||
while (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 执行任务
|
||||
await Task.Run(() => {
|
||||
new SwapPushService(OptUserInfo.SystemUser).ConsumerClientBankResp(_rspCounterPartyCashAccoutInsertConsumer);
|
||||
}, cancellationToken);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error("ConsumerClientBank Exception", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
using YLErp.Abstract;
|
||||
using YLErp.Helpers;
|
||||
using YLErp.Modules.SwapModule;
|
||||
|
||||
namespace YLErp.Web.App.KafkaTask
|
||||
{
|
||||
/// <summary>
|
||||
/// 交易对手方信息推送回应衡泰Kafka
|
||||
/// </summary>
|
||||
public class ClientInfoConsumerKafkaTask : IHostedService, IDisposable
|
||||
{
|
||||
private readonly IYcLogger _logger;
|
||||
private readonly CancellationTokenSource _cts = new CancellationTokenSource();
|
||||
private string onRspCounterPartyInsertTopic = string.Empty;
|
||||
private string onRspCounterPartyInsertTopicGroupId = string.Empty;
|
||||
private KafkaConsumerHelper _rspCounterPartyInsertConsumer;
|
||||
private IKafkaProduce kafkaProduceHelper;
|
||||
public ClientInfoConsumerKafkaTask(IKafkaProduce kafkaProduce)
|
||||
{
|
||||
_logger = LogFactory.GetLogger("ClientInfoConsumerKafkaTask");
|
||||
onRspCounterPartyInsertTopic = Environment.GetEnvironmentVariable("KafkaConfig_OnRspCounterPartyInsertTopic");
|
||||
onRspCounterPartyInsertTopicGroupId = Environment.GetEnvironmentVariable("KafkaConfig_OnRspCounterPartyInsertTopicGroupId");
|
||||
|
||||
_rspCounterPartyInsertConsumer = new KafkaConsumerHelper(onRspCounterPartyInsertTopicGroupId, onRspCounterPartyInsertTopic);
|
||||
kafkaProduceHelper = kafkaProduce;
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
_cts.Dispose();
|
||||
}
|
||||
|
||||
public Task StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.Info("ConsumerClient started");
|
||||
Task.Run(() => ExecuteTask(_cts.Token), _cts.Token);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public async Task StopAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.Info("ConsumerClient stoped");
|
||||
_cts.Cancel();
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
private async Task ExecuteTask(CancellationToken cancellationToken)
|
||||
{
|
||||
while (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
try
|
||||
{
|
||||
var pushService = new SwapPushService(OptUserInfo.SystemUser);
|
||||
pushService.SetKafKaProduce(kafkaProduceHelper);
|
||||
// 执行任务
|
||||
await Task.Run(() => {
|
||||
new SwapPushService(OptUserInfo.SystemUser).ConsumerClientResp(_rspCounterPartyInsertConsumer);
|
||||
}, cancellationToken);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error("ConsumerClient Exception", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
using YLErp.Abstract;
|
||||
using YLErp.Modules.SwapModule;
|
||||
|
||||
namespace YLErp.Web.App.KafkaTask
|
||||
{
|
||||
/// <summary>
|
||||
/// 交易对手方信息推送衡泰Kafka
|
||||
/// </summary>
|
||||
public class ClientInfoProduceKafkaTask : IHostedService, IDisposable
|
||||
{
|
||||
private readonly IYcLogger _logger;
|
||||
private readonly CancellationTokenSource _cts = new CancellationTokenSource();
|
||||
private IKafkaProduce kafkaProduceHelper;
|
||||
public ClientInfoProduceKafkaTask(IKafkaProduce kafkaProduce)
|
||||
{
|
||||
_logger = LogFactory.GetLogger("ClientInfoKafkaTask");
|
||||
kafkaProduceHelper = kafkaProduce;
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
_cts.Dispose();
|
||||
}
|
||||
|
||||
public Task StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.Info("PushClient started");
|
||||
Task.Run(() => ExecuteTask(_cts.Token), _cts.Token);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public async Task StopAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
_cts.Cancel();
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
private async Task ExecuteTask(CancellationToken cancellationToken)
|
||||
{
|
||||
while (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
var pushService= new SwapPushService(OptUserInfo.SystemUser);
|
||||
pushService.SetKafKaProduce(kafkaProduceHelper);
|
||||
try
|
||||
{
|
||||
// 执行任务
|
||||
await Task.Run(() => {
|
||||
pushService.PushClient();
|
||||
}, cancellationToken);
|
||||
await Task.Run(() =>
|
||||
{
|
||||
pushService.PushClientBank();
|
||||
}, cancellationToken);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error("PushClient Exception", ex);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
using YLErp.Modules.SwapModule;
|
||||
|
||||
namespace YLErp.Web.App.KafkaTask
|
||||
{
|
||||
public class ExchangeTradeConsumerKafkaTask : IHostedService, IDisposable
|
||||
{
|
||||
|
||||
private readonly IYcLogger _logger;
|
||||
private readonly CancellationTokenSource _cts = new CancellationTokenSource();
|
||||
private KafkaConsumerHelper _exchangeTradeConsumer;//对冲交易消费者
|
||||
private string exchangeTradeTopic = string.Empty;
|
||||
private string exchangeTradeTopicGroupId = string.Empty;
|
||||
|
||||
public ExchangeTradeConsumerKafkaTask()
|
||||
{
|
||||
_logger = LogFactory.GetLogger("ExchangeTradeConsumerKafkaTask");
|
||||
exchangeTradeTopic = Environment.GetEnvironmentVariable("KafkaConfig_ExchangeTradeConsumerTopic");
|
||||
exchangeTradeTopicGroupId = Environment.GetEnvironmentVariable("KafkaConfig_ExchangeTradeConsumerTopicGroupId");
|
||||
_exchangeTradeConsumer = new KafkaConsumerHelper(exchangeTradeTopicGroupId, exchangeTradeTopic);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_cts.Dispose();
|
||||
}
|
||||
|
||||
public Task StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
Task.Run(() => ExecuteTask(_cts.Token), _cts.Token);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public async Task StopAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
_cts.Cancel();
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
private async Task ExecuteTask(CancellationToken cancellationToken)
|
||||
{
|
||||
while (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
try
|
||||
{
|
||||
await Task.Run(() =>
|
||||
{
|
||||
new SwapConsumerService(OptUserInfo.SystemUser).ConsumerExchangeTradeResp(_exchangeTradeConsumer, "衡泰同步");
|
||||
}, cancellationToken);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error("ConsumerTradePosiResp Exception", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
using YLErp.Modules.SwapModule;
|
||||
|
||||
namespace YLErp.Web.App.KafkaTask
|
||||
{
|
||||
public class RespIRSDbConsumerKafkaTask : IHostedService, IDisposable
|
||||
{
|
||||
private readonly IYcLogger _logger;
|
||||
private readonly CancellationTokenSource _cts = new CancellationTokenSource();
|
||||
private KafkaConsumerHelper _rtnInterestRateSwapConsumer;//衡泰数据库收益互换交易回执消费者
|
||||
private string rtnInterestRateSwapTopic = string.Empty;
|
||||
private string rtnInterestRateSwapTopicGroupId = string.Empty;
|
||||
public RespIRSDbConsumerKafkaTask()
|
||||
{
|
||||
_logger = LogFactory.GetLogger("RespIRSDbConsumerKafkaTask");
|
||||
rtnInterestRateSwapTopic = Environment.GetEnvironmentVariable("KafkaConfig_RtnInterestRateSwapTopic");
|
||||
rtnInterestRateSwapTopicGroupId = Environment.GetEnvironmentVariable("KafkaConfig_RtnInterestRateSwapTopicGroupId");
|
||||
_rtnInterestRateSwapConsumer = new KafkaConsumerHelper(rtnInterestRateSwapTopicGroupId, rtnInterestRateSwapTopic);
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
_cts.Dispose();
|
||||
}
|
||||
|
||||
public Task StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
Task.Run(() => ExecuteTask(_cts.Token), _cts.Token);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public async Task StopAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
_cts.Cancel();
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
private async Task ExecuteTask(CancellationToken cancellationToken)
|
||||
{
|
||||
while (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 执行任务
|
||||
await Task.Run(() => {
|
||||
new SwapConsumerService(OptUserInfo.SystemUser).ConsumerIRSDb(_rtnInterestRateSwapConsumer);
|
||||
}, cancellationToken);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error("ConsumerTradeResp Exception", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
using YLErp.Abstract;
|
||||
using YLErp.Modules.SwapModule;
|
||||
|
||||
namespace YLErp.Web.App.KafkaTask
|
||||
{
|
||||
/// <summary>
|
||||
/// 互换交易回执消费任务
|
||||
/// </summary>
|
||||
public class SwapTradeCashReceiptConsumerKafkaTask : IHostedService, IDisposable
|
||||
{
|
||||
private readonly IYcLogger _logger;
|
||||
private readonly CancellationTokenSource _cts = new CancellationTokenSource();
|
||||
private KafkaConsumerHelper _rtnInterestRateSwapAccountConsumer;//收益互换日终资金流水回执消费者
|
||||
private string rtnInterestRateSwapAccountTopic = string.Empty;
|
||||
private string rtnInterestRateSwapAccountTopicGroupId = string.Empty;
|
||||
public SwapTradeCashReceiptConsumerKafkaTask()
|
||||
{
|
||||
_logger = LogFactory.GetLogger("SwapTradeCashReceiptConsumerKafkaTask");
|
||||
rtnInterestRateSwapAccountTopic = Environment.GetEnvironmentVariable("KafkaConfig_RtnInterestRateSwapAccountTopic");
|
||||
rtnInterestRateSwapAccountTopicGroupId = Environment.GetEnvironmentVariable("KafkaConfig_RtnInterestRateSwapAccountTopicGroupId");
|
||||
_rtnInterestRateSwapAccountConsumer = new KafkaConsumerHelper(rtnInterestRateSwapAccountTopicGroupId, rtnInterestRateSwapAccountTopic);
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
_cts.Dispose();
|
||||
}
|
||||
|
||||
public Task StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
Task.Run(() => ExecuteTask(_cts.Token), _cts.Token);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public async Task StopAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
_cts.Cancel();
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
private async Task ExecuteTask(CancellationToken cancellationToken)
|
||||
{
|
||||
while (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
try
|
||||
{
|
||||
var consumerService= new SwapConsumerService(OptUserInfo.SystemUser);
|
||||
// 执行任务
|
||||
await Task.Run(() => {
|
||||
consumerService.ConsumerTradeCashResp(_rtnInterestRateSwapAccountConsumer);
|
||||
}, cancellationToken);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error("ConsumerTradeCashResp Exception", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
using YLErp.Abstract;
|
||||
using YLErp.Modules.SwapModule;
|
||||
|
||||
namespace YLErp.Web.App
|
||||
{
|
||||
/// <summary>
|
||||
/// 互换簿记kafka推山证回应接收任务
|
||||
/// </summary>
|
||||
public class SwapTradeConsumerKafkaTask : IHostedService, IDisposable
|
||||
{
|
||||
private readonly IYcLogger _logger;
|
||||
private readonly CancellationTokenSource _cts = new CancellationTokenSource();
|
||||
private KafkaConsumerHelper _rspInterestRateSwapInsertConsumer;//收益互换交易推送请求响应
|
||||
private string onRspInterestRateSwapInsertTopic = string.Empty;
|
||||
private string onRspInterestRateSwapInsertTopicGroupId = string.Empty;
|
||||
private IKafkaProduce kafkaProduceHelper;
|
||||
public SwapTradeConsumerKafkaTask(IKafkaProduce kafkaProduce)
|
||||
{
|
||||
_logger = LogFactory.GetLogger("SwapTradeCosumerKafkaTask");
|
||||
onRspInterestRateSwapInsertTopic = Environment.GetEnvironmentVariable("KafkaConfig_OnRspInterestRateSwapInsertTopic");
|
||||
onRspInterestRateSwapInsertTopicGroupId = Environment.GetEnvironmentVariable("KafkaConfig_OnRspInterestRateSwapInsertTopicGroupId");
|
||||
_rspInterestRateSwapInsertConsumer = new KafkaConsumerHelper(onRspInterestRateSwapInsertTopicGroupId, onRspInterestRateSwapInsertTopic);
|
||||
kafkaProduceHelper = kafkaProduce;
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
_cts.Dispose();
|
||||
}
|
||||
|
||||
public Task StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
Task.Run(() => ExecuteTask(_cts.Token), _cts.Token);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public async Task StopAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
_cts.Cancel();
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
private async Task ExecuteTask(CancellationToken cancellationToken)
|
||||
{
|
||||
while (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
try
|
||||
{
|
||||
var pushService = new SwapPushService(OptUserInfo.SystemUser);
|
||||
pushService.SetKafKaProduce(kafkaProduceHelper);
|
||||
// 执行任务
|
||||
await Task.Run(() => {
|
||||
pushService.ConsumerTradeResp(_rspInterestRateSwapInsertConsumer);
|
||||
}, cancellationToken);
|
||||
}catch (Exception ex)
|
||||
{
|
||||
_logger.Error("ConsumerTradeResp Exception", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
using YLErp.Abstract;
|
||||
using YLErp.Helpers;
|
||||
using YLErp.Modules.SwapModule;
|
||||
|
||||
namespace YLErp.Web.App
|
||||
{
|
||||
/// <summary>
|
||||
/// 互换簿记kafka推山证回应接收任务
|
||||
/// </summary>
|
||||
public class SwapTradeMarginConsumerKafkaTask : IHostedService, IDisposable
|
||||
{
|
||||
private readonly IYcLogger _logger;
|
||||
private readonly CancellationTokenSource _cts = new CancellationTokenSource();
|
||||
private KafkaConsumerHelper _rspMarginInsertConsumer;//预付金推送请求响应
|
||||
private string onRspMarginInsertTopic = string.Empty;
|
||||
private string onRspMarginInsertTopicGroupId = string.Empty;
|
||||
private IKafkaProduce kafkaProduceHelper;
|
||||
public SwapTradeMarginConsumerKafkaTask(IKafkaProduce kafkaProduce)
|
||||
{
|
||||
_logger = LogFactory.GetLogger("SwapTradeMarginConsumerKafkaTask");
|
||||
onRspMarginInsertTopic = Environment.GetEnvironmentVariable("KafkaConfig_OnRspMarginInsertTopic");
|
||||
onRspMarginInsertTopicGroupId = Environment.GetEnvironmentVariable("KafkaConfig_OnRspMarginInsertTopicGroupId");
|
||||
_rspMarginInsertConsumer= new KafkaConsumerHelper(onRspMarginInsertTopicGroupId, onRspMarginInsertTopic);
|
||||
kafkaProduceHelper = kafkaProduce;
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
_cts.Dispose();
|
||||
}
|
||||
|
||||
public Task StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
Task.Run(() => ExecuteTask(_cts.Token), _cts.Token);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public async Task StopAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
_cts.Cancel();
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
private async Task ExecuteTask(CancellationToken cancellationToken)
|
||||
{
|
||||
while (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
try
|
||||
{
|
||||
var pushService = new SwapPushService(OptUserInfo.SystemUser);
|
||||
pushService.SetKafKaProduce(kafkaProduceHelper);
|
||||
await Task.Run(() => {
|
||||
new SwapPushService(OptUserInfo.SystemUser).ConsumerTradeResp(_rspMarginInsertConsumer);
|
||||
}, cancellationToken);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error("ConsumerTradeMarginResp Exception", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
using YLErp.Modules.SwapModule;
|
||||
|
||||
namespace YLErp.Web.App.KafkaTask
|
||||
{
|
||||
/// <summary>
|
||||
/// 互换交易回执消费任务
|
||||
/// </summary>
|
||||
public class SwapTradeMarginReceiptConsumerKafkaTask : IHostedService, IDisposable
|
||||
{
|
||||
private readonly IYcLogger _logger;
|
||||
private readonly CancellationTokenSource _cts = new CancellationTokenSource();
|
||||
private KafkaConsumerHelper _rtnMarginConsumer;//预付金回执消费者
|
||||
private string rtnMarginTopic = string.Empty;
|
||||
private string rtnMarginTopicGroupId = string.Empty;
|
||||
public SwapTradeMarginReceiptConsumerKafkaTask()
|
||||
{
|
||||
_logger = LogFactory.GetLogger("SwapTradeMarginReceiptConsumerKafkaTask");
|
||||
rtnMarginTopic = Environment.GetEnvironmentVariable("KafkaConfig_RtnMarginTopic");
|
||||
rtnMarginTopicGroupId = Environment.GetEnvironmentVariable("KafkaConfig_RtnMarginTopicGroupId");
|
||||
_rtnMarginConsumer = new KafkaConsumerHelper(rtnMarginTopicGroupId, rtnMarginTopic);
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
_cts.Dispose();
|
||||
}
|
||||
|
||||
public Task StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
Task.Run(() => ExecuteTask(_cts.Token), _cts.Token);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public async Task StopAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
_cts.Cancel();
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
private async Task ExecuteTask(CancellationToken cancellationToken)
|
||||
{
|
||||
while (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 执行任务
|
||||
await Task.Run(() => {
|
||||
new SwapConsumerService(OptUserInfo.SystemUser).ConsumerTradeMarginResp(_rtnMarginConsumer);
|
||||
}, cancellationToken);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error("ConsumerTradeMarginResp Exception", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
using YLErp.Abstract;
|
||||
using YLErp.Helpers;
|
||||
using YLErp.Modules.SwapModule;
|
||||
|
||||
namespace YLErp.Web.App
|
||||
{
|
||||
/// <summary>
|
||||
/// 互换簿记kafka推山证回应接收任务
|
||||
/// </summary>
|
||||
public class SwapTradePosiConsumerKafkaTask : IHostedService, IDisposable
|
||||
{
|
||||
private readonly IYcLogger _logger;
|
||||
private readonly CancellationTokenSource _cts = new CancellationTokenSource();
|
||||
private KafkaConsumerHelper _rspAssetSwapInsertConsumer;//互换资产交易推送请求响应
|
||||
private string onRspAssetSwapInsertTopic = string.Empty;
|
||||
private string onRspAssetSwapInsertTopicGroupId = string.Empty;
|
||||
private IKafkaProduce kafkaProduceHelper;
|
||||
public SwapTradePosiConsumerKafkaTask(IKafkaProduce kafkaProduce)
|
||||
{
|
||||
_logger = LogFactory.GetLogger("SwapTradePosiConsumerKafkaTask");
|
||||
onRspAssetSwapInsertTopic = Environment.GetEnvironmentVariable("KafkaConfig_OnRspAssetSwapInsertTopic");
|
||||
onRspAssetSwapInsertTopicGroupId = Environment.GetEnvironmentVariable("KafkaConfig_OnRspAssetSwapInsertTopicGroupId");
|
||||
_rspAssetSwapInsertConsumer = new KafkaConsumerHelper(onRspAssetSwapInsertTopicGroupId, onRspAssetSwapInsertTopic);
|
||||
kafkaProduceHelper = kafkaProduce;
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
_cts.Dispose();
|
||||
}
|
||||
|
||||
public Task StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
Task.Run(() => ExecuteTask(_cts.Token), _cts.Token);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public async Task StopAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
_cts.Cancel();
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
private async Task ExecuteTask(CancellationToken cancellationToken)
|
||||
{
|
||||
while (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
try
|
||||
{
|
||||
var pushService = new SwapPushService(OptUserInfo.SystemUser);
|
||||
pushService.SetKafKaProduce(kafkaProduceHelper);
|
||||
// 执行任务
|
||||
await Task.Run(() => {
|
||||
pushService.ConsumerTradeResp(_rspAssetSwapInsertConsumer);
|
||||
}, cancellationToken);
|
||||
}catch (Exception ex)
|
||||
{
|
||||
_logger.Error("ConsumerTradePosiResp Exception", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
using YLErp.Modules.SwapModule;
|
||||
|
||||
namespace YLErp.Web.App.KafkaTask
|
||||
{
|
||||
/// <summary>
|
||||
/// 互换交易回执消费任务
|
||||
/// </summary>
|
||||
public class SwapTradePosiReceiptConsumerKafkaTask : IHostedService, IDisposable
|
||||
{
|
||||
private readonly IYcLogger _logger;
|
||||
private readonly CancellationTokenSource _cts = new CancellationTokenSource();
|
||||
private KafkaConsumerHelper _rtnAssetSwapConsumer;//互换资产回执消费者
|
||||
private string rtnAssetSwapTopic = string.Empty;
|
||||
private string rtnAssetSwapTopicGroupId = string.Empty;
|
||||
public SwapTradePosiReceiptConsumerKafkaTask()
|
||||
{
|
||||
_logger = LogFactory.GetLogger("SwapTradePosiReceiptConsumerKafkaTask");
|
||||
rtnAssetSwapTopic = Environment.GetEnvironmentVariable("KafkaConfig_RtnAssetSwapTopic");
|
||||
rtnAssetSwapTopicGroupId = Environment.GetEnvironmentVariable("KafkaConfig_RtnAssetSwapTopicGroupId");
|
||||
_rtnAssetSwapConsumer = new KafkaConsumerHelper(rtnAssetSwapTopicGroupId, rtnAssetSwapTopic);
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
_cts.Dispose();
|
||||
}
|
||||
|
||||
public Task StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
Task.Run(() => ExecuteTask(_cts.Token), _cts.Token);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public async Task StopAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
_cts.Cancel();
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
private async Task ExecuteTask(CancellationToken cancellationToken)
|
||||
{
|
||||
while (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
try
|
||||
{
|
||||
await Task.Run(() => {
|
||||
new SwapConsumerService(OptUserInfo.SystemUser).ConsumerTradePosiResp(_rtnAssetSwapConsumer);
|
||||
}, cancellationToken);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error("ConsumerTradePosiResp Exception", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
using YLErp.Abstract;
|
||||
using YLErp.Modules.SwapModule;
|
||||
|
||||
namespace YLErp.Web.App.KafkaTask
|
||||
{
|
||||
/// <summary>
|
||||
/// 互换簿记kafka推山证任务
|
||||
/// </summary>
|
||||
public class SwapTradeProduceKafkaTask : IHostedService, IDisposable
|
||||
{
|
||||
private readonly IYcLogger _logger;
|
||||
private readonly CancellationTokenSource _cts = new CancellationTokenSource();
|
||||
private IKafkaProduce kafkaProduceHelper;
|
||||
public SwapTradeProduceKafkaTask(IKafkaProduce kafkaProduce)
|
||||
{
|
||||
_logger = LogFactory.GetLogger("SwapTradeProduceKafkaTask");
|
||||
kafkaProduceHelper = kafkaProduce;
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
_cts.Dispose();
|
||||
}
|
||||
|
||||
public Task StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
Task.Run(() => ExecuteTask(_cts.Token), _cts.Token);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public async Task StopAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
_cts.Cancel();
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
private async Task ExecuteTask(CancellationToken cancellationToken)
|
||||
{
|
||||
while (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
var pushService = new SwapPushService(OptUserInfo.SystemUser);
|
||||
pushService.SetKafKaProduce(kafkaProduceHelper);
|
||||
try
|
||||
{
|
||||
// 执行任务
|
||||
await Task.Run(() => {
|
||||
pushService.PushTrade();
|
||||
}, cancellationToken);
|
||||
// 执行任务
|
||||
await Task.Run(() => {
|
||||
pushService.PushTradeUpdate();
|
||||
}, cancellationToken);
|
||||
// 执行任务
|
||||
await Task.Run(() => {
|
||||
pushService.PushUnwind();
|
||||
}, cancellationToken);
|
||||
// 执行任务
|
||||
await Task.Run(() => {
|
||||
pushService.PushRepealUnwind();
|
||||
}, cancellationToken);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error("PushTrade Exception",ex);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
using YLErp.Modules.SwapModule;
|
||||
|
||||
namespace YLErp.Web.App.KafkaTask
|
||||
{
|
||||
/// <summary>
|
||||
/// 互换交易回执消费任务
|
||||
/// </summary>
|
||||
public class SwapTradeReceiptConsumerKafkaTask : IHostedService, IDisposable
|
||||
{
|
||||
private readonly IYcLogger _logger;
|
||||
private readonly CancellationTokenSource _cts = new CancellationTokenSource();
|
||||
private KafkaConsumerHelper _rtnInterestRateSwapConsumer;//收益互换交易回执消费者
|
||||
private string rtnInterestRateSwapTopic = string.Empty;
|
||||
private string rtnInterestRateSwapTopicGroupId = string.Empty;
|
||||
public SwapTradeReceiptConsumerKafkaTask()
|
||||
{
|
||||
_logger = LogFactory.GetLogger("SwapTradeReceiptConsumerKafkaTask");
|
||||
rtnInterestRateSwapTopic = Environment.GetEnvironmentVariable("KafkaConfig_RtnInterestRateSwapTopic");
|
||||
rtnInterestRateSwapTopicGroupId = Environment.GetEnvironmentVariable("KafkaConfig_RtnInterestRateSwapTopicGroupId");
|
||||
_rtnInterestRateSwapConsumer = new KafkaConsumerHelper(rtnInterestRateSwapTopicGroupId, rtnInterestRateSwapTopic);
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
_cts.Dispose();
|
||||
}
|
||||
|
||||
public Task StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
Task.Run(() => ExecuteTask(_cts.Token), _cts.Token);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public async Task StopAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
_cts.Cancel();
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
private async Task ExecuteTask(CancellationToken cancellationToken)
|
||||
{
|
||||
while (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 执行任务
|
||||
await Task.Run(() => {
|
||||
new SwapConsumerService(OptUserInfo.SystemUser).ConsumerTradeResp(_rtnInterestRateSwapConsumer);
|
||||
}, cancellationToken);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error("ConsumerTradeResp Exception", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
using YLErp.Modules.SwapModule;
|
||||
|
||||
namespace YLErp.Web.App
|
||||
{
|
||||
/// <summary>
|
||||
/// 互换簿记kafka推山证回应接收任务
|
||||
/// </summary>
|
||||
public class SwapTradeUnwindConsumerKafkaTask : IHostedService, IDisposable
|
||||
{
|
||||
private readonly IYcLogger _logger;
|
||||
private readonly CancellationTokenSource _cts = new CancellationTokenSource();
|
||||
private KafkaConsumerHelper _rspAcctSwapTerminateConsumer;//合约终止请求响应
|
||||
private string onRspAcctSwapTerminateTopic = string.Empty;
|
||||
private string onRspAcctSwapTerminateTopicGroupId = string.Empty;
|
||||
public SwapTradeUnwindConsumerKafkaTask()
|
||||
{
|
||||
_logger = LogFactory.GetLogger("SwapTradeUnwindConsumerKafkaTask");
|
||||
onRspAcctSwapTerminateTopic = Environment.GetEnvironmentVariable("KafkaConfig_OnRspAcctSwapTerminateTopic");
|
||||
onRspAcctSwapTerminateTopicGroupId = Environment.GetEnvironmentVariable("KafkaConfig_OnRspAcctSwapTerminateTopicGroupId");
|
||||
_rspAcctSwapTerminateConsumer = new KafkaConsumerHelper(onRspAcctSwapTerminateTopicGroupId, onRspAcctSwapTerminateTopic);
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
_cts.Dispose();
|
||||
}
|
||||
|
||||
public Task StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
Task.Run(() => ExecuteTask(_cts.Token), _cts.Token);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public async Task StopAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
_cts.Cancel();
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
private async Task ExecuteTask(CancellationToken cancellationToken)
|
||||
{
|
||||
while (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
try
|
||||
{
|
||||
await Task.Run(() => {
|
||||
new SwapPushService(OptUserInfo.SystemUser).ConsumerTradeResp(_rspAcctSwapTerminateConsumer);
|
||||
}, cancellationToken);
|
||||
}catch (Exception ex)
|
||||
{
|
||||
_logger.Error("ConsumerTradeUnwindResp Exception", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
using YLErp.Modules.SwapModule;
|
||||
|
||||
namespace YLErp.Web.App.KafkaTask
|
||||
{
|
||||
/// <summary>
|
||||
/// 互换交易回执消费任务
|
||||
/// </summary>
|
||||
public class SwapTradeUnwindReceiptConsumerKafkaTask : IHostedService, IDisposable
|
||||
{
|
||||
private readonly IYcLogger _logger;
|
||||
private readonly CancellationTokenSource _cts = new CancellationTokenSource();
|
||||
private KafkaConsumerHelper _rtnAcctSwapTerminateConsumer;//合约终止回执消费者
|
||||
private string rtnAcctSwapTerminateTopic = string.Empty;
|
||||
private string rtnAcctSwapTerminateTopicGroupId = string.Empty;
|
||||
public SwapTradeUnwindReceiptConsumerKafkaTask()
|
||||
{
|
||||
_logger = LogFactory.GetLogger("SwapTradeUnwindReceiptConsumerKafkaTask");
|
||||
rtnAcctSwapTerminateTopic = Environment.GetEnvironmentVariable("KafkaConfig_RtnAcctSwapTerminateTopic");
|
||||
rtnAcctSwapTerminateTopicGroupId = Environment.GetEnvironmentVariable("KafkaConfig_RtnAcctSwapTerminateTopicGroupId");
|
||||
_rtnAcctSwapTerminateConsumer= new KafkaConsumerHelper(rtnAcctSwapTerminateTopicGroupId, rtnAcctSwapTerminateTopic);
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
_cts.Dispose();
|
||||
}
|
||||
|
||||
public Task StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
Task.Run(() => ExecuteTask(_cts.Token), _cts.Token);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public async Task StopAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
_cts.Cancel();
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
private async Task ExecuteTask(CancellationToken cancellationToken)
|
||||
{
|
||||
while (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 执行任务
|
||||
await Task.Run(() => {
|
||||
new SwapConsumerService(OptUserInfo.SystemUser).ConsumerTradeUnwindResp(_rtnAcctSwapTerminateConsumer);
|
||||
}, cancellationToken);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error("ConsumerTradeResp Exception", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -80,13 +80,6 @@ namespace YLErp.Web.Controllers
|
||||
if (client.ProcessStatus=="已开户")
|
||||
{
|
||||
new EtradingRuleService(CurUser).SendEtradingRuleToKafka(client.Number);
|
||||
new PushLogService(CurUser).AddLog(client.id, SwapPushDataEnum.客户创建, SwapPushDataEnum.客户修改, client.Number);
|
||||
using ClientDBContext clientDB=new ClientDBContext();
|
||||
if (clientDB.bankcard.Any(o => o.ApprovalOrder < 1 && o.ClientId == clientId && o.ValidState != "InValid"))
|
||||
{
|
||||
new PushLogService(CurUser).AddLog(client.id, SwapPushDataEnum.客户资金账户新增, client.Number);
|
||||
}
|
||||
|
||||
}
|
||||
return JsonSuccess(message, client);
|
||||
}
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
using YLErp.Modules.DataCompare;
|
||||
using YLErp.Modules.DataCompare.Dto;
|
||||
using YLErp.Modules.EodModule.SettlementModule;
|
||||
using YLErp.Modules.SwapModule;
|
||||
|
||||
namespace YLErp.Web.Controllers
|
||||
{
|
||||
public class DataCompareController : BaseController
|
||||
{
|
||||
[MyAuthorize("结算管理-与衡泰对账")]
|
||||
public ActionResult Index()
|
||||
{
|
||||
var service = new DataCompareService(CurUser);
|
||||
ViewBag.ValueDate = service.GetLastCloseDate().ToString("yyyy-MM-dd");
|
||||
return View();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询数据比对列表
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public JsonResult QueryNeedCompareData(QueryNeedCompareDataRequest req)
|
||||
{
|
||||
var service = new DataCompareService(CurUser);
|
||||
var sList = service.QueryNeedCompareData(req);
|
||||
return Json(sList);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询仅衡泰数据
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public JsonResult QueryOnlyHengTaiData(QueryNeedCompareDataRequest req)
|
||||
{
|
||||
var service = new DataCompareService(CurUser);
|
||||
var sList = service.QueryOnlyHengTaiData(req);
|
||||
return Json(sList);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 导出
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
public object ExportData(QueryNeedCompareDataRequest req)
|
||||
{
|
||||
var service = new DataCompareService(CurUser);
|
||||
var bytes = service.ExprotExcel(req);
|
||||
return File(bytes, xlsxMimeType, $"与衡泰对账_{DateTime.Now:yyyyMMddHHmmss}.xlsx");
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询清算时间
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public JsonResult GetLiquidationTime(QueryNeedCompareDataRequest req)
|
||||
{
|
||||
var service = new DataCompareService(CurUser);
|
||||
var sList = service.GetLiquidationTime(req);
|
||||
return Json(sList);
|
||||
}
|
||||
/// <summary>
|
||||
/// 检验是日期范围内是否拿到衡泰估值
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public JsonResult CheckHTData(EodTaskSaveReq req)
|
||||
{
|
||||
var service = new DataCompareService(CurUser);
|
||||
var msg= service.CheckHTDataByDate(req.StartDate, req.EndDate);
|
||||
bool checkSuccess = string.IsNullOrEmpty(msg);
|
||||
return JsonSuccess("",new { checkSuccess= checkSuccess,msg=msg });
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取衡泰最后一次估值信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public JsonResult GetLastSettmentTime()
|
||||
{
|
||||
var lastTime = new DataCompareService(CurUser).GetHTLastDate();
|
||||
return JsonSuccess("", lastTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
|
||||
using YLErp.Helpers;
|
||||
using YLErp.Modules.SwapModule;
|
||||
using YLErp.Modules.SwapModule.Interface;
|
||||
|
||||
namespace YLErp.Web.Controllers
|
||||
{
|
||||
public class PushLogController : BaseController
|
||||
{
|
||||
private IPushHTService _pushHTService;
|
||||
public PushLogController(IPushHTService pushHTService) {
|
||||
_pushHTService = pushHTService;
|
||||
}
|
||||
[MyAuthorize("结算管理-推送衡泰")]
|
||||
public ActionResult LogList()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
/// <summary>
|
||||
/// 推送列表查询json
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public JsonResult LogQuery(PushLogQueryRequest req)
|
||||
{
|
||||
var pushService = new PushLogService(CurUser);
|
||||
var sList = pushService.SearchList(req);
|
||||
return Json(sList);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重新推送
|
||||
/// </summary>
|
||||
/// <param name="logId"></param>
|
||||
/// <returns></returns>
|
||||
public JsonResult ReSetLog(string enid)
|
||||
{
|
||||
var logId=DecryptLong(enid);
|
||||
var pushLog= new PushLogService(CurUser).ReSetLog(logId);
|
||||
if (pushLog!=null&& !pushLog.data_stateStr.Contains("成功"))
|
||||
{
|
||||
_pushHTService.PushSingle(pushLog);
|
||||
}
|
||||
return JsonSuccess("");
|
||||
}
|
||||
/// <summary>
|
||||
/// 删除推送
|
||||
/// </summary>
|
||||
/// <param name="logId"></param>
|
||||
/// <returns></returns>
|
||||
public JsonResult DelLog(string enid)
|
||||
{
|
||||
var logId = DecryptLong(enid);
|
||||
new PushLogService(CurUser).DeleteLog(logId);
|
||||
return JsonSuccess("删除成功");
|
||||
}
|
||||
/// <summary>
|
||||
/// 推送到衡泰
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<JsonResult> SendHT()
|
||||
{
|
||||
var tasks = StaticHelper<Task>.GetValues();
|
||||
foreach (var task in tasks)
|
||||
{
|
||||
if (task.Status != TaskStatus.RanToCompletion)
|
||||
{
|
||||
return JsonError("仍有推送中的数据,请稍后再试");
|
||||
}
|
||||
}
|
||||
StaticHelper<Task>.DeleteValues();
|
||||
var t1= Task.Run(() =>
|
||||
{
|
||||
_pushHTService.PushClient();
|
||||
});
|
||||
var t2= Task.Run(() =>
|
||||
{
|
||||
_pushHTService.PushTrade();
|
||||
});
|
||||
StaticHelper<Task>.SetValues(t1);
|
||||
StaticHelper<Task>.SetValues(t1);
|
||||
return JsonSuccess("");
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取最后日终估值获取日期
|
||||
/// </summary>
|
||||
/// <param name="valueDate"></param>
|
||||
/// <returns></returns>
|
||||
public JsonResult GetLastSettmentTime()
|
||||
{
|
||||
var lastTime = new PushLogService(CurUser).GetLastSettmentTime(valuedateBLL.ValueDate);
|
||||
return JsonSuccess("",lastTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,6 @@ using System.Text.Unicode;
|
||||
using YieldChain.Commons;
|
||||
using YLErp.Abstract;
|
||||
using YLErp.Modules.SwapModule;
|
||||
using YLErp.Modules.SwapModule.Interface;
|
||||
using YLErp.Web.App;
|
||||
using YLErp.Web.App.KafkaTask;
|
||||
using YLErp.Web.Hubs;
|
||||
@@ -51,7 +50,6 @@ try
|
||||
builder.Services.Configure<KafkaConfig>(builder.Configuration.GetSection("KafkaConfig"));
|
||||
builder.Services.AddScoped<IViewRenderService, ViewRenderService>();
|
||||
builder.Services.AddSingleton<IKafkaProduce, KafkaProduceHelper>();
|
||||
builder.Services.AddSingleton<IPushHTService, PushHTService>();
|
||||
builder.Services.AddResponseCompression(options =>
|
||||
{
|
||||
options.Providers.Add<BrotliCompressionProvider>();
|
||||
@@ -100,28 +98,11 @@ try
|
||||
builder.Services.AddHostedService<SendKafkaTask>();
|
||||
builder.Services.AddHostedService<ClientBalanceTask>();
|
||||
|
||||
//builder.Services.AddHostedService<SwapTradeProduceKafkaTask>();
|
||||
builder.Services.AddHostedService<SwapTradeConsumerKafkaTask>();
|
||||
builder.Services.AddHostedService<SwapTradeMarginConsumerKafkaTask>();
|
||||
builder.Services.AddHostedService<SwapTradePosiConsumerKafkaTask>();
|
||||
builder.Services.AddHostedService<SwapTradeUnwindConsumerKafkaTask>();
|
||||
|
||||
builder.Services.AddHostedService<SwapTradeReceiptConsumerKafkaTask>();
|
||||
builder.Services.AddHostedService<SwapTradeCashReceiptConsumerKafkaTask>();
|
||||
builder.Services.AddHostedService<SwapTradeMarginReceiptConsumerKafkaTask>();
|
||||
builder.Services.AddHostedService<SwapTradePosiReceiptConsumerKafkaTask>();
|
||||
builder.Services.AddHostedService<SwapTradeUnwindReceiptConsumerKafkaTask>();
|
||||
|
||||
//builder.Services.AddHostedService<ClientInfoProduceKafkaTask>();
|
||||
builder.Services.AddHostedService<ClientInfoConsumerKafkaTask>();
|
||||
builder.Services.AddHostedService<ClientBankConsumerKafkaTask>();
|
||||
|
||||
builder.Services.AddHostedService<ClientReskCheckKafkaTask>();
|
||||
builder.Services.AddHostedService<YLErp.Web.App.HostedTaskService>();
|
||||
builder.Services.AddHostedService<ClientBalanceMonitorTotalKafkaTask>();
|
||||
builder.Services.AddHostedService<ClientBalanceMonitorSingleKafkaTask>();
|
||||
|
||||
builder.Services.AddHostedService<ExchangeTradeConsumerKafkaTask>();
|
||||
builder.Services.AddHostedService<TrsExchangeTradeConsumerKafkaTask>();
|
||||
builder.Services.AddHostedService<HedgingOrderCancelConsumerKafkaTask>();
|
||||
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
@{
|
||||
ViewBag.Title = "与衡泰对账";
|
||||
ViewBag.Menu = "结算财务-与衡泰对账";
|
||||
Layout = "~/Views/Shared/_MainLayout.cshtml";
|
||||
}
|
||||
@section CSS{
|
||||
<style>
|
||||
textarea {
|
||||
width: 98%;
|
||||
height:200px;
|
||||
}
|
||||
|
||||
.wentiEdit{
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.searchdiv .search-group {
|
||||
width:282px;
|
||||
}
|
||||
.searchdiv .search-label{
|
||||
width:120px;
|
||||
}
|
||||
|
||||
.searchdiv .datepicker {
|
||||
width: 152px !important;
|
||||
font-size: .75rem;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
@section JS{
|
||||
<script>
|
||||
var page = {
|
||||
configcolumn_data_comparehetai : "@configcolumn_data.衡泰对账"
|
||||
};
|
||||
</script>
|
||||
<script src="~/Scripts/app/datacompare/list.js?v=@HtmlUtil.JsVersion"></script>
|
||||
}
|
||||
<div id="rateVue">
|
||||
<div class="searchdiv">
|
||||
<div class="search-group">
|
||||
<span class="search-label" for="DateValueDate">对账日期</span>
|
||||
<input class="search-input datepicker" id="ValueDate" name="ValueDate" value="@ViewBag.ValueDate" type="text" autocomplete="off">
|
||||
</div>
|
||||
@Html.MyAceDropdownInput("AssetId", "簿记账户", AssetunitController.GetClientassetunit())
|
||||
@Html.ShortInput("TradeNumber", "交易编号")
|
||||
<div class="search-group">
|
||||
<span class="search-label" for="ShowException">仅看异常</span>
|
||||
<input type="checkbox" id="ShowException" name="ShowException" />
|
||||
</div>
|
||||
<button class="btn btn-primary" onclick="SearchClick()"><span class="glyphicon glyphicon-search"></span>查询</button>
|
||||
<button class="btn btn-primary" onclick="ExportClick()"><span class="glyphicon"></span>导出</button>
|
||||
<div style="width: 30px; display: inline;" onclick="showcolumnChooser();return false;">
|
||||
<img src="~/Images/configure.png" />
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
|
||||
<div class="search-group">
|
||||
<span class="search-label">系统清算时间</span>
|
||||
<span id="sysTime"></span>
|
||||
</div>
|
||||
<div class="search-group">
|
||||
<span class="search-label">衡泰清算时间</span>
|
||||
<span id="hengTaiTime"></span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<ul id="myTab" class="nav nav-tabs nav-main">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" href="#">本系统中的合约</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div style="width:98%">
|
||||
@Html.Raw(JqGridSimple.OutTable())
|
||||
</div>
|
||||
<ul id="myTab" class="nav nav-tabs nav-main">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" href="#">仅衡泰中有的合约</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div style="width:98%">
|
||||
@Html.Raw(JqGridSimple.OutTable(1))
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form target="_blank" method="post" id="exportForm" action="">
|
||||
<input type="hidden" name="" value="" />
|
||||
</form>
|
||||
@@ -1,62 +0,0 @@
|
||||
@{
|
||||
ViewBag.Title = "推送衡泰";
|
||||
ViewBag.Menu = "结算财务-推送衡泰";
|
||||
Layout = "~/Views/Shared/_MainLayout.cshtml";
|
||||
var logTypes = JsDataModel.GetPushLogType();//数据类型
|
||||
var logStates = JsDataModel.GetPushLogState();//数据状态
|
||||
}
|
||||
@section CSS{
|
||||
<style>
|
||||
textarea {
|
||||
width: 98%;
|
||||
height:200px;
|
||||
}
|
||||
|
||||
.wentiEdit{
|
||||
cursor:pointer;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
@section JS{
|
||||
<script>
|
||||
var page = {
|
||||
canPush: '@CurUser.结算管理_推送衡泰推送',
|
||||
canDelete: '@CurUser.结算管理_推送衡泰删除'
|
||||
}
|
||||
</script>
|
||||
<script src="~/Scripts/app/pushlog/list.js?v=@HtmlUtil.JsVersion"></script>
|
||||
}
|
||||
<div id="rateVue">
|
||||
<div class="searchdiv">
|
||||
@Html.MyAceDropdownInput("data_type", "数据类型", logTypes,appendEmptyAll:false,multiple:true)
|
||||
@Html.MyAceDropdownInput("data_state", "数据状态", logStates,appendEmptyAll:false,multiple:true)
|
||||
@Html.ShortInput("data_numer", "数据编号")
|
||||
@Html.SearchDateRange("OptDate", "推送时间")
|
||||
<button class="btn btn-primary" onclick="SearchClick(true)"><span class="glyphicon glyphicon-search"></span>查询</button>
|
||||
@if (CurUser.结算管理_推送衡泰推送)
|
||||
{
|
||||
<button class="btn btn-primary" onclick="PushClick()"><span class="glyphicon"></span>推送衡泰</button>
|
||||
}
|
||||
@if (CurUser.结算管理_日终估值获取)
|
||||
{
|
||||
<button class="btn btn-primary" onclick="ComparisonClick()"><span class="glyphicon"></span>日终估值获取</button>
|
||||
}
|
||||
</div>
|
||||
<div style="width:98%">
|
||||
@Html.Raw(JqGridSimple.OutTable())
|
||||
</div>
|
||||
<div id="detailForm" style="display:none;">
|
||||
<div class="yc-panel">
|
||||
<h4 class="mb-3">推送请求</h4>
|
||||
<div class="mb-4">
|
||||
<textarea id="req_text"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="yc-panel">
|
||||
<h4 class="mb-3">请求响应</h4>
|
||||
<div class="mb-4">
|
||||
<textarea id="resp_text"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -84,10 +84,6 @@
|
||||
{
|
||||
<button class="btn btn-primary" onclick="showImport()">导入日终持仓估值</button>
|
||||
}
|
||||
@if (CurUser.结算管理_推送衡泰推送)
|
||||
{
|
||||
<button class="btn btn-primary" onclick="PushClick()"><span class="glyphicon"></span>执行衡泰推送</button>
|
||||
}
|
||||
<div style="width: 30px; display: inline;" onclick="showcolumnChooser();return false;">
|
||||
<img src="~/Images/configure.png" />
|
||||
</div>
|
||||
|
||||
@@ -8,23 +8,22 @@
|
||||
minValueDate = valuedateBLL.ValueDate.AddYears(-5).ToString("yyyy-MM-dd"),
|
||||
checkResult = new YLErp.Modules.EodModule.EodCurrencyCheckResult(),
|
||||
isAutoDelaySettlement = PS.Config.IsAutoDelaySettlement,
|
||||
isShanxigushou = PS.Config.Is山西固收
|
||||
};
|
||||
var allVolTypes = SettlementViewModel.GetVolTypes();
|
||||
var checkedVolTypes = Model.VolTypes.Split(',').Where(n => !string.IsNullOrWhiteSpace(n)).ToArray();
|
||||
var dispaly =PS.Config.Is山西固收? "display:none":"";
|
||||
// var dispaly = PS.Config.Is浙商 ? "display:none" : "";
|
||||
}
|
||||
@section CSS{
|
||||
@section CSS {
|
||||
<link href="~/Style/Css/eodExecV2.css?v=@HtmlUtil.JsVersion" rel="stylesheet" />
|
||||
}
|
||||
|
||||
@section JS{
|
||||
@section JS {
|
||||
<script>
|
||||
const page = @Json.Serialize(pageObj);
|
||||
</script>
|
||||
<script src="~/Scripts/app/eod/eodExecV2.js?v=@(HtmlUtil.JsVersion)"></script>
|
||||
}
|
||||
<div class="yc-panel">
|
||||
<div class="yc-panel">
|
||||
<div class="row">
|
||||
<h6 class="float-left">异常标的预警: </h6>
|
||||
<div class="underlycss" id="underlycss" style="">
|
||||
@@ -36,9 +35,9 @@
|
||||
上次刷新时间:<span id="updateTradeUnderlyDate"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="yc-panel">
|
||||
<div class="yc-panel">
|
||||
<h3 class="card-title">收盘操作</h3>
|
||||
<p style="color:red">(注:执行历史收盘时请务必按照顺序,连续执行到最近收盘日期,否则报表中数据可能会产生误差!)</p>
|
||||
<hr />
|
||||
@@ -54,17 +53,17 @@
|
||||
<div class="mt-4">
|
||||
<span class="mr-1"> 价格模式:</span>
|
||||
<label class="mr-2"><input type="checkbox" name="PriceType" class="mr-1" value="1" @((Model.PriceType & 1) > 0 ? "checked" : "") />收盘价  </label>
|
||||
<label class="mr-2" style="@dispaly"><input type="checkbox" name="PriceType" class="mr-1" value="2" @((Model.PriceType & 2) > 0 ? "checked" : "") />结算价  </label>
|
||||
@* <label class="mr-2" style="@dispaly"><input type="checkbox" name="PriceType" class="mr-1" value="2" @((Model.PriceType & 2) > 0 ? "checked" : "") />结算价  </label> *@
|
||||
</div>
|
||||
|
||||
<div class="mt-4" style="@dispaly">
|
||||
@* <div class="mt-4" style="@dispaly">
|
||||
<span class="mr-1">波动率类型:</span>
|
||||
@foreach (var item in allVolTypes)
|
||||
{
|
||||
var _checked = checkedVolTypes.Contains(item.Value) ? "checked" : "";
|
||||
<label class="mr-2"><input type="checkbox" name="VolTypes" class="mr-1" value="@(item.Value)" @(_checked) />@(item.Text)</label>
|
||||
}
|
||||
</div>
|
||||
</div> *@
|
||||
@if (PS.Config.Company == CompanyEnum.国元固收)
|
||||
{
|
||||
<div class="mt-4">
|
||||
@@ -94,38 +93,14 @@
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (PS.Config.Is山西固收)
|
||||
{
|
||||
<div class="mt-4">
|
||||
@if (CurUser.结算管理_日终估值获取)
|
||||
{
|
||||
<button class="btn btn-primary ml-3" onclick="ComparisonClick()">日终估值获取</button>
|
||||
}
|
||||
<span>衡泰清算时间:<label id="lastHTSettmentTime"></label></span>
|
||||
</div>
|
||||
<div class="mt-4">
|
||||
@if (System.Diagnostics.Debugger.IsAttached)
|
||||
{
|
||||
<button class="btn btn-primary ml-3" onclick="saveEodTask(true)">执行调试</button>
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CurUser.结算管理_收盘操作)
|
||||
{
|
||||
<button class="btn btn-primary ml-3" onclick="saveEodTask()">执行</button>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
<div class="mt-4">
|
||||
<span style="margin-left:100px;"></span>
|
||||
@if (PS.Config.ErpElement.SupportMultiCurrency)
|
||||
{
|
||||
<button class="btn btn-primary" onclick="vueCheck.show()">汇率检查</button>
|
||||
}
|
||||
<button class="btn btn-primary ml-3" onclick="saveEodKnowInOut()" style="@dispaly">期权自动敲入敲出</button>
|
||||
@* <button class="btn btn-primary ml-3" onclick="saveEodKnowInOut()" style="@dispaly">期权自动敲入敲出</button> *@
|
||||
@if (System.Diagnostics.Debugger.IsAttached)
|
||||
{
|
||||
<button class="btn btn-primary ml-3" onclick="saveEodTask(true)">执行调试</button>
|
||||
@@ -138,15 +113,10 @@
|
||||
}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</form>
|
||||
|
||||
<hr />
|
||||
<div>
|
||||
@if (PS.Config.Is山西固收)
|
||||
{
|
||||
<a class="btn btn-link" href="/pushlog/loglist" target="_blank">衡泰相关</a>
|
||||
}
|
||||
<a class="btn btn-link" href="/eod_trade_value/EodHistory" target="_blank">收盘历史</a>
|
||||
@if (CurUser.结算管理_日终价格查看)
|
||||
{
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"ConnectionStrings": {
|
||||
"ylcms": "server=139.196.109.225;uid=root/YieldChain%8341;pooling=true;port=20306;pwd=Midnight001!@#$;database=yltrs_ylcms;charset=utf8;Allow User Variables=True;SslMode=none;Connection Timeout=30;IgnoreCommandTransaction=true;",
|
||||
"yladmin": "server=139.196.109.225;uid=root/YieldChain%8341;pooling=true;port=20306;pwd=Midnight001!@#$;database=yltrs_admin;charset=utf8;Allow User Variables=True;SslMode=none;Connection Timeout=30;IgnoreCommandTransaction=true;",
|
||||
"ylclient": "server=139.196.109.225;uid=root/YieldChain%8341;pooling=true;port=20306;pwd=Midnight001!@#$;database=yltrs_client;charset=utf8;Allow User Variables=True;SslMode=none;Connection Timeout=30;IgnoreCommandTransaction=true;",
|
||||
"bondoms": "server=139.196.109.225;uid=root/YieldChain%8341;pooling=true;port=20306;pwd=Midnight001!@#$;database=bond_oms;charset=utf8;Allow User Variables=True;SslMode=none;Connection Timeout=30;IgnoreCommandTransaction=true;",
|
||||
"ylcms": "server=139.196.109.225;uid=root;pooling=true;port=3306;pwd=Midnight001!@#$;database=yltrs_ylcms;charset=utf8;Allow User Variables=True;SslMode=none;Connection Timeout=30;IgnoreCommandTransaction=true;",
|
||||
"yladmin": "server=139.196.109.225;uid=root;pooling=true;port=3306;pwd=Midnight001!@#$;database=yltrs_admin;charset=utf8;Allow User Variables=True;SslMode=none;Connection Timeout=30;IgnoreCommandTransaction=true;",
|
||||
"ylclient": "server=139.196.109.225;uid=root;pooling=true;port=3306;pwd=Midnight001!@#$;database=yltrs_client;charset=utf8;Allow User Variables=True;SslMode=none;Connection Timeout=30;IgnoreCommandTransaction=true;",
|
||||
"bondoms": "server=139.196.109.225;uid=root;pooling=true;port=3306;pwd=Midnight001!@#$;database=bond_oms;charset=utf8;Allow User Variables=True;SslMode=none;Connection Timeout=30;IgnoreCommandTransaction=true;"
|
||||
// "apex_oracle": "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=122.112.205.57)(PORT=11521)))(CONNECT_DATA=(SERVICE_NAME=xe)));User ID=system;Password=oracle;"
|
||||
},
|
||||
"AppSettings": {
|
||||
@@ -37,53 +37,20 @@
|
||||
"MessageTimeoutMs": 3000, // 控制生产者等待消息确认的时间,单位是毫秒
|
||||
"ClientRateTopic": "ylClientRateTopic", //客户互换费率生产topic
|
||||
"HedgingAccountTopic": "ylHedgingAccountTopic", //对冲账户生产topic
|
||||
"AccountCapitalTopicGroupId": "YiLian_OnRspAccountCapitalConsumer", //账户资金消费组
|
||||
"ReqAccountCapitalTopic": "ReqAccountCapital", //账户资金请求topic
|
||||
"OnRspAccountCapitalTopic": "OnRspAccountCapital", //账户资金请求返回topic
|
||||
"ReqInterestRateSwapInsertTopic": "ReqInterestRateSwapInsert", //收益互换交易推送请求topic
|
||||
"OnRspInterestRateSwapInsertTopic": "OnRspInterestRateSwapInsert", //收益互换交易推送请求响应topic
|
||||
"OnRspInterestRateSwapInsertTopicGroupId": "OnRspInterestRateSwapInsertConsumer1", //收益互换交易推送请求响应消费组
|
||||
"AccountCapitalTopicGroupId": "YiLian_OnRspAccountCapitalConsumer", //账户资金消费组
|
||||
"ReqAssetSwapInsertTopic": "ReqAssetSwapInsert", //互换资产交易推送请求
|
||||
"OnRspAssetSwapInsertTopic": "OnRspAssetSwapInsert", //互换资产交易推送请求响应
|
||||
"OnRspAssetSwapInsertTopicGroupId": "OnRspAssetSwapInsertConsumer", //互换资产交易推送请求响应消费组
|
||||
"ReqMarginInsertTopic": "ReqMarginInsert", //预付金交易推送请求
|
||||
"OnRspMarginInsertTopic": "OnRspMarginInsert", //预付金交易推送请求响应
|
||||
"OnRspMarginInsertTopicGroupId": "OnRspMarginInsertConsumer", //预付金交易推送请求响应消费组
|
||||
"ReqAcctSwapTerminateTopic": "ReqAcctSwapTerminate", //平仓推送请求
|
||||
"OnRspAcctSwapTerminateTopic": "OnRspAcctSwapTerminate", //平仓推送请求响应
|
||||
"OnRspAcctSwapTerminateTopicGroupId": "OnRspAcctSwapTerminateConsumer", //平仓推送请求响应消费组
|
||||
"ReqCalcBondTopic": "ReqCalcBond", //互换成交收益率计算器topic
|
||||
"OnRspCalcBondTopic": "OnRspCalcBond", //互换成交收益率计算器消费topic
|
||||
"OnRspCalcBondTopicGroupId": "OnRspCalcBondConsumer", //互换成交收益率计算器消费topic消费组
|
||||
"AutoOffsetReset": 1, //Latest(0),Earliest(1),Error(2)
|
||||
"EnableCalcBongd": false, //是否启用kafka计算
|
||||
"ReqClientRiskCheckTopic": "YiLian_ReqClientRiskCheck", //客户风控检查
|
||||
"ReqClientRiskCheckConsumerTopic": "YiLian_OnRspClientRiskCheck", //客户风控检查消费者
|
||||
"ReqClientRiskCheckTopicGroupId": "YiLian_ReqClientRiskCheckConsumer1", //客户风控检查消费者
|
||||
"ReqCounterPartyInfoInsertTopic": "ReqCounterPartyInfoInsert", //交易对手信息导入请求
|
||||
"OnRspCounterPartyInsertTopic": "OnRspCounterPartyInsert", //交易对手信息导入请求响应
|
||||
"OnRspCounterPartyInsertTopicGroupId": "OnRspCounterPartyInsertConsumer", //交易对手信息导入请求响应消费组
|
||||
"ReqCounterPartyCashAccoutInsertTopic": "ReqCounterPartyCashAccoutInsert", //交易对手资金账户信息导入请求
|
||||
"OnRspCounterPartyCashAccoutInsertTopic": "OnRspCounterPartyCashAccoutInsert", //交易对手资金账户信息请求响应
|
||||
"OnRspCounterPartyCashAccoutInsertTopicGroupId": "OnRspCounterPartyCashAccoutInsertConsumer", //交易对手资金账户信息请求响应消费组
|
||||
"RtnInterestRateSwapTopic": "RtnInterestRateSwap", //收益互换回执消费
|
||||
"RtnInterestRateSwapTopicGroupId": "RtnInterestRateSwapConsumer1", //收益互换回执消费组
|
||||
"RtnAssetSwapTopic": "RtnAssetSwap", //互换资产交易回执消费
|
||||
"RtnAssetSwapTopicGroupId": "RtnAssetSwapConsumer1", //互换资产交易回执消费组
|
||||
"RtnMarginTopic": "RtnMargin", //预付金交易回执消费
|
||||
"RtnMarginTopicGroupId": "RtnMarginConsumer1", //预付金交易回执消费组
|
||||
"RtnAcctSwapTerminateTopic": "RtnAcctSwapTerminate", //合约终止回执消费
|
||||
"RtnAcctSwapTerminateTopicGroupId": "RtnAcctSwapTerminateConsumer", //合约终止回执消费组
|
||||
"RtnInterestRateSwapAccountTopic": "RtnInterestRateSwapAccount", //收益互换日终资金流水回执消费
|
||||
"RtnInterestRateSwapAccountTopicGroupId": "RtnInterestRateSwapAccountConsumer1", //收益互换日终资金流水回执消费组
|
||||
"ReqClientMonitorTopic": "YiLian_ReqClientMonitor", //客户资金监控
|
||||
"OnRspClientMonitorConsumerTopic": "YiLian_OnRspClientMonitor", //客户资金监控消费者
|
||||
"ReqClientMonitorTopicGroupId": "YiLian_ReqClientMonitorConsumer1", //客户资金监控消费组
|
||||
"ReqClientMonitorSingleTopic": "YiLian_ReqClientMonitorSingle", //单个客户资金监控
|
||||
"OnRspClientMonitorSingleConsumerTopic": "YiLian_OnRspClientMonitorSingle", //单个客户资金监控
|
||||
"ReqClientMonitorSingleTopicGroupId": "YiLian_ReqClientMonitorSingleConsumer1", //单个客户资金监控
|
||||
"ExchangeTradeConsumerTopic": "RtnAssetSwapDb", //对冲交易消费 topic
|
||||
"ExchangeTradeConsumerTopicGroupId": "RtnAssetSwapDbGroup1", //对冲交易消费 Group,
|
||||
"TrsExchangeTradeConsumerTopic": "YiLian_HedgingOrder", //TRS对冲交易消费 topic
|
||||
"TrsExchangeTradeConsumerTopicGroupId": "YiLian_HedgingOrderGroup1", //TRS对冲交易消费 Group
|
||||
"YiLian_ReqHedgingOrderCancelTopic": "YiLian_ReqHedgingOrderCancel", //TRS对冲交易撤单请求消费 topic
|
||||
|
||||
@@ -1,328 +0,0 @@
|
||||
var g_grid = {};
|
||||
var query_data = {};
|
||||
|
||||
$(function () {
|
||||
var PostData = {};
|
||||
|
||||
$(".datepicker").datepicker({
|
||||
changeMonth: true,
|
||||
changeYear: true,
|
||||
showButtonPanel: true,
|
||||
showOtherMonths: true,
|
||||
selectOtherMonths: true
|
||||
});
|
||||
|
||||
grid = jQuery('#listGrid').jqGrid({
|
||||
cmTemplate: {
|
||||
width: 80,
|
||||
align: 'center',
|
||||
sortable: false
|
||||
},
|
||||
url: '/DataCompare/QueryNeedCompareData',
|
||||
datatype: 'json',
|
||||
multiselect: false,
|
||||
height: '340px',
|
||||
width: '96%',
|
||||
autowidth: false,
|
||||
shrinkToFit: false,
|
||||
viewrecords: true,
|
||||
jsonReader: { repeatitems: false },
|
||||
caption: '',
|
||||
mtype: 'POST',
|
||||
postData: PostData,
|
||||
colModel: colModelGrid,
|
||||
pager: jQuery('#pagerGrid'),
|
||||
pagerpos: 'left',
|
||||
loadComplete: gridComplete,
|
||||
rowNum: 20,
|
||||
rowList: [20, 30, 50, 200, 10000]
|
||||
});
|
||||
|
||||
grid2 = jQuery('#listGrid1').jqGrid({
|
||||
cmTemplate: {
|
||||
width: 80,
|
||||
align: 'center',
|
||||
sortable: false
|
||||
},
|
||||
url: '/DataCompare/QueryOnlyHengTaiData',
|
||||
datatype: 'json',
|
||||
multiselect: false,
|
||||
height: '340px',
|
||||
width: '96%',
|
||||
autowidth: false,
|
||||
shrinkToFit: false,
|
||||
viewrecords: true,
|
||||
jsonReader: { repeatitems: false },
|
||||
caption: '',
|
||||
mtype: 'POST',
|
||||
postData: PostData,
|
||||
colModel: colModelGrid2,
|
||||
pager: jQuery('#pagerGrid1'),
|
||||
pagerpos: 'left',
|
||||
rowNum: 20,
|
||||
rowList: [20, 30, 50, 200, 10000]
|
||||
});
|
||||
|
||||
function keyEnter(event) {
|
||||
try {
|
||||
var e = event ? event : (window.event ? window.event : null);
|
||||
if (e.keyCode === 13) {
|
||||
SearchClick(true);
|
||||
}
|
||||
} catch (e) {
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
document.onkeydown = keyEnter;
|
||||
});
|
||||
|
||||
function gridComplete() {
|
||||
var jgrid = jQuery('#listGrid');
|
||||
main.setcolumnChooser(jgrid, page.configcolumn_data_comparehetai);
|
||||
|
||||
}
|
||||
|
||||
|
||||
function showcolumnChooser() {
|
||||
var jgrid = jQuery('#listGrid');
|
||||
main.showcolumnChooser(jgrid, page.configcolumn_data_comparehetai);
|
||||
}
|
||||
|
||||
var hideObj = { clientWidth: 160 };
|
||||
|
||||
var i = 0;
|
||||
var getColModelGrid = function () {
|
||||
var col = [{
|
||||
name: 'id',
|
||||
hidden: true,
|
||||
optionHide: true
|
||||
}, {
|
||||
name: 'ValueDate',
|
||||
label: '对账日期',
|
||||
width: 80,
|
||||
sortable: true,
|
||||
align: 'center',
|
||||
formatter: 'date'
|
||||
}, {
|
||||
name: 'AssetName',
|
||||
label: '簿记账户',
|
||||
width: 140,
|
||||
sortable: true,
|
||||
align: 'center'
|
||||
}, {
|
||||
name: 'TradeStatus',
|
||||
label: '交易状态',
|
||||
index: "data_type",
|
||||
width: 90,
|
||||
align: 'center'
|
||||
}, {
|
||||
name: 'TradeNumber',
|
||||
label: '交易编号',
|
||||
width: 150,
|
||||
sortable: false,
|
||||
align: 'center'
|
||||
}, {
|
||||
name: 'TradeDate',
|
||||
label: '交易日期',
|
||||
width: 80,
|
||||
sortable: false,
|
||||
align: 'center',
|
||||
formatter: 'date'
|
||||
}, {
|
||||
name: 'StartDate',
|
||||
label: '开始日期',
|
||||
width: 80,
|
||||
sortable: false,
|
||||
align: 'center',
|
||||
formatter: 'date'
|
||||
}, {
|
||||
name: 'EndDate',
|
||||
label: '到期日期',
|
||||
width: 80,
|
||||
sortable: false,
|
||||
align: 'center',
|
||||
formatter: 'date'
|
||||
}, {
|
||||
name: 'StructType',
|
||||
label: '结构类型',
|
||||
width: 90,
|
||||
sortable: false,
|
||||
align: 'center'
|
||||
}, {
|
||||
name: 'QuoteCurrency',
|
||||
label: '计价货币',
|
||||
width: 90,
|
||||
sortable: false,
|
||||
align: 'center'
|
||||
}, {
|
||||
name: 'ClientName',
|
||||
label: '交易对手方',
|
||||
width: 150,
|
||||
sortable: false,
|
||||
align: 'center'
|
||||
}, {
|
||||
name: 'TraderName',
|
||||
label: '交易员',
|
||||
width: 90,
|
||||
sortable: false,
|
||||
align: 'center'
|
||||
}, {
|
||||
name: 'SwapType',
|
||||
label: '互换类型',
|
||||
width: 120,
|
||||
sortable: false,
|
||||
align: 'center'
|
||||
}, {
|
||||
name: 'StockEqvNotional',
|
||||
label: '名义本金',
|
||||
width: 120,
|
||||
sortable: false,
|
||||
align: 'center'
|
||||
}, {
|
||||
name: 'StockEqvNotionalV2',
|
||||
label: '衡泰名义本金',
|
||||
width: 120,
|
||||
sortable: false,
|
||||
align: 'center'
|
||||
}, {
|
||||
name: 'Pv',
|
||||
label: '持仓市值<i class="fa fa-question-circle-o" style="margin-left:5px;" title="不考虑待实现交易费用"></i>',
|
||||
width: 120,
|
||||
sortable: false,
|
||||
align: 'center'
|
||||
}, {
|
||||
name: 'PvV2',
|
||||
label: '衡泰持仓市值',
|
||||
width: 120,
|
||||
sortable: false,
|
||||
align: 'center'
|
||||
}, {
|
||||
name: 'CheckResult',
|
||||
label: '是否一致',
|
||||
width: 90,
|
||||
sortable: false,
|
||||
align: 'center',
|
||||
formatter: function (cellValue, options, rowObject) {
|
||||
if (cellValue) {
|
||||
return "<span style='color:#84E17E;'>" + rowObject.CheckResultStr + "</span>";
|
||||
}
|
||||
return "<span style='color:#FF7575;'>异常</span>";
|
||||
}
|
||||
}]
|
||||
return col;
|
||||
};
|
||||
|
||||
var getColModelGrid2 = function () {
|
||||
var col = [{
|
||||
name: 'id',
|
||||
hidden: true,
|
||||
optionHide: true
|
||||
}, {
|
||||
name: 'ValueDate',
|
||||
label: '对账日期',
|
||||
width: 120,
|
||||
sortable: true,
|
||||
align: 'center',
|
||||
formatter: 'date'
|
||||
}, {
|
||||
name: 'TradeNumber',
|
||||
label: '交易编号(外部成交编号)',
|
||||
width: 200,
|
||||
sortable: false,
|
||||
align: 'center'
|
||||
}, {
|
||||
name: 'StartDate',
|
||||
label: '开始日期',
|
||||
width: 100,
|
||||
sortable: false,
|
||||
align: 'center',
|
||||
formatter: 'date'
|
||||
}, {
|
||||
name: 'EndDate',
|
||||
label: '到期日期',
|
||||
width: 100,
|
||||
sortable: false,
|
||||
align: 'center',
|
||||
formatter: 'date'
|
||||
},{
|
||||
name: 'StockEqvNotionalV2',
|
||||
label: '衡泰名义本金',
|
||||
width: 100,
|
||||
sortable: false,
|
||||
align: 'center'
|
||||
}, {
|
||||
name: 'PvV2',
|
||||
label: '衡泰持仓市值',
|
||||
width: 100,
|
||||
sortable: false,
|
||||
align: 'center'
|
||||
}]
|
||||
return col;
|
||||
};
|
||||
|
||||
var colModelGrid = getColModelGrid();
|
||||
|
||||
var colModelGrid2 = getColModelGrid2();
|
||||
|
||||
|
||||
|
||||
|
||||
function reloadRate() {
|
||||
//重新加载
|
||||
SearchClick();
|
||||
}
|
||||
|
||||
function SearchClick(isSearchclick) {
|
||||
var listGrid = $('#listGrid');
|
||||
|
||||
reloadGridData(listGrid);
|
||||
|
||||
var listGrid1 = $('#listGrid1');
|
||||
|
||||
reloadGridData(listGrid1);
|
||||
|
||||
|
||||
main.post("/DataCompare/GetLiquidationTime", query_data).done(function (res) {
|
||||
console.log(res);
|
||||
$("#sysTime").text(res.SystemLiquidationTime);
|
||||
$("#hengTaiTime").text(res.HengTaiLiquidationTime);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
var query_data = {};
|
||||
function reloadGridData(listGrid) {
|
||||
listGrid.appendPostData({ ValueDate: $("#ValueDate").val() });
|
||||
listGrid.appendPostData({ AssetId: $("#AssetId").val() });
|
||||
listGrid.appendPostData({ TradeNumber: $("#TradeNumber").val() });
|
||||
listGrid.appendPostData({ ShowException: $("#ShowException").is(":checked") });
|
||||
query_data = listGrid.jqGrid('getPostData');
|
||||
if (typeof isSearchclick !== "undefined" && isSearchclick) {
|
||||
//点击搜索时默认第一页
|
||||
listGrid.jqGrid('setGridParam',
|
||||
{
|
||||
page: 1
|
||||
});
|
||||
}
|
||||
|
||||
listGrid.trigger('reloadGrid');
|
||||
}
|
||||
|
||||
|
||||
function ExportClick() {
|
||||
var $form = $('#exportForm').html('');
|
||||
$form.attr("action", '/DataCompare/ExportData')
|
||||
_.each(query_data, (val, key) => {
|
||||
if (!val) {
|
||||
val = '';
|
||||
} else if (_.isArray(val)) {
|
||||
_.each(val, x => {
|
||||
$form.append(`<input type="hidden" name="${key}" value="${x}">`);
|
||||
});
|
||||
return;
|
||||
}
|
||||
$form.append(`<input type="hidden" name="${key}" value="${val}">`);
|
||||
});
|
||||
$form.submit();
|
||||
}
|
||||
@@ -65,9 +65,7 @@ $(function () {
|
||||
checkExerciseTradeUnderly(false);
|
||||
|
||||
reportMgr.init();
|
||||
if (page.isShanxigushou) {
|
||||
loadSettmentLogTime();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//保存收盘任务
|
||||
@@ -112,20 +110,8 @@ function saveEodTask(isDebug) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function _saveEodTask(data) {
|
||||
main.post("/DataCompare/CheckHTData", data).done(function (res) {
|
||||
if (res.obj.checkSuccess) {
|
||||
eodTask(data);
|
||||
} else {
|
||||
main.confirm("检测到" + res.obj.msg + ",是否要继续?", function () {
|
||||
eodTask(data);
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
function eodTask(data) {
|
||||
main.post('/eod_trade_value/AjaxSaveEodTask', data).done(function () {
|
||||
main.message('收盘任务已加入到执行计划中');
|
||||
}).always(function () {
|
||||
@@ -331,20 +317,4 @@ function checkExerciseTradeUnderly(isupdate) {
|
||||
}
|
||||
});
|
||||
}
|
||||
//衡泰清算时间
|
||||
function loadSettmentLogTime() {
|
||||
main.post("/DataCompare/GetLastSettmentTime", {}, { waitMe: false, suppressError: true }).done(function (resp) {
|
||||
$('#lastHTSettmentTime').text(resp.obj);
|
||||
if (timeoutId && !resp.obj.indexOf($("#endDate").val())) {
|
||||
clearTimeout(timeoutId);
|
||||
}
|
||||
})
|
||||
}
|
||||
let timeoutId = null;
|
||||
function ComparisonClick() {
|
||||
main.post("/trs_hub_api/dataVerify/sendRequest", { startDate: $("#startDate").val(), endDate: $("#endDate").val() }).done(function (resp) {
|
||||
main.message(resp.message);
|
||||
timeoutId = setInterval(loadSettmentLogTime, 5000);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -1,224 +0,0 @@
|
||||
var g_grid = {};
|
||||
var query_data = {};
|
||||
|
||||
$(function () {
|
||||
var PostData = {};
|
||||
|
||||
$(".datepicker").datepicker({
|
||||
changeMonth: true,
|
||||
changeYear: true,
|
||||
showButtonPanel: true,
|
||||
showOtherMonths: true,
|
||||
selectOtherMonths: true
|
||||
});
|
||||
|
||||
grid = jQuery('#listGrid').jqGrid({
|
||||
cmTemplate: {
|
||||
width: 80,
|
||||
align: 'center',
|
||||
sortable: false
|
||||
},
|
||||
url: '/PushLog/LogQuery',
|
||||
datatype: 'json',
|
||||
multiselect: false,
|
||||
height: 'auto',
|
||||
width: '96%',
|
||||
autowidth: false,
|
||||
shrinkToFit: false,
|
||||
viewrecords: true,
|
||||
jsonReader: { repeatitems: false },
|
||||
caption: '',
|
||||
mtype: 'POST',
|
||||
postData: PostData,
|
||||
afterInsertRow: AfterInsertRow,
|
||||
onSelectRow: rowclick,
|
||||
ondblClickRow: rowdblclick,
|
||||
colModel: colModelGrid,
|
||||
pager: jQuery('#pagerGrid'),
|
||||
pagerpos: 'left',
|
||||
rowNum: 20,
|
||||
rowList: [20, 30, 50, 200, 10000],
|
||||
footerrow: false,
|
||||
loadComplete: gridComplete,
|
||||
onPaging: onJqgridPaging,
|
||||
});
|
||||
|
||||
function keyEnter(event) {
|
||||
try {
|
||||
var e = event ? event : (window.event ? window.event : null);
|
||||
if (e.keyCode === 13) {
|
||||
SearchClick(true);
|
||||
}
|
||||
} catch (e) {
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
document.onkeydown = keyEnter;
|
||||
});
|
||||
|
||||
var hideObj = { clientWidth: 160 };
|
||||
|
||||
var i = 0;
|
||||
var getColModelGrid = function () {
|
||||
var col = [{
|
||||
name: 'EncryptId',
|
||||
hidden: true,
|
||||
optionHide: true
|
||||
}, {
|
||||
name: 'data_state',
|
||||
hidden: true,
|
||||
optionHide: true
|
||||
}, {
|
||||
name: '',
|
||||
label: '操作',
|
||||
align: 'center',
|
||||
width: 140,
|
||||
formatter: showToolName
|
||||
}, {
|
||||
name: 'odata_no',
|
||||
label: 'SERIAL_NO',
|
||||
width: 160,
|
||||
sortable: true,
|
||||
align: 'center'
|
||||
}, {
|
||||
name: 'data_number',
|
||||
label: '数据编号',
|
||||
width: 160,
|
||||
sortable: true,
|
||||
align: 'center'
|
||||
}, {
|
||||
name: 'data_typeStr',
|
||||
label: '推送类型',
|
||||
index: "data_type",
|
||||
width: 160,
|
||||
align: 'center'
|
||||
}, {
|
||||
name: 'data_stateStr',
|
||||
label: '推送状态',
|
||||
width: 90,
|
||||
index: "data_state",
|
||||
sortable: false,
|
||||
align: 'center'
|
||||
}
|
||||
, {
|
||||
name: 'data_req',
|
||||
label: '推送请求',
|
||||
sortable: false,
|
||||
hidden: true,
|
||||
optionHide: true
|
||||
}, {
|
||||
name: 'data_resp',
|
||||
label: '请求响应',
|
||||
sortable: false,
|
||||
hidden: true,
|
||||
optionHide: true
|
||||
}, {
|
||||
name: 'create_time',
|
||||
label: '创建时间',
|
||||
width: 160,
|
||||
align: 'center',
|
||||
sortable: true,
|
||||
formatter: 'datetime'
|
||||
}, {
|
||||
name: 'update_time',
|
||||
label: '更新时间',
|
||||
width: 160,
|
||||
align: 'center',
|
||||
sortable: true,
|
||||
formatter: 'datetime'
|
||||
}]
|
||||
return col;
|
||||
};
|
||||
|
||||
var colModelGrid = getColModelGrid();
|
||||
|
||||
function gridComplete() {
|
||||
$('.ui-jqgrid-bdiv', '#gbox_listGrid').floatingScroll();
|
||||
}
|
||||
|
||||
function rowdblclick(rowid) {
|
||||
var rowData = $(this).getRowData(rowid);
|
||||
$("#req_text").val(rowData.data_req);
|
||||
$("#resp_text").val(rowData.data_resp);
|
||||
layer.open({
|
||||
type: 1,
|
||||
area: ['60%', '80%'],
|
||||
fixed: false, //不固定
|
||||
maxmin: true,
|
||||
content: $("#detailForm"),
|
||||
});
|
||||
}
|
||||
|
||||
function reloadRate() {
|
||||
//重新加载
|
||||
SearchClick();
|
||||
}
|
||||
|
||||
function showToolName(cellValue, options, rowObject) {
|
||||
var html = "";
|
||||
if (page.canPush=="True") {
|
||||
if (rowObject.data_stateStr.indexOf("接收") < 0 && rowObject.data_stateStr.indexOf("成功") < 0) {
|
||||
html = "<input type=\"button\" class=\"wentiEdit\" title='重推' onclick=\"resetLog('{0}')\" value=\"重推\" />"
|
||||
.template(rowObject.EncryptId);
|
||||
}
|
||||
}
|
||||
if (page.canDelete == "True") {
|
||||
html +=
|
||||
"<input type=\"button\" class=\"wentiEdit\" title='删除' onclick=\"delLog('{0}')\" value=\"删除\" />"
|
||||
.template(rowObject.EncryptId);
|
||||
}
|
||||
return html;
|
||||
}
|
||||
function resetLog(id) {
|
||||
main.confirm("确定要重新推送吗?", function () {
|
||||
main.post("/PushLog/ReSetLog?enid=" + id).done(function (resp) {
|
||||
SearchClick();
|
||||
layer.closeMe();
|
||||
})
|
||||
});
|
||||
}
|
||||
function delLog(id) {
|
||||
main.confirm("确定要删除吗?", function () {
|
||||
main.post("/PushLog/DelLog?enid=" + id).done(function (resp) {
|
||||
SearchClick();
|
||||
layer.closeMe();
|
||||
})
|
||||
});
|
||||
}
|
||||
function SearchClick(isSearchclick) {
|
||||
var listGrid = $('#listGrid');
|
||||
|
||||
listGrid.appendPostData({ data_types: $("#data_type").val() == null ? "" : $("#data_type").val() });
|
||||
listGrid.appendPostData({ data_states: $("#data_state").val() == null ? "" : $("#data_state").val() });
|
||||
listGrid.appendPostData({ data_number: $("#data_numer").val() });
|
||||
listGrid.appendPostData({ OptDateStart: $("#DateFromOptDate").val() });
|
||||
listGrid.appendPostData({ OptDateEnd: $("#DateToOptDate").val() });
|
||||
query_data = listGrid.jqGrid('getPostData');
|
||||
if (typeof isSearchclick !== "undefined" && isSearchclick) {
|
||||
//点击搜索时默认第一页
|
||||
listGrid.jqGrid('setGridParam',
|
||||
{
|
||||
page: 1
|
||||
});
|
||||
}
|
||||
|
||||
listGrid.trigger('reloadGrid');
|
||||
}
|
||||
|
||||
function PushClick() {
|
||||
main.confirm("确定要推送衡泰吗?", function () {
|
||||
main.post("/PushLog/SendHT").done(function (resp) {
|
||||
main.message("推送任务成功");
|
||||
SearchClick();
|
||||
})
|
||||
});
|
||||
|
||||
}
|
||||
function ComparisonClick() {
|
||||
main.post("/trs_hub_api/dataVerify/sendRequest", {}).done(function (resp) {
|
||||
main.message(resp.message);
|
||||
SearchClick();
|
||||
})
|
||||
}
|
||||
|
||||
@@ -584,13 +584,5 @@ function importEodFile() {
|
||||
function importClose() {
|
||||
layer.closeAll();
|
||||
}
|
||||
function PushClick() {
|
||||
main.confirm("确定要推送衡泰吗?", function () {
|
||||
main.post("/PushLog/SendHT").done(function (resp) {
|
||||
main.message("推送任务成功");
|
||||
})
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
window.reloadData = reloadtrade;
|
||||
@@ -1,65 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using YLErp.BLL.Eod;
|
||||
using YLErp.Cache;
|
||||
using YLErp;
|
||||
using YLErp.Helpers;
|
||||
|
||||
namespace RealTimeCalcPositionService
|
||||
{
|
||||
public class BondCalcKafkTask : IHostedService, IDisposable
|
||||
{
|
||||
private readonly IYcLogger _logger;
|
||||
private KafkaConsumerHelper _rspCalcBondTopicConsumer;
|
||||
private string onRspCalcBondTopic = string.Empty;
|
||||
private string onRspCalcBondTopicGroupId = string.Empty;
|
||||
private readonly CancellationTokenSource _cts = new CancellationTokenSource();
|
||||
public BondCalcKafkTask()
|
||||
{
|
||||
_logger = LogFactory.GetLogger("BondCalcKafkTask");
|
||||
onRspCalcBondTopic = Environment.GetEnvironmentVariable("KafkaConfig_OnRspCalcBondTopic");
|
||||
onRspCalcBondTopicGroupId = Environment.GetEnvironmentVariable("KafkaConfig_OnRspCalcBondTopicGroupId");
|
||||
_rspCalcBondTopicConsumer = new KafkaConsumerHelper(onRspCalcBondTopicGroupId, onRspCalcBondTopic);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_cts.Dispose();
|
||||
}
|
||||
|
||||
|
||||
public Task StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.Info("ClientBalanceTask task is starting.");
|
||||
Task.Run(() => ExecuteTask(_cts.Token), _cts.Token);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public async Task StopAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.Info("ClientBalanceTask task is stopping.");
|
||||
_cts.Cancel();
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
private void ExecuteTask(CancellationToken stoppingToken)
|
||||
{
|
||||
while (!stoppingToken.IsCancellationRequested)
|
||||
{
|
||||
try
|
||||
{
|
||||
RealtimePnlCalc.ConsumerBondCalcResp(_rspCalcBondTopicConsumer);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(ex, "收益率接收计算结果服务异常:" + ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,6 @@ internal class Program
|
||||
services.AddSingleton<IKafkaProduce,KafkaProduceHelper>();
|
||||
services.AddHostedService<ClientPosiTask>();
|
||||
services.AddHostedService<Worker>();
|
||||
services.AddHostedService<BondCalcKafkTask>();
|
||||
services.AddHostedService<ClientNoDMABalanceTask>();
|
||||
services.AddHostedService<ClientRealBalanceTask>();
|
||||
}).ConfigureLogging(logging =>
|
||||
|
||||
Reference in New Issue
Block a user