diff --git a/Framework/YLErp.Core/ConsGlobal.cs b/Framework/YLErp.Core/ConsGlobal.cs index 8e078bdf..5cb686b3 100644 --- a/Framework/YLErp.Core/ConsGlobal.cs +++ b/Framework/YLErp.Core/ConsGlobal.cs @@ -109,33 +109,33 @@ namespace YLErp /// public static class InstrumentType { - public const string Stock = "Stock"; - public const string StockIndex = "StockIndex"; - public const string StockIF = "StockIF"; - public const string CommoditySpot = "CommoditySpot"; - public const string CommodityFutures = "CommodityFutures"; - public const string NewOtcStock = "NewOtcStock"; - public const string HKStock = "HKStock"; - public const string HKStockIndex = "HKStockIndex"; - public const string Fund = "Fund"; - public const string TBonds = "TBonds"; - public const string CreditBonds = "CreditBonds"; //信用债 - public const string OtherBonds = "OtherBonds"; //其它债券 - public const string Bonds = "Bond"; //债券 - public const string GoldFutures = "GoldFutures"; - public const string TBFutures = "TBFutures"; - public const string OtherFutures = "OtherFutures"; - public const string GoldSpot = "GoldSpot"; - public const string OtherSpot = "OtherSpot"; - public const string AbroadFutures = "AbroadFutures"; - public const string AbroadSpot = "AbroadSpot"; - public const string AbroadStock = "AbroadStock"; - public const string AbroadStockIndex = "AbroadStockIndex"; - public const string ExRate = "ExRate"; - public const string Shibor = "Shibor"; - public const string FixingRepoRate = "FixingRepoRate"; - public const string OtherRate = "OtherRate"; - public const string RateYield = "RateYield"; //利率收益率 + public const string Stock = "Stock"; // 股票 + public const string StockIndex = "StockIndex"; // 股指 + public const string StockIF = "StockIF"; // 股指期货 + public const string CommoditySpot = "CommoditySpot"; // 商品现货 + public const string CommodityFutures = "CommodityFutures"; // 商品期货 + public const string NewOtcStock = "NewOtcStock"; // 新三板挂牌股票 + public const string HKStock = "HKStock"; // 香港股票 + public const string HKStockIndex = "HKStockIndex"; // 香港股指 + public const string Fund = "Fund"; // 基金及基金专户 + public const string TBonds = "TBonds"; // 利率债 + public const string CreditBonds = "CreditBonds"; // 信用债 + public const string OtherBonds = "OtherBonds"; // 其它债券 + public const string Bonds = "Bond"; // 债券 + public const string GoldFutures = "GoldFutures"; // 黄金期货 + public const string TBFutures = "TBFutures"; // 国债期货 + public const string OtherFutures = "OtherFutures"; // 其他期货 + public const string GoldSpot = "GoldSpot"; // 黄金现货 + public const string OtherSpot = "OtherSpot"; // 其他现货 + public const string AbroadFutures = "AbroadFutures"; // 境外期货 + public const string AbroadSpot = "AbroadSpot"; // 境外现货 + public const string AbroadStock = "AbroadStock"; // 境外股票 + public const string AbroadStockIndex = "AbroadStockIndex"; // 境外股指 + public const string ExRate = "ExRate"; // 汇率 + public const string Shibor = "Shibor"; // Shibor + public const string FixingRepoRate = "FixingRepoRate"; // 银行间回购定盘 + public const string OtherRate = "OtherRate"; // 其他利率 + public const string RateYield = "RateYield"; // 利率收益率 public const string BondIndex = "BondIndex"; // 债券指数 //public const string OtherUnderlying = "OtherUnderlying"; diff --git a/UnitTestProject/Modules/EodModule/EodPriceDtoTest.cs b/UnitTestProject/Modules/EodModule/EodPriceDtoTest.cs index 459ba7af..f1053933 100644 --- a/UnitTestProject/Modules/EodModule/EodPriceDtoTest.cs +++ b/UnitTestProject/Modules/EodModule/EodPriceDtoTest.cs @@ -85,6 +85,21 @@ namespace YLErp.Modules.EodModule #endregion + #region 手工上传日终价格落表分流 + + [TestMethod] + [Description("股指期货和基金进入股票价格表,Shibor、利率收益率和债券指数进入商品期货价格表")] + public void 手工上传_按标的类型选择股票价格表() + { + Assert.IsTrue(SettlementPriceImportService.UseStockPriceTable(ConsGlobal.InstrumentType.StockIF)); + Assert.IsTrue(SettlementPriceImportService.UseStockPriceTable(ConsGlobal.InstrumentType.Fund)); + Assert.IsFalse(SettlementPriceImportService.UseStockPriceTable(ConsGlobal.InstrumentType.Shibor)); + Assert.IsFalse(SettlementPriceImportService.UseStockPriceTable(ConsGlobal.InstrumentType.RateYield)); + Assert.IsFalse(SettlementPriceImportService.UseStockPriceTable(ConsGlobal.InstrumentType.BondIndex)); + } + + #endregion + #region 问题3:债券数据来源按是否手工改过区分"人工"/"系统" [TestMethod] diff --git a/YLErpDAL/Modules/EodModule/SettlementPriceImportService.cs b/YLErpDAL/Modules/EodModule/SettlementPriceImportService.cs index 594edcb4..db79110a 100644 --- a/YLErpDAL/Modules/EodModule/SettlementPriceImportService.cs +++ b/YLErpDAL/Modules/EodModule/SettlementPriceImportService.cs @@ -14,6 +14,12 @@ namespace YLErp.Modules.EodModule } + public static bool UseStockPriceTable(string instrumentType) + { + return ConsGlobal.InstrumentType.EquityTypes().Contains(instrumentType) + || instrumentType == ConsGlobal.InstrumentType.Fund; + } + /// /// 导入xlsx数据 /// @@ -134,7 +140,7 @@ namespace YLErp.Modules.EodModule EodPriceService.StampBondOperator(eodPrice, UserId, eodPrice.id == 0); result.SuccessCount++; } - else if (!underlying.CalcTypeIsStock()) + else if (!UseStockPriceTable(underlying.UnderlyingInstrumentType)) { var eodPrice = DbContext.eod_commodity_future_price .FirstOrDefault(p => p.ValueDate == item.date && p.UnderlyingCode == underlying.UnderlyingCode);