diff --git a/Framework/YLErp.Core/DBModels/Consts/ConsReport.cs b/Framework/YLErp.Core/DBModels/Consts/ConsReport.cs
index 1e5559e7..9152f16e 100644
--- a/Framework/YLErp.Core/DBModels/Consts/ConsReport.cs
+++ b/Framework/YLErp.Core/DBModels/Consts/ConsReport.cs
@@ -1,4 +1,10 @@
-using YLErp.Commons;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using YLErp.Commons;
namespace YLErp.DBModels.Consts
{
@@ -98,6 +104,16 @@ namespace YLErp.DBModels.Consts
///
[Description("收益互换交易确认书附件")]
A1017,
+ ///
+ /// 场外期权-估值
+ ///
+ [Description("场外期权-估值")]
+ A1018,
+ ///
+ /// 场外期权交易确认书附件
+ ///
+ [Description("场外期权交易确认书附件")]
+ A1019,
}
///
/// 操作标识
@@ -131,20 +147,20 @@ namespace YLErp.DBModels.Consts
[Flags]
public enum SAC_ReportDataSourceEnum : byte
{
- ///
- /// 系统数据
- ///
- System = 1,
+ /////
+ ///// 系统数据
+ /////
+ //System = 1,
///
/// Excel模板
///
- Template = 1<<1,
+ Template = 1 << 1,
- ///
- /// 金仕达视图
- ///
- KingstarView = 1<<2
+ /////
+ ///// 金仕达视图
+ /////
+ //KingstarView = 1 << 2
}
///
@@ -255,6 +271,14 @@ namespace YLErp.DBModels.Consts
{"SAC(2018年12月发布)","5" },
{"SAC信用保护合约专用版","6" },
{"其他","99" },
+ {"0","0" },
+ {"1","1" },
+ {"2","2" },
+ {"3","3" },
+ {"4","4" },
+ {"5","5" },
+ {"6","6" },
+ {"99","99" }
});
}
return _masterAgrmtVerMap;
@@ -276,6 +300,8 @@ namespace YLErp.DBModels.Consts
{
{"甲方","0" },
{"乙方","1" },
+ {"0","0" },
+ {"1","1" }
});
}
return _fillPartyMap;
@@ -296,6 +322,8 @@ namespace YLErp.DBModels.Consts
{
{"甲方","0" },
{"乙方","1" },
+ {"0","0" },
+ {"1","1" }
});
}
return _fillPartyMap;
@@ -321,6 +349,10 @@ namespace YLErp.DBModels.Consts
{"客户空头","1" },
{"多空组合","2" },
{"其他","99" },
+ {"0","0" },
+ {"1","1" },
+ {"2","2" },
+ {"99","99" }
});
}
return _swapTypeMap;
@@ -342,6 +374,8 @@ namespace YLErp.DBModels.Consts
{
{"非专业","0" },
{"专业","1" },
+ {"0","0" },
+ {"1","1" }
});
}
return _proCounterpartyMap;
@@ -411,6 +445,28 @@ namespace YLErp.DBModels.Consts
{"政策性银行","19" },
{"外资银行","20" },
{"期货资产管理公司","21" },
+ {"0","0" },
+ {"1","1" },
+ {"2","2" },
+ {"3","3" },
+ {"4","4" },
+ {"5","5" },
+ {"6","6" },
+ {"7","7" },
+ {"8","8" },
+ {"9","9" },
+ {"10","10" },
+ {"11","11" },
+ {"12","12" },
+ {"13","13" },
+ {"14","14" },
+ {"15","15" },
+ {"16","16" },
+ {"17","17" },
+ {"18","18" },
+ {"19","19" },
+ {"20","20" },
+ {"21","21" }
});
}
return _counterpartyTypeMap;
@@ -480,6 +536,28 @@ namespace YLErp.DBModels.Consts
{"外资银行","20" },
{"期货资产管理公司","21" },
{"其他","99" },
+ {"0","0" },
+ {"1","1" },
+ {"2","2" },
+ {"4","4" },
+ {"5","5" },
+ {"6","6" },
+ {"7","7" },
+ {"8","8" },
+ {"9","9" },
+ {"10","10" },
+ {"11","11" },
+ {"12","12" },
+ {"13","13" },
+ {"14","14" },
+ {"15","15" },
+ {"16","16" },
+ {"17","17" },
+ {"18","18" },
+ {"19","19" },
+ {"20","20" },
+ {"21","21" },
+ {"99","99" }
});
}
return _nafmiiCounterpartyTypeMap;
@@ -501,6 +579,8 @@ namespace YLErp.DBModels.Consts
{
{"产品管理人","1" },
{"自营","2" },
+ {"1","1" },
+ {"2","2" }
});
}
return _counterpartyIdentityMap;
@@ -522,6 +602,8 @@ namespace YLErp.DBModels.Consts
{
{"首次","0" },
{"变更","1" },
+ {"0","0" },
+ {"1","1" }
});
}
return _reportTypeMap;
@@ -545,6 +627,12 @@ namespace YLErp.DBModels.Consts
{"首次","01" },
{"补充","02" },
{"变更","03" },
+ {"1","01" },
+ {"2","02" },
+ {"3","03" },
+ {"01","01" },
+ {"02","02" },
+ {"03","03" }
});
}
return _isdaReportTypeMap;
@@ -566,6 +654,10 @@ namespace YLErp.DBModels.Consts
{
{"首次","01" },
{"变更","02" },
+ {"1","01" },
+ {"2","02" },
+ {"01","01" },
+ {"02","02" }
});
}
return _isdaReportTypeMap2;
@@ -590,6 +682,10 @@ namespace YLErp.DBModels.Consts
{"填报机构","01" },
{"对手方","02" },
{"交易对手方","02" },
+ {"1","01" },
+ {"2","02" },
+ {"01","01" },
+ {"02","02" }
});
}
return _optionTraderMap;
@@ -612,27 +708,49 @@ namespace YLErp.DBModels.Consts
{"看涨","0" },
{"看跌","1" },
{"双向","2" },
+ {"0","0" },
+ {"1","1" },
+ {"2","2" }
});
}
return _optionDirectionMap;
}
}
+ private static ExpandoDictionary _multiOrderOptionTypeMap;
+ ///
+ /// 多标的期权类型
+ /// Best of:0
+ /// Worst of:1
+ /// 其他类型:2
+ ///
+ public static ExpandoDictionary MultiOrderOptionTypeMap
+ {
+ get
+ {
+ if (_multiOrderOptionTypeMap == null)
+ {
+ _multiOrderOptionTypeMap = new ExpandoDictionary(new Dictionary() {
+ { "Best of","0"},
+ { "Worst of","1"},
+ { "其他类型","2"},
+ {"0","0" },
+ {"1","1" },
+ {"2","2" }
+ });
+ }
+ return _multiOrderOptionTypeMap;
+ }
+ }
+
private static ExpandoDictionary _optionStructureTypeMap;
///
/// 期权结构类型
- /// 香草:0
- /// 二元:1
- /// 价差:2
- /// 鲨鱼鳍:4
- /// 障碍:5
- /// 区间累计:6
- /// 自动看涨:7
- /// AutoCallable:7
- /// Auto Callable:7
- /// 自动看涨(AutoCallable):7
- /// 自动看涨(Auto Callable):7
- /// 自动看涨(AutoCallable):7
- /// 自动看涨(Auto Callable):7
+ /// 香草及其组合:0
+ /// 二元及其组合:1
+ /// 障碍及其组合:2
+ /// 自动赎回:3
+ /// 区间累计:4
+ /// 安全气囊:5
/// 其他:99
///
public static ExpandoDictionary OptionStructureTypeMap
@@ -642,20 +760,20 @@ namespace YLErp.DBModels.Consts
if (_optionStructureTypeMap == null)
{
_optionStructureTypeMap = new ExpandoDictionary(new Dictionary() {
- {"香草","0" },
- {"二元","1" },
- {"价差","2" },
- {"鲨鱼鳍","4" },
- {"障碍","5" },
- {"区间累计","6" },
- {"自动看涨","7" },
- {"AutoCallable","7" },
- {"Auto Callable","7" },
- {"自动看涨(AutoCallable)","7" },
- {"自动看涨(Auto Callable)","7" },
- {"自动看涨(AutoCallable)","7" },
- {"自动看涨(Auto Callable)","7" },
+ {"香草及其组合","0" },
+ {"二元及其组合","1" },
+ {"障碍及其组合","2" },
+ {"自动赎回","3" },
+ {"区间累计","4" },
+ {"安全气囊","5" },
{"其他","99" },
+ {"0","0" },
+ {"1","1" },
+ {"2","2" },
+ {"3","3" },
+ {"4","4" },
+ {"5","5" },
+ {"99","99" }
});
}
return _optionStructureTypeMap;
@@ -688,6 +806,22 @@ namespace YLErp.DBModels.Consts
{"单鲨","06" },
{"双鲨","07" },
{"其他","08" },
+ {"1","01" },
+ {"2","02" },
+ {"3","03" },
+ {"4","04" },
+ {"5","05" },
+ {"6","06" },
+ {"7","07" },
+ {"8","08" },
+ {"01","01" },
+ {"02","02" },
+ {"03","03" },
+ {"04","04" },
+ {"05","05" },
+ {"06","06" },
+ {"07","07" },
+ {"08","08" }
});
}
return _sacOptionStructureTypeMap;
@@ -712,11 +846,37 @@ namespace YLErp.DBModels.Consts
{"美式","1" },
{"百慕大","2" },
{"亚式","3" },
+ {"0","0" },
+ {"1","1" },
+ {"2","2" },
+ {"3","3" }
});
}
return _exerciseApproachMap;
}
}
+
+ private static ExpandoDictionary _clearingAgencyMap_optionDisplay;
+
+ public static ExpandoDictionary ClearingAgencyMap_OptionDisplay
+ {
+ get
+ {
+ if (_clearingAgencyMap_optionDisplay == null)
+ {
+ _clearingAgencyMap_optionDisplay = new ExpandoDictionary(new Dictionary()
+ {
+ //{"甲方","0" },
+ {"乙方","1" },
+ {"甲方","0" },//原本是甲方,为了方便交易员理解,创建交易时直观,改成交易员方
+ //{"中金","1" },//原本是乙方,为了方便交易员理解,创建交易时直观,改成客户方
+ {"报价系统","3" }
+ });
+ }
+ return _clearingAgencyMap_optionDisplay;
+ }
+ }
+
private static ExpandoDictionary _clearingAgencyMap;
///
/// 清算机构
@@ -737,10 +897,18 @@ namespace YLErp.DBModels.Consts
{
{"甲方","0" },
{"乙方","1" },
+ {"交易员方","0" },//原本是甲方,为了方便交易员理解,创建交易时直观,改成交易员方
+ {"客户方","1" },//原本是乙方,为了方便交易员理解,创建交易时直观,改成客户方
{"报价系统","3" },
{"中债登","4" },
{"上清所","5" },
{"其他","99" },
+ {"1","1" },
+ {"0","0" },
+ {"3","3" },
+ {"4","4" },
+ {"5","5" },
+ {"99","99" }
});
}
return _clearingAgencyMap;
@@ -769,7 +937,7 @@ namespace YLErp.DBModels.Consts
{"报价系统","3" },
{"中债登","4" },
{"上清所","5" },
- {"其他","99" }
+ {"其他","99" },
});
}
return _clearingAgencyMapDisplay;
@@ -777,7 +945,7 @@ namespace YLErp.DBModels.Consts
}
private static ExpandoDictionary _tradingPlaceMap;
///
- /// 交易场所
+ /// 交易场所(用于报送)
///柜台市场:0
///报价系统:1
///银行间市场:2
@@ -795,6 +963,10 @@ namespace YLErp.DBModels.Consts
{"报价系统","1" },
{"银行间市场","2" },
{"其他交易场所","99" },
+ {"0","0" },
+ {"1","1" },
+ {"2","2" },
+ {"99","99" }
});
}
return _tradingPlaceMap;
@@ -845,6 +1017,13 @@ namespace YLErp.DBModels.Consts
{"报价系统","02" },
{"银行间市场","03" },
{"其他交易场所","99" },
+ {"1","01" },
+ {"2","02" },
+ {"3","03" },
+ {"01","01" },
+ {"02","02" },
+ {"03","03" },
+ {"99","99" }
});
}
return _isdaTradingPlaceMap;
@@ -864,6 +1043,7 @@ namespace YLErp.DBModels.Consts
_businessModelTypeMap = new ExpandoDictionary(new Dictionary()
{
{"传统型期权","1" },
+ {"1","1" }
});
}
return _businessModelTypeMap;
@@ -895,6 +1075,13 @@ namespace YLErp.DBModels.Consts
{"汇率","4" },
{"混合类","5" },
{"其他","99" },
+ {"0","0" },
+ {"1","1" },
+ {"2","2" },
+ {"3","3" },
+ {"4","4" },
+ {"5","5" },
+ {"99","99" }
});
}
return _undrlygAssetTypeMap;
@@ -925,43 +1112,22 @@ namespace YLErp.DBModels.Consts
{"信用类","04" },
{"汇率","05" },
{"其他","99" },
+ {"1","01" },
+ {"2","02" },
+ {"3","03" },
+ {"4","04" },
+ {"5","05" },
+ {"01","01" },
+ {"02","02" },
+ {"03","03" },
+ {"04","04" },
+ {"05","05" },
+ {"99","99" }
});
}
return _sacUndrlygAssetTypeMap;
}
}
-
- private static ExpandoDictionary _isdaUndrlygAssetDtldTypeMap;
- ///
- /// ISDA标的类型
- /// 权益类(境内):01
- /// 权益类(境外):02
- /// 大宗商品:03
- /// 利率:04
- /// 信用类:05
- /// 汇率:06
- /// 其他:99
- ///
- public static ExpandoDictionary ISDAUndrlygAssetDtldTypeMap
- {
- get
- {
- if (_isdaUndrlygAssetDtldTypeMap == null)
- {
- _isdaUndrlygAssetDtldTypeMap = new ExpandoDictionary(new Dictionary()
- {
- {"权益类(境内)","01"},
- {"权益类(境外)","02"},
- {"大宗商品","03"},
- {"利率","04"},
- {"信用类","05"},
- {"汇率","06"},
- {"其他","99"},
- });
- }
- return _isdaUndrlygAssetDtldTypeMap;
- }
- }
private static ExpandoDictionary _nafmiiUndrlygAssetDtldTypeMap;
///
/// NAFMII标的类型
@@ -986,6 +1152,18 @@ namespace YLErp.DBModels.Consts
{"黄金期货","04"},
{"利率类","05"},
{"其他","06"},
+ {"1","01"},
+ {"2","02"},
+ {"3","03"},
+ {"4","04"},
+ {"5","05"},
+ {"6","06"},
+ {"01","01"},
+ {"02","02"},
+ {"03","03"},
+ {"04","04"},
+ {"05","05"},
+ {"06","06"}
});
}
return _nafmiiUndrlygAssetDtldTypeMap;
@@ -1009,6 +1187,8 @@ namespace YLErp.DBModels.Consts
{"单一标的","0" },
{"组合标的","1" },
{"多标的","1" },
+ {"0","0" },
+ {"1","1" }
});
}
return _undrlygAssetNoMap;
@@ -1021,6 +1201,7 @@ namespace YLErp.DBModels.Consts
///无履约担保:0
///部分担保:1
///全额担保:2
+ ///双方不涉及履约担保:3
///
public static ExpandoDictionary PerformanceGuaranteeMap
{
@@ -1034,14 +1215,17 @@ namespace YLErp.DBModels.Consts
{"无履约担保","0" },
{"部分担保","1" },
{"全额担保","2" },
+ {"双方不涉及履约担保","3" },
+ {"0","0" },
+ {"1","1" },
+ {"2","2" },
+ {"3","3" },
});
}
return _performanceGuaranteeTypeMap;
}
}
- private static ExpandoDictionary _performanceCollProviderMap;
private static ExpandoDictionary _performanceGuaranteeMapDisplay;
-
///
/// 履约担保类型(用于页面展示)
///否:0
@@ -1058,7 +1242,6 @@ namespace YLErp.DBModels.Consts
{
_performanceGuaranteeMapDisplay = new ExpandoDictionary(new Dictionary()
{
- {"无","" },
{"无履约担保","0" },
{"部分担保","1" },
{"全额担保","2" },
@@ -1067,6 +1250,7 @@ namespace YLErp.DBModels.Consts
return _performanceGuaranteeMapDisplay;
}
}
+ private static ExpandoDictionary _performanceCollProviderMap;
///
/// 履约担保品提供方
///甲方:0
@@ -1088,13 +1272,16 @@ namespace YLErp.DBModels.Consts
{"第三方","2" },
{"第三方(需在履约担保备注中说明第三方相关情况)","2" },
{"交易双方","3" },
+ {"0","0" },
+ {"1","1" },
+ {"2","2" },
+ {"3","3" }
});
}
return _performanceCollProviderMap;
}
}
private static ExpandoDictionary _performanceCollProviderMapDisplay;
-
///
/// 履约担保品提供方(用于页面展示)
///甲方:0
@@ -1120,7 +1307,6 @@ namespace YLErp.DBModels.Consts
return _performanceCollProviderMapDisplay;
}
}
-
private static ExpandoDictionary _boolMap;
///
/// Bool
@@ -1137,11 +1323,14 @@ namespace YLErp.DBModels.Consts
{
{"是","true" },
{"否","false" },
+ {"true","true" },
+ {"false","false" }
});
}
return _boolMap;
}
}
+
private static ExpandoDictionary _boolMapDisplay;
///
/// Bool (用于页面展示)
@@ -1179,6 +1368,10 @@ namespace YLErp.DBModels.Consts
{
{"是","01" },
{"否","02" },
+ {"1","01" },
+ {"2","02" },
+ {"01","01" },
+ {"02","02" }
});
}
return _boolNumberMap;
@@ -1245,6 +1438,28 @@ namespace YLErp.DBModels.Consts
{"银行间回购定盘(Fixing Repo Rate)","19"},
{"其他利率","20"},
{"其他标的","99"},
+ {"0","0"},
+ {"1","1"},
+ {"2","2"},
+ {"3","3"},
+ {"4","4"},
+ {"5","5"},
+ {"6","6"},
+ {"7","7"},
+ {"8","8"},
+ {"9","9"},
+ {"10","10"},
+ {"11","11"},
+ {"12","12"},
+ {"13","13"},
+ {"14","14"},
+ {"15","15"},
+ {"16","16"},
+ {"17","17"},
+ {"18","18"},
+ {"19","19"},
+ {"20","20"},
+ {"99","99"}
});
}
return _undrlygAssetDtldTypeMap;
@@ -1304,6 +1519,26 @@ namespace YLErp.DBModels.Consts
{"汇率","17"},
{"利率","18"},
{"其他标的","99"},
+ {"0","0"},
+ {"1","1"},
+ {"2","2"},
+ {"3","3"},
+ {"4","4"},
+ {"5","5"},
+ {"6","6"},
+ {"7","7"},
+ {"8","8"},
+ {"9","9"},
+ {"10","10"},
+ {"11","11"},
+ {"12","12"},
+ {"13","13"},
+ {"14","14"},
+ {"15","15"},
+ {"16","16"},
+ {"17","17"},
+ {"18","18"},
+ {"99","99"}
});
}
return _swapUndrlygAssetDtldTypeMap;
@@ -1366,6 +1601,37 @@ namespace YLErp.DBModels.Consts
{"银行间回购定盘(FixingRepoRate)","20"},
{"其他利率","21"},
{"其他标的","99"},
+ {"1","01"},
+ {"2","02"},
+ {"3","03"},
+ {"4","04"},
+ {"5","05"},
+ {"6","06"},
+ {"7","07"},
+ {"8","08"},
+ {"9","09"},
+ {"01","01"},
+ {"02","02"},
+ {"03","03"},
+ {"04","04"},
+ {"05","05"},
+ {"06","06"},
+ {"07","07"},
+ {"08","08"},
+ {"09","09"},
+ {"10","10"},
+ {"11","11"},
+ {"12","12"},
+ {"13","13"},
+ {"14","14"},
+ {"15","15"},
+ {"16","16"},
+ {"17","17"},
+ {"18","18"},
+ {"19","19"},
+ {"20","20"},
+ {"21","21"},
+ {"99","99"}
});
}
return _sacUndrlygAssetDtldTypeMap;
@@ -1402,25 +1668,34 @@ namespace YLErp.DBModels.Consts
{
_swapSACUndrlygAssetDtldTypeMap = new ExpandoDictionary(new Dictionary()
{
- {"股票","01"},
- {"股指","02"},
- {"新三板挂牌股票","03"},
- {"香港股票","04"},
- {"香港股指","05"},
- {"基金及基金专户","06"},
- {"债券","07"},
- {"黄金期货","08"},
- {"国债期货","09"},
- {"股指期货","10"},
- {"其他期货","11"},
- {"黄金现货","12"},
- {"其他现货","13"},
- {"境外期货","14"},
- {"境外现货","15"},
- {"境外股票","16"},
- {"境外股指","17"},
- {"汇率","18"},
- {"其他标的","99"},
+ {"1","01"},
+ {"2","02"},
+ {"3","03"},
+ {"4","04"},
+ {"5","05"},
+ {"6","06"},
+ {"7","07"},
+ {"8","08"},
+ {"9","09"},
+ {"01","01"},
+ {"02","02"},
+ {"03","03"},
+ {"04","04"},
+ {"05","05"},
+ {"06","06"},
+ {"07","07"},
+ {"08","08"},
+ {"09","09"},
+ {"10","10"},
+ {"11","11"},
+ {"12","12"},
+ {"13","13"},
+ {"14","14"},
+ {"15","15"},
+ {"16","16"},
+ {"17","17"},
+ {"18","18"},
+ {"99","99"},
});
}
return _swapSACUndrlygAssetDtldTypeMap;
@@ -1459,6 +1734,19 @@ namespace YLErp.DBModels.Consts
{"香港股指","06"},
{"其他","99"},
{"其他标的","99"},
+ {"1","01"},
+ {"2","02"},
+ {"3","03"},
+ {"4","04"},
+ {"5","05"},
+ {"6","06"},
+ {"01","01"},
+ {"02","02"},
+ {"03","03"},
+ {"04","04"},
+ {"05","05"},
+ {"06","06"},
+ {"99","99"}
});
}
return _hedgeSACUndrlygAssetDtldTypeMap;
@@ -1501,6 +1789,27 @@ namespace YLErp.DBModels.Consts
{"境外交易所","11"},
{"其他","99"},
{"其他(注明具体场所)","99"},
+ {"1","01"},
+ {"2","02"},
+ {"3","03"},
+ {"4","04"},
+ {"5","05"},
+ {"6","06"},
+ {"7","07"},
+ {"8","08"},
+ {"9","09"},
+ {"01","01"},
+ {"02","02"},
+ {"03","03"},
+ {"04","04"},
+ {"05","05"},
+ {"06","06"},
+ {"07","07"},
+ {"08","08"},
+ {"09","09"},
+ {"10","10"},
+ {"11","11"},
+ {"99","99"}
});
}
return _undrlygAssetTradgPlcMap;
@@ -1537,6 +1846,23 @@ namespace YLErp.DBModels.Consts
{"外汇交易中心","08"},
{"其他","99"},
{"其他(注明具体场所)","99"},
+ {"1","01"},
+ {"2","02"},
+ {"3","03"},
+ {"4","04"},
+ {"5","05"},
+ {"6","06"},
+ {"7","07"},
+ {"8","08"},
+ {"01","01"},
+ {"02","02"},
+ {"03","03"},
+ {"04","04"},
+ {"05","05"},
+ {"06","06"},
+ {"07","07"},
+ {"08","08"},
+ {"99","99"}
});
}
return _hedgeUndrlygAssetTradgPlcMap;
@@ -1574,11 +1900,18 @@ namespace YLErp.DBModels.Consts
{"其他(须在履约担保备注栏进行说明)","99" },
{"其他(需在履约担保备注栏进行说明)","99" },
{"其他(须在履约担保备注栏进行说明)","99" },
+ {"0","0"},
+ {"1","1"},
+ {"2","2" },
+ {"3","3" },
+ {"99","99" }
});
}
return _performanceCollTypeMap;
}
}
+
+ private static ExpandoDictionary _performanceCollTypeMapDisplay;
///
/// 履约担保品类型(用于页面展示)
///现金:0
@@ -1605,7 +1938,6 @@ namespace YLErp.DBModels.Consts
return _performanceCollTypeMapDisplay;
}
}
- private static ExpandoDictionary _performanceCollTypeMapDisplay;
private static ExpandoDictionary _performanceCollRangeMap;
///
@@ -1627,11 +1959,16 @@ namespace YLErp.DBModels.Consts
{"本笔交易对应主协议框架下的所有交易(在附件中上传履约担保协议)","1"},
{"其他情况下多笔交易","2"},
{"其他情况下多笔交易(在附件中上传履约担保协议)","2"},
+ {"0","0"},
+ {"1","1"},
+ {"2","2"}
});
}
return _performanceCollRangeMap;
}
}
+
+ private static ExpandoDictionary _performanceCollRangeMapDisplay;
///
/// 担保品担保范围(用于页面展示)
///仅本笔交易:0
@@ -1654,7 +1991,6 @@ namespace YLErp.DBModels.Consts
return _performanceCollRangeMapDisplay;
}
}
- private static ExpandoDictionary _performanceCollRangeMapDisplay;
private static ExpandoDictionary _paymentMethodMap;
///
@@ -1686,6 +2022,11 @@ namespace YLErp.DBModels.Consts
{"固定利率","3"},
{"固定利率收益","3"},
{"权益收益多空组合","4"},
+ {"0","0"},
+ {"1","1"},
+ {"2","2"},
+ {"3","3"},
+ {"4","4"}
});
}
return _paymentMethodMap;
@@ -1709,6 +2050,9 @@ namespace YLErp.DBModels.Consts
{"期初支付","0"},
{"期末支付","1"},
{"期间多次支付","2"},
+ {"0","0"},
+ {"1","1"},
+ {"2","2"}
});
}
return _paymentFreqMap;
@@ -1730,6 +2074,8 @@ namespace YLErp.DBModels.Consts
{
{"单一标的","0"},
{"多标的","1"},
+ {"0","0"},
+ {"1","1"}
});
}
return _ptyBUndrlygAssetNoMap;
@@ -1755,6 +2101,10 @@ namespace YLErp.DBModels.Consts
{"开空仓","1" },
{"平多仓","2" },
{"平空仓","3" },
+ {"0","0" },
+ {"1","1" },
+ {"2","2" },
+ {"3","3" }
});
}
return _undrlygAssetPositionMap;
@@ -1790,6 +2140,15 @@ namespace YLErp.DBModels.Consts
{"Libor1M","6"},
{"Hibor1M","7"},
{"其他","99"},
+ {"0","0"},
+ {"1","1"},
+ {"2","2"},
+ {"3","3"},
+ {"4","4"},
+ {"5","5"},
+ {"6","6"},
+ {"7","7"},
+ {"99","99"}
});
}
return _refRateTypeMap;
@@ -1797,11 +2156,13 @@ namespace YLErp.DBModels.Consts
}
private static ExpandoDictionary _operationTypeMap;
///
- /// 参考利率类型
+ /// 存续期操作类型
/// 展期:01
/// 终止:02
/// 违约终止:03
/// 调仓:04
+ /// 敲入:05
+ /// 敲出:06
///
public static ExpandoDictionary OperationTypeMap
{
@@ -1815,11 +2176,58 @@ namespace YLErp.DBModels.Consts
{"终止","02"},
{"违约终止","03"},
{"调仓","04"},
+ {"敲入","05"},
+ {"敲出","06"},
+ {"1","01"},
+ {"2","02"},
+ {"3","03"},
+ {"4","04"},
+ {"5","05"},
+ {"6","06"},
+ {"01","01"},
+ {"02","02"},
+ {"03","03"},
+ {"04","04"},
+ {"05","05"},
+ {"06","06"}
});
}
return _operationTypeMap;
}
}
+ private static ExpandoDictionary _swapOperationTypeMap;
+ ///
+ /// 互换存续期操作类型
+ /// 展期:1
+ /// 终止:2
+ /// 违约终止:3
+ /// 调仓:4
+ ///
+ public static ExpandoDictionary SwapOperationTypeMap
+ {
+ get
+ {
+ if (_swapOperationTypeMap == null)
+ {
+ _swapOperationTypeMap = new ExpandoDictionary(new Dictionary()
+ {
+ {"展期","1"},
+ {"终止","2"},
+ {"违约终止","3"},
+ {"调仓","4"},
+ {"1","1"},
+ {"2","2"},
+ {"3","3"},
+ {"4","4"},
+ {"01","1"},
+ {"02","2"},
+ {"03","3"},
+ {"04","4"},
+ });
+ }
+ return _swapOperationTypeMap;
+ }
+ }
private static ExpandoDictionary _businessTypeMap;
///
/// 业务类型
@@ -1850,6 +2258,18 @@ namespace YLErp.DBModels.Consts
{"收益互换(客户空头)","12"},
{"多空组合收益互换","13"},
{"其他收益互换","14"},
+ {"1","01"},
+ {"2","02"},
+ {"3","03"},
+ {"4","04"},
+ {"01","01"},
+ {"02","02"},
+ {"03","03"},
+ {"04","04"},
+ {"11","11"},
+ {"12","12"},
+ {"13","13"},
+ {"14","14"}
});
}
return _businessTypeMap;
@@ -1875,6 +2295,14 @@ namespace YLErp.DBModels.Consts
{"互换看跌","02" },
{"利率上限","03" },
{"利率下限","04" },
+ {"1","01" },
+ {"2","02" },
+ {"3","03" },
+ {"4","04" },
+ {"01","01" },
+ {"02","02" },
+ {"03","03" },
+ {"04","04" }
});
}
return _nafmiiOptionDirectionMap;
@@ -1902,6 +2330,16 @@ namespace YLErp.DBModels.Consts
{"lpr1y_irs","03" },
{"lpr5y_irs","04" },
{"其他","05" },
+ {"1","01" },
+ {"2","02" },
+ {"3","03" },
+ {"4","04" },
+ {"5","05" },
+ {"01","01" },
+ {"02","02" },
+ {"03","03" },
+ {"04","04" },
+ {"05","05" }
});
}
return _nafmiiInvestmentNameMap;
@@ -1923,6 +2361,10 @@ namespace YLErp.DBModels.Consts
{
{"实物交割","01" },
{"现金交割","02" },
+ {"1","01" },
+ {"2","02" },
+ {"01","01" },
+ {"02","02" }
});
}
return _nafmiiDeliveryTypeMap;
@@ -1944,6 +2386,10 @@ namespace YLErp.DBModels.Consts
{
{"本月新增业务","01"},
{"截至上月底尚未完全终止业务","02"},
+ {"1","01"},
+ {"2","02"},
+ {"01","01"},
+ {"02","02"}
});
}
return _dataTypeForBusinessMap;
@@ -2040,6 +2486,55 @@ namespace YLErp.DBModels.Consts
{"期权","36"},
{"其他衍生品","37"},
{"其他标的","99"},
+ {"0","00"},
+ {"1","01"},
+ {"2","02"},
+ {"3","03"},
+ {"4","04"},
+ {"5","05"},
+ {"6","06"},
+ {"7","07"},
+ {"8","08"},
+ {"9","09"},
+ {"00","00"},
+ {"01","01"},
+ {"02","02"},
+ {"03","03"},
+ {"04","04"},
+ {"05","05"},
+ {"06","06"},
+ {"07","07"},
+ {"08","08"},
+ {"09","09"},
+ {"10","10"},
+ {"11","11"},
+ {"12","12"},
+ {"13","13"},
+ {"14","14"},
+ {"15","15"},
+ {"16","16"},
+ {"17","17"},
+ {"18","18"},
+ {"19","19"},
+ {"20","20"},
+ {"21","21"},
+ {"22","22"},
+ {"23","23"},
+ {"24","24"},
+ {"25","25"},
+ {"26","26"},
+ {"27","27"},
+ {"28","28"},
+ {"29","29"},
+ {"30","30"},
+ {"31","31"},
+ {"32","32"},
+ {"33","33"},
+ {"34","34"},
+ {"35","35"},
+ {"36","36"},
+ {"37","37"},
+ {"99","99"}
});
}
return _investmentTargetTypeMap;
@@ -2135,10 +2630,505 @@ namespace YLErp.DBModels.Consts
{"期权","36"},
{"其他衍生品","37"},
{"其他标的","99"},
+ {"0","00"},
+ {"1","01"},
+ {"2","02"},
+ {"3","03"},
+ {"4","04"},
+ {"5","05"},
+ {"6","06"},
+ {"7","07"},
+ {"8","08"},
+ {"9","09"},
+ {"00","00"},
+ {"01","01"},
+ {"02","02"},
+ {"03","03"},
+ {"04","04"},
+ {"05","05"},
+ {"06","06"},
+ {"07","07"},
+ {"08","08"},
+ {"09","09"},
+ {"10","10"},
+ {"11","11"},
+ {"12","12"},
+ {"13","13"},
+ {"14","14"},
+ {"15","15"},
+ {"16","16"},
+ {"17","17"},
+ {"18","18"},
+ {"19","19"},
+ {"20","20"},
+ {"21","21"},
+ {"22","22"},
+ {"23","23"},
+ {"24","24"},
+ {"25","25"},
+ {"26","26"},
+ {"27","27"},
+ {"28","28"},
+ {"29","29"},
+ {"30","30"},
+ {"31","31"},
+ {"32","32"},
+ {"33","33"},
+ {"34","34"},
+ {"35","35"},
+ {"36","36"},
+ {"37","37"},
+ {"99","99"}
});
}
return _hedgeUnderlyingTypeMap;
}
}
+
+ private static ExpandoDictionary _vanillaOptionStructureSubclassMap;
+ ///
+ /// 期权结构小类
+ ///香草:0
+ ///跨式:1
+ ///宽跨式:2
+ ///参与式看涨:3
+ ///两段参与式看涨:4
+ ///价差:5
+ ///区间保护看涨:6
+ ///有限区间保护看涨:7
+ ///区间保护看涨价差:8
+ ///有限区间保护看涨价差:9
+ ///鹰式:10
+ ///蝶式:11
+ ///其他香草及其组合:12
+ ///
+ public static ExpandoDictionary VanillaOptionStructureSubclassMap
+ {
+ get
+ {
+ if (_vanillaOptionStructureSubclassMap == null)
+ {
+ _vanillaOptionStructureSubclassMap = new ExpandoDictionary(new Dictionary()
+ {
+ {"香草","0"},
+ {"跨式","1"},
+ {"宽跨式","2"},
+ {"参与式看涨","3"},
+ {"两段参与式看涨","4"},
+ {"价差","5"},
+ {"区间保护看涨","6"},
+ {"有限区间保护看涨","7"},
+ {"区间保护看涨价差","8"},
+ {"有限区间保护看涨价差","9"},
+ {"鹰式","10"},
+ {"蝶式","11"},
+ {"其他香草及其组合","12"},
+ {"0","0"},
+ {"1","1"},
+ {"2","2"},
+ {"3","3"},
+ {"4","4"},
+ {"5","5"},
+ {"6","6"},
+ {"7","7"},
+ {"8","8"},
+ {"9","9"},
+ {"10","10"},
+ {"11","11"},
+ {"12","12"}
+ });
+ }
+ return _vanillaOptionStructureSubclassMap;
+ }
+ }
+
+ private static ExpandoDictionary _digitalOptionStructureSubclassMap;
+ ///
+ /// 期权结构小类
+ ///欧式二元:0
+ ///美式二元触碰:1
+ ///美式二元不触碰:2
+ ///美式双触碰:3
+ ///美式双不触碰:4
+ ///二元凹式:5
+ ///二元凸式:6
+ ///三层阶梯:7
+ ///四层阶梯:8
+ ///四层阶梯/:8
+ ///其他二元及其组合:9
+ ///
+ public static ExpandoDictionary DigitalOptionStructureSubclassMap
+ {
+ get
+ {
+ if (_digitalOptionStructureSubclassMap == null)
+ {
+ _digitalOptionStructureSubclassMap = new ExpandoDictionary(new Dictionary()
+ {
+ {"欧式二元","0"},
+ {"美式二元触碰","1"},
+ {"美式二元不触碰","2"},
+ {"美式双触碰","3"},
+ {"美式双不触碰","4"},
+ {"二元凹式","5"},
+ {"二元凸式","6"},
+ {"三层阶梯","7"},
+ {"四层阶梯","8"},
+ {"四层阶梯/","8"},
+ {"其他二元及其组合","9"},
+ {"0","0"},
+ {"1","1"},
+ {"2","2"},
+ {"3","3"},
+ {"4","4"},
+ {"5","5"},
+ {"6","6"},
+ {"7","7"},
+ {"8","8"},
+ {"9","9"}
+ });
+ }
+ return _digitalOptionStructureSubclassMap;
+ }
+ }
+
+ private static ExpandoDictionary _barrierOptionStructureSubclassMap;
+ ///
+ /// 期权结构小类
+ ///敲入障碍类:0
+ ///单向鲨鱼鳍:1
+ ///双向鲨鱼鳍:2
+ ///其他障碍及其组合:3
+ ///
+ public static ExpandoDictionary BarrierOptionStructureSubclassMap
+ {
+ get
+ {
+ if (_barrierOptionStructureSubclassMap == null)
+ {
+ _barrierOptionStructureSubclassMap = new ExpandoDictionary(new Dictionary()
+ {
+ {"敲入障碍类","0"},
+ {"单向鲨鱼鳍","1"},
+ {"双向鲨鱼鳍","2"},
+ {"其他障碍及其组合","3"},
+ {"0","0"},
+ {"1","1"},
+ {"2","2"},
+ {"3","3"}
+ });
+ }
+ return _barrierOptionStructureSubclassMap;
+ }
+ }
+
+ private static ExpandoDictionary _barrierObservationTypeMap;
+ ///
+ /// 期权结构小类
+ ///到期观察:0
+ ///每日观察:1
+ ///离散观察:2
+ ///
+ public static ExpandoDictionary BarrierObservationTypeMap
+ {
+ get
+ {
+ if (_barrierObservationTypeMap == null)
+ {
+ _barrierObservationTypeMap = new ExpandoDictionary(new Dictionary()
+ {
+ {"到期观察","0"},
+ {"每日观察","1"},
+ {"离散观察","2"},
+ {"0","0"},
+ {"1","1"},
+ {"2","2"}
+ });
+ }
+ return _barrierObservationTypeMap;
+ }
+ }
+
+ private static ExpandoDictionary _autoCallableOptionStructureSubclassMap;
+ ///
+ /// 期权结构小类
+ ///保本雪球(二元):0
+ ///保本雪球(三元):1
+ ///非保本普通型雪球:2
+ ///非保本要素(敲入、敲出、收益率)可变型雪球:3
+ ///非保本普通型凤凰:4
+ ///非保本要素(敲入、敲出、收益率) 可变型凤凰:5
+ ///其他自动赎回:6
+ ///
+ public static ExpandoDictionary AutoCallableOptionStructureSubclassMap
+ {
+ get
+ {
+ if (_autoCallableOptionStructureSubclassMap == null)
+ {
+ _autoCallableOptionStructureSubclassMap = new ExpandoDictionary(new Dictionary()
+ {
+ {"保本雪球(二元)","0"},
+ {"保本雪球(二元)","0"},
+ {"保本雪球(三元)","1"},
+ {"保本雪球(三元)","1"},
+ {"非保本普通型雪球","2"},
+ {"非保本要素(敲入、敲出、收益率)可变型雪球","3"},
+ {"非保本要素(敲入、敲出、收益率)可变型雪球","3"},
+ {"非保本要素(敲入\\敲出\\收益率)可变型雪球","3"},
+ {"非保本要素(敲入\\敲出\\收益率)可变型雪球","3"},
+ {"非保本普通型凤凰","4"},
+ {"非保本要素(敲入、敲出、收益率)可变型凤凰","5"},
+ {"非保本要素(敲入、敲出、收益率)可变型凤凰","5"},
+ {"非保本要素(敲入\\敲出\\收益率)可变型凤凰","5"},
+ {"非保本要素(敲入\\敲出\\收益率)可变型凤凰","5"},
+ {"其他自动赎回","6"},
+ {"0","0"},
+ {"1","1"},
+ {"2","2"},
+ {"3","3"},
+ {"4","4"},
+ {"5","5"},
+ {"6","6"}
+ });
+ }
+ return _autoCallableOptionStructureSubclassMap;
+ }
+ }
+
+ private static ExpandoDictionary _autoCallableWhetherDiscountedWarehouseTypeMap;
+ ///
+ /// 是否为折价建仓型
+ ///是:0
+ ///否:1
+ ///
+ public static ExpandoDictionary AutoCallableWhetherDiscountedWarehouseTypeMap
+ {
+ get
+ {
+ if (_autoCallableWhetherDiscountedWarehouseTypeMap == null)
+ {
+ _autoCallableWhetherDiscountedWarehouseTypeMap = new ExpandoDictionary(new Dictionary()
+ {
+ {"是","0"},
+ {"否","1"},
+ {"0","0"},
+ {"1","1"}
+ });
+ }
+ return _autoCallableWhetherDiscountedWarehouseTypeMap;
+ }
+ }
+
+ private static ExpandoDictionary _autoCallableWhetherRevenueEnhancedTypeMap;
+ ///
+ /// 是否为收益增强型
+ ///是:0
+ ///否:1
+ ///
+ public static ExpandoDictionary AutoCallableWhetherRevenueEnhancedTypeMap
+ {
+ get
+ {
+ if (_autoCallableWhetherRevenueEnhancedTypeMap == null)
+ {
+ _autoCallableWhetherRevenueEnhancedTypeMap = new ExpandoDictionary(new Dictionary()
+ {
+ {"是","0"},
+ {"否","1"},
+ {"0","0"},
+ {"1","1"}
+ });
+ }
+ return _autoCallableWhetherRevenueEnhancedTypeMap;
+ }
+ }
+
+ private static ExpandoDictionary _autoCallableWhetherKnockInPriceCoefficientIsVariableMap;
+ ///
+ /// 敲入价格系数是否可变
+ ///是:0
+ ///否:1
+ ///
+ public static ExpandoDictionary AutoCallableWhetherKnockInPriceCoefficientIsVariableMap
+ {
+ get
+ {
+ if (_autoCallableWhetherKnockInPriceCoefficientIsVariableMap == null)
+ {
+ _autoCallableWhetherKnockInPriceCoefficientIsVariableMap = new ExpandoDictionary(new Dictionary()
+ {
+ {"是","0"},
+ {"否","1"},
+ {"0","0"},
+ {"1","1"}
+ });
+ }
+ return _autoCallableWhetherKnockInPriceCoefficientIsVariableMap;
+ }
+ }
+
+ private static ExpandoDictionary _autoCallableWhetherKnockOutPriceCoefficientIsVariableMap;
+ ///
+ /// 敲出价格系数是否可变
+ ///是:0
+ ///否:1
+ ///
+ public static ExpandoDictionary AutoCallableWhetherKnockOutPriceCoefficientIsVariableMap
+ {
+ get
+ {
+ if (_autoCallableWhetherKnockOutPriceCoefficientIsVariableMap == null)
+ {
+ _autoCallableWhetherKnockOutPriceCoefficientIsVariableMap = new ExpandoDictionary(new Dictionary()
+ {
+ {"是","0"},
+ {"否","1"},
+ {"0","0"},
+ {"1","1"}
+ });
+ }
+ return _autoCallableWhetherKnockOutPriceCoefficientIsVariableMap;
+ }
+ }
+
+ private static ExpandoDictionary _autoCallableWhetherKnockOutYieldIsVariableMap;
+ ///
+ /// 敲出收益率是否可变
+ ///是:0
+ ///否:1
+ ///
+ public static ExpandoDictionary AutoCallableWhetherKnockOutYieldIsVariableMap
+ {
+ get
+ {
+ if (_autoCallableWhetherKnockOutYieldIsVariableMap == null)
+ {
+ _autoCallableWhetherKnockOutYieldIsVariableMap = new ExpandoDictionary(new Dictionary()
+ {
+ {"是","0"},
+ {"否","1"},
+ {"0","0"},
+ {"1","1"}
+ });
+ }
+ return _autoCallableWhetherKnockOutYieldIsVariableMap;
+ }
+ }
+
+ private static ExpandoDictionary _autoCallableWhetherDividendYieldIsVariableMap;
+ ///
+ /// 敲出收益率是否可变
+ ///是:0
+ ///否:1
+ ///
+ public static ExpandoDictionary AutoCallableWhetherDividendYieldIsVariableMap
+ {
+ get
+ {
+ if (_autoCallableWhetherDividendYieldIsVariableMap == null)
+ {
+ _autoCallableWhetherDividendYieldIsVariableMap = new ExpandoDictionary(new Dictionary()
+ {
+ {"是","0"},
+ {"否","1"},
+ {"0","0"},
+ {"1","1"}
+ });
+ }
+ return _autoCallableWhetherDividendYieldIsVariableMap;
+ }
+ }
+
+ private static ExpandoDictionary _rangeAccrualOptionStructureSubclassMap;
+ ///
+ /// 期权结构小类
+ ///区间累计:0
+ ///双层区间累计:1
+ ///其他区间累计:2
+ ///
+ public static ExpandoDictionary RangeAccrualOptionStructureSubclassMap
+ {
+ get
+ {
+ if (_rangeAccrualOptionStructureSubclassMap == null)
+ {
+ _rangeAccrualOptionStructureSubclassMap = new ExpandoDictionary(new Dictionary()
+ {
+ {"区间累计","0"},
+ {"双层区间累计","1"},
+ {"其他区间累计","2"},
+ {"0","0"},
+ {"1","1"},
+ {"2","2"}
+ });
+ }
+ return _rangeAccrualOptionStructureSubclassMap;
+ }
+ }
+
+ private static ExpandoDictionary _airbagOptionStructureSubclassMap;
+ ///
+ /// 期权结构小类
+ ///安全气囊看涨:0
+ ///安全气囊看涨价差:1
+ ///安全气囊看涨保护:2
+ ///安全气囊看涨价差保护:3
+ ///上段封顶安全气囊:4
+ ///上端封顶安全气囊:4
+ ///其他气囊结构:5
+ ///
+ public static ExpandoDictionary AirbagOptionStructureSubclassMap
+ {
+ get
+ {
+ if (_airbagOptionStructureSubclassMap == null)
+ {
+ _airbagOptionStructureSubclassMap = new ExpandoDictionary(new Dictionary()
+ {
+ {"安全气囊看涨","0"},
+ {"安全气囊看涨价差","1"},
+ {"安全气囊看涨保护","2"},
+ {"安全气囊看涨价差保护","3"},
+ {"上段封顶安全气囊","4"},
+ {"上端封顶安全气囊","4"},
+ {"其他气囊结构","5"},
+ {"0","0"},
+ {"1","1"},
+ {"2","2"},
+ {"3","3"},
+ {"4","4"},
+ {"5","5"}
+ });
+ }
+ return _airbagOptionStructureSubclassMap;
+ }
+ }
+
+ private static ExpandoDictionary _barrierEventStatusMap;
+ ///
+ /// 期权结构小类
+ ///已敲入:01
+ ///已敲出:02
+ ///
+ public static ExpandoDictionary BarrierEventStatusMap
+ {
+ get
+ {
+ if (_barrierEventStatusMap == null)
+ {
+ _barrierEventStatusMap = new ExpandoDictionary(new Dictionary()
+ {
+ {"已敲入","01"},
+ {"已敲出","02"},
+ {"1","01"},
+ {"2","02"},
+ {"01","01"},
+ {"02","02"}
+ });
+ }
+ return _barrierEventStatusMap;
+ }
+ }
}
}
diff --git a/Framework/YLErp.Core/DBModels/Enums/SuperviseReportTypeEnum.cs b/Framework/YLErp.Core/DBModels/Enums/SuperviseReportTypeEnum.cs
index 8689596d..df8d9e83 100644
--- a/Framework/YLErp.Core/DBModels/Enums/SuperviseReportTypeEnum.cs
+++ b/Framework/YLErp.Core/DBModels/Enums/SuperviseReportTypeEnum.cs
@@ -95,5 +95,15 @@
///
[Description("互换交易确认书附件")]
SAC_ConfirmationAtt = 17,
+ ///
+ /// 场外期权估值
+ ///
+ [Description("场外期权估值")]
+ SAC_ValuationInformation = 18,
+ ///
+ /// 场外期权交易确认书附件
+ ///
+ [Description("场外期权交易确认书附件")]
+ SAC_OptionConfirmationAtt = 19,
}
}
diff --git a/YLErpDAL/Modules/AppModule/AppUpgrader.cs b/YLErpDAL/Modules/AppModule/AppUpgrader.cs
index f9488b0b..4617f13f 100644
--- a/YLErpDAL/Modules/AppModule/AppUpgrader.cs
+++ b/YLErpDAL/Modules/AppModule/AppUpgrader.cs
@@ -210,7 +210,7 @@ namespace YLErp.Modules.AppModule
configService.AddDataIfNotExists("ProjectConfig", "SAC_FDEPOutboxPath", data?.PValue ?? "", "string", "FDEP发件箱目录,支持本地目录,内网共享目录和Ftp目录,共享路径例:\\\\192.168.1.200\\share-test\\ ;Ftp目录应填不包含根目录的相对目录例\\share-test\\ 注意:共享路径和ftp模式下,不要忘记最后的\\");
data = configService.RemoveData("ProjectConfig", "SACReportDataSource");
- configService.AddDataIfNotExists("ProjectConfig", "SAC_ReportDataSource", data?.PValue ?? "3", "int", "证券业报送数据源;1=Db;2=Excel模板;3=Db+Excel模板(该方式中涉及百分比汇总计算时仍使用模板中数据)");
+ configService.AddDataIfNotExists("ProjectConfig", "SAC_ReportDataSource", data?.PValue ?? "3", "int", "证券业报送数据源;2=Excel模板;");
configService.AddDataIfNotExists("ProjectConfig", "SAC_FtpUsePassive", data?.PValue ?? "false", "bool", "FDEP收发目录如果采用Ftp时,这里要选择是否为被动模式,不确定就选false");
diff --git a/YLErpDAL/Modules/SuperviseReportModule/SAC/Common/BaseCheckHelper.cs b/YLErpDAL/Modules/SuperviseReportModule/SAC/Common/BaseCheckHelper.cs
index 6e6a5a8b..29eabe0e 100644
--- a/YLErpDAL/Modules/SuperviseReportModule/SAC/Common/BaseCheckHelper.cs
+++ b/YLErpDAL/Modules/SuperviseReportModule/SAC/Common/BaseCheckHelper.cs
@@ -1,4 +1,4 @@
-using System.Globalization;
+using System.Globalization;
using System.Reflection;
namespace YLErp.Modules.SuperviseReportModule.SAC.Common
@@ -56,11 +56,11 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Common
public override bool Execute(object value)
{
- bool state = false;
- string text = (value?.ToString()) ?? "";
+ var state = false;
+ var text = (value?.ToString()) ?? "";
if (text.Length == 0)
{
- state = (!Required || IgnoreNullOrEmpty);
+ state = !Required || IgnoreNullOrEmpty;
}
else
{
@@ -258,7 +258,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Common
protected override bool Execute(string value)
{
- bool match = false;
+ var match = false;
if (Multiple)
{
var split = EndsWithString.Split(SplitStr.ToCharArray());
@@ -316,13 +316,13 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Common
protected override bool Execute(string value)
{
- bool result = true;
+ var result = true;
try
{
- result = DateTime.TryParseExact((value ?? ""), FormatString, CultureInfo.CurrentCulture, DateTimeStyles.None, out _);
+ result = DateTime.TryParseExact(value ?? "", FormatString, CultureInfo.CurrentCulture, DateTimeStyles.None, out _);
if (!result)
{
- result = DateTime.TryParse(value ?? "", out DateTime temp);
+ result = DateTime.TryParse(value ?? "", out var temp);
if (result)
{
UseChangeValue = true;
@@ -410,7 +410,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Common
minValue = MinValue_Number;
maxValue = MaxValue_Number;
}
- List msgArr = new List();
+ var msgArr = new List();
if (!double.IsNaN(minValue))
{
msgArr.Add(">={MinValue}");
@@ -439,7 +439,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Common
int beforePointMaxLength, afterPointMaxLength;
double maxValue, minValue;
- isPercent = value.EndsWith("%");
+ isPercent = isPercent = value != null && value.EndsWith("%");
if (isPercent)
{
value = value.Remove(value.Length - 1);
@@ -455,11 +455,11 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Common
maxValue = MaxValue_Number;
minValue = MinValue_Number;
}
- if (!double.TryParse(value, out double temp))
+ if (!double.TryParse(value, out var temp))
{
return false;
}
- string[] part = (value ?? "").Split('.');
+ var part = (value ?? "").Split('.');
if (part.Length > 2)
{
return false;
@@ -468,6 +468,14 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Common
{
return false;
}
+ if (!double.IsNaN(maxValue) && temp > maxValue)
+ {
+ return false;
+ }
+ if (!double.IsNaN(minValue) && temp < minValue)
+ {
+ return false;
+ }
if (part.Length > 1 && part[1].Length > afterPointMaxLength)
{
UseChangeValue = true;
@@ -476,14 +484,6 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Common
ChangedValue = temp.ToString(sufix) + (isPercent ? "%" : "");
return true;
}
- if (!double.IsNaN(maxValue) && temp > maxValue)
- {
- return false;
- }
- if (!double.IsNaN(minValue) && temp < minValue)
- {
- return false;
- }
return true;
}
@@ -492,7 +492,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Common
int beforePointMaxLength, afterPointMaxLength;
double maxValue, minValue;
- isPercent = isPercent = value != null && value.EndsWith("%");
+ isPercent = isPercent = value != null && value.EndsWith("%");
if (isPercent)
{
value = value.Remove(value.Length - 2);
@@ -512,8 +512,8 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Common
.Replace("{fieldValue}", value)
.Replace("{BeforePointMaxLength}", beforePointMaxLength.ToString())
.Replace("{AfterPointMaxLength}", afterPointMaxLength.ToString())
- .Replace("{MinValue}", maxValue.ToString())
- .Replace("{MaxValue}", minValue.ToString());
+ .Replace("{MinValue}", minValue.ToString())
+ .Replace("{MaxValue}", maxValue.ToString());
}
}
@@ -554,7 +554,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Common
{
//_errMsg = "{fieldName}={fieldValue}不合法,值应为数字,且最大保留位数为[{BeforePointMaxLength},{AfterPointMaxLength}]";
_errMsg = "值应为数字,且最大保留位数为[{BeforePointMaxLength},{AfterPointMaxLength}]";
- List msgArr = new List();
+ var msgArr = new List();
if (!double.IsNaN(MinValue))
{
msgArr.Add(">={MinValue}");
@@ -578,11 +578,11 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Common
protected override bool Execute(string value)
{
- if (!double.TryParse(value, out double temp))
+ if (!double.TryParse(value, out var temp))
{
return false;
}
- string[] part = (value ?? "").Split('.');
+ var part = (value ?? "").Split('.');
if (part.Length > 2)
{
return false;
@@ -591,23 +591,24 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Common
{
return false;
}
+ var state = true;
if (part.Length == 1 || (part.Length > 1 && part[1].Length != AfterPointMaxLength))
{
UseChangeValue = true;
- string sufix = "0.".PadRight(AfterPointMaxLength + 2, '0');
+ var sufix = "0.".PadRight(AfterPointMaxLength + 2, '0');
UseChangeValue = true;
ChangedValue = temp.ToString(sufix);
- return true;
+ state = true;
}
if (!double.IsNaN(MinValue) && temp < MinValue)
{
- return false;
+ state = false;
}
if (!double.IsNaN(MaxValue) && temp > MaxValue)
{
- return false;
+ state = false;
}
- return true;
+ return state;
}
protected override string GenerateErrMsg(string value)
@@ -659,7 +660,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Common
{
//_errMsg = "{fieldName}={fieldValue}不合法,值应为数字,且保留位数必须为[{BeforePointMaxLength},{AfterPointLength}]";
_errMsg = "值应为数字,且保留位数必须为[{BeforePointMaxLength},{AfterPointLength}]";
- List msgArr = new List();
+ var msgArr = new List();
if (!double.IsNaN(MinValue))
{
msgArr.Add(">={MinValue}");
@@ -683,7 +684,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Common
protected override bool Execute(string value)
{
- if (!double.TryParse(value, out double temp))
+ if (!double.TryParse(value, out var temp))
{
return false;
}
@@ -695,14 +696,14 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Common
{
return false;
}
- string[] part = (value ?? "").Split('.');
+ var part = (value ?? "").Split('.');
if (part[0].Length > BeforePointMaxLength)
{
return false;
}
if (part.Length == 1 || (part.Length > 1 && part[1].Length != AfterPointLength))
{
- string sufix = "0.".PadRight(AfterPointLength + 2, '0');
+ var sufix = "0.".PadRight(AfterPointLength + 2, '0');
UseChangeValue = true;
ChangedValue = temp.ToString(sufix);
return true;
@@ -728,8 +729,8 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Common
{
public override bool Execute(object value)
{
- bool state = false;
- IEnumerable
- [CheckStringIntLength(BeforePointMaxLength = 34, AfterPointLength = 2)]
+ [CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 2)]
[DefaultValue("")]
[SacDescription("HoldTrustProductAtTheEndOfThisMonth", "本月末持有信托产品(元)", "36,2", true, "校验规则:保留两位小数;")]
public string HoldTrustProductAtTheEndOfThisMonth { get; set; }
@@ -1711,7 +1712,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 必填:是
/// 说明:校验规则:保留两位小数;
///
- [CheckStringIntLength(BeforePointMaxLength = 34, AfterPointLength = 2)]
+ [CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 2)]
[DefaultValue("")]
[SacDescription("HoldTrustProductAtTheEndOfLastMonth", "上月末持有信托产品(元)", "36,2", true, "校验规则:保留两位小数;")]
public string HoldTrustProductAtTheEndOfLastMonth { get; set; }
@@ -1722,7 +1723,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 必填:是
/// 说明:校验规则:保留两位小数;
///
- [CheckStringIntLength(BeforePointMaxLength = 34, AfterPointLength = 2)]
+ [CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 2)]
[DefaultValue("")]
[SacDescription("InsuranceProductsAreHeldAtTheEndOfThisMonth", "本月末持有保险产品(元)", "36,2", true, "校验规则:保留两位小数;")]
public string InsuranceProductsAreHeldAtTheEndOfThisMonth { get; set; }
@@ -1733,7 +1734,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 必填:是
/// 说明:校验规则:保留两位小数;
///
- [CheckStringIntLength(BeforePointMaxLength = 34, AfterPointLength = 2)]
+ [CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 2)]
[DefaultValue("")]
[SacDescription("InsuranceProductsAreHeldAtTheEndOfLastMonth", "上月末持有保险产品(元)", "36,2", true, "校验规则:保留两位小数;")]
public string InsuranceProductsAreHeldAtTheEndOfLastMonth { get; set; }
@@ -1744,7 +1745,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 必填:是
/// 说明:校验规则:保留两位小数;
///
- [CheckStringIntLength(BeforePointMaxLength = 34, AfterPointLength = 2)]
+ [CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 2)]
[DefaultValue("")]
[SacDescription("HoldOtherProductsAtTheEndOfThisMonth", "本月末持有其他产品(元)", "36,2", true, "校验规则:保留两位小数;")]
public string HoldOtherProductsAtTheEndOfThisMonth { get; set; }
@@ -1755,7 +1756,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 必填:是
/// 说明:校验规则:保留两位小数;
///
- [CheckStringIntLength(BeforePointMaxLength = 34, AfterPointLength = 2)]
+ [CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 2)]
[DefaultValue("")]
[SacDescription("HoldOtherProductsAtTheEndOfLastMonth", "上月末持有其他产品(元)", "36,2", true, "校验规则:保留两位小数;")]
public string HoldOtherProductsAtTheEndOfLastMonth { get; set; }
@@ -1777,7 +1778,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 必填:是
/// 说明:校验规则:保留四位小数;
///
- [CheckStringIntLength(BeforePointMaxLength = 34, AfterPointLength = 4)]
+ [CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 4)]
[DefaultValue("")]
[SacDescription("SettledSwapTransactionInvolvesNotionalPrincipalAtThisMonth", "互换本月了结交易涉及名义本金(亿元)", "36,4", true, "校验规则:保留四位小数;")]
public string SettledSwapTransactionInvolvesNotionalPrincipalAtThisMonth { get; set; }
@@ -1788,7 +1789,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 必填:是
/// 说明:校验规则:保留四位小数;
///
- [CheckStringIntLength(BeforePointMaxLength = 34, AfterPointLength = 4)]
+ [CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 4)]
[DefaultValue("")]
[SacDescription("SwapIncomeCashFlow", "互换收入现金流(万元)", "36,4", true, "校验规则:保留四位小数;")]
public string SwapIncomeCashFlow { get; set; }
@@ -1799,20 +1800,20 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 必填:是
/// 说明:校验规则:保留四位小数;
///
- [CheckStringIntLength(BeforePointMaxLength = 34, AfterPointLength = 4)]
+ [CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 4)]
[DefaultValue("")]
[SacDescription("SwapExpensesCashFlow", "互换支出现金流(万元)", "36,4", true, "校验规则:保留四位小数;")]
public string SwapExpensesCashFlow { get; set; }
///
- /// 互换使用预付金形成的净收益对应现金流(万元)
+ /// 互换使用保证金形成的净收益对应现金流(万元)
/// 长度:36,4
/// 必填:是
/// 说明:校验规则:保留四位小数;
///
- [CheckStringIntLength(BeforePointMaxLength = 34, AfterPointLength = 4)]
+ [CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 4)]
[DefaultValue("")]
- [SacDescription("CashFlowCorrespondingToNetIncomeOnSwapMargin", "互换使用预付金形成的净收益对应现金流(万元)", "36,4", true, "校验规则:保留四位小数;")]
+ [SacDescription("CashFlowCorrespondingToNetIncomeOnSwapMargin", "互换使用保证金形成的净收益对应现金流(万元)", "36,4", true, "校验规则:保留四位小数;")]
public string CashFlowCorrespondingToNetIncomeOnSwapMargin { get; set; }
///
@@ -1821,7 +1822,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 必填:是
/// 说明:校验规则:保留四位小数;
///
- [CheckStringIntLength(BeforePointMaxLength = 34, AfterPointLength = 4)]
+ [CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 4)]
[DefaultValue("")]
[SacDescription("SwapHedgeCost", "互换对冲成本(万元)", "36,4", true, "校验规则:保留四位小数;")]
public string SwapHedgeCost { get; set; }
@@ -1843,7 +1844,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 必填:是
/// 说明:校验规则:保留四位小数;
///
- [CheckStringIntLength(BeforePointMaxLength = 34, AfterPointLength = 4)]
+ [CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 4)]
[DefaultValue("")]
[SacDescription("SettledOptionTransactionInvolvesNotionalPrincipalAtThisMonth", "期权本月了结交易涉及名义本金(亿元)", "36,4", true, "校验规则:保留四位小数;")]
public string SettledOptionTransactionInvolvesNotionalPrincipalAtThisMonth { get; set; }
@@ -1854,7 +1855,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 必填:是
/// 说明:校验规则:保留四位小数;
///
- [CheckStringIntLength(BeforePointMaxLength = 34, AfterPointLength = 4)]
+ [CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 4)]
[DefaultValue("")]
[SacDescription("OptionPremiumIncome", "期权权利金收入(万元)", "36,4", true, "校验规则:保留四位小数;")]
public string OptionPremiumIncome { get; set; }
@@ -1865,7 +1866,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 必填:是
/// 说明:校验规则:保留四位小数;
///
- [CheckStringIntLength(BeforePointMaxLength = 34, AfterPointLength = 4)]
+ [CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 4)]
[DefaultValue("")]
[SacDescription("OptionHedgeCost", "期权对冲成本(万元)", "36,4", true, "校验规则:保留四位小数;")]
public string OptionHedgeCost { get; set; }
@@ -1876,7 +1877,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 必填:是
/// 说明:校验规则:保留四位小数;
///
- [CheckStringIntLength(BeforePointMaxLength = 34, AfterPointLength = 4)]
+ [CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 4)]
[DefaultValue("")]
[SacDescription("BalanceOfSwapRealizedGainsAndLossesAtThisMonth", "互换合约端损益本月发生额(万元)", "36,4", true, "校验规则:保留四位小数;")]
public string BalanceOfSwapRealizedGainsAndLossesAtThisMonth { get; set; }
@@ -1887,7 +1888,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 必填:是
/// 说明:校验规则:保留四位小数;
///
- [CheckStringIntLength(BeforePointMaxLength = 34, AfterPointLength = 4)]
+ [CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 4)]
[DefaultValue("")]
[SacDescription("BalanceOfOptionRealizedGainsAndLossesAtThisMonth", "期权合约端损益本月发生额(万元)", "36,4", true, "校验规则:保留四位小数;")]
public string BalanceOfOptionRealizedGainsAndLossesAtThisMonth { get; set; }
@@ -1898,7 +1899,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 必填:是
/// 说明:校验规则:保留四位小数;
///
- [CheckStringIntLength(BeforePointMaxLength = 34, AfterPointLength = 4)]
+ [CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 4)]
[DefaultValue("")]
[SacDescription("BalanceOfSwapRealizedGainsAndLossesAtThisYear", "互换合约端损益本年累计额(万元)", "36,4", true, "校验规则:保留四位小数;")]
public string BalanceOfSwapRealizedGainsAndLossesAtThisYear { get; set; }
@@ -1909,7 +1910,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 必填:是
/// 说明:校验规则:保留四位小数;
///
- [CheckStringIntLength(BeforePointMaxLength = 34, AfterPointLength = 4)]
+ [CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 4)]
[DefaultValue("")]
[SacDescription("BalanceOfOptionRealizedGainsAndLossesAtThisYear", "期权合约端损益本年累计额(万元)", "36,4", true, "校验规则:保留四位小数;")]
public string BalanceOfOptionRealizedGainsAndLossesAtThisYear { get; set; }
@@ -1920,7 +1921,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 必填:是
/// 说明:校验规则:保留四位小数;
///
- [CheckStringIntLength(BeforePointMaxLength = 34, AfterPointLength = 4)]
+ [CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 4)]
[DefaultValue("")]
[SacDescription("BalanceOfSwapChangedGainsAndLossesInFairValueAtThisMonth", "互换对冲端损益本月发生额(万元)", "36,4", true, "校验规则:保留四位小数;")]
public string BalanceOfSwapChangedGainsAndLossesInFairValueAtThisMonth { get; set; }
@@ -1931,7 +1932,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 必填:是
/// 说明:校验规则:保留四位小数;
///
- [CheckStringIntLength(BeforePointMaxLength = 34, AfterPointLength = 4)]
+ [CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 4)]
[DefaultValue("")]
[SacDescription("BalanceOfOptionChangedGainsAndLossesInFairValueAtThisMonth", "期权对冲端损益本月发生额(万元)", "36,4", true, "校验规则:保留四位小数;")]
public string BalanceOfOptionChangedGainsAndLossesInFairValueAtThisMonth { get; set; }
@@ -1942,7 +1943,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 必填:是
/// 说明:校验规则:保留四位小数;
///
- [CheckStringIntLength(BeforePointMaxLength = 34, AfterPointLength = 4)]
+ [CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 4)]
[DefaultValue("")]
[SacDescription("BalanceOfSwapChangedGainsAndLossesInFairValueAtThisYear", "互换对冲端损益本年累计额(万元)", "36,4", true, "校验规则:保留四位小数;")]
public string BalanceOfSwapChangedGainsAndLossesInFairValueAtThisYear { get; set; }
@@ -1953,7 +1954,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 必填:是
/// 说明:校验规则:保留四位小数;
///
- [CheckStringIntLength(BeforePointMaxLength = 34, AfterPointLength = 4)]
+ [CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 4)]
[DefaultValue("")]
[SacDescription("BalanceOfOptionChangedGainsAndLossesInFairValueAtThisYear", "期权对冲端损益本年累计额(万元)", "36,4", true, "校验规则:保留四位小数;")]
public string BalanceOfOptionChangedGainsAndLossesInFairValueAtThisYear { get; set; }
@@ -1964,7 +1965,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 必填:是
/// 说明:校验规则:保留四位小数;
///
- [CheckStringIntLength(BeforePointMaxLength = 34, AfterPointLength = 4)]
+ [CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 4)]
[DefaultValue("")]
[SacDescription("BalanceOfSwapTotalGainsAndLossesAtThisMonth", "互换损益合计本月发生额(万元)", "36,4", true, "校验规则:保留四位小数;")]
public string BalanceOfSwapTotalGainsAndLossesAtThisMonth { get; set; }
@@ -1975,7 +1976,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 必填:是
/// 说明:校验规则:保留四位小数;
///
- [CheckStringIntLength(BeforePointMaxLength = 34, AfterPointLength = 4)]
+ [CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 4)]
[DefaultValue("")]
[SacDescription("BalanceOfOptionTotalGainsAndLossesAtThisMonth", "期权损益合计本月发生额(万元)", "36,4", true, "校验规则:保留四位小数;")]
public string BalanceOfOptionTotalGainsAndLossesAtThisMonth { get; set; }
@@ -1986,7 +1987,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 必填:是
/// 说明:校验规则:保留四位小数;
///
- [CheckStringIntLength(BeforePointMaxLength = 34, AfterPointLength = 4)]
+ [CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 4)]
[DefaultValue("")]
[SacDescription("BalanceOfSwapTotalGainsAndLossesAtThisYear", "互换损益合计本年累计额(万元)", "36,4", true, "校验规则:保留四位小数;")]
public string BalanceOfSwapTotalGainsAndLossesAtThisYear { get; set; }
@@ -1997,7 +1998,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 必填:是
/// 说明:校验规则:保留四位小数;
///
- [CheckStringIntLength(BeforePointMaxLength = 34, AfterPointLength = 4)]
+ [CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 4)]
[DefaultValue("")]
[SacDescription("BalanceOfOptionTotalGainsAndLossesAtThisYear", "期权损益合计本年累计额(万元)", "36,4", true, "校验规则:保留四位小数;")]
public string BalanceOfOptionTotalGainsAndLossesAtThisYear { get; set; }
@@ -2033,14 +2034,14 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
public List TargetCaseAndHedgeTuple { get; set; }
///
- /// 收益互换整体业务存量对应预付金(元)+ 期权费(元)
+ /// 收益互换整体业务存量对应保证金(元)+ 期权费(元)
/// 长度:36,2
/// 必填:是
/// 说明:校验规则:保留两位小数
///
[CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 2)]
[DefaultValue("")]
- [SacDescription("MarginOfSubsistSwap", "收益互换整体业务存量对应预付金(元)+", "36,2", true, "校验规则:保留两位小数;")]
+ [SacDescription("MarginOfSubsistSwap", "收益互换整体业务存量对应保证金(元)+ 期权费(元)", "36,2", true, "校验规则:保留两位小数;")]
public string MarginOfSubsistSwap { get; set; }
///
@@ -2066,14 +2067,14 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
public string LeverageRatiOfSwap { get; set; }
///
- /// 收益互换股指标的存量对应预付金(元)+ 期权费(元)
+ /// 收益互换股指标的存量对应保证金(元)+ 期权费(元)
/// 长度:36,2
/// 必填:是
/// 说明:校验规则:保留两位小数
///
[CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 2)]
[DefaultValue("")]
- [SacDescription("MarginOfSubsistStockIndexSwap", "收益互换股指标的存量对应预付金(元)+", "36,2", true, "校验规则:保留两位小数;")]
+ [SacDescription("MarginOfSubsistStockIndexSwap", "收益互换股指标的存量对应保证金(元)+ 期权费(元)", "36,2", true, "校验规则:保留两位小数;")]
public string MarginOfSubsistStockIndexSwap { get; set; }
///
@@ -2099,14 +2100,14 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
public string LeverageRatioOfStockIndexSwap { get; set; }
///
- /// 收益互换个股标的存量对应预付金(元)+ 期权费(元)
+ /// 收益互换个股标的存量对应保证金(元)+ 期权费(元)
/// 长度:36,2
/// 必填:是
/// 说明:校验规则:保留两位小数
///
[CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 2)]
[DefaultValue("")]
- [SacDescription("MarginOfSubsistStockSwap", "收益互换个股标的存量对应预付金(元)+", "36,2", true, "校验规则:保留两位小数;")]
+ [SacDescription("MarginOfSubsistStockSwap", "收益互换个股标的存量对应保证金(元)+ 期权费(元)", "36,2", true, "校验规则:保留两位小数;")]
public string MarginOfSubsistStockSwap { get; set; }
///
@@ -2132,14 +2133,14 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
public string LeverageRatioOfStockSwap { get; set; }
///
- /// 场外期权整体业务存量对应预付金(元)+ 期权费(元)
+ /// 场外期权整体业务存量对应保证金(元)+ 期权费(元)
/// 长度:36,2
/// 必填:是
/// 说明:校验规则:保留两位小数
///
[CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 2)]
[DefaultValue("")]
- [SacDescription("MarginandPremiumOfSubsistOption", "场外期权整体业务存量对应预付金(元)+", "36,2", true, "校验规则:保留两位小数;")]
+ [SacDescription("MarginandPremiumOfSubsistOption", "场外期权整体业务存量对应保证金(元)+ 期权费(元)", "36,2", true, "校验规则:保留两位小数;")]
public string MarginandPremiumOfSubsistOption { get; set; }
///
@@ -2165,14 +2166,14 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
public string LeverageRatioOfOption { get; set; }
///
- /// 场外期权股指标的存量对应预付金(元)+ 期权费(元)
+ /// 场外期权股指标的存量对应保证金(元)+ 期权费(元)
/// 长度:36,2
/// 必填:是
/// 说明:校验规则:保留两位小数
///
[CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 2)]
[DefaultValue("")]
- [SacDescription("MarginandPremiumOfSubsistStockIndexOption", "场外期权股指标的存量对应预付金(元)+", "36,2", true, "校验规则:保留两位小数;")]
+ [SacDescription("MarginandPremiumOfSubsistStockIndexOption", "场外期权股指标的存量对应保证金(元)+ 期权费(元)", "36,2", true, "校验规则:保留两位小数;")]
public string MarginandPremiumOfSubsistStockIndexOption { get; set; }
///
@@ -2198,14 +2199,14 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
public string LeverageRatioOfStockIndexOption { get; set; }
///
- /// 场外期权个股标的存量对应预付金(元)+ 期权费(元)
+ /// 场外期权个股标的存量对应保证金(元)+ 期权费(元)
/// 长度:36,2
/// 必填:是
/// 说明:校验规则:保留两位小数
///
[CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 2)]
[DefaultValue("")]
- [SacDescription("MarginandPremiumOfSubsistStockOption", "场外期权个股标的存量对应预付金(元)+", "36,2", true, "校验规则:保留两位小数;")]
+ [SacDescription("MarginandPremiumOfSubsistStockOption", "场外期权个股标的存量对应保证金(元)+ 期权费(元)", "36,2", true, "校验规则:保留两位小数;")]
public string MarginandPremiumOfSubsistStockOption { get; set; }
///
@@ -2454,7 +2455,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
///
/// 标的情况与对冲
///
- public class TargetCaseAndHedgeModel
+ public class TargetCaseAndHedgeModel : ReportSubBaseModel
{
///
/// 报送机构名称(全称)
@@ -2576,7 +2577,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 权益类填写股数
///
///
- [CheckStringIntLength(MinValue = 0, BeforePointMaxLength = 36, AfterPointLength = 6, Required = false)]
+ [CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 6, Required = false)]
[DefaultValue("")]
[SacDescription("TheNumberOfPositionsHeldAtTheEndOfThisMonth", "本月末持仓数量(股/手)", "36,6", false, "校验规则:大于等于0;\r\n权益类填写股数;")]
public string TheNumberOfPositionsHeldAtTheEndOfThisMonth { get; set; }
@@ -2591,12 +2592,21 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
[DefaultValue("")]
[SacDescription("AveragePriceAtTheEndOfTheMonth", "本月末持仓平均价格(元)", "36,2", false, "校验规则:保留两位小数;")]
public string AveragePriceAtTheEndOfTheMonth { get; set; }
+ ///
+ /// 序号
+ /// 长度:
+ /// 必填:否
+ /// 说明:
+ ///
+ [XmlIgnore]
+ [SacDescription("Index", "序号", "", false, "")]
+ public string Index { get; set; }
}
///
/// 本月末存量业务明细
///
- public class InventoryBusinessDetailsAtTheEndOfThisMonthModel
+ public class InventoryBusinessDetailsAtTheEndOfThisMonthModel : ReportSubBaseModel
{
///
/// 报送机构名称(全称)
@@ -2667,22 +2677,22 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 名义本金(或多头名义本金)(元)
/// 长度:36,2
/// 必填:否
- /// 说明:校验规则:保留两位小数;
+ /// 说明:校验规则:保留2位小数,同时总的字符长度不能超过20,即整数位最多可为15位;
///
[CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 2, Required = false)]
[DefaultValue("")]
- [SacDescription("NotionalPrincipalAmountLNotionalPrincipalAmount", "名义本金(或多头名义本金)(元)", "36,2", false, "校验规则:保留两位小数;")]
+ [SacDescription("NotionalPrincipalAmountLNotionalPrincipalAmount", "名义本金(或多头名义本金)(元)", "36,2", false, "校验规则:保留2位小数,同时总的字符长度不能超过20,即整数位最多可为15位;")]
public string NotionalPrincipalAmountLNotionalPrincipalAmount { get; set; }
///
/// 空头名义本金(元)(多空组合填写)
/// 长度:36,2
/// 必填:否
- /// 说明:校验规则:保留两位小数;
+ /// 说明:校验规则:保留2位小数,同时总的字符长度不能超过20,即整数位最多可为15位;
///
[CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 2, Required = false)]
[DefaultValue("")]
- [SacDescription("SNotionalPrincipalAmount", "空头名义本金(元)(多空组合填写)", "36,2", false, "校验规则:保留两位小数;")]
+ [SacDescription("SNotionalPrincipalAmount", "空头名义本金(元)(多空组合填写)", "36,2", false, "校验规则:保留2位小数,同时总的字符长度不能超过20,即整数位最多可为15位;")]
public string SNotionalPrincipalAmount { get; set; }
///
@@ -2754,12 +2764,12 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 期权标的小类(场外期权填写)
/// 长度:2
/// 必填:否
- /// 说明:校验规则:如业务类型为期权,需填写本字段;
+ /// 说明:校验规则:如业务类型为期权,需填写本字段;
///
[CheckConditionStringValue(ConditionName = nameof(BusinessType), ConditionValue = "02", CheckHandleNameArr = new[] { "A" })]
[CheckConditionStringNEQValue(ConditionName = nameof(BusinessType), ConditionValue = "02", CheckHandleNameArr = new[] { "B" })]
- [CheckStringInMap(Map = new[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "99" }, CheckHandleName = "A")]
- [CheckStringInMap(Map = new[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "99" }, Required = false, CheckHandleName = "B")]
+ [CheckStringInMap(Map = new[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "99" }, CheckHandleName = "A")]
+ [CheckStringInMap(Map = new[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "99" }, Required = false, CheckHandleName = "B")]
[DefaultValue("")]
[SacDescription("OptionSumInvestmentTargetType", "期权标的小类(场外期权填写)", "2", false, "校验规则:如业务类型为期权,需填写本字段;")]
public string OptionSumInvestmentTargetType { get; set; }
@@ -2793,27 +2803,27 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
public string OptionFee { get; set; }
///
- /// 期权类型
+ /// 期权结构类型(期权填写)
/// 长度:2
/// 必填:否
/// 说明: 校验规则:如业务类型为期权,需填写本字段;
///
[CheckConditionStringValue(ConditionName = nameof(BusinessType), ConditionValue = "02", CheckHandleNameArr = new[] { "A" })]
[CheckConditionStringNEQValue(ConditionName = nameof(BusinessType), ConditionValue = "02", CheckHandleNameArr = new[] { "B" })]
- [CheckStringInMap(Map = new[] { "0", "1", "2", "4", "5", "6", "7", "99" }, CheckHandleName = "A")]
- [CheckStringInMap(Map = new[] { "0", "1", "2", "4", "5", "6", "7", "99" }, Required = false, CheckHandleName = "B")]
+ [CheckStringInMap(Map = new[] { "0", "1", "2", "3", "4", "5", "99" }, CheckHandleName = "A")]
+ [CheckStringInMap(Map = new[] { "0", "1", "2", "3", "4", "5", "99" }, Required = false, CheckHandleName = "B")]
[DefaultValue("")]
- [SacDescription("OptionType", "期权类型", "2", false, "校验规则:如业务类型为期权,需填写本字段;")]
+ [SacDescription("OptionType", "期权结构类型(期权填写)", "2", false, "校验规则:如业务类型为期权,需填写本字段;")]
public string OptionType { get; set; }
///
- /// 本月末维持预付金比例(%)
+ /// 本月末维持保证金比例(%)
/// 长度:36,2
/// 必填:否
///
- /// 说明:指月末维持预付金加浮动盈亏占合约存续名义本金的比例;
- /// 对于多空互换,指维持预付金加浮动盈亏占多头名义本金和空头名义本金孰高的比例.
- /// 例如维持预付金比例为50%,填写50.00
+ /// 说明:指月末维持保证金加浮动盈亏占合约存续名义本金的比例;
+ /// 对于多空互换,指维持保证金加浮动盈亏占多头名义本金和空头名义本金孰高的比例.
+ /// 例如维持保证金比例为50%,填写50.00
///
///
[CheckConditionStringInMap(ConditionName = nameof(BusinessType), ConditionMap = new[] { "11", "12" }, CheckHandleNameArr = new[] { "A" })]
@@ -2821,7 +2831,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
[CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 2, CheckHandleName = "A")]
[CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 2, Required = false, CheckHandleName = "B")]
[DefaultValue("")]
- [SacDescription("MaitainMarginRation", "本月末维持预付金比例(%)", "36,2", false, "指月末维持预付金加浮动盈亏占合约存续名义本金的比例;\r\n对于多空互换,指维持预付金加浮动盈亏占多头名义本金和空头名义本金孰高的比例.\r\n例如维持预付金比例为50%,填写50.00;")]
+ [SacDescription("MaitainMarginRation", "本月末维持保证金比例(%)", "36,2", false, "指月末维持保证金加浮动盈亏占合约存续名义本金的比例;\r\n对于多空互换,指维持保证金加浮动盈亏占多头名义本金和空头名义本金孰高的比例.\r\n例如维持保证金比例为50%,填写50.00;")]
public string MaitainMarginRation { get; set; }
///
/// 标的相关系数
@@ -2870,12 +2880,22 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
[DefaultValue("")]
[SacDescription("ShortPositionContractValue", "空头合约价值(元)", "36,2", false, "客户空头、多空组合收益互换需填写;\r\n保留两位小数;")]
public string ShortPositionContractValue { get; set; }
+
+ ///
+ /// 序号
+ /// 长度:
+ /// 必填:否
+ /// 说明:
+ ///
+ [XmlIgnore]
+ [SacDescription("Index", "序号", "", false, "")]
+ public string Index { get; set; }
}
///
/// 本月新增业务明细
///
- public class IncreaseBusinessDetailsThisMonthModel
+ public class IncreaseBusinessDetailsThisMonthModel : ReportSubBaseModel
{
///
/// 报送机构名称(全称)
@@ -2949,22 +2969,22 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 名义本金(或多头名义本金)(元)
/// 长度:36,2
/// 必填:否
- /// 说明:校验规则:保留两位小数;
+ /// 说明:校验规则:保留4位小数,同时总的字符长度不能超过20,即整数位最多可为15位;
///
[CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 2, Required = false)]
[DefaultValue("")]
- [SacDescription("NotionalPrincipalAmountLNotionalPrincipalAmount", "名义本金(或多头名义本金)(元)", "36,2", false, "校验规则:保留两位小数;")]
+ [SacDescription("NotionalPrincipalAmountLNotionalPrincipalAmount", "名义本金(或多头名义本金)(元)", "36,2", false, "校验规则:保留2位小数,同时总的字符长度不能超过20,即整数位最多可为15位;")]
public string NotionalPrincipalAmountLNotionalPrincipalAmount { get; set; }
///
/// 空头名义本金(元)(多空组合填写)
/// 长度:36,2
/// 必填:否
- /// 说明:校验规则:保留两位小数;
+ /// 说明:校验规则:保留2位小数,同时总的字符长度不能超过20,即整数位最多可为15位;
///
[CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 2, Required = false)]
[DefaultValue("")]
- [SacDescription("SNotionalPrincipalAmount", "空头名义本金(元)(多空组合填写)", "36,2", false, "校验规则:保留两位小数;")]
+ [SacDescription("SNotionalPrincipalAmount", "空头名义本金(元)(多空组合填写)", "36,2", false, "校验规则:保留2位小数,同时总的字符长度不能超过20,即整数位最多可为15位;")]
public string SNotionalPrincipalAmount { get; set; }
///
@@ -3030,12 +3050,12 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 期权标的小类(场外期权填写)
/// 长度:2
/// 必填:否
- /// 说明:校验规则:如业务类型为场外期权,需填写本字段;
+ /// 说明:校验规则:如业务类型为场外期权,需填写本字段;
///
[CheckConditionStringValue(ConditionName = nameof(BusinessType), ConditionValue = "02", CheckHandleNameArr = new[] { "A" })]
[CheckConditionStringNEQValue(ConditionName = nameof(BusinessType), ConditionValue = "02", CheckHandleNameArr = new[] { "B" })]
- [CheckStringInMap(Map = new[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "99" }, CheckHandleName = "A")]
- [CheckStringInMap(Map = new[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "99" }, Required = false, CheckHandleName = "B")]
+ [CheckStringInMap(Map = new[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "99" }, CheckHandleName = "A")]
+ [CheckStringInMap(Map = new[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "99" }, Required = false, CheckHandleName = "B")]
[DefaultValue("")]
[SacDescription("OptionObjectSecondClass", "期权标的小类(场外期权填写)", "2", false, "校验规则:如业务类型为场外期权,需填写本字段;")]
public string OptionObjectSecondClass { get; set; }
@@ -3072,17 +3092,26 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
public string NonAnnualOptionFee { get; set; }
///
- /// 期权类型(期权填写)
+ /// 期权结构类型(期权填写)
/// 长度:2
/// 必填:否
/// 说明:校验规则:如业务类型为期权,需填写本字段;
///
[CheckConditionStringValue(ConditionName = nameof(BusinessType), ConditionValue = "02", CheckHandleNameArr = new[] { "A" })]
[CheckConditionStringNEQValue(ConditionName = nameof(BusinessType), ConditionValue = "02", CheckHandleNameArr = new[] { "B" })]
- [CheckStringInMap(Map = new[] { "0", "1", "2", "4", "5", "6", "7", "99" }, Required = false, CheckHandleName = "A")]
- [CheckStringInMap(Map = new[] { "0", "1", "2", "4", "5", "6", "7", "99" }, Required = false, CheckHandleName = "B")]
+ [CheckStringInMap(Map = new[] { "0", "1", "2", "3", "4", "5", "99" }, CheckHandleName = "A")]
+ [CheckStringInMap(Map = new[] { "0", "1", "2", "3", "4", "5", "99" }, Required = false, CheckHandleName = "B")]
[DefaultValue("")]
- [SacDescription("OptionType", "期权类型(期权填写)", "2", false, "校验规则:如业务类型为期权,需填写本字段;")]
+ [SacDescription("OptionType", "期权结构类型(期权填写)", "2", false, "校验规则:如业务类型为期权,需填写本字段;")]
public string OptionType { get; set; }
+ ///
+ /// 序号
+ /// 长度:
+ /// 必填:否
+ /// 说明:
+ ///
+ [XmlIgnore]
+ [SacDescription("Index", "序号", "", false, "")]
+ public string Index { get; set; }
}
}
\ No newline at end of file
diff --git a/YLErpDAL/Modules/SuperviseReportModule/SAC/Model/ReportReq.cs b/YLErpDAL/Modules/SuperviseReportModule/SAC/Model/ReportReq.cs
index 0747b149..1e546bb6 100644
--- a/YLErpDAL/Modules/SuperviseReportModule/SAC/Model/ReportReq.cs
+++ b/YLErpDAL/Modules/SuperviseReportModule/SAC/Model/ReportReq.cs
@@ -1,4 +1,6 @@
-using System.Collections.ObjectModel;
+using System.Collections.ObjectModel;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
using System.Xml.Serialization;
using YLErp.Modules.SuperviseReportModule.SAC.Common;
using static YLErp.DBModels.Consts.ConsReport;
@@ -95,6 +97,18 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 报告类型
///
public List ReportTypes { get; set; }
+
+ ///
+ /// 证券业报送中定期报告取值模式
+ /// 1=Db;
+ /// 2=Excel模板;
+ /// 3=Db+Excel模板(该方式中涉及百分比汇总计算时仍使用模板中数据)
+ /// 4=金仕达视图(该方式只涉及互换确认书及存续期的数据)
+ /// 5=Db+金仕达视图
+ /// 6=Excel+金仕达视图
+ /// 7=Db+Excel+金仕达视图
+ ///
+ public SAC_ReportDataSourceEnum DataSource { get; set; }
}
public class ReportResponse
@@ -112,7 +126,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
{
return "";
}
- return $"OTC_{Infos[0].Header.SenderCode}_{Infos[0].Header.ReceiverCode}_{Infos[0].Header.ReportType}_{Infos[0].Header.SendDate.Replace("-", "")}_{Index.ToString("0000")}";
+ return $"OTC_{Infos[0].Header.SenderCode}_{Infos[0].Header.ReceiverCode}_{Infos[0].Header.ReportType}_{Infos[0].Header.SendDate.Replace("-", "")}_{Index.ToString("0000")}{(Infos.Any(O => O.Header.BusiDataType == DataFlagsEnum.A1015) ? "_checked" : "")}";
}
}
@@ -126,13 +140,26 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 仅外部数据来源使用
///
[XmlIgnore]
+ [NotMapped]
public bool IgnoreCheck { get; set; }
+
+ [Key]
+ [XmlIgnore]
+ public int Id { get; set; }
+
+ ///
+ /// 报送日期
+ ///
+ [XmlIgnore]
+ public DateTime ReportDate { get; set; }
+
///
/// 业务数据流水号
/// 长度:28
/// 必填:是
/// 说明:文件创建人代码(6位)+文件接收人代码(6位)+报送日期(8位)+当日顺序编号(8位)
///
+
[CheckStringLength(Length = 28)]
[SacDescription("ExceID", "业务数据流水号", "28", true, "文件创建人代码(6位)+文件接收人代码(6位)+报送日期(8位)+当日顺序编号(8位);")]
public string ExceID { get; set; }
@@ -143,6 +170,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 说明:报送时该字段应为Null
///
[XmlElement(IsNullable = false)]
+ [NotMapped]
[SacDescription("RetCode", "响应码", "6", true, "报送时该字段应为Null;")]
public string RetCode { get; set; }
///
@@ -152,6 +180,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 说明:报送时该字段应为Null
///
[XmlElement(IsNullable = false)]
+ [NotMapped]
[SacDescription("RetMsg", "响应描述", "1000", true, "报送时该字段应为Null;")]
public string RetMsg { get; set; }
///
@@ -162,6 +191,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 报送时该字段应为Null
///
[XmlElement(IsNullable = false)]
+ [NotMapped]
[SacDescription("BizID", "报送数据业务编号", "50", false, "报告库接口返回,数据处理异常时为空\r\n报送时该字段应为Null;")]
public string BizID { get; set; }
///
@@ -172,10 +202,30 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 报送时该字段应为Null
///
[XmlElement(IsNullable = false)]
+ [NotMapped]
[SacDescription("DurationEventNO", "操作事件编号", "6", false, "场外证券业务系统接口返回,当报送存续期业务时,返回操作时间编号ID\r\n报送时该字段应为Null;")]
public string DurationEventNO { get; set; }
}
+ public abstract class ReportSubBaseModel
+ {
+ [Key]
+ [XmlIgnore]
+ public int Id { get; set; }
+
+ ///
+ /// 报送日期
+ ///
+ [XmlIgnore]
+ public DateTime ReportDate { get; set; }
+
+ ///
+ /// 来源报送文件 ExceID
+ ///
+ [XmlIgnore]
+ public string ExceID { get; set; }
+ }
+
///
/// 报告状态
///
@@ -198,8 +248,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
private long limitFileLength => MaxFileLength - 5242880;//留出5MB余量
- private long _currentLength = 0;
- public long CurrentLength => _currentLength;
+ public long CurrentLength { get; private set; } = 0;
public bool Continue { get; private set; }
@@ -208,7 +257,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
///
public void ResetCurrentLength()
{
- _currentLength = 0;
+ CurrentLength = 0;
Continue = false;
}
@@ -226,22 +275,22 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
{
return true;
}
- var length = new FileInfo(path).Length;
- if (length > limitFileLength)
- {
- LogFactory.GetLogger("CheckFileLength").Error($"单一文件大小不应超过30MB,错误文件:{path}");
- throw new ServiceException("单一文件大小不应超过30MB");
- }
- _currentLength += length;
- if (_currentLength <= limitFileLength)
- {
- return true;
- }
- else
- {
- Continue = true;
- return false;
- }
+ //var length = new FileInfo(path).Length;
+ //if (length > MaxAnnexLength)
+ //{
+ // LogFactory.GetLogger("CheckFileLength").Error($"单一文件大小不应超过30MB,错误文件:{path}");
+ // throw new ServiceException("单一文件大小不应超过30MB");
+ //}
+ //CurrentLength += length;
+ //if (CurrentLength <= limitFileLength)
+ //{
+ return true;
+ //}
+ //else
+ //{
+ // Continue = true;
+ // return false;
+ //}
}
///
@@ -252,10 +301,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 缓存是否存在value
public bool CheckCacheInfo(string key, string value)
{
- if (CacheInfo == null)
- {
- CacheInfo = new Dictionary>();
- }
+ CacheInfo ??= new Dictionary>();
if (!CacheInfo.ContainsKey(key))
{
CacheInfo[key] = new List();
@@ -270,10 +316,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
///
public ReadOnlyCollection GetCacheInfo(string key)
{
- if (CacheInfo == null)
- {
- CacheInfo = new Dictionary>();
- }
+ CacheInfo ??= new Dictionary>();
if (!CacheInfo.ContainsKey(key))
{
CacheInfo[key] = new List();
@@ -288,10 +331,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
///
public void AddCacheInfo(string key, string value)
{
- if (CacheInfo == null)
- {
- CacheInfo = new Dictionary>();
- }
+ CacheInfo ??= new Dictionary>();
if (!CacheInfo.ContainsKey(key))
{
CacheInfo[key] = new List();
diff --git a/YLErpDAL/Modules/SuperviseReportModule/SAC/Model/ReportRootModel.cs b/YLErpDAL/Modules/SuperviseReportModule/SAC/Model/ReportRootModel.cs
index 73ead5f0..048b7543 100644
--- a/YLErpDAL/Modules/SuperviseReportModule/SAC/Model/ReportRootModel.cs
+++ b/YLErpDAL/Modules/SuperviseReportModule/SAC/Model/ReportRootModel.cs
@@ -1,4 +1,9 @@
-using System.ComponentModel;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
using System.Xml;
using System.Xml.Serialization;
using YLErp.Helpers;
@@ -58,30 +63,40 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
private string check(string xml)
{
var result = xml;
- if (Header.BusiDataType == DataFlagsEnum.A1016)
+ switch (this.Header.BusiDataType)
{
- try
- {
- var doc = new System.Xml.XmlDocument();
- doc.LoadXml(xml);
- var body = doc.GetElementsByTagName("SwapEquityPayment");
- if (body.Count > 0)
+ case DataFlagsEnum.A1016:
+ try
{
- foreach (XmlElement item in body)
+ var doc = new System.Xml.XmlDocument();
+ doc.LoadXml(xml);
+ var body = doc.GetElementsByTagName("SwapEquityPayment");
+ if (body.Count > 0)
{
- var taget = item.GetElementsByTagName("DurationEventNO");
- var frist = item.GetElementsByTagName("SwapEquityPaymentTuple");
- if (taget.Count > 0)
+ foreach (XmlElement item in body)
{
- item.InsertAfter(taget[0], frist[frist.Count - 1]);
+ var target = item.GetElementsByTagName("DurationEventNO");
+ var frist = item.GetElementsByTagName("SwapEquityPaymentTuple");
+ if (target.Count > 0)
+ {
+ item.InsertAfter(target[0], frist[frist.Count - 1]);
+ }
}
+ result = XmlHelper.FormatXml(doc.OuterXml);
}
- result = XmlHelper.FormatXml(doc.OuterXml);
}
- }
- catch
- {
- }
+#pragma warning disable CS0168 // 声明了变量“ex”,但从未使用过
+ catch (Exception ex)
+#pragma warning restore CS0168 // 声明了变量“ex”,但从未使用过
+ {
+ }
+ break;
+ case DataFlagsEnum.A1004:
+ if (result.Contains(""))
+ {
+ result = result.Replace("", "");
+ }
+ break;
}
return result;
}
@@ -161,7 +176,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 说明:
///
[CheckStringInMap(Map = new[] { "A1001", "A1002","A1003","A1004", "A1005", "A1006" ,"A1007",
- "A1008", "A1009","A1010", "A1011", "A1012","A1013","A1014","A1015","A1016","A1017" })]
+ "A1008", "A1009","A1010", "A1011", "A1012","A1013","A1014","A1015","A1016","A1017","A1018","A1019" })]
[SacDescription("BusiDataType", "接口标识", "5", true, "")]
public DataFlagsEnum BusiDataType { get; set; }
///
@@ -241,11 +256,11 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
[SacDescription("SwapEquityPayment", "收益互换交易权益端支付", "", false, "")]
public List SwapEquityPayment { get; set; }
///
- /// 互换交易确认书附件
+ /// 交易确认书附件
///
[XmlElement]
- [SacDescription("ConfirmationAtt", "互换交易确认书附件", "", false, "")]
- public List ConfirmationAtt { get; set; }
+ [SacDescription("ConfirmationAtt", "交易确认书附件", "", false, "")]
+ public List ConfirmationAtt { get; set; }
///
/// 期权交易存续期管理
///
@@ -259,6 +274,12 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
[SacDescription("SwapDurationManagement", "收益互换交易存续期管理", "", false, "")]
public List SwapDurationManagement { get; set; }
///
+ /// 场外期权合约估值信息
+ ///
+ [XmlElement]
+ [SacDescription("ValuationInformation", "场外期权合约估值信息", "", false, "")]
+ public List ValuationInformation { get; set; }
+ ///
/// 定期报告-SAC模板
///
[XmlElement]
diff --git a/YLErpDAL/Modules/SuperviseReportModule/SAC/Model/SupAgrmtModel.cs b/YLErpDAL/Modules/SuperviseReportModule/SAC/Model/SupAgrmtModel.cs
index 685f1949..2d994a2d 100644
--- a/YLErpDAL/Modules/SuperviseReportModule/SAC/Model/SupAgrmtModel.cs
+++ b/YLErpDAL/Modules/SuperviseReportModule/SAC/Model/SupAgrmtModel.cs
@@ -1,4 +1,6 @@
-using System.ComponentModel;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations.Schema;
using System.Xml.Serialization;
using YLErp.Modules.SuperviseReportModule.SAC.Common;
using static YLErp.DBModels.Consts.ConsReport;
@@ -8,6 +10,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
///
/// 补充协议
///
+ [Table("A1003_SupAgrmt")]
public class SupAgrmtModel : ReportBaseModel
{
///
@@ -23,14 +26,14 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 主协议编号(双方约定)
/// 长度:100
/// 必填:是
- /// 说明:校验规则:双方约定
+ /// 说明:双方约定
///
[CheckStringMaxLength(MaxLength = 100)]
[DefaultValue("")]
- [SacDescription("MasterAgrmtNo", "主协议编号(双方约定)", "100", true, "校验规则:双方约定;")]
+ [SacDescription("MasterAgrmtNo", "主协议编号(双方约定)", "100", true, "双方约定;")]
public string MasterAgrmtNo { get; set; }
///
- /// 补充协议编号
+ /// 补充议编号
/// 长度:32
/// 必填:否
/// 说明:校验规则:补正时必填
@@ -40,17 +43,17 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
[CheckStringMaxLength(MaxLength = 32, CheckHandleName = "A")]
[CheckStringMaxLength(MaxLength = 32, Required = false, CheckHandleName = "B")]
[DefaultValue("")]
- [SacDescription("SupAgrmtID", "补充协议编号", "32", false, "校验规则:补正时必填;")]
+ [SacDescription("SupAgrmtID", "补充议编号", "32", false, "校验规则:补正时必填;")]
public string SupAgrmtID { get; set; }
///
/// 补充协议编号(双方约定)
/// 长度:100
/// 必填:是
- /// 说明:校验规则:双方约定
+ /// 说明:双方约定
///
[CheckStringMaxLength(MaxLength = 100)]
[DefaultValue("")]
- [SacDescription("SupAgrmtNo", "补充协议编号(双方约定)", "100", true, "校验规则:双方约定;")]
+ [SacDescription("SupAgrmtNo", "补充协议编号(双方约定)", "100", true, "双方约定;")]
public string SupAgrmtNo { get; set; }
///
/// 补充协议类型
@@ -61,7 +64,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
[CheckStringMaxLength(MaxLength = 2)]
[DefaultValue("")]
[SacDescription("SupAgrmtType", "补充协议类型", "2", true, "")]
- public string SupAgrmtType { get; set; }
+ public string? SupAgrmtType { get; set; }
///
/// 签署时间
/// 长度:10
@@ -71,7 +74,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
[CheckStringLength(Length = 10)]
[CheckStringIsDateTimeFormat(FormatString = "yyyy-MM-dd")]
[DefaultValue("")]
- [SacDescription("SigningDate", "签署时间", "10", true, "校验规则:必须是yyyy-MM-dd;")]
+ [SacDescription("SigningDate", "签署时间", "10", true, "校验规则:必须是YYYY-MM-DD;")]
public string SigningDate { get; set; }
///
/// 补充协议备注
@@ -82,7 +85,17 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
[CheckStringMaxLength(MaxLength = 1024, Required = false)]
[DefaultValue("")]
[SacDescription("SupAgrmtRemark", "补充协议备注", "1024", false, "上述所有字段未能包含的信息;")]
- public string SupAgrmtRemark { get; set; }
+ public string? SupAgrmtRemark { get; set; }
+ ///
+ /// 补充协议附件
+ /// 长度:1024
+ /// 必填:否
+ /// 说明:上述所有字段未能包含的信息
+ ///
+ [XmlIgnore]
+ public string SupAgrmtAtt { get; set; }
+ ///
+ /// 补充协议附件
///
/// 补充协议附件
/// 长度:
@@ -90,14 +103,15 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 说明:
///
[XmlElement]
+ [NotMapped]
[SacDescription("SupAgrmtAttTuple", "补充协议附件", "", true, "")]
- public List SupAgrmtAttTuple { get; set; }
+ public List? SupAgrmtAttTuple { get; set; }
}
///
/// 补充协议附件
///
- public class SupAgrmtAttModel
+ public class SupAgrmtAttModel : ReportSubBaseModel
{
///
/// 补充协议附件
@@ -108,6 +122,6 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
[CheckStringEndsWith(EndsWithString = ".pdf")]
[DefaultValue("")]
[SacDescription("SupAgrmtAtt", "补充协议附件", "", true, "校验规则:只支持PDF格式;")]
- public string SupAgrmtAtt { get; set; }
+ public string? SupAgrmtAtt { get; set; }
}
}
\ No newline at end of file
diff --git a/YLErpDAL/Modules/SuperviseReportModule/SAC/Model/SwapConfirmationAttModel.cs b/YLErpDAL/Modules/SuperviseReportModule/SAC/Model/SwapConfirmationAttModel.cs
deleted file mode 100644
index b958d902..00000000
--- a/YLErpDAL/Modules/SuperviseReportModule/SAC/Model/SwapConfirmationAttModel.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-using System.ComponentModel;
-using System.Xml.Serialization;
-using YLErp.Modules.SuperviseReportModule.SAC.Common;
-using static YLErp.DBModels.Consts.ConsReport;
-
-namespace YLErp.Modules.SuperviseReportModule.SAC.Model
-{
- ///
- /// 互换交易确认书附件
- ///
- public class SwapConfirmationAttModel : ReportBaseModel
- {
- ///
- /// 交易确认书编号(双方约定)
- /// 长度:100
- /// 必填:是
- /// 说明:双方约定
- ///
- [CheckStringMaxLength(MaxLength = 100)]
- [DefaultValue("")]
- [SacDescription("ConfirmationNo", "交易确认书编号(双方约定)", "100", true, "双方约定;")]
- public string ConfirmationNo { get; set; }
- ///
- /// 操作标识
- /// 长度:1
- /// 必填:是
- /// 说明:
- ///
- [XmlIgnore]
- [SacDescription("OperationType", "操作标识", "1", true, "")]
- public OptFlagsEnum OperationType { get; set; }
- ///
- /// 交易确认书附件
- /// 长度:
- /// 必填:是
- /// 说明:多附件;
- ///
- [CheckIEnumerableTMinCount(MinCount = 1)]
- [XmlElement]
- [SacDescription("ConfirmationFilesTuple", "交易确认书附件", "", true, "多附件;")]
- public List ConfirmationFilesTuple { get; set; }
- }
-
- public class ConfirmationFilesTupleModel
- {
- ///
- /// 交易确认书附件
- /// 长度:100
- /// 必填:是
- /// 说明:校验规则:只支持PDF格式
- ///
- [CheckStringEndsWith(EndsWithString = ".pdf")]
- [DefaultValue("")]
- [SacDescription("ConfirmationFiles", "交易确认书附件", "100", true, "校验规则:只支持PDF格式;")]
- public string ConfirmationFiles { get; set; }
- }
-}
\ No newline at end of file
diff --git a/YLErpDAL/Modules/SuperviseReportModule/SAC/Model/SwapConfirmationModel.cs b/YLErpDAL/Modules/SuperviseReportModule/SAC/Model/SwapConfirmationModel.cs
index 92f81f9e..af73c72e 100644
--- a/YLErpDAL/Modules/SuperviseReportModule/SAC/Model/SwapConfirmationModel.cs
+++ b/YLErpDAL/Modules/SuperviseReportModule/SAC/Model/SwapConfirmationModel.cs
@@ -1,4 +1,6 @@
-using System.ComponentModel;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations.Schema;
using System.Xml.Serialization;
using YLErp.Modules.SuperviseReportModule.SAC.Common;
using static YLErp.DBModels.Consts.ConsReport;
@@ -8,6 +10,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
///
/// 互换交易确认书
///
+ [Table("A1005_SwapConfirmation")]
public class SwapConfirmationModel : ReportBaseModel
{
///
@@ -17,6 +20,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 说明:
///
[XmlIgnore]
+ [SacDescription("PaymentMethod", "支付方式", "2", true, "")]
public string PaymentMethod { get; set; }
///
/// 操作标识
@@ -64,7 +68,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 交易确认书编号(双方约定)
/// 长度:100
/// 必填:是
- /// 说明:双方约定;
+ /// 说明:双方约定
///
[CheckStringMaxLength(MaxLength = 100)]
[DefaultValue("")]
@@ -74,11 +78,11 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 交易确认书类型
/// 长度:2
/// 必填:是
- /// 说明:
+ /// 说明:校验规则:首次提交时填0,补正时填1
///
[CheckStringInMap(Map = new[] { "0", "1" })]
[DefaultValue("")]
- [SacDescription("ConfirmationType", "交易确认书类型", "2", true, "")]
+ [SacDescription("ConfirmationType", "交易确认书类型", "2", true, "校验规则:首次提交时填0,补正时填1;")]
public string ConfirmationType { get; set; }
///
/// 填报方角色
@@ -104,34 +108,34 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 起始日
/// 长度:10
/// 必填:是
- /// 说明:校验规则:1 起始日不能大于到期日日期;2 必须是yyyy-MM-dd
+ /// 说明:校验规则:1 起始日不能大于到期日日期;2 必须是YYYY-MM-DD
///
[CheckStringMaxLength(MaxLength = 10)]
[CheckStringIsDateTimeFormat]
[DefaultValue("")]
- [SacDescription("StartDate", "起始日", "10", true, "校验规则:\r\n1 起始日不能大于到期日日期;\r\n2 必须是yyyy-MM-dd;")]
+ [SacDescription("StartDate", "起始日", "10", true, "校验规则:\r\n1 起始日不能大于到期日日期;\r\n2 必须是YYYY-MM-DD;")]
public string StartDate { get; set; }
///
/// 到期日
/// 长度:10
/// 必填:是
- /// 说明:指定的进行结算金额收付的日期. 校验规则:1 到期日不能小于起始日日期;2 必须是yyyy-MM-dd;3 补正时,如果该交易还有未被废除的存续期记录(包括展期\终止数据),到期日字段不能修改;
+ /// 说明:指定的进行结算金额收付的日期. 校验规则:1 到期日不能小于起始日日期;2 必须是YYYY-MM-DD;
///
[CheckStringMaxLength(MaxLength = 10)]
[CheckStringIsDateTimeFormat]
[DefaultValue("")]
- [SacDescription("DueDate", "到期日", "10", true, "指定的进行结算金额收付的日期.\r\n校验规则:\r\n1 到期日不能小于起始日日期;\r\n2 必须是yyyy-MM-dd;\r\n3 补正时,如果该交易还有未被废除的存续期记录(包括展期、终止数据),到期日字段不能修改;")]
+ [SacDescription("DueDate", "到期日", "10", true, "指定的进行结算金额收付的日期.\r\n校验规则:\r\n1 到期日不能小于起始日日期;\r\n2 必须是YYYY-MM-DD;")]
public string DueDate { get; set; }
///
/// 结算日
/// 长度:10
/// 必填:否
- /// 说明:交易双方在交易有效约定中指定的进行结算金额收付的日期;校验规则:1 必须是yyyy-MM-dd;
+ /// 说明:校验规则:1 必须是YYYY-MM-DD;
///
[CheckStringMaxLength(MaxLength = 10, Required = false)]
[CheckStringIsDateTimeFormat(Required = false)]
[DefaultValue("")]
- [SacDescription("SettlementDate", "结算日", "10", false, "交易双方在交易有效约定中指定的进行结算金额收付的日期;\r\n校验规则:\r\n1 必须是yyyy-MM-dd;")]
+ [SacDescription("SettlementDate", "结算日", "10", false, "校验规则:\r\n1 必须是YYYY-MM-DD;")]
public string SettlementDate { get; set; }
///
/// 结算货币
@@ -144,7 +148,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
[SacDescription("Currency", "结算货币", "2", true, "使用货币通用代码(大写);")]
public string Currency { get; set; }
///
- /// 名义本金额(人民币、元)
+ /// 名义本金(元)
/// 长度:36,2
/// 必填:是
/// 说明:校验规则:1 必须两位小数以内;2 补正时,如果该交易还有未被废除的存续期记录(包括展期\终止数据),名义本金额(人民币)字段不能修改;
@@ -152,7 +156,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
///
[CheckStringIntMaxLength(BeforePointMaxLength = 36, AfterPointMaxLength = 2, MinValue = 0)]
[DefaultValue("")]
- [SacDescription("NotinalPrincipleAmt", "名义本金额(人民币、元)", "36,2", true, "校验规则:\r\n1 必须两位小数以内;\r\n2 补正时,如果该交易还有未被废除的存续期记录(包括展期、终止数据),名义本金额(人民币)字段不能修改;\r\n名义本金为标的期初价格乘以数量乘以乘数;\r\n多空组合填写多头名义本金与空头名义本金孰高;")]
+ [SacDescription("NotinalPrincipleAmt", "名义本金(元)", "36,2", true, "校验规则:\r\n1 必须两位小数以内;\r\n2 补正时,如果该交易还有未被废除的存续期记录(包括展期、终止数据),名义本金额(人民币)字段不能修改;")]
public string NotinalPrincipleAmt { get; set; }
///
/// 清算机构
@@ -181,7 +185,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 说明:交易场所选"99:其他交易场所"时,必填
///
[CheckConditionStringValue(ConditionName = nameof(TradingPlace), ConditionValue = "99", CheckHandleNameArr = new[] { "A" })]
- [CheckStringMinLength(MinLength = 1, CheckHandleName = "A")]
+ [CheckStringMaxLength(MaxLength = 200, CheckHandleName = "A")]
[DefaultValue("")]
[SacDescription("TradingPlaceOther", "交易场所(其他)", "200", false, "交易场所选99:其他交易场所时,必填;")]
public string TradingPlaceOther { get; set; }
@@ -209,6 +213,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 费用端支付
///
[XmlElement]
+ [NotMapped]
[SacDescription("CostPaymentTuple", "费用端支付", "", false, "")]
public List CostPaymentTuple { get; set; }
///
@@ -232,26 +237,26 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
[CheckStringInMap(Map = new[] { "0", "1", "2", "3" }, CheckHandleName = "A")]
[CheckStringLength(Length = 0, Required = false, CheckHandleName = "B")]
[DefaultValue("")]
- [SacDescription("PerformanceCollProvider", "履约担保品提供方", "2", false, "检验规则履约担保类型为部分担保或全额担保时必填;")]
+ [SacDescription("PerformanceCollProvider", "履约担保品提供方", "2", false, "检验规则:履约担保类型为部分担保或全额担保时必填;")]
public string PerformanceCollProvider { get; set; }
///
/// 担保品收取方是否可使用担保品
/// 长度:5
/// 必填:否
- /// 说明:检验规则:履约担保类型为部分担保,全额担保时必填;
+ /// 说明:检验规则:履约担保类型为"部分担保"或"全额担保"时必填;
///
[CheckConditionStringInMap(ConditionName = nameof(PerformanceGuaranteeType), ConditionMap = new[] { "1", "2" }, CheckHandleNameArr = new[] { "A" })]
[CheckConditionStringNotInMap(ConditionName = nameof(PerformanceGuaranteeType), ConditionMap = new[] { "1", "2" }, CheckHandleNameArr = new[] { "B" })]
[CheckStringInMap(Map = new[] { "true", "false" }, CheckHandleName = "A")]
[CheckStringLength(Length = 0, Required = false, CheckHandleName = "B")]
[DefaultValue("")]
- [SacDescription("PartyUseColl", "担保品收取方是否可使用担保品", "5", false, "检验规则:履约担保类型为部分担保,全额担保时必填;")]
+ [SacDescription("PartyUseColl", "担保品收取方是否可使用担保品", "5", false, "检验规则:履约担保类型为部分担保或全额担保时必填;")]
public string PartyUseColl { get; set; }
///
/// 担保品使用说明
/// 长度:1024
/// 必填:否
- /// 说明:检验规则:当担保品收取方是否可使用担保品选择是时必填;
+ /// 说明:检验规则:当"担保品收取方是否可使用担保品"选择"是"时必填;
///
[CheckConditionStringValue(ConditionName = nameof(PartyUseColl), ConditionValue = "true", CheckHandleNameArr = new[] { "A" })]
[CheckConditionStringNEQValue(ConditionName = nameof(PartyUseColl), ConditionValue = "true", CheckHandleNameArr = new[] { "B" })]
@@ -264,7 +269,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 是否计算担保品价值产生利息
/// 长度:5
/// 必填:否
- /// 说明:检验规则:当"履约担保类型"为"部分担保"\"全额担保"时必填
+ /// 说明:检验规则:当"履约担保类型"为"部分担保"、"全额担保"时必填
///
[CheckConditionStringInMap(ConditionName = nameof(PerformanceGuaranteeType), ConditionMap = new[] { "1", "2" }, CheckHandleNameArr = new[] { "A" })]
[CheckConditionStringNotInMap(ConditionName = nameof(PerformanceGuaranteeType), ConditionMap = new[] { "1", "2" }, CheckHandleNameArr = new[] { "B" })]
@@ -277,11 +282,11 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 履约担保品初始比率(%)
/// 长度:5,2
/// 必填:是
- /// 说明:校验规则:1 当"履约保障类型"选择"部分担保"或"全额担保"时必填;2 大于等于0的数字,最多2位小数,该值为100%时,填写100.00
+ /// 说明:校验规则:大于等于0的数字,最多2位小数,该值为100%时,填写100.00
///
- [CheckStringIntMaxLength(BeforePointMaxLength = 3, AfterPointMaxLength = 2, MaxValue = 100, MinValue = 0)]
+ [CheckStringIntMaxLength(BeforePointMaxLength = 3, AfterPointMaxLength = 2, MinValue = 0)]
[DefaultValue("")]
- [SacDescription("PerformanceCollInitialRatio", "履约担保品初始比率(%)", "5,2", true, "校验规则:\r\n1 当履约保障类型选择部分担保或全额担保时必填;\r\n2 大于等于0的数字,最多2位小数,该值为100%时,填写100.00;")]
+ [SacDescription("PerformanceCollInitialRatio", "履约担保品初始比率(%)", "5,2", true, "校验规则:大于等于0的数字,最多2位小数,该值为100%时,填写100.00;")]
public string PerformanceCollInitialRatio { get; set; }
///
/// 履约担保品追保比率(%)
@@ -291,8 +296,8 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
///
[CheckConditionStringInMap(ConditionName = nameof(PerformanceGuaranteeType), ConditionMap = new[] { "1", "2" }, CheckHandleNameArr = new[] { "A" })]
[CheckConditionStringNotInMap(ConditionName = nameof(PerformanceGuaranteeType), ConditionMap = new[] { "1", "2" }, CheckHandleNameArr = new[] { "B" })]
- [CheckStringIntMaxLength(BeforePointMaxLength = 3, AfterPointMaxLength = 2, MaxValue = 100, MinValue = 0, CheckHandleName = "A")]
- [CheckStringIntMaxLength(BeforePointMaxLength = 3, AfterPointMaxLength = 2, MaxValue = 100, MinValue = 0, Required = false, CheckHandleName = "B")]
+ [CheckStringIntMaxLength(BeforePointMaxLength = 3, AfterPointMaxLength = 2, MinValue = 0, CheckHandleName = "A")]
+ [CheckStringIntMaxLength(BeforePointMaxLength = 3, AfterPointMaxLength = 2, MinValue = 0, Required = false, CheckHandleName = "B")]
[DefaultValue("")]
[SacDescription("PerformanceCollAddtlRatio", "履约担保品追保比率(%)", "5,2", false, "校验规则:\r\n1 当履约保障类型选择部分担保或全额担保时必填;\r\n2 大于等于0的数字,最多2位小数,该值为100%时,填写100.00;")]
public string PerformanceCollAddtlRatio { get; set; }
@@ -304,8 +309,8 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
///
[CheckConditionStringInMap(ConditionName = nameof(PerformanceGuaranteeType), ConditionMap = new[] { "1", "2" }, CheckHandleNameArr = new[] { "A" })]
[CheckConditionStringNotInMap(ConditionName = nameof(PerformanceGuaranteeType), ConditionMap = new[] { "1", "2" }, CheckHandleNameArr = new[] { "B" })]
- [CheckStringIntMaxLength(BeforePointMaxLength = 3, AfterPointMaxLength = 2, MaxValue = 100, MinValue = 0, CheckHandleName = "A")]
- [CheckStringIntMaxLength(BeforePointMaxLength = 3, AfterPointMaxLength = 2, MaxValue = 100, MinValue = 0, Required = false, CheckHandleName = "B")]
+ [CheckStringIntMaxLength(BeforePointMaxLength = 3, AfterPointMaxLength = 2, MinValue = 0, CheckHandleName = "A")]
+ [CheckStringIntMaxLength(BeforePointMaxLength = 3, AfterPointMaxLength = 2, MinValue = 0, Required = false, CheckHandleName = "B")]
[DefaultValue("")]
[SacDescription("PerformanceCollOffsetRatio", "履约担保品平仓比率(%)", "5,2", false, "校验规则:\r\n1 当履约保障类型选择部分担保或全额担保时必填;\r\n2 大于等于0的数字,最多2位小数,该值为100%时,填写100.00;")]
public string PerformanceCollOffsetRatio { get; set; }
@@ -347,6 +352,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
[CheckConditionStringInMap(ConditionName = nameof(PerformanceGuaranteeType), ConditionMap = new[] { "1", "2" }, CheckHandleNameArr = new[] { "A" })]
[CheckIEnumerableTMinCount(CheckHandleName = "A", MinCount = 1)]
[XmlElement]
+ [NotMapped]
[SacDescription("PerformanceCollTuple", "履约担保品", "", false, "数组结构,支持新增多条;\r\n校验规则:字段信息详见收益互换交易确认书【履约担保品】。检验规则:当“履约担保类型”为“部分担保”或“全额担保”时必填;")]
public List PerformanceCollTuple { get; set; }
///
@@ -373,31 +379,31 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 标的个数
/// 长度:2
/// 必填:是
- /// 说明: 多标的时,权益收益\浮动利率收益固定利率收益信息需新增多个
+ /// 说明: 多标的时,权益收益、浮动利率收益、固定利率收益信息需新增多个
///
[CheckStringInMap(Map = new[] { "0", "1" })]
[DefaultValue("")]
- [SacDescription("PtyAUndrlygAssetNo", "标的个数", "2", true, "多标的时,权益收益、浮动利率收益固定利率收益信息需新增多个;")]
+ [SacDescription("PtyAUndrlygAssetNo", "标的个数", "2", true, "多标的时,权益收益、浮动利率收益、固定利率收益信息需新增多个;")]
public string PtyAUndrlygAssetNo { get; set; }
///
/// 收益计算说明
/// 长度:1024
/// 必填:是
- /// 说明:甲方支付乙方,详细说明收益计算方式;
+ /// 说明:详细说明收益计算方式
///
[CheckStringMaxLength(MaxLength = 1024)]
[DefaultValue("")]
- [SacDescription("PtyAPrOfitCalculationInfo", "收益计算说明", "1024", true, "甲方支付乙方,详细说明收益计算方式;")]
+ [SacDescription("PtyAPrOfitCalculationInfo", "收益计算说明", "1024", true, "详细说明收益计算方式;")]
public string PtyAPrOfitCalculationInfo { get; set; }
///
/// 收益备注
/// 长度:1024
/// 必填:否
- /// 说明:甲方支付乙方,填写上述字段或交易确认书中不能包含的信息;
+ /// 说明:填写上述字段或交易确认书中不能包含的信息
///
[CheckStringMaxLength(MaxLength = 1024, Required = false)]
[DefaultValue("")]
- [SacDescription("PtyAProfitRemark", "收益备注", "1024", false, "甲方支付乙方,填写上述字段或交易确认书中不能包含的信息;")]
+ [SacDescription("PtyAProfitRemark", "收益备注", "1024", false, "填写上述字段或交易确认书中不能包含的信息;")]
public string PtyAProfitRemark { get; set; }
///
/// 甲方代签产品名称
@@ -451,6 +457,17 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
[DefaultValue("")]
[SacDescription("PytBPdctCode", "乙方交易对手码(产品)", "20", false, "校验规则:如乙方代签产品名称或乙方代签产品代码填值,则甲方代签产品名称和甲方代签产品代码禁止填值;")]
public string PytBPdctCode { get; set; }
+ //TODO: 2.3互换上线时取消注释
+ /////
+ ///// 是否为跨境交易
+ ///// 长度:5
+ ///// 必填:是
+ ///// 说明:
+ /////
+ //[CheckStringInMap(Map = new[] { "true", "false" })]
+ //[DefaultValue("")]
+ //[SacDescription("CrossBorderTransactions", "是否为跨境交易", "5", true, "")]
+ //public string CrossBorderTransactions { get; set; }
///
/// 空白1
///
@@ -468,7 +485,8 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
///
/// 履约担保品详情
///
- public class SwapPerformanceGuaranteeAttModel
+ [Table("A1005_SwapPerformanceGuaranteeAtt")]
+ public class SwapPerformanceGuaranteeAttModel : ReportSubBaseModel
{
///
/// 履约担保品类型
@@ -510,12 +528,18 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
[DefaultValue("")]
[SacDescription("Remarks", "备注", "1024", false, "")]
public string Remarks { get; set; }
+
+ [XmlIgnore]
+ [DefaultValue("")]
+ [SacDescription("ConfirmationNo", "交易确认书编号", "100", false, "")]
+ public string ConfirmationNo { get; set; }
}
///
/// 收益互换交易费用端支付
///
- public class PaymentMethodModel
+ [Table("A1005_PaymentMethod")]
+ public class PaymentMethodModel : ReportSubBaseModel
{
///
/// 支付方式
@@ -612,5 +636,9 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
[DefaultValue("")]
[SacDescription("Blank2", "空白2", "", false, "")]
public string Blank2 { get; set; }
+ [XmlIgnore]
+ [DefaultValue("")]
+ [SacDescription("ConfirmationNo", "交易确认书编号", "100", false, "")]
+ public string ConfirmationNo { get; set; }
}
}
\ No newline at end of file
diff --git a/YLErpDAL/Modules/SuperviseReportModule/SAC/Model/SwapDurationManagementModel.cs b/YLErpDAL/Modules/SuperviseReportModule/SAC/Model/SwapDurationManagementModel.cs
index 04c22f7a..b117dbe1 100644
--- a/YLErpDAL/Modules/SuperviseReportModule/SAC/Model/SwapDurationManagementModel.cs
+++ b/YLErpDAL/Modules/SuperviseReportModule/SAC/Model/SwapDurationManagementModel.cs
@@ -1,4 +1,6 @@
-using System.ComponentModel;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations.Schema;
using System.Xml.Serialization;
using YLErp.Modules.SuperviseReportModule.SAC.Common;
using static YLErp.DBModels.Consts.ConsReport;
@@ -8,6 +10,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
///
/// 收益互换交易存续期管理
///
+ [Table("A1006_SwapDurationManagement")]
public class SwapDurationManagementModel : ReportBaseModel
{
///
@@ -57,12 +60,12 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 存续期操作类型
/// 长度:2
/// 必填:是
- /// 说明:当"收益互换交易类型"为"多空组合"时,可选"调仓"
+ /// 说明:当"收益互换交易类型"为"多空组合"时,可选"调仓"
///
[CheckConditionStringValue(ConditionName = nameof(SwapType), ConditionValue = "2", CheckHandleNameArr = new[] { "A", "C" })]
[CheckConditionStringNEQValue(ConditionName = nameof(SwapType), ConditionValue = "2", CheckHandleNameArr = new[] { "B", "C" })]
- [CheckStringInMap(Map = new[] { "01", "04" }, CheckHandleName = "A")]
- [CheckStringInMap(Map = new[] { "01", "02", "03" }, CheckHandleName = "B")]
+ [CheckStringInMap(Map = new[] { "1", "4" }, CheckHandleName = "A")]
+ [CheckStringInMap(Map = new[] { "1", "2", "3" }, CheckHandleName = "B")]
[CheckStringIntMaxLength(MaxValue = 4, MinValue = 1, BeforePointMaxLength = 2, CheckHandleName = "C")]
[DefaultValue("")]
[SacDescription("DurationOperationType", "存续期操作类型", "2", true, "当收益互换交易类型为多空组合时,可选调仓;")]
@@ -131,7 +134,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
/// 当"存续期操作类型"选择"调仓"时,可增可减
///
///
- [CheckConditionStringInMap(ConditionName = nameof(DurationOperationType), ConditionMap = new[] { "02", "03", "04" }, CheckHandleNameArr = new[] { "A" })]
+ [CheckConditionStringInMap(ConditionName = nameof(DurationOperationType), ConditionMap = new[] { "04" }, CheckHandleNameArr = new[] { "A" })]
[CheckConditionStringInMap(ConditionName = nameof(DurationOperationType), ConditionMap = new[] { "02", "03" }, CheckHandleNameArr = new[] { "B" })]
[CheckConditionStringNotInMap(ConditionName = nameof(DurationOperationType), ConditionMap = new[] { "02", "03", "04" }, CheckHandleNameArr = new[] { "C" })]
[CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 2, CheckHandleName = "A")]
@@ -170,14 +173,14 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
[SacDescription("AmountPaidThisTime", "本次支付金额(元)", "36,2", false, "当存续期操作类型选择终止、违约终止、调仓时,必填;\r\n支付为正,收取为负;")]
public string AmountPaidThisTime { get; set; }
///
- /// 预付金比例(%)
+ /// 保证金比例(%)
/// 长度:8,2
/// 必填:是
- /// 说明:为预付金占存量名义本金比例,其中多空组合收益互换存量名义本金为存量多头名义本金和空头名义本金孰大者
+ /// 说明:为保证金占存量名义本金比例,其中多空组合收益互换存量名义本金为存量多头名义本金和空头名义本金孰大者
///
[CheckStringIntLength(BeforePointMaxLength = 8, AfterPointLength = 2)]
[DefaultValue("")]
- [SacDescription("MarginRatio", "预付金比例(%)", "8,2", true, "为预付金占存量名义本金比例,其中多空组合收益互换存量名义本金为存量多头名义本金和空头名义本金孰大者;")]
+ [SacDescription("MarginRatio", "保证金比例(%)", "8,2", true, "为保证金占存量名义本金比例,其中多空组合收益互换存量名义本金为存量多头名义本金和空头名义本金孰大者;")]
public string MarginRatio { get; set; }
///
/// 合约持仓明细
@@ -189,6 +192,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
[CheckConditionIntInRange(ConditionName = nameof(Balance), MinValue = 0, MaxValue = 0, CheckHandleNameArr = new[] { "B" })]
[CheckIEnumerableTMaxCount(CheckHandleName = "A", MaxCount = 0)]
[CheckIEnumerableTMaxCount(CheckHandleName = "B", MaxCount = 0)]
+ [NotMapped]
[SacDescription("CurrentPositionDetails", "合约持仓明细", "", false, "校验规则:当存量名义本金(元)为0时,非必填;\r\n展期数据不允许添加合约持仓明细;")]
public List CurrentPositionDetails { get; set; }
///
@@ -216,7 +220,8 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
///
/// 合约持仓明细
///
- public class CurrentPositionDetailModel
+ [Table("A1006_CurrentPositionDetail")]
+ public class CurrentPositionDetailModel : ReportSubBaseModel
{
///
/// 挂钩标的编码
@@ -320,5 +325,9 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
[DefaultValue("")]
[SacDescription("Blank2", "空白2", "", false, "")]
public string Blank2 { get; set; }
+ [XmlIgnore]
+ [DefaultValue("")]
+ [SacDescription("ConfirmationNo", "交易确认书编号", "100", false, "")]
+ public string ConfirmationNo { get; set; }
}
}
\ No newline at end of file
diff --git a/YLErpDAL/Modules/SuperviseReportModule/SAC/Model/SwapEquityPaymentModel.cs b/YLErpDAL/Modules/SuperviseReportModule/SAC/Model/SwapEquityPaymentModel.cs
index a5917a43..162fafff 100644
--- a/YLErpDAL/Modules/SuperviseReportModule/SAC/Model/SwapEquityPaymentModel.cs
+++ b/YLErpDAL/Modules/SuperviseReportModule/SAC/Model/SwapEquityPaymentModel.cs
@@ -1,4 +1,8 @@
-using System.ComponentModel;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.Xml;
+using System.Xml.Schema;
using System.Xml.Serialization;
using YLErp.Modules.SuperviseReportModule.SAC.Common;
using static YLErp.DBModels.Consts.ConsReport;
@@ -8,6 +12,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
///
/// 收益互换交易权益端支付
///
+ [Table("A1016_SwapEquityPayment")]
public class SwapEquityPaymentModel : ReportBaseModel
{
///
@@ -27,13 +32,14 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
///
[CheckStringMaxLength(MaxLength = 100)]
[DefaultValue("")]
- [SacDescription("ConfirmationNo", "交易确认书", "100", true, "双方约定;")]
+ [SacDescription("ConfirmationNo", "交易确认书(双方约定)", "100", true, "双方约定;")]
public string ConfirmationNo { get; set; }
///
/// 权益端支付
///
[XmlElement]
[CheckIEnumerableTMinCount(MinCount = 1)]
+ [NotMapped]
[SacDescription("SwapEquityPaymentTuple", "权益端支付", "", false, "")]
public List SwapEquityPaymentTuple { get; set; }
///
@@ -50,7 +56,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
///
[CheckStringLengthInMap(Map = new[] { 4, 5 }, Required = false)]
[SacDescription("DurationEventNO", "操作事件编号", "6", false, "首次随交易确认书上报时,不填;\r\n存续期发生相关事件时,必填;\r\n同一笔交易确认书下应当保证唯一性,并按照事件发生顺序进行编号,起始编号为0000.\r\n如一笔交易下依次发生展期、调仓、终止事件,编号应当分别为0000、0001、0002,\r\n场外业务报告系统返回编号分别为E0000、R0001、T0002;")]
- public new string DurationEventNO { get; set; }
+ public new string? DurationEventNO { get; set; }
///
/// 空白1
///
@@ -68,7 +74,8 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
///
/// 权益端支付
///
- public class SwapEquityPaymentTupleModel
+ [Table("A1016_SwapEquityPaymentTuple")]
+ public class SwapEquityPaymentTupleModel : ReportSubBaseModel
{
///
/// 支付方式
@@ -106,7 +113,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
///
[CheckStringIsDateTimeFormat]
[DefaultValue("")]
- [SacDescription("OpenandClosingDate", "标的开/平仓日期", "2", true, "yyyy-MM-dd;")]
+ [SacDescription("OpenandClosingDate", "标的开/平仓日期", "10", true, "yyyy-MM-dd;")]
public string OpenandClosingDate { get; set; }
///
/// 标的小类
@@ -197,7 +204,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
[CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 2, MinValue = 0, CheckHandleName = "A")]
[CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 2, MinValue = 0, Required = false, CheckHandleName = "B")]
[DefaultValue("")]
- [SacDescription("LNotinalPrincipleAmt", "多头名义本金", "36,2", false, "标的数量*合约乘数*标的价格;\r\n当支付方式选择权益收益(多头)、浮动利率收益、权益收益多空组合时,必填;")]
+ [SacDescription("LNotinalPrincipleAmt", "多头名义本金(元)", "36,2", false, "标的数量*合约乘数*标的价格;\r\n当支付方式选择权益收益(多头)、浮动利率收益、权益收益多空组合时,必填;")]
public string LNotinalPrincipleAmt { get; set; }
///
/// 空头名义本金(元)
@@ -210,7 +217,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
[CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 2, MaxValue = 0, CheckHandleName = "A")]
[CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 2, MaxValue = 0, Required = false, CheckHandleName = "B")]
[DefaultValue("")]
- [SacDescription("SNotinalPrincipleAmt", "空头名义本金", "36,2", false, "-(标的数量*合约乘数* 标的价格)\r\n当支付方式选择权益收益(空头)、浮动利率收益、权益收益多空组合时,必填;")]
+ [SacDescription("SNotinalPrincipleAmt", "空头名义本金(元)", "36,2", false, "-(标的数量*合约乘数* 标的价格)\r\n当支付方式选择权益收益(空头)、浮动利率收益、权益收益多空组合时,必填;")]
public string SNotinalPrincipleAmt { get; set; }
///
/// 利率(%)
@@ -220,7 +227,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
///
[CheckStringIntLength(BeforePointMaxLength = 8, AfterPointLength = 2, MinValue = 0, Required = false)]
[DefaultValue("")]
- [SacDescription("InterestRate", "利率", "8,2", false, "校验规则:大于等于0的两位小数,如5.12;")]
+ [SacDescription("InterestRate", "利率(%)", "8,2", false, "校验规则:大于等于0的两位小数,如5.12;")]
public string InterestRate { get; set; }
///
/// 空白1
@@ -234,5 +241,9 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Model
[DefaultValue("")]
[SacDescription("Blank2", "空白2", "", false, "")]
public string Blank2 { get; set; }
+ [XmlIgnore]
+ [DefaultValue("")]
+ [SacDescription("ConfirmationNo", "交易确认书编号", "100", false, "")]
+ public string ConfirmationNo { get; set; }
}
}
\ No newline at end of file
diff --git a/YLErpDAL/Modules/SuperviseReportModule/SAC/Model/ValuationInformationModel.cs b/YLErpDAL/Modules/SuperviseReportModule/SAC/Model/ValuationInformationModel.cs
new file mode 100644
index 00000000..837745d2
--- /dev/null
+++ b/YLErpDAL/Modules/SuperviseReportModule/SAC/Model/ValuationInformationModel.cs
@@ -0,0 +1,240 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Xml.Serialization;
+using YLErp.Modules.SuperviseReportModule.SAC.Common;
+using static YLErp.DBModels.Consts.ConsReport;
+
+namespace YLErp.Modules.SuperviseReportModule.SAC.Model
+{
+ ///
+ /// 场外期权合约估值信息
+ ///
+ [Table("A1018_ValuationInformation")]
+ public class ValuationInformationModel : ReportBaseModel
+ {
+ ///
+ /// 操作标识
+ /// 长度:1
+ /// 必填:是
+ /// 说明:
+ ///
+ [XmlIgnore]
+ [SacDescription("OperationType", "操作标识", "1", true, "")]
+ public OptFlagsEnum OperationType { get; set; }
+
+ ///
+ /// 交易确认书编号(双方约定)
+ /// 长度:100
+ /// 必填:是
+ /// 说明:双方约定
+ ///
+ [CheckStringMaxLength(MaxLength = 100)]
+ [DefaultValue("")]
+ [SacDescription("ConfirmationNo", "交易确认书编号(双方约定)", "100", true, "双方约定;")]
+ public string ConfirmationNo { get; set; }
+
+ ///
+ /// 估值日期
+ /// 长度:10
+ /// 必填:是
+ /// 说明:
+ ///
+ [CheckStringLength(Length = 10)]
+ [CheckStringIsDateTimeFormat(FormatString = "yyyy-MM-dd")]
+ [DefaultValue("")]
+ [SacDescription("ValuationDate", "估值日期", "10", true, "")]
+ public string ValuationDate { get; set; }
+
+ ///
+ /// 存量名义本金(元)
+ /// 长度:36,2
+ /// 必填:是
+ /// 说明:两位小数;大于等于0的数字
+ ///
+ [CheckStringIntMaxLength(BeforePointMaxLength = 36, AfterPointMaxLength = 2, MinValue = 0)]
+ [DefaultValue("")]
+ [SacDescription("Balance", "存量名义本金(元)", "36,2", true, "大于等于0的数字;")]
+ public string Balance { get; set; }
+
+ ///
+ /// 保证金比例(%)
+ /// 长度:8,2
+ /// 必填:否
+ /// 说明:
+ ///
+ [CheckStringIntMaxLength(BeforePointMaxLength = 8, AfterPointMaxLength = 2, Required = false)]
+ [DefaultValue("")]
+ [SacDescription("MarginRatio", "保证金比例(%)", "8,2", false, "")]
+ public string MarginRatio { get; set; }
+
+ ///
+ /// 期权估值
+ /// 长度:36,2
+ /// 必填:是
+ /// 说明:期权生效后,每个交易日更新,直至期权终止
+ ///
+ [CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 2)]
+ [DefaultValue("")]
+ [SacDescription("OptionValuation", "期权估值", "36,2", true, "期权生效后,每个交易日更新,直至期权终止;")]
+ public string OptionValuation { get; set; }
+
+ ///
+ /// Delta
+ /// 长度:36,2
+ /// 必填:是
+ /// 说明:期权生效后,每个交易日更新,直至期权终止
+ ///
+ [CheckStringIntMaxLength(BeforePointMaxLength = 36, AfterPointMaxLength = 2)]
+ [DefaultValue("")]
+ [SacDescription("Delta", "Delta", "36,2", true, "期权生效后,每个交易日更新,直至期权终止;")]
+ public string Delta { get; set; }
+
+ ///
+ /// Gamma
+ /// 长度:36,2
+ /// 必填:是
+ /// 说明:期权生效后,每个交易日更新,直至期权终止
+ ///
+ [CheckStringIntMaxLength(BeforePointMaxLength = 36, AfterPointMaxLength = 2)]
+ [DefaultValue("")]
+ [SacDescription("Gamma", "Gamma", "36,2", true, "期权生效后,每个交易日更新,直至期权终止;")]
+ public string Gamma { get; set; }
+
+ ///
+ /// Vega
+ /// 长度:36,2
+ /// 必填:是
+ /// 说明:期权生效后,每个交易日更新,直至期权终止
+ ///
+ [CheckStringIntMaxLength(BeforePointMaxLength = 36, AfterPointMaxLength = 2)]
+ [DefaultValue("")]
+ [SacDescription("Vega", "Vega", "36,2", true, "期权生效后,每个交易日更新,直至期权终止;")]
+ public string Vega { get; set; }
+
+ ///
+ /// Theta
+ /// 长度:36,2
+ /// 必填:是
+ /// 说明:期权生效后,每个交易日更新,直至期权终止
+ ///
+ [CheckStringIntMaxLength(BeforePointMaxLength = 36, AfterPointMaxLength = 2)]
+ [DefaultValue("")]
+ [SacDescription("Theta", "Theta", "36,2", true, "期权生效后,每个交易日更新,直至期权终止;")]
+ public string Theta { get; set; }
+
+ ///
+ /// Rho
+ /// 长度:36,2
+ /// 必填:是
+ /// 说明:期权生效后,每个交易日更新,直至期权终止
+ ///
+ [CheckStringIntMaxLength(BeforePointMaxLength = 36, AfterPointMaxLength = 2)]
+ [DefaultValue("")]
+ [SacDescription("Rho", "Rho", "36,2", true, "期权生效后,每个交易日更新,直至期权终止;")]
+ public string Rho { get; set; }
+
+ ///
+ /// RhoQ
+ /// 长度:36,2
+ /// 必填:否
+ /// 说明:
+ ///
+ [CheckStringIntMaxLength(BeforePointMaxLength = 36, AfterPointMaxLength = 2, Required = false)]
+ [DefaultValue("")]
+ [SacDescription("RhoQ", "RhoQ", "36,2", false, "")]
+ public string RhoQ { get; set; }
+
+ ///
+ /// DeltaCash
+ /// 长度:36,2
+ /// 必填:是
+ /// 说明:期权生效后,每个交易日更新,直至期权终止
+ ///
+ [CheckStringIntMaxLength(BeforePointMaxLength = 36, AfterPointMaxLength = 2)]
+ [DefaultValue("")]
+ [SacDescription("DeltaCash", "DeltaCash", "36,2", true, "期权生效后,每个交易日更新,直至期权终止;")]
+ public string DeltaCash { get; set; }
+
+ ///
+ /// GammaCash
+ /// 长度:36,2
+ /// 必填:是
+ /// 说明:期权生效后,每个交易日更新,直至期权终止
+ ///
+ [CheckStringIntMaxLength(BeforePointMaxLength = 36, AfterPointMaxLength = 2)]
+ [DefaultValue("")]
+ [SacDescription("GammaCash", "GammaCash", "36,2", true, "期权生效后,每个交易日更新,直至期权终止;")]
+ public string GammaCash { get; set; }
+
+ ///
+ /// VegaCash
+ /// 长度:36,2
+ /// 必填:是
+ /// 说明:期权生效后,每个交易日更新,直至期权终止
+ ///
+ [CheckStringIntMaxLength(BeforePointMaxLength = 36, AfterPointMaxLength = 2)]
+ [DefaultValue("")]
+ [SacDescription("VegaCash", "VegaCash", "36,2", true, "期权生效后,每个交易日更新,直至期权终止;")]
+ public string VegaCash { get; set; }
+
+ ///
+ /// ThetaCash
+ /// 长度:36,2
+ /// 必填:否
+ /// 说明:
+ ///
+ [CheckStringIntMaxLength(BeforePointMaxLength = 36, AfterPointMaxLength = 2, Required = false)]
+ [DefaultValue("")]
+ [SacDescription("ThetaCash", "ThetaCash", "36,2", false, "")]
+ public string ThetaCash { get; set; }
+
+ ///
+ /// RhoCash
+ /// 长度:36,2
+ /// 必填:否
+ /// 说明:
+ ///
+ [CheckStringIntMaxLength(BeforePointMaxLength = 36, AfterPointMaxLength = 2, Required = false)]
+ [DefaultValue("")]
+ [SacDescription("RhoCash", "RhoCash", "36,2", false, "")]
+ public string RhoCash { get; set; }
+
+ ///
+ /// RhoQCash
+ /// 长度:36,2
+ /// 必填:否
+ /// 说明:
+ ///
+ [CheckStringIntMaxLength(BeforePointMaxLength = 36, AfterPointMaxLength = 2, Required = false)]
+ [DefaultValue("")]
+ [SacDescription("RhoQCash", "RhoQCash", "36,2", false, "")]
+ public string RhoQCash { get; set; }
+
+ ///
+ /// 空白1
+ /// 长度:
+ /// 必填:否
+ /// 说明:
+ ///
+ [XmlIgnore]
+ [DefaultValue("")]
+ [SacDescription("Blank1", "空白1", "", false, "")]
+ public string Blank1 { get; set; }
+
+ ///
+ /// 空白2
+ /// 长度:
+ /// 必填:否
+ /// 说明:
+ ///
+ [XmlIgnore]
+ [DefaultValue("")]
+ [SacDescription("Blank2", "空白2", "", false, "")]
+ public string Blank2 { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/YLErpDAL/Modules/SuperviseReportModule/SAC/Service/ContractNumberProcessService.cs b/YLErpDAL/Modules/SuperviseReportModule/SAC/Service/ContractNumberProcessService.cs
index 13f3815e..f5f701ec 100644
--- a/YLErpDAL/Modules/SuperviseReportModule/SAC/Service/ContractNumberProcessService.cs
+++ b/YLErpDAL/Modules/SuperviseReportModule/SAC/Service/ContractNumberProcessService.cs
@@ -1,4 +1,4 @@
-using System.Data;
+using DocumentFormat.OpenXml.Bibliography;
using YLErp.DBModels.Enums;
using YLErp.Modules.SuperviseReportModule.SAC.Common;
using YLErp.Modules.SuperviseReportModule.SAC.Model;
@@ -19,44 +19,46 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
protected override DataFlagsEnum BusiDataType => DataFlagsEnum.A1015;
- private List _validOperationType = null;
+ private List? _validOperationType = null;
public override List ValidOperationType
{
get
{
- if (_validOperationType == null)
- {
- _validOperationType = new List() {
+ _validOperationType ??= new List() {
OptFlagsEnum.A,
};
- }
return _validOperationType;
}
}
protected override SuperviseReportTypeEnum ReportType => SuperviseReportTypeEnum.SAC_ContractNumberProcess;
+ List noteList = new List();
protected override BodyModel GenerateBody(out bool noData, out List fileList)
{
fileList = new List();
- BodyModel model = new BodyModel();
- model.ContractNumberProcess = new ContractNumberProcessModel();
- model.ContractNumberProcess.MasterAgrmtTuple = new List();
- model.ContractNumberProcess.SupAgrmtTuple = new List();
- model.ContractNumberProcess.OptionConfirmationTuple = new List();
- model.ContractNumberProcess.SwapConfirmationTuple = new List();
- HashSet masterAgrmtTupleId = new HashSet();
- HashSet masterAgrmtTupleNo = new HashSet();
- HashSet supAgrmtTupleId = new HashSet();
- HashSet supAgrmtTupleNo = new HashSet();
- HashSet confirmationTupleId = new HashSet();
- HashSet confirmationTupleNo = new HashSet();
+ var model = new BodyModel
+ {
+ ContractNumberProcess = new ContractNumberProcessModel
+ {
+ MasterAgrmtTuple = new List(),
+ SupAgrmtTuple = new List(),
+ OptionConfirmationTuple = new List(),
+ SwapConfirmationTuple = new List()
+ }
+ };
+ var masterAgrmtTupleId = new HashSet();
+ var masterAgrmtTupleNo = new HashSet();
+ var supAgrmtTupleId = new HashSet();
+ var supAgrmtTupleNo = new HashSet();
+ var confirmationTupleId = new HashSet();
+ var confirmationTupleNo = new HashSet();
string id = "", no = "";
if (_excelDataSource != null && _excelDataSource.Tables.Contains("双方约定编号数据明细"))
{
- DataTable dt = _excelDataSource.Tables["双方约定编号数据明细"];
- for (int i = 1; i < dt.Rows.Count; i++)
+ var dt = _excelDataSource.Tables["双方约定编号数据明细"];
+ for (var i = 1; i < dt.Rows.Count; i++)
{
if (string.IsNullOrWhiteSpace(dt.Rows[i][0]?.ToString()))
{
@@ -137,27 +139,44 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
{
model.ContractNumberProcess.SwapConfirmationTuple.Add(new ChangeOptionConfirmationModel());
}
+ ReportService.EditContractNumber(DbContextFactory.GetYLDbContext(), model.ContractNumberProcess, out _);
+ var note = new SACReportNotes();
+ note.IsValid = true;
+ note.InfoCache = $"{{\"Tag\":\"\"}}";
+ note.ExceId = model.ContractNumberProcess.ExceID;
+ note.CreateTime = DateTime.Now;
+ note.FileTag = FileTag;
+ note.ReportType = ReportType;
+ note.ReportDate = _reqInfo.ReportDate;
+ note.InfoTag = BusiDataType.ToString();
+ note.OptTime = note.CreateTime;
+ note.RetCode = "";
+ note.RetMsg = "";
+ note.ReportResponse = false;
+ note.BizId = "";
+ note.changeStatus = false;
+ noteList.Add(note);
}
return model;
}
protected override List CheckBodyValue(BodyModel model, out bool checkStatus)
{
- List result = new List();
+ var result = new List();
if (model.ContractNumberProcess != null)
{
- List listRoot = new List();
- CheckHelper helper = new CheckHelper();
- CheckHelper masterAgrmtHelper = new CheckHelper();
- CheckHelper supAgrmtHelper = new CheckHelper();
- CheckHelper optionConfirmationHelper = new CheckHelper();
+ var listRoot = new List();
+ var helper = new CheckHelper();
+ var masterAgrmtHelper = new CheckHelper();
+ var supAgrmtHelper = new CheckHelper();
+ var optionConfirmationHelper = new CheckHelper();
helper.ExecuteCheck(model.ContractNumberProcess, (name, value, msg) =>
{
listRoot.Add(new SacInfo(name, value, msg));
});
if (model.ContractNumberProcess.MasterAgrmtTuple != null)
{
- for (int i = 0; i < model.ContractNumberProcess.MasterAgrmtTuple.Count; i++)
+ for (var i = 0; i < model.ContractNumberProcess.MasterAgrmtTuple.Count; i++)
{
var listItem = new List();
var item = model.ContractNumberProcess.MasterAgrmtTuple[i];
@@ -167,15 +186,17 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
});
if (listItem.Count > 0)
{
- var temp = new SacInfo("MasterAgrmtTuple", i);
- temp.SubMaps = new List(listItem);
+ var temp = new SacInfo("MasterAgrmtTuple", i)
+ {
+ SubMaps = new List(listItem)
+ };
listRoot.Add(temp);
}
}
}
if (model.ContractNumberProcess.SupAgrmtTuple != null)
{
- for (int i = 0; i < model.ContractNumberProcess.SupAgrmtTuple.Count; i++)
+ for (var i = 0; i < model.ContractNumberProcess.SupAgrmtTuple.Count; i++)
{
var listItem = new List();
var item = model.ContractNumberProcess.SupAgrmtTuple[i];
@@ -185,15 +206,17 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
});
if (listItem.Count > 0)
{
- var temp = new SacInfo("SupAgrmtTuple", i);
- temp.SubMaps = new List(listItem);
+ var temp = new SacInfo("SupAgrmtTuple", i)
+ {
+ SubMaps = new List(listItem)
+ };
listRoot.Add(temp);
}
}
}
if (model.ContractNumberProcess.OptionConfirmationTuple != null)
{
- for (int i = 0; i < model.ContractNumberProcess.OptionConfirmationTuple.Count; i++)
+ for (var i = 0; i < model.ContractNumberProcess.OptionConfirmationTuple.Count; i++)
{
var listItem = new List();
var item = model.ContractNumberProcess.OptionConfirmationTuple[i];
@@ -203,15 +226,17 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
});
if (listItem.Count > 0)
{
- var temp = new SacInfo("OptionConfirmationTuple", i);
- temp.SubMaps = new List(listItem);
+ var temp = new SacInfo("OptionConfirmationTuple", i)
+ {
+ SubMaps = new List(listItem)
+ };
listRoot.Add(temp);
}
}
}
if (model.ContractNumberProcess.SwapConfirmationTuple != null)
{
- for (int i = 0; i < model.ContractNumberProcess.SwapConfirmationTuple.Count; i++)
+ for (var i = 0; i < model.ContractNumberProcess.SwapConfirmationTuple.Count; i++)
{
var listItem = new List();
var item = model.ContractNumberProcess.SwapConfirmationTuple[i];
@@ -221,21 +246,42 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
});
if (listItem.Count > 0)
{
- var temp = new SacInfo("SwapConfirmationTuple", i);
- temp.SubMaps = new List(listItem);
+ var temp = new SacInfo("SwapConfirmationTuple", i)
+ {
+ SubMaps = new List(listItem)
+ };
listRoot.Add(temp);
}
}
}
if (listRoot.Count > 0)
{
- var errMsg = new SacInfo("ContractNumberProcess");
- errMsg.SubMaps = new List(listRoot);
+ var errMsg = new SacInfo("ContractNumberProcess")
+ {
+ SubMaps = new List(listRoot)
+ };
result.Add(errMsg);
}
}
checkStatus = result.Count > 0;
return result;
}
+
+ protected override string _changeCodeOfInfoTag(string infoTag, string newCode, out string originalCode)
+ {
+ //这个报告只有新增,不存在后续报送,所以InfoTag中只有报告类型,不存在编号,也就不存在修改编号的情况;
+ throw new NotImplementedException();
+ }
+
+ public override bool BeforeOfGenerated(out string errMsg)
+ {
+ errMsg = "";
+ for (int i = 0; i < noteList.Count; i++)
+ {
+ base.SaveReportNotes(noteList[i]);
+ }
+ return true;
+ }
+
}
}
diff --git a/YLErpDAL/Modules/SuperviseReportModule/SAC/Service/ReportBaseService.cs b/YLErpDAL/Modules/SuperviseReportModule/SAC/Service/ReportBaseService.cs
index 70c70cd5..0d14d7a1 100644
--- a/YLErpDAL/Modules/SuperviseReportModule/SAC/Service/ReportBaseService.cs
+++ b/YLErpDAL/Modules/SuperviseReportModule/SAC/Service/ReportBaseService.cs
@@ -1,4 +1,6 @@
-using Oracle.ManagedDataAccess.Client;
+using BaseOUDAL;
+using NPOI.OpenXmlFormats.Dml.Diagram;
+using Oracle.ManagedDataAccess.Client;
using System.Data;
using System.Diagnostics;
using System.Text;
@@ -45,12 +47,12 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
///
/// 子系统报送文件目录
///
- protected List xmlAttachmentList = new List();
+ protected List xmlAttachmentList = new();
///
///
///
- protected TempFilesService tempFilesService = null;
+ protected TempFilesService? tempFilesService = null;
protected ReportBaseService(OptUserInfo optUser) : base(optUser)
{
@@ -66,6 +68,8 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
protected abstract DataFlagsEnum BusiDataType { get; }
+ protected virtual string CacheKey => $"{BusiDataType}";
+
protected abstract SuperviseReportTypeEnum ReportType { get; }
///
/// 支持的操作类型
@@ -78,7 +82,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
///
protected OptFlagsEnum _operationType { get; private set; }
- private YLContext _writeDb = null;
+ private YLContext? _writeDb = null;
public YLContext WriteDb
{
get
@@ -102,29 +106,20 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
public ReportRootModel Execute(ReportInfo req, OptFlagsEnum operationType)
{
- LogFactory.GetLogger("Executeone").Info($"PS.Config.ErpElement.SAC_ReportDataSource111:" + PS.Config.ErpElement.SAC_ReportDataSource.ToString());
-
_reqInfo = req;
+
+ LogFactory.GetLogger("Executeone").Info($"PS.Config.ErpElement.SAC_ReportDataSource:" + _reqInfo.DataSource.ToString());
_operationType = operationType;
- ReportRootModel root = new ReportRootModel();
+ var root = new ReportRootModel();
try
{
root.Annex = new List();
- LogFactory.GetLogger("Execute22").Info($"PS.Config.ErpElement.SAC_ReportDataSource111:" + PS.Config.ErpElement.SAC_ReportDataSource.ToString());
loadExcelDataSource();
- LogFactory.GetLogger("Execute22").Info($"PS.Config.ErpElement.SAC_ReportDataSource111:" + PS.Config.ErpElement.SAC_ReportDataSource.ToString());
-
- LogFactory.GetLogger("Execute111").Info($"PS.Config.ErpElement.SAC_ReportDataSource111:" + PS.Config.ErpElement.SAC_ReportDataSource.ToString());
- if ((PS.Config.ErpElement.SAC_ReportDataSource & SAC_ReportDataSourceEnum.KingstarView) == SAC_ReportDataSourceEnum.KingstarView)
- {
- LogFactory.GetLogger("Execute111").Info($"PS.Config.ErpElement.SAC_ReportDataSource222:" + PS.Config.ErpElement.SAC_ReportDataSource.ToString());
- loadViewDataSource();
- }
root.Header = GenerateHeader();
FileTag = root.FileTag;
- root.Body = GenerateBody(out bool noData, out List fileList);
+ root.Body = GenerateBody(out var noData, out var fileList);
if (noData)
{ return null; }
root.Annex.AddRange(fileList);
@@ -168,13 +163,15 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
private HeaderModel GenerateHeader()
{
- HeaderModel model = new HeaderModel();
- model.SenderCode = _reqInfo.SenderCode;
- model.ReceiverCode = _reqInfo.ReceiverCode;
- model.SendDate = _reqInfo.ReportDate.ToString("yyyy-MM-dd");
- model.FileNumber = FileNumber.ToString("0000");
- model.BusiDataType = BusiDataType;
- model.OperationType = _operationType.ToString();
+ var model = new HeaderModel
+ {
+ SenderCode = _reqInfo.SenderCode,
+ ReceiverCode = _reqInfo.ReceiverCode,
+ SendDate = _reqInfo.ReportDate.ToString("yyyy-MM-dd"),
+ FileNumber = FileNumber.ToString("0000"),
+ BusiDataType = BusiDataType,
+ OperationType = _operationType.ToString()
+ };
return model;
}
@@ -193,7 +190,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
errMsg = "接收方编号不应为空";
return false;
}
- if (req.ReportDate == default(DateTime))
+ if (req.ReportDate == default)
{
errMsg = "报送日期不应为空";
return false;
@@ -206,7 +203,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
SacInfo errMsg = null;
if (model != null)
{
- List listRoot = new List();
+ var listRoot = new List();
var headerItem = CheckHeaderValue(model?.Header, out _);
if (headerItem != null)
{
@@ -215,8 +212,10 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
var bodyItem = CheckBodyValue(model?.Body, out _);
if (bodyItem.Count > 0)
{
- var item = new SacInfo("Body");
- item.SubMaps = bodyItem;
+ var item = new SacInfo("Body")
+ {
+ SubMaps = bodyItem
+ };
listRoot.Add(item);
}
model.XmlStr = XmlHelper.Serializable(model, true);
@@ -234,8 +233,10 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
}
if (listRoot.Count > 0)
{
- errMsg = new SacInfo("Root");
- errMsg.SubMaps = new List(listRoot);
+ errMsg = new SacInfo("Root")
+ {
+ SubMaps = new List(listRoot)
+ };
errMsg.formatFieldDescription();
}
}
@@ -246,16 +247,18 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
private SacInfo CheckHeaderValue(HeaderModel model, out bool checkStatus)
{
SacInfo errMsg = null;
- List listRoot = new List();
- CheckHelper helper = new CheckHelper();
+ var listRoot = new List();
+ var helper = new CheckHelper();
helper.ExecuteCheck(model, (name, value, msg) =>
{
listRoot.Add(new SacInfo(name, value, msg));
});
if (listRoot.Count > 0)
{
- errMsg = new SacInfo("Header");
- errMsg.SubMaps = new List(listRoot);
+ errMsg = new SacInfo("Header")
+ {
+ SubMaps = new List(listRoot)
+ };
}
checkStatus = errMsg == null;
return errMsg;
@@ -263,29 +266,48 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
protected void SaveReportNotes(SACReportNotes sacReportNotes)
{
- sacReportNotes.DataId = sacReportNotes.DataId ?? "";
+ sacReportNotes.DataId ??= "";
WriteDb.sac_report_notes.Add(sacReportNotes);
}
+ ///
+ /// 初始化报告记录
+ ///
+ ///
+ ///
+ protected IEnumerable InitReportNotes(SuperviseReportTypeEnum reportType)
+ {
+ return DbContext.sac_report_notes.AsNoTracking().Where(O => O.ReportType == reportType).ToList();
+ }
+
///
/// 获取报送记录
///
/// 报告标识
- /// 是否忽略无效的交易
+ /// 是否需要无效的记录
///
- protected List GetReportNotes(string infoTag, bool ignoreInValid = false)
+ protected List GetReportNotes(string infoTag, bool needInValid = false, IEnumerable dataSource = null)
{
- var query = DbContext.sac_report_notes.AsNoTracking().Where(O => O.InfoTag.Contains(infoTag) && O.ReportResponse);
- if (!ignoreInValid)
+ IQueryable query;
+ if (dataSource == null)
+ {
+ query = DbContext.sac_report_notes.AsNoTracking();
+ }
+ else
+ {
+ query = dataSource.AsQueryable();
+ }
+ query = query.Where(O => O.InfoTag.Contains(infoTag) && O.ReportResponse);
+ if (!needInValid)
{
query = query.Where(O => O.IsValid);
}
return query.OrderByDescending(O => O.OptTime).ToList();
}
- protected List GetReportNotes(SuperviseReportTypeEnum reportType, string infoTag, bool ignoreInValid = false)
+ protected List GetReportNotes(SuperviseReportTypeEnum reportType, string infoTag, bool needInValid = false, IEnumerable dataSource = null)
{
- return GetReportNotes(infoTag, ignoreInValid).Where(O => O.ReportType == reportType).ToList();
+ return GetReportNotes(infoTag, needInValid, dataSource).Where(O => O.ReportType == reportType).ToList();
}
///
@@ -304,8 +326,45 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
return transactionConfirmationNumber;
}
+ ///
+ /// 检查生成内容是否合规
+ ///
+ ///
+ ///
+ ///
protected abstract List CheckBodyValue(BodyModel model, out bool checkStatus);
+ ///
+ /// 修改InfoTag中的编号
+ ///
+ /// 原始InfoTag
+ /// 要修改的编号
+ ///
+ /// 修改后的InfoTag
+ ///
+ protected abstract string _changeCodeOfInfoTag(string infoTag, string newCode, out string originalCode);
+
+ ///
+ /// 修改InfoTag中的编号
+ ///
+ /// 原始InfoTag
+ /// 要修改的编号
+ ///
+ /// 修改后的InfoTag
+ public string ChangeCodeOfInfoTag(string infoTag, string newCode, out string originalCode)
+ {
+ if (string.IsNullOrEmpty(infoTag))
+ {
+ throw new ArgumentException($"“{nameof(infoTag)}”不能为 null 或空。", nameof(infoTag));
+ }
+
+ if (string.IsNullOrEmpty(newCode))
+ {
+ throw new ArgumentException($"“{nameof(newCode)}”不能为 null 或空。", nameof(newCode));
+ }
+ return _changeCodeOfInfoTag(infoTag, newCode, out originalCode);
+ }
+
///
/// 全部报表生成成功后执行
///
@@ -372,6 +431,12 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
case SuperviseReportTypeEnum.SAC_ConfirmationAtt:
service = new ReportSwapConfirmationAttService(optUser);
break;
+ case SuperviseReportTypeEnum.SAC_OptionConfirmationAtt:
+ service = new ReportOptionConfirmationAttService(optUser);
+ break;
+ case SuperviseReportTypeEnum.SAC_ValuationInformation:
+ service = new ReportValuationInformationService(optUser);
+ break;
default:
throw new ServiceException("报表未实现");
}
@@ -384,31 +449,48 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
{
return "";
}
- string directory = $"/App_Docs/Download/Report/";
- string absDirectory = OtcAppContext.MapPath(directory);
+ var directory = $"/App_Docs/Download/Report/";
+ var absDirectory = OtcAppContext.MapPath(directory);
checkDirectory(absDirectory);
- string tempFile = Path.Combine(absDirectory, "Temp", res.FileTag);
+ var tempFile = Path.Combine(absDirectory, "Temp", res.FileTag);
checkDirectory(tempFile, true);
- string attachmentPath = Path.Combine(tempFile, "ATTACHMENT");
+ var attachmentPath = Path.Combine(tempFile, "ATTACHMENT");
checkDirectory(attachmentPath);
foreach (var item in res.Infos)
{
File.WriteAllText(Path.Combine(tempFile, item.FileTag + ".xml"), item.XmlStr);
- for (int i = 0; i < item.Annex.Count; i++)
+ for (var i = 0; i < item.Annex.Count; i++)
{
if (string.IsNullOrWhiteSpace(item.Annex[i]))
{
continue;
}
- string annexPath = item.Annex[i];
+ var annexPath = item.Annex[i];
+ LogFactory.GetLogger().Info($"附件路径:{annexPath}");
if (annexPath.StartsWith("\\") || annexPath.StartsWith("/") || !Path.IsPathRooted(annexPath))
{
annexPath = OtcAppContext.MapPath(item.Annex[i]);
+ if (!OperatingSystem.IsWindows())
+ {
+ //修复linux环境下绝对路径MapPath处理结果会增加系统根目录的问题;
+ if (!File.Exists(annexPath))
+ {
+ annexPath = item.Annex[i];
+ }
+ }
+ LogFactory.GetLogger().Info($"附件物理路径:{annexPath}");
}
- string annexFileName = Path.GetFileName(annexPath);
+ var annexFileName = Path.GetFileName(annexPath);
try
{
- File.Copy(annexPath, Path.Combine(attachmentPath, annexFileName));
+ var destFileName = Path.Combine(attachmentPath, annexFileName);
+ //国元固收从金仕达获取的交易确认书附件会有多笔交易指向同一附件的情况,做特殊处理.
+ if (PS.Config.Company == Configuration.CompanyEnum.国元固收 && File.Exists(destFileName))
+ {
+ continue;
+ }
+ LogFactory.GetLogger().Info($"附件目标路径:{destFileName}");
+ File.Copy(annexPath, destFileName);
}
catch (Exception ex)
{
@@ -418,7 +500,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
}
}
var zipFile = res.FileTag + ".zip";
- string outFile = Path.Combine(OtcAppContext.MapPath(directory), zipFile);
+ var outFile = Path.Combine(OtcAppContext.MapPath(directory), zipFile);
ZipHelper.ZipDirectory(tempFile, outFile);
return Path.Combine(directory, zipFile);
}
@@ -431,14 +513,14 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
private static SacInfo ValidationXSD(string xmlStr, string xsdPath)
{
SacInfo result = null;
- List listRoot = new List();
- XmlSchemaSet schema = new XmlSchemaSet();
+ var listRoot = new List();
+ var schema = new XmlSchemaSet();
schema.Add("", xsdPath);
- XmlReader reader = XmlReader.Create(new StringReader(xmlStr));
- XDocument doc = XDocument.Load(reader);
+ var reader = XmlReader.Create(new StringReader(xmlStr));
+ var doc = XDocument.Load(reader);
doc.Validate(schema, (obj, e) =>
{
- string msg = Regex.Replace(e.Message, @"元素[^,]+,", "");
+ var msg = Regex.Replace(e.Message, @"元素[^,]+,", "");
msg = Regex.Replace(msg, @"\s-\s[\D]+约束失败。", "").Replace("“", "").Replace("”", "");
var name = "";
try
@@ -451,8 +533,10 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
});
if (listRoot.Count > 0)
{
- result = new SacInfo("Body");
- result.SubMaps = new List(listRoot);
+ result = new SacInfo("Body")
+ {
+ SubMaps = new List(listRoot)
+ };
}
return result;
}
@@ -478,10 +562,9 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
///
protected string GetSACUndrlygAssetDtldTypeMap(ExpandoDictionary undrlygAssetDtldTypeMap, string underlyingInstrumentType, string commodityCode)
{
- string result;
var desc = ConsGlobal.InstrumentType.GetDesc(underlyingInstrumentType);
- if (!undrlygAssetDtldTypeMap.TryGetValue(desc, out result))
+ if (!undrlygAssetDtldTypeMap.TryGetValue(desc, out var result))
{
switch (desc)
{
@@ -523,7 +606,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
///
protected string GetDataSetValue(DataTable dt, int rowIndex, int colIndex)
{
- string result = "";
+ var result = "";
if (dt != null)
{
if (dt.Rows.Count <= rowIndex
@@ -543,18 +626,17 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
///
///
///
- protected string GetDataSetValue(DataTable dt, int rowIndex, string colName)
+ protected string GetDataSetValue(DataRow row, string colName)
{
- string result = "";
- if (dt != null)
+ var result = "";
+ try
{
- if (!dt.Columns.Contains(colName))
- {
- LogFactory.GetLogger("GetDataSetValue").Info($"{dt.TableName} 不存在[{colName}]列数据");
- //throw new ServiceException($"{dt.TableName} 不存在[{colName}]列数据");
- return "";
- }
- result = dt.Rows[rowIndex][colName].ToString().Trim();
+ result = row[colName].ToString().Trim();
+ }
+ catch (Exception)
+ {
+ LogFactory.GetLogger("GetDataSetValue").Info($"{row.Table.TableName} 不存在[{colName}]列数据");
+ result = "";
}
return result;
}
@@ -566,17 +648,34 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
///
///
///
- protected double GetDataSetValueToDouble(DataTable dt, int rowIndex, string colName)
+ protected double GetDataSetValueToDouble(DataRow row, string colName)
{
- double result = 0;
- var str = GetDataSetValue(dt, rowIndex, colName);
- if (str == null || !double.TryParse(str, out result))
+ var str = GetDataSetValue(row, colName);
+ if (str == null || !double.TryParse(str, out var result))
{
result = 0;
}
return result;
}
+
+ ///
+ /// 从_excelDataSource中获取汇总信息
+ ///
+ ///
+ ///
+ ///
+ ///
+ protected double? GetDataSetValueToDoubleOrNull(DataTable dt, int rowIndex, int colIndex)
+ {
+ var str = GetDataSetValue(dt, rowIndex, colIndex);
+ if (str == null || !double.TryParse(str, out var result))
+ {
+ return null;
+ }
+ return result;
+ }
+
///
/// 从_excelDataSource中获取指定信息
///
@@ -586,9 +685,8 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
///
protected double GetDataSetValueToDouble(DataTable dt, int rowIndex, int colIndex)
{
- double result = 0;
var str = GetDataSetValue(dt, rowIndex, colIndex);
- if (str == null || !double.TryParse(str, out result))
+ if (str == null || !double.TryParse(str, out var result))
{
result = 0;
}
@@ -597,8 +695,8 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
protected void loadExcelDataSource()
{
- if (((PS.Config.ErpElement.SAC_ReportDataSource & SAC_ReportDataSourceEnum.Template) == SAC_ReportDataSourceEnum.Template ||
- BusiDataType == DataFlagsEnum.A1011 ||
+ if ((_reqInfo.DataSource.HasFlag(SAC_ReportDataSourceEnum.Template) ||
+ //BusiDataType == DataFlagsEnum.A1011 ||
BusiDataType == DataFlagsEnum.A1012 ||
BusiDataType == DataFlagsEnum.A1013) &&
!string.IsNullOrWhiteSpace(_excelDataSourcePath))
@@ -609,12 +707,12 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
return;
}
_excelDataSourceRootPath = $"{Path.GetDirectoryName(rootPath)}\\{Path.GetFileNameWithoutExtension(rootPath)}\\";
- string path = $"{_excelDataSourceRootPath}{_excelDataSourcePath}";
+ var path = $"{_excelDataSourceRootPath}{_excelDataSourcePath}";
LogFactory.GetLogger("loadExcelDataSource").Info($"查找数据源目录:{path}");
path = OtcAppContext.MapPath(path);
if (System.IO.Directory.Exists(path))
{
- string filePath = System.IO.Directory.GetFiles(path, _excelDataSourceFileName).FirstOrDefault();
+ var filePath = System.IO.Directory.GetFiles(path, _excelDataSourceFileName).FirstOrDefault();
LogFactory.GetLogger("loadExcelDataSource").Info($"查找数据源文件:{filePath}");
if (!string.IsNullOrWhiteSpace(filePath))
{
@@ -702,23 +800,34 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
private string GetDataReaderValue(OracleDataReader dr, string fieldName)
{
- string result = "";
- if (dr == null) return result;
+ var result = "";
+ if (dr == null)
+ {
+ return result;
+ }
+
result = dr[fieldName] == DBNull.Value ? "" : dr[fieldName].ToString();
return result;
}
- private void SetOneColumnData(OracleDataReader dr, DataRow row, string fieldName)
+ private string SetOneColumnData(OracleDataReader dr, DataRow row, string fieldName)
{
- SetOneColumnData(dr, row, fieldName, "");
+ return SetOneColumnData(dr, row, fieldName, "");
}
- private void SetOneColumnData(OracleDataReader dr, DataRow row, string fieldName, string toFileName = "")
+ private string SetOneColumnData(OracleDataReader dr, DataRow row, string fieldName, string toFileName = "")
+ {
+ var value = GetDataReaderValue(dr, fieldName);
+ return SetOneColumnData(value, row, fieldName, toFileName);
+ }
+
+ private string SetOneColumnData(string value, DataRow row, string fieldName, string toFileName = "")
{
if (string.IsNullOrEmpty(toFileName))
- row[fieldName] = GetDataReaderValue(dr, fieldName);
+ row[fieldName] = value;
else
- row[toFileName] = GetDataReaderValue(dr, fieldName);
+ row[toFileName] = value;
+ return value;
}
#region 交易确认书视图数据读取
@@ -733,10 +842,8 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
try
{
LogFactory.GetLogger("GetSwapConfirm").Info("进入GetSwapConfirm");
- string schema = PS.Config.ErpElement.KingstarViewTableSchema.IsNullOrWhiteSpace() ? "" : $"\"{PS.Config.ErpElement.KingstarViewTableSchema}\".";
+ var schema = PS.Config.ErpElement.KingstarViewTableSchema.IsNullOrWhiteSpace() ? "" : $"\"{PS.Config.ErpElement.KingstarViewTableSchema}\".";
var dtSwapConfirm = CreateSwapConfirmDataTable();
- var dtSwapCollateral = CreateSwapCollateralDataTable();
- var dtPaymentMethod = CreatePaymentMethodDataTable();
LogFactory.GetLogger("GetSwapConfirm").Info("创建完3个DataTable结构");
var sqlStr = new StringBuilder();
@@ -756,13 +863,17 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
}
CreateSwapConfirmNewRow(dtSwapConfirm, dr);
});
+ if (dtSwapConfirm.Rows.Count > 0)
+ {
+ sqlStr.Clear();
+ sqlStr.Append("SELECT collateral.*");
+ sqlStr.Append($"FROM {schema}v_swap_collateral_A1005 collateral ");
+ sqlStr.Append($"WHERE collateral.BUSIDATE='{reportDate.ToString("yyyy-MM-dd")}'");
- sqlStr.Clear();
- sqlStr.Append("SELECT collateral.*");
- sqlStr.Append($"FROM {schema}v_swap_collateral_A1005 collateral ");
- sqlStr.Append($"WHERE collateral.BUSIDATE='{reportDate.ToString("yyyy-MM-dd")}'");
+ var dtSwapCollateral = CreateSwapCollateralDataTable();
+ var dict = new Dictionary>();
- db.ExecuteSql(sqlStr.ToString(), dr =>
+ db.ExecuteSql(sqlStr.ToString(), dr =>
{
try
{
@@ -772,15 +883,19 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
{
LogFactory.GetLogger("GetSwapConfirm ExecuteSql CreateSwapPerformanceGuaranteeAttNewRow").Error(ex);
}
- CreateSwapCollateralNewRow(dtSwapCollateral, dr);
+ CreateSwapCollateralNewRow(dtSwapCollateral, dr, dict, setIndexDict);
});
+ dtSwapCollateral.ExtendedProperties["Index"] = dict;
- sqlStr.Clear();
- sqlStr.Append("SELECT feepayment.*");
- sqlStr.Append($"FROM {schema}v_swap_fee_payment_A1005 feepayment ");
- sqlStr.Append($"WHERE feepayment.BUSIDATE='{reportDate.ToString("yyyy-MM-dd")}'");
+ dict = new Dictionary>();
+ sqlStr.Clear();
+ sqlStr.Append("SELECT feepayment.*");
+ sqlStr.Append($"FROM {schema}v_swap_fee_payment_A1005 feepayment ");
+ sqlStr.Append($"WHERE feepayment.BUSIDATE='{reportDate.ToString("yyyy-MM-dd")}'");
- db.ExecuteSql(sqlStr.ToString(), dr =>
+ var dtPaymentMethod = CreatePaymentMethodDataTable();
+
+ db.ExecuteSql(sqlStr.ToString(), dr =>
{
try
{
@@ -790,14 +905,17 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
{
LogFactory.GetLogger("GetSwapConfirm ExecuteSql CreatePaymentMethodNewRow").Error(ex);
}
- CreatePaymentMethodNewRow(dtPaymentMethod, dr);
+ CreatePaymentMethodNewRow(dtPaymentMethod, dr, dict, setIndexDict);
});
- LogFactory.GetLogger("GetSwapConfirm").Info("dtSwapConfirm Data:" + dtSwapConfirm.ToStringContent());
- _viewDataSource.Tables.Add(dtSwapConfirm);
- LogFactory.GetLogger("GetSwapConfirm").Info("CreateSwapCollateralNewRow Data:" + dtSwapCollateral.ToStringContent());
- _viewDataSource.Tables.Add(dtSwapCollateral);
- LogFactory.GetLogger("GetSwapConfirm").Info("dtPaymentMethod Data:" + dtPaymentMethod.ToStringContent());
- _viewDataSource.Tables.Add(dtPaymentMethod);
+ dtPaymentMethod.ExtendedProperties["Index"] = dict;
+
+ _viewDataSource.Tables.Add(dtSwapConfirm);
+ _viewDataSource.Tables.Add(dtSwapCollateral);
+ _viewDataSource.Tables.Add(dtPaymentMethod);
+ LogFactory.GetLogger("GetSwapConfirm ExecuteSql dtSwapConfirm").Info($"dtSwapConfirm:{dtSwapConfirm.Rows.Count}");
+ LogFactory.GetLogger("GetSwapConfirm ExecuteSql dtSwapCollateral").Info($"dtSwapCollateral:{dtSwapCollateral.Rows.Count}");
+ LogFactory.GetLogger("GetSwapConfirm ExecuteSql dtPaymentMethod").Info($"dtPaymentMethod:{dtPaymentMethod.Rows.Count}");
+ }
LogFactory.GetLogger("GetSwapConfirm").Info("成功执行完离开GetSwapConfirm");
}
catch (Exception ex)
@@ -806,10 +924,21 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
}
}
- private void CreatePaymentMethodNewRow(DataTable dtPaymentMethod, OracleDataReader dr)
+ ///
+ /// 增加确认书-费用端支付记录
+ ///
+ ///
+ ///
+ ///
+ ///
+ private void CreatePaymentMethodNewRow(
+ DataTable dtPaymentMethod,
+ OracleDataReader dr,
+ Dictionary> indexDict,
+ Action>, DataRow, string> action)
{
var newRow = dtPaymentMethod.NewRow();
- SetOneColumnData(dr, newRow, "CONFIRMATIONNO");
+ var no = SetOneColumnData(dr, newRow, "CONFIRMATIONNO");
SetOneColumnData(dr, newRow, "PAYMENTMETHOD");
SetOneColumnData(dr, newRow, "PAYER");
SetOneColumnData(dr, newRow, "PAYMENTFREQ");
@@ -820,25 +949,51 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
SetOneColumnData(dr, newRow, "BLANK1", "BLANK1");
SetOneColumnData(dr, newRow, "BLANK2", "BLANK2");
dtPaymentMethod.Rows.Add(newRow);
+ action(indexDict, newRow, no);
}
- private void CreateSwapCollateralNewRow(DataTable dtSwapPerformanceGuaranteeAtt, OracleDataReader dr)
+ ///
+ /// 增加确认书-履约担保品记录
+ ///
+ ///
+ ///
+ ///
+ ///
+ private void CreateSwapCollateralNewRow(
+ DataTable dtSwapPerformanceGuaranteeAtt,
+ OracleDataReader dr,
+ Dictionary> indexDict,
+ Action>, DataRow, string> action)
{
var newRow = dtSwapPerformanceGuaranteeAtt.NewRow();
- SetOneColumnData(dr, newRow, "CONFIRMATIONNO");
+ var no = SetOneColumnData(dr, newRow, "CONFIRMATIONNO");
SetOneColumnData(dr, newRow, "PERFORMANCECOLLTYPE");
SetOneColumnData(dr, newRow, "PERFORMANCECOLLRANGE");
SetOneColumnData(dr, newRow, "MULTICONFIRMATIONID");
SetOneColumnData(dr, newRow, "REMARKS", "REMARKS");
dtSwapPerformanceGuaranteeAtt.Rows.Add(newRow);
+ action(indexDict, newRow, no);
}
+ private static void setIndexDict(Dictionary> indexDict, DataRow row, string no)
+ {
+ if (!indexDict.ContainsKey(no))
+ {
+ indexDict[no] = new List();
+ }
+ indexDict[no].Add(row);
+ }
+
+ ///
+ /// 增加确认书记录
+ ///
+ ///
+ ///
private void CreateSwapConfirmNewRow(DataTable dtSwapConfirm, OracleDataReader dr)
{
- LogFactory.GetLogger("CreateSwapConfirmNewRow").Info("进入CreateSwapConfirmNewRow");
var confirmationNo = GetDataReaderValue(dr, "CONFIRMATIONNO");
- var rows = dtSwapConfirm.Select("CONFIRMATIONNO='" + confirmationNo + "'");
- if (rows != null && rows.Count() > 0) return;//存在了就不用再加了
+ var row = dtSwapConfirm.Rows.Find(confirmationNo);
+ if (row != null) return;//存在了就不用再加了
var newRow = dtSwapConfirm.NewRow();
@@ -889,12 +1044,17 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
dtSwapConfirm.Rows.Add(newRow);
LogFactory.GetLogger("CreateSwapConfirmNewRow").Info("退出CreateSwapConfirmNewRow");
}
+
+ ///
+ /// 创建确认书表格
+ ///
+ ///
private DataTable CreateSwapConfirmDataTable()
{
var dtSwapConfirm = new DataTable("交易确认书");
dtSwapConfirm.Columns.Add("MASTERAGRMTNO");
dtSwapConfirm.Columns.Add("SUPAGRMNO");
- dtSwapConfirm.Columns.Add("CONFIRMATIONNO");
+ var primaryKey = dtSwapConfirm.Columns.Add("CONFIRMATIONNO");
dtSwapConfirm.Columns.Add("FILLPARTY");
dtSwapConfirm.Columns.Add("SWAPTYPE");
dtSwapConfirm.Columns.Add("STARTDATE");
@@ -931,9 +1091,15 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
dtSwapConfirm.Columns.Add("BLANK2");
dtSwapConfirm.Columns.Add("SUBMIT_STATUS");
dtSwapConfirm.Columns.Add("OPERATIONTYPE");
+
+ dtSwapConfirm.PrimaryKey = new DataColumn[] { primaryKey };
return dtSwapConfirm;
}
+ ///
+ /// 创建确认书-履约担保品表格
+ ///
+ ///
private DataTable CreateSwapCollateralDataTable()
{
var dtSwapPerformanceGuaranteeAtt = new DataTable("履约担保品");
@@ -942,9 +1108,14 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
dtSwapPerformanceGuaranteeAtt.Columns.Add("PERFORMANCECOLLRANGE");
dtSwapPerformanceGuaranteeAtt.Columns.Add("MULTICONFIRMATIONID");
dtSwapPerformanceGuaranteeAtt.Columns.Add("REMARKS");
+
return dtSwapPerformanceGuaranteeAtt;
}
+ ///
+ /// 创建确认书-费用端支付表格
+ ///
+ ///
private DataTable CreatePaymentMethodDataTable()
{
var dtPaymentMethod = new DataTable("费用端支付");
@@ -958,6 +1129,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
dtPaymentMethod.Columns.Add("BASEPOINT");
dtPaymentMethod.Columns.Add("BLANK1");
dtPaymentMethod.Columns.Add("BLANK2");
+
return dtPaymentMethod;
}
@@ -975,11 +1147,9 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
{
try
{
- string schema = PS.Config.ErpElement.KingstarViewTableSchema.IsNullOrWhiteSpace() ? "" : $"\"{PS.Config.ErpElement.KingstarViewTableSchema}\".";
+ var schema = PS.Config.ErpElement.KingstarViewTableSchema.IsNullOrWhiteSpace() ? "" : $"\"{PS.Config.ErpElement.KingstarViewTableSchema}\".";
LogFactory.GetLogger("GetSwapLifeCycle").Info("进入GetSwapLifeCycle");
var dtSwapLifeCycle = CreateSwapLifeCycleDataTable();
- var dtSwapLifeCyclePosDt = CreateSwapLifeCyclePosDtDataTable();
- LogFactory.GetLogger("GetSwapLifeCycle").Info("创建完2个DataTable结构");
var sqlStr = new StringBuilder();
sqlStr.Append("SELECT lifecycle.* ");
sqlStr.Append($" FROM {schema}v_swap_lifecycle_A1006 lifecycle ");
@@ -1001,29 +1171,38 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
CreateSwapLifeCycleNewRow(dtSwapLifeCycle, dr);
});
- sqlStr.Clear();
- sqlStr.Append("SELECT posdt.* ");
- sqlStr.Append($" FROM {schema}v_swap_lifecycle_pos_dt_A1006 posdt ");
- sqlStr.Append($"WHERE posdt.BUSIDATE='{reportDate.ToString("yyyy-MM-dd")}'");
-
- LogFactory.GetLogger("GetSwapLifeCycle").Info($"sqlStr:{sqlStr}");
-
- db.ExecuteSql(sqlStr.ToString(), dr =>
+ if (dtSwapLifeCycle.Rows.Count > 0)
{
- try
+ sqlStr.Clear();
+ sqlStr.Append("SELECT posdt.* ");
+ sqlStr.Append($" FROM {schema}v_swap_lifecycle_pos_dt_A1006 posdt ");
+ sqlStr.Append($"WHERE posdt.BUSIDATE='{reportDate.ToString("yyyy-MM-dd")}'");
+
+ LogFactory.GetLogger("dtSwapLifeCyclePosDt").Info($"sqlStr:{sqlStr}");
+
+ var dtSwapLifeCyclePosDt = CreateSwapLifeCyclePosDtDataTable();
+ var dict = new Dictionary>();
+
+ db.ExecuteSql(sqlStr.ToString(), dr =>
{
- LogFactory.GetLogger("GetSwapLifeCycle ExecuteSql").Info("RowData:" + dr.ToStringContent());
- }
- catch (Exception ex)
- {
- LogFactory.GetLogger("GetSwapLifeCycle ExecuteSql").Error(ex);
- }
- CreateSwapLifeCyclePosDtNewRow(dtSwapLifeCyclePosDt, dr);
- });
- LogFactory.GetLogger("GetSwapLifeCycle").Info("dtSwapLifeCycle Data:" + dtSwapLifeCycle.ToStringContent());
- _viewDataSource.Tables.Add(dtSwapLifeCycle);
- LogFactory.GetLogger("GetSwapLifeCycle").Info("dtSwapLifeCyclePosDt Data:" + dtSwapLifeCyclePosDt.ToStringContent());
- _viewDataSource.Tables.Add(dtSwapLifeCyclePosDt);
+ try
+ {
+ LogFactory.GetLogger("dtSwapLifeCyclePosDt ExecuteSql").Info("RowData:" + dr.ToStringContent());
+ }
+ catch (Exception ex)
+ {
+ LogFactory.GetLogger("dtSwapLifeCyclePosDt ExecuteSql").Error(ex);
+ }
+ CreateSwapLifeCyclePosDtNewRow(dtSwapLifeCyclePosDt, dr, dict, setIndexDict);
+ });
+ dtSwapLifeCyclePosDt.ExtendedProperties["Index"] = dict;
+
+ _viewDataSource.Tables.Add(dtSwapLifeCycle);
+ _viewDataSource.Tables.Add(dtSwapLifeCyclePosDt);
+ LogFactory.GetLogger("dtSwapLifeCycle ExecuteSql dtSwapLifeCycle").Info($"dtSwapLifeCycle:{dtSwapLifeCycle.Rows.Count}");
+ LogFactory.GetLogger("dtSwapLifeCycle ExecuteSql dtSwapLifeCyclePosDt").Info($"dtSwapLifeCyclePosDt:{dtSwapLifeCyclePosDt.Rows.Count}");
+ LogFactory.GetLogger("dtSwapLifeCycle Index dtSwapLifeCyclePosDt").Info($"Index:{dict.Count}");
+ }
}
catch (Exception ex)
{
@@ -1031,17 +1210,22 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
}
}
+ ///
+ /// 增加存续期管理记录
+ ///
+ ///
+ ///
private void CreateSwapLifeCycleNewRow(DataTable dtSwapLifeCycle, OracleDataReader dr)
{
var confirmationNo = GetDataReaderValue(dr, "CONFIRMATIONNO");
- var rows = dtSwapLifeCycle.Select("CONFIRMATIONNO='" + confirmationNo + "'");
- if (rows != null && rows.Count() > 0) return;//存在了就不用再加了
+ var row = dtSwapLifeCycle.Rows.Find(confirmationNo);
+ if (row != null) return;//存在了就不用再加了
var newRow = dtSwapLifeCycle.NewRow();
SetOneColumnData(dr, newRow, "BIZID");
SetOneColumnData(dr, newRow, "GUID");
SetOneColumnData(dr, newRow, "DURATIONEVENTNO");
- SetOneColumnData(dr, newRow, "CONFIRMATIONNO");
+ SetOneColumnData(confirmationNo, newRow, "CONFIRMATIONNO");
SetOneColumnData(dr, newRow, "DURATIONOPERATIONTYPE");
SetOneColumnData(dr, newRow, "DURATIONOPERATIONDATE");
SetOneColumnData(dr, newRow, "RENEWALDATE");
@@ -1061,11 +1245,22 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
dtSwapLifeCycle.Rows.Add(newRow);
}
- private void CreateSwapLifeCyclePosDtNewRow(DataTable dtSwapLifeCyclePosDt, OracleDataReader dr)
+ ///
+ /// 增加持仓明细记录
+ ///
+ ///
+ ///
+ ///
+ ///
+ private void CreateSwapLifeCyclePosDtNewRow(
+ DataTable dtSwapLifeCyclePosDt,
+ OracleDataReader dr,
+ Dictionary> indexDict,
+ Action>, DataRow, string> action)
{
var newRow = dtSwapLifeCyclePosDt.NewRow();
SetOneColumnData(dr, newRow, "GUID", "GUID");
- SetOneColumnData(dr, newRow, "CONFIRMATIONNO");
+ var no = SetOneColumnData(dr, newRow, "CONFIRMATIONNO");
SetOneColumnData(dr, newRow, "BUSIDATE");
//SetOneColumnData(dr, newRow, "DURATIONOPERATIONTYPE");
SetOneColumnData(dr, newRow, "UNDRLYGASSETCODE");
@@ -1080,17 +1275,22 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
SetOneColumnData(dr, newRow, "BLANK1", "BLANK1");
SetOneColumnData(dr, newRow, "BLANK2", "BLANK2");
SetOneColumnData(dr, newRow, "DURATIONEVENTNO", "DURATIONEVENTNO");
+ action(indexDict, newRow, no);
dtSwapLifeCyclePosDt.Rows.Add(newRow);
}
+ ///
+ /// 创建存续期管理表格
+ ///
+ ///
private DataTable CreateSwapLifeCycleDataTable()
{
var dtSwapLifeCycle = new DataTable("互换交易存续期管理");
dtSwapLifeCycle.Columns.Add("BIZID");
dtSwapLifeCycle.Columns.Add("GUID");
dtSwapLifeCycle.Columns.Add("DURATIONEVENTNO");
- dtSwapLifeCycle.Columns.Add("CONFIRMATIONNO");
+ var primaryKey = dtSwapLifeCycle.Columns.Add("CONFIRMATIONNO");
dtSwapLifeCycle.Columns.Add("DURATIONOPERATIONTYPE");
dtSwapLifeCycle.Columns.Add("DURATIONOPERATIONDATE");
dtSwapLifeCycle.Columns.Add("RENEWALDATE");
@@ -1107,9 +1307,16 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
dtSwapLifeCycle.Columns.Add("SUBMIT_STATUS");
dtSwapLifeCycle.Columns.Add("OPERATIONTYPE");
dtSwapLifeCycle.Columns.Add("BUSIDATE");
+
+ dtSwapLifeCycle.PrimaryKey = new DataColumn[] { primaryKey };
+
return dtSwapLifeCycle;
}
+ ///
+ /// 创建存续期管理-合约持仓明细表格
+ ///
+ ///
private DataTable CreateSwapLifeCyclePosDtDataTable()
{
var dtSwapLifeCyclePosDt = new DataTable("合约持仓明细");
@@ -1146,11 +1353,9 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
{
try
{
- string schema = PS.Config.ErpElement.KingstarViewTableSchema.IsNullOrWhiteSpace() ? "" : $"\"{PS.Config.ErpElement.KingstarViewTableSchema}\".";
+ var schema = PS.Config.ErpElement.KingstarViewTableSchema.IsNullOrWhiteSpace() ? "" : $"\"{PS.Config.ErpElement.KingstarViewTableSchema}\".";
LogFactory.GetLogger("GetSwapequityPayment").Info("进入GetSwapequityPayment");
var dtSwapEquityPayment = CreateSwapEquityPaymentDataTable();
- var dtSwapEquityPaymentTP = CreateSwapEquityPaymentTPDataTable();
- LogFactory.GetLogger("GetSwapequityPayment").Info("创建完2个DataTable结构");
var sqlStr = new StringBuilder();
sqlStr.Append("SELECT quitypayment.* ");
sqlStr.Append($"FROM {schema}v_swap_equity_payment_A1016 quitypayment ");
@@ -1173,30 +1378,39 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
CreateSwapEquityPaymentNewRow(dtSwapEquityPayment, dr);
});
- sqlStr.Clear();
- sqlStr.Append("SELECT equityaymenttp.* ");
- sqlStr.Append($"FROM {schema}v_swap_equity_payment_tp_A1016 equityaymenttp ");
- sqlStr.Append($"WHERE equityaymenttp.BUSIDATE='{reportDate.ToString("yyyy-MM-dd")}'");//一对多分组
-
- LogFactory.GetLogger("GetSwapequityPayment").Info($"sqlStr:{sqlStr}");
-
- db.ExecuteSql(sqlStr.ToString(), dr =>
+ if (dtSwapEquityPayment.Rows.Count > 0)
{
- try
- {
- LogFactory.GetLogger("GetSwapequityPayment ExecuteSql").Info("RowData:" + dr.ToStringContent());
- }
- catch (Exception ex)
- {
- LogFactory.GetLogger("GetSwapequityPayment ExecuteSql").Error(ex);
- }
+ sqlStr.Clear();
+ sqlStr.Append("SELECT equityaymenttp.* ");
+ sqlStr.Append($"FROM {schema}v_swap_equity_payment_tp_A1016 equityaymenttp ");
+ sqlStr.Append($"WHERE equityaymenttp.BUSIDATE='{reportDate.ToString("yyyy-MM-dd")}'");//一对多分组
- CreateSwapEquityPaymentPtNewRow(dtSwapEquityPaymentTP, dr);
- });
- LogFactory.GetLogger("GetSwapequityPayment").Info("dtSwapEquityPayment Data:" + dtSwapEquityPayment.ToStringContent());
- _viewDataSource.Tables.Add(dtSwapEquityPayment);
- LogFactory.GetLogger("GetSwapequityPayment").Info("dtSwapEquityPaymentTP Data:" + dtSwapEquityPaymentTP.ToStringContent());
- _viewDataSource.Tables.Add(dtSwapEquityPaymentTP);
+ LogFactory.GetLogger("dtSwapEquityPaymentTP").Info($"sqlStr:{sqlStr}");
+
+ var dtSwapEquityPaymentTP = CreateSwapEquityPaymentTPDataTable();
+ var dict = new Dictionary>();
+
+ db.ExecuteSql(sqlStr.ToString(), dr =>
+ {
+ try
+ {
+ LogFactory.GetLogger("dtSwapEquityPaymentTP ExecuteSql").Info("RowData:" + dr.ToStringContent());
+ }
+ catch (Exception ex)
+ {
+ LogFactory.GetLogger("dtSwapEquityPaymentTP ExecuteSql").Error(ex);
+ }
+
+ CreateSwapEquityPaymentPtNewRow(dtSwapEquityPaymentTP, dr, dict, setIndexDict);
+ });
+ dtSwapEquityPaymentTP.ExtendedProperties["Index"] = dict;
+
+ _viewDataSource.Tables.Add(dtSwapEquityPayment);
+ _viewDataSource.Tables.Add(dtSwapEquityPaymentTP);
+ LogFactory.GetLogger("dtSwapEquityPayment ExecuteSql dtSwapEquityPayment").Info($"dtSwapLifeCycle:{dtSwapEquityPayment.Rows.Count}");
+ LogFactory.GetLogger("dtSwapEquityPayment ExecuteSql dtSwapEquityPaymentTP").Info($"dtSwapLifeCyclePosDt:{dtSwapEquityPaymentTP.Rows.Count}");
+ LogFactory.GetLogger("dtSwapEquityPayment Index dtSwapEquityPayment").Info($"Index:{dict.Count}");
+ }
}
catch (Exception ex)
{
@@ -1204,10 +1418,21 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
}
}
- private void CreateSwapEquityPaymentPtNewRow(DataTable dtSwapEquityPaymentPt, OracleDataReader dr)
+ ///
+ /// 增加权益端支付明细记录
+ ///
+ ///
+ ///
+ ///
+ ///
+ private void CreateSwapEquityPaymentPtNewRow(
+ DataTable dtSwapEquityPaymentPt,
+ OracleDataReader dr,
+ Dictionary> indexDict,
+ Action>, DataRow, string> action)
{
var newRow = dtSwapEquityPaymentPt.NewRow();
- SetOneColumnData(dr, newRow, "CONFIRMATIONNO");
+ var no = SetOneColumnData(dr, newRow, "CONFIRMATIONNO");
SetOneColumnData(dr, newRow, "BUSIDATE");
SetOneColumnData(dr, newRow, "PAYMENTMETHOD");
SetOneColumnData(dr, newRow, "PAYER");
@@ -1228,16 +1453,22 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
SetOneColumnData(dr, newRow, "BLANK1");
SetOneColumnData(dr, newRow, "BLANK2");
SetOneColumnData(dr, newRow, "DURATIONEVENTNO");
+ action(indexDict, newRow, no);
dtSwapEquityPaymentPt.Rows.Add(newRow);
}
+ ///
+ /// 增加权益端支付记录
+ ///
+ ///
+ ///
private void CreateSwapEquityPaymentNewRow(DataTable dtSwapEquityPayment, OracleDataReader dr)
{
var confirmationNo = GetDataReaderValue(dr, "CONFIRMATIONNO");
- var rows = dtSwapEquityPayment.Select("CONFIRMATIONNO='" + confirmationNo + "'");
- if (rows != null && rows.Count() > 0) return;//存在了就不用再加了
+ var row = dtSwapEquityPayment.Rows.Find(confirmationNo);
+ if (row != null) return;//存在了就不用再加了
var newRow = dtSwapEquityPayment.NewRow();
@@ -1253,6 +1484,10 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
dtSwapEquityPayment.Rows.Add(newRow);
}
+ ///
+ /// 创建权益端支付明细表格
+ ///
+ ///
private DataTable CreateSwapEquityPaymentTPDataTable()
{
var dtSwapEquityPaymentPt = new DataTable("权益端支付");
@@ -1280,18 +1515,24 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
return dtSwapEquityPaymentPt;
}
+ ///
+ /// 创建权益端支付表格
+ ///
+ ///
private DataTable CreateSwapEquityPaymentDataTable()
{
var dtSwapEquityPayment = new DataTable("互换交易权益端支付");
dtSwapEquityPayment.Columns.Add("BIZID");
dtSwapEquityPayment.Columns.Add("BUSIDATE");
- dtSwapEquityPayment.Columns.Add("CONFIRMATIONNO");
+ var primaryKey = dtSwapEquityPayment.Columns.Add("CONFIRMATIONNO");
dtSwapEquityPayment.Columns.Add("DURATIONEVENTNO");
dtSwapEquityPayment.Columns.Add("SUBMIT_STATUS");
dtSwapEquityPayment.Columns.Add("OPERATIONTYPE");
dtSwapEquityPayment.Columns.Add("BLANK1");
dtSwapEquityPayment.Columns.Add("BLANK2");
+ dtSwapEquityPayment.PrimaryKey = new DataColumn[] { primaryKey };
+
return dtSwapEquityPayment;
}
@@ -1307,7 +1548,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
{
try
{
- string schema = PS.Config.ErpElement.KingstarViewTableSchema.IsNullOrWhiteSpace() ? "" : $"\"{PS.Config.ErpElement.KingstarViewTableSchema}\".";
+ var schema = PS.Config.ErpElement.KingstarViewTableSchema.IsNullOrWhiteSpace() ? "" : $"\"{PS.Config.ErpElement.KingstarViewTableSchema}\".";
LogFactory.GetLogger("GetSwapConfirmationAtt").Info("进入GetSwapConfirmationAtt");
var dtSwapConfirmationAtt = CreateSwapConfirmationAttDataTable();
LogFactory.GetLogger("GetSwapConfirmationAtt").Info("创建完1个DataTable结构");
@@ -1329,7 +1570,6 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
}
CreatConfirmationAttNewRow(dtSwapConfirmationAtt, dr);
});
- LogFactory.GetLogger("GetSwapConfirmationAtt").Info("dtSwapConfirmationAtt Data:" + dtSwapConfirmationAtt.ToStringContent());
_viewDataSource.Tables.Add(dtSwapConfirmationAtt);
}
catch (Exception ex)
@@ -1372,9 +1612,12 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
var subSystemOutboxPath = PS.Config.ErpElement.SAC_SubSystemOutboxPath;
LogFactory.GetLogger("loadSubsystemDataSource").Info($"subSystemOutboxPath:" + subSystemOutboxPath);
- if (string.IsNullOrEmpty(subSystemOutboxPath) || !Directory.Exists(subSystemOutboxPath)) return list;
+ if (string.IsNullOrEmpty(subSystemOutboxPath) || !Directory.Exists(subSystemOutboxPath))
+ {
+ return list;
+ }
- LogFactory.GetLogger("loadSubsystemDataSource").Info($"开始执行1");
+ LogFactory.GetLogger("loadSubsystemDataSource").Info($"目录存在:{subSystemOutboxPath}");
var dateDir = _reqInfo.ReportDate.ToString("yyyyMMdd");
@@ -1382,13 +1625,21 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
var folder = new DirectoryInfo(subSystemOutboxPath);
var files = folder.GetFiles("*.zip");
LogFactory.GetLogger("loadSubsystemDataSource").Info($"zip文件个数:" + files.Count());
- if (files == null || files.Count() == 0) return list;
+ if (files == null || files.Count() == 0)
+ {
+ return list;
+ }
+
foreach (var file in files)
{
- LogFactory.GetLogger("loadSubsystemDataSource").Info($"2:");
+ LogFactory.GetLogger("loadSubsystemDataSource").Info($"准备读取{file.Name}");
//zip压缩文件名包含报送日期才需要读取解析
- if (!file.Name.Contains("_" + dateDir + "_")) continue;
- LogFactory.GetLogger("loadSubsystemDataSource").Info($"3:");
+ if (!file.Name.Contains("_" + dateDir + "_"))
+ {
+ continue;
+ }
+
+ LogFactory.GetLogger("loadSubsystemDataSource").Info($"文件名中包含{dateDir}");
//获取文件不包含扩展名的文件名
var tag = Path.GetFileNameWithoutExtension(file.FullName);
//待解压的包含路径的完整文件名
@@ -1407,7 +1658,6 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
LogFactory.GetLogger("loadSubsystemDataSource").Info($"解压成功:targetName:" + targetName + ",tDir:" + tDir);
}
- LogFactory.GetLogger("loadSubsystemDataSource").Info($"4");
//存在说明已经解压过了
//解压后文件的附件根目录
var fileAttachmentDir = Path.Combine(subSystemOutboxPath, tag, "ATTACHMENT");
@@ -1422,11 +1672,14 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
LogFactory.GetLogger("loadSubsystemDataSource").Info($"reportFilesCount:" + reportFiles.Count());
foreach (var reportFile in reportFiles)
{
- LogFactory.GetLogger("loadSubsystemDataSource").Info($"6:");
+ LogFactory.GetLogger("loadSubsystemDataSource").Info($"准备解析:{reportFile.FullName}");
//读取xml文件,并反序列化成对象
var xml = File.ReadAllText(reportFile.FullName);
var model = XmlHelper.Deserialize(xml);
- if (model.Body == null) continue;
+ if (model.Body == null)
+ {
+ continue;
+ }
//记录xml报告文件,等读取完后,需要删掉
xmlAttachmentList.Add(reportFile.FullName);
@@ -1443,7 +1696,10 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
var flist = new List();
//调用委托构造notes数据
var ret = callback(x as T, flist, tag);
- if (!ret) continue;
+ if (!ret)
+ {
+ continue;
+ }
//把返回的附件文件名加上完整路径添加到附件集合待后边删除
flist.ForEach(attchment =>
{
@@ -1468,7 +1724,10 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
var flist = new List();
//调用委托构造notes数据
var ret = callback(x as T, flist, tag);
- if (!ret) continue;
+ if (!ret)
+ {
+ continue;
+ }
//把返回的附件文件名加上完整路径添加到附件集合待后边删除
flist.ForEach(attchment =>
{
@@ -1493,7 +1752,10 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
var flist = new List();
//调用委托构造notes数据
var ret = callback(x as T, flist, tag);
- if (!ret) continue;
+ if (!ret)
+ {
+ continue;
+ }
//把返回的附件文件名加上完整路径添加到附件集合待后边删除
flist.ForEach(attchment =>
{
@@ -1519,7 +1781,10 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
var flist = new List();
//调用委托构造notes数据
var ret = callback(x as T, flist, tag);
- if (!ret) continue;
+ if (!ret)
+ {
+ continue;
+ }
//把返回的附件文件名加上完整路径添加到附件集合待后边删除
flist.ForEach(attchment =>
{
@@ -1544,7 +1809,10 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
var flist = new List();
//调用委托构造notes数据
var ret = callback(x as T, flist, tag);
- if (!ret) continue;
+ if (!ret)
+ {
+ continue;
+ }
//把返回的附件文件名加上完整路径添加到附件集合待后边删除
flist.ForEach(attchment =>
{
@@ -1569,7 +1837,10 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
var flist = new List();
//调用委托构造notes数据
var ret = callback(x as T, flist, tag);
- if (!ret) continue;
+ if (!ret)
+ {
+ continue;
+ }
//把返回的附件文件名加上完整路径添加到附件集合待后边删除
flist.ForEach(attchment =>
{
@@ -1595,7 +1866,10 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
var flist = new List();
//调用委托构造notes数据
var ret = callback(x as T, flist, tag);
- if (!ret) continue;
+ if (!ret)
+ {
+ continue;
+ }
//把返回的附件文件名加上完整路径添加到附件集合待后边删除
flist.ForEach(attchment =>
{
@@ -1621,7 +1895,10 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
var flist = new List();
//调用委托构造notes数据
var ret = callback(x as T, flist, tag);
- if (!ret) continue;
+ if (!ret)
+ {
+ continue;
+ }
//把返回的附件文件名加上完整路径添加到附件集合待后边删除
flist.ForEach(attchment =>
{
@@ -1647,7 +1924,10 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
var flist = new List();
//调用委托构造notes数据
var ret = callback(x as T, flist, tag);
- if (!ret) continue;
+ if (!ret)
+ {
+ continue;
+ }
//把返回的附件文件名加上完整路径添加到附件集合待后边删除
flist.ForEach(attchment =>
{
@@ -1665,6 +1945,10 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
case DataFlagsEnum.A1017:
foreach (var x in model.Body.ConfirmationAtt)
{
+ if (string.IsNullOrWhiteSpace(x.ConfirmationFilesTuple.FirstOrDefault()?.ConfirmationFiles))
+ {
+ continue;
+ }
x.OperationType = (OptFlagsEnum)Enum.Parse(typeof(OptFlagsEnum), model.Header.OperationType, true);
//子系统的数据忽略字段检查
x.IgnoreCheck = true;
@@ -1687,6 +1971,63 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
list.Add(x as T);
};
break;
+ case DataFlagsEnum.A1018:
+ foreach (var x in model.Body.ValuationInformation)
+ {
+ x.OperationType = (OptFlagsEnum)Enum.Parse(typeof(OptFlagsEnum), model.Header.OperationType, true);
+ //子系统的数据忽略字段检查
+ x.IgnoreCheck = true;
+ //通过调用委托返回业务的附件文件名数据
+ var flist = new List();
+ //调用委托构造notes数据
+ var ret = callback(x as T, flist, tag);
+ if (!ret) continue;
+ //把返回的附件文件名加上完整路径添加到附件集合待后边删除
+ flist.ForEach(attchment =>
+ {
+ var path = Path.Combine(fileAttachmentDir, attchment);
+ //把附件添加到报告附件列表,为了生成报告
+ fileList.Add(path);
+ //把附件添加到附件列表中,以便后边删除
+ xmlAttachmentList.Add(path);
+ });
+
+ //添加数据到数据集合当中
+ list.Add(x as T);
+ };
+ break;
+ case DataFlagsEnum.A1019:
+ foreach (var x in model.Body.ConfirmationAtt)
+ {
+ if (string.IsNullOrWhiteSpace(x.ConfirmationFilesTuple.FirstOrDefault()?.ConfirmationAtt))
+ {
+ continue;
+ }
+ x.OperationType = (OptFlagsEnum)Enum.Parse(typeof(OptFlagsEnum), model.Header.OperationType, true);
+ //子系统的数据忽略字段检查
+ x.IgnoreCheck = true;
+ //通过调用委托返回业务的附件文件名数据
+ var flist = new List();
+ //调用委托构造notes数据
+ var ret = callback(x as T, flist, tag);
+ if (!ret)
+ {
+ continue;
+ }
+ //把返回的附件文件名加上完整路径添加到附件集合待后边删除
+ flist.ForEach(attchment =>
+ {
+ var path = Path.Combine(fileAttachmentDir, attchment);
+ //把附件添加到报告附件列表,为了生成报告
+ fileList.Add(path);
+ //把附件添加到附件列表中,以便后边删除
+ xmlAttachmentList.Add(path);
+ });
+
+ //添加数据到数据集合当中
+ list.Add(x as T);
+ };
+ break;
default:
break;
}
@@ -1700,14 +2041,23 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
///
///
///
- protected string formatExceID()
+ protected string formatExceID(IEnumerable dataSource = null)
{
var exceId = "";
+ IQueryable query;
+ if (dataSource != null)
+ {
+ query = dataSource.AsQueryable();
+ }
+ else
+ {
+ query = DbContext.sac_report_notes;
+ }
do
{
exceId = $"{_reqInfo.SenderCode}{_reqInfo.ReceiverCode}{_reqInfo.ReportDate.ToString("yyyyMMdd")}{MaxExceIndex.ToString("00000000")}";
MaxExceIndex = MaxExceIndex + 1;
- } while (DbContext.sac_report_notes.Any(O => O.ExceId == exceId));
+ } while (query.Any(O => O.ExceId == exceId));
return exceId;
}
@@ -1778,5 +2128,67 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
var path = $"{configPath}/data/{viewAttFileName}";
return path;
}
+
+ ///
+ /// 从DataTable中获取索引字典
+ ///
+ ///
+ ///
+ protected Dictionary> readIndexDict(string tableName)
+ {
+ Dictionary> result = null;
+ if (_viewDataSource != null && _viewDataSource.Tables.Contains(tableName))
+ {
+ DataTable dt = _viewDataSource.Tables[tableName];
+ if (dt.ExtendedProperties["Index"] is Dictionary> dict)
+ {
+ result = dict;
+ LogFactory.GetLogger("Index").Info($"取出索引:{dict.Count}");
+ }
+ }
+
+ return result;
+ }
+
+ protected string formatUnderlyingCode(string underlyingCode, List dictItemMap, string name, string defaultValue = "")
+ {
+ if (underlyingCode == null || underlyingCode.Contains("."))
+ {
+ return underlyingCode;
+ }
+ if (name == null || dictItemMap == null) { return defaultValue; }
+ var obj = dictItemMap.FirstOrDefault(O => O.Name == name);
+ var suffix = (obj == null ? defaultValue : obj.ShortName);
+ if (suffix.IsNullOrWhiteSpace())
+ {
+ return underlyingCode;
+ }
+ return $"{underlyingCode}.{suffix}";
+ }
+
+ ///
+ /// 获取普通互换客户方向多空 山证金衍 逻辑
+ ///
+ ///
+ ///
+ ///
+ ///
+ public string GetClientSideLongShort(bool isPayFloat, string getLongShort, string payLongShort)
+ {
+ string getPayStr = isPayFloat ? ("支付" + payLongShort) : ("收取" + getLongShort);
+ switch (getPayStr)
+ {
+ case "收取多头":
+ return "空头";
+ case "收取空头":
+ return "多头";
+ case "支付多头":
+ return "多头";
+ case "支付空头":
+ return "空头";
+ default:
+ return "";
+ }
+ }
}
}
diff --git a/YLErpDAL/Modules/SuperviseReportModule/SAC/Service/ReportEventReportService.cs b/YLErpDAL/Modules/SuperviseReportModule/SAC/Service/ReportEventReportService.cs
index d48f7010..d5982fd2 100644
--- a/YLErpDAL/Modules/SuperviseReportModule/SAC/Service/ReportEventReportService.cs
+++ b/YLErpDAL/Modules/SuperviseReportModule/SAC/Service/ReportEventReportService.cs
@@ -15,25 +15,23 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
protected override DataFlagsEnum BusiDataType => DataFlagsEnum.A1009;
- private List _validOperationType = null;
+ private List? _validOperationType = null;
public override List ValidOperationType
{
get
{
- if (_validOperationType == null)
- {
- _validOperationType = new List() {
+ _validOperationType ??= new List() {
OptFlagsEnum.A,
OptFlagsEnum.U,
OptFlagsEnum.D,
};
- }
return _validOperationType;
}
}
protected override SuperviseReportTypeEnum ReportType => SuperviseReportTypeEnum.SAC_EventReport;
- List noteList = new List();
+
+ readonly List noteList = new();
public override bool CheckRequestParamer(ReportInfo req, out string errMsg)
{
@@ -63,7 +61,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
errMsg = "重大事件报告非新增报送时,对应的业务编码不应为空";
return false;
}
- SACReportNotes note = base.GetReportNotes(ReportType, formatInfoTag(req.EventReportDate?.ToString("yyyy-MM-dd"))).Where(O => O.ReportDate == req.EventReportDate).FirstOrDefault();
+ var note = base.GetReportNotes(ReportType, formatInfoTag(req.EventReportDate?.ToString("yyyy-MM-dd"))).Where(O => O.ReportDate == req.EventReportDate).FirstOrDefault();
if (note == null)
{
errMsg = $"{req.EventReportDate?.ToString("yyyy-MM-dd")}不存在报送成功的重大事项报告记录,请重新选择";
@@ -72,7 +70,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
if (req.EventReportStatus == OptFlagsEnum.U)
{
var fileIds = tempFilesService.QueryTempFile(req.ReportDate, "重大事项报告").Select(O => O.id.ToString()).ToArray();
- string[] fileIdArr = note.DataId.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
+ var fileIdArr = note.DataId.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
if (!fileIds.Except(fileIdArr).Any())
{
errMsg = $"{req.ReportDate.ToString("yyyy-MM-dd")}已上传重大事项报告附件都已报送成功,不需要再次报送";
@@ -103,9 +101,11 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
fileList = new List();
noData = false;
var noteKey = formatInfoTag(_reqInfo.ReportDate.ToString("yyyy-MM-dd"));
- BodyModel model = new BodyModel();
- model.EventReport = new EventReportModel();
- SACReportNotes note = base.GetReportNotes(ReportType, noteKey).FirstOrDefault();
+ var model = new BodyModel
+ {
+ EventReport = new EventReportModel()
+ };
+ var note = base.GetReportNotes(ReportType, noteKey).FirstOrDefault();
if (note == null && _operationType == OptFlagsEnum.A)
{
note = new SACReportNotes()
@@ -161,8 +161,10 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
{
ReportStatus.AddCacheInfo(noteKey, item.fileName);
}
- var info = new EventReportDetailModel();
- info.EventReport = item.fileName;
+ var info = new EventReportDetailModel
+ {
+ EventReport = item.fileName
+ };
if (model.EventReport.EventReportTuple == null)
{
model.EventReport.EventReportTuple = new List();
@@ -173,7 +175,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
}
model.EventReport.DetailedDescription = _reqInfo.EventReportDesc;
}
- noData = (!(model.EventReport.EventReportTuple?.Count > 0));
+ noData = !(model.EventReport.EventReportTuple?.Count > 0);
if (!noData)
{
note.id = 0;
@@ -197,19 +199,19 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
protected override List CheckBodyValue(BodyModel model, out bool checkStatus)
{
- List result = new List();
+ var result = new List();
if (model.EventReport != null)
{
- List listRoot = new List();
- CheckHelper helper = new CheckHelper();
- CheckHelper attHelper = new CheckHelper();
+ var listRoot = new List();
+ var helper = new CheckHelper();
+ var attHelper = new CheckHelper();
helper.ExecuteCheck(model.EventReport, (name, value, msg) =>
{
listRoot.Add(new SacInfo(name, value, msg));
});
if (model.EventReport.EventReportTuple != null)
{
- for (int i = 0; i < model.EventReport.EventReportTuple.Count; i++)
+ for (var i = 0; i < model.EventReport.EventReportTuple.Count; i++)
{
var listItem = new List();
var item = model.EventReport.EventReportTuple[i];
@@ -219,16 +221,20 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
});
if (listItem.Count > 0)
{
- var temp = new SacInfo("EventReportTuple", i);
- temp.SubMaps = new List(listItem);
+ var temp = new SacInfo("EventReportTuple", i)
+ {
+ SubMaps = new List(listItem)
+ };
listRoot.Add(temp);
}
}
}
if (listRoot.Count > 0)
{
- var errMsg = new SacInfo("EventReport");
- errMsg.SubMaps = new List(listRoot);
+ var errMsg = new SacInfo("EventReport")
+ {
+ SubMaps = new List(listRoot)
+ };
result.Add(errMsg);
}
}
@@ -238,7 +244,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
private string formatInfoTag(string tag, bool suffixType = false)
{
- string result = $"{BusiDataType}_{tag}_";
+ var result = $"{BusiDataType}_{tag}_";
if (suffixType)
{
result = $"{result}{_operationType}";
@@ -246,10 +252,16 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
return result;
}
+ protected override string _changeCodeOfInfoTag(string infoTag, string newCode, out string originalCode)
+ {
+ //定期报告中不存在编号,也就不存在修改编号的情况;
+ throw new NotImplementedException();
+ }
+
public override bool BeforeOfGenerated(out string errMsg)
{
errMsg = "";
- for (int i = 0; i < noteList.Count; i++)
+ for (var i = 0; i < noteList.Count; i++)
{
base.SaveReportNotes(noteList[i]);
}
diff --git a/YLErpDAL/Modules/SuperviseReportModule/SAC/Service/ReportMasterAgrmtProductService.cs b/YLErpDAL/Modules/SuperviseReportModule/SAC/Service/ReportMasterAgrmtProductService.cs
index 76192987..70dd9bac 100644
--- a/YLErpDAL/Modules/SuperviseReportModule/SAC/Service/ReportMasterAgrmtProductService.cs
+++ b/YLErpDAL/Modules/SuperviseReportModule/SAC/Service/ReportMasterAgrmtProductService.cs
@@ -23,168 +23,38 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
protected override DataFlagsEnum BusiDataType => DataFlagsEnum.A1002;
- private List _validOperationType = null;
+ private List? _validOperationType = null;
public override List ValidOperationType
{
get
{
- if (_validOperationType == null)
- {
- _validOperationType = new List() {
+ _validOperationType ??= new List() {
OptFlagsEnum.A,
OptFlagsEnum.U,
OptFlagsEnum.D,
};
- }
return _validOperationType;
}
}
protected override SuperviseReportTypeEnum ReportType => SuperviseReportTypeEnum.SAC_MasterAgrmtProduct;
- List noteList = new List();
+
+ readonly List noteList = new();
protected override BodyModel GenerateBody(out bool noData, out List fileList)
{
fileList = new List();
- BodyModel model = new BodyModel();
- List dataList = new List();
- if ((PS.Config.ErpElement.SAC_ReportDataSource & SAC_ReportDataSourceEnum.Template) == SAC_ReportDataSourceEnum.Template)
+ var model = new BodyModel();
+ var dataList = new List();
+ if (_reqInfo.DataSource.HasFlag(SAC_ReportDataSourceEnum.Template))
{
- dataList = GetMasterAgrmtProductModel(ref fileList);
- }
- if ((PS.Config.ErpElement.SAC_ReportDataSource & SAC_ReportDataSourceEnum.System) == SAC_ReportDataSourceEnum.System)
- {
- using (var baseDb = DbContextFactory.GetClientDbContext(null))
- {
- var nextDate = _reqInfo.ReportDate.AddDays(1);
- var fileObjList = (from c in baseDb.client
- join cf in baseDb.client_file
- on c.id equals cf.ClientId
- where c.ProcessStatus == "已开户" && cf.HasSent == false && cf.IsValid &&
- cf.FileTypeName == ConsGlobal.ClientFileType.AllographProduct && cf.OptState == _operationType &&
- ((c.ProcessOptDate >= _reqInfo.ReportDate && c.ProcessOptDate < nextDate && cf.OptDate < nextDate) ||//如果这一天开户,则把这一天之前(含这一天)的所有文件都报送了
- (cf.OptDate >= _reqInfo.ReportDate && cf.OptDate < nextDate && c.ProcessOptDate < _reqInfo.ReportDate))//如果这一天不是开户日期,则只在报送日期大于开户日期时,报送当日修改的文件
- && cf.ApprovalOrder < 1
- select new
- {
- cf.id,
- cf.ClientId,
- cf.OptState,
- cf.ProtocolNumber,
- cf.MainProtocolNumber,
- cf.SignDate,
- cf.FilePath,
- cf.FileName,
- c.Name,
- c.ClientType,
- c.Number,
- c.ParentId,
- }).ToArray();
- var clientIds = fileObjList.Select(O => O.ClientId);
- var ct = baseDb.contactype.Where(O => O.ContactType == "产品投资经理").FirstOrDefault();
- ExpandoDictionary clientdutyDict = null;
- if (ct != null)
- {
- clientdutyDict = new ExpandoDictionary(
- (from cd in baseDb.clientduty.Where(t => t.ApprovalOrder < 1)
- where clientIds.Contains(cd.ClientId ?? 0) && (cd.DeadLine == null || cd.DeadLine >= _reqInfo.ReportDate)
- select cd)
- .ToList()
- .Where(O => O.ContactTypeIdsInt.Contains(ct.id)).GroupBy(O => O.ClientId ?? 0)
- .ToDictionary(K => K.Key, V => V.FirstOrDefault()));
- }
- var cacheKey = $"{BusiDataType}";
- var service = new ClientQueryService(UserInfo);
- foreach (var item in fileObjList)
- {
- if (item.ClientType != "产品") { continue; }
- var info = new MasterAgrmtProductModel();
- info.ClientType = item.ClientType;
- info.MasterAgrmtNo = item.MainProtocolNumber;
- info.OperationType = item.OptState;
- info.ProductName = service.GetProductName(item.ClientId);
- if (string.IsNullOrWhiteSpace(info.ProductName))
- {
- info.ProductName = item.Name;
- }
- info.CounterpartyCodeProducts = item.Number;
- info.ManagerName = clientdutyDict == null ? null : clientdutyDict[item.ClientId]?.ContactName;
- info.InvestmentManagerContactNumber = clientdutyDict == null ? null : clientdutyDict[item.ClientId]?.PhoneNumber;
- info.TrusteeAgency = service.GetTrusteeAgency(item.ClientId);// ?? DataCacheProvider.GetClientDataSource().GetData(item.ParentId)?.Name;
- info.TheDateTable = item.SignDate?.ToString("yyyy-MM-dd");
- info.SuchProducts = item.FileName;
- var cacheValue = info.MasterAgrmtNo + "_" + info.ProductName;
- if (ReportStatus.CheckCacheInfo(cacheKey, cacheValue))
- {
- continue;
- }
-
- SACReportNotes note = base.GetReportNotes(ReportType, formatInfoTag(info)).FirstOrDefault();
- if (note == null && _operationType == OptFlagsEnum.A)
- {
- note = new SACReportNotes()
- {
- InfoCache = $"{{\"Tag\":\"{info.ProductName}\",\"Source\":\"System\"}}",
- IsValid = true,
- };
- }
- else
- {
- if (note == null)
- {
- continue;
- }
- switch (_operationType)
- {
- case OptFlagsEnum.A:
- continue;//新增数据已报送,跳过
- case OptFlagsEnum.U:
- note.IsValid = true;
- break;
- case OptFlagsEnum.D:
- note.IsValid = false;
- break;
- case OptFlagsEnum.NONE:
- default:
- throw new ServiceException("未知操作类型");
- }
- }
- if (info.OperationType != OptFlagsEnum.A)
- {
- info.ProductNo = note.BizId;
- }
- note.id = 0;
- info.ExceID = base.formatExceID();
- note.DataId = item.id.ToString();
- note.CreateTime = DateTime.Now;
- note.FileTag = FileTag;
- note.ReportType = ReportType;
- note.ReportDate = _reqInfo.ReportDate;
- note.InfoTag = formatInfoTag(info, true);
- note.OptTime = note.CreateTime;
- note.RetCode = "";
- note.RetMsg = "";
- note.ReportResponse = false;
- note.BizId = "";
- note.changeStatus = false;
- if (!ReportStatus.CheckFileLength(item.FilePath))
- {
- break;
- }
- else
- {
- ReportStatus.AddCacheInfo(cacheKey, cacheValue);
- }
- dataList.Add(info);
- fileList.Add(item.FilePath);
- note.ExceId = info.ExceID;
- noteList.Add(note);
- }
- }
+ dataList.AddRange(GetMasterAgrmtProductModelFromExcel(ref fileList));
}
var subsystemDataList = loadSubsystemDataSource(fileList, AddSubsystemNote);
if (subsystemDataList != null && subsystemDataList.Count > 0)
+ {
dataList.AddRange(subsystemDataList);
+ }
noData = dataList.Count == 0;
model.MasterAgrmtProduct = dataList;
@@ -193,7 +63,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
public bool AddSubsystemNote(MasterAgrmtProductModel model, List fileList, string tag)
{
- SACReportNotes note = base.GetReportNotes(ReportType, formatInfoTag(model, true)).FirstOrDefault();//参数true要加,要不A和D会查到同一条记录,在D时候,就会和A相同的数据
+ var note = base.GetReportNotes(ReportType, formatInfoTag(model, true)).FirstOrDefault();//参数true要加,要不A和D会查到同一条记录,在D时候,就会和A相同的数据
if (note == null)
{
note = new SACReportNotes()
@@ -244,16 +114,14 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
return true;
}
-
- private List GetMasterAgrmtProductModel(ref List fileList)
+ private List GetMasterAgrmtProductModelFromExcel(ref List fileList)
{
- List result = new List();
+ var result = new List();
if (_excelDataSource != null && _excelDataSource.Tables.Contains("主协议关联产品列表"))
{
- var cacheKey = $"{BusiDataType}";
- string sourcePath = Path.Combine(_excelDataSourceRootPath, "附件");
- DataTable dt = _excelDataSource.Tables["主协议关联产品列表"];
- for (int i = 1; i < dt.Rows.Count; i++)
+ var sourcePath = Path.Combine(_excelDataSourceRootPath, "附件");
+ var dt = _excelDataSource.Tables["主协议关联产品列表"];
+ for (var i = 1; i < dt.Rows.Count; i++)
{
if (string.IsNullOrWhiteSpace(dt.Rows[i][0]?.ToString()))
{
@@ -263,12 +131,18 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
var optType = OptFlagsEnum.NONE;
switch (dt.Rows[i][1]?.ToString())
{
+ case "0":
+ case "A":
case "首次":
optType = OptFlagsEnum.A;
break;
+ case "1":
+ case "U":
case "变更":
optType = OptFlagsEnum.U;
break;
+ case "2":
+ case "D":
case "废止":
optType = OptFlagsEnum.D;
break;
@@ -278,25 +152,26 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
continue;
}
- MasterAgrmtProductModel model = new MasterAgrmtProductModel();
-
- model.ClientType = "产品";
- model.MasterAgrmtNo = GetDataSetValue(dt, i, 0);
- model.OperationType = optType == OptFlagsEnum.A ? OptFlagsEnum.A : OptFlagsEnum.U;
- model.ProductName = GetDataSetValue(dt, i, 2);
- model.CounterpartyCodeProducts = GetDataSetValue(dt, i, 3);
- model.ManagerName = GetDataSetValue(dt, i, 4);
- model.InvestmentManagerContactNumber = GetDataSetValue(dt, i, 5);
- model.TrusteeAgency = GetDataSetValue(dt, i, 6);
- model.TheDateTable = GetDataSetValue(dt, i, 7);
- model.SuchProducts = GetDataSetValue(dt, i, 8);
+ var model = new MasterAgrmtProductModel
+ {
+ ClientType = "产品",
+ MasterAgrmtNo = GetDataSetValue(dt, i, 0),
+ OperationType = optType == OptFlagsEnum.A ? OptFlagsEnum.A : OptFlagsEnum.U,
+ ProductName = GetDataSetValue(dt, i, 2),
+ CounterpartyCodeProducts = GetDataSetValue(dt, i, 3),
+ ManagerName = GetDataSetValue(dt, i, 4),
+ InvestmentManagerContactNumber = GetDataSetValue(dt, i, 5),
+ TrusteeAgency = GetDataSetValue(dt, i, 6),
+ TheDateTable = GetDataSetValue(dt, i, 7),
+ SuchProducts = GetDataSetValue(dt, i, 8)
+ };
var cacheValue = model.MasterAgrmtNo + "_" + model.ProductName;
- if (ReportStatus.CheckCacheInfo(cacheKey, cacheValue))
+ if (ReportStatus.CheckCacheInfo(CacheKey, cacheValue))
{
continue;
}
- SACReportNotes note = base.GetReportNotes(ReportType, formatInfoTag(model)).FirstOrDefault();
+ var note = base.GetReportNotes(ReportType, formatInfoTag(model)).FirstOrDefault();
if (note == null && _operationType == OptFlagsEnum.A)
{
note = new SACReportNotes()
@@ -332,14 +207,14 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
}
if (!string.IsNullOrWhiteSpace(model.SuchProducts))
{
- string path = Path.Combine(sourcePath, model.SuchProducts);
+ var path = Path.Combine(sourcePath, model.SuchProducts);
if (!ReportStatus.CheckFileLength(path))
{
break;
}
else
{
- ReportStatus.AddCacheInfo(cacheKey, cacheValue);
+ ReportStatus.AddCacheInfo(CacheKey, cacheValue);
}
note.id = 0;
model.ExceID = base.formatExceID();
@@ -366,23 +241,30 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
protected override List CheckBodyValue(BodyModel model, out bool checkStatus)
{
- List result = new List();
+ var result = new List();
if (model?.MasterAgrmtProduct != null)
{
- List listRoot = new List();
- CheckHelper helper = new Common.CheckHelper();
- for (int i = 0; i < model.MasterAgrmtProduct.Count; i++)
+ var helper = new Common.CheckHelper();
+ for (var i = 0; i < model.MasterAgrmtProduct.Count; i++)
{
+ var listRoot = new List();
var item = model.MasterAgrmtProduct[i];
- if (item.IgnoreCheck) continue;
+ if (item.IgnoreCheck)
+ {
+ continue;
+ }
+
helper.ExecuteCheck(item, (name, value, msg) =>
{
listRoot.Add(new SacInfo(name, value, msg));
});
if (listRoot.Count > 0)
{
- var errMsg = new SacInfo("MasterAgrmtProduct", i);
- errMsg.SubMaps = new List(listRoot);
+ var errMsg = new SacInfo("MasterAgrmtProduct", i)
+ {
+ FieldValue = item.ProductName,
+ SubMaps = new List(listRoot)
+ };
result.Add(errMsg);
}
}
@@ -408,7 +290,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
};
}
- for (int i = 0; i < noteList.Count; i++)
+ for (var i = 0; i < noteList.Count; i++)
{
base.SaveReportNotes(noteList[i]);
}
@@ -423,12 +305,24 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
}
private string formatInfoTag(MasterAgrmtProductModel model, bool suffixType = false)
{
- string result = $"{BusiDataType}_{model.MasterAgrmtNo.Replace("_", "-")}_{model.ProductName.Replace("_", "-")}_";
+ var result = $"{BusiDataType}_{model.MasterAgrmtNo.Replace("_", "-")}_{model.ProductName.Replace("_", "-")}_";
if (suffixType)
{
result = $"{result}{_operationType}";
}
return result;
}
+
+ protected override string _changeCodeOfInfoTag(string infoTag, string newCode, out string originalCode)
+ {
+ var arr = infoTag.Split('_');
+ if (arr.Length != 4)
+ {
+ throw new ServiceException($"InfoTag信息不匹配:{infoTag}");
+ }
+ originalCode = arr[2];
+ arr[2] = newCode.Replace("_", "-");
+ return string.Join("_", arr);
+ }
}
}
diff --git a/YLErpDAL/Modules/SuperviseReportModule/SAC/Service/ReportMasterAgrmtService.cs b/YLErpDAL/Modules/SuperviseReportModule/SAC/Service/ReportMasterAgrmtService.cs
index 6d0e7c18..91d4b54c 100644
--- a/YLErpDAL/Modules/SuperviseReportModule/SAC/Service/ReportMasterAgrmtService.cs
+++ b/YLErpDAL/Modules/SuperviseReportModule/SAC/Service/ReportMasterAgrmtService.cs
@@ -1,7 +1,9 @@
-using System.Data;
+using BaseOUDAL;
+using System.Data;
using YLErp.Commons;
using YLErp.DBModels.Consts;
using YLErp.DBModels.Enums;
+using YLErp.Helpers;
using YLErp.Modules.SuperviseReportModule.SAC.Common;
using YLErp.Modules.SuperviseReportModule.SAC.Model;
using static YLErp.DBModels.Consts.ConsReport;
@@ -23,60 +25,39 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
protected override DataFlagsEnum BusiDataType => DataFlagsEnum.A1001;
- private List _validOperationType = null;
+ private List? _validOperationType = null;
public override List ValidOperationType
{
get
{
- if (_validOperationType == null)
- {
- _validOperationType = new List() {
+ _validOperationType ??= new List() {
OptFlagsEnum.A,
OptFlagsEnum.U,
OptFlagsEnum.D,
};
- }
return _validOperationType;
}
}
protected override SuperviseReportTypeEnum ReportType => SuperviseReportTypeEnum.SAC_MasterAgrmt;
- List noteList = new List();
+
+ readonly List noteList = new();
protected override BodyModel GenerateBody(out bool noData, out List fileList)
{
fileList = new List();
- BodyModel model = new BodyModel();
- List dataList = new List();
- if ((PS.Config.ErpElement.SAC_ReportDataSource & SAC_ReportDataSourceEnum.Template) == SAC_ReportDataSourceEnum.Template)
+ var model = new BodyModel();
+ var dataList = new List();
+ if (_reqInfo.DataSource.HasFlag(SAC_ReportDataSourceEnum.Template))
{
dataList = GetMasterAgrmtModelFromExcel(ref fileList);
}
- if ((PS.Config.ErpElement.SAC_ReportDataSource & SAC_ReportDataSourceEnum.System) == SAC_ReportDataSourceEnum.System)
- {
- try
- {
- LogFactory.GetLogger("GenerateBody").Info($"System:1111x");
- var resultList = GetMasterAgrmtModelFromDb(ref fileList);
- if (resultList != null && resultList.Count() > 0)
- {
- LogFactory.GetLogger("GenerateBody").Info($"ok");
- dataList.AddRange(resultList);
- }
-
- LogFactory.GetLogger("GenerateBody").Info($"System:2222x");
- }
- catch (Exception ex)
- {
- LogFactory.GetLogger("GenerateBody").Info($"System:1111x系统异常:" + ex.ToString());
- }
- }
-
-
- LogFactory.GetLogger("GenerateBody").Info($"System:11112");
var subsystemDataList = loadSubsystemDataSource(fileList, AddSubsystemNote);
if (subsystemDataList != null && subsystemDataList.Count > 0)
+ {
dataList.AddRange(subsystemDataList);
+ }
+
noData = dataList.Count == 0;
model.MasterAgrmt = dataList;
return model;
@@ -84,7 +65,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
public bool AddSubsystemNote(MasterAgrmtModel model, List fileList, string tag)
{
- SACReportNotes note = base.GetReportNotes(ReportType, formatInfoTag(model, true)).FirstOrDefault();//参数true要加,要不A和D会查到同一条记录,在D时候,就会和A相同的数据
+ var note = base.GetReportNotes(ReportType, formatInfoTag(model, true)).FirstOrDefault();//参数true要加,要不A和D会查到同一条记录,在D时候,就会和A相同的数据
if (note == null)
{
note = new SACReportNotes()
@@ -136,186 +117,14 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
return true;
}
- private IEnumerable GetMasterAgrmtModelFromDb(ref List fileList)
- {
- var dataList = new List();
- using (var baseDb = DbContextFactory.GetClientDbContext(null))
- {
- var nextDate = _reqInfo.ReportDate.AddDays(1);
- var fileObjList = (from c in baseDb.client
- join cf in baseDb.client_file
- on c.id equals cf.ClientId
- where c.ProcessStatus == "已开户" && cf.HasSent == false && cf.IsValid &&
- cf.FileTypeName == ConsGlobal.ClientFileType.MainProtocol && cf.OptState == _operationType &&
- ((c.ProcessOptDate >= _reqInfo.ReportDate && c.ProcessOptDate < nextDate && cf.OptDate < nextDate) ||//如果这一天开户,则把这一天之前(含这一天)的所有文件都报送了
- (cf.OptDate >= _reqInfo.ReportDate && cf.OptDate < nextDate && c.ProcessOptDate < _reqInfo.ReportDate))//如果这一天不是开户日期,则只在报送日期大于开户日期时,报送当日修改的文件
- && cf.ApprovalOrder < 1
- select new
- {
- cf.id,
- cf.ClientId,
- cf.OptState,
- cf.ProtocolNumber,
- cf.SignDate,
- cf.SignType,
- cf.ReportorRole,
- cf.FilePath,
- cf.FileName,
- cf.FileDesc,
- c.Name,
- c.CounterpartyCode,
- c.Number,
- c.ProperClientClass,
- c.CustomerNature1,
- c.NFICode,
- c.RegisteredCapital,
- c.ClientType
- }).ToArray();
- var clientIds = fileObjList.Select(O => O.ClientId);
- var ct = baseDb.contactype.Where(O => O.ContactType == "联系人").FirstOrDefault();
- ExpandoDictionary clientdutyDict = null;
- if (ct != null)
- {
- clientdutyDict = new ExpandoDictionary(
- (from cd in baseDb.clientduty.Where(t => t.ApprovalOrder < 1)
- where clientIds.Contains(cd.ClientId ?? 0) && (cd.DeadLine == null || cd.DeadLine >= _reqInfo.ReportDate)
- select cd)
- .ToList()
- .Where(O => O.ContactTypeIdsInt.Contains(ct.id)).GroupBy(O => O.ClientId ?? 0)
- .ToDictionary(K => K.Key, V => V.FirstOrDefault()));
- }
- LogFactory.GetLogger("ReportMasterAgrmtService").Error("查询到: " + fileObjList.Length.ToString());
- var cacheKey = $"{BusiDataType}";
- foreach (var item in fileObjList)
- {
- var cacheValue = item.ProtocolNumber;
- if (ReportStatus.CheckCacheInfo(cacheKey, cacheValue))
- {
- LogFactory.GetLogger("ReportMasterAgrmtService").Error("有重复编号跳过 " + item.ProtocolNumber);
- continue;
- }
- try
- {
- var info = new MasterAgrmtModel();
- info.OperationType = item.OptState;
- info.MasterAgrmtNo = item.ProtocolNumber;
- info.SigningDate = item.SignDate?.ToString("yyyy-MM-dd");
- info.MasterAgrmtVer = ConsReport.MasterAgrmtVerMap[item.SignType ?? ""];
- info.FillParty = ConsReport.FillPartyMap[item.ReportorRole ?? ""];
- info.NameOfCounterparty = item.Name;
- info.CounterpartyCode = item.Number;
- info.ProCounterparty = item.ProperClientClass != null && item.ProperClientClass.Contains("专业") ? ProCounterpartyMap["专业"] : ProCounterpartyMap["非专业"];
- info.CounterpartyType = CounterpartyTypeMap[item.CustomerNature1 ?? ""];
- if ((info.CounterpartyType == CounterpartyTypeMap["境外金融机构"] || info.CounterpartyType == CounterpartyTypeMap["境外非金融机构"]))
- {
- info.LEI = item.CounterpartyCode;
- }
- else
- {
- info.CODS = item.CounterpartyCode;
- }
- if (item.CustomerNature1 != null && item.CustomerNature1.Contains("非金融机构"))
- {
- info.NFICode = item.NFICode;
- }
- info.CounterpartyRegdCptl = item.RegisteredCapital;
- info.MasterAgrmtAtt = item.FileName;
- info.MasterAgrmtRemark = item.FileDesc;
- if (clientdutyDict != null && clientdutyDict.ContainsKey(item.ClientId))
- {
- info.CounterpartyInformationTuple = new List();
- CounterpartyInfomationModel userInfo = new CounterpartyInfomationModel();
- userInfo.Name = clientdutyDict[item.ClientId]?.ContactName;
- userInfo.Title = clientdutyDict[item.ClientId] == null ? null : "联系人";
- userInfo.Email = clientdutyDict[item.ClientId]?.Email;
- userInfo.Telephone = clientdutyDict[item.ClientId]?.PhoneNumber;
- //userInfo.Mobile = clientdutyDict[item.ClientId]?.PhoneNumber;
- info.CounterpartyInformationTuple.Add(userInfo);
- }
- info.CounterpartyIdentity = item.ClientType == "机构" ? CounterpartyIdentityMap["自营"] : CounterpartyIdentityMap["产品管理人"];
-
- SACReportNotes note = base.GetReportNotes(ReportType, formatInfoTag(info)).FirstOrDefault();
- if (note == null && _operationType == OptFlagsEnum.A)
- {
- note = new SACReportNotes()
- {
- InfoCache = $"{{\"Tag\":\"{info.MasterAgrmtNo}\",\"Source\":\"System\"}}",
- IsValid = true,
- };
- }
- else
- {
- if (note == null)
- {
- LogFactory.GetLogger("ReportMasterAgrmtService").Error("未找到历史报送信息跳过 " + formatInfoTag(info));
- continue;
- }
- switch (_operationType)
- {
- case OptFlagsEnum.A:
- continue;//新增数据已报送,跳过
- case OptFlagsEnum.U:
- note.IsValid = true;
- break;
- case OptFlagsEnum.D:
- note.IsValid = false;
- break;
- case OptFlagsEnum.NONE:
- default:
- throw new ServiceException("未知操作类型");
- }
- }
- if (info.OperationType != OptFlagsEnum.A)
- {
- info.MasterAgrmtID = note.BizId;
- }
- if (!ReportStatus.CheckFileLength(item.FilePath))
- {
- break;
- }
- else
- {
- ReportStatus.AddCacheInfo(cacheKey, cacheValue);
- }
- info.ExceID = base.formatExceID();
- dataList.Add(info);
- fileList.Add(item.FilePath);
- note.id = 0;
- note.DataId = item.id.ToString();
- note.ExceId = info.ExceID;
- note.CreateTime = DateTime.Now;
- note.FileTag = FileTag;
- note.ReportType = ReportType;
- note.ReportDate = _reqInfo.ReportDate;
- note.InfoTag = formatInfoTag(info, true);
- note.OptTime = note.CreateTime;
- note.RetCode = "";
- note.RetMsg = "";
- note.ReportResponse = false;
- note.BizId = "";
- note.changeStatus = false;
- noteList.Add(note);
- }
- catch (Exception ex)
- {
- LogFactory.GetLogger("ReportMasterAgrmtService").Error(ex);
- LogFactory.GetLogger("ReportMasterAgrmtService").Error(item.ToJson());
- throw;
- }
- }
- }
- return dataList;
- }
-
private List GetMasterAgrmtModelFromExcel(ref List fileList)
{
- List result = new List();
+ var result = new List();
if (_excelDataSource != null && _excelDataSource.Tables.Contains("主协议"))
{
- var cacheKey = $"{BusiDataType}";
- string sourcePath = Path.Combine(_excelDataSourceRootPath, "附件");
- DataTable dt = _excelDataSource.Tables["主协议"];
- for (int i = 1; i < dt.Rows.Count; i++)
+ var sourcePath = Path.Combine(_excelDataSourceRootPath, "附件");
+ var dt = _excelDataSource.Tables["主协议"];
+ for (var i = 1; i < dt.Rows.Count; i++)
{
if (string.IsNullOrWhiteSpace(dt.Rows[i][0]?.ToString()))
{
@@ -325,12 +134,18 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
var optType = OptFlagsEnum.NONE;
switch (dt.Rows[i][3]?.ToString())
{
+ case "0":
+ case "A":
case "首次":
optType = OptFlagsEnum.A;
break;
+ case "1":
+ case "U":
case "变更":
optType = OptFlagsEnum.U;
break;
+ case "2":
+ case "D":
case "废止":
optType = OptFlagsEnum.D;
break;
@@ -340,14 +155,14 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
continue;
}
- MasterAgrmtModel model = generiterInfoFromExcel(dt, i, optType);
+ var model = generiterInfoFromExcel(dt, i, optType);
model.CounterpartyInformationTuple = GetCounterpartyInfomationModelFromExcel(model.MasterAgrmtNo);
- string cacheValue = model.MasterAgrmtNo;
- if (ReportStatus.CheckCacheInfo(cacheKey, cacheValue))
+ var cacheValue = model.MasterAgrmtNo;
+ if (ReportStatus.CheckCacheInfo(CacheKey, cacheValue))
{
continue;
}
- SACReportNotes note = base.GetReportNotes(ReportType, formatInfoTag(model)).FirstOrDefault();
+ var note = base.GetReportNotes(ReportType, formatInfoTag(model)).FirstOrDefault();
if (note == null && _operationType == OptFlagsEnum.A)
{
note = new SACReportNotes()
@@ -385,14 +200,14 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
if (!string.IsNullOrWhiteSpace(model.MasterAgrmtAtt))
{
model.ExceID = base.formatExceID();
- string path = Path.Combine(sourcePath, model.MasterAgrmtAtt);
+ var path = Path.Combine(sourcePath, model.MasterAgrmtAtt);
if (!ReportStatus.CheckFileLength(path))
{
break;
}
else
{
- ReportStatus.AddCacheInfo(cacheKey, cacheValue);
+ ReportStatus.AddCacheInfo(CacheKey, cacheValue);
}
result.Add(model);
fileList.Add(path);
@@ -418,29 +233,31 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
private MasterAgrmtModel generiterInfoFromExcel(DataTable dt, int i, OptFlagsEnum optType)
{
- var model = new MasterAgrmtModel();
- model.MasterAgrmtNo = GetDataSetValue(dt, i, 0);
- model.SigningDate = GetDataSetValue(dt, i, 1);
- model.MasterAgrmtVer = ConsReport.MasterAgrmtVerMap[GetDataSetValue(dt, i, 2)];
- model.OperationType = optType == OptFlagsEnum.A ? OptFlagsEnum.A : OptFlagsEnum.U;
- model.FillParty = ConsReport.FillPartyMap[GetDataSetValue(dt, i, 4)];
- model.NameOfCounterparty = GetDataSetValue(dt, i, 5);
- model.CODS = GetDataSetValue(dt, i, 6);
- model.CounterpartyCode = GetDataSetValue(dt, i, 7);
- model.LEI = GetDataSetValue(dt, i, 8);
- model.ProCounterparty = ConsReport.ProCounterpartyMap[GetDataSetValue(dt, i, 9)];
- model.CounterpartyType = ConsReport.CounterpartyTypeMap[GetDataSetValue(dt, i, 10)];
- model.NFICode = GetDataSetValue(dt, i, 11);
- model.CounterpartyRegdCptl = GetDataSetValue(dt, i, 12);
- model.MasterAgrmtRemark = GetDataSetValue(dt, i, 13);
- model.MasterAgrmtAtt = GetDataSetValue(dt, i, 14);
- model.CounterpartyIdentity = ConsReport.CounterpartyIdentityMap[GetDataSetValue(dt, i, 15)];
+ var model = new MasterAgrmtModel
+ {
+ MasterAgrmtNo = GetDataSetValue(dt, i, 0),
+ SigningDate = GetDataSetValue(dt, i, 1),
+ MasterAgrmtVer = ConsReport.MasterAgrmtVerMap[GetDataSetValue(dt, i, 2)],
+ OperationType = optType == OptFlagsEnum.A ? OptFlagsEnum.A : OptFlagsEnum.U,
+ FillParty = ConsReport.FillPartyMap[GetDataSetValue(dt, i, 4)],
+ NameOfCounterparty = GetDataSetValue(dt, i, 5),
+ CODS = GetDataSetValue(dt, i, 6),
+ CounterpartyCode = GetDataSetValue(dt, i, 7),
+ LEI = GetDataSetValue(dt, i, 8),
+ ProCounterparty = ConsReport.ProCounterpartyMap[GetDataSetValue(dt, i, 9)],
+ CounterpartyType = ConsReport.CounterpartyTypeMap[GetDataSetValue(dt, i, 10)],
+ NFICode = GetDataSetValue(dt, i, 11),
+ CounterpartyRegdCptl = GetDataSetValue(dt, i, 12),
+ MasterAgrmtRemark = GetDataSetValue(dt, i, 13),
+ MasterAgrmtAtt = GetDataSetValue(dt, i, 14),
+ CounterpartyIdentity = ConsReport.CounterpartyIdentityMap[GetDataSetValue(dt, i, 15)]
+ };
return model;
}
private string formatInfoTag(MasterAgrmtModel model, bool suffixType = false)
{
- string result = $"{BusiDataType}_{model.MasterAgrmtNo.Replace("_", "-")}_";
+ var result = $"{BusiDataType}_{model.MasterAgrmtNo.Replace("_", "-")}_";
if (suffixType)
{
result = $"{result}{_operationType}";
@@ -448,31 +265,44 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
return result;
}
+ protected override string _changeCodeOfInfoTag(string infoTag, string newCode, out string originalCode)
+ {
+ var arr = infoTag.Split('_');
+ if (arr.Length != 3)
+ {
+ throw new ServiceException($"InfoTag信息不匹配:{infoTag}");
+ }
+ originalCode = arr[1];
+ arr[1] = newCode.Replace("_", "-");
+ return string.Join("_", arr);
+ }
+
private List GetCounterpartyInfomationModelFromExcel(string masterAgrmtNo)
{
- List result = new List();
+ var result = new List();
if (_excelDataSource != null && _excelDataSource.Tables.Contains("填报方业务代表明细"))
{
- DataTable dt = _excelDataSource.Tables["填报方业务代表明细"];
- for (int i = 1; i < dt.Rows.Count; i++)
+ var dt = _excelDataSource.Tables["填报方业务代表明细"];
+ for (var i = 1; i < dt.Rows.Count; i++)
{
if (string.IsNullOrWhiteSpace(dt.Rows[i][0]?.ToString()))
{
//第一列空白说明数据结束了;
break;
}
- if (dt.Rows[i][0]?.ToString() != masterAgrmtNo)
+ if (dt.Rows[i][0]?.ToString().Trim() != masterAgrmtNo)
{
continue;
}
- CounterpartyInfomationModel model = new CounterpartyInfomationModel();
-
- model.Name = GetDataSetValue(dt, i, 1);
- model.Title = GetDataSetValue(dt, i, 2);
- model.Telephone = GetDataSetValue(dt, i, 3);
- model.Mobile = GetDataSetValue(dt, i, 4);
- model.Email = GetDataSetValue(dt, i, 5);
+ var model = new CounterpartyInfomationModel
+ {
+ Name = GetDataSetValue(dt, i, 1),
+ Title = GetDataSetValue(dt, i, 2),
+ Telephone = GetDataSetValue(dt, i, 3),
+ Mobile = GetDataSetValue(dt, i, 4),
+ Email = GetDataSetValue(dt, i, 5)
+ };
result.Add(model);
}
@@ -482,23 +312,27 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
protected override List CheckBodyValue(BodyModel model, out bool checkStatus)
{
- List result = new List();
+ var result = new List();
if (model?.MasterAgrmt != null)
{
- CheckHelper helper = new Common.CheckHelper();
- CheckHelper infoHelper = new Common.CheckHelper();
- for (int i = 0; i < model.MasterAgrmt.Count; i++)
+ var helper = new Common.CheckHelper();
+ var infoHelper = new Common.CheckHelper();
+ for (var i = 0; i < model.MasterAgrmt.Count; i++)
{
- List listRoot = new List();
+ var listRoot = new List();
var item = model.MasterAgrmt[i];
- if (item.IgnoreCheck) continue;
+ if (item.IgnoreCheck)
+ {
+ continue;
+ }
+
helper.ExecuteCheck(item, (name, value, msg) =>
{
listRoot.Add(new SacInfo(name, value, msg));
});
if (item.CounterpartyInformationTuple != null)
{
- for (int j = 0; j < item.CounterpartyInformationTuple.Count; j++)
+ for (var j = 0; j < item.CounterpartyInformationTuple.Count; j++)
{
var listItem = new List();
var tuple = item.CounterpartyInformationTuple[j];
@@ -508,16 +342,21 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
});
if (listItem.Count > 0)
{
- var temp = new SacInfo("CounterpartyInformationTuple", j);
- temp.SubMaps = new List(listItem);
+ var temp = new SacInfo("CounterpartyInformationTuple", j)
+ {
+ SubMaps = new List(listItem)
+ };
listRoot.Add(temp);
}
}
}
if (listRoot.Count > 0)
{
- var errMsg = new SacInfo("MasterAgrmt", i);
- errMsg.SubMaps = new List(listRoot);
+ var errMsg = new SacInfo("MasterAgrmt", i)
+ {
+ FieldValue = item.MasterAgrmtNo,
+ SubMaps = new List(listRoot)
+ };
result.Add(errMsg);
}
}
@@ -542,7 +381,7 @@ namespace YLErp.Modules.SuperviseReportModule.SAC.Service
LogFactory.GetLogger().Error(e);
};
}
- for (int i = 0; i < noteList.Count; i++)
+ for (var i = 0; i < noteList.Count; i++)
{
base.SaveReportNotes(noteList[i]);
}
diff --git a/YLErpDAL/Modules/SuperviseReportModule/SAC/Service/ReportOptionConfirmationAttService.cs b/YLErpDAL/Modules/SuperviseReportModule/SAC/Service/ReportOptionConfirmationAttService.cs
new file mode 100644
index 00000000..e29762b7
--- /dev/null
+++ b/YLErpDAL/Modules/SuperviseReportModule/SAC/Service/ReportOptionConfirmationAttService.cs
@@ -0,0 +1,320 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using static YLErp.DBModels.Consts.ConsReport;
+using YLErp.BLL;
+using YLErp.DBModels.Consts;
+using YLErp.DBModels.Enums;
+using YLErp.DBModels;
+using YLErp.Modules.SuperviseReportModule.SAC.Common;
+using YLErp.Modules.SuperviseReportModule.SAC.Model;
+using System.Data;
+using System.IO;
+using NPOI.SS.Formula.Functions;
+using YLErp.Helpers;
+
+namespace YLErp.Modules.SuperviseReportModule.SAC.Service
+{
+ class ReportOptionConfirmationAttService : ReportBaseService
+ {
+ public ReportOptionConfirmationAttService(OptUserInfo optUser) : base(optUser)
+ {
+ }
+
+ protected override string _excelDataSourcePath => "交易相关\\";
+
+ protected override string _excelDataSourceFileName => "import_OptionConfirmationAtt_template.xlsx";
+
+ protected override DataFlagsEnum BusiDataType => DataFlagsEnum.A1019;
+
+ private List _validOperationType = null;
+ public override List ValidOperationType
+ {
+ get
+ {
+ if (_validOperationType == null)
+ {
+ _validOperationType = new List() {
+ OptFlagsEnum.A,
+ OptFlagsEnum.U,
+ OptFlagsEnum.D,
+ };
+ }
+ return _validOperationType;
+ }
+ }
+
+ protected override SuperviseReportTypeEnum ReportType => SuperviseReportTypeEnum.SAC_OptionConfirmationAtt;
+ List noteList = new List();
+
+ protected override BodyModel GenerateBody(out bool noData, out List fileList)
+ {
+ fileList = new List();
+ BodyModel model = new BodyModel();
+ List dataList = new List();
+ if (_reqInfo.DataSource.HasFlag(SAC_ReportDataSourceEnum.Template))
+ {
+ dataList = GetOptionConfirmationAttModel(out fileList);
+ }
+ var subsystemDataList = loadSubsystemDataSource(fileList, AddSubsystemNote);
+ if (subsystemDataList != null && subsystemDataList.Count > 0)
+ dataList.AddRange(subsystemDataList);
+
+ noData = dataList.Count == 0;
+ model.ConfirmationAtt = dataList;
+ return model;
+ }
+
+ public bool AddSubsystemNote(ConfirmationAttModel model, List fileList, string tag)
+ {
+ SACReportNotes note = base.GetReportNotes(ReportType, formatInfoTag(model, true)).FirstOrDefault();//参数true要加,要不A和D会查到同一条记录,在D时候,就会和A相同的数据
+ if (note == null)
+ {
+ note = new SACReportNotes()
+ {
+ InfoCache = $"{{\"Tag\":\"{model.ConfirmationNo}\",\"Source\":\"Subsystem\",\"SubFileTag\":\"{tag}\",\"ExceID\":\"{model.ExceID}\"}}",
+ IsValid = true,
+ };
+ }
+ else
+ {
+ switch (model.OperationType)
+ {
+ case OptFlagsEnum.A:
+ return false;//新增数据已报送,跳过
+ case OptFlagsEnum.U:
+ //多次U的时候,每次用最新的tag来赋值SubFileTag
+ note.InfoCache = $"{{\"Tag\":\"{model.ConfirmationNo}\",\"Source\":\"Subsystem\",\"SubFileTag\":\"{tag}\",\"ExceID\":\"{model.ExceID}\"}}";
+ note.IsValid = true;
+ break;
+ case OptFlagsEnum.D:
+ note.IsValid = false;
+ break;
+ case OptFlagsEnum.NONE:
+ default:
+ throw new ServiceException("未知操作类型");
+ }
+ }
+
+ if (model.ConfirmationFilesTuple != null && model.ConfirmationFilesTuple.Count > 0)
+ {
+ fileList.AddRange(model.ConfirmationFilesTuple.Select(x => x.ConfirmationAtt));
+ }
+ model.ExceID = base.formatExceID();
+ note.ExceId = model.ExceID;
+ note.id = 0;
+ note.CreateTime = DateTime.Now;
+ note.FileTag = FileTag;
+ note.ReportType = ReportType;
+ note.ReportDate = _reqInfo.ReportDate;
+ note.InfoTag = formatInfoTag(model, true);
+ note.OptTime = note.CreateTime;
+ note.RetCode = "";
+ note.RetMsg = "";
+ note.ReportResponse = false;
+ note.BizId = "";
+ note.changeStatus = false;
+ noteList.Add(note);
+ return true;
+ }
+
+ private List GetOptionConfirmationAttModel(out List fileList)
+ {
+ fileList = new List();
+ List result = new List();
+ if (_excelDataSource != null && _excelDataSource.Tables.Contains("场外期权确认书附件明细"))
+ {
+ DataTable dt = _excelDataSource.Tables["场外期权确认书附件明细"];
+ string sourcePath = Path.Combine(_excelDataSourceRootPath, "附件");
+ for (int i = 1; i < dt.Rows.Count; i++)
+ {
+ if (string.IsNullOrWhiteSpace(dt.Rows[i][0]?.ToString()))
+ {
+ //第一列空白说明数据结束了;
+ break;
+ }
+ var optType = OptFlagsEnum.NONE;
+ switch (dt.Rows[i][1]?.ToString())
+ {
+ case "0":
+ case "A":
+ case "首次":
+ optType = OptFlagsEnum.A;
+ break;
+ case "1":
+ case "U":
+ case "变更":
+ optType = OptFlagsEnum.U;
+ break;
+ case "2":
+ case "D":
+ case "废止":
+ optType = OptFlagsEnum.D;
+ break;
+ }
+ if (optType != _operationType)
+ {
+ continue;
+ }
+
+ ConfirmationAttModel model = new ConfirmationAttModel();
+
+ model.ConfirmationNo = GetDataSetValue(dt, i, 0);
+ model.OperationType = optType;
+ var cacheValue = (model.ConfirmationNo ?? "").ToString();
+ if (cacheValue.IsNullOrWhiteSpace())
+ {
+ continue;
+ }
+ if (ReportStatus.CheckCacheInfo(CacheKey, cacheValue))
+ {
+ continue;
+ }
+ model.ConfirmationFilesTuple = new List();
+ var files = GetDataSetValue(dt, i, 2).Split(',');
+ foreach (var f in files)
+ {
+ if (!string.IsNullOrWhiteSpace(f))
+ {
+ var path = Path.Combine(sourcePath, f);
+ if (!ReportStatus.CheckFileLength(path))
+ {
+ break;
+ }
+ fileList.Add(path);
+ model.ConfirmationFilesTuple.Add(new ConfirmationFilesTupleModel() { IsSwap = "false", ConfirmationAtt = f });
+ }
+ }
+ List