46 changed files with 2175 additions and 200 deletions
@ -1,3 +1,3 @@ |
|||
application.title=Application Platform |
|||
application.title=Risk Manager Platform |
|||
application.version=$version |
|||
application.copyright=Copyright \u00A9 2019\u20132022 |
@ -1,3 +1,3 @@ |
|||
application.title=\u61C9\u7528\u958B\u767C\u5E73\u53F0 |
|||
application.title=\u98A8\u96AA\u7BA1\u7406\u5E73\u53F0 |
|||
application.version=$version |
|||
application.copyright=Copyright \u00A9 2019\u20132022 |
@ -1,3 +1,3 @@ |
|||
application.title=\u5E94\u7528\u5F00\u53D1\u5E73\u53F0 |
|||
application.title=\u98CE\u9669\u7BA1\u7406\u5E73\u53F0 |
|||
application.version=$version |
|||
application.copyright=Copyright \u00A9 2019\u20132022 |
@ -0,0 +1 @@ |
|||
io.sc.algorithm.weka.initializer.WekaInitializer |
@ -1,45 +1,68 @@ |
|||
{ |
|||
"menu.engine.st":"Stress Test", |
|||
"menu.engine.st.factorManager":"Economic Factor", |
|||
"menu.engine.st.target": "Test Target Manager", |
|||
"menu.engine.st.indicator": "Test Indicator Manager", |
|||
"menu.engine.st.scenario": "Scenario Manager", |
|||
"menu.engine.st.ead": "Stress Test (EAD)", |
|||
|
|||
"engine.st.factorType.grid.title": "Factor Type", |
|||
"engine.st.factor.grid.title": "Factor", |
|||
|
|||
"engine.st.economicIndicator.grid.title": "Economic Indicator", |
|||
"engine.st.economicIndicator.grid.entity.periodType": "Period Type", |
|||
"engine.st.economicIndicator.grid.entity.GDP": "GDP(a hundred million)", |
|||
"engine.st.economicIndicator.grid.entity.M2": "M2(a hundred million)", |
|||
"engine.st.economicIndicator.grid.entity.CPI": "CPI", |
|||
"engine.st.economicIndicator.grid.entity.HPI": "HPI", |
|||
"engine.st.economicIndicator.grid.entity.PMI": "PMI", |
|||
"engine.st.economicIndicator.grid.entity.BLR": "BLR", |
|||
|
|||
"engine.st.target.grid.title": "Test Target", |
|||
"engine.st.targetIndicator.grid.title": "History Data", |
|||
"engine.st.targetIndicator.grid.entity.periodType": "Period Type", |
|||
"engine.st.targetIndicator.grid.entity.target": "Test Target", |
|||
"engine.st.targetIndicator.grid.entity.PD": "PD", |
|||
"engine.st.targetIndicator.grid.entity.PD.title": "Probability of Default", |
|||
"engine.st.targetIndicator.grid.entity.LGD": "LGD", |
|||
"engine.st.targetIndicator.grid.entity.LGD.title": "Loss Given Default", |
|||
"engine.st.targetIndicator.grid.entity.CCF": "CCF", |
|||
"engine.st.targetIndicator.grid.entity.CCF.title": "Credit Conversion Factors", |
|||
"menu.engine.st.indepFactorManager":"Economic Factor Manager", |
|||
"menu.engine.st.depFactorManager": "Test Target Manager", |
|||
"menu.engine.st.modelManager": "Conduct Model Manager", |
|||
"menu.engine.st.scenarioFactorManager": "Scenario Manager", |
|||
"menu.engine.st.testCaseManager": "Stress Test", |
|||
|
|||
"engine.st.indepFactorDefine.grid.title": "Independence Factors", |
|||
"engine.st.indepFactorDefine.grid.toolbar.addTop": "Top Folder", |
|||
"engine.st.indepFactorDefine.grid.toolbar.addChild": "Child Folder", |
|||
"engine.st.indepFactorDefine.grid.toolbar.addFactorDefine": "Factor", |
|||
"engine.st.indepFactorDefine.grid.entity.factorDefine": "Factor Define", |
|||
"engine.st.indepFactorDefine.grid.entity.formula": "Formula", |
|||
"engine.st.indepFactorDefine.grid.entity.delayFactorDefine": "Delay Reference Factor Define", |
|||
"engine.st.indepFactorDefine.grid.entity.delayIssue": "Delay Issue", |
|||
"engine.st.indepFactorDefine.grid.entity.differentialFactorDefine": "Differential Reference Factor Define", |
|||
"engine.st.indepFactorDefine.grid.entity.differentialDegree": "Differential Degree", |
|||
|
|||
"engine.st.depFactorDefine.grid.title": "Dependence Factors", |
|||
"engine.st.depFactorDefine.grid.toolbar.addTop": "Top Folder", |
|||
"engine.st.depFactorDefine.grid.toolbar.addChild": "Child Folder", |
|||
"engine.st.depFactorDefine.grid.toolbar.addFactorDefine": "Factor", |
|||
"engine.st.depFactorDefine.grid.entity.factorDefine": "Factor Define", |
|||
"engine.st.depFactorDefine.grid.entity.formula": "Formula", |
|||
"engine.st.depFactorDefine.grid.entity.reserveFormula": "Reserve Formula", |
|||
"engine.st.depFactorDefine.grid.entity.delayFactorDefine": "Delay Reference Factor Define", |
|||
"engine.st.depFactorDefine.grid.entity.delayIssue": "Delay Issue", |
|||
"engine.st.depFactorDefine.grid.entity.differentialFactorDefine": "Differential Reference Factor Define", |
|||
"engine.st.depFactorDefine.grid.entity.differentialDegree": "Differential Degree", |
|||
|
|||
"engine.st.model.grid.title": "Model", |
|||
"engine.st.model.grid.toolbar.buildModel": "Build Model", |
|||
"engine.st.model.grid.entity.depFactorDefine": "Dependence Factor", |
|||
"engine.st.model.grid.entity.raFreedomDegree": "Freedom", |
|||
"engine.st.model.grid.entity.raRsquared": "R-Square", |
|||
"engine.st.model.grid.entity.raAdjustedRsquared": "Adjust R-Square", |
|||
"engine.st.model.grid.entity.raFstatistic": "F", |
|||
"engine.st.model.grid.entity.formula": "Model Formula", |
|||
|
|||
"engine.st.model.indepFactorDefine.grid.title": "Independence Factor", |
|||
"engine.st.model.indepFactorDefine.grid.toolbar.selectIn": "Select In", |
|||
"engine.st.model.indepFactorDefine.grid.toolbar.selectOut": "Select Out", |
|||
"engine.st.model.indepFactorDefine.grid.toolbar.selectOut.tip": "Are you sure to select out?", |
|||
|
|||
"engine.st.model.selectIndepFactorDialog.title": "Select Independence Factor", |
|||
|
|||
"engine.st.model.analysisFactor.grid.title": "Variable Validate Result", |
|||
"engine.st.model.analysisFactor.grid.entity.variable": "Name", |
|||
"engine.st.model.analysisFactor.grid.entity.coefficient": "Coefficient", |
|||
"engine.st.model.analysisFactor.grid.entity.coefficientSe": "SE of Coefficient", |
|||
"engine.st.model.analysisFactor.grid.entity.t": "t", |
|||
|
|||
"engine.st.scenario.scenarioFactor.grid.toolbar.fillWithPercentile": "Percentile Fill", |
|||
"engine.st.scenario.scenarioFactor.grid.entity.valueLow": "Low Grade", |
|||
"engine.st.scenario.scenarioFactor.grid.entity.valueMid": "Mid Grade", |
|||
"engine.st.scenario.scenarioFactor.grid.entity.valueHigh": "High Grade", |
|||
|
|||
"engine.st.scenario.percentileDialog.title": "Percentile Setting", |
|||
"engine.st.scenario.percentileDialog.entity.precision": "Precision", |
|||
"engine.st.scenario.percentileDialog.entity.low": "Low Grade", |
|||
"engine.st.scenario.percentileDialog.entity.mid": "Mid Grade", |
|||
"engine.st.scenario.percentileDialog.entity.high": "High Grade", |
|||
|
|||
"engine.st.testCase.grid.title": "Test Case", |
|||
"engine.st.testCase.grid.toolbar.scenario": "Scenario", |
|||
"engine.st.testCase.grid.entity.model": "Stress Test Model", |
|||
"engine.st.testCase.grid.toolbar.test": "Test", |
|||
"engine.st.testCase.grid.toolbar.viewResult": "View Result", |
|||
"engine.st.testCase.grid.entity.periodType": "Period Type", |
|||
|
|||
"engine.st.scenario.dialog.title": "Scenario Setting", |
|||
"engine.st.scenario.grid.title": "Indicator", |
|||
"engine.st.scenario.grid.entity.testCase": "Test Case", |
|||
"engine.st.scenario.grid.entity.indicator": "Indicator", |
|||
"engine.st.scenario.grid.entity.lowGrade": "Low Grade", |
|||
"engine.st.scenario.grid.entity.midGrade": "Mid Grade", |
|||
"engine.st.scenario.grid.entity.highGrade": "High Grade", |
|||
} |
@ -1,57 +1,68 @@ |
|||
{ |
|||
"menu.engine.st":"壓力測試", |
|||
"menu.engine.st.factorManager":"宏觀經濟指標", |
|||
"menu.engine.st.target": "測試對象管理", |
|||
"menu.engine.st.indicator": "測試指標管理", |
|||
"menu.engine.st.scenario": "情景管理", |
|||
"menu.engine.st.ead": "壓力測試(風險暴露)", |
|||
"menu.engine.st.indepFactorManager":"宏觀經濟指標", |
|||
"menu.engine.st.depFactorManager": "測試對象管理", |
|||
"menu.engine.st.modelManager": "傳導模型", |
|||
"menu.engine.st.scenarioFactorManager": "情景管理", |
|||
"menu.engine.st.testCaseManager": "壓力測試", |
|||
|
|||
"engine.st.factorType.grid.title": "指標定義", |
|||
"engine.st.factor.grid.title": "指標", |
|||
"engine.st.indepFactorDefine.grid.title": "自變量", |
|||
"engine.st.indepFactorDefine.grid.toolbar.addTop": "頂級文件夾", |
|||
"engine.st.indepFactorDefine.grid.toolbar.addChild": "子文件夾", |
|||
"engine.st.indepFactorDefine.grid.toolbar.addFactorDefine": "自變量", |
|||
"engine.st.indepFactorDefine.grid.entity.factorDefine": "自變量定義", |
|||
"engine.st.indepFactorDefine.grid.entity.formula": "公式", |
|||
"engine.st.indepFactorDefine.grid.entity.delayFactorDefine": "滯後引用自變量定義", |
|||
"engine.st.indepFactorDefine.grid.entity.delayIssue": "滯後期數", |
|||
"engine.st.indepFactorDefine.grid.entity.differentialFactorDefine": "差分引用自變量定義", |
|||
"engine.st.indepFactorDefine.grid.entity.differentialDegree": "差分階數", |
|||
|
|||
"engine.st.depFactorDefine.grid.title": "因變量", |
|||
"engine.st.depFactorDefine.grid.toolbar.addTop": "頂級文件夾", |
|||
"engine.st.depFactorDefine.grid.toolbar.addChild": "子文件夾", |
|||
"engine.st.depFactorDefine.grid.toolbar.addFactorDefine": "因變量", |
|||
"engine.st.depFactorDefine.grid.entity.factorDefine": "因變量定義", |
|||
"engine.st.depFactorDefine.grid.entity.formula": "公式", |
|||
"engine.st.depFactorDefine.grid.entity.reserveFormula": "反公式", |
|||
"engine.st.depFactorDefine.grid.entity.delayFactorDefine": "滯後引用因變量定義", |
|||
"engine.st.depFactorDefine.grid.entity.delayIssue": "滯後期數", |
|||
"engine.st.depFactorDefine.grid.entity.differentialFactorDefine": "差分引用因變量定義", |
|||
"engine.st.depFactorDefine.grid.entity.differentialDegree": "差分階數", |
|||
|
|||
"engine.st.economicIndicator.grid.title": "宏觀經濟指標", |
|||
"engine.st.economicIndicator.grid.entity.periodType": "週期", |
|||
"engine.st.economicIndicator.grid.entity.GDP": "GDP(億元)", |
|||
"engine.st.economicIndicator.grid.entity.GDP.title": "國內生產總值", |
|||
"engine.st.model.grid.title": "模型列表", |
|||
"engine.st.model.grid.toolbar.buildModel": "構建模型", |
|||
"engine.st.model.grid.entity.depFactorDefine": "因變量", |
|||
"engine.st.model.grid.entity.raFreedomDegree": "自由度", |
|||
"engine.st.model.grid.entity.raRsquared": "R方", |
|||
"engine.st.model.grid.entity.raAdjustedRsquared": "調整R方", |
|||
"engine.st.model.grid.entity.raFstatistic": "F", |
|||
"engine.st.model.grid.entity.formula": "模型公式", |
|||
|
|||
"engine.st.economicIndicator.grid.entity.M2": "M2(億元)", |
|||
"engine.st.economicIndicator.grid.entity.M2.title": "廣義貨幣供應量", |
|||
"engine.st.model.indepFactorDefine.grid.title": "自變量列表", |
|||
"engine.st.model.indepFactorDefine.grid.toolbar.selectIn": "選入", |
|||
"engine.st.model.indepFactorDefine.grid.toolbar.selectOut": "選出", |
|||
"engine.st.model.indepFactorDefine.grid.toolbar.selectOut.tip": "您確定要選出嗎?", |
|||
|
|||
"engine.st.economicIndicator.grid.entity.CPI": "CPI", |
|||
"engine.st.economicIndicator.grid.entity.CPI.title": "消費價格指數", |
|||
"engine.st.model.selectIndepFactorDialog.title": "選擇自變量", |
|||
|
|||
"engine.st.economicIndicator.grid.entity.HPI": "HPI", |
|||
"engine.st.economicIndicator.grid.entity.HPI.title": "房地產價格指數", |
|||
"engine.st.model.analysisFactor.grid.title": "變量檢驗結果", |
|||
"engine.st.model.analysisFactor.grid.entity.variable": "變量名稱", |
|||
"engine.st.model.analysisFactor.grid.entity.coefficient": "回歸係數", |
|||
"engine.st.model.analysisFactor.grid.entity.coefficientSe": "回歸係數標準誤差", |
|||
"engine.st.model.analysisFactor.grid.entity.t": "t檢驗", |
|||
|
|||
"engine.st.economicIndicator.grid.entity.PMI": "PMI", |
|||
"engine.st.economicIndicator.grid.entity.PMI.title": "生產者物價指數", |
|||
"engine.st.scenario.scenarioFactor.grid.toolbar.fillWithPercentile": "分位數填充", |
|||
"engine.st.scenario.scenarioFactor.grid.entity.valueLow": "輕度", |
|||
"engine.st.scenario.scenarioFactor.grid.entity.valueMid": "中度", |
|||
"engine.st.scenario.scenarioFactor.grid.entity.valueHigh": "重度", |
|||
|
|||
"engine.st.economicIndicator.grid.entity.BLR": "BLR", |
|||
"engine.st.economicIndicator.grid.entity.BLR.title": "貸款利率", |
|||
|
|||
"engine.st.target.grid.title": "測試目標", |
|||
"engine.st.targetIndicator.grid.title": "歷史數據", |
|||
"engine.st.targetIndicator.grid.entity.periodType": "週期", |
|||
"engine.st.targetIndicator.grid.entity.target": "測試目標", |
|||
"engine.st.targetIndicator.grid.entity.PD": "PD", |
|||
"engine.st.targetIndicator.grid.entity.PD.title": "違約概率", |
|||
"engine.st.targetIndicator.grid.entity.LGD": "LGD", |
|||
"engine.st.targetIndicator.grid.entity.LGD.title": "違約損失率", |
|||
"engine.st.targetIndicator.grid.entity.CCF": "CCF", |
|||
"engine.st.targetIndicator.grid.entity.CCF.title": "信用轉換係數", |
|||
"engine.st.scenario.percentileDialog.title": "設置分位數參數", |
|||
"engine.st.scenario.percentileDialog.entity.precision": "小數精度", |
|||
"engine.st.scenario.percentileDialog.entity.low": "輕度", |
|||
"engine.st.scenario.percentileDialog.entity.mid": "中度", |
|||
"engine.st.scenario.percentileDialog.entity.high": "重度", |
|||
|
|||
"engine.st.testCase.grid.title": "測試用例", |
|||
"engine.st.testCase.grid.toolbar.scenario": "壓力情景", |
|||
"engine.st.testCase.grid.entity.model": "壓力測試傳導模型", |
|||
"engine.st.testCase.grid.toolbar.test": "測試", |
|||
"engine.st.testCase.grid.toolbar.viewResult": "查看測試結果", |
|||
"engine.st.testCase.grid.entity.periodType": "週期", |
|||
|
|||
"engine.st.scenario.dialog.title": "壓力測試情景設置", |
|||
"engine.st.scenario.grid.title": "壓力測試情景指標", |
|||
"engine.st.scenario.grid.entity.testCase": "測試用例", |
|||
"engine.st.scenario.grid.entity.indicator": "指標", |
|||
"engine.st.scenario.grid.entity.lowGrade": "輕度", |
|||
"engine.st.scenario.grid.entity.midGrade": "中度", |
|||
"engine.st.scenario.grid.entity.highGrade": "重度", |
|||
} |
@ -1,52 +1,71 @@ |
|||
{ |
|||
"menu.engine.st":"压力测试", |
|||
"menu.engine.st.factorManager":"宏观经济指标", |
|||
"menu.engine.st.target": "测试对象管理", |
|||
"menu.engine.st.indicator": "测试指标管理", |
|||
"menu.engine.st.scenario": "情景管理", |
|||
"menu.engine.st.ead": "压力测试(风险暴露)", |
|||
|
|||
"engine.st.factorType.grid.title": "指标定义", |
|||
"engine.st.factor.grid.title": "指标", |
|||
|
|||
|
|||
"engine.st.economicIndicator.grid.title": "宏观经济指标", |
|||
"engine.st.economicIndicator.grid.entity.periodType": "周期", |
|||
"engine.st.economicIndicator.grid.entity.GDP": "GDP(亿元)", |
|||
"engine.st.economicIndicator.grid.entity.GDP.title": "国内生产总值", |
|||
"engine.st.economicIndicator.grid.entity.M2": "M2(亿元)", |
|||
"engine.st.economicIndicator.grid.entity.M2.title": "广义货币供应量", |
|||
"engine.st.economicIndicator.grid.entity.CPI": "CPI", |
|||
"engine.st.economicIndicator.grid.entity.CPI.title": "消费价格指数", |
|||
"engine.st.economicIndicator.grid.entity.HPI": "HPI", |
|||
"engine.st.economicIndicator.grid.entity.HPI.title": "房地产价格指数", |
|||
"engine.st.economicIndicator.grid.entity.PMI": "PMI", |
|||
"engine.st.economicIndicator.grid.entity.PMI.title": "生产者物价指数", |
|||
"engine.st.economicIndicator.grid.entity.BLR": "BLR", |
|||
"engine.st.economicIndicator.grid.entity.BLR.title": "贷款利率", |
|||
|
|||
"engine.st.target.grid.title": "测试目标", |
|||
"engine.st.targetIndicator.grid.title": "历史数据", |
|||
"engine.st.targetIndicator.grid.entity.periodType": "周期", |
|||
"engine.st.targetIndicator.grid.entity.target": "测试目标", |
|||
"engine.st.targetIndicator.grid.entity.PD": "PD", |
|||
"engine.st.targetIndicator.grid.entity.PD.title": "违约概率", |
|||
"engine.st.targetIndicator.grid.entity.LGD": "LGD", |
|||
"engine.st.targetIndicator.grid.entity.LGD.title": "违约损失率", |
|||
"engine.st.targetIndicator.grid.entity.CCF": "CCF", |
|||
"engine.st.targetIndicator.grid.entity.CCF.title": "信用转换系数", |
|||
"menu.engine.st.indepFactorManager":"宏观经济指标", |
|||
"menu.engine.st.depFactorManager": "测试对象", |
|||
"menu.engine.st.modelManager": "传导模型", |
|||
"menu.engine.st.scenarioFactorManager": "情景管理", |
|||
"menu.engine.st.testCaseManager": "压力测试", |
|||
|
|||
"engine.st.indepFactorDefine.grid.title": "自变量树", |
|||
"engine.st.indepFactorDefine.grid.toolbar.addTop": "顶级文件夹", |
|||
"engine.st.indepFactorDefine.grid.toolbar.addChild": "子文件夹", |
|||
"engine.st.indepFactorDefine.grid.toolbar.addFactorDefine": "自变量", |
|||
"engine.st.indepFactorDefine.grid.entity.factorDefine": "自变量定义", |
|||
"engine.st.indepFactorDefine.grid.entity.formula": "公式", |
|||
"engine.st.indepFactorDefine.grid.entity.delayFactorDefine": "滞后引用自变量定义", |
|||
"engine.st.indepFactorDefine.grid.entity.delayIssue": "滞后期数", |
|||
"engine.st.indepFactorDefine.grid.entity.differentialFactorDefine": "差分引用自变量定义", |
|||
"engine.st.indepFactorDefine.grid.entity.differentialDegree": "差分阶数", |
|||
|
|||
"engine.st.depFactorDefine.grid.title": "因变量树", |
|||
"engine.st.depFactorDefine.grid.toolbar.addTop": "顶级文件夹", |
|||
"engine.st.depFactorDefine.grid.toolbar.addChild": "子文件夹", |
|||
"engine.st.depFactorDefine.grid.toolbar.addFactorDefine": "因变量", |
|||
"engine.st.depFactorDefine.grid.entity.factorDefine": "因变量定义", |
|||
"engine.st.depFactorDefine.grid.entity.formula": "公式", |
|||
"engine.st.depFactorDefine.grid.entity.reverseFormula": "反公式", |
|||
"engine.st.depFactorDefine.grid.entity.delayFactorDefine": "滞后引用因变量定义", |
|||
"engine.st.depFactorDefine.grid.entity.delayIssue": "滞后期数", |
|||
"engine.st.depFactorDefine.grid.entity.differentialFactorDefine": "差分引用因变量定义", |
|||
"engine.st.depFactorDefine.grid.entity.differentialDegree": "差分阶数", |
|||
|
|||
"engine.st.model.grid.title": "模型列表", |
|||
"engine.st.model.grid.toolbar.buildModel": "构建模型", |
|||
"engine.st.model.grid.entity.depFactorDefine": "因变量", |
|||
"engine.st.model.grid.entity.raFreedomDegree": "自由度", |
|||
"engine.st.model.grid.entity.raRsquared": "R方", |
|||
"engine.st.model.grid.entity.raAdjustedRsquared": "调整R方", |
|||
"engine.st.model.grid.entity.raFstatistic": "F", |
|||
"engine.st.model.grid.entity.formula": "模型公式", |
|||
|
|||
"engine.st.model.indepFactorDefine.grid.title": "自变量列表", |
|||
"engine.st.model.indepFactorDefine.grid.toolbar.selectIn": "选入", |
|||
"engine.st.model.indepFactorDefine.grid.toolbar.selectOut": "选出", |
|||
"engine.st.model.indepFactorDefine.grid.toolbar.selectOut.tip": "您确定要选出吗?", |
|||
|
|||
"engine.st.model.selectIndepFactorDialog.title": "选择自变量", |
|||
|
|||
"engine.st.model.analysisFactor.grid.title": "变量检验结果", |
|||
"engine.st.model.analysisFactor.grid.entity.variable": "变量名", |
|||
"engine.st.model.analysisFactor.grid.entity.coefficient": "回归系数", |
|||
"engine.st.model.analysisFactor.grid.entity.coefficientSe": "回归系数标准误差", |
|||
"engine.st.model.analysisFactor.grid.entity.t": "t检验", |
|||
|
|||
"engine.st.scenario.scenarioFactor.grid.toolbar.fillWithPercentile": "分位数填充", |
|||
"engine.st.scenario.scenarioFactor.grid.entity.valueLow": "轻度", |
|||
"engine.st.scenario.scenarioFactor.grid.entity.valueMid": "中度", |
|||
"engine.st.scenario.scenarioFactor.grid.entity.valueHigh": "重度", |
|||
|
|||
"engine.st.scenario.percentileDialog.title": "设置分位数参数", |
|||
"engine.st.scenario.percentileDialog.entity.precision": "小数精度", |
|||
"engine.st.scenario.percentileDialog.entity.low": "轻度", |
|||
"engine.st.scenario.percentileDialog.entity.mid": "中度", |
|||
"engine.st.scenario.percentileDialog.entity.high": "重度", |
|||
|
|||
"engine.st.testCase.grid.title": "测试用例", |
|||
"engine.st.testCase.grid.toolbar.scenario": "压力情景", |
|||
"engine.st.testCase.grid.entity.model": "压力测试传导模型", |
|||
"engine.st.testCase.grid.toolbar.test": "测试", |
|||
"engine.st.testCase.grid.toolbar.viewResult": "查看测试结果", |
|||
"engine.st.testCase.grid.entity.periodType": "周期", |
|||
|
|||
"engine.st.scenario.dialog.title": "压力测试情景设置", |
|||
"engine.st.scenario.grid.title": "压力测试情景指标", |
|||
"engine.st.scenario.grid.entity.testCase": "测试用例", |
|||
"engine.st.scenario.grid.entity.indicator": "压力测试情景指标", |
|||
"engine.st.scenario.grid.entity.lowGrade": "轻度", |
|||
"engine.st.scenario.grid.entity.midGrade": "中度", |
|||
"engine.st.scenario.grid.entity.highGrade": "重度", |
|||
|
|||
"engine.st.testResult.grid.title": "预测结果", |
|||
|
|||
} |
@ -0,0 +1,35 @@ |
|||
<template> |
|||
<q-splitter :model-value="70" class="w-full" style="height: 100%"> |
|||
<template #before> |
|||
<div class="pr-1" style="height: 100%"> |
|||
<DepFactorDefine |
|||
ref="factorDefineTreeGridRef" |
|||
@row-click=" |
|||
(evt, row, index) => { |
|||
currentSelectedFactorDefineRef = row; |
|||
factorGridRef.refresh(); |
|||
} |
|||
" |
|||
@before-request-data=" |
|||
() => { |
|||
currentSelectedFactorDefineRef = {}; |
|||
factorGridRef.refresh(); |
|||
} |
|||
" |
|||
></DepFactorDefine> |
|||
</div> |
|||
</template> |
|||
<template #after> |
|||
<DepFactor ref="factorGridRef" :factor-define="currentSelectedFactorDefineRef"></DepFactor> |
|||
</template> |
|||
</q-splitter> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { ref } from 'vue'; |
|||
import DepFactorDefine from './DepFactorDefine.vue'; |
|||
import DepFactor from './DepFactor.vue'; |
|||
|
|||
const factorDefineTreeGridRef = ref(); |
|||
const currentSelectedFactorDefineRef = ref(); |
|||
const factorGridRef = ref(); |
|||
</script> |
@ -0,0 +1,189 @@ |
|||
<template> |
|||
<q-splitter :model-value="70" horizontal class="w-full" style="height: 100%"> |
|||
<template #before> |
|||
<div class="pl-1" style="height: 100%"> |
|||
<w-grid |
|||
ref="gridRef" |
|||
:title="$t('data')" |
|||
dense |
|||
:checkbox-selection="true" |
|||
:fetch-data-url="Environment.apiContextPath('/api/st/indepFactor?defineId=' + factorDefine.id)" |
|||
:data-url="Environment.apiContextPath('/api/st/indepFactor')" |
|||
:pageable="false" |
|||
:sort-by="['year', 'quarter', 'month', 'day']" |
|||
:query-form-cols-num="4" |
|||
:query-form-fields="[]" |
|||
:toolbar-actions="[ |
|||
'refresh', |
|||
'separator', |
|||
{ |
|||
extend: 'add', |
|||
enableIf: () => { |
|||
return factorDefine.type === 'ORIGINAL'; |
|||
}, |
|||
}, |
|||
{ |
|||
extend: 'clone', |
|||
enableIf: () => { |
|||
return factorDefine.type === 'ORIGINAL'; |
|||
}, |
|||
}, |
|||
{ |
|||
extend: 'edit', |
|||
enableIf: () => { |
|||
return factorDefine.type === 'ORIGINAL'; |
|||
}, |
|||
}, |
|||
{ |
|||
extend: 'remove', |
|||
enableIf: () => { |
|||
return factorDefine.type === 'ORIGINAL'; |
|||
}, |
|||
}, |
|||
'separator', |
|||
'view', |
|||
'separator', |
|||
'export', |
|||
]" |
|||
:columns="[ |
|||
{ width: 60, name: 'year', label: t('year'), align: 'right' }, |
|||
{ width: 60, name: 'quarter', label: t('quarter'), align: 'right' }, |
|||
{ width: 60, name: 'month', label: t('month'), align: 'right' }, |
|||
{ width: 150, name: 'value', label: t('value') }, |
|||
]" |
|||
:editor="{ |
|||
dialog: { |
|||
width: '600px', |
|||
}, |
|||
form: { |
|||
colsNum: 1, |
|||
fields: [ |
|||
{ |
|||
name: 'factorType', |
|||
label: $t('factorType'), |
|||
type: 'text', |
|||
defaultValue: factorDefine.id, |
|||
hidden: true, |
|||
}, |
|||
{ name: 'year', label: $t('year'), type: 'number', required: true }, |
|||
{ |
|||
name: 'quarter', |
|||
label: $t('quarter'), |
|||
type: 'number', |
|||
required: true, |
|||
showIf: () => { |
|||
return factorDefine.period === 'QUARTER'; |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'month', |
|||
label: $t('month'), |
|||
type: 'number', |
|||
required: true, |
|||
showIf: () => { |
|||
return factorDefine.period === 'MONTH'; |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'day', |
|||
label: $t('day'), |
|||
type: 'number', |
|||
required: true, |
|||
showIf: () => { |
|||
return factorDefine.period === 'DAY'; |
|||
}, |
|||
}, |
|||
{ name: 'value', label: $t('value'), type: 'text', required: true }, |
|||
], |
|||
}, |
|||
}" |
|||
:viewer="{ |
|||
panel: { |
|||
columnNum: 1, |
|||
fields: [ |
|||
{ name: 'id', label: $t('id') }, |
|||
{ name: 'define', label: $t('engine.st.indepFactorDefine.grid.entity.factorDefine') }, |
|||
{ name: 'year', label: $t('year') }, |
|||
{ name: 'quarter', label: $t('quarter') }, |
|||
{ name: 'month', label: $t('month') }, |
|||
{ name: 'value', label: $t('value') }, |
|||
{ name: 'dataComeFrom', label: $t('dataComeFrom') }, |
|||
{ name: 'creator', label: $t('creator') }, |
|||
{ name: 'createDate', label: $t('createDate') }, |
|||
{ name: 'lastModifier', label: $t('lastModifier') }, |
|||
{ name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.none() }, |
|||
{ name: 'corporationCode', label: $t('corporationCode') }, |
|||
], |
|||
}, |
|||
}" |
|||
@after-request-data=" |
|||
() => { |
|||
const rows = gridRef.getRows(); |
|||
const xAxisData = []; |
|||
const seriesData = []; |
|||
for (const row of rows) { |
|||
xAxisData.push(row.year + (row.month ? '-' + row.month : '')); |
|||
seriesData.push(row.value); |
|||
} |
|||
echartsOptionRef = { |
|||
title: { |
|||
text: factorDefine.name, |
|||
left: 'center', |
|||
}, |
|||
xAxis: { |
|||
type: 'category', |
|||
name: $t('period'), |
|||
data: xAxisData, |
|||
}, |
|||
yAxis: { |
|||
type: 'value', |
|||
name: $t('value'), |
|||
}, |
|||
series: [ |
|||
{ |
|||
data: seriesData, |
|||
type: 'line', |
|||
smooth: true, |
|||
}, |
|||
], |
|||
}; |
|||
} |
|||
" |
|||
></w-grid> |
|||
</div> |
|||
</template> |
|||
<template #after> |
|||
<w-echarts ref="factorEcharts" style="width: 100%; height: 100%" :option="echartsOptionRef"></w-echarts> |
|||
</template> |
|||
</q-splitter> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { ref, computed, onUpdated } from 'vue'; |
|||
import { useI18n } from 'vue-i18n'; |
|||
import { Environment, Formater } from 'platform-core'; |
|||
|
|||
const props = defineProps({ |
|||
factorDefine: { |
|||
type: Object, |
|||
default: () => { |
|||
return {}; |
|||
}, |
|||
}, |
|||
}); |
|||
|
|||
const { t } = useI18n(); |
|||
const gridRef = ref(); |
|||
const echartsOptionRef = ref(); |
|||
|
|||
const refresh = () => { |
|||
gridRef.value.refresh(); |
|||
}; |
|||
|
|||
onUpdated(() => { |
|||
gridRef.value.refresh(); |
|||
}); |
|||
|
|||
defineExpose({ |
|||
refresh, |
|||
}); |
|||
</script> |
@ -0,0 +1,257 @@ |
|||
<template> |
|||
<w-grid |
|||
ref="treeGridRef" |
|||
:title="$t('engine.st.indepFactorDefine.grid.title')" |
|||
dense |
|||
:checkbox-selection="false" |
|||
:tree="true" |
|||
:tree-icon=" |
|||
(row) => { |
|||
if (row.type === 'FOLDER') { |
|||
return { name: 'folder', color: 'amber' }; |
|||
} else if (row.type === 'ORIGINAL') { |
|||
return { name: 'bi-file-earmark-text' }; |
|||
} else if (row.type === 'EXTEND_ARITHMETIC') { |
|||
return { name: 'bi-file-earmark-text', color: 'green' }; |
|||
} else if (row.type === 'EXTEND_DELAY') { |
|||
return { name: 'bi-file-earmark-text', color: 'blue' }; |
|||
} else if (row.type === 'EXTEND_DIFFERENTIAL') { |
|||
return { name: 'bi-file-earmark-text', color: 'amber' }; |
|||
} else { |
|||
return { name: 'bi-file-earmark-text' }; |
|||
} |
|||
} |
|||
" |
|||
:data-url="Environment.apiContextPath('/api/st/indepFactorDefine')" |
|||
:pageable="false" |
|||
:sort-by="['order']" |
|||
:toolbar-actions="[ |
|||
'refresh', |
|||
'separator', |
|||
'expand', |
|||
'separator', |
|||
[ |
|||
{ |
|||
name: '_add', |
|||
label: $t('add'), |
|||
icon: 'add', |
|||
click: undefined, |
|||
}, |
|||
{ |
|||
extend: 'addTop', |
|||
label: $t('engine.st.indepFactorDefine.grid.toolbar.addTop'), |
|||
enableIf: (arg) => { |
|||
return true; |
|||
}, |
|||
afterClick: (arg) => { |
|||
arg.grid.getEditorForm().setFieldValue('type', 'FOLDER'); |
|||
}, |
|||
}, |
|||
{ |
|||
extend: 'addChild', |
|||
label: $t('engine.st.indepFactorDefine.grid.toolbar.addChild'), |
|||
enableIf: (arg) => { |
|||
return arg.selected && arg.selected.type === 'FOLDER'; |
|||
}, |
|||
afterClick: (arg) => { |
|||
arg.grid.getEditorForm().setFieldValue('type', 'FOLDER'); |
|||
}, |
|||
}, |
|||
'separator', |
|||
{ |
|||
extend: 'addChild', |
|||
name: 'addFactorDefine', |
|||
label: $t('engine.st.indepFactorDefine.grid.toolbar.addFactorDefine'), |
|||
enableIf: (arg) => { |
|||
return arg.selected && arg.selected.type === 'FOLDER'; |
|||
}, |
|||
afterClick: (arg) => { |
|||
arg.grid.getEditorForm().setFieldValue('type', 'ORIGINAL'); |
|||
}, |
|||
}, |
|||
], |
|||
'clone', |
|||
'edit', |
|||
'remove', |
|||
'separator', |
|||
'view', |
|||
'separator', |
|||
'export', |
|||
]" |
|||
:columns="[ |
|||
{ width: 160, name: 'name', label: $t('name') }, |
|||
{ width: 150, name: 'code', label: $t('code') }, |
|||
{ |
|||
width: 100, |
|||
name: 'type', |
|||
label: $t('type'), |
|||
format: (value, row) => { |
|||
if (value === 'FOLDER') { |
|||
return ''; |
|||
} |
|||
return Formater.enum(Enums.FactorDefineType)(value); |
|||
}, |
|||
}, |
|||
{ width: 60, name: 'period', label: $t('period'), format: Formater.enum(Enums.Period) }, |
|||
{ width: 70, name: 'valueType', label: $t('valueType'), format: Formater.enum(Enums.ValueType) }, |
|||
]" |
|||
:editor="{ |
|||
dialog: { |
|||
width: '500px', |
|||
}, |
|||
form: { |
|||
colsNum: 1, |
|||
fields: [ |
|||
{ |
|||
name: 'type', |
|||
label: $t('type'), |
|||
type: 'select', |
|||
required: true, |
|||
options: Options.enum(Enums.FactorDefineType), |
|||
onChange: (arg) => { |
|||
findAllWithoutById(arg.form.getFieldValue('id')); |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'code', |
|||
label: $t('code'), |
|||
type: 'text', |
|||
required: true, |
|||
showIf: (arg) => { |
|||
return arg.form.getFieldValue('type') !== 'FOLDER'; |
|||
}, |
|||
}, |
|||
{ name: 'name', label: $t('name'), type: 'text', required: true }, |
|||
{ name: 'description', label: $t('description'), type: 'text' }, |
|||
{ name: 'order', label: $t('order'), type: 'number' }, |
|||
{ |
|||
name: 'period', |
|||
label: $t('period'), |
|||
required: true, |
|||
type: 'select', |
|||
options: Options.enum(Enums.Period), |
|||
showIf: (arg) => { |
|||
return arg.form.getFieldValue('type') !== 'FOLDER'; |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'valueType', |
|||
label: $t('valueType'), |
|||
required: true, |
|||
type: 'select', |
|||
options: Options.enum(Enums.ValueType), |
|||
showIf: (arg) => { |
|||
return arg.form.getFieldValue('type') !== 'FOLDER'; |
|||
}, |
|||
}, |
|||
|
|||
{ |
|||
name: 'formula', |
|||
label: $t('engine.st.indepFactorDefine.grid.entity.formula'), |
|||
type: 'code-mirror', |
|||
required: true, |
|||
showIf: (arg) => { |
|||
return arg.form.getFieldValue('type') === 'EXTEND_ARITHMETIC'; |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'delayFactorDefine', |
|||
label: $t('engine.st.indepFactorDefine.grid.entity.delayFactorDefine'), |
|||
type: 'select', |
|||
options: factorDefineOptionsRef, |
|||
required: true, |
|||
showIf: (arg) => { |
|||
return arg.form.getFieldValue('type') === 'EXTEND_DELAY'; |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'delayIssue', |
|||
label: $t('engine.st.indepFactorDefine.grid.entity.delayIssue'), |
|||
type: 'number', |
|||
required: true, |
|||
showIf: (arg) => { |
|||
return arg.form.getFieldValue('type') === 'EXTEND_DELAY'; |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'differentialFactorDefine', |
|||
label: $t('engine.st.indepFactorDefine.grid.entity.differentialFactorDefine'), |
|||
type: 'select', |
|||
options: factorDefineOptionsRef, |
|||
required: true, |
|||
showIf: (arg) => { |
|||
return arg.form.getFieldValue('type') === 'EXTEND_DIFFERENTIAL'; |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'differentialDegree', |
|||
label: $t('engine.st.indepFactorDefine.grid.entity.differentialDegree'), |
|||
type: 'number', |
|||
required: true, |
|||
showIf: (arg) => { |
|||
return arg.form.getFieldValue('type') === 'EXTEND_DIFFERENTIAL'; |
|||
}, |
|||
}, |
|||
], |
|||
}, |
|||
}" |
|||
:viewer="{ |
|||
panel: { |
|||
columnNum: 1, |
|||
fields: [ |
|||
{ name: 'id', label: $t('id') }, |
|||
{ name: 'type', label: $t('type') }, |
|||
{ name: 'period', label: $t('period') }, |
|||
{ name: 'code', label: $t('code') }, |
|||
{ name: 'name', label: $t('name') }, |
|||
{ name: 'description', label: $t('description') }, |
|||
{ name: 'order', label: $t('order') }, |
|||
{ name: 'valueType', label: $t('valueType') }, |
|||
|
|||
{ name: 'formula', label: $t('engine.st.indepFactorDefine.grid.entity.formula') }, |
|||
{ name: 'delayFactorDefine', label: $t('engine.st.indepFactorDefine.grid.entity.delayFactorDefine') }, |
|||
{ name: 'delayIssue', label: $t('engine.st.indepFactorDefine.grid.entity.delayIssue') }, |
|||
{ name: 'differentialFactorDefine', label: $t('engine.st.indepFactorDefine.grid.entity.differentialFactorDefine') }, |
|||
{ name: 'differentialDegree', label: $t('engine.st.indepFactorDefine.grid.entity.differentialDegree') }, |
|||
|
|||
{ name: 'dataComeFrom', label: $t('dataComeFrom') }, |
|||
{ name: 'creator', label: $t('creator') }, |
|||
{ name: 'createDate', label: $t('createDate') }, |
|||
{ name: 'lastModifier', label: $t('lastModifier') }, |
|||
{ name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.none() }, |
|||
{ name: 'corporationCode', label: $t('corporationCode') }, |
|||
], |
|||
}, |
|||
}" |
|||
@after-editor-open=" |
|||
(selected) => { |
|||
if (selected?.type === 'EXTEND_DELAY' || selected?.type === 'EXTEND_DIFFERENTIAL') { |
|||
findAllWithoutById(selected.id); |
|||
} |
|||
} |
|||
" |
|||
></w-grid> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { ref } from 'vue'; |
|||
import { Environment, Formater, Options, EnumTools, axios } from 'platform-core'; |
|||
|
|||
const treeGridRef = ref(); |
|||
const factorDefineOptionsRef = ref([]); |
|||
const Enums = await EnumTools.fetch(['io.sc.engine.st.enums.FactorDefineType', 'io.sc.engine.st.enums.Period', 'io.sc.engine.st.enums.ValueType']); |
|||
const findAllWithoutById = (id) => { |
|||
axios.get(Environment.apiContextPath('/api/st/indepFactorDefine/findAllWithoutById?defineId=' + (id ? id : ''))).then((response) => { |
|||
const defines = response?.data; |
|||
if (defines) { |
|||
const options = []; |
|||
for (const define of defines) { |
|||
if (define.type !== 'FOLDER') { |
|||
options.push({ value: define.id, label: define.name }); |
|||
} |
|||
} |
|||
console.log(factorDefineOptionsRef.value); |
|||
factorDefineOptionsRef.value = options; |
|||
} |
|||
}); |
|||
}; |
|||
</script> |
@ -0,0 +1,35 @@ |
|||
<template> |
|||
<q-splitter :model-value="70" class="w-full" style="height: 100%"> |
|||
<template #before> |
|||
<div class="pr-1" style="height: 100%"> |
|||
<IndepFactorDefine |
|||
ref="factorDefineTreeGridRef" |
|||
@row-click=" |
|||
(evt, row, index) => { |
|||
currentSelectedFactorDefineRef = row; |
|||
factorGridRef.refresh(); |
|||
} |
|||
" |
|||
@before-request-data=" |
|||
() => { |
|||
currentSelectedFactorDefineRef = {}; |
|||
factorGridRef.refresh(); |
|||
} |
|||
" |
|||
></IndepFactorDefine> |
|||
</div> |
|||
</template> |
|||
<template #after> |
|||
<IndepFactor ref="factorGridRef" :factor-define="currentSelectedFactorDefineRef"></IndepFactor> |
|||
</template> |
|||
</q-splitter> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { ref } from 'vue'; |
|||
import IndepFactorDefine from './IndepFactorDefine.vue'; |
|||
import IndepFactor from './IndepFactor.vue'; |
|||
|
|||
const factorDefineTreeGridRef = ref(); |
|||
const currentSelectedFactorDefineRef = ref(); |
|||
const factorGridRef = ref(); |
|||
</script> |
@ -1,4 +0,0 @@ |
|||
<template> |
|||
<div>Indicator</div> |
|||
</template> |
|||
<script setup lang="ts"></script> |
@ -0,0 +1,35 @@ |
|||
<template> |
|||
<q-splitter :model-value="60" class="w-full" style="height: 100%"> |
|||
<template #before> |
|||
<div class="pr-1" style="height: 100%"> |
|||
<ScenarioFactorDefine |
|||
ref="factorDefineTreeGridRef" |
|||
@row-click=" |
|||
(evt, row, index) => { |
|||
currentSelectedFactorDefineRef = row; |
|||
factorGridRef.refresh(); |
|||
} |
|||
" |
|||
@before-request-data=" |
|||
() => { |
|||
currentSelectedFactorDefineRef = {}; |
|||
factorGridRef.refresh(); |
|||
} |
|||
" |
|||
></ScenarioFactorDefine> |
|||
</div> |
|||
</template> |
|||
<template #after> |
|||
<ScenarioFactor ref="factorGridRef" :factor-define="currentSelectedFactorDefineRef"></ScenarioFactor> |
|||
</template> |
|||
</q-splitter> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { ref } from 'vue'; |
|||
import ScenarioFactorDefine from './ScenarioFactorDefine.vue'; |
|||
import ScenarioFactor from './ScenarioFactor.vue'; |
|||
|
|||
const factorDefineTreeGridRef = ref(); |
|||
const currentSelectedFactorDefineRef = ref(); |
|||
const factorGridRef = ref(); |
|||
</script> |
@ -0,0 +1,40 @@ |
|||
<template> |
|||
<q-splitter :model-value="60" class="w-full" style="height: 100%"> |
|||
<template #before> |
|||
<div class="pr-1" style="height: 100%"> |
|||
<TestCase |
|||
ref="factorDefineTreeGridRef" |
|||
@row-click=" |
|||
(evt, row, index) => { |
|||
currentSelectedFactorDefineRef = row; |
|||
factorGridRef.refresh(); |
|||
} |
|||
" |
|||
@before-request-data=" |
|||
() => { |
|||
currentSelectedFactorDefineRef = {}; |
|||
factorGridRef.refresh(); |
|||
} |
|||
" |
|||
@after-test=" |
|||
() => { |
|||
factorGridRef.refresh(); |
|||
} |
|||
" |
|||
></TestCase> |
|||
</div> |
|||
</template> |
|||
<template #after> |
|||
<TestResult ref="factorGridRef" :factor-define="currentSelectedFactorDefineRef"></TestResult> |
|||
</template> |
|||
</q-splitter> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { ref } from 'vue'; |
|||
import TestCase from './TestCase.vue'; |
|||
import TestResult from './TestResult.vue'; |
|||
|
|||
const factorDefineTreeGridRef = ref(); |
|||
const currentSelectedFactorDefineRef = ref(); |
|||
const factorGridRef = ref(); |
|||
</script> |
@ -0,0 +1,20 @@ |
|||
package io.sc.engine.st.controller; |
|||
|
|||
import io.sc.engine.st.jpa.entity.IndepFactorDefineEntity; |
|||
import io.sc.engine.st.jpa.repository.IndepFactorDefineRepository; |
|||
import io.sc.engine.st.service.IndepFactorDefineService; |
|||
import io.sc.engine.st.vo.IndepFactorDefineVo; |
|||
import io.sc.platform.mvc.controller.support.RestCrudController; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
@RestController("io.sc.engine.st.controller.IndepFactorDefineWebController") |
|||
@RequestMapping("/api/st/indepFactorDefine") |
|||
public class IndepFactorDefineWebController extends RestCrudController<IndepFactorDefineVo, IndepFactorDefineEntity,String, IndepFactorDefineRepository, IndepFactorDefineService> { |
|||
|
|||
@GetMapping("findAllWithoutById") |
|||
public List<IndepFactorDefineVo> findAllWithoutById(@RequestParam(name="defineId",required = false)String defineId) throws Exception { |
|||
return service.findAllWithoutById(defineId); |
|||
} |
|||
} |
@ -0,0 +1,29 @@ |
|||
package io.sc.engine.st.controller; |
|||
|
|||
import io.sc.engine.st.jpa.entity.IndepFactorEntity; |
|||
import io.sc.engine.st.jpa.repository.IndepFactorRepository; |
|||
import io.sc.engine.st.service.IndepFactorService; |
|||
import io.sc.engine.st.vo.IndepFactorVo; |
|||
import io.sc.platform.core.util.StringUtil; |
|||
import io.sc.platform.mvc.controller.support.RestCrudController; |
|||
import io.sc.platform.orm.service.support.QueryParameter; |
|||
import io.sc.platform.orm.service.support.QueryResult; |
|||
import org.springframework.data.domain.Page; |
|||
import org.springframework.util.StringUtils; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestParam; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import javax.servlet.http.HttpServletRequest; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.List; |
|||
|
|||
@RestController("io.sc.engine.st.controller.IndepFactorWebController") |
|||
@RequestMapping("/api/st/indepFactor") |
|||
public class IndepFactorWebController extends RestCrudController<IndepFactorVo, IndepFactorEntity,String, IndepFactorRepository, IndepFactorService> { |
|||
@Override |
|||
protected Page<IndepFactorVo> query(HttpServletRequest request, HttpServletResponse response, QueryParameter queryParameter) throws Exception { |
|||
String defineId =request.getParameter("defineId"); |
|||
return QueryResult.page(service.findByFactorDefineId(defineId)); |
|||
} |
|||
} |
@ -0,0 +1,9 @@ |
|||
package io.sc.engine.st.enums; |
|||
|
|||
/** |
|||
* 模型算法 |
|||
*/ |
|||
public enum ModelAlgorithm { |
|||
LINEAR_REGRESSION, //线性回归
|
|||
VAR; //向量自回归模型
|
|||
} |
@ -0,0 +1,208 @@ |
|||
package io.sc.engine.st.jpa.entity; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
|||
import com.fasterxml.jackson.annotation.JsonSubTypes; |
|||
import com.fasterxml.jackson.annotation.JsonTypeInfo; |
|||
import io.sc.engine.st.enums.FactorDefineType; |
|||
import io.sc.engine.st.enums.Period; |
|||
import io.sc.engine.st.enums.ValueType; |
|||
import io.sc.engine.st.jpa.entity.sub.*; |
|||
import io.sc.engine.st.vo.IndepFactorDefineVo; |
|||
import io.sc.platform.core.util.DateUtil; |
|||
import io.sc.platform.orm.api.validator.ValidatorMessage; |
|||
import io.sc.platform.orm.api.validator.ValidatorRegExp; |
|||
import io.sc.platform.orm.entity.CorporationAuditorEntity; |
|||
import org.hibernate.annotations.GenericGenerator; |
|||
|
|||
import javax.persistence.*; |
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.Pattern; |
|||
import javax.validation.constraints.Size; |
|||
import java.math.BigDecimal; |
|||
import java.text.ParseException; |
|||
import java.util.ArrayList; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
@Entity(name="io.sc.engine.st.jpa.entity.IndepFactorDefineEntity") |
|||
@Table(name="ST_INDEP_FACTOR_DEF") |
|||
@Inheritance(strategy = InheritanceType.SINGLE_TABLE) |
|||
@DiscriminatorColumn(name="TYPE_",discriminatorType=DiscriminatorType.STRING,length=20) |
|||
@JsonIgnoreProperties(ignoreUnknown=true) |
|||
@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=JsonTypeInfo.As.PROPERTY, property="type",visible=true,defaultImpl = IndepFolderEntity.class ) |
|||
@JsonSubTypes({ |
|||
@JsonSubTypes.Type(value = IndepFolderEntity.class, name = "FOLDER"), |
|||
@JsonSubTypes.Type(value = IndepOriginalFactorDefineEntity.class, name = "ORIGINAL"), |
|||
@JsonSubTypes.Type(value = IndepArithmeticFactorDefineEntity.class, name = "EXTEND_ARITHMETIC"), |
|||
@JsonSubTypes.Type(value = IndepDelayFactorDefineEntity.class, name = "EXTEND_DELAY"), |
|||
@JsonSubTypes.Type(value = IndepDifferentialFactorDefineEntity.class, name = "EXTEND_DIFFERENTIAL") |
|||
}) |
|||
public class IndepFactorDefineEntity extends CorporationAuditorEntity<IndepFactorDefineVo> { |
|||
@Id |
|||
@GeneratedValue(generator = "system-uuid") |
|||
@GenericGenerator(name = "system-uuid", strategy = "uuid2") |
|||
@Column(name="ID_", length=36) |
|||
@Size(max=36) |
|||
protected String id; |
|||
|
|||
// 类型
|
|||
@Column(name="TYPE_",insertable=false,updatable=false) |
|||
@Enumerated(EnumType.STRING) |
|||
protected FactorDefineType type; |
|||
|
|||
// 代码
|
|||
@Column(name="CODE_", length=255) |
|||
@Size(max=255) |
|||
@Pattern(regexp = ValidatorRegExp.ID,message = ValidatorMessage.ID) |
|||
protected String code; |
|||
|
|||
// 名称
|
|||
@Column(name="NAME_", length=255) |
|||
@NotBlank |
|||
@Size(max=255) |
|||
protected String name; |
|||
|
|||
// 描述
|
|||
@Column(name="DESCRIPTION_", length=255) |
|||
@Size(max=255) |
|||
protected String description; |
|||
|
|||
// 顺序
|
|||
@Column(name="ORDER_") |
|||
protected Integer order; |
|||
|
|||
// 周期
|
|||
@Column(name="PERIOD_", length=20) |
|||
@Enumerated(EnumType.STRING) |
|||
protected Period period; |
|||
|
|||
// 值类型
|
|||
@Column(name="VALUE_TYPE_", length=20) |
|||
@Enumerated(EnumType.STRING) |
|||
protected ValueType valueType; |
|||
|
|||
// 父
|
|||
@ManyToOne(fetch = FetchType.LAZY) |
|||
@JoinColumn(name = "PARENT_ID_") |
|||
protected IndepFactorDefineEntity parent; |
|||
|
|||
@OneToMany(mappedBy="define",fetch = FetchType.LAZY) |
|||
@OrderBy("year,quarter,month") |
|||
protected List<IndepFactorEntity> factors =new ArrayList<>(); |
|||
|
|||
|
|||
public Object convertValue(String value) throws ParseException { |
|||
if(value==null){ |
|||
return null; |
|||
} |
|||
switch (valueType){ |
|||
case NUMERIC: |
|||
return new BigDecimal(value); |
|||
case STRING: |
|||
return value; |
|||
case DATE: |
|||
return DateUtil.tryParseDate(value); |
|||
default: |
|||
return value; |
|||
} |
|||
} |
|||
@Override |
|||
public void toVo(IndepFactorDefineVo vo) { |
|||
if(vo!=null){ |
|||
vo.setType(this.getType()); |
|||
vo.setId(this.getId()); |
|||
vo.setCode(this.getCode()); |
|||
vo.setName(this.getName()); |
|||
vo.setDescription(this.getDescription()); |
|||
vo.setOrder(this.getOrder()); |
|||
vo.setPeriod(this.getPeriod()); |
|||
vo.setValueType(this.getValueType()); |
|||
vo.setParent(this.getParent()==null?null:this.getParent().getId()); |
|||
} |
|||
} |
|||
|
|||
public IndepFactorDefineEntity(){} |
|||
public IndepFactorDefineEntity(String id){ |
|||
this.id =id; |
|||
} |
|||
|
|||
public String getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(String id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public FactorDefineType getType() { |
|||
return type; |
|||
} |
|||
|
|||
public void setType(FactorDefineType type) { |
|||
this.type = type; |
|||
} |
|||
|
|||
public String getCode() { |
|||
return code; |
|||
} |
|||
|
|||
public void setCode(String code) { |
|||
this.code = code; |
|||
} |
|||
|
|||
public String getName() { |
|||
return name; |
|||
} |
|||
|
|||
public void setName(String name) { |
|||
this.name = name; |
|||
} |
|||
|
|||
public String getDescription() { |
|||
return description; |
|||
} |
|||
|
|||
public void setDescription(String description) { |
|||
this.description = description; |
|||
} |
|||
|
|||
public Integer getOrder() { |
|||
return order; |
|||
} |
|||
|
|||
public void setOrder(Integer order) { |
|||
this.order = order; |
|||
} |
|||
|
|||
public Period getPeriod() { |
|||
return period; |
|||
} |
|||
|
|||
public void setPeriod(Period period) { |
|||
this.period = period; |
|||
} |
|||
|
|||
public ValueType getValueType() { |
|||
return valueType; |
|||
} |
|||
|
|||
public void setValueType(ValueType valueType) { |
|||
this.valueType = valueType; |
|||
} |
|||
|
|||
public IndepFactorDefineEntity getParent() { |
|||
return parent; |
|||
} |
|||
|
|||
public void setParent(IndepFactorDefineEntity parent) { |
|||
this.parent = parent; |
|||
} |
|||
|
|||
public List<IndepFactorEntity> getFactors() { |
|||
return factors; |
|||
} |
|||
|
|||
public void setFactors(List<IndepFactorEntity> factors) { |
|||
this.factors = factors; |
|||
} |
|||
} |
@ -0,0 +1,119 @@ |
|||
package io.sc.engine.st.jpa.entity; |
|||
|
|||
import io.sc.engine.st.support.PeriodWrapper; |
|||
import io.sc.engine.st.vo.IndepFactorVo; |
|||
import io.sc.platform.orm.entity.CorporationAuditorEntity; |
|||
import org.hibernate.annotations.GenericGenerator; |
|||
|
|||
import javax.persistence.*; |
|||
import javax.validation.constraints.Size; |
|||
|
|||
@Entity(name="io.sc.engine.st.jpa.entity.IndepFactorEntity") |
|||
@Table(name="ST_INDEP_FACTOR") |
|||
public class IndepFactorEntity extends CorporationAuditorEntity<IndepFactorVo> { |
|||
@Id |
|||
@GeneratedValue(generator = "system-uuid") |
|||
@GenericGenerator(name = "system-uuid", strategy = "uuid2") |
|||
@Column(name="ID_", length=36) |
|||
@Size(max=36) |
|||
protected String id; |
|||
|
|||
@Column(name="YEAR_") |
|||
protected Integer year; |
|||
|
|||
@Column(name="QUARTER_") |
|||
protected Integer quarter; |
|||
|
|||
@Column(name="MONTH_") |
|||
protected Integer month; |
|||
|
|||
@Column(name="VALUE_", length=255) |
|||
@Size(max=255) |
|||
protected String value; |
|||
|
|||
@ManyToOne(fetch=FetchType.LAZY) |
|||
@JoinColumn(name="DEF_ID_") |
|||
protected IndepFactorDefineEntity define; |
|||
|
|||
public PeriodWrapper calUniqueKey(){ |
|||
if(define==null){ |
|||
return new PeriodWrapper(null,null,null); |
|||
} |
|||
switch (define.getPeriod()){ |
|||
case YEAR: |
|||
return new PeriodWrapper(year,null,null); |
|||
case QUARTER: |
|||
return new PeriodWrapper(year,quarter,null); |
|||
case MONTH: |
|||
return new PeriodWrapper(year,quarter,month); |
|||
default: |
|||
return new PeriodWrapper(null,null,null); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public IndepFactorVo toVo() { |
|||
IndepFactorVo vo =new IndepFactorVo(); |
|||
super.toVo(vo); |
|||
vo.setId(this.getId()); |
|||
vo.setYear(this.getYear()); |
|||
vo.setQuarter(this.getQuarter()); |
|||
vo.setMonth(this.getMonth()); |
|||
vo.setValue(this.getValue()); |
|||
vo.setDefine(this.getDefine()==null?null:this.getDefine().getId()); |
|||
return vo; |
|||
} |
|||
|
|||
public IndepFactorEntity(){} |
|||
public IndepFactorEntity(String id){ |
|||
this.id =id; |
|||
} |
|||
|
|||
public String getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(String id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public Integer getYear() { |
|||
return year; |
|||
} |
|||
|
|||
public void setYear(Integer year) { |
|||
this.year = year; |
|||
} |
|||
|
|||
public Integer getQuarter() { |
|||
return quarter; |
|||
} |
|||
|
|||
public void setQuarter(Integer quarter) { |
|||
this.quarter = quarter; |
|||
} |
|||
|
|||
public Integer getMonth() { |
|||
return month; |
|||
} |
|||
|
|||
public void setMonth(Integer month) { |
|||
this.month = month; |
|||
} |
|||
|
|||
public String getValue() { |
|||
return value; |
|||
} |
|||
|
|||
public void setValue(String value) { |
|||
this.value = value; |
|||
} |
|||
|
|||
public IndepFactorDefineEntity getDefine() { |
|||
return define; |
|||
} |
|||
|
|||
public void setDefine(IndepFactorDefineEntity define) { |
|||
this.define = define; |
|||
} |
|||
} |
@ -0,0 +1,120 @@ |
|||
package io.sc.engine.st.jpa.entity; |
|||
|
|||
import io.sc.engine.st.vo.ModelAnalysisFactorVo; |
|||
import io.sc.platform.orm.entity.BaseEntity; |
|||
import org.hibernate.annotations.GenericGenerator; |
|||
|
|||
import javax.persistence.*; |
|||
import javax.validation.constraints.Size; |
|||
|
|||
/** |
|||
* 回归分析结果实体类 |
|||
*/ |
|||
@Entity(name="io.sc.engine.st.jpa.entity.ModelAnalysisFactorEntity") |
|||
@Table(name="ST_MODEL_ANALYSIS_FACTOR") |
|||
public class ModelAnalysisFactorEntity extends BaseEntity<ModelAnalysisFactorVo> { |
|||
@Id |
|||
@GeneratedValue(generator = "system-uuid") |
|||
@GenericGenerator(name = "system-uuid", strategy = "uuid2") |
|||
@Column(name="ID_", length=36) |
|||
@Size(max=36) |
|||
protected String id; |
|||
|
|||
@ManyToOne(fetch=FetchType.LAZY) |
|||
@JoinColumn(name="MODEL_ID_") |
|||
protected ModelEntity model; |
|||
|
|||
@Column(name="ORDER_") |
|||
protected Integer order; |
|||
|
|||
// 变量
|
|||
@Column(name="VARIABLE_") |
|||
protected String variable; |
|||
|
|||
// 回归系数
|
|||
@Column(name="COEFFICIENT_") |
|||
protected Double coefficient; |
|||
|
|||
// 回归系数的标准误差
|
|||
@Column(name="COEFFICIENT_SE_") |
|||
protected Double coefficientSe; |
|||
|
|||
// t 检验值
|
|||
@Column(name="T_") |
|||
protected Double t; |
|||
|
|||
@Override |
|||
public ModelAnalysisFactorVo toVo() { |
|||
ModelAnalysisFactorVo vo =new ModelAnalysisFactorVo(); |
|||
super.toVo(vo); |
|||
vo.setId(this.getId()); |
|||
vo.setModel(this.getModel()==null?null:this.getModel().getId()); |
|||
vo.setOrder(this.getOrder()); |
|||
vo.setVariable(this.getVariable()); |
|||
vo.setCoefficient(this.getCoefficient()); |
|||
vo.setCoefficientSe(this.getCoefficientSe()); |
|||
vo.setT(this.getT()); |
|||
return vo; |
|||
} |
|||
|
|||
public ModelAnalysisFactorEntity(){} |
|||
public ModelAnalysisFactorEntity(String id){ |
|||
this.id =id; |
|||
} |
|||
|
|||
public String getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(String id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public ModelEntity getModel() { |
|||
return model; |
|||
} |
|||
|
|||
public void setModel(ModelEntity model) { |
|||
this.model = model; |
|||
} |
|||
|
|||
public Integer getOrder() { |
|||
return order; |
|||
} |
|||
|
|||
public void setOrder(Integer order) { |
|||
this.order = order; |
|||
} |
|||
|
|||
public String getVariable() { |
|||
return variable; |
|||
} |
|||
|
|||
public void setVariable(String variable) { |
|||
this.variable = variable; |
|||
} |
|||
|
|||
public Double getCoefficient() { |
|||
return coefficient; |
|||
} |
|||
|
|||
public void setCoefficient(Double coefficient) { |
|||
this.coefficient = coefficient; |
|||
} |
|||
|
|||
public Double getCoefficientSe() { |
|||
return coefficientSe; |
|||
} |
|||
|
|||
public void setCoefficientSe(Double coefficientSe) { |
|||
this.coefficientSe = coefficientSe; |
|||
} |
|||
|
|||
public Double getT() { |
|||
return t; |
|||
} |
|||
|
|||
public void setT(Double t) { |
|||
this.t = t; |
|||
} |
|||
} |
@ -0,0 +1,25 @@ |
|||
package io.sc.engine.st.jpa.entity.sub; |
|||
|
|||
import io.sc.engine.st.jpa.entity.IndepFactorDefineEntity; |
|||
import io.sc.engine.st.vo.IndepFactorDefineVo; |
|||
import io.sc.engine.st.vo.sub.IndepFolderVo; |
|||
import io.sc.engine.st.vo.sub.IndepOriginalFactorDefineVo; |
|||
|
|||
import javax.persistence.DiscriminatorValue; |
|||
import javax.persistence.Entity; |
|||
|
|||
@Entity |
|||
@DiscriminatorValue("FOLDER") |
|||
public class IndepFolderEntity extends IndepFactorDefineEntity { |
|||
@Override |
|||
public IndepFactorDefineVo toVo() { |
|||
IndepFolderVo vo =new IndepFolderVo(); |
|||
super.toVo(vo); |
|||
return vo; |
|||
} |
|||
|
|||
public IndepFolderEntity(){} |
|||
public IndepFolderEntity(String id){ |
|||
this.id =id; |
|||
} |
|||
} |
@ -0,0 +1,24 @@ |
|||
package io.sc.engine.st.jpa.entity.sub; |
|||
|
|||
import io.sc.engine.st.jpa.entity.IndepFactorDefineEntity; |
|||
import io.sc.engine.st.vo.IndepFactorDefineVo; |
|||
import io.sc.engine.st.vo.sub.IndepOriginalFactorDefineVo; |
|||
|
|||
import javax.persistence.DiscriminatorValue; |
|||
import javax.persistence.Entity; |
|||
|
|||
@Entity |
|||
@DiscriminatorValue("ORIGINAL") |
|||
public class IndepOriginalFactorDefineEntity extends IndepFactorDefineEntity { |
|||
@Override |
|||
public IndepFactorDefineVo toVo() { |
|||
IndepOriginalFactorDefineVo vo =new IndepOriginalFactorDefineVo(); |
|||
super.toVo(vo); |
|||
return vo; |
|||
} |
|||
|
|||
public IndepOriginalFactorDefineEntity(){} |
|||
public IndepOriginalFactorDefineEntity(String id){ |
|||
this.id =id; |
|||
} |
|||
} |
@ -0,0 +1,26 @@ |
|||
package io.sc.engine.st.jpa.repository; |
|||
|
|||
import io.sc.engine.st.jpa.entity.IndepFactorDefineEntity; |
|||
import io.sc.engine.st.jpa.entity.IndepFactorEntity; |
|||
import io.sc.platform.orm.repository.DaoRepository; |
|||
import org.springframework.data.jpa.repository.Query; |
|||
import org.springframework.data.repository.query.Param; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
import java.util.Set; |
|||
|
|||
@Service("io.sc.engine.st.jpa.repository.IndepFactorDefineRepository") |
|||
public interface IndepFactorDefineRepository extends DaoRepository<IndepFactorDefineEntity,String>{ |
|||
public IndepFactorDefineEntity findByCode(String defineCode); |
|||
|
|||
@Query("select e from io.sc.engine.st.jpa.entity.IndepFactorDefineEntity e where e.code in (:defineCodes)") |
|||
public List<IndepFactorDefineEntity> findByCodes(@Param("defineCodes") List<String> defineCodes); |
|||
|
|||
@Query("select e from io.sc.engine.st.jpa.entity.IndepFactorDefineEntity e where e.id<>:defineId") |
|||
public List<IndepFactorDefineEntity> findAllWithoutById(@Param("defineId") String defineId); |
|||
|
|||
@Query("select e from io.sc.engine.st.jpa.entity.IndepFactorDefineEntity e where e.id in :defineIds") |
|||
public List<IndepFactorDefineEntity> findByIds(@Param("defineIds") Set<String> defineIds); |
|||
|
|||
} |
@ -0,0 +1,15 @@ |
|||
package io.sc.engine.st.jpa.repository; |
|||
|
|||
import io.sc.engine.st.jpa.entity.IndepFactorEntity; |
|||
import io.sc.platform.orm.repository.DaoRepository; |
|||
import org.springframework.data.jpa.repository.Query; |
|||
import org.springframework.data.repository.query.Param; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Service("io.sc.engine.st.jpa.repository.IndepFactorRepository") |
|||
public interface IndepFactorRepository extends DaoRepository<IndepFactorEntity,String>{ |
|||
@Query("select e from io.sc.engine.st.jpa.entity.IndepFactorEntity e where e.define.id=:defineId order by e.year, e.quarter, e.month") |
|||
public List<IndepFactorEntity> findByDefineId(@Param("defineId") String defineId); |
|||
} |
@ -0,0 +1,11 @@ |
|||
package io.sc.engine.st.jpa.repository; |
|||
|
|||
import io.sc.engine.st.jpa.entity.ModelAnalysisFactorEntity; |
|||
import io.sc.engine.st.jpa.entity.ModelEntity; |
|||
import io.sc.platform.orm.repository.DaoRepository; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
@Service("io.sc.engine.st.jpa.repository.ModelAnalysisFactorRepository") |
|||
public interface ModelAnalysisFactorRepository extends DaoRepository<ModelAnalysisFactorEntity,String>{ |
|||
|
|||
} |
@ -0,0 +1,13 @@ |
|||
package io.sc.engine.st.service; |
|||
|
|||
import io.sc.engine.st.jpa.entity.IndepFactorDefineEntity; |
|||
import io.sc.engine.st.jpa.repository.IndepFactorDefineRepository; |
|||
import io.sc.engine.st.vo.IndepFactorDefineVo; |
|||
import io.sc.platform.orm.service.DaoService; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface IndepFactorDefineService extends DaoService<IndepFactorDefineEntity, String, IndepFactorDefineRepository>{ |
|||
public List<IndepFactorDefineVo> findAllWithoutById(String defineId) throws Exception; |
|||
} |
@ -0,0 +1,14 @@ |
|||
package io.sc.engine.st.service; |
|||
|
|||
import io.sc.engine.st.jpa.entity.IndepFactorEntity; |
|||
import io.sc.engine.st.jpa.repository.IndepFactorRepository; |
|||
import io.sc.engine.st.vo.IndepFactorVo; |
|||
import io.sc.platform.orm.service.DaoService; |
|||
import org.springframework.web.bind.annotation.RequestParam; |
|||
|
|||
import java.text.ParseException; |
|||
import java.util.List; |
|||
|
|||
public interface IndepFactorService extends DaoService<IndepFactorEntity, String, IndepFactorRepository>{ |
|||
public List<IndepFactorVo> findByFactorDefineId(@RequestParam("defineId") String defineId) throws Exception; |
|||
} |
@ -0,0 +1,13 @@ |
|||
package io.sc.engine.st.service; |
|||
|
|||
import io.sc.engine.st.jpa.entity.ModelAnalysisFactorEntity; |
|||
import io.sc.engine.st.jpa.entity.ModelEntity; |
|||
import io.sc.engine.st.jpa.repository.ModelAnalysisFactorRepository; |
|||
import io.sc.engine.st.jpa.repository.ModelRepository; |
|||
import io.sc.engine.st.vo.IndepFactorDefineVo; |
|||
import io.sc.platform.orm.service.DaoService; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface ModelAnalysisFactorService extends DaoService<ModelAnalysisFactorEntity, String, ModelAnalysisFactorRepository>{ |
|||
} |
@ -0,0 +1,24 @@ |
|||
package io.sc.engine.st.service.impl; |
|||
|
|||
import io.sc.engine.st.jpa.entity.IndepFactorDefineEntity; |
|||
import io.sc.engine.st.jpa.repository.IndepFactorDefineRepository; |
|||
import io.sc.engine.st.service.IndepFactorDefineService; |
|||
import io.sc.engine.st.vo.IndepFactorDefineVo; |
|||
import io.sc.platform.orm.service.impl.DaoServiceImpl; |
|||
import io.sc.platform.orm.util.EntityVoUtil; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.util.StringUtils; |
|||
|
|||
import java.util.Collections; |
|||
import java.util.List; |
|||
|
|||
@Service("io.sc.engine.st.service.impl.IndepFactorDefineServiceImpl") |
|||
public class IndepFactorDefineServiceImpl extends DaoServiceImpl<IndepFactorDefineEntity, String, IndepFactorDefineRepository> implements IndepFactorDefineService { |
|||
@Override |
|||
public List<IndepFactorDefineVo> findAllWithoutById(String defineId) throws Exception { |
|||
if(!StringUtils.hasText(defineId)){ |
|||
EntityVoUtil.toVo(repository.findAll()); |
|||
} |
|||
return EntityVoUtil.toVo(repository.findAllWithoutById(defineId)); |
|||
} |
|||
} |
@ -0,0 +1,215 @@ |
|||
package io.sc.engine.st.service.impl; |
|||
|
|||
import io.sc.engine.st.enums.FactorDefineType; |
|||
import io.sc.engine.st.enums.Period; |
|||
import io.sc.engine.st.exception.FactorDefinePeroidNotSameException; |
|||
import io.sc.engine.st.jpa.entity.IndepFactorDefineEntity; |
|||
import io.sc.engine.st.jpa.entity.IndepFactorEntity; |
|||
import io.sc.engine.st.jpa.entity.sub.IndepArithmeticFactorDefineEntity; |
|||
import io.sc.engine.st.jpa.entity.sub.IndepDelayFactorDefineEntity; |
|||
import io.sc.engine.st.jpa.entity.sub.IndepDifferentialFactorDefineEntity; |
|||
import io.sc.engine.st.jpa.repository.IndepFactorRepository; |
|||
import io.sc.engine.st.service.IndepFactorDefineService; |
|||
import io.sc.engine.st.service.IndepFactorService; |
|||
import io.sc.engine.st.support.FormulaUtil; |
|||
import io.sc.engine.st.support.PeriodWrapper; |
|||
import io.sc.engine.st.vo.IndepFactorVo; |
|||
import io.sc.platform.core.service.SpringExpressionParserService; |
|||
import io.sc.platform.groovy.GroovyScriptExecutor; |
|||
import io.sc.platform.orm.service.impl.DaoServiceImpl; |
|||
import io.sc.platform.orm.service.support.QueryParameter; |
|||
import io.sc.platform.orm.service.support.QueryResult; |
|||
import io.sc.platform.orm.util.EntityVoUtil; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.data.domain.Page; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.util.StringUtils; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.text.ParseException; |
|||
import java.util.*; |
|||
import java.util.regex.Matcher; |
|||
|
|||
@Service("io.sc.engine.st.service.impl.IndepFactorServiceImpl") |
|||
public class IndepFactorServiceImpl extends DaoServiceImpl<IndepFactorEntity, String, IndepFactorRepository> implements IndepFactorService { |
|||
@Autowired private IndepFactorDefineService indepFactorDefineService; |
|||
|
|||
@Override |
|||
public List<IndepFactorVo> findByFactorDefineId(String defineId) throws Exception { |
|||
if(!StringUtils.hasText(defineId)){ |
|||
return Collections.emptyList(); |
|||
} |
|||
IndepFactorDefineEntity factorDefineEntity =indepFactorDefineService.findById(defineId); |
|||
if(factorDefineEntity==null){ |
|||
return Collections.emptyList(); |
|||
} |
|||
|
|||
if(FactorDefineType.FOLDER.equals(factorDefineEntity.getType())){ |
|||
return Collections.emptyList(); |
|||
} |
|||
if(FactorDefineType.ORIGINAL.equals(factorDefineEntity.getType())){ |
|||
return EntityVoUtil.toVo(repository.findByDefineId(defineId)); |
|||
} |
|||
if(factorDefineEntity instanceof IndepArithmeticFactorDefineEntity){ |
|||
IndepArithmeticFactorDefineEntity arithmeticFactorDefineEntity =(IndepArithmeticFactorDefineEntity)factorDefineEntity; |
|||
return cal(arithmeticFactorDefineEntity); |
|||
}else if(factorDefineEntity instanceof IndepDelayFactorDefineEntity){ |
|||
IndepDelayFactorDefineEntity delayFactorDefineEntity =(IndepDelayFactorDefineEntity)factorDefineEntity; |
|||
return cal(delayFactorDefineEntity); |
|||
}else if(factorDefineEntity instanceof IndepDifferentialFactorDefineEntity){ |
|||
IndepDifferentialFactorDefineEntity differentialFactorDefineEntity =(IndepDifferentialFactorDefineEntity)factorDefineEntity; |
|||
return cal(differentialFactorDefineEntity); |
|||
} |
|||
return Collections.emptyList(); |
|||
} |
|||
|
|||
private List<IndepFactorVo> cal(IndepArithmeticFactorDefineEntity selfEntity) throws Exception { |
|||
// 获取算术运算表达式中引用的其他自变量代码
|
|||
List<String> variableNames = FormulaUtil.extractVariableNames(selfEntity.getFormula()); |
|||
// 查找算术运算表达式中引用的其他自变量定义
|
|||
List<IndepFactorDefineEntity> referenceEntities =indepFactorDefineService.getRepository().findByCodes(variableNames); |
|||
// 算术运算表达式中引用的其他自变量的周期是否相同
|
|||
if(!isSamePeroid(referenceEntities,selfEntity.getPeriod())){ |
|||
throw new FactorDefinePeroidNotSameException(); |
|||
} |
|||
|
|||
// 所有算术运算表达式中引用的其他自变量集合的行 key 集合
|
|||
Set<PeriodWrapper> rowKeys =new LinkedHashSet<>(); |
|||
// 查找算术运算表达式中引用的其他自变量Map
|
|||
// key : 自变量定义代码
|
|||
// value: 自变量的值 Map(key:唯一标识,value:值)
|
|||
Map<String,Map<PeriodWrapper,Object>> variableValueMap =new HashMap<>(); |
|||
for(IndepFactorDefineEntity defineEntity : referenceEntities){ |
|||
Map<PeriodWrapper,Object> records =new HashMap<>(); |
|||
List<IndepFactorEntity> factorEntities =repository.findByDefineId(defineEntity.getId()); |
|||
if(factorEntities!=null){ |
|||
for(IndepFactorEntity factorEntity : factorEntities){ |
|||
rowKeys.add(new PeriodWrapper(factorEntity.getYear(),factorEntity.getQuarter(),factorEntity.getMonth())); |
|||
records.put(factorEntity.calUniqueKey(),defineEntity.convertValue(factorEntity.getValue())); |
|||
} |
|||
} |
|||
variableValueMap.put(defineEntity.getCode(),records); |
|||
} |
|||
|
|||
// 结果集
|
|||
List<IndepFactorVo> result =new ArrayList<>(); |
|||
for(PeriodWrapper rowKey : rowKeys){ |
|||
IndepFactorVo vo =new IndepFactorVo(); |
|||
vo.setYear(rowKey.getYear()); |
|||
vo.setQuarter(rowKey.getQuarter()); |
|||
vo.setMonth(rowKey.getMonth()); |
|||
Map<String,Object> context =new HashMap<>(); |
|||
for(String variableName : variableNames){ |
|||
Map<PeriodWrapper,Object> values =variableValueMap.get(variableName); |
|||
Object value =values.get(rowKey); |
|||
context.put(variableName,value); |
|||
} |
|||
String groovyScript =FormulaUtil.getGroovyScript(selfEntity.getFormula()); |
|||
vo.setValue(GroovyScriptExecutor.getInstance().eval(groovyScript,context).toString()); |
|||
result.add(vo); |
|||
} |
|||
return result; |
|||
} |
|||
|
|||
private List<IndepFactorVo> cal(IndepDelayFactorDefineEntity selfEntity) throws Exception { |
|||
// 获取滞后自变量定义引用的自变量定义实体
|
|||
IndepFactorDefineEntity referenceEntity =selfEntity.getDelayFactorDefine(); |
|||
if(referenceEntity==null){ |
|||
return Collections.emptyList(); |
|||
} |
|||
|
|||
// 滞后自变量定义和引用的自变量定义实体的周期是否相同
|
|||
if(!referenceEntity.getPeriod().equals(selfEntity.getPeriod())){ |
|||
throw new FactorDefinePeroidNotSameException(); |
|||
} |
|||
|
|||
List<IndepFactorEntity> factorEntities =repository.findByDefineId(referenceEntity.getId()); |
|||
if(factorEntities==null || factorEntities.isEmpty()){ |
|||
return Collections.emptyList(); |
|||
} |
|||
|
|||
Map<PeriodWrapper,Object> recordCache =new LinkedHashMap<>(); |
|||
for(IndepFactorEntity factorEntity : factorEntities){ |
|||
recordCache.put(factorEntity.calUniqueKey(),selfEntity.convertValue(factorEntity.getValue())); |
|||
} |
|||
|
|||
// 结果集
|
|||
List<IndepFactorVo> result =new ArrayList<>(); |
|||
for(PeriodWrapper key : recordCache.keySet()){ |
|||
IndepFactorVo vo =new IndepFactorVo(); |
|||
vo.setYear(key.getYear()); |
|||
vo.setQuarter(key.getQuarter()); |
|||
vo.setMonth(key.getMonth()); |
|||
Object value =recordCache.get(key.previous(selfEntity.getDelayIssue())); |
|||
vo.setValue(value==null?null:value.toString()); |
|||
result.add(vo); |
|||
} |
|||
return result; |
|||
} |
|||
|
|||
private List<IndepFactorVo> cal(IndepDifferentialFactorDefineEntity selfEntity) throws Exception { |
|||
// 获取差分自变量定义引用的自变量定义实体
|
|||
IndepFactorDefineEntity referenceEntity =selfEntity.getDifferentialFactorDefine(); |
|||
if(referenceEntity==null){ |
|||
return Collections.emptyList(); |
|||
} |
|||
|
|||
// 滞后自变量定义和引用的自变量定义实体的周期是否相同
|
|||
if(!referenceEntity.getPeriod().equals(selfEntity.getPeriod())){ |
|||
throw new FactorDefinePeroidNotSameException(); |
|||
} |
|||
|
|||
List<IndepFactorEntity> factorEntities =repository.findByDefineId(referenceEntity.getId()); |
|||
if(factorEntities==null || factorEntities.isEmpty()){ |
|||
return Collections.emptyList(); |
|||
} |
|||
|
|||
Map<PeriodWrapper,Object> recordCache =new LinkedHashMap<>(); |
|||
for(IndepFactorEntity factorEntity : factorEntities){ |
|||
recordCache.put(factorEntity.calUniqueKey(),selfEntity.convertValue(factorEntity.getValue())); |
|||
} |
|||
|
|||
for(int i=0;i<selfEntity.getDifferentialDegree();i++) { |
|||
Map<PeriodWrapper,Object> recordCacheTemp =new LinkedHashMap<>(); |
|||
for (PeriodWrapper key : recordCache.keySet()) { |
|||
Object value =recordCache.get(key); |
|||
Object value_1 =recordCache.get(key.previous(1)); |
|||
if(value_1!=null){ |
|||
recordCacheTemp.put(key,new BigDecimal(value.toString()).subtract(new BigDecimal(value_1.toString()))); |
|||
}else{ |
|||
recordCacheTemp.put(key,null); |
|||
} |
|||
} |
|||
recordCache =recordCacheTemp; |
|||
} |
|||
|
|||
// 结果集
|
|||
List<IndepFactorVo> result =new ArrayList<>(); |
|||
for(PeriodWrapper key : recordCache.keySet()){ |
|||
IndepFactorVo vo =new IndepFactorVo(); |
|||
vo.setYear(key.getYear()); |
|||
vo.setQuarter(key.getQuarter()); |
|||
vo.setMonth(key.getMonth()); |
|||
Object value =recordCache.get(key); |
|||
vo.setValue(value==null?null:value.toString()); |
|||
result.add(vo); |
|||
} |
|||
return result; |
|||
} |
|||
|
|||
|
|||
private boolean isSamePeroid(List<IndepFactorDefineEntity> factorDefineEntities,Period period){ |
|||
if(period==null){ |
|||
return false; |
|||
} |
|||
if(factorDefineEntities==null || !factorDefineEntities.isEmpty()){ |
|||
return true; |
|||
} |
|||
for(IndepFactorDefineEntity defineEntity : factorDefineEntities){ |
|||
if(!period.equals(defineEntity.getPeriod())){ |
|||
return false; |
|||
} |
|||
} |
|||
return true; |
|||
} |
|||
} |
@ -0,0 +1,22 @@ |
|||
package io.sc.engine.st.support; |
|||
|
|||
public class Model { |
|||
private String arff; |
|||
private String formula; |
|||
|
|||
public String getArff() { |
|||
return arff; |
|||
} |
|||
|
|||
public void setArff(String arff) { |
|||
this.arff = arff; |
|||
} |
|||
|
|||
public String getFormula() { |
|||
return formula; |
|||
} |
|||
|
|||
public void setFormula(String formula) { |
|||
this.formula = formula; |
|||
} |
|||
} |
@ -0,0 +1,90 @@ |
|||
package io.sc.engine.st.vo; |
|||
|
|||
import io.sc.engine.st.enums.FactorDefineType; |
|||
import io.sc.engine.st.enums.Period; |
|||
import io.sc.engine.st.enums.ValueType; |
|||
import io.sc.platform.orm.api.vo.CorporationAuditorVo; |
|||
|
|||
public class IndepFactorDefineVo extends CorporationAuditorVo { |
|||
protected String id; |
|||
protected FactorDefineType type; |
|||
protected String code; |
|||
protected String name; |
|||
protected String description; |
|||
protected Integer order; |
|||
protected Period period; |
|||
protected ValueType valueType; |
|||
protected String parent; |
|||
|
|||
public String getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(String id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public FactorDefineType getType() { |
|||
return type; |
|||
} |
|||
|
|||
public void setType(FactorDefineType type) { |
|||
this.type = type; |
|||
} |
|||
|
|||
public String getCode() { |
|||
return code; |
|||
} |
|||
|
|||
public void setCode(String code) { |
|||
this.code = code; |
|||
} |
|||
|
|||
public String getName() { |
|||
return name; |
|||
} |
|||
|
|||
public void setName(String name) { |
|||
this.name = name; |
|||
} |
|||
|
|||
public String getDescription() { |
|||
return description; |
|||
} |
|||
|
|||
public void setDescription(String description) { |
|||
this.description = description; |
|||
} |
|||
|
|||
public Integer getOrder() { |
|||
return order; |
|||
} |
|||
|
|||
public void setOrder(Integer order) { |
|||
this.order = order; |
|||
} |
|||
|
|||
public Period getPeriod() { |
|||
return period; |
|||
} |
|||
|
|||
public void setPeriod(Period period) { |
|||
this.period = period; |
|||
} |
|||
|
|||
public ValueType getValueType() { |
|||
return valueType; |
|||
} |
|||
|
|||
public void setValueType(ValueType valueType) { |
|||
this.valueType = valueType; |
|||
} |
|||
|
|||
public String getParent() { |
|||
return parent; |
|||
} |
|||
|
|||
public void setParent(String parent) { |
|||
this.parent = parent; |
|||
} |
|||
} |
@ -0,0 +1,65 @@ |
|||
package io.sc.engine.st.vo; |
|||
|
|||
import io.sc.engine.st.support.PeriodWrapper; |
|||
import io.sc.platform.orm.api.vo.CorporationAuditorVo; |
|||
|
|||
public class IndepFactorVo extends CorporationAuditorVo { |
|||
protected String id; |
|||
protected Integer year; |
|||
protected Integer quarter; |
|||
protected Integer month; |
|||
protected String value; |
|||
protected String define; |
|||
|
|||
public PeriodWrapper calUniqueKey(){ |
|||
return new PeriodWrapper(year,quarter,month); |
|||
} |
|||
|
|||
public String getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(String id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public Integer getYear() { |
|||
return year; |
|||
} |
|||
|
|||
public void setYear(Integer year) { |
|||
this.year = year; |
|||
} |
|||
|
|||
public Integer getQuarter() { |
|||
return quarter; |
|||
} |
|||
|
|||
public void setQuarter(Integer quarter) { |
|||
this.quarter = quarter; |
|||
} |
|||
|
|||
public Integer getMonth() { |
|||
return month; |
|||
} |
|||
|
|||
public void setMonth(Integer month) { |
|||
this.month = month; |
|||
} |
|||
|
|||
public String getValue() { |
|||
return value; |
|||
} |
|||
|
|||
public void setValue(String value) { |
|||
this.value = value; |
|||
} |
|||
|
|||
public String getDefine() { |
|||
return define; |
|||
} |
|||
|
|||
public void setDefine(String define) { |
|||
this.define = define; |
|||
} |
|||
} |
@ -0,0 +1,24 @@ |
|||
package io.sc.engine.st.vo.sub; |
|||
|
|||
import io.sc.engine.st.vo.IndepFactorDefineVo; |
|||
|
|||
public class IndepDelayFactorDefineVo extends IndepFactorDefineVo { |
|||
protected String delayFactorDefine; |
|||
protected Integer delayIssue; |
|||
|
|||
public String getDelayFactorDefine() { |
|||
return delayFactorDefine; |
|||
} |
|||
|
|||
public void setDelayFactorDefine(String delayFactorDefine) { |
|||
this.delayFactorDefine = delayFactorDefine; |
|||
} |
|||
|
|||
public Integer getDelayIssue() { |
|||
return delayIssue; |
|||
} |
|||
|
|||
public void setDelayIssue(Integer delayIssue) { |
|||
this.delayIssue = delayIssue; |
|||
} |
|||
} |
@ -0,0 +1,24 @@ |
|||
package io.sc.engine.st.vo.sub; |
|||
|
|||
import io.sc.engine.st.vo.IndepFactorDefineVo; |
|||
|
|||
public class IndepDifferentialFactorDefineVo extends IndepFactorDefineVo { |
|||
protected String differentialFactorDefine; |
|||
protected Integer differentialDegree; |
|||
|
|||
public String getDifferentialFactorDefine() { |
|||
return differentialFactorDefine; |
|||
} |
|||
|
|||
public void setDifferentialFactorDefine(String differentialFactorDefine) { |
|||
this.differentialFactorDefine = differentialFactorDefine; |
|||
} |
|||
|
|||
public Integer getDifferentialDegree() { |
|||
return differentialDegree; |
|||
} |
|||
|
|||
public void setDifferentialDegree(Integer differentialDegree) { |
|||
this.differentialDegree = differentialDegree; |
|||
} |
|||
} |
@ -0,0 +1,10 @@ |
|||
package io.sc.engine.st.vo.sub; |
|||
|
|||
import io.sc.engine.st.vo.IndepFactorDefineVo; |
|||
|
|||
import javax.persistence.DiscriminatorValue; |
|||
import javax.persistence.Entity; |
|||
|
|||
public class IndepFolderVo extends IndepFactorDefineVo { |
|||
|
|||
} |
@ -0,0 +1,10 @@ |
|||
package io.sc.engine.st.vo.sub; |
|||
|
|||
import io.sc.engine.st.vo.IndepFactorDefineVo; |
|||
|
|||
import javax.persistence.DiscriminatorValue; |
|||
import javax.persistence.Entity; |
|||
|
|||
public class IndepOriginalFactorDefineVo extends IndepFactorDefineVo { |
|||
|
|||
} |
@ -1,6 +1,7 @@ |
|||
{ |
|||
"includes":[ |
|||
"io/sc/platform/orm/api/i18n/enum", |
|||
"io/sc/platform/orm/api/i18n/exception" |
|||
"io/sc/platform/orm/api/i18n/exception", |
|||
"io/sc/platform/orm/api/i18n/validator" |
|||
] |
|||
} |
Loading…
Reference in new issue