提交 8220af95 authored 作者: 黄夏豪's avatar 黄夏豪

[流程模块] 修改了回调函数时会发生类型错误的Bug

上级 f0d4f878
......@@ -13,6 +13,8 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
public class WorkflowCoreApplication {
public static void main(String[] args) {
SpringApplication.run(WorkflowCoreApplication.class, args);
System.out.println(
"█▀▀▀▀▀▀▀█▀▀▀█▀▀▀█▀▀▀█▀█▀▀▀▀▀▀▀█\n" +
......
......@@ -23,6 +23,6 @@ public class Parameter {
* key为字段名 value为字段值
*/
@ApiModelProperty(value = "实例对象")
private Map<String,Object> instance;
private Object instance;
}
......@@ -161,8 +161,8 @@ public class ApiService {
/**
* 把map转成指定类型的JavaBean对象
*/
public static <T> T toBean(Map<String, Object> map, Class<T> clazz) {
return JSON.parseObject(JSON.toJSONString(map), clazz);
public static <T> T toBean(Object o, Class<T> clazz) {
return JSON.parseObject(JSON.toJSONString(o), clazz);
}
}
\ No newline at end of file
......@@ -16,7 +16,7 @@ public class ApiException extends RuntimeException {
}
public ApiException(String message) {
this.responseEntity = ResponseEntity.status(500).body(new ResultObj(message));
this.responseEntity = ResponseEntity.status(500).body(new ResultObj("",message));
}
public ApiException( Object data,String message) {
......
......@@ -25,5 +25,5 @@ public class SearchTableInfoVo extends JpaCustomPage {
private String modelTitle;
private List<Integer> modelType;
private Integer[] modelType;
}
......@@ -95,7 +95,7 @@ public class ModelImpl implements ModelService {
PredicateBuilder<TableInfo> and = Specifications.and();
and.like(searchTableInfoVo.getModelName() != null && StringUtils.isNotEmpty(searchTableInfoVo.getModelName()), "modelName", "%" + searchTableInfoVo.getModelName() + "%");
and.like(searchTableInfoVo.getModelTitle() != null && StringUtils.isNotEmpty(searchTableInfoVo.getModelTitle()), "modelTitle", "%" + searchTableInfoVo.getModelTitle() + "%");
and.in(searchTableInfoVo.getModelType() != null&&searchTableInfoVo.getModelType().size()>0, "modelType", searchTableInfoVo.getModelType());
and.in(searchTableInfoVo.getModelType() != null&&searchTableInfoVo.getModelType().length>0, "modelType", searchTableInfoVo.getModelType());
return tableInfoDao.findAll(and.build(), searchTableInfoVo.getPageable());
}
......
......@@ -97,26 +97,26 @@ public class FlowsInfoController {
}
@PostMapping("/createFlow")
@ApiModelProperty("创建流程")
@ApiOperation("创建流程")
public ResponseEntity createFlow(@RequestBody FlowsInfoVo flowsInfovo){
return ResultUtil.success(workFlowService.createFlow(flowsInfovo.toEntity()),"流程创建成功");
}
@PostMapping("/saveVariableStorage")
@ApiModelProperty("保存函数调用配置")
@ApiOperation("保存函数调用配置")
public ResponseEntity saveVariableStorage(@RequestBody VariableStorageVo variableStorageVo){
VariableStorage variableStorage = variableStorageService.saveVariableStorageService(variableStorageVo.toEntity());
return ResultUtil.success(variableStorage,"保存接口调用配置成功");
}
@PostMapping("/searchVariableStorage")
@ApiModelProperty("查找函数调用配置")
@ApiOperation("查找函数调用配置")
public ResponseEntity searchVariableStorage(@RequestBody SearchVariableStorageVo searchVariableStorageVo){
return ResultUtil.success( variableStorageService.searchVariableStoragePage(searchVariableStorageVo),"查询接口调用配置成功");
}
@GetMapping("/searchVariableStorage")
@ApiModelProperty("根据ID查找函数调用配置")
@ApiOperation("根据ID查找函数调用配置")
public ResponseEntity searchVariableStorageById(Integer id){
return ResultUtil.success( variableStorageService.searchVariableById(id),"查询接口调用配置成功");
}
......
......@@ -14,6 +14,7 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Entity;
import javax.persistence.Lob;
import java.util.List;
/**
......@@ -41,14 +42,16 @@ public class VariableStorage extends BaseEntity {
private String className;
@ApiModelProperty("调用方法")
private String method;
private String name;
@ApiModelProperty("方法描述")
private String description;
@Lob
@ApiModelProperty("详情json")
private String parameterInfo;
private String params;
@JsonGetter
public List<ParameterVo> getParameterInfo() {
return JSON.parseObject(parameterInfo,new TypeReference<List<ParameterVo>>(){});
public List<ParameterVo> getParams() {
return JSON.parseObject(params,new TypeReference<List<ParameterVo>>(){});
}
}
......@@ -24,6 +24,6 @@ public class ParameterVo {
private String name;
private List<ParameterVo> params;
private List<ParameterVo> fields;
}
......@@ -38,12 +38,15 @@ public class VariableStorageVo {
@ApiModelProperty("调用方法名")
private String name;
@ApiModelProperty("方法描述")
private String description;
private List<ParameterVo> params;
public VariableStorage toEntity(){
VariableStorage variableStorage = new VariableStorage();
BeanUtils.copyProperties(this,variableStorage);
variableStorage.setParameterInfo(JSON.toJSONString(params));
variableStorage.setParams(JSON.toJSONString(params));
return variableStorage;
}
}
......@@ -56,8 +56,8 @@ public class VariableStorageServiceImpl implements VariableStorageService {
PredicateBuilder predicateBuilder = Specifications.and();
if (searchVariableStorageVo!=null){
predicateBuilder.eq(searchVariableStorageVo.getId()!=null,"id",searchVariableStorageVo.getId());
predicateBuilder.eq(StringUtils.isEmpty(searchVariableStorageVo.getFlowKey()),"flowKey",searchVariableStorageVo.getFlowKey());
predicateBuilder.eq(StringUtils.isEmpty(searchVariableStorageVo.getActivityId()),"activityId",searchVariableStorageVo.getActivityId());
predicateBuilder.eq(!StringUtils.isEmpty(searchVariableStorageVo.getFlowKey()),"flowKey",searchVariableStorageVo.getFlowKey());
predicateBuilder.eq(!StringUtils.isEmpty(searchVariableStorageVo.getActivityId()),"activityId",searchVariableStorageVo.getActivityId());
}
return variableStorageMapper.findAll(predicateBuilder.build(),searchVariableStorageVo.getPageable());
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论