|
@@ -9,6 +9,8 @@ import com.sundata.product.rwa.calc.service.finals.CalcType;
|
|
import com.sundata.product.rwa.rwacalcconfig004rwa.model.StageDefinitionModel;
|
|
import com.sundata.product.rwa.rwacalcconfig004rwa.model.StageDefinitionModel;
|
|
import com.sundata.product.rwa.rwacalcconfig004rwa.model.StageStepsModel;
|
|
import com.sundata.product.rwa.rwacalcconfig004rwa.model.StageStepsModel;
|
|
import com.sundata.product.rwa.rwacalcconfig004rwa.service.StageConfigService;
|
|
import com.sundata.product.rwa.rwacalcconfig004rwa.service.StageConfigService;
|
|
|
|
+import org.slf4j.Logger;
|
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
|
|
|
import java.util.LinkedList;
|
|
import java.util.LinkedList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -16,6 +18,7 @@ import java.util.Map;
|
|
|
|
|
|
public class StageUnit extends CalcUnit {
|
|
public class StageUnit extends CalcUnit {
|
|
|
|
|
|
|
|
+ private static final Logger log = LoggerFactory.getLogger(StageUnit.class);
|
|
final StageDefinitionModel stageDefinitionModel;
|
|
final StageDefinitionModel stageDefinitionModel;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -25,8 +28,8 @@ public class StageUnit extends CalcUnit {
|
|
* @param calcName 计算对象名称
|
|
* @param calcName 计算对象名称
|
|
* @param initContext 计算单元初始化参数
|
|
* @param initContext 计算单元初始化参数
|
|
*/
|
|
*/
|
|
- public StageUnit(StageDefinitionModel stageDefinitionModel, String calcCode, String calcName, Map<String, Object> initContext) {
|
|
|
|
- super(calcCode, calcName, CalcType.STAGE, initContext);
|
|
|
|
|
|
+ public StageUnit(StageDefinitionModel stageDefinitionModel, String calcCode, String calcName, int sequence, Map<String, Object> initContext) {
|
|
|
|
+ super(calcCode, calcName, CalcType.STAGE, sequence, initContext);
|
|
this.stageDefinitionModel = stageDefinitionModel;
|
|
this.stageDefinitionModel = stageDefinitionModel;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -63,19 +66,21 @@ public class StageUnit extends CalcUnit {
|
|
StageStepsModel sm = stageStepsModels.get(i);
|
|
StageStepsModel sm = stageStepsModels.get(i);
|
|
CalcUnit unit = null;
|
|
CalcUnit unit = null;
|
|
if ("1".equals(sm.getStepType())) {
|
|
if ("1".equals(sm.getStepType())) {
|
|
- unit = new SqlUnit("SQL"+sm.getStepIndex(),"SQL"+sm.getStepIndex(),this.getInitContext(),sm.getStepInfo(),NumberUtil.parseInt(sm.getStepIndex()));
|
|
|
|
- }else if ("2".equals(sm.getStepType())) {
|
|
|
|
-
|
|
|
|
- }else if ("3".equals(sm.getStepType())) {
|
|
|
|
-
|
|
|
|
- }else if ("4".equals(sm.getStepType())) {
|
|
|
|
-
|
|
|
|
- }else if ("5".equals(sm.getStepType())) {
|
|
|
|
-
|
|
|
|
- }else if ("6".equals(sm.getStepType())) {
|
|
|
|
-
|
|
|
|
- }else if ("7".equals(sm.getStepType())) {
|
|
|
|
-
|
|
|
|
|
|
+ unit = new SqlUnit("SQL" + sm.getStepIndex(), "SQL" + sm.getStepIndex(), this.getInitContext(), sm.getStepInfo(), NumberUtil.parseInt(sm.getStepIndex()));
|
|
|
|
+ } else if ("2".equals(sm.getStepType())) {
|
|
|
|
+ unit = new DataImportUnit(sm.getStepId(), "补录任务阶段", NumberUtil.parseInt(sm.getStepIndex()), getInitContext());
|
|
|
|
+ } else if ("3".equals(sm.getStepType())) {
|
|
|
|
+ unit = new QualifiedSlowReleaseUnit(sm.getStepId(), "合格缓释阶段", NumberUtil.parseInt(sm.getStepIndex()), getInitContext());
|
|
|
|
+ } else if ("4".equals(sm.getStepType())) {
|
|
|
|
+ unit = new ProjectDivisionUnit(sm.getStepId(), "表外项目划分", NumberUtil.parseInt(sm.getStepIndex()), getInitContext());
|
|
|
|
+ } else if ("5".equals(sm.getStepType())) {
|
|
|
|
+ unit = new RiskExposureUnit(sm.getStepId(),"风险暴露分类", NumberUtil.parseInt(sm.getStepIndex()), getInitContext());
|
|
|
|
+ } else if ("6".equals(sm.getStepType())) {
|
|
|
|
+ unit = new SingleRWAUnit(sm.getStepId(), "债项级别RWA计量", NumberUtil.parseInt(sm.getStepIndex()), getInitContext());
|
|
|
|
+ calcUnitList.add(unit);
|
|
|
|
+ unit = new IntegratedRWAUnit(sm.getStepId(),"法人RWA计量", NumberUtil.parseInt(sm.getStepIndex()), getInitContext());
|
|
|
|
+ } else if ("7".equals(sm.getStepType())) {
|
|
|
|
+ unit = new ReportInitUnit(sm.getStepId() , "报表填报", NumberUtil.parseInt(sm.getStepIndex()), getInitContext());
|
|
}
|
|
}
|
|
calcUnitList.add(unit);
|
|
calcUnitList.add(unit);
|
|
|
|
|
|
@@ -103,6 +108,6 @@ public class StageUnit extends CalcUnit {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void calc(CalcResult<String, Object> thisResult, String calculateInstanceNumber, Map<String, Object> context, Map<CalcUnit, CalcResult<String, Object>> sourceResults) {
|
|
public void calc(CalcResult<String, Object> thisResult, String calculateInstanceNumber, Map<String, Object> context, Map<CalcUnit, CalcResult<String, Object>> sourceResults) {
|
|
-
|
|
|
|
|
|
+ log.debug("阶段的计算过程除了必须的SQL逻辑,其他均调用外部步骤");
|
|
}
|
|
}
|
|
}
|
|
}
|