fase()规则测试
parent
881752d134
commit
f0e416ccf1
|
@ -3,7 +3,7 @@ package muyu.data.test.clinet.config;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
import muyu.data.test.clinet.config.runner.AccessConfigRunner;
|
import muyu.data.test.clinet.config.runner.AccessConfigRunner;
|
||||||
import muyu.data.test.common.dataSoutce.DataSourceConfig;
|
import muyu.data.test.common.dataSoutce.DataSourceConfig;
|
||||||
import muyu.data.test.common.domain.model.DataModel;
|
import muyu.data.test.common.model.DataModel;
|
||||||
import org.springframework.context.annotation.ComponentScan;
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
import org.springframework.context.annotation.Import;
|
import org.springframework.context.annotation.Import;
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ public class AccessConfig {
|
||||||
.processType(columnClassName)
|
.processType(columnClassName)
|
||||||
.processClass(Class.forName(columnClassName))
|
.processClass(Class.forName(columnClassName))
|
||||||
.build();
|
.build();
|
||||||
log.info("测试内容:{}",build);
|
// log.info("测试内容:{}",build);
|
||||||
list.add(build);
|
list.add(build);
|
||||||
}
|
}
|
||||||
listList.add(list);
|
listList.add(list);
|
||||||
|
@ -116,12 +116,8 @@ public class AccessConfig {
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
switch (ruleLevel){
|
|
||||||
case 2, 3:
|
|
||||||
return listList;
|
return listList;
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}
|
|
||||||
private Map<String, String> getColumnComments(DatabaseMetaData metaData, String typeName) {
|
private Map<String, String> getColumnComments(DatabaseMetaData metaData, String typeName) {
|
||||||
Map<String, String> columnComents = new HashMap<>();
|
Map<String, String> columnComents = new HashMap<>();
|
||||||
try (ResultSet colums = metaData.getColumns(null, null, typeName, null)) {
|
try (ResultSet colums = metaData.getColumns(null, null, typeName, null)) {
|
||||||
|
|
|
@ -1,12 +1,95 @@
|
||||||
package muyu.data.test.clinet.config;
|
package muyu.data.test.clinet.config;
|
||||||
|
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import com.muyu.common.core.exception.ServiceException;
|
||||||
|
import com.muyu.edition.constant.RuleOperationConstants;
|
||||||
|
import com.muyu.edition.domain.Config;
|
||||||
|
import com.muyu.edition.domain.Edition;
|
||||||
|
import com.muyu.goods.edition.remote.EditionDataRemoteService;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
import muyu.data.test.clinet.config.runner.DataEditionConfigRunner;
|
import muyu.data.test.clinet.config.runner.DataEditionConfigRunner;
|
||||||
|
import muyu.data.test.common.context.DataModelContextHolder;
|
||||||
|
import muyu.data.test.common.context.DataSetContextHolder;
|
||||||
|
import muyu.data.test.common.dataSoutce.EditionSoutceConfig;
|
||||||
|
import muyu.data.test.common.dymamicLoad.DynamicLoader;
|
||||||
|
import muyu.data.test.common.model.DataModel;
|
||||||
|
import muyu.data.test.common.model.DataSetModel;
|
||||||
|
import muyu.data.test.common.model.RecordModel;
|
||||||
|
import muyu.data.test.common.model.process.DataModelProcessModel;
|
||||||
|
import muyu.data.test.common.model.process.DataSetProcessModel;
|
||||||
|
import muyu.data.test.common.model.process.RecordProcessModel;
|
||||||
|
import muyu.data.test.common.req.TestDataModelReq;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.ComponentScan;
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
import org.springframework.context.annotation.Import;
|
import org.springframework.context.annotation.Import;
|
||||||
|
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Log4j2
|
@Log4j2
|
||||||
@ComponentScan
|
@ComponentScan
|
||||||
@Import(value = DataEditionConfigRunner.class)
|
@Import(value = DataEditionConfigRunner.class)
|
||||||
public class DataEditionConfig {
|
public class DataEditionConfig {
|
||||||
|
@Autowired
|
||||||
|
private EditionDataRemoteService editionDataRemoteService;
|
||||||
|
public Object setColumn(TestDataModelReq testDataModelReq) {
|
||||||
|
switch (testDataModelReq.getRuleLevel()){
|
||||||
|
case 2:
|
||||||
|
//先获取一个记录列
|
||||||
|
List<RecordModel> dataModels = new ArrayList<>();
|
||||||
|
// 获取数据集的数据
|
||||||
|
List<List<DataModel>> dataModelLists = testDataModelReq.getDataModelLists();
|
||||||
|
//给记录列赋值
|
||||||
|
dataModelLists.stream().forEach(res -> {
|
||||||
|
//获取记录模型
|
||||||
|
RecordModel recordModel = RecordModel.builder().dataModels(res).build();
|
||||||
|
dataModels.add(recordModel);
|
||||||
|
});
|
||||||
|
//调取数据集的处理模型
|
||||||
|
DataSetModel dataSetModel = DataSetModel.builder().recordModels(dataModels).build();
|
||||||
|
//调取数据集的上下文
|
||||||
|
DataSetProcessModel dataSetProcessModel = new DataSetProcessModel();
|
||||||
|
dataSetProcessModel.setDataSetModel(dataSetModel);
|
||||||
|
DataSetContextHolder.set(dataSetProcessModel);
|
||||||
|
case 3:
|
||||||
|
//调取记录的处理模型
|
||||||
|
RecordModel recordModel = RecordModel.builder()
|
||||||
|
.dataModels(testDataModelReq.getDataModelList())
|
||||||
|
.build();
|
||||||
|
//调取记录的上下文
|
||||||
|
RecordProcessModel recordProcessModel = new RecordProcessModel();
|
||||||
|
recordProcessModel.setKeys(testDataModelReq.getKeys());
|
||||||
|
recordProcessModel.setRecordModel(recordModel);
|
||||||
|
case 4:
|
||||||
|
//调取数据处理模型
|
||||||
|
DataModelProcessModel dataModelProcessModel = new DataModelProcessModel();
|
||||||
|
dataModelProcessModel.setDataModel(testDataModelReq.getDataModel());
|
||||||
|
//调取数据明显上下文
|
||||||
|
DataModelContextHolder.set(dataModelProcessModel);
|
||||||
|
}
|
||||||
|
// 获取规则
|
||||||
|
List<Edition> listEdition = editionDataRemoteService.lists().getData();
|
||||||
|
List<Edition> editions = listEdition.stream().filter(e -> e.getId().equals(testDataModelReq.getEditionId())).collect(Collectors.toList());
|
||||||
|
Edition edition = editions.get(0);
|
||||||
|
Map<String, byte[]> aByte = EditionSoutceConfig.getByte(edition.getId());
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 加载class文件到虚拟机中,然后通过反射执行
|
||||||
|
@SuppressWarnings("resource")
|
||||||
|
DynamicLoader.MemoryClassLoader classLoader = new DynamicLoader.MemoryClassLoader(aByte);
|
||||||
|
Class<?> clazz = classLoader.loadClass(edition.getVersionClass());
|
||||||
|
|
||||||
|
// 调用ruleTest方法
|
||||||
|
Method mainMethod = clazz.getDeclaredMethod("execution");
|
||||||
|
Object o = clazz.newInstance();
|
||||||
|
mainMethod.invoke(o);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new ServiceException("异常"+e.getMessage());
|
||||||
|
}
|
||||||
|
return "正常,无需返回";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ public class DataEditionConfigRunner implements ApplicationRunner {
|
||||||
String versionClass = editionList.get(0).getVersionClass();
|
String versionClass = editionList.get(0).getVersionClass();
|
||||||
byte[] bytes = aByte.get(versionClass);
|
byte[] bytes = aByte.get(versionClass);
|
||||||
String s = new String(bytes);
|
String s = new String(bytes);
|
||||||
System.out.println(s);
|
log.info(s);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package muyu.data.test.common.context;
|
package muyu.data.test.common.context;
|
||||||
|
|
||||||
|
|
||||||
import com.muyu.edition.model.process.DataModelProcessModel;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import muyu.data.test.common.model.process.DataModelProcessModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据模型上下文
|
* 数据模型上下文
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package muyu.data.test.common.context;
|
package muyu.data.test.common.context;
|
||||||
|
|
||||||
import com.muyu.edition.model.process.DataSetProcessModel;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import muyu.data.test.common.model.process.DataSetProcessModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据集上下文
|
* 数据集上下文
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package muyu.data.test.common.context;
|
package muyu.data.test.common.context;
|
||||||
|
|
||||||
import com.muyu.edition.model.process.RecordProcessModel;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import muyu.data.test.common.model.process.RecordProcessModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 记录上下文
|
* 记录上下文
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
package muyu.data.test.common.engine.scope;
|
package muyu.data.test.common.engine.scope;
|
||||||
|
|
||||||
|
|
||||||
import com.muyu.edition.context.DataModelContextHolder;
|
|
||||||
import com.muyu.edition.model.DataModel;
|
import muyu.data.test.common.context.DataModelContextHolder;
|
||||||
import com.muyu.edition.model.process.DataModelProcessModel;
|
|
||||||
import muyu.data.test.common.engine.Engine;
|
import muyu.data.test.common.engine.Engine;
|
||||||
|
import muyu.data.test.common.model.DataModel;
|
||||||
|
import muyu.data.test.common.model.process.DataModelProcessModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据模型引擎
|
* 数据模型引擎
|
||||||
|
@ -29,7 +30,7 @@ public abstract class DataModelEngine implements Engine<DataModelProcessModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object getValue () {
|
public Object getValue () {
|
||||||
return getModel().getValue();
|
return getModel().getVal();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSourceType () {
|
public String getSourceType () {
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
package muyu.data.test.common.engine.scope;
|
package muyu.data.test.common.engine.scope;
|
||||||
|
|
||||||
|
import muyu.data.test.common.context.DataSetContextHolder;
|
||||||
import com.muyu.edition.context.DataSetContextHolder;
|
|
||||||
import com.muyu.edition.model.DataSetModel;
|
|
||||||
import com.muyu.edition.model.RecordModel;
|
|
||||||
import com.muyu.edition.model.process.DataSetProcessModel;
|
|
||||||
import muyu.data.test.common.engine.Engine;
|
import muyu.data.test.common.engine.Engine;
|
||||||
|
import muyu.data.test.common.model.DataSetModel;
|
||||||
|
import muyu.data.test.common.model.RecordModel;
|
||||||
|
import muyu.data.test.common.model.process.DataSetProcessModel;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
package muyu.data.test.common.engine.scope;
|
package muyu.data.test.common.engine.scope;
|
||||||
|
|
||||||
|
|
||||||
import com.muyu.edition.context.RecordContextHolder;
|
|
||||||
import com.muyu.edition.model.DataModel;
|
import muyu.data.test.common.context.RecordContextHolder;
|
||||||
import com.muyu.edition.model.RecordModel;
|
|
||||||
import com.muyu.edition.model.process.RecordProcessModel;
|
|
||||||
import muyu.data.test.common.engine.Engine;
|
import muyu.data.test.common.engine.Engine;
|
||||||
|
import muyu.data.test.common.model.DataModel;
|
||||||
|
import muyu.data.test.common.model.RecordModel;
|
||||||
|
import muyu.data.test.common.model.process.RecordProcessModel;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ public class DataModel {
|
||||||
/**
|
/**
|
||||||
* 值
|
* 值
|
||||||
*/
|
*/
|
||||||
private Object value;
|
private Object val;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 原标准
|
* 原标准
|
||||||
|
|
|
@ -3,6 +3,7 @@ package muyu.data.test.common.model;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -13,6 +14,7 @@ import java.util.List;
|
||||||
* @Date 2024/5/5 18:48
|
* @Date 2024/5/5 18:48
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class DataSetModel {
|
public class DataSetModel {
|
||||||
|
|
|
@ -3,6 +3,7 @@ package muyu.data.test.common.model;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -13,6 +14,7 @@ import java.util.List;
|
||||||
* @Date 2024/5/5 18:48
|
* @Date 2024/5/5 18:48
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class RecordModel {
|
public class RecordModel {
|
||||||
|
|
|
@ -4,11 +4,11 @@ import com.data.test.server.TestService;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.common.core.web.controller.BaseController;
|
import com.muyu.common.core.web.controller.BaseController;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
import muyu.data.test.common.domain.model.DataModel;
|
import muyu.data.test.common.model.DataModel;
|
||||||
|
import muyu.data.test.common.model.DataModel;
|
||||||
|
import muyu.data.test.common.req.TestDataModelReq;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.sql.*;
|
import java.sql.*;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -29,8 +29,21 @@ public class TestController extends BaseController {
|
||||||
return success(service.getRabdomData(id,tableName,ruleLevel));
|
return success(service.getRabdomData(id,tableName,ruleLevel));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 展示队列
|
||||||
|
* @param id
|
||||||
|
* @param tableName
|
||||||
|
* @param ruleLevel
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
@GetMapping("getColumn")
|
@GetMapping("getColumn")
|
||||||
public Result<List<List<DataModel>>> getColumn(Long id, String tableName, Integer ruleLevel) throws Exception {
|
public Result<List<List<DataModel>>> getColumn(Long id, String tableName, Integer ruleLevel) throws Exception {
|
||||||
return success(service.getColumn(id,tableName,ruleLevel));
|
return success(service.getColumn(id,tableName,ruleLevel));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("setColumn")
|
||||||
|
public Result setColumn(@RequestBody TestDataModelReq testDataModelReq){
|
||||||
|
return success(service.setColumn(testDataModelReq));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.data.test.server;
|
package com.data.test.server;
|
||||||
|
|
||||||
import muyu.data.test.common.domain.model.DataModel;
|
import muyu.data.test.common.model.DataModel;
|
||||||
|
import muyu.data.test.common.req.TestDataModelReq;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -9,4 +10,6 @@ public interface TestService {
|
||||||
List<DataModel> getRabdomData(Long id, String tableName,Integer ruleLevel) throws SQLException;
|
List<DataModel> getRabdomData(Long id, String tableName,Integer ruleLevel) throws SQLException;
|
||||||
|
|
||||||
List<List<DataModel>> getColumn(Long id, String tableName, Integer ruleLevel);
|
List<List<DataModel>> getColumn(Long id, String tableName, Integer ruleLevel);
|
||||||
|
|
||||||
|
Object setColumn(TestDataModelReq testDataModelReq);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,9 @@ package com.data.test.server.impl;
|
||||||
|
|
||||||
import com.data.test.server.TestService;
|
import com.data.test.server.TestService;
|
||||||
import muyu.data.test.clinet.config.AccessConfig;
|
import muyu.data.test.clinet.config.AccessConfig;
|
||||||
import muyu.data.test.common.domain.model.DataModel;
|
import muyu.data.test.clinet.config.DataEditionConfig;
|
||||||
|
import muyu.data.test.common.model.DataModel;
|
||||||
|
import muyu.data.test.common.req.TestDataModelReq;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@ -13,6 +15,8 @@ import java.util.List;
|
||||||
public class TestServiceImpl implements TestService {
|
public class TestServiceImpl implements TestService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private AccessConfig accessConfig;
|
private AccessConfig accessConfig;
|
||||||
|
@Autowired
|
||||||
|
private DataEditionConfig dataEditionConfig;
|
||||||
@Override
|
@Override
|
||||||
public List<DataModel> getRabdomData(Long id, String tableName, Integer ruleLevel) throws SQLException {
|
public List<DataModel> getRabdomData(Long id, String tableName, Integer ruleLevel) throws SQLException {
|
||||||
return accessConfig.getRabdomData(id,tableName,ruleLevel);
|
return accessConfig.getRabdomData(id,tableName,ruleLevel);
|
||||||
|
@ -22,4 +26,9 @@ public class TestServiceImpl implements TestService {
|
||||||
public List<List<DataModel>> getColumn(Long id, String tableName, Integer ruleLevel) {
|
public List<List<DataModel>> getColumn(Long id, String tableName, Integer ruleLevel) {
|
||||||
return accessConfig.getColumn(id,tableName,ruleLevel);
|
return accessConfig.getColumn(id,tableName,ruleLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object setColumn(TestDataModelReq testDataModelReq) {
|
||||||
|
return dataEditionConfig.setColumn(testDataModelReq);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.muyu.edition.domain;
|
||||||
|
|
||||||
import com.muyu.common.core.annotation.Excel;
|
import com.muyu.common.core.annotation.Excel;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import com.muyu.common.security.utils.SecurityUtils;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
@ -9,6 +10,8 @@ import lombok.experimental.SuperBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 规则引擎版本对象 edition
|
* 规则引擎版本对象 edition
|
||||||
*
|
*
|
||||||
|
@ -56,7 +59,6 @@ public class Edition extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
@Excel(name = "是否发布")
|
@Excel(name = "是否发布")
|
||||||
private Integer editionStatus;
|
private Integer editionStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 引擎状态
|
* 引擎状态
|
||||||
*/
|
*/
|
||||||
|
@ -74,4 +76,11 @@ public class Edition extends BaseEntity {
|
||||||
|
|
||||||
@Excel(name = "版本内容")
|
@Excel(name = "版本内容")
|
||||||
private String ruleContent;
|
private String ruleContent;
|
||||||
|
|
||||||
|
public static Edition updateEdition(Long id){
|
||||||
|
return Edition.builder()
|
||||||
|
.id(id)
|
||||||
|
.editionStatus(0)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,11 +38,6 @@ public class EditionController extends BaseController {
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("lists")
|
|
||||||
public Result<List<Edition>> lists() {
|
|
||||||
return success(editionService.lists());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取相应的规则引擎版本
|
* 获取相应的规则引擎版本
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package com.muyu.edition.mapper;
|
package com.muyu.edition.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.muyu.edition.domain.Edition;
|
import com.muyu.edition.domain.Edition;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -10,7 +12,7 @@ import java.util.List;
|
||||||
* @author muyu
|
* @author muyu
|
||||||
* @date 2024-05-06
|
* @date 2024-05-06
|
||||||
*/
|
*/
|
||||||
public interface EditionMapper {
|
public interface EditionMapper extends BaseMapper<Edition> {
|
||||||
/**
|
/**
|
||||||
* 查询规则引擎版本
|
* 查询规则引擎版本
|
||||||
*
|
*
|
||||||
|
@ -59,4 +61,5 @@ public interface EditionMapper {
|
||||||
public int deleteEditionByIds(Long[] ids);
|
public int deleteEditionByIds(Long[] ids);
|
||||||
|
|
||||||
List<Edition> lists();
|
List<Edition> lists();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.muyu.edition.service;
|
package com.muyu.edition.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.edition.domain.Edition;
|
import com.muyu.edition.domain.Edition;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -10,7 +11,7 @@ import java.util.List;
|
||||||
* @author muyu
|
* @author muyu
|
||||||
* @date 2024-05-06
|
* @date 2024-05-06
|
||||||
*/
|
*/
|
||||||
public interface IEditionService {
|
public interface IEditionService extends IService<Edition> {
|
||||||
/**
|
/**
|
||||||
* 查询规则引擎版本
|
* 查询规则引擎版本
|
||||||
*
|
*
|
||||||
|
@ -51,6 +52,7 @@ public interface IEditionService {
|
||||||
*/
|
*/
|
||||||
public int updateEdition(Edition edition);
|
public int updateEdition(Edition edition);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除规则引擎版本
|
* 批量删除规则引擎版本
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,22 +1,27 @@
|
||||||
package com.muyu.edition.service.impl;
|
package com.muyu.edition.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.edition.domain.Edition;
|
import com.muyu.edition.domain.Edition;
|
||||||
import com.muyu.edition.mapper.EditionMapper;
|
import com.muyu.edition.mapper.EditionMapper;
|
||||||
import com.muyu.edition.service.IEditionService;
|
import com.muyu.edition.service.IEditionService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static java.util.concurrent.Executors.newFixedThreadPool;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 规则引擎版本Service业务层处理
|
* 规则引擎版本Service业务层处理
|
||||||
*
|
*
|
||||||
* @author muyu
|
* @author muyu
|
||||||
* @date 2024-05-06
|
* @date 2024-05-06
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
public class EditionServiceImpl implements IEditionService {
|
public class EditionServiceImpl extends ServiceImpl<EditionMapper, Edition> implements IEditionService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private EditionMapper editionMapper;
|
private EditionMapper editionMapper;
|
||||||
|
|
||||||
|
|
|
@ -69,6 +69,7 @@
|
||||||
<if test="name != null">name = #{name},</if>
|
<if test="name != null">name = #{name},</if>
|
||||||
<if test="editionContent != null">edition_content = #{editionContent},</if>
|
<if test="editionContent != null">edition_content = #{editionContent},</if>
|
||||||
<if test="ruleContent != null">rule_content = #{ruleContent},</if>
|
<if test="ruleContent != null">rule_content = #{ruleContent},</if>
|
||||||
|
edition_status = 0
|
||||||
</trim>
|
</trim>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
Loading…
Reference in New Issue