48 changed files with 2151 additions and 0 deletions
@ -0,0 +1,20 @@ |
|||||
|
package io.sc.engine.mv.controller.configuration; |
||||
|
|
||||
|
import io.sc.engine.mv.jpa.entity.CfgBinomial; |
||||
|
import io.sc.engine.mv.jpa.repository.CfgBinomialRepository; |
||||
|
import io.sc.engine.mv.service.configuration.CfgBinomialService; |
||||
|
import io.sc.engine.mv.vo.CfgBinomialVo; |
||||
|
import io.sc.platform.mvc.controller.support.RestCrudController; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
/** |
||||
|
* 二项检验标准正态分布显著水平下的Z值常量配置控制器 |
||||
|
* @author wangshaoping |
||||
|
* |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("/api/mv/config/binomial") |
||||
|
public class CfgBinomialWebController extends RestCrudController<CfgBinomialVo,CfgBinomial, String, CfgBinomialRepository, CfgBinomialService> { |
||||
|
|
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package io.sc.engine.mv.controller.configuration; |
||||
|
|
||||
|
import io.sc.engine.mv.jpa.entity.CfgChiSquare; |
||||
|
import io.sc.engine.mv.jpa.repository.CfgChiSquareRepository; |
||||
|
import io.sc.engine.mv.service.configuration.CfgChiSquareService; |
||||
|
import io.sc.engine.mv.vo.CfgChiSquareVo; |
||||
|
import io.sc.platform.mvc.controller.support.RestCrudController; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
/** |
||||
|
* 卡方分布临界值常量配置信息控制器 |
||||
|
* @author wangshaoping |
||||
|
* |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("/api/mv/config/chiSquare") |
||||
|
public class CfgChiSquareWebController extends RestCrudController<CfgChiSquareVo, CfgChiSquare, String, CfgChiSquareRepository, CfgChiSquareService> { |
||||
|
|
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package io.sc.engine.mv.controller.configuration; |
||||
|
|
||||
|
import io.sc.engine.mv.jpa.entity.CfgCustomerDistribution; |
||||
|
import io.sc.engine.mv.jpa.repository.CfgCustomerDistributionRepository; |
||||
|
import io.sc.engine.mv.service.configuration.CfgCustomerDistributionService; |
||||
|
import io.sc.engine.mv.vo.CfgCustomerDistributionVo; |
||||
|
import io.sc.platform.mvc.controller.support.RestCrudController; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
/** |
||||
|
* 咨询建模时客户评分分布情况配置控制器 |
||||
|
* @author wangshaoping |
||||
|
* |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("/api/mv/config/distribution") |
||||
|
public class CfgCustomerDistributionWebController extends RestCrudController<CfgCustomerDistributionVo,CfgCustomerDistribution, String, CfgCustomerDistributionRepository, CfgCustomerDistributionService> { |
||||
|
|
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package io.sc.engine.mv.controller.configuration; |
||||
|
|
||||
|
import io.sc.engine.mv.jpa.entity.CfgCutOffPoint; |
||||
|
import io.sc.engine.mv.jpa.repository.CfgCutOffPointRepository; |
||||
|
import io.sc.engine.mv.service.configuration.CfgCutOffPointService; |
||||
|
import io.sc.engine.mv.vo.CfgCutOffPointVo; |
||||
|
import io.sc.platform.mvc.controller.support.RestCrudController; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
/** |
||||
|
* 截断点配置信息控制器 |
||||
|
* @author wangshaoping |
||||
|
* |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("/api/mv/config/cutOffPoint") |
||||
|
public class CfgCutOffPointWebController extends RestCrudController<CfgCutOffPointVo, CfgCutOffPoint, String, CfgCutOffPointRepository, CfgCutOffPointService> { |
||||
|
|
||||
|
} |
@ -0,0 +1,41 @@ |
|||||
|
package io.sc.engine.mv.controller.configuration; |
||||
|
|
||||
|
import io.sc.engine.mv.Executor; |
||||
|
import io.sc.engine.mv.ExecutorManager; |
||||
|
import io.sc.engine.mv.executor.support.ExecutorWrapper; |
||||
|
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.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.data.domain.Page; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletRequest; |
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
import java.util.Locale; |
||||
|
|
||||
|
/** |
||||
|
* 模型验证执行器 |
||||
|
* @author wangshaoping |
||||
|
* |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("/api/mv/config/executor") |
||||
|
public class CfgExecutorWebController { |
||||
|
@Autowired private ExecutorManager executorManager; |
||||
|
|
||||
|
@GetMapping("") |
||||
|
protected Page<Executor> query(QueryParameter queryParameter) throws Exception { |
||||
|
if(!queryParameter.existsSortBy()) { |
||||
|
queryParameter.addSortBy("order"); |
||||
|
} |
||||
|
List<Executor> executors = executorManager.getItems(); |
||||
|
return QueryResult.page(executors, queryParameter); |
||||
|
} |
||||
|
} |
@ -0,0 +1,32 @@ |
|||||
|
package io.sc.engine.mv.controller.configuration; |
||||
|
|
||||
|
import io.sc.engine.mv.jpa.entity.CfgModel; |
||||
|
import io.sc.engine.mv.jpa.repository.CfgModelRepository; |
||||
|
import io.sc.engine.mv.service.configuration.CfgModelService; |
||||
|
import io.sc.engine.mv.vo.CfgModelVo; |
||||
|
import io.sc.platform.mvc.controller.support.RestCrudController; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMethod; |
||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
/** |
||||
|
* 二项检验标准正态分布显著水平下的Z值常量配置控制器 |
||||
|
* @author wangshaoping |
||||
|
* |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("/api/mv/config/model") |
||||
|
public class CfgModelWebController extends RestCrudController<CfgModelVo, CfgModel, String, CfgModelRepository, CfgModelService> { |
||||
|
@Autowired private CfgModelService service; |
||||
|
|
||||
|
/** |
||||
|
* 恢复默认二项检验标准正态分布显著水平下的Z值常量配置 |
||||
|
*/ |
||||
|
@RequestMapping(value="importFromScoreRecord",method=RequestMethod.POST) |
||||
|
@ResponseBody |
||||
|
public void importFromScoreRecord(){ |
||||
|
service.importFromScoreRecord(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,49 @@ |
|||||
|
package io.sc.engine.mv.controller.configuration; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
import io.sc.engine.mv.jpa.entity.CfgScale; |
||||
|
import io.sc.engine.mv.jpa.repository.CfgScaleRepository; |
||||
|
import io.sc.engine.mv.service.configuration.CfgScaleService; |
||||
|
import io.sc.engine.mv.vo.CfgScaleVo; |
||||
|
import io.sc.platform.mvc.controller.support.RestCrudController; |
||||
|
import io.sc.platform.orm.service.support.QueryParameter; |
||||
|
import org.springframework.data.domain.Page; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.util.StringUtils; |
||||
|
import org.springframework.web.bind.annotation.PathVariable; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletRequest; |
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
|
||||
|
/** |
||||
|
* 标尺配置控制器 |
||||
|
* @author wangshaoping |
||||
|
* |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("/api/mv/config/scale") |
||||
|
public class CfgScaleWebController extends RestCrudController<CfgScaleVo, CfgScale, String, CfgScaleRepository, CfgScaleService> { |
||||
|
@RequestMapping(value="getScaleLevelByModel/{modelId}") |
||||
|
@ResponseBody |
||||
|
public List<String> getScaleLevelByModel(@PathVariable(name="modelId")String modelId) throws Exception{ |
||||
|
if(StringUtils.hasText(modelId)) { |
||||
|
List<CfgScale> scales =service.getRepository().findByModelIdOrderByOrder(modelId); |
||||
|
if(scales==null || scales.size()==0) { |
||||
|
scales =service.getRepository().findByNullModelIdOrderByOrder(); |
||||
|
} |
||||
|
if(scales!=null && scales.size()>0) { |
||||
|
List<String> levels =new ArrayList<String>(); |
||||
|
for(CfgScale scale : scales) { |
||||
|
levels.add(scale.getLevel()); |
||||
|
} |
||||
|
return levels; |
||||
|
} |
||||
|
} |
||||
|
return null; |
||||
|
} |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package io.sc.engine.mv.controller.configuration; |
||||
|
|
||||
|
import io.sc.engine.mv.jpa.entity.CfgThreshold; |
||||
|
import io.sc.engine.mv.jpa.repository.CfgThresholdRepository; |
||||
|
import io.sc.engine.mv.service.configuration.CfgThresholdService; |
||||
|
import io.sc.engine.mv.vo.CfgThresholdVo; |
||||
|
import io.sc.platform.mvc.controller.support.RestCrudController; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
/** |
||||
|
* 预警阈值控制器 |
||||
|
* @author wangshaoping |
||||
|
* |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("/api/mv/config/threshold") |
||||
|
public class CfgThresholdWebController extends RestCrudController<CfgThresholdVo, CfgThreshold, String, CfgThresholdRepository, CfgThresholdService> { |
||||
|
|
||||
|
} |
@ -0,0 +1,110 @@ |
|||||
|
package io.sc.engine.mv.jpa.entity; |
||||
|
|
||||
|
import io.sc.engine.mv.vo.CfgBinomialVo; |
||||
|
import io.sc.platform.orm.entity.AuditorEntity; |
||||
|
import org.hibernate.annotations.GenericGenerator; |
||||
|
|
||||
|
import javax.persistence.*; |
||||
|
import javax.validation.constraints.Size; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 二项检验标准正态分布显著水平下的Z值常量实体类 |
||||
|
* |
||||
|
*/ |
||||
|
@Entity |
||||
|
@Table(name="MV_CFG_BINOMIAL") |
||||
|
public class CfgBinomial extends AuditorEntity<CfgBinomialVo> { |
||||
|
@Id |
||||
|
@GeneratedValue(generator = "system-uuid") |
||||
|
@GenericGenerator(name = "system-uuid", strategy = "uuid2") |
||||
|
@Column(name="FD_ID", length=36) |
||||
|
@Size(max=36) |
||||
|
private String id; |
||||
|
|
||||
|
//显著水平
|
||||
|
@Column(name="FD_SIGNIFICANCE_LEVEL") |
||||
|
private Double significanceLevel; |
||||
|
|
||||
|
//置信水平
|
||||
|
@Column(name="FD_CONFIDENCE_LEVEL") |
||||
|
private Double confidenceLevel; |
||||
|
|
||||
|
//在该显著水平下的Z值上界
|
||||
|
@Column(name="FD_Z_UPPER") |
||||
|
private Double zUpper; |
||||
|
|
||||
|
//在该显著水平下的Z值下界
|
||||
|
@Column(name="FD_Z_LOWER") |
||||
|
private Double zLower; |
||||
|
|
||||
|
public CfgBinomial(){} |
||||
|
|
||||
|
public CfgBinomial(Double significanceLevel,Double confidenceLevel,Double zUpper,Double zLower){ |
||||
|
this.significanceLevel =significanceLevel; |
||||
|
this.confidenceLevel =confidenceLevel; |
||||
|
this.zUpper =zUpper; |
||||
|
this.zLower =zLower; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public CfgBinomialVo toVo() { |
||||
|
CfgBinomialVo vo =new CfgBinomialVo(); |
||||
|
super.toVo(vo); |
||||
|
vo.setId(this.getId()); |
||||
|
vo.setSignificanceLevel(this.getSignificanceLevel()); |
||||
|
vo.setConfidenceLevel(this.getConfidenceLevel()); |
||||
|
vo.setzUpper(this.getzUpper()); |
||||
|
vo.setzLower(this.getzLower()); |
||||
|
return vo; |
||||
|
} |
||||
|
|
||||
|
public static List<CfgBinomial> getDefaultValues(){ |
||||
|
List<CfgBinomial> result =new ArrayList<CfgBinomial>(); |
||||
|
result.add(new CfgBinomial(0.01 ,0.99 ,2.576 ,-2.576)); |
||||
|
result.add(new CfgBinomial(0.05 ,0.95 ,1.96 ,-1.96)); |
||||
|
result.add(new CfgBinomial(0.1 ,0.9 ,1.645 ,-1.645)); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
public String getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(String id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public Double getSignificanceLevel() { |
||||
|
return significanceLevel; |
||||
|
} |
||||
|
|
||||
|
public void setSignificanceLevel(Double significanceLevel) { |
||||
|
this.significanceLevel = significanceLevel; |
||||
|
} |
||||
|
|
||||
|
public Double getConfidenceLevel() { |
||||
|
return confidenceLevel; |
||||
|
} |
||||
|
|
||||
|
public void setConfidenceLevel(Double confidenceLevel) { |
||||
|
this.confidenceLevel = confidenceLevel; |
||||
|
} |
||||
|
|
||||
|
public Double getzUpper() { |
||||
|
return zUpper; |
||||
|
} |
||||
|
|
||||
|
public void setzUpper(Double zUpper) { |
||||
|
this.zUpper = zUpper; |
||||
|
} |
||||
|
|
||||
|
public Double getzLower() { |
||||
|
return zLower; |
||||
|
} |
||||
|
|
||||
|
public void setzLower(Double zLower) { |
||||
|
this.zLower = zLower; |
||||
|
} |
||||
|
} |
@ -0,0 +1,151 @@ |
|||||
|
package io.sc.engine.mv.jpa.entity; |
||||
|
|
||||
|
import io.sc.engine.mv.vo.CfgChiSquareVo; |
||||
|
import io.sc.platform.orm.entity.AuditorEntity; |
||||
|
import org.hibernate.annotations.GenericGenerator; |
||||
|
|
||||
|
import javax.persistence.*; |
||||
|
import javax.validation.constraints.Size; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 卡方检验临界值常量实体类 |
||||
|
* @author wangshaoping |
||||
|
* |
||||
|
*/ |
||||
|
@Entity |
||||
|
@Table(name="MV_CFG_CHI_SQUARE") |
||||
|
public class CfgChiSquare extends AuditorEntity<CfgChiSquareVo> { |
||||
|
//主键
|
||||
|
@Id |
||||
|
@GeneratedValue(generator = "system-uuid") |
||||
|
@GenericGenerator(name = "system-uuid", strategy = "uuid2") |
||||
|
@Column(name="FD_ID", length=36) |
||||
|
@Size(max=36) |
||||
|
private String id; |
||||
|
|
||||
|
//自由度
|
||||
|
@Column(name="FD_DOF") |
||||
|
private Integer dof; |
||||
|
|
||||
|
//显著水平
|
||||
|
@Column(name="FD_SIGNIFICANCE_LEVEL") |
||||
|
private Double significanceLevel; |
||||
|
|
||||
|
//临界值
|
||||
|
@Column(name="FD_CRITICAL_VALUE") |
||||
|
private Double criticalValue; |
||||
|
|
||||
|
public CfgChiSquare(){} |
||||
|
public CfgChiSquare(int dof,double significanceLevel,double criticalValue){ |
||||
|
this.dof =dof; |
||||
|
this.significanceLevel =significanceLevel; |
||||
|
this.criticalValue =criticalValue; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public CfgChiSquareVo toVo() { |
||||
|
CfgChiSquareVo vo =new CfgChiSquareVo(); |
||||
|
super.toVo(vo); |
||||
|
vo.setId(this.getId()); |
||||
|
vo.setDof(this.getDof()); |
||||
|
vo.setSignificanceLevel(this.getSignificanceLevel()); |
||||
|
vo.setCriticalValue(this.getCriticalValue()); |
||||
|
return vo; |
||||
|
} |
||||
|
|
||||
|
public static List<CfgChiSquare> getDefaultValues(){ |
||||
|
List<CfgChiSquare> result =new ArrayList<CfgChiSquare>(); |
||||
|
result.add(new CfgChiSquare(1, 0.1, 2.706)); |
||||
|
result.add(new CfgChiSquare(1, 0.05, 3.841)); |
||||
|
result.add(new CfgChiSquare(1, 0.01, 6.635)); |
||||
|
|
||||
|
result.add(new CfgChiSquare(2, 0.1, 4.605)); |
||||
|
result.add(new CfgChiSquare(2, 0.05, 5.991)); |
||||
|
result.add(new CfgChiSquare(2, 0.01, 9.210)); |
||||
|
|
||||
|
result.add(new CfgChiSquare(3, 0.1, 6.251)); |
||||
|
result.add(new CfgChiSquare(3, 0.05, 7.815)); |
||||
|
result.add(new CfgChiSquare(3, 0.01, 11.345)); |
||||
|
|
||||
|
result.add(new CfgChiSquare(4, 0.1, 7.779)); |
||||
|
result.add(new CfgChiSquare(4, 0.05, 9.488)); |
||||
|
result.add(new CfgChiSquare(4, 0.01, 13.277)); |
||||
|
|
||||
|
result.add(new CfgChiSquare(5, 0.1, 9.236)); |
||||
|
result.add(new CfgChiSquare(5, 0.05, 11.070)); |
||||
|
result.add(new CfgChiSquare(5, 0.01, 15.086)); |
||||
|
|
||||
|
result.add(new CfgChiSquare(6, 0.1, 10.645)); |
||||
|
result.add(new CfgChiSquare(6, 0.05, 12.592)); |
||||
|
result.add(new CfgChiSquare(6, 0.01, 16.812)); |
||||
|
|
||||
|
result.add(new CfgChiSquare(7, 0.1, 12.017)); |
||||
|
result.add(new CfgChiSquare(7, 0.05, 14.067)); |
||||
|
result.add(new CfgChiSquare(7, 0.01, 18.475)); |
||||
|
|
||||
|
result.add(new CfgChiSquare(8, 0.1, 13.362)); |
||||
|
result.add(new CfgChiSquare(8, 0.05, 15.507)); |
||||
|
result.add(new CfgChiSquare(8, 0.01, 20.09)); |
||||
|
|
||||
|
result.add(new CfgChiSquare(9, 0.1, 14.684)); |
||||
|
result.add(new CfgChiSquare(9, 0.05, 16.919)); |
||||
|
result.add(new CfgChiSquare(9, 0.01, 21.666)); |
||||
|
|
||||
|
result.add(new CfgChiSquare(10, 0.1, 15.987)); |
||||
|
result.add(new CfgChiSquare(10, 0.05, 18.307)); |
||||
|
result.add(new CfgChiSquare(10, 0.01, 23.209)); |
||||
|
|
||||
|
result.add(new CfgChiSquare(11, 0.1, 17.275)); |
||||
|
result.add(new CfgChiSquare(11, 0.05, 19.675)); |
||||
|
result.add(new CfgChiSquare(11, 0.01, 24.725)); |
||||
|
|
||||
|
result.add(new CfgChiSquare(12, 0.1, 18.549)); |
||||
|
result.add(new CfgChiSquare(12, 0.05, 21.026)); |
||||
|
result.add(new CfgChiSquare(12, 0.01, 26.217)); |
||||
|
|
||||
|
result.add(new CfgChiSquare(13, 0.1, 19.812)); |
||||
|
result.add(new CfgChiSquare(13, 0.05, 22.362)); |
||||
|
result.add(new CfgChiSquare(13, 0.01, 27.688)); |
||||
|
|
||||
|
result.add(new CfgChiSquare(14, 0.1, 21.064)); |
||||
|
result.add(new CfgChiSquare(14, 0.05, 23.685)); |
||||
|
result.add(new CfgChiSquare(14, 0.01, 29.141)); |
||||
|
|
||||
|
result.add(new CfgChiSquare(15, 0.1, 22.307)); |
||||
|
result.add(new CfgChiSquare(15, 0.05, 24.996)); |
||||
|
result.add(new CfgChiSquare(15, 0.01, 30.578)); |
||||
|
|
||||
|
result.add(new CfgChiSquare(16, 0.1, 23.542)); |
||||
|
result.add(new CfgChiSquare(16, 0.05, 26.296)); |
||||
|
result.add(new CfgChiSquare(16, 0.01, 32.000)); |
||||
|
|
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
public String getId() { |
||||
|
return id; |
||||
|
} |
||||
|
public void setId(String id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
public Integer getDof() { |
||||
|
return dof; |
||||
|
} |
||||
|
public void setDof(Integer dof) { |
||||
|
this.dof = dof; |
||||
|
} |
||||
|
public Double getSignificanceLevel() { |
||||
|
return significanceLevel; |
||||
|
} |
||||
|
public void setSignificanceLevel(Double significanceLevel) { |
||||
|
this.significanceLevel = significanceLevel; |
||||
|
} |
||||
|
public Double getCriticalValue() { |
||||
|
return criticalValue; |
||||
|
} |
||||
|
public void setCriticalValue(Double criticalValue) { |
||||
|
this.criticalValue = criticalValue; |
||||
|
} |
||||
|
} |
@ -0,0 +1,113 @@ |
|||||
|
package io.sc.engine.mv.jpa.entity; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
import javax.persistence.Column; |
||||
|
import javax.persistence.Entity; |
||||
|
import javax.persistence.GeneratedValue; |
||||
|
import javax.persistence.Id; |
||||
|
import javax.persistence.Table; |
||||
|
import javax.validation.constraints.Size; |
||||
|
|
||||
|
import io.sc.engine.mv.vo.CfgCustomerDistributionVo; |
||||
|
import io.sc.platform.orm.entity.AuditorEntity; |
||||
|
import org.hibernate.annotations.GenericGenerator; |
||||
|
|
||||
|
/** |
||||
|
* 咨询建模时客户分布情况实体类 |
||||
|
* @author wangshaoping |
||||
|
* |
||||
|
*/ |
||||
|
@Entity |
||||
|
@Table(name="MV_CFG_DISTRIBUTION") |
||||
|
public class CfgCustomerDistribution extends AuditorEntity<CfgCustomerDistributionVo> { |
||||
|
//主键
|
||||
|
@Id |
||||
|
@GeneratedValue(generator = "system-uuid") |
||||
|
@GenericGenerator(name = "system-uuid", strategy = "uuid2") |
||||
|
@Column(name="FD_ID", length=36) |
||||
|
@Size(max=36) |
||||
|
private String id; |
||||
|
|
||||
|
//模型标识
|
||||
|
@Column(name="FD_MODEL_ID", length=254) |
||||
|
@Size(max=254) |
||||
|
private String modelId; |
||||
|
|
||||
|
//模型名称
|
||||
|
@Column(name="FD_MODEL_NAME", length=254) |
||||
|
@Size(max=254) |
||||
|
private String modelName; |
||||
|
|
||||
|
//分数段开始值_含该值
|
||||
|
@Column(name="FD_SCORE_SEG_START") |
||||
|
private Double scoreSegStart; |
||||
|
|
||||
|
//分数段结束值_含该值
|
||||
|
@Column(name="FD_SCORE_SEG_END") |
||||
|
private Double scoreSegEnd; |
||||
|
|
||||
|
//评分在开始值和结束值段内的客户个数
|
||||
|
@Column(name="FD_COUNT") |
||||
|
private Long count; |
||||
|
|
||||
|
@Override |
||||
|
public CfgCustomerDistributionVo toVo() { |
||||
|
CfgCustomerDistributionVo vo =new CfgCustomerDistributionVo(); |
||||
|
super.toVo(vo); |
||||
|
vo.setId(this.getId()); |
||||
|
vo.setModelId(this.getModelId()); |
||||
|
vo.setModelName(this.getModelName()); |
||||
|
vo.setScoreSegStart(this.getScoreSegStart()); |
||||
|
vo.setScoreSegEnd(this.getScoreSegEnd()); |
||||
|
return vo; |
||||
|
} |
||||
|
|
||||
|
public String getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(String id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public String getModelId() { |
||||
|
return modelId; |
||||
|
} |
||||
|
|
||||
|
public void setModelId(String modelId) { |
||||
|
this.modelId = modelId; |
||||
|
} |
||||
|
|
||||
|
public String getModelName() { |
||||
|
return modelName; |
||||
|
} |
||||
|
|
||||
|
public void setModelName(String modelName) { |
||||
|
this.modelName = modelName; |
||||
|
} |
||||
|
|
||||
|
public Double getScoreSegStart() { |
||||
|
return scoreSegStart; |
||||
|
} |
||||
|
|
||||
|
public void setScoreSegStart(Double scoreSegStart) { |
||||
|
this.scoreSegStart = scoreSegStart; |
||||
|
} |
||||
|
|
||||
|
public Double getScoreSegEnd() { |
||||
|
return scoreSegEnd; |
||||
|
} |
||||
|
|
||||
|
public void setScoreSegEnd(Double scoreSegEnd) { |
||||
|
this.scoreSegEnd = scoreSegEnd; |
||||
|
} |
||||
|
|
||||
|
public Long getCount() { |
||||
|
return count; |
||||
|
} |
||||
|
|
||||
|
public void setCount(Long count) { |
||||
|
this.count = count; |
||||
|
} |
||||
|
} |
@ -0,0 +1,176 @@ |
|||||
|
package io.sc.engine.mv.jpa.entity; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.math.RoundingMode; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
import javax.persistence.Column; |
||||
|
import javax.persistence.Entity; |
||||
|
import javax.persistence.EnumType; |
||||
|
import javax.persistence.Enumerated; |
||||
|
import javax.persistence.GeneratedValue; |
||||
|
import javax.persistence.Id; |
||||
|
import javax.persistence.Table; |
||||
|
import javax.validation.constraints.Size; |
||||
|
|
||||
|
import io.sc.engine.mv.vo.CfgCutOffPointVo; |
||||
|
import io.sc.platform.orm.entity.AuditorEntity; |
||||
|
import org.hibernate.annotations.GenericGenerator; |
||||
|
|
||||
|
@Entity |
||||
|
@Table(name="MV_CFG_CUT_OFF_POINT") |
||||
|
public class CfgCutOffPoint extends AuditorEntity<CfgCutOffPointVo> { |
||||
|
public static final String CUT_OFF_ROC ="ROC-评分截断点配置(总体)"; |
||||
|
public static final String CUT_OFF_ROC_QUANTITATIVE ="ROC-评分截断点配置(定量)"; |
||||
|
public static final String CUT_OFF_ROC_QUALITATIVE ="ROC-评分截断点配置(定性)"; |
||||
|
|
||||
|
public static final String CUT_OFF_CAP ="CAP-评分截断点配置(总体)"; |
||||
|
public static final String CUT_OFF_CAP_QUANTITATIVE ="CAP-评分截断点配置(定量)"; |
||||
|
public static final String CUT_OFF_CAP_QUALITATIVE ="CAP-评分截断点配置(定性)"; |
||||
|
|
||||
|
public static final String CUT_OFF_KS ="KS-评分截断点配置(总体)"; |
||||
|
public static final String CUT_OFF_KS_QUANTITATIVE ="KS-评分截断点配置(定量)"; |
||||
|
public static final String CUT_OFF_KS_QUALITATIVE ="KS-评分截断点配置(定性)"; |
||||
|
|
||||
|
private static final long serialVersionUID = 436183145838373764L; |
||||
|
|
||||
|
private static final String[] supportedCutOffPointNames =new String[]{ |
||||
|
CUT_OFF_ROC, |
||||
|
CUT_OFF_ROC_QUANTITATIVE, |
||||
|
CUT_OFF_ROC_QUALITATIVE, |
||||
|
CUT_OFF_CAP, |
||||
|
CUT_OFF_CAP_QUANTITATIVE, |
||||
|
CUT_OFF_CAP_QUALITATIVE, |
||||
|
CUT_OFF_KS, |
||||
|
CUT_OFF_KS_QUANTITATIVE, |
||||
|
CUT_OFF_KS_QUALITATIVE |
||||
|
}; |
||||
|
|
||||
|
public static String[] getSupportedCutOffPointNames(){ |
||||
|
return supportedCutOffPointNames; |
||||
|
} |
||||
|
|
||||
|
//主键
|
||||
|
@Id |
||||
|
@GeneratedValue(generator = "system-uuid") |
||||
|
@GenericGenerator(name = "system-uuid", strategy = "uuid2") |
||||
|
@Column(name="FD_ID", length=36) |
||||
|
@Size(max=36) |
||||
|
private String id; |
||||
|
|
||||
|
//截断点配置名称
|
||||
|
@Column(name="FD_NAME", length=254) |
||||
|
@Size(max=254) |
||||
|
private String name; |
||||
|
|
||||
|
//截断点起始值
|
||||
|
@Column(name="FD_FROM", length=32) |
||||
|
@Size(max=32) |
||||
|
private String from; |
||||
|
|
||||
|
//截断点结束值
|
||||
|
@Column(name="FD_TO", length=32) |
||||
|
@Size(max=32) |
||||
|
private String to; |
||||
|
|
||||
|
//截断点增量值
|
||||
|
@Column(name="FD_STEP", length=32) |
||||
|
@Size(max=32) |
||||
|
private String step; |
||||
|
|
||||
|
//截断点值精度
|
||||
|
@Column(name="FD_SCALE") |
||||
|
private Integer scale; |
||||
|
|
||||
|
//截断点四舍五入模式
|
||||
|
@Column(name="FD_ROUNDING_MODE") |
||||
|
@Enumerated(EnumType.STRING) |
||||
|
private RoundingMode roundingMode; |
||||
|
|
||||
|
@Override |
||||
|
public CfgCutOffPointVo toVo() { |
||||
|
CfgCutOffPointVo vo =new CfgCutOffPointVo(); |
||||
|
super.toVo(vo); |
||||
|
vo.setId(this.getId()); |
||||
|
vo.setName(this.getName()); |
||||
|
vo.setFrom(this.getFrom()); |
||||
|
vo.setTo(this.getTo()); |
||||
|
vo.setStep(this.getStep()); |
||||
|
vo.setScale(this.getScale()); |
||||
|
vo.setRoundingMode(this.getRoundingMode()); |
||||
|
return vo; |
||||
|
} |
||||
|
|
||||
|
public static List<CfgCutOffPoint> getDefaultValues(){ |
||||
|
List<CfgCutOffPoint> result =new ArrayList<CfgCutOffPoint>(); |
||||
|
|
||||
|
for(String name : supportedCutOffPointNames){ |
||||
|
CfgCutOffPoint cp =new CfgCutOffPoint(); |
||||
|
cp.setName(name); |
||||
|
cp.setFrom("0"); |
||||
|
cp.setTo("100"); |
||||
|
cp.setStep("5"); |
||||
|
cp.setScale(0); |
||||
|
cp.setRoundingMode(RoundingMode.HALF_UP); |
||||
|
result.add(cp); |
||||
|
} |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
public String getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(String id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public String getName() { |
||||
|
return name; |
||||
|
} |
||||
|
|
||||
|
public void setName(String name) { |
||||
|
this.name = name; |
||||
|
} |
||||
|
|
||||
|
public String getFrom() { |
||||
|
return from; |
||||
|
} |
||||
|
|
||||
|
public void setFrom(String from) { |
||||
|
this.from = from; |
||||
|
} |
||||
|
|
||||
|
public String getTo() { |
||||
|
return to; |
||||
|
} |
||||
|
|
||||
|
public void setTo(String to) { |
||||
|
this.to = to; |
||||
|
} |
||||
|
|
||||
|
public String getStep() { |
||||
|
return step; |
||||
|
} |
||||
|
|
||||
|
public void setStep(String step) { |
||||
|
this.step = step; |
||||
|
} |
||||
|
|
||||
|
public Integer getScale() { |
||||
|
return scale; |
||||
|
} |
||||
|
|
||||
|
public void setScale(Integer scale) { |
||||
|
this.scale = scale; |
||||
|
} |
||||
|
|
||||
|
public RoundingMode getRoundingMode() { |
||||
|
return roundingMode; |
||||
|
} |
||||
|
|
||||
|
public void setRoundingMode(RoundingMode roundingMode) { |
||||
|
this.roundingMode = roundingMode; |
||||
|
} |
||||
|
} |
@ -0,0 +1,121 @@ |
|||||
|
package io.sc.engine.mv.jpa.entity; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
import javax.persistence.*; |
||||
|
|
||||
|
import io.sc.engine.mv.vo.CfgDataExtractorVo; |
||||
|
import io.sc.platform.orm.converter.NumericBooleanConverter; |
||||
|
import io.sc.platform.orm.entity.AuditorEntity; |
||||
|
import org.hibernate.annotations.GenericGenerator; |
||||
|
|
||||
|
/** |
||||
|
* 数据抽取器配置实体类 |
||||
|
* @author wangshaoping |
||||
|
* |
||||
|
*/ |
||||
|
@Entity |
||||
|
@Table(name="MV_CFG_DATA_EXTRACTOR") |
||||
|
public class CfgDataExtractor extends AuditorEntity<CfgDataExtractorVo> { |
||||
|
//主键
|
||||
|
@Id |
||||
|
@GeneratedValue(generator = "system-uuid") |
||||
|
@GenericGenerator(name = "system-uuid", strategy = "uuid2") |
||||
|
@Column(name="FD_ID", length=36) |
||||
|
private String id; |
||||
|
|
||||
|
//名称
|
||||
|
@Column(name="FD_NAME", length=254) |
||||
|
private String name; |
||||
|
|
||||
|
//是否可用
|
||||
|
@Column(name="FD_ENABLE", length=254) |
||||
|
@Convert(converter= NumericBooleanConverter.class) |
||||
|
private Boolean enable =true; |
||||
|
|
||||
|
//执行顺序
|
||||
|
@Column(name="FD_ORDER") |
||||
|
private Integer order; |
||||
|
|
||||
|
//预计执行时间权重
|
||||
|
@Column(name="FD_EXECUTE_TIME_WEIGHT") |
||||
|
private Integer executeTimeWeight; |
||||
|
|
||||
|
//数据源名称
|
||||
|
@Column(name="FD_DATASOURCE_NAME") |
||||
|
private String datasourceName; |
||||
|
|
||||
|
//执行 groovy 脚本
|
||||
|
@Column(name="FD_GROOVY_SCRIPT") |
||||
|
private String groovyScript; |
||||
|
|
||||
|
@Override |
||||
|
public CfgDataExtractorVo toVo() { |
||||
|
CfgDataExtractorVo vo =new CfgDataExtractorVo(); |
||||
|
super.toVo(vo); |
||||
|
vo.setId(this.getId()); |
||||
|
vo.setName(this.getName()); |
||||
|
vo.setEnable(this.getEnable()); |
||||
|
vo.setOrder(this.getOrder()); |
||||
|
vo.setExecuteTimeWeight(this.getExecuteTimeWeight()); |
||||
|
vo.setDatasourceName(this.getDatasourceName()); |
||||
|
vo.setGroovyScript(this.getGroovyScript()); |
||||
|
return vo; |
||||
|
} |
||||
|
|
||||
|
public String getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(String id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public String getName() { |
||||
|
return name; |
||||
|
} |
||||
|
|
||||
|
public void setName(String name) { |
||||
|
this.name = name; |
||||
|
} |
||||
|
|
||||
|
public Boolean getEnable() { |
||||
|
return enable; |
||||
|
} |
||||
|
|
||||
|
public void setEnable(Boolean enable) { |
||||
|
this.enable = enable; |
||||
|
} |
||||
|
|
||||
|
public Integer getOrder() { |
||||
|
return order; |
||||
|
} |
||||
|
|
||||
|
public void setOrder(Integer order) { |
||||
|
this.order = order; |
||||
|
} |
||||
|
|
||||
|
public Integer getExecuteTimeWeight() { |
||||
|
return executeTimeWeight; |
||||
|
} |
||||
|
|
||||
|
public void setExecuteTimeWeight(Integer executeTimeWeight) { |
||||
|
this.executeTimeWeight = executeTimeWeight; |
||||
|
} |
||||
|
|
||||
|
public String getDatasourceName() { |
||||
|
return datasourceName; |
||||
|
} |
||||
|
|
||||
|
public void setDatasourceName(String datasourceName) { |
||||
|
this.datasourceName = datasourceName; |
||||
|
} |
||||
|
|
||||
|
public String getGroovyScript() { |
||||
|
return groovyScript; |
||||
|
} |
||||
|
|
||||
|
public void setGroovyScript(String groovyScript) { |
||||
|
this.groovyScript = groovyScript; |
||||
|
} |
||||
|
} |
@ -0,0 +1,87 @@ |
|||||
|
package io.sc.engine.mv.jpa.entity; |
||||
|
|
||||
|
import io.sc.engine.mv.ModelType; |
||||
|
import io.sc.engine.mv.vo.CfgModelVo; |
||||
|
import io.sc.platform.orm.entity.AuditorEntity; |
||||
|
import org.hibernate.annotations.GenericGenerator; |
||||
|
|
||||
|
import javax.persistence.*; |
||||
|
|
||||
|
/** |
||||
|
* 模型列表实体类 |
||||
|
* @author wangshaoping |
||||
|
* |
||||
|
*/ |
||||
|
@Entity |
||||
|
@Table(name="MV_CFG_MODEL") |
||||
|
public class CfgModel extends AuditorEntity<CfgModelVo> { |
||||
|
@Id |
||||
|
@GeneratedValue(generator = "system-uuid") |
||||
|
@GenericGenerator(name = "system-uuid", strategy = "uuid2") |
||||
|
@Column(name="FD_ID", length=36) |
||||
|
private String id; |
||||
|
|
||||
|
//模型标识
|
||||
|
@Column(name="FD_MODEL_ID") |
||||
|
private String modelId; |
||||
|
|
||||
|
//模型名称
|
||||
|
@Column(name="FD_MODEL_NAME") |
||||
|
private String modelName; |
||||
|
|
||||
|
//模型创建类型
|
||||
|
@Column(name="FD_TYPE") |
||||
|
@Enumerated(EnumType.STRING) |
||||
|
private ModelType type; |
||||
|
|
||||
|
public CfgModel(){} |
||||
|
|
||||
|
public CfgModel(String modelId,String modelName,ModelType type){ |
||||
|
this.modelId =modelId; |
||||
|
this.modelName =modelName; |
||||
|
this.type =type; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public CfgModelVo toVo() { |
||||
|
CfgModelVo vo =new CfgModelVo(); |
||||
|
super.toVo(vo); |
||||
|
vo.setId(this.getId()); |
||||
|
vo.setModelId(this.getModelId()); |
||||
|
vo.setModelName(this.getModelName()); |
||||
|
vo.setType(this.getType()); |
||||
|
return vo; |
||||
|
} |
||||
|
|
||||
|
public String getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(String id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public String getModelId() { |
||||
|
return modelId; |
||||
|
} |
||||
|
|
||||
|
public void setModelId(String modelId) { |
||||
|
this.modelId = modelId; |
||||
|
} |
||||
|
|
||||
|
public String getModelName() { |
||||
|
return modelName; |
||||
|
} |
||||
|
|
||||
|
public void setModelName(String modelName) { |
||||
|
this.modelName = modelName; |
||||
|
} |
||||
|
|
||||
|
public ModelType getType() { |
||||
|
return type; |
||||
|
} |
||||
|
|
||||
|
public void setType(ModelType type) { |
||||
|
this.type = type; |
||||
|
} |
||||
|
} |
@ -0,0 +1,105 @@ |
|||||
|
package io.sc.engine.mv.jpa.entity; |
||||
|
|
||||
|
import io.sc.engine.mv.vo.CfgScaleVo; |
||||
|
import io.sc.platform.orm.entity.AuditorEntity; |
||||
|
import org.hibernate.annotations.GenericGenerator; |
||||
|
|
||||
|
import javax.persistence.*; |
||||
|
|
||||
|
/** |
||||
|
* 标尺实体类 |
||||
|
* @author wangshaoping |
||||
|
* |
||||
|
*/ |
||||
|
@Entity |
||||
|
@Table(name="MV_CFG_SCALE") |
||||
|
public class CfgScale extends AuditorEntity<CfgScaleVo> { |
||||
|
//主键
|
||||
|
@Id |
||||
|
@GeneratedValue(generator = "system-uuid") |
||||
|
@GenericGenerator(name = "system-uuid", strategy = "uuid2") |
||||
|
@Column(name="FD_ID", length=36) |
||||
|
private String id; |
||||
|
|
||||
|
//模型ID
|
||||
|
@Column(name="FD_MODEL_ID") |
||||
|
private String modelId; |
||||
|
|
||||
|
//模型名称
|
||||
|
@Column(name="FD_MODEL_NAME") |
||||
|
private String modelName; |
||||
|
|
||||
|
//评级等级
|
||||
|
@Column(name="FD_LEVEL") |
||||
|
private String level; |
||||
|
|
||||
|
//违约概率
|
||||
|
@Column(name="FD_PD") |
||||
|
private Double pd; |
||||
|
|
||||
|
//排序
|
||||
|
@Column(name="FD_ORDER") |
||||
|
private Integer order; |
||||
|
|
||||
|
@Override |
||||
|
public CfgScaleVo toVo() { |
||||
|
CfgScaleVo vo =new CfgScaleVo(); |
||||
|
super.toVo(vo); |
||||
|
vo.setId(this.getId()); |
||||
|
vo.setModelId(this.getModelId()); |
||||
|
vo.setModelName(this.getModelName()); |
||||
|
vo.setLevel(this.getLevel()); |
||||
|
vo.setPd(this.getPd()); |
||||
|
vo.setOrder(this.getOrder()); |
||||
|
return vo; |
||||
|
} |
||||
|
|
||||
|
public String getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(String id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public String getModelId() { |
||||
|
return modelId; |
||||
|
} |
||||
|
|
||||
|
public void setModelId(String modelId) { |
||||
|
this.modelId = modelId; |
||||
|
} |
||||
|
|
||||
|
public String getModelName() { |
||||
|
return modelName; |
||||
|
} |
||||
|
|
||||
|
public void setModelName(String modelName) { |
||||
|
this.modelName = modelName; |
||||
|
} |
||||
|
|
||||
|
public String getLevel() { |
||||
|
return level; |
||||
|
} |
||||
|
|
||||
|
public void setLevel(String level) { |
||||
|
this.level = level; |
||||
|
} |
||||
|
|
||||
|
public Double getPd() { |
||||
|
return pd; |
||||
|
} |
||||
|
|
||||
|
public void setPd(Double pd) { |
||||
|
this.pd = pd; |
||||
|
} |
||||
|
|
||||
|
public Integer getOrder() { |
||||
|
return order; |
||||
|
} |
||||
|
|
||||
|
public void setOrder(Integer order) { |
||||
|
this.order = order; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,141 @@ |
|||||
|
package io.sc.engine.mv.jpa.entity; |
||||
|
|
||||
|
import io.sc.engine.mv.vo.CfgThresholdVo; |
||||
|
import io.sc.platform.orm.entity.AuditorEntity; |
||||
|
import org.hibernate.annotations.GenericGenerator; |
||||
|
|
||||
|
import javax.persistence.*; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 模型验证预警阈值配置实体类 |
||||
|
* @author wangshaoping |
||||
|
* |
||||
|
*/ |
||||
|
@Entity |
||||
|
@Table(name="MV_CFG_THRESHOLD") |
||||
|
public class CfgThreshold extends AuditorEntity<CfgThresholdVo> { |
||||
|
//主键
|
||||
|
@Id |
||||
|
@GeneratedValue(generator = "system-uuid") |
||||
|
@GenericGenerator(name = "system-uuid", strategy = "uuid2") |
||||
|
@Column(name="FD_ID", length=32) |
||||
|
private String id; |
||||
|
|
||||
|
//阈值名称
|
||||
|
@Column(name="FD_NAME", length=254) |
||||
|
private String name; |
||||
|
|
||||
|
//等级(越大越好)
|
||||
|
@Column(name="FD_LEVEL", length=254) |
||||
|
private Integer level; |
||||
|
|
||||
|
//颜色
|
||||
|
@Column(name="FD_COLOR", length=254) |
||||
|
private String color; |
||||
|
|
||||
|
//阈值范围
|
||||
|
@Column(name="FD_RANGE", length=254) |
||||
|
private String range; |
||||
|
|
||||
|
//阈值范围(定量)
|
||||
|
@Column(name="FD_QUANTITATIVE_RANGE", length=254) |
||||
|
private String quantitativeRange; |
||||
|
|
||||
|
//阈值范围(定性)
|
||||
|
@Column(name="FD_QUALITATIVE_RANGE", length=254) |
||||
|
private String qualitativeRange; |
||||
|
|
||||
|
public CfgThreshold(){} |
||||
|
public CfgThreshold(String name,int level,String color,String range,String quantitativeRange,String qualitativeRange){ |
||||
|
this.name =name; |
||||
|
this.level =level; |
||||
|
this.color =color; |
||||
|
this.range =range; |
||||
|
this.quantitativeRange =quantitativeRange; |
||||
|
this.qualitativeRange =qualitativeRange; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public CfgThresholdVo toVo() { |
||||
|
CfgThresholdVo vo =new CfgThresholdVo(); |
||||
|
super.toVo(vo); |
||||
|
vo.setId(this.getId()); |
||||
|
vo.setName(this.getName()); |
||||
|
vo.setLevel(this.getLevel()); |
||||
|
vo.setColor(this.getColor()); |
||||
|
vo.setRange(this.getRange()); |
||||
|
vo.setQualitativeRange(this.getQualitativeRange()); |
||||
|
vo.setQuantitativeRange(this.getQuantitativeRange()); |
||||
|
return vo; |
||||
|
} |
||||
|
|
||||
|
public static List<CfgThreshold> getDefaultValues(){ |
||||
|
List<CfgThreshold> result =new ArrayList<CfgThreshold>(); |
||||
|
result.add(new CfgThreshold("AUC", 1, "red" , "(-,0.65)", "(-,0.65)", "(-,0.65)")); |
||||
|
result.add(new CfgThreshold("AUC", 2, "#FF9900", "[0.65,0.75)","[0.65,0.75)","[0.65,0.75)")); |
||||
|
result.add(new CfgThreshold("AUC", 3, "green", "[0.75,-)", "[0.75,-)", "[0.75,-)")); |
||||
|
|
||||
|
result.add(new CfgThreshold("AR", 1, "red" , "(-,0.3)", "(-,0.3)", "(-,0.3)")); |
||||
|
result.add(new CfgThreshold("AR", 2, "#FF9900", "[0.3,0.5)","[0.3,0.5)","[0.3,0.5)")); |
||||
|
result.add(new CfgThreshold("AR", 3, "green", "[0.5,-)", "[0.5,-)", "[0.5,-)")); |
||||
|
|
||||
|
result.add(new CfgThreshold("KS", 1, "red" , "(-,0.2)", "(-,0.2)", "(-,0.2)")); |
||||
|
result.add(new CfgThreshold("KS", 2, "#FF9900", "[0.2,0.4)","[0.2,0.4)","[0.2,0.4)")); |
||||
|
result.add(new CfgThreshold("KS", 3, "green", "[0.4,-)", "[0.4,-)", "[0.4,-)")); |
||||
|
|
||||
|
result.add(new CfgThreshold("SVD", 1, "red", "(0.25,-)", null,null)); |
||||
|
result.add(new CfgThreshold("SVD", 2, "#FF9900", "[0.1,0.25]", null,null)); |
||||
|
result.add(new CfgThreshold("SVD", 3, "green", "(-,0.1)", null,null)); |
||||
|
|
||||
|
result.add(new CfgThreshold("PSI", 1, "red", "(0.5,-)", null,null)); |
||||
|
result.add(new CfgThreshold("PSI", 2, "#FF9900", "[0.25,0.5)", null,null)); |
||||
|
result.add(new CfgThreshold("PSI", 3, "green", "(-,0.25)", null,null)); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
public String getId() { |
||||
|
return id; |
||||
|
} |
||||
|
public void setId(String id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
public String getName() { |
||||
|
return name; |
||||
|
} |
||||
|
public void setName(String name) { |
||||
|
this.name = name; |
||||
|
} |
||||
|
public Integer getLevel() { |
||||
|
return level; |
||||
|
} |
||||
|
public void setLevel(Integer level) { |
||||
|
this.level = level; |
||||
|
} |
||||
|
public String getColor() { |
||||
|
return color; |
||||
|
} |
||||
|
public void setColor(String color) { |
||||
|
this.color = color; |
||||
|
} |
||||
|
public String getRange() { |
||||
|
return range; |
||||
|
} |
||||
|
public void setRange(String range) { |
||||
|
this.range = range; |
||||
|
} |
||||
|
public String getQuantitativeRange() { |
||||
|
return quantitativeRange; |
||||
|
} |
||||
|
public void setQuantitativeRange(String quantitativeRange) { |
||||
|
this.quantitativeRange = quantitativeRange; |
||||
|
} |
||||
|
public String getQualitativeRange() { |
||||
|
return qualitativeRange; |
||||
|
} |
||||
|
public void setQualitativeRange(String qualitativeRange) { |
||||
|
this.qualitativeRange = qualitativeRange; |
||||
|
} |
||||
|
} |
@ -0,0 +1,14 @@ |
|||||
|
package io.sc.engine.mv.jpa.repository; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
import io.sc.engine.mv.jpa.entity.CfgBinomial; |
||||
|
import io.sc.platform.orm.repository.DaoRepository; |
||||
|
import org.springframework.data.jpa.repository.Query; |
||||
|
|
||||
|
public interface CfgBinomialRepository extends DaoRepository<CfgBinomial,String> { |
||||
|
public CfgBinomial findBySignificanceLevel(Double significanceLevel); |
||||
|
|
||||
|
@Query("select distinct e.significanceLevel from CfgBinomial e order by e.significanceLevel") |
||||
|
public List<Double> findDistinctSignificanceLevel(); |
||||
|
} |
@ -0,0 +1,15 @@ |
|||||
|
package io.sc.engine.mv.jpa.repository; |
||||
|
|
||||
|
import io.sc.engine.mv.jpa.entity.CfgChiSquare; |
||||
|
import io.sc.platform.orm.repository.DaoRepository; |
||||
|
import org.springframework.data.jpa.repository.Query; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
public interface CfgChiSquareRepository extends DaoRepository<CfgChiSquare,String> { |
||||
|
|
||||
|
public CfgChiSquare findByDofAndSignificanceLevel(int dof,double significanceLevel); |
||||
|
|
||||
|
@Query("select distinct e.significanceLevel from CfgChiSquare e order by e.significanceLevel") |
||||
|
public List<Double> findDistinctSignificanceLevel(); |
||||
|
} |
@ -0,0 +1,9 @@ |
|||||
|
package io.sc.engine.mv.jpa.repository; |
||||
|
|
||||
|
|
||||
|
import io.sc.engine.mv.jpa.entity.CfgCustomerDistribution; |
||||
|
import io.sc.platform.orm.repository.DaoRepository; |
||||
|
|
||||
|
public interface CfgCustomerDistributionRepository extends DaoRepository<CfgCustomerDistribution,String> { |
||||
|
|
||||
|
} |
@ -0,0 +1,10 @@ |
|||||
|
package io.sc.engine.mv.jpa.repository; |
||||
|
|
||||
|
|
||||
|
import io.sc.engine.mv.jpa.entity.CfgCutOffPoint; |
||||
|
import io.sc.platform.orm.repository.DaoRepository; |
||||
|
|
||||
|
public interface CfgCutOffPointRepository extends DaoRepository<CfgCutOffPoint,String> { |
||||
|
|
||||
|
public CfgCutOffPoint findByName(String name); |
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
package io.sc.engine.mv.jpa.repository; |
||||
|
|
||||
|
import io.sc.engine.mv.jpa.entity.CfgDataExtractor; |
||||
|
import io.sc.platform.orm.repository.DaoRepository; |
||||
|
import org.springframework.data.jpa.repository.Modifying; |
||||
|
import org.springframework.data.jpa.repository.Query; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
public interface CfgDataExtractorRepository extends DaoRepository<CfgDataExtractor,String> { |
||||
|
public List<CfgDataExtractor> findByEnableOrderByOrder(boolean enable); |
||||
|
|
||||
|
public CfgDataExtractor findByName(String name); |
||||
|
|
||||
|
@Modifying |
||||
|
@Transactional |
||||
|
@Query("delete from CfgDataExtractor de where de.name=?1") |
||||
|
public void deleteByName(String name); |
||||
|
|
||||
|
} |
@ -0,0 +1,15 @@ |
|||||
|
package io.sc.engine.mv.jpa.repository; |
||||
|
|
||||
|
import io.sc.engine.mv.jpa.entity.CfgModel; |
||||
|
import io.sc.platform.orm.repository.DaoRepository; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
public interface CfgModelRepository extends DaoRepository<CfgModel,String> { |
||||
|
|
||||
|
public CfgModel findByModelId(String modelId); |
||||
|
|
||||
|
public List<CfgModel> findAllByOrderByModelName(); |
||||
|
|
||||
|
} |
@ -0,0 +1,15 @@ |
|||||
|
package io.sc.engine.mv.jpa.repository; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
import io.sc.engine.mv.jpa.entity.CfgScale; |
||||
|
import io.sc.platform.orm.repository.DaoRepository; |
||||
|
import org.springframework.data.jpa.repository.Query; |
||||
|
|
||||
|
public interface CfgScaleRepository extends DaoRepository<CfgScale,String> { |
||||
|
|
||||
|
public List<CfgScale> findByModelIdOrderByOrder(String modelId); |
||||
|
|
||||
|
@Query("select de from CfgScale de where de.modelId is null order by de.order") |
||||
|
public List<CfgScale> findByNullModelIdOrderByOrder(); |
||||
|
} |
@ -0,0 +1,14 @@ |
|||||
|
package io.sc.engine.mv.jpa.repository; |
||||
|
|
||||
|
import io.sc.engine.mv.jpa.entity.CfgThreshold; |
||||
|
import io.sc.platform.orm.repository.DaoRepository; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
public interface CfgThresholdRepository extends DaoRepository<CfgThreshold,String> { |
||||
|
|
||||
|
public List<CfgThreshold> findByName(String name); |
||||
|
|
||||
|
public CfgThreshold findByNameAndLevel(String name,int level); |
||||
|
} |
@ -0,0 +1,9 @@ |
|||||
|
package io.sc.engine.mv.service.configuration; |
||||
|
|
||||
|
import io.sc.engine.mv.jpa.entity.CfgBinomial; |
||||
|
import io.sc.engine.mv.jpa.repository.CfgBinomialRepository; |
||||
|
import io.sc.platform.orm.service.DaoService; |
||||
|
|
||||
|
public interface CfgBinomialService extends DaoService<CfgBinomial, String, CfgBinomialRepository> { |
||||
|
|
||||
|
} |
@ -0,0 +1,10 @@ |
|||||
|
package io.sc.engine.mv.service.configuration; |
||||
|
|
||||
|
|
||||
|
import io.sc.engine.mv.jpa.entity.CfgChiSquare; |
||||
|
import io.sc.engine.mv.jpa.repository.CfgChiSquareRepository; |
||||
|
import io.sc.platform.orm.service.DaoService; |
||||
|
|
||||
|
public interface CfgChiSquareService extends DaoService<CfgChiSquare, String, CfgChiSquareRepository> { |
||||
|
|
||||
|
} |
@ -0,0 +1,10 @@ |
|||||
|
package io.sc.engine.mv.service.configuration; |
||||
|
|
||||
|
|
||||
|
import io.sc.engine.mv.jpa.entity.CfgCustomerDistribution; |
||||
|
import io.sc.engine.mv.jpa.repository.CfgCustomerDistributionRepository; |
||||
|
import io.sc.platform.orm.service.DaoService; |
||||
|
|
||||
|
public interface CfgCustomerDistributionService extends DaoService<CfgCustomerDistribution, String, CfgCustomerDistributionRepository> { |
||||
|
|
||||
|
} |
@ -0,0 +1,12 @@ |
|||||
|
package io.sc.engine.mv.service.configuration; |
||||
|
|
||||
|
|
||||
|
import io.sc.engine.mv.jpa.entity.CfgCutOffPoint; |
||||
|
import io.sc.engine.mv.jpa.repository.CfgCutOffPointRepository; |
||||
|
import io.sc.platform.orm.service.DaoService; |
||||
|
|
||||
|
public interface CfgCutOffPointService extends DaoService<CfgCutOffPoint, String, CfgCutOffPointRepository> { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
@ -0,0 +1,13 @@ |
|||||
|
package io.sc.engine.mv.service.configuration; |
||||
|
|
||||
|
|
||||
|
import io.sc.engine.mv.jpa.entity.CfgDataExtractor; |
||||
|
import io.sc.engine.mv.jpa.repository.CfgDataExtractorRepository; |
||||
|
import io.sc.platform.orm.service.DaoService; |
||||
|
|
||||
|
public interface CfgDataExtractorService extends DaoService<CfgDataExtractor, String, CfgDataExtractorRepository> { |
||||
|
|
||||
|
public void test(CfgDataExtractor object) throws Exception; |
||||
|
public void generateSample() throws Exception; |
||||
|
|
||||
|
} |
@ -0,0 +1,15 @@ |
|||||
|
package io.sc.engine.mv.service.configuration; |
||||
|
|
||||
|
import io.sc.engine.mv.jpa.entity.CfgModel; |
||||
|
import io.sc.engine.mv.jpa.repository.CfgModelRepository; |
||||
|
import io.sc.platform.orm.service.DaoService; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
public interface CfgModelService extends DaoService<CfgModel, String, CfgModelRepository> { |
||||
|
/** |
||||
|
* 从评分记录表中导入所有模型配置 |
||||
|
*/ |
||||
|
public void importFromScoreRecord(); |
||||
|
} |
@ -0,0 +1,10 @@ |
|||||
|
package io.sc.engine.mv.service.configuration; |
||||
|
|
||||
|
|
||||
|
import io.sc.engine.mv.jpa.entity.CfgScale; |
||||
|
import io.sc.engine.mv.jpa.repository.CfgScaleRepository; |
||||
|
import io.sc.platform.orm.service.DaoService; |
||||
|
|
||||
|
public interface CfgScaleService extends DaoService<CfgScale, String, CfgScaleRepository> { |
||||
|
|
||||
|
} |
@ -0,0 +1,10 @@ |
|||||
|
package io.sc.engine.mv.service.configuration; |
||||
|
|
||||
|
|
||||
|
import io.sc.engine.mv.jpa.entity.CfgThreshold; |
||||
|
import io.sc.engine.mv.jpa.repository.CfgThresholdRepository; |
||||
|
import io.sc.platform.orm.service.DaoService; |
||||
|
|
||||
|
public interface CfgThresholdService extends DaoService<CfgThreshold, String, CfgThresholdRepository> { |
||||
|
|
||||
|
} |
@ -0,0 +1,24 @@ |
|||||
|
package io.sc.engine.mv.service.configuration.impl; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
import io.sc.engine.mv.jpa.entity.CfgBinomial; |
||||
|
import io.sc.engine.mv.jpa.repository.CfgBinomialRepository; |
||||
|
import io.sc.engine.mv.service.configuration.CfgBinomialService; |
||||
|
import io.sc.platform.orm.service.impl.DaoServiceImpl; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
@Service |
||||
|
public class CfgBinomialServiceImpl extends DaoServiceImpl<CfgBinomial, String, CfgBinomialRepository> implements CfgBinomialService { |
||||
|
|
||||
|
@Override |
||||
|
public CfgBinomial findByUniqueKey(CfgBinomial entity) { |
||||
|
return repository.findBySignificanceLevel(entity.getSignificanceLevel()); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<CfgBinomial> getDefaultValues() throws Exception { |
||||
|
return CfgBinomial.getDefaultValues(); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,28 @@ |
|||||
|
package io.sc.engine.mv.service.configuration.impl; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
import io.sc.engine.mv.jpa.entity.CfgChiSquare; |
||||
|
import io.sc.engine.mv.jpa.repository.CfgChiSquareRepository; |
||||
|
import io.sc.engine.mv.service.configuration.CfgChiSquareService; |
||||
|
import io.sc.platform.orm.service.impl.DaoServiceImpl; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
@Service |
||||
|
public class CfgChiSquareServiceImpl extends DaoServiceImpl<CfgChiSquare, String, CfgChiSquareRepository> implements CfgChiSquareService { |
||||
|
|
||||
|
@Override |
||||
|
public String[] getDefaultSortBy() { |
||||
|
return new String[]{"dof","significanceLevel"}; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public CfgChiSquare findByUniqueKey(CfgChiSquare entity) { |
||||
|
return repository.findByDofAndSignificanceLevel(entity.getDof(), entity.getSignificanceLevel()); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<CfgChiSquare> getDefaultValues() throws Exception { |
||||
|
return CfgChiSquare.getDefaultValues(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
package io.sc.engine.mv.service.configuration.impl; |
||||
|
|
||||
|
import io.sc.engine.mv.jpa.entity.CfgCustomerDistribution; |
||||
|
import io.sc.engine.mv.jpa.repository.CfgCustomerDistributionRepository; |
||||
|
import io.sc.engine.mv.service.configuration.CfgCustomerDistributionService; |
||||
|
import io.sc.platform.orm.service.impl.DaoServiceImpl; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
@Service |
||||
|
public class CfgCustomerDistributionServiceImpl extends DaoServiceImpl<CfgCustomerDistribution, String, CfgCustomerDistributionRepository> implements CfgCustomerDistributionService { |
||||
|
|
||||
|
@Override |
||||
|
public String[] getDefaultSortBy() { |
||||
|
return new String[]{"modelId","scoreSegStart"}; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public CfgCustomerDistribution findByUniqueKey(CfgCustomerDistribution entity) { |
||||
|
return findById(entity.getId()); |
||||
|
} |
||||
|
} |
@ -0,0 +1,29 @@ |
|||||
|
package io.sc.engine.mv.service.configuration.impl; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
import io.sc.engine.mv.jpa.entity.CfgCutOffPoint; |
||||
|
import io.sc.engine.mv.jpa.repository.CfgCutOffPointRepository; |
||||
|
import io.sc.engine.mv.service.configuration.CfgCutOffPointService; |
||||
|
import io.sc.platform.orm.service.impl.DaoServiceImpl; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
@Service |
||||
|
public class CfgCutOffPointServiceImpl extends DaoServiceImpl<CfgCutOffPoint, String, CfgCutOffPointRepository> implements CfgCutOffPointService { |
||||
|
|
||||
|
@Override |
||||
|
public String[] getDefaultSortBy() { |
||||
|
return new String[]{"name"}; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public CfgCutOffPoint findByUniqueKey(CfgCutOffPoint entity) { |
||||
|
return repository.findByName(entity.getName()); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<CfgCutOffPoint> getDefaultValues() throws Exception { |
||||
|
return CfgCutOffPoint.getDefaultValues(); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,74 @@ |
|||||
|
package io.sc.engine.mv.service.configuration.impl; |
||||
|
|
||||
|
import io.sc.engine.mv.DataExtractorManager; |
||||
|
import io.sc.engine.mv.jpa.entity.CfgDataExtractor; |
||||
|
import io.sc.engine.mv.jpa.repository.CfgDataExtractorRepository; |
||||
|
import io.sc.engine.mv.service.configuration.CfgDataExtractorService; |
||||
|
import io.sc.platform.core.Environment; |
||||
|
import io.sc.platform.core.support.ProgressInfo; |
||||
|
import io.sc.platform.core.util.FileUtil; |
||||
|
import io.sc.platform.orm.api.exception.UpdateNullNewObjectException; |
||||
|
import io.sc.platform.orm.service.impl.DaoServiceImpl; |
||||
|
import org.apache.commons.io.IOUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.core.io.Resource; |
||||
|
import org.springframework.core.io.ResourceLoader; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.util.StringUtils; |
||||
|
|
||||
|
@Service |
||||
|
public class CfgDataExtractorServiceImpl extends DaoServiceImpl<CfgDataExtractor, String, CfgDataExtractorRepository> implements CfgDataExtractorService { |
||||
|
@Autowired private DataExtractorManager dataExtractorManager; |
||||
|
@Autowired private ResourceLoader resourceLoader; |
||||
|
|
||||
|
@Override |
||||
|
public CfgDataExtractor findByUniqueKey(CfgDataExtractor entity) { |
||||
|
return repository.findByName(entity.getName()); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void test(CfgDataExtractor object) throws Exception { |
||||
|
if(object==null){ |
||||
|
throw new UpdateNullNewObjectException(); |
||||
|
} |
||||
|
if(StringUtils.hasText(object.getId())){//更新时进行的测试
|
||||
|
this.update(object.getId(), object); |
||||
|
}else{//新增时进行的测试
|
||||
|
|
||||
|
} |
||||
|
ProgressInfo progressInfo =new ProgressInfo(); |
||||
|
dataExtractorManager.execute(object, null, progressInfo); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void generateSample() throws Exception { |
||||
|
repository.deleteByName("示例(评分记录)"); |
||||
|
repository.deleteByName("示例(违约记录)"); |
||||
|
|
||||
|
CfgDataExtractor extractor =new CfgDataExtractor(); |
||||
|
extractor.setName("示例(评分记录)"); |
||||
|
extractor.setOrder(1000); |
||||
|
extractor.setEnable(true); |
||||
|
extractor.setExecuteTimeWeight(10); |
||||
|
extractor.setDatasourceName(null); |
||||
|
extractor.setGroovyScript(getScoreRecordGroovyScript()); |
||||
|
repository.save(extractor); |
||||
|
|
||||
|
extractor =new CfgDataExtractor(); |
||||
|
extractor.setName("示例(违约记录)"); |
||||
|
extractor.setOrder(1100); |
||||
|
extractor.setEnable(true); |
||||
|
extractor.setExecuteTimeWeight(10); |
||||
|
extractor.setDatasourceName(null); |
||||
|
extractor.setGroovyScript(getDefaultRecordGroovyScript()); |
||||
|
repository.save(extractor); |
||||
|
} |
||||
|
|
||||
|
private String getScoreRecordGroovyScript() throws Exception{ |
||||
|
return FileUtil.readString("classpath:/io/sc/engine/mv/initializer/SampleScoreRecord.groovy"); |
||||
|
} |
||||
|
|
||||
|
private String getDefaultRecordGroovyScript() throws Exception{ |
||||
|
return FileUtil.readString("classpath:/io/sc/engine/mv/initializer/SampleDefaultRecord.groovy"); |
||||
|
} |
||||
|
} |
@ -0,0 +1,47 @@ |
|||||
|
package io.sc.engine.mv.service.configuration.impl; |
||||
|
|
||||
|
import io.sc.engine.mv.ModelType; |
||||
|
import io.sc.engine.mv.jpa.entity.CfgModel; |
||||
|
import io.sc.engine.mv.jpa.repository.CfgModelRepository; |
||||
|
import io.sc.engine.mv.service.configuration.CfgModelService; |
||||
|
import io.sc.platform.orm.service.impl.DaoServiceImpl; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.jdbc.core.JdbcTemplate; |
||||
|
import org.springframework.jdbc.core.RowMapper; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.sql.ResultSet; |
||||
|
import java.sql.SQLException; |
||||
|
import java.util.List; |
||||
|
|
||||
|
@Service |
||||
|
public class CfgModelServiceImpl extends DaoServiceImpl<CfgModel, String, CfgModelRepository> implements CfgModelService { |
||||
|
@Autowired private JdbcTemplate jdbcTemplate; |
||||
|
|
||||
|
@Override |
||||
|
public CfgModel findByUniqueKey(CfgModel entity) { |
||||
|
return repository.findByModelId(entity.getModelId()); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void importFromScoreRecord(){ |
||||
|
jdbcTemplate.execute("delete from MV_CFG_MODEL where FD_TYPE='IMPORT_FROM_SCORE_RECORD'"); |
||||
|
|
||||
|
String sql ="select FD_MODEL_ID, max(FD_MODEL_NAME) as FD_MODEL_NAME" |
||||
|
+ " from MV_SCORE_RECORD" |
||||
|
+ " group by FD_MODEL_ID"; |
||||
|
List<CfgModel> cfgModels =jdbcTemplate.query(sql, new CfgModelRowMapper()); |
||||
|
if(cfgModels!=null && cfgModels.size()>0){ |
||||
|
repository.saveAll(cfgModels); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
static class CfgModelRowMapper implements RowMapper<CfgModel>{ |
||||
|
@Override |
||||
|
public CfgModel mapRow(ResultSet rs, int rowNum) throws SQLException { |
||||
|
String modelId =rs.getString("FD_MODEL_ID"); |
||||
|
String modelName =rs.getString("FD_MODEL_NAME"); |
||||
|
return new CfgModel(modelId,modelName, ModelType.IMPORT_FROM_SCORE_RECORD); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package io.sc.engine.mv.service.configuration.impl; |
||||
|
|
||||
|
import io.sc.engine.mv.jpa.entity.CfgScale; |
||||
|
import io.sc.engine.mv.jpa.repository.CfgScaleRepository; |
||||
|
import io.sc.engine.mv.service.configuration.CfgScaleService; |
||||
|
import io.sc.platform.orm.service.impl.DaoServiceImpl; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
@Service |
||||
|
public class CfgScaleServiceImpl extends DaoServiceImpl<CfgScale, String, CfgScaleRepository> implements CfgScaleService { |
||||
|
@Override |
||||
|
public String[] getDefaultSortBy() { |
||||
|
return new String[]{"modelId","order"}; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public CfgScale findByUniqueKey(CfgScale entity) { |
||||
|
return findById(entity.getId()); |
||||
|
} |
||||
|
} |
@ -0,0 +1,29 @@ |
|||||
|
package io.sc.engine.mv.service.configuration.impl; |
||||
|
|
||||
|
import io.sc.engine.mv.jpa.entity.CfgThreshold; |
||||
|
import io.sc.engine.mv.jpa.repository.CfgThresholdRepository; |
||||
|
import io.sc.engine.mv.service.configuration.CfgThresholdService; |
||||
|
import io.sc.platform.orm.service.impl.DaoServiceImpl; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Service |
||||
|
public class CfgThresholdServiceImpl extends DaoServiceImpl<CfgThreshold, String, CfgThresholdRepository> implements CfgThresholdService { |
||||
|
|
||||
|
@Override |
||||
|
public String[] getDefaultSortBy() { |
||||
|
return new String[]{"name","level"}; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public CfgThreshold findByUniqueKey(CfgThreshold entity) { |
||||
|
return repository.findByNameAndLevel(entity.getName(),entity.getLevel()); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<CfgThreshold> getDefaultValues() throws Exception { |
||||
|
return CfgThreshold.getDefaultValues(); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,52 @@ |
|||||
|
package io.sc.engine.mv.vo; |
||||
|
|
||||
|
import io.sc.platform.orm.api.vo.AuditorVo; |
||||
|
|
||||
|
|
||||
|
public class CfgBinomialVo extends AuditorVo { |
||||
|
private String id; |
||||
|
private Double significanceLevel; |
||||
|
private Double confidenceLevel; |
||||
|
private Double zUpper; |
||||
|
private Double zLower; |
||||
|
|
||||
|
public String getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(String id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public Double getSignificanceLevel() { |
||||
|
return significanceLevel; |
||||
|
} |
||||
|
|
||||
|
public void setSignificanceLevel(Double significanceLevel) { |
||||
|
this.significanceLevel = significanceLevel; |
||||
|
} |
||||
|
|
||||
|
public Double getConfidenceLevel() { |
||||
|
return confidenceLevel; |
||||
|
} |
||||
|
|
||||
|
public void setConfidenceLevel(Double confidenceLevel) { |
||||
|
this.confidenceLevel = confidenceLevel; |
||||
|
} |
||||
|
|
||||
|
public Double getzUpper() { |
||||
|
return zUpper; |
||||
|
} |
||||
|
|
||||
|
public void setzUpper(Double zUpper) { |
||||
|
this.zUpper = zUpper; |
||||
|
} |
||||
|
|
||||
|
public Double getzLower() { |
||||
|
return zLower; |
||||
|
} |
||||
|
|
||||
|
public void setzLower(Double zLower) { |
||||
|
this.zLower = zLower; |
||||
|
} |
||||
|
} |
@ -0,0 +1,35 @@ |
|||||
|
package io.sc.engine.mv.vo; |
||||
|
|
||||
|
import io.sc.platform.orm.api.vo.AuditorVo; |
||||
|
|
||||
|
public class CfgChiSquareVo extends AuditorVo { |
||||
|
private String id; |
||||
|
private Integer dof; |
||||
|
private Double significanceLevel; |
||||
|
private Double criticalValue; |
||||
|
|
||||
|
public String getId() { |
||||
|
return id; |
||||
|
} |
||||
|
public void setId(String id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
public Integer getDof() { |
||||
|
return dof; |
||||
|
} |
||||
|
public void setDof(Integer dof) { |
||||
|
this.dof = dof; |
||||
|
} |
||||
|
public Double getSignificanceLevel() { |
||||
|
return significanceLevel; |
||||
|
} |
||||
|
public void setSignificanceLevel(Double significanceLevel) { |
||||
|
this.significanceLevel = significanceLevel; |
||||
|
} |
||||
|
public Double getCriticalValue() { |
||||
|
return criticalValue; |
||||
|
} |
||||
|
public void setCriticalValue(Double criticalValue) { |
||||
|
this.criticalValue = criticalValue; |
||||
|
} |
||||
|
} |
@ -0,0 +1,60 @@ |
|||||
|
package io.sc.engine.mv.vo; |
||||
|
|
||||
|
import io.sc.platform.orm.api.vo.AuditorVo; |
||||
|
|
||||
|
public class CfgCustomerDistributionVo extends AuditorVo { |
||||
|
private String id; |
||||
|
private String modelId; |
||||
|
private String modelName; |
||||
|
private Double scoreSegStart; |
||||
|
private Double scoreSegEnd; |
||||
|
private Long count; |
||||
|
|
||||
|
public String getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(String id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public String getModelId() { |
||||
|
return modelId; |
||||
|
} |
||||
|
|
||||
|
public void setModelId(String modelId) { |
||||
|
this.modelId = modelId; |
||||
|
} |
||||
|
|
||||
|
public String getModelName() { |
||||
|
return modelName; |
||||
|
} |
||||
|
|
||||
|
public void setModelName(String modelName) { |
||||
|
this.modelName = modelName; |
||||
|
} |
||||
|
|
||||
|
public Double getScoreSegStart() { |
||||
|
return scoreSegStart; |
||||
|
} |
||||
|
|
||||
|
public void setScoreSegStart(Double scoreSegStart) { |
||||
|
this.scoreSegStart = scoreSegStart; |
||||
|
} |
||||
|
|
||||
|
public Double getScoreSegEnd() { |
||||
|
return scoreSegEnd; |
||||
|
} |
||||
|
|
||||
|
public void setScoreSegEnd(Double scoreSegEnd) { |
||||
|
this.scoreSegEnd = scoreSegEnd; |
||||
|
} |
||||
|
|
||||
|
public Long getCount() { |
||||
|
return count; |
||||
|
} |
||||
|
|
||||
|
public void setCount(Long count) { |
||||
|
this.count = count; |
||||
|
} |
||||
|
} |
@ -0,0 +1,73 @@ |
|||||
|
package io.sc.engine.mv.vo; |
||||
|
|
||||
|
import io.sc.platform.orm.api.vo.AuditorVo; |
||||
|
|
||||
|
import java.math.RoundingMode; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
public class CfgCutOffPointVo extends AuditorVo { |
||||
|
private String id; |
||||
|
private String name; |
||||
|
private String from; |
||||
|
private String to; |
||||
|
private String step; |
||||
|
private Integer scale; |
||||
|
private RoundingMode roundingMode; |
||||
|
|
||||
|
public String getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(String id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public String getName() { |
||||
|
return name; |
||||
|
} |
||||
|
|
||||
|
public void setName(String name) { |
||||
|
this.name = name; |
||||
|
} |
||||
|
|
||||
|
public String getFrom() { |
||||
|
return from; |
||||
|
} |
||||
|
|
||||
|
public void setFrom(String from) { |
||||
|
this.from = from; |
||||
|
} |
||||
|
|
||||
|
public String getTo() { |
||||
|
return to; |
||||
|
} |
||||
|
|
||||
|
public void setTo(String to) { |
||||
|
this.to = to; |
||||
|
} |
||||
|
|
||||
|
public String getStep() { |
||||
|
return step; |
||||
|
} |
||||
|
|
||||
|
public void setStep(String step) { |
||||
|
this.step = step; |
||||
|
} |
||||
|
|
||||
|
public Integer getScale() { |
||||
|
return scale; |
||||
|
} |
||||
|
|
||||
|
public void setScale(Integer scale) { |
||||
|
this.scale = scale; |
||||
|
} |
||||
|
|
||||
|
public RoundingMode getRoundingMode() { |
||||
|
return roundingMode; |
||||
|
} |
||||
|
|
||||
|
public void setRoundingMode(RoundingMode roundingMode) { |
||||
|
this.roundingMode = roundingMode; |
||||
|
} |
||||
|
} |
@ -0,0 +1,69 @@ |
|||||
|
package io.sc.engine.mv.vo; |
||||
|
|
||||
|
import io.sc.platform.orm.api.vo.AuditorVo; |
||||
|
|
||||
|
public class CfgDataExtractorVo extends AuditorVo { |
||||
|
private String id; |
||||
|
private String name; |
||||
|
private Boolean enable =true; |
||||
|
private Integer order; |
||||
|
private Integer executeTimeWeight; |
||||
|
private String datasourceName; |
||||
|
private String groovyScript; |
||||
|
|
||||
|
public String getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(String id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public String getName() { |
||||
|
return name; |
||||
|
} |
||||
|
|
||||
|
public void setName(String name) { |
||||
|
this.name = name; |
||||
|
} |
||||
|
|
||||
|
public Boolean getEnable() { |
||||
|
return enable; |
||||
|
} |
||||
|
|
||||
|
public void setEnable(Boolean enable) { |
||||
|
this.enable = enable; |
||||
|
} |
||||
|
|
||||
|
public Integer getOrder() { |
||||
|
return order; |
||||
|
} |
||||
|
|
||||
|
public void setOrder(Integer order) { |
||||
|
this.order = order; |
||||
|
} |
||||
|
|
||||
|
public Integer getExecuteTimeWeight() { |
||||
|
return executeTimeWeight; |
||||
|
} |
||||
|
|
||||
|
public void setExecuteTimeWeight(Integer executeTimeWeight) { |
||||
|
this.executeTimeWeight = executeTimeWeight; |
||||
|
} |
||||
|
|
||||
|
public String getDatasourceName() { |
||||
|
return datasourceName; |
||||
|
} |
||||
|
|
||||
|
public void setDatasourceName(String datasourceName) { |
||||
|
this.datasourceName = datasourceName; |
||||
|
} |
||||
|
|
||||
|
public String getGroovyScript() { |
||||
|
return groovyScript; |
||||
|
} |
||||
|
|
||||
|
public void setGroovyScript(String groovyScript) { |
||||
|
this.groovyScript = groovyScript; |
||||
|
} |
||||
|
} |
@ -0,0 +1,44 @@ |
|||||
|
package io.sc.engine.mv.vo; |
||||
|
|
||||
|
import io.sc.engine.mv.ModelType; |
||||
|
import io.sc.platform.orm.api.vo.AuditorVo; |
||||
|
|
||||
|
|
||||
|
public class CfgModelVo extends AuditorVo { |
||||
|
private String id; |
||||
|
private String modelId; |
||||
|
private String modelName; |
||||
|
private ModelType type; |
||||
|
|
||||
|
public String getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(String id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public String getModelId() { |
||||
|
return modelId; |
||||
|
} |
||||
|
|
||||
|
public void setModelId(String modelId) { |
||||
|
this.modelId = modelId; |
||||
|
} |
||||
|
|
||||
|
public String getModelName() { |
||||
|
return modelName; |
||||
|
} |
||||
|
|
||||
|
public void setModelName(String modelName) { |
||||
|
this.modelName = modelName; |
||||
|
} |
||||
|
|
||||
|
public ModelType getType() { |
||||
|
return type; |
||||
|
} |
||||
|
|
||||
|
public void setType(ModelType type) { |
||||
|
this.type = type; |
||||
|
} |
||||
|
} |
@ -0,0 +1,62 @@ |
|||||
|
package io.sc.engine.mv.vo; |
||||
|
|
||||
|
|
||||
|
import io.sc.platform.orm.api.vo.AuditorVo; |
||||
|
|
||||
|
public class CfgScaleVo extends AuditorVo { |
||||
|
private String id; |
||||
|
private String modelId; |
||||
|
private String modelName; |
||||
|
private String level; |
||||
|
private Double pd; |
||||
|
private Integer order; |
||||
|
|
||||
|
public String getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(String id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public String getModelId() { |
||||
|
return modelId; |
||||
|
} |
||||
|
|
||||
|
public void setModelId(String modelId) { |
||||
|
this.modelId = modelId; |
||||
|
} |
||||
|
|
||||
|
public String getModelName() { |
||||
|
return modelName; |
||||
|
} |
||||
|
|
||||
|
public void setModelName(String modelName) { |
||||
|
this.modelName = modelName; |
||||
|
} |
||||
|
|
||||
|
public String getLevel() { |
||||
|
return level; |
||||
|
} |
||||
|
|
||||
|
public void setLevel(String level) { |
||||
|
this.level = level; |
||||
|
} |
||||
|
|
||||
|
public Double getPd() { |
||||
|
return pd; |
||||
|
} |
||||
|
|
||||
|
public void setPd(Double pd) { |
||||
|
this.pd = pd; |
||||
|
} |
||||
|
|
||||
|
public Integer getOrder() { |
||||
|
return order; |
||||
|
} |
||||
|
|
||||
|
public void setOrder(Integer order) { |
||||
|
this.order = order; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,56 @@ |
|||||
|
package io.sc.engine.mv.vo; |
||||
|
|
||||
|
import io.sc.platform.orm.api.vo.AuditorVo; |
||||
|
|
||||
|
public class CfgThresholdVo extends AuditorVo { |
||||
|
private String id; |
||||
|
private String name; |
||||
|
private Integer level; |
||||
|
private String color; |
||||
|
private String range; |
||||
|
private String quantitativeRange; |
||||
|
private String qualitativeRange; |
||||
|
|
||||
|
public String getId() { |
||||
|
return id; |
||||
|
} |
||||
|
public void setId(String id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
public String getName() { |
||||
|
return name; |
||||
|
} |
||||
|
public void setName(String name) { |
||||
|
this.name = name; |
||||
|
} |
||||
|
public Integer getLevel() { |
||||
|
return level; |
||||
|
} |
||||
|
public void setLevel(Integer level) { |
||||
|
this.level = level; |
||||
|
} |
||||
|
public String getColor() { |
||||
|
return color; |
||||
|
} |
||||
|
public void setColor(String color) { |
||||
|
this.color = color; |
||||
|
} |
||||
|
public String getRange() { |
||||
|
return range; |
||||
|
} |
||||
|
public void setRange(String range) { |
||||
|
this.range = range; |
||||
|
} |
||||
|
public String getQuantitativeRange() { |
||||
|
return quantitativeRange; |
||||
|
} |
||||
|
public void setQuantitativeRange(String quantitativeRange) { |
||||
|
this.quantitativeRange = quantitativeRange; |
||||
|
} |
||||
|
public String getQualitativeRange() { |
||||
|
return qualitativeRange; |
||||
|
} |
||||
|
public void setQualitativeRange(String qualitativeRange) { |
||||
|
this.qualitativeRange = qualitativeRange; |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue