11111
parent
555668190a
commit
f65d73f2fb
|
@ -289,9 +289,9 @@ public Result testEngine(@PathVariable("className") String className,@RequestBod
|
|||
//加载对应的规则引擎
|
||||
versionService.loadValueEngineClass(className);
|
||||
//执行对应的规则引擎
|
||||
versionService.testEngine(className,dataValue);
|
||||
DataValue value = versionService.testEngine(className, dataValue);
|
||||
|
||||
return Result.success(null,"数据正常");
|
||||
return Result.success(value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -308,15 +308,18 @@ public Result<List<RuleEngineVersion>> selectVersionById(@PathVariable("id") Lon
|
|||
return Result.success(versionList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping("/DataSetEngine/{className}")
|
||||
public Result DataSetEngine(@PathVariable("className") String className,@RequestBody DataValue[][] dataValues){
|
||||
|
||||
versionService.loadDateSetEngineClass(className);
|
||||
|
||||
versionService.DataSetEngine(className,dataValues);
|
||||
DataValue[][] testedEngine = versionService.testEngine(className, dataValues);
|
||||
|
||||
|
||||
return Result.success();
|
||||
return Result.success(testedEngine);
|
||||
}
|
||||
|
||||
|
||||
|
@ -327,6 +330,7 @@ public Result DataSetEngine(@PathVariable("className") String className,@Request
|
|||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -67,17 +67,21 @@ public interface RuleEngineVersionService extends IService<RuleEngineVersion> {
|
|||
|
||||
void loadValueEngineClass(String className);
|
||||
|
||||
/**
|
||||
* 测试数据
|
||||
* @param className 类名
|
||||
* @param dataValue ktvl数据
|
||||
*/
|
||||
|
||||
void testEngine(String className, DataValue dataValue);
|
||||
|
||||
|
||||
String deposit(Integer type);
|
||||
|
||||
void DataSetEngine( String className, DataValue[][] dataValues);
|
||||
|
||||
void loadDateSetEngineClass(String className);
|
||||
/**
|
||||
* 测试数据
|
||||
*
|
||||
* @param className 类名
|
||||
* @param dataValue ktvl数据
|
||||
* @return
|
||||
*/
|
||||
|
||||
public DataValue testEngine(String className, DataValue dataValue);
|
||||
public DataValue[] testEngine(String className, DataValue[] dataValue);
|
||||
|
||||
public DataValue[][] testEngine( String className, DataValue[][] dataValues);
|
||||
}
|
||||
|
|
|
@ -228,9 +228,10 @@ public class RuleEngineVersionServiceImpl extends ServiceImpl<RuleEngineVersionM
|
|||
*
|
||||
* @param className 类名
|
||||
* @param dataValue ktvl数据
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void testEngine(String className, DataValue dataValue) {
|
||||
public DataValue testEngine(String className, DataValue dataValue) {
|
||||
log.info("测试的数据[]{}:" + dataValue);
|
||||
|
||||
BasicEngine<DataValue> valueBasicEngine = engineMap.get(className);
|
||||
|
@ -238,8 +239,30 @@ public class RuleEngineVersionServiceImpl extends ServiceImpl<RuleEngineVersionM
|
|||
valueBasicEngine.set(dataValue);
|
||||
|
||||
valueBasicEngine.execution();
|
||||
DataValue value = valueBasicEngine.get();
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataValue[] testEngine(String className, DataValue[] dataValue) {
|
||||
log.info("测试的数据[]{}:" + dataValue);
|
||||
|
||||
BasicEngine<DataValue[]> basicEngine = engineRowMap.get(className);
|
||||
|
||||
basicEngine.set(dataValue);
|
||||
|
||||
basicEngine.execution();
|
||||
DataValue[] dataValues = basicEngine.get();
|
||||
return dataValues;
|
||||
}
|
||||
public void execution(String engineKey,DataValue dataValue){
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String deposit(Integer type) {
|
||||
|
||||
|
@ -248,13 +271,17 @@ public class RuleEngineVersionServiceImpl extends ServiceImpl<RuleEngineVersionM
|
|||
}
|
||||
|
||||
@Override
|
||||
public void DataSetEngine(String className, DataValue[][] dataValues) {
|
||||
public DataValue[][] testEngine(String className, DataValue[][] dataValues) {
|
||||
|
||||
BasicEngine<DataValue[][]> basicEngine = engineDataSetMap.get(className);
|
||||
|
||||
basicEngine.set(dataValues);
|
||||
|
||||
basicEngine.execution();
|
||||
|
||||
DataValue[][] dataValues1 = basicEngine.get();
|
||||
|
||||
return dataValues1;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue