diff --git a/Framework/YLErp.Cache/YLRedisCache.cs b/Framework/YLErp.Cache/YLRedisCache.cs index aae50a6d..a927f107 100644 --- a/Framework/YLErp.Cache/YLRedisCache.cs +++ b/Framework/YLErp.Cache/YLRedisCache.cs @@ -192,8 +192,19 @@ namespace YLErp.Cache /// public bool BatchDelete(string pattern) { - var keys = QueryKeys(pattern); - return db.KeyDelete(keys.ToArray())>0; + var endpoints = _redisConnector.GetEndPoints(); // 获取所有节点 + var patterns = GenerateKey(pattern); + foreach (var endpoint in endpoints) + { + var server = _redisConnector.GetServer(endpoint); + var keys = server.Keys(pattern: patterns); + // 逐键删除(规避跨槽位) + foreach (var key in keys) + { + db.KeyDelete(key); + } + } + return true; } /// diff --git a/Framework/YLErp.Core/DBModels/ClientCashInCashOut.cs b/Framework/YLErp.Core/DBModels/ClientCashInCashOut.cs index 780b0096..2529c4bf 100644 --- a/Framework/YLErp.Core/DBModels/ClientCashInCashOut.cs +++ b/Framework/YLErp.Core/DBModels/ClientCashInCashOut.cs @@ -1,4 +1,4 @@ -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations.Schema; using YLErp.Commons; using YLErp.Helpers; @@ -205,6 +205,20 @@ namespace YLErp.DBModels /// [DisplayName("账户类型")] public string cash_type { get; set; } + + /// + /// 转出科目 + /// + [DisplayName("转出科目")] + [Column("transfer_out_account​")] + public string TransferOutAccount { get; set; } + + /// + /// 转入科目 + /// + [DisplayName("转入科目")] + [Column("transfer_in_account")] + public string TransferInAccount { get; set; } } /// /// 出入金信息 @@ -267,7 +281,7 @@ namespace YLErp.DBModels { get { - if (Direction == "出金" || Direction == "入金" || Direction == "其他收入" || Direction == "其他支出" || Direction == "应收预付金" || Direction == "实收预付金" || Direction == "实付预付金" || Direction == "实收权利金" || Direction == "实付权利金") + if (Direction == "出金" || Direction == "入金" || Direction == "其他收入" || Direction == "其他支出" || Direction == "应收预付金" || Direction == "实收预付金" || Direction == "实付预付金" || Direction == "实收权利金" || Direction == "实付权利金" || Direction == "划转") { return Direction; } diff --git a/Framework/YLErp.Core/Helpers/HttpHelper.cs b/Framework/YLErp.Core/Helpers/HttpHelper.cs index b714a0e3..bbeb9b3c 100644 --- a/Framework/YLErp.Core/Helpers/HttpHelper.cs +++ b/Framework/YLErp.Core/Helpers/HttpHelper.cs @@ -1,4 +1,4 @@ -using RestSharp; +using RestSharp; using RestSharp.Authenticators; using RestSharp.Authenticators.OAuth2; using System; @@ -95,7 +95,6 @@ namespace YLErp.Helpers // 发送请求并获取响应结果 var response = await client.ExecuteAsync>(request); var responseContent = response.Content; - return Newtonsoft.Json.JsonConvert.DeserializeObject(responseContent); } } diff --git a/YLErpDAL/AppManager.cs b/YLErpDAL/AppManager.cs index a486f9aa..0b244c2d 100644 --- a/YLErpDAL/AppManager.cs +++ b/YLErpDAL/AppManager.cs @@ -78,7 +78,7 @@ namespace YLErp setEnvironment(new[] { "KafkaConfig" }, "_"); setEnvironment(new[] { "BondOmsInterface" }, "_"); setEnvironment(new[] { "OrcaleDatabaseConfig" }, "_"); - Environment.SetEnvironmentVariable("MaxThreadPercent", configuration["MaxThreadPercent"]); + Environment.SetEnvironmentVariable("Reg_Report_Url", configuration["Reg_Report_Url"]); //用于必须引入程序集System.Numerics.Vectors _ = System.Numerics.Vector.Zero; diff --git a/YLErpDAL/BLL/EodSettlement/RealTimeClientBanlanceService.cs b/YLErpDAL/BLL/EodSettlement/RealTimeClientBanlanceService.cs index 7abecc2a..e60beb81 100644 --- a/YLErpDAL/BLL/EodSettlement/RealTimeClientBanlanceService.cs +++ b/YLErpDAL/BLL/EodSettlement/RealTimeClientBanlanceService.cs @@ -230,7 +230,6 @@ namespace YLErp.BLL.Eod //SetDebugSqlLog(); Dictionary dicIntradayTradePosition = DbContext.intraday_trade_position.Where(x => clientIds.Contains(x.ClientId)).AsEnumerable().GroupBy(p => p.ClientId).Select(p => new { p.Key, OptDate = p.Max(d => d.OptDate) }) .ToDictionary(p => p.Key, p => p.OptDate); - Dictionary dicCashInOut = DbContext.ClientCashInCashOut.Where(x => clientIds.Contains((int)x.ClientId)).AsEnumerable().GroupBy(p => (int)p.ClientId).Select(p => new { p.Key, OptDate = p.Max(d => d.OptDate) }).ToDictionary(p => p.Key, p => p.OptDate); foreach (var item in _clientBalanceDic.Values) { @@ -256,7 +255,7 @@ namespace YLErp.BLL.Eod item.LastDayRemainFundWithProduct = item.LastDayRemainFund + item.LastGuaranteesTotalAmount; //当前账号资金 - item.AmountFund = item.AmountFund + item.NetFund + item.OtherFund + item.OptionPremium + item.OptionPremiumSwap + item.SwapBalance + item.SettlementBalance+ item.VmInFund-item.VmOutFund; + item.AmountFund = item.AmountFund + item.NetFund + item.OtherFund + item.VmInFund-item.VmOutFund+item.WinLoss; item.WinLoss += item.WinLoss2; @@ -268,7 +267,7 @@ namespace YLErp.BLL.Eod //预付金金额=期末结存-初始预付金金额 item.MarginBalance = item.AmountFund - item.MySideMargin; // 可用资金 = 期末结存 - 追保账户余额 - 初始保证金 - item.AvailableAmount = item.MarginBalance - (item.VmInFundSum - item.VmOutFundSum) - item.FrozenMarginMoney; + item.AvailableAmount = item.MarginBalance - item.FrozenMarginMoney; // 是否追保=盯市金额小于维持保证金额 item.NeedAddMargin = item.SwapMarketAmount < item.MaintenanceMargin; // 追保金额=初始保证金金额-盯市金额 @@ -1065,7 +1064,7 @@ namespace YLErp.BLL.Eod from td in trade.DefaultIfEmpty() where t.HappenDate >= lastSettletDateAddOne && t.HappenDate < newValuedate && t.ValidState != "InValid" - && (t.State == ClientCashInCashOut.已结算 || t.State == ClientCashInCashOut.已确认 || (t.Direction == "出金" && ClientCashInCashOut.outCashCals.Contains(t.State))) + && (t.State == ClientCashInCashOut.已结算 || t.State == ClientCashInCashOut.已确认 || ((t.Direction == "出金"||t.Direction=="划转") && ClientCashInCashOut.outCashCals.Contains(t.State))) && clientIds.Contains(t.ClientId.Value) && t.Money != null && td.TradeType != "收益互换" @@ -1075,19 +1074,23 @@ namespace YLErp.BLL.Eod TradeId = t.TradeId ?? 0, action = t.Direction + "^" + (t.Direction == "应收" ? t.Action : ""), money = t.Money.Value, - cash_type = t.cash_type + cash_type = t.cash_type, + TransferOutAccount=t.TransferOutAccount, + TransferInAccount = t.TransferInAccount }; //获取包含的所有收益互换id列表 var allTradeIds = ClientCashQuery.Select(x => x.TradeId).ToList(); var ClientCashQuerySum = from t in ClientCashQuery - group t by new { t.ClientId, t.action, t.cash_type } into g + group t by new { t.ClientId, t.action, t.cash_type,t.TransferOutAccount,t.TransferInAccount } into g select new { g.Key.ClientId, g.Key.action, g.Key.cash_type, + g.Key.TransferOutAccount, + g.Key.TransferInAccount, moneySum = g.Sum(n => n.money), swapMoneySun = 0.0 }; @@ -1150,6 +1153,45 @@ namespace YLErp.BLL.Eod { balance.OutFundOther = data.moneySum; } + else if (data.action == "划转^") + { + if (data.TransferOutAccount == "初保账户") + { + balance.InFund -= data.moneySum; + if (data.TransferInAccount == "追保账户") + { + balance.VmInFund += data.moneySum; + } + else + { + balance.WinLoss += data.moneySum; + } + } + else if (data.TransferOutAccount == "追保账户") + { + balance.VmInFund -= data.moneySum; + if (data.TransferInAccount == "初保账户") + { + balance.InFund += data.moneySum; + } + else + { + balance.WinLoss += data.moneySum; + } + } + else + { + balance.WinLoss -= data.moneySum; + if (data.TransferInAccount == "初保账户") + { + balance.InFund += data.moneySum; + } + else + { + balance.VmInFund += data.moneySum; + } + } + } } diff --git a/YLErpDAL/BLL_System/ViewUser.cs b/YLErpDAL/BLL_System/ViewUser.cs index 4179b09e..319e62bb 100644 --- a/YLErpDAL/BLL_System/ViewUser.cs +++ b/YLErpDAL/BLL_System/ViewUser.cs @@ -17,6 +17,7 @@ namespace BaseOUDAL get { if (State == 0) return "正常"; + if (State == 2) return "已注销"; return "禁用"; } } diff --git a/YLErpDAL/Modules/ApiModule/HttpClientWrap.cs b/YLErpDAL/Modules/ApiModule/HttpClientWrap.cs index bfa45e77..6a4ebcf6 100644 --- a/YLErpDAL/Modules/ApiModule/HttpClientWrap.cs +++ b/YLErpDAL/Modules/ApiModule/HttpClientWrap.cs @@ -1,6 +1,7 @@ using System.Net; using System.Net.Http; using System.Net.Http.Headers; +using System.Text; namespace YLErp.Modules.ApiModule { @@ -83,7 +84,7 @@ namespace YLErp.Modules.ApiModule public string PostJson(string apiPath, object postData, Action requestHandle) { var str = JsonHelper.Serialize(postData) ?? string.Empty; - using (var content = new StringContent(str)) + using (var content = new StringContent(str, Encoding.UTF8, "application/json")) using (var request = new HttpRequestMessage() { Method = HttpMethod.Post, @@ -93,7 +94,7 @@ namespace YLErp.Modules.ApiModule { request.Headers.Add("Accept-Encoding", "gzip"); requestHandle?.Invoke(request); - content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); + // content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); LogFactory.GetLogger().Info($"url:{apiPath}\r\npostData:{str}\r\n{content.ToJson()}"); try { diff --git a/YLErpDAL/Modules/ClientModule/ClientCashInCashOutDataService.cs b/YLErpDAL/Modules/ClientModule/ClientCashInCashOutDataService.cs index cb899926..ccdad4d4 100644 --- a/YLErpDAL/Modules/ClientModule/ClientCashInCashOutDataService.cs +++ b/YLErpDAL/Modules/ClientModule/ClientCashInCashOutDataService.cs @@ -602,6 +602,8 @@ namespace YLErp.Modules.ClientModule r.CurrencyCode = req.CurrencyCode; r.cash_type = req.cash_type; r.ValidState = ConsGlobal.Valid; + r.TransferOutAccount = req.TransferOutAccount; + r.TransferInAccount = req.TransferInAccount; } if (isARAP) @@ -696,7 +698,34 @@ namespace YLErp.Modules.ClientModule } #endregion - + #region 划转资金时进行验资 + if ("划转".Equals(r.Direction)) + { + var clientbalance = ClientBalanceUtility.GetClientBanlances(new List { r.ClientId.Value }, DateTime.MinValue, DateTime.Now.Date).FirstOrDefault(); + if (clientbalance == null) + { + throw new ServiceException("查询客户资金信息失败"); + } + var money = r.Money ?? 0; + money=isAddNew? money: money-(originalMoney??0); + var netFundAll = Math.Round(clientbalance.NetFundAll,2,MidpointRounding.AwayFromZero); + var vmFundSum = Math.Round(clientbalance.VmFundSum,2,MidpointRounding.AwayFromZero); + var winLoss = Math.Round(clientbalance.WinLoss,2,MidpointRounding.AwayFromZero); + if (r.TransferOutAccount == "初保账户" && money > netFundAll) + { + throw new ServiceException("划转金额不能超过初保账户金额"); + } + if (r.TransferOutAccount == "追保账户" && money > vmFundSum) + { + throw new ServiceException("划转金额不能超过追保账户金额"); + } + if (r.TransferOutAccount == "已实现盈亏" && money > winLoss) + { + throw new ServiceException("划转金额不能超过已实现盈亏"); + } + r.cash_type = null; + } + #endregion if (r.Direction != "出金" && r.Direction != "入金") { r.OpenBank = null; diff --git a/YLErpDAL/Modules/ClientModule/EntryexitBLL.cs b/YLErpDAL/Modules/ClientModule/EntryexitBLL.cs index f6cd93e1..bd3bba02 100644 --- a/YLErpDAL/Modules/ClientModule/EntryexitBLL.cs +++ b/YLErpDAL/Modules/ClientModule/EntryexitBLL.cs @@ -18,8 +18,9 @@ namespace YLErp.BLL /// 系统中可以操作的方向 /// public static List EntryDirection_Remove = new List { "收入", "支出" }; - public static List EntryDirection_Menu = new List { "出金", "入金", "其他收入", "其他支出" }; - public static List DirectionType = new List { "出金", "入金", "权利金支出", "权利金收入", "平仓/行权支出", "平仓/行权收入", "票息支出", "票息收入", "其他支出", "其他收入", "互换收入", "互换支出","应付预付金","预付金返息" }; + public static List EntryDirection_Menu = new List { "出金", "入金", "其他收入", "其他支出","划转" }; + public static List TransferAccount = new List { "初保账户", "追保账户", "已实现盈亏" }; + public static List DirectionType = new List { "出金", "入金", "划转", "权利金支出", "权利金收入", "平仓/行权支出", "平仓/行权收入", "票息支出", "票息收入", "其他支出", "其他收入", "互换收入", "互换支出","应付预付金","预付金返息" }; /// /// 现金交易方向 /// diff --git a/YLErpDAL/Modules/DataCacheModule/DBCacheManager.cs b/YLErpDAL/Modules/DataCacheModule/DBCacheManager.cs index 8e288b79..059ce027 100644 --- a/YLErpDAL/Modules/DataCacheModule/DBCacheManager.cs +++ b/YLErpDAL/Modules/DataCacheModule/DBCacheManager.cs @@ -69,7 +69,7 @@ namespace YLErp.Modules.DataCacheModule } } - public string GetStr(string key, string template = "Ĭ") + public string GetStr(string key, string template = "默认") { if (string.IsNullOrEmpty(key)) { @@ -93,7 +93,7 @@ namespace YLErp.Modules.DataCacheModule } } - public void UpdateObj(string key, string value, string template = "Ĭ") + public void UpdateObj(string key, string value, string template = "默认") { if (string.IsNullOrEmpty(key)) { @@ -121,7 +121,7 @@ namespace YLErp.Modules.DataCacheModule /// Type /// The key of the value to get. /// The value associated with the specified key. - public virtual T Get(string key, string template = "Ĭ") where T : new() + public virtual T Get(string key, string template = "默认") where T : new() { if (!string.IsNullOrEmpty(key) && CacheDic.TryGetValue(key + template, out CacheTable ca)) { @@ -136,7 +136,7 @@ namespace YLErp.Modules.DataCacheModule /// key /// Data /// Cache time - public virtual void Set(string key, object data, int cacheTime = CacheTimeout, string template = "Ĭ") + public virtual void Set(string key, object data, int cacheTime = CacheTimeout, string template = "默认") { if (string.IsNullOrEmpty(key) || data == null) { @@ -180,7 +180,7 @@ namespace YLErp.Modules.DataCacheModule /// /// key /// Result - public virtual bool IsSet(string key, string template = "Ĭ") + public virtual bool IsSet(string key, string template = "默认") { return !string.IsNullOrEmpty(key + template) && CacheDic.ContainsKey(key + template); } @@ -189,7 +189,7 @@ namespace YLErp.Modules.DataCacheModule /// Removes the value with the specified key from the cache /// /// /key - public virtual void Remove(string key, string template = "Ĭ") + public virtual void Remove(string key, string template = "默认") { if (string.IsNullOrEmpty(key)) { @@ -214,11 +214,11 @@ namespace YLErp.Modules.DataCacheModule List fliterList = new List(); switch (reportType) { - case "ϸ": fliterList = TradeDetailReport; break; - case "ϸ": fliterList = TradeSwapDetailReport; break; - case "㱨": fliterList = ClientBalanceReport; break; + case "交易明细": fliterList = TradeDetailReport; break; + case "互换明细": fliterList = TradeSwapDetailReport; break; + case "结算报告": fliterList = ClientBalanceReport; break; default: - throw new ServiceException("ı"); + throw new ServiceException("错误的报告类型"); } using (ErpBaseContext db = new ErpBaseContext()) { @@ -231,11 +231,11 @@ namespace YLErp.Modules.DataCacheModule List fliterList = new List(); switch (reportType) { - case "ϸ": fliterList = TradeDetailReport; break; - case "ϸ": fliterList = TradeSwapDetailReport; break; - case "㱨": fliterList = ClientBalanceReport; break; + case "交易明细": fliterList = TradeDetailReport; break; + case "互换明细": fliterList = TradeSwapDetailReport; break; + case "结算报告": fliterList = ClientBalanceReport; break; default: - throw new ServiceException("ı"); + throw new ServiceException("错误的报告类型"); } using (ErpBaseContext db = new ErpBaseContext()) { @@ -247,7 +247,7 @@ namespace YLErp.Modules.DataCacheModule } else { - throw new ServiceException(" " + needDel + " ģ"); + throw new ServiceException("不存在 " + needDel + " 模板"); } } } diff --git a/YLErpDAL/Modules/EodModule/SettlementModule/EodClientBalanceCalc.cs b/YLErpDAL/Modules/EodModule/SettlementModule/EodClientBalanceCalc.cs index 102162b0..207d5eea 100644 --- a/YLErpDAL/Modules/EodModule/SettlementModule/EodClientBalanceCalc.cs +++ b/YLErpDAL/Modules/EodModule/SettlementModule/EodClientBalanceCalc.cs @@ -1,4 +1,5 @@ -using Newtonsoft.Json; +using DocumentFormat.OpenXml.Drawing.Charts; +using Newtonsoft.Json; using NPOI.SS.Formula.Functions; using NPOI.SS.UserModel; using Org.BouncyCastle.Asn1.Ocsp; @@ -525,6 +526,53 @@ namespace YLErp.Modules.EodModule.SettlementModule fundObject.OtherFund.Add(clientEntryexit.CurrencyCode, clientEntryexit.Money ?? 0); } } + else if (clientEntryexit.Direction.Equals("划转")) { + if (clientEntryexit.TransferOutAccount == "初保账户") + { + AddToFund(fundObject.InFund, clientEntryexit.CurrencyCode, -clientEntryexit.Money ?? 0); + // 更新 NetFund + AddToFund(fundObject.NetFund, clientEntryexit.CurrencyCode, -clientEntryexit.Money ?? 0); + if (clientEntryexit.TransferInAccount == "追保账户") + { + AddToFund(fundObject.VmInFund, clientEntryexit.CurrencyCode, clientEntryexit.Money ?? 0); + } + else + { + WinLoss += clientEntryexit.Money ?? 0; + CurrChangeAmount += clientEntryexit.Money ?? 0; + } + } + else if (clientEntryexit.TransferOutAccount == "追保账户") + { + AddToFund(fundObject.VmInFund, clientEntryexit.CurrencyCode, -clientEntryexit.Money ?? 0); + if (clientEntryexit.TransferInAccount == "初保账户") + { + AddToFund(fundObject.InFund, clientEntryexit.CurrencyCode, clientEntryexit.Money ?? 0); + // 更新 NetFund + AddToFund(fundObject.NetFund, clientEntryexit.CurrencyCode, clientEntryexit.Money ?? 0); + } + else + { + WinLoss += clientEntryexit.Money ?? 0; + CurrChangeAmount += clientEntryexit.Money ?? 0; + } + } + else + { + WinLoss -= clientEntryexit.Money ?? 0; + CurrChangeAmount -= clientEntryexit.Money ?? 0; + if (clientEntryexit.TransferInAccount == "初保账户") + { + AddToFund(fundObject.InFund, clientEntryexit.CurrencyCode, clientEntryexit.Money ?? 0); + // 更新 NetFund + AddToFund(fundObject.NetFund, clientEntryexit.CurrencyCode, clientEntryexit.Money ?? 0); + } + else + { + AddToFund(fundObject.VmInFund, clientEntryexit.CurrencyCode, clientEntryexit.Money ?? 0); + } + } + } else { if (ClientCashInCashOut.系统操作_期权费.Equals(clientEntryexit.Action)) diff --git a/YLErpDAL/Modules/SuperviseReportModule/ExtendReport/ExtendReportBaseService.cs b/YLErpDAL/Modules/SuperviseReportModule/ExtendReport/ExtendReportBaseService.cs index 7581a03a..f7461754 100644 --- a/YLErpDAL/Modules/SuperviseReportModule/ExtendReport/ExtendReportBaseService.cs +++ b/YLErpDAL/Modules/SuperviseReportModule/ExtendReport/ExtendReportBaseService.cs @@ -3,6 +3,7 @@ using YLErp.Model; using YLErp.Modules.SuperviseReportModule.ExtendReport.Common; using YLErp.Modules.SuperviseReportModule.ExtendReport.GeLin; using YLErp.Modules.SuperviseReportModule.ExtendReport.ZheQi; +using YLErp.Modules.SuperviseReportModule.ExtendReport.ZheShang; namespace YLErp.Modules.SuperviseReportModule.ExtendReport { @@ -48,6 +49,9 @@ namespace YLErp.Modules.SuperviseReportModule.ExtendReport case "客户资金记录报表": service = new CustomerFundsReport(optUser, req); break; + case "月报基础数据债券收益互换": + service = new SwapTradeMothReport(optUser, req); + break; default: throw new ServiceException("报表未实现"); } diff --git a/YLErpDAL/Modules/SuperviseReportModule/ExtendReport/ZheShang/SwapTradeMothReport.cs b/YLErpDAL/Modules/SuperviseReportModule/ExtendReport/ZheShang/SwapTradeMothReport.cs new file mode 100644 index 00000000..639e6304 --- /dev/null +++ b/YLErpDAL/Modules/SuperviseReportModule/ExtendReport/ZheShang/SwapTradeMothReport.cs @@ -0,0 +1,70 @@ +using BaseOUDAL; +using CsvHelper; +using Org.BouncyCastle.Ocsp; +using Qdp.Foundation.Utilities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using YLErp.DBModels; +using YLErp.DBModels.Consts; +using YLErp.DBModels.Enums; +using YLErp.Helpers; +using YLErp.Model; +using YLErp.Modules.SuperviseReportModule.ExtendReport.ZheQi; + +namespace YLErp.Modules.SuperviseReportModule.ExtendReport.ZheShang +{ + public class SwapTradeMothReport: SimpleExtendReportBaseService + { + public SwapTradeMothReport(OptUserInfo userInfo, SuperviseReportReq req) : base(userInfo, req) + { + } + public override string TemplateName => "月报基础数据债券收益互换.xlsx"; + public override string TargetFileName => "月报基础数据债券收益互换"+ base.RequestInfo.ValueDate.ToString("yyyyMM") +".xlsx"; + public override Dictionary SearchReportInfo() + { + var yearMonth = RequestInfo.ValueDate.ToString("yyyy-MM-dd"); + var dealList = new List(); + var addList= new List(); + var reportData = GetSwapMonthReport(yearMonth); + if (reportData != null) + { + if (reportData.DealList != null && reportData.DealList.Count > 0) + { + dealList = reportData.DealList; + } + if (reportData.AddList != null && reportData.AddList.Count > 0) + { + addList = reportData.AddList; + } + } + return new Dictionary() { + {"本月新增业务明细", addList}, + {"本月末存量业务明细", dealList} + }; + } + + private SwapTradeMothReportModelList GetSwapMonthReport(string yearMonth) + { + var baseUrl = Environment.GetEnvironmentVariable("Reg_Report_Url"); + var calculateUrl = "/swap-trade/month-report?date="+yearMonth; + LogFactory.GetLogger("SwapTradeMothReport").Info("获取收益互换月报信息地址:" + baseUrl+ calculateUrl); + if (!string.IsNullOrEmpty(baseUrl)) + { + var httpHelper = new HttpHelper(baseUrl, null); + var result = httpHelper.GetRequestNoAuth< SwapTradeMothReportModelListReponse>(calculateUrl).Result; + if (result != null && !result.success) + { + LogFactory.GetLogger("SwapTradeMothReport").Info("获取收益互换月报信息失败:" + result.message); + } + else + { + return result.data; + } + } + return null; + } + } +} diff --git a/YLErpDAL/Modules/SuperviseReportModule/ExtendReport/ZheShang/SwapTradeMothReportModel.cs b/YLErpDAL/Modules/SuperviseReportModule/ExtendReport/ZheShang/SwapTradeMothReportModel.cs new file mode 100644 index 00000000..5c201486 --- /dev/null +++ b/YLErpDAL/Modules/SuperviseReportModule/ExtendReport/ZheShang/SwapTradeMothReportModel.cs @@ -0,0 +1,127 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using YLErp.Models; + +namespace YLErp.Modules.SuperviseReportModule.ExtendReport.ZheShang +{ + public class SwapTradeMothReportModel + { + /// + /// 报送机构名称(全称) + /// + public string NameOfSecuritiesCompany { get; set; } + + /// + /// 交易对手方名称(全称) + /// + public string NameOfCounterparty { get; set; } + + /// + /// 交易对手产品名称 + /// + public string NameOfCounterpartyProduct { get; set; } + + /// + /// 交易确认书编号(报告库编号) + /// + public string TransactionConfirmationNumber { get; set; } + + /// + /// 业务类型 (如场外期权/收益互换) + /// + public string BusinessType { get; set; } + + /// + /// 名义本金/多头名义本金 (元) + /// + public decimal? NotionalPrincipalAmountL { get; set; } + + /// + /// 空头名义本金(元) (多空组合填写) + /// + public decimal? SNotionalPrincipalAmount { get; set; } + + /// + /// 起始日(T日) + /// + public string StartDay { get; set; } + + /// + /// 到期日 + /// + public string DueDate { get; set; } + + /// + /// 标的类型 + /// + public string SumInvestmentTargetType { get; set; } + + /// + /// 标的名称 + /// + public string UndrlygAssetName { get; set; } + + /// + /// 标的编码 + /// + public string UndrlygAssetCode { get; set; } + + /// + /// 标的交易场所 + /// + public string UndrlygAssetTradgPlc { get; set; } + + /// + /// 场外期权标的小类 (当业务类型为场外期权时填写) + /// + public string OptionSumInvestmentTargetType { get; set; } + + /// + /// 收益互换标的小类 (当业务类型为收益互换时填写) + /// + public string ExchangeSumInvestmentTargetType { get; set; } + + /// + /// 期权费(非年化)(%) (场外期权填写) + /// + public decimal? OptionFee { get; set; } + + /// + /// 期权类型 (场外期权填写) + /// + public string OptionType { get; set; } + + /// + /// 本月末维持保证金比例(%) + /// + public string MaitainMarginRation { get; set; } + + /// + /// 标的相关系数 (特殊字段,根据备注"不填"处理) + /// + public decimal? CorrelationCoefficient { get; set; } = null; + + /// + /// 多头合约价值(元) + /// + public decimal? LongPositionContractValue { get; set; } + + /// + /// 空头合约价值(元) + /// + public decimal? ShortPositionContractValue { get; set; } + } + public class SwapTradeMothReportModelListReponse : ApiResponse + { + public SwapTradeMothReportModelList data { get; set; } + } + + public class SwapTradeMothReportModelList + { + public List DealList { get; set; } + public List AddList { get; set; } + } +} diff --git a/YLErpDAL/Modules/TradeModule/TradeOAService.cs b/YLErpDAL/Modules/TradeModule/TradeOAService.cs index d1418c2d..7c8b0a72 100644 --- a/YLErpDAL/Modules/TradeModule/TradeOAService.cs +++ b/YLErpDAL/Modules/TradeModule/TradeOAService.cs @@ -1,3 +1,5 @@ +using BaseOUDAL; +using NPOI.SS.Formula.Functions; using Qdp.Foundation.Utilities; using YLErp.DBModels; using YLErp.DBModels.Consts; @@ -77,7 +79,8 @@ namespace YLErp.Modules.TradeModule { oaResult.status = "提交成功"; oaResult.oa_fileid = oaResp.data?.fileid; - oaResult.oa_msg = oaResp.data?.url; + oaResult.oa_msg = oaResp.message; + oaResult.oa_url = oaResp.data?.url; } else { @@ -110,7 +113,11 @@ namespace YLErp.Modules.TradeModule // 获取OA配置 var oaConfigSection = AppManager.GetConfiguration().GetSection("oa_confg"); var baseUrl = oaConfigSection["BaseUrl"]; - var loginName = UserInfo.OaAccount; + var loginName = string.Empty; + using (var adminDb = new ErpBaseContext()) { + var userInfo=adminDb.SystemUsers.FirstOrDefault(x=>x.Id==UserInfo.UserId); + loginName= userInfo?.OaAccount; + } var systemKey = oaConfigSection["SystemKey"]; var objectClass = oaConfigSection["ObjectClass"]; var urgent = int.Parse(oaConfigSection["Urgent"] ?? "1"); @@ -192,25 +199,34 @@ namespace YLErp.Modules.TradeModule if (totalNotionalPrincipal > 0) { decimal weightedMarginSum = 0; - decimal totalCount = 0; foreach (var t in matchingPositions) { var marginDetail = UnderlyingHelper.GetApplicableMarginRate(t.ClientId, t.UnderlyingCode, t.TradeDate.Value); var rate = marginDetail?.init_rate ?? 0; weightedMarginSum += rate*Convert.ToDecimal(t.OriginalStockEqvNotional); - totalCount+= Convert.ToDecimal(t.OriginalStockEqvNotional); } - marginRate = weightedMarginSum / totalCount; - marginRate=Math.Round(marginRate, 4); // 保留四位小数 + marginRate = weightedMarginSum / Convert.ToDecimal(totalNotionalPrincipal); + // marginRate=Math.Round(marginRate, 4); // 保留四位小数 } var posiTypeStr = currentPositionType == (int)PositionTypeFlag.Long ? "买入" : "卖出"; + string bgContent = @$"

各位领导:

+

经友好协商,我司拟与交易对手开展以下场外利率收益互换交易:

+

浮动收益交付方: 浙商证券

+

存款收益接收方: {trade.ClientName}

+

标的: {trade.UnderlyingInstrumentTypeCn}

+

方向: {posiTypeStr}

+

起始日: {trade.StartDate?.ToString("yyyy/M/d")}

+

到期日: {exerciseDate?.ToString("yyyy/M/d")}

+

合约名义本金: {totalNotionalPrincipal:N0}元

+

保证金支付方: {trade.ClientName}

+

交易标的满足浙商证券标的池管理要求,交易对手方为非交易商,提供【{(marginRate*100).ToString("0.##")}%】名义本金的履约担保品作为初始保证金。保证金预警线与盯市追保符合内外规要求。

"; // 构建OA请求参数 var oaRequest = new { loginname = loginName, systemkey = systemKey, objectclass = objectClass, - title = $"交易确认书OA申请-{trade.ClientName}-{contractCode}", + title = $"关于场外利率债收益互换交易的审批盖章申请({trade.TradeDate.Value.ToString("yyyyMMdd")}-{trade.ClientName})", urgent = urgent, issend = issend, copyattfileid = "", @@ -229,7 +245,7 @@ namespace YLErp.Modules.TradeModule CKDX1 = "", CKDX2 = "", LB = "", - QSBGNR = $"各位领导:\n\t\t经友好协商,我司拟与交易对手开展以下场外利率收益互换交易:\n浮动收益交付方\t存款收益接收方\t标的\t方向\t起始日\t到期日\t合约名义本金\t保证金支付方\n浙商证券\t{trade.ClientName}\t{trade.UnderlyingInstrumentTypeCn}\t{posiTypeStr}\t{trade.StartDate?.ToString("yyyy/M/d")}\t{exerciseDate?.ToString("yyyy/M/d")}\t{totalNotionalPrincipal:N0}元\t{trade.ClientName}\n交易标的满足浙商证券标的池管理要求,交易对手方为非交易商,提供【{(marginRate*100).ToString("0.##")}%】名义本金的履约担保品作为初始保证金。保证金预警线与盯市追保符合内外规要求。", + QSBGNR = bgContent, MX = new object[0], SQMX = new object[0] }, @@ -239,7 +255,7 @@ namespace YLErp.Modules.TradeModule logger.Info($"OA接口参数:{JsonHelper.Serialize(oaRequest)}"); // 调用OA接口 var httpClient = new HttpClientWrap(baseUrl); - var response = httpClient.PostJson("/fileDraft", oaRequest, null); + var response = httpClient.PostJson("/ZSZQ/fileDraft", oaRequest, null);// fileDraft logger.Info($"OA接口返回:{response}"); // 解析响应 var responseObj = JsonHelper.Deserialize(response); diff --git a/YLErpWeb/App/Startup.cs b/YLErpWeb/App/Startup.cs index f2a3e36d..a1b8d0b1 100644 --- a/YLErpWeb/App/Startup.cs +++ b/YLErpWeb/App/Startup.cs @@ -53,14 +53,11 @@ namespace YLErp.Web GlobalConfig.EnableExtendSetting = true; GlobalConfig.ProjectTitle = "场外衍生品业务管理系统"; break; - case Configuration.CompanyEnum.浙期: + case Configuration.CompanyEnum.浙商: + GlobalConfig.ExtendReportType.Add("月报基础数据债券收益互换", 2); + break; case Configuration.CompanyEnum.方顿: - - if (PS.Config.Company == Configuration.CompanyEnum.浙期) - { - GlobalConfig.ExtendReportType.Add("成交明细汇总", 1); - } - GlobalConfig.ExtendReportType.Add("风险资本准备计算表", 1); + GlobalConfig.ExtendReportType.Add("风险资本准备计算表", 1); break; case Configuration.CompanyEnum.格林大华: GlobalConfig.ExtendReportType.Add("客户持仓信息", 3); diff --git a/YLErpWeb/App_Data/Menus.txt b/YLErpWeb/App_Data/Menus.txt index a24c4bdd..59ada860 100644 --- a/YLErpWeb/App_Data/Menus.txt +++ b/YLErpWeb/App_Data/Menus.txt @@ -25,6 +25,7 @@ {Name:"交易确认书",Rights:["结算管理-交易确认书"],Url:"TradeConfirmBook/ConfirmBookListByClient"}, {Name:"结算确认书",Rights:["结算管理-结算确认书"],Url:"swaptrade2/tradeEndConfirmList"}, {Name:"每日估值报告",Rights:["结算管理-每日估值报告"],Url:"clientbalance/TradeMarketReport"}, + {Name:"其他报告",Rights:["结算管理-其他报告"],Url:"supervise_report/ExtendReport"}, ] }, {Name:"监管报告",Rights:["监管报告"],Icon:"menu-icon iconteleven" diff --git a/YLErpWeb/App_Docs/导出模板/月报基础数据债券收益互换.xlsx b/YLErpWeb/App_Docs/导出模板/月报基础数据债券收益互换.xlsx new file mode 100644 index 00000000..b15735e1 Binary files /dev/null and b/YLErpWeb/App_Docs/导出模板/月报基础数据债券收益互换.xlsx differ diff --git a/YLErpWeb/Controllers/SystemController.cs b/YLErpWeb/Controllers/SystemController.cs index 06118809..5b7d0681 100644 --- a/YLErpWeb/Controllers/SystemController.cs +++ b/YLErpWeb/Controllers/SystemController.cs @@ -1,11 +1,22 @@ -using Dapper; +using BaseOUDAL; +using Dapper; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Rendering; +using Microsoft.EntityFrameworkCore; using Newtonsoft.Json; +using Org.BouncyCastle.Asn1.Ocsp; +using System; +using System.Collections.Generic; using System.Data; +using System.Linq; using YLErp.Abstract; using YLErp.BLL; +using YLErp.DBModels; using YLErp.DBModels.Consts; using YLErp.Modules.DictionaryModule; using YLErp.Modules.SystemModule; +using YLErp.Web.Models; namespace YLErp.Web.Controllers { @@ -667,7 +678,7 @@ namespace YLErp.Web.Controllers r.Password = null; return View(r); } - + [MyAuthorize("系统管理-用户管理")] public ActionResult UserLevelView(int id) { @@ -852,6 +863,15 @@ namespace YLErp.Web.Controllers } } + public JsonResult accountDelete(int accountIds) + { + var r = basedb.SystemUsers.Find(accountIds); + r.State = 2; + basedb.SaveChanges(); + new SysUserService(CurUser).UpdateState(accountIds, 2); + return JsonSuccess("注销账户成功", r); + } + public JsonResult accountAble(int accountIds) { var r = basedb.SystemUsers.Find(accountIds); diff --git a/YLErpWeb/Controllers/entryexitController.cs b/YLErpWeb/Controllers/entryexitController.cs index c0b25fda..3ff952e6 100644 --- a/YLErpWeb/Controllers/entryexitController.cs +++ b/YLErpWeb/Controllers/entryexitController.cs @@ -354,7 +354,7 @@ namespace YLErp.Web.Controllers { return JsonError("找不到出入金信息"); } - if (r.Direction != "出金" && r.Direction != "入金" && r.Direction != "其他收入" && r.Direction != "其他支出") + if (r.Direction != "出金" && r.Direction != "入金" && r.Direction != "其他收入" && r.Direction != "其他支出" && r.Direction != "划转") { return JsonError("该笔交易不可以删除"); } diff --git a/YLErpWeb/Controllers/supervise_reportController.cs b/YLErpWeb/Controllers/supervise_reportController.cs index d4488948..6b54a5cb 100644 --- a/YLErpWeb/Controllers/supervise_reportController.cs +++ b/YLErpWeb/Controllers/supervise_reportController.cs @@ -1394,7 +1394,7 @@ namespace YLErp.Web.Controllers { Directory.CreateDirectory(targetPath); } - + ExcelPackage.LicenseContext= LicenseContext.NonCommercial; var targetFileName = Path.Combine(targetPath, service.TargetFileName); var path = ExcelTemplate.GeneratePDFFromExeclTemplate(sourcePath, sourceFileName, modelDict, targetPath, targetFileName, null, null, null, false); diff --git a/YLErpWeb/Properties/launchSettings.json b/YLErpWeb/Properties/launchSettings.json index 6b0464ba..be61e851 100644 --- a/YLErpWeb/Properties/launchSettings.json +++ b/YLErpWeb/Properties/launchSettings.json @@ -5,7 +5,7 @@ "launchBrowser": true, "launchUrl": "http://localhost:49462", "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "local" + "ASPNETCORE_ENVIRONMENT": "dev" }, "applicationUrl": "http://localhost:49462" } diff --git a/YLErpWeb/Views/SwapTrade2/SwapflowList.cshtml b/YLErpWeb/Views/SwapTrade2/SwapflowList.cshtml index 5961c843..a8f37f02 100644 --- a/YLErpWeb/Views/SwapTrade2/SwapflowList.cshtml +++ b/YLErpWeb/Views/SwapTrade2/SwapflowList.cshtml @@ -243,7 +243,7 @@
- +
@*
diff --git a/YLErpWeb/Views/System/UserEdit.cshtml b/YLErpWeb/Views/System/UserEdit.cshtml index 85e60d8a..0689f9c8 100644 --- a/YLErpWeb/Views/System/UserEdit.cshtml +++ b/YLErpWeb/Views/System/UserEdit.cshtml @@ -169,7 +169,7 @@
- @Html.DropDownListFor(model => model.State, new SelectListItem[] { new SelectListItem { Text = "正常", Value = "0" }, new SelectListItem { Text = "禁用", Value = "1" } }) + @Html.DropDownListFor(model => model.State, new SelectListItem[] { new SelectListItem { Text = "正常", Value = "0" }, new SelectListItem { Text = "禁用", Value = "1" }, new SelectListItem { Text = "已注销", Value = "2" } })
diff --git a/YLErpWeb/Views/System/UserIndex.cshtml b/YLErpWeb/Views/System/UserIndex.cshtml index a012d7be..243d23f7 100644 --- a/YLErpWeb/Views/System/UserIndex.cshtml +++ b/YLErpWeb/Views/System/UserIndex.cshtml @@ -11,7 +11,7 @@ }; } -@section JS{ +@section JS { + } -
- - -
- @Html.SearchDate("ValueDate", "日期") -
-
- @Html.ShortInput("ValueMonthly", "月份") -
-
- @Html.SearchDate("StartDate", "开始日期")@Html.SearchDate("EndDate", "结束日期") -
-
- @Html.SearchDateRange("ValueDate1", "发生时间") - @Html.MyAceDropdownInput("ClientId", "客户名称", CurUser.GetClientSelectItems(),false) -
- @MyControls.Btn("导出", "exportToFile()") +
+ + +
+ @Html.SearchDate("ValueDate", "日期")
+
+ + +
+
+ @Html.SearchDate("StartDate", "开始日期")@Html.SearchDate("EndDate", "结束日期") +
+ @MyControls.Btn("导出", "exportToFile()") +
diff --git a/YLErpWeb/YLErpWeb.csproj b/YLErpWeb/YLErpWeb.csproj index 7b0a1442..b637f139 100644 --- a/YLErpWeb/YLErpWeb.csproj +++ b/YLErpWeb/YLErpWeb.csproj @@ -106,6 +106,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest diff --git a/YLErpWeb/appsettings.dev.json b/YLErpWeb/appsettings.dev.json index 8d34d9d8..9e1f16d1 100644 --- a/YLErpWeb/appsettings.dev.json +++ b/YLErpWeb/appsettings.dev.json @@ -7,11 +7,10 @@ }, "AllowedHosts": "*", "ConnectionStrings": { - "ylcms": "server=221.229.106.161;uid=roottest;pooling=true;port=20306;pwd=YieldChain!@#$2020;database=yltrs_ylcms;charset=utf8;Allow User Variables=True;SslMode=none;Connection Timeout=30;IgnoreCommandTransaction=true;", - "yladmin": "server=221.229.106.161;uid=roottest;pooling=true;port=20306;pwd=YieldChain!@#$2020;database=yltrs_admin;charset=utf8;Allow User Variables=True;SslMode=none;Connection Timeout=30;IgnoreCommandTransaction=true;", - "ylclient": "server=221.229.106.161;uid=roottest;pooling=true;port=20306;pwd=YieldChain!@#$2020;database=yltrs_client;charset=utf8;Allow User Variables=True;SslMode=none;Connection Timeout=30;IgnoreCommandTransaction=true;", - "bondoms": "server=221.229.106.161;uid=roottest;pooling=true;port=20306;pwd=YieldChain!@#$2020;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;" + "ylcms": "server=192.168.2.96;uid=DBAdmin;pooling=true;port=3306;pwd=YieldChain$$2025;database=zszq_yltrs_ylcms;charset=utf8;Allow User Variables=True;SslMode=none;Connection Timeout=30;IgnoreCommandTransaction=true;", + "yladmin": "server=192.168.2.96;uid=DBAdmin;pooling=true;port=3306;pwd=YieldChain$$2025;database=zszq_yltrs_admin;charset=utf8;Allow User Variables=True;SslMode=none;Connection Timeout=30;IgnoreCommandTransaction=true;", + "ylclient": "server=192.168.2.96;uid=DBAdmin;pooling=true;port=3306;pwd=YieldChain$$2025;database=zszq_yltrs_client;charset=utf8;Allow User Variables=True;SslMode=none;Connection Timeout=30;IgnoreCommandTransaction=true;", + "bondoms": "server=192.168.2.96;uid=DBAdmin;pooling=true;port=3306;pwd=YieldChain$$2025;database=zszq_bond_oms;charset=utf8;Allow User Variables=True;SslMode=none;Connection Timeout=30;IgnoreCommandTransaction=true;" }, "AppSettings": { "VirtualPathRoot": "", @@ -66,9 +65,10 @@ "YiLian_SwapFlowGroup": "YiLian_SwapFlowGroup" //交易端同步流水消费组 }, "BondOmsInterface": { - "BaseUrl": "http://localhost:8887", + "BaseUrl": "http://192.168.2.96:10023/trs_hub_api", "CalculateMarginUrl": "/marginAlgorithm/triggerMarginCalc" // }, + "Reg_Report_Url": "http://192.168.2.96:10025/reg_api/", "OrcaleDatabaseConfig": { "Schema": "APEX_040000" }, diff --git a/YLErpWeb/appsettings.local.json b/YLErpWeb/appsettings.local.json index 4e435ca1..49a2868a 100644 --- a/YLErpWeb/appsettings.local.json +++ b/YLErpWeb/appsettings.local.json @@ -1,85 +1,86 @@ { - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*", - "ConnectionStrings": { - "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": { - "VirtualPathRoot": "", - "UseRightAligned": "", - "PluginFolder": "D:\\project\\zsza-trs\\Plugins\\build\\ZheShang\\Debug\\net6.0" - }, - "LibreOffice": { - "ExePath": "", - "UserInstallation": "" - }, - "EPPlus": { - "ExcelPackage": { - "LicenseContext": "NonCommercial" //The license context used - } - }, - "KafkaConfig": { - "BootstrapServers": "139.196.109.225:9092", // Kafka 集群的地址 - "Acks": -1, // 消息确认方式,可以是 All(-1)、Leader(1)、None(0) 中的一种 - "EnableAutoCommit": false, //是否自动提交 - "EnableIdempotence": false, // 开启幂等性,确保消息只被发送一次 - "MaxInFlight": 5, // 控制生产者在同一时间最多可以发送的未确认消息数 - "CompressionType": 0, // 消息压缩方式,可以是 None(0)、Gzip(1)、Snappy(2)、Lz4(3)、Zstd(4) 中的一种, - "MessageTimeoutMs": 3000, // 控制生产者等待消息确认的时间,单位是毫秒 - "ClientRateTopic": "ylClientRateTopic", //客户互换费率生产topic - "HedgingAccountTopic": "ylHedgingAccountTopic", //对冲账户生产topic - "AccountCapitalTopicGroupId": "YiLian_OnRspAccountCapitalConsumer", //账户资金消费组 - "ReqAccountCapitalTopic": "ReqAccountCapital", //账户资金请求topic - "OnRspAccountCapitalTopic": "OnRspAccountCapital", //账户资金请求返回topic - "AutoOffsetReset": 1, //Latest(0),Earliest(1),Error(2) - "EnableCalcBongd": false, //是否启用kafka计算 - "ReqClientRiskCheckTopic": "YiLian_ReqClientRiskCheck", //客户风控检查 - "ReqClientRiskCheckConsumerTopic": "YiLian_OnRspClientRiskCheck", //客户风控检查消费者 - "ReqClientRiskCheckTopicGroupId": "YiLian_ReqClientRiskCheckConsumer1", //客户风控检查消费者 - "ReqClientMonitorTopic": "YiLian_ReqClientMonitor", //客户资金监控 - "OnRspClientMonitorConsumerTopic": "YiLian_OnRspClientMonitor", //客户资金监控消费者 - "ReqClientMonitorTopicGroupId": "YiLian_ReqClientMonitorConsumer1", //客户资金监控消费组 - "ReqClientMonitorSingleTopic": "YiLian_ReqClientMonitorSingle", //单个客户资金监控 - "OnRspClientMonitorSingleConsumerTopic": "YiLian_OnRspClientMonitorSingle", //单个客户资金监控 - "ReqClientMonitorSingleTopicGroupId": "YiLian_ReqClientMonitorSingleConsumer1", //单个客户资金监控 - "TrsExchangeTradeConsumerTopic": "YiLian_HedgingOrder", //TRS对冲交易消费 topic - "TrsExchangeTradeConsumerTopicGroupId": "YiLian_HedgingOrderGroup1", //TRS对冲交易消费 Group - "YiLian_ReqHedgingOrderCancelTopic": "YiLian_ReqHedgingOrderCancel", //TRS对冲交易撤单请求消费 topic - "YiLian_ReqHedgingOrderCancelTopicGroupId": "YiLian_ReqHedgingOrderCancelGroup1", //TRS对冲交易撤单请求消费 Group - "YiLian_RespHedgingOrderCancelTopic": "YiLian_RespHedgingOrderCancel", //TRS对冲交易撤单请求回应 topic - "YiLian_ClientInfoChangeTopic": "YiLian_ClientInfoChangeTopic", //客户信息变更通知客户端 topic - "YiLian_CashCalcConsumerTopic": "YiLian_CashCalc", //客户资金计算 topic - "YiLian_CashCalcConsumerGroup": "YiLian_CashCalcGroup1", //客户资金计算消费组 topic - "YiLian_CashNoticeConsumerTopic": "YiLian_CashNotice", //客户资金通知 topic - "YiLian_CashNoticeConsumerGroup": "YiLian_CashNoticeGroup", //客户资金通知消费组 topic - "YiLian_HolidayResetTopic": "YiLian_HolidayReset", //交易日历缓存重新加载 topic - "YiLian_HolidayResetGroupId": "YiLian_HedgingOrderGroup1", //交易日历缓存重新加载消费 Group - "YiLian_SwapFlowTopic": "YiLian_SwapFlow", //交易端同步流水 - "YiLian_SwapFlowGroup": "YiLian_SwapFlowGroup1", //交易端同步流水消费组 - "YiLian_SysUserInfoChangeTopic": "YiLian_SysUserInfoChangeTopic" //管理端系统用户变更 - }, - "BondOmsInterface": { - "BaseUrl": "http://trs.yiliantech.com:8080/trs_hub_api" - }, - "OrcaleDatabaseConfig": { - "Schema": "APEX_040000" - }, - "SendKafakaCron": "10 0 * * *", - "MaxThreadPercent": 0.6, //占系统资源最多60%的线程数量 - "oa_confg": { - "BaseUrl": "http://ip:port", - "SystemKey": "M001", //OA系统key - "ObjectClass": "ZSZQ_ZDNX", //OA文件类别 - "Urgent": 1, //紧急程度,1一般 2紧急 3加急 - "Issend": 1 //流程是否自动发送,0不发送,1自动发送下一步 + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" } + }, + "AllowedHosts": "*", + "ConnectionStrings": { + "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": { + "VirtualPathRoot": "", + "UseRightAligned": "", + "PluginFolder": "D:\\project\\zsza-trs\\Plugins\\build\\ZheShang\\Debug\\net6.0" + }, + "LibreOffice": { + "ExePath": "", + "UserInstallation": "" + }, + "EPPlus": { + "ExcelPackage": { + "LicenseContext": "NonCommercial" //The license context used + } + }, + "KafkaConfig": { + "BootstrapServers": "139.196.109.225:9092", // Kafka 集群的地址 + "Acks": -1, // 消息确认方式,可以是 All(-1)、Leader(1)、None(0) 中的一种 + "EnableAutoCommit": false, //是否自动提交 + "EnableIdempotence": false, // 开启幂等性,确保消息只被发送一次 + "MaxInFlight": 5, // 控制生产者在同一时间最多可以发送的未确认消息数 + "CompressionType": 0, // 消息压缩方式,可以是 None(0)、Gzip(1)、Snappy(2)、Lz4(3)、Zstd(4) 中的一种, + "MessageTimeoutMs": 3000, // 控制生产者等待消息确认的时间,单位是毫秒 + "ClientRateTopic": "ylClientRateTopic", //客户互换费率生产topic + "HedgingAccountTopic": "ylHedgingAccountTopic", //对冲账户生产topic + "AccountCapitalTopicGroupId": "YiLian_OnRspAccountCapitalConsumer", //账户资金消费组 + "ReqAccountCapitalTopic": "ReqAccountCapital", //账户资金请求topic + "OnRspAccountCapitalTopic": "OnRspAccountCapital", //账户资金请求返回topic + "AutoOffsetReset": 1, //Latest(0),Earliest(1),Error(2) + "EnableCalcBongd": false, //是否启用kafka计算 + "ReqClientRiskCheckTopic": "YiLian_ReqClientRiskCheck", //客户风控检查 + "ReqClientRiskCheckConsumerTopic": "YiLian_OnRspClientRiskCheck", //客户风控检查消费者 + "ReqClientRiskCheckTopicGroupId": "YiLian_ReqClientRiskCheckConsumer1", //客户风控检查消费者 + "ReqClientMonitorTopic": "YiLian_ReqClientMonitor", //客户资金监控 + "OnRspClientMonitorConsumerTopic": "YiLian_OnRspClientMonitor", //客户资金监控消费者 + "ReqClientMonitorTopicGroupId": "YiLian_ReqClientMonitorConsumer1", //客户资金监控消费组 + "ReqClientMonitorSingleTopic": "YiLian_ReqClientMonitorSingle", //单个客户资金监控 + "OnRspClientMonitorSingleConsumerTopic": "YiLian_OnRspClientMonitorSingle", //单个客户资金监控 + "ReqClientMonitorSingleTopicGroupId": "YiLian_ReqClientMonitorSingleConsumer1", //单个客户资金监控 + "TrsExchangeTradeConsumerTopic": "YiLian_HedgingOrder", //TRS对冲交易消费 topic + "TrsExchangeTradeConsumerTopicGroupId": "YiLian_HedgingOrderGroup1", //TRS对冲交易消费 Group + "YiLian_ReqHedgingOrderCancelTopic": "YiLian_ReqHedgingOrderCancel", //TRS对冲交易撤单请求消费 topic + "YiLian_ReqHedgingOrderCancelTopicGroupId": "YiLian_ReqHedgingOrderCancelGroup1", //TRS对冲交易撤单请求消费 Group + "YiLian_RespHedgingOrderCancelTopic": "YiLian_RespHedgingOrderCancel", //TRS对冲交易撤单请求回应 topic + "YiLian_ClientInfoChangeTopic": "YiLian_ClientInfoChangeTopic", //客户信息变更通知客户端 topic + "YiLian_CashCalcConsumerTopic": "YiLian_CashCalc", //客户资金计算 topic + "YiLian_CashCalcConsumerGroup": "YiLian_CashCalcGroup1", //客户资金计算消费组 topic + "YiLian_CashNoticeConsumerTopic": "YiLian_CashNotice", //客户资金通知 topic + "YiLian_CashNoticeConsumerGroup": "YiLian_CashNoticeGroup", //客户资金通知消费组 topic + "YiLian_HolidayResetTopic": "YiLian_HolidayReset", //交易日历缓存重新加载 topic + "YiLian_HolidayResetGroupId": "YiLian_HedgingOrderGroup1", //交易日历缓存重新加载消费 Group + "YiLian_SwapFlowTopic": "YiLian_SwapFlow", //交易端同步流水 + "YiLian_SwapFlowGroup": "YiLian_SwapFlowGroup1", //交易端同步流水消费组 + "YiLian_SysUserInfoChangeTopic": "YiLian_SysUserInfoChangeTopic" //管理端系统用户变更 + }, + "BondOmsInterface": { + "BaseUrl": "http://trs.yiliantech.com:8080/trs_hub_api" + }, + "Reg_Report_Url": "http://139.196.109.225:8889",//报送后端地址 + "OrcaleDatabaseConfig": { + "Schema": "APEX_040000" + }, + "SendKafakaCron": "10 0 * * *", + "MaxThreadPercent": 0.6, //占系统资源最多60%的线程数量 + "oa_confg": { + "BaseUrl": "http://ip:port", + "SystemKey": "M001", //OA系统key + "ObjectClass": "ZSZQ_ZDNX", //OA文件类别 + "Urgent": 1, //紧急程度,1一般 2紧急 3加急 + "Issend": 0 //流程是否自动发送,0不发送,1自动发送下一步 + } } diff --git a/YLErpWeb/appsettings.uat.json b/YLErpWeb/appsettings.uat.json index 186bb9db..c26cc1d6 100644 --- a/YLErpWeb/appsettings.uat.json +++ b/YLErpWeb/appsettings.uat.json @@ -73,5 +73,12 @@ "Schema": "YILIAN" }, "SendKafakaCron": "10 0 * * *", - "MaxThreadPercent": 0.6 //占系统资源最多60%的线程数量 + "MaxThreadPercent": 0.6, //占系统资源最多60%的线程数量 + "oa_confg": { + "BaseUrl": "http://10.52.130.11", + "SystemKey": "fF2U9HXs7dm6Hjz5X", //OA系统key + "ObjectClass": "ZSZQ_CWYSPJYQRSDZWF", //OA文件类别 + "Urgent": 1, //紧急程度,1一般 2紧急 3加急 + "Issend": 0 //流程是否自动发送,0不发送,1自动发送下一步 + } } diff --git a/YLErpWeb/wwwroot/Scripts/app/client/entryexitEdit.js b/YLErpWeb/wwwroot/Scripts/app/client/entryexitEdit.js index 5dd2036d..10d5a0cc 100644 --- a/YLErpWeb/wwwroot/Scripts/app/client/entryexitEdit.js +++ b/YLErpWeb/wwwroot/Scripts/app/client/entryexitEdit.js @@ -1,4 +1,8 @@ -const cardInputMgr = (new function () { +var winloss = 0; // 已实现盈亏 +var netFund = 0; // 初保账户 +var vmFund = 0; // 追保账户 +var transferOutMoney = 0; // 转出金额 +const cardInputMgr = (new function () { var _inited = 0, _inputFlag = 0; @@ -180,7 +184,18 @@ function checkSubmitData() { else { $("#Money").val($("#Money").val().replace(',', '')); } - + let direction = $("#Direction").val(); + if (direction==="划转") { + var transfer_out_account = $("#TransferOutAccount").val(); + var transfer_in_account = $("#TransferInAccount").val(); + if (transfer_out_account === transfer_in_account) { + return main.message("转出科目与转入科目不能相同!"); + } + var money = parseFloat($("#Money").val()); + if (money <=0) { + return main.message("转出金额必须大于0!"); + } + } return cardInputMgr.checkSubmit(); } @@ -205,16 +220,30 @@ function setDirection(isInit) { !isInit && cardInputMgr.changeInputType(true); let direction = $("#Direction").val(); $(".changeInputBtn").toggleClass("hide", ["出金", "应付"].includes(direction)); - if (direction === "出金") { - $("#cash_type_container").hide(); // 隐藏资金类型 - } else { + if (direction === "入金") { $("#cash_type_container").show(); // 显示资金类型 + } else { + $("#cash_type_container").hide(); // 隐藏资金类型 + } + if (direction === "划转") { + $("#transfer_out_container").show(); + $("#transfer_in_container").show(); + $("#transferAll").show(); + } else { + $("#transfer_out_container").hide(); + $("#transfer_in_container").hide(); + $("#transferAll").hide(); } cardInputMgr.toggle(["入金", "出金"].includes(direction)); cardInputMgr.updateOptions(); } +// 全部转出 +function transferAll() { + $("#MoneyStr").val(transferOutMoney); + moneyInputMgr.onInput(); +} function setClientCash() { var clientId = $("#ClientId").val(); if (!clientId) { @@ -225,9 +254,49 @@ function setClientCash() { $("#ClientCashCNY").val(res.CNY); $("#ClientCashUSD").val(res.USD); } - }) + }); + main.post("/trade_span/GetClientLatestBalance", { clientId: clientId }).done(function (data) { + winloss = numFormart(data.WinLoss); + netFund = numFormart(data.NetFund); + vmFund = numFormart(data.VmFundSum); + setTransferMoney(); + }); +} +function setTransferMoney() { + var clientId = $("#ClientId").val(); + if (!clientId) { + return; + } + var transfer_out_account = $("#TransferOutAccount").val(); + var transfer_in_account = $("#TransferInAccount").val(); + if (transfer_out_account === "初保账户") { + transferOutMoney = netFund; + $("#transfer_out_account_money").text("余额:" + netFund); + } + else if (transfer_out_account === "追保账户") { + transferOutMoney = vmFund; + $("#transfer_out_account_money").text("余额:" + vmFund); + } else { + transferOutMoney = winloss; + $("#transfer_out_account_money").text("余额:" + winloss); + } + if (transfer_in_account === "初保账户") { + $("#transfer_in_account_money").text("余额:" + netFund); + } + else if (transfer_in_account === "追保账户") { + $("#transfer_in_account_money").text("余额:" + vmFund); + } else { + $("#transfer_in_account_money").text("余额:" + winloss); + } +} +function numFormart(num) { + num = num || 0; + var result = numeral(num).format("0,0.00") === "NaN" ? "0.00" : numeral(num).format("0,0.00"); + if (result === "-0.00") { + result = "0.00"; + } + return result; } - $(function () { cardInputMgr.init(); diff --git a/YLErpWeb/wwwroot/Scripts/app/swaptrade/SwapflowList.js b/YLErpWeb/wwwroot/Scripts/app/swaptrade/SwapflowList.js index 3d51053f..cc16488f 100644 --- a/YLErpWeb/wwwroot/Scripts/app/swaptrade/SwapflowList.js +++ b/YLErpWeb/wwwroot/Scripts/app/swaptrade/SwapflowList.js @@ -1155,6 +1155,10 @@ var vue = new Vue({ this.swapflow.ClientId = client.id; this.swapflow.ClientName = client.Name; }, + //变更标的单价 + changeSpotPrice() { + this.swapflow.TradingAmount = main.toNumber(this.swapflow.TradingAmountAvg * this.swapflow.TradingQty * this.swapflow.ContractSize*100, 2); + }, deleteSwapflow(id, st) { main.confirm("确定要删除吗?", function () { main.post("/swaptrade2/DeleteSwapflow?enid=" + id + "&step=" + st).done(function (resp) { diff --git a/YLErpWeb/wwwroot/Scripts/app/trade/tradeConfirmBookListByClient.js b/YLErpWeb/wwwroot/Scripts/app/trade/tradeConfirmBookListByClient.js index 9238fd46..4dcb8b62 100644 --- a/YLErpWeb/wwwroot/Scripts/app/trade/tradeConfirmBookListByClient.js +++ b/YLErpWeb/wwwroot/Scripts/app/trade/tradeConfirmBookListByClient.js @@ -37,16 +37,16 @@ const colModelGrid = (new function () { return html; } }, - // { label: 'OA状态', name: 'OAStatus', width: 100, align: 'center' }, - //{ label: 'OA-URL', name: 'OAURL', width: 150, align: 'center', - // formatter: function (cellValue, options, rowObject) { - // if (cellValue && cellValue.length > 0) { - // return '查看'; - // } - // return ''; - // } - //}, - //{ label: 'OA消息', name: 'OAMessage', width: 150, align: 'left' }, + { label: 'OA状态', name: 'OAStatus', width: 100, align: 'center' }, + { label: 'OA-URL', name: 'OAURL', width: 150, align: 'center', + formatter: function (cellValue, options, rowObject) { + if (cellValue && cellValue.length > 0) { + return '查看'; + } + return ''; + } + }, + { label: 'OA消息', name: 'OAMessage', width: 150, align: 'left' }, { label: '交易数量', name: 'tradeCount', width: 80, align: 'center' }, { label: 'tradeIds', name: 'tradeIds', hidden: true, optionHide: true }]; this.upload = function (encryptId, sendMail) { @@ -166,7 +166,7 @@ $(function () { // $("#batchSendMailBtn").click(BatchSendMail); initJqGrid(); SendEmailHub() - // SendOAHub(); // 初始化OA发送功能 + SendOAHub(); // 初始化OA发送功能 }); // 初始化jqGrid函数 @@ -259,8 +259,8 @@ function showToolName(cellValue, options, rowObject) { html += "".template(rowObject.ContractCode, canUpload); // 添加发送OA按钮 - //html += "" - // .template(rowObject.id); + html += "" + .template(rowObject.id); return html; }