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

[基础模块] 增加了/xml和/workflow/xml的静态资源句柄 以修复在主系统无法获取XML的问题

[工作流模块] 修复了根据页面搜索实体时STRING无法转为INTEGER的问题
上级 6dff6c9b
...@@ -33,6 +33,8 @@ public class WebMvcConfig { ...@@ -33,6 +33,8 @@ public class WebMvcConfig {
public void addResourceHandlers(ResourceHandlerRegistry registry) { public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/workflow/xml/**") registry.addResourceHandler("/workflow/xml/**")
.addResourceLocations("file:" + System.getProperty("user.dir") + "\\xml\\"); .addResourceLocations("file:" + System.getProperty("user.dir") + "\\xml\\");
registry.addResourceHandler("/xml/**")
.addResourceLocations("file:" + System.getProperty("user.dir") + "\\xml\\");
} }
}; };
} }
......
...@@ -51,12 +51,7 @@ public class ModelController { ...@@ -51,12 +51,7 @@ public class ModelController {
@PostMapping("/getAllEntity") @PostMapping("/getAllEntity")
public ResponseEntity getAllEntity(@RequestBody SearchTableInfoVo searchTableInfoVo) { public ResponseEntity getAllEntity(@RequestBody SearchTableInfoVo searchTableInfoVo) {
Page<TableInfo> tableInfos; Page<TableInfo> tableInfos;
try { tableInfos = modelService.pageAllEntities(searchTableInfoVo);
tableInfos = modelService.pageAllEntities(searchTableInfoVo);
} catch (SQLException throwables) {
return ResultUtil.failed("数据查询失败!");
}
return ResultUtil.success(tableInfos, "数据查询成功!"); return ResultUtil.success(tableInfos, "数据查询成功!");
} }
......
...@@ -5,6 +5,7 @@ import com.tykj.workflowcore.model_layer.entity.TableInfo; ...@@ -5,6 +5,7 @@ import com.tykj.workflowcore.model_layer.entity.TableInfo;
import com.tykj.workflowcore.model_layer.entity.vo.TableAndColumnInfoVO; import com.tykj.workflowcore.model_layer.entity.vo.TableAndColumnInfoVO;
import com.tykj.workflowcore.workflow_editer.entity.FormPage; import com.tykj.workflowcore.workflow_editer.entity.FormPage;
//import com.tykj.workflowcore.workflow_editer.entity.PageEntity; //import com.tykj.workflowcore.workflow_editer.entity.PageEntity;
import com.tykj.workflowcore.workflow_editer.entity.vo.SearchPageEntityVo;
import com.tykj.workflowcore.workflow_editer.service.FormPageService; import com.tykj.workflowcore.workflow_editer.service.FormPageService;
//import com.tykj.workflowcore.workflow_editer.service.PageEntityService; //import com.tykj.workflowcore.workflow_editer.service.PageEntityService;
import com.tykj.workflowcore.workflow_editer.entity.vo.FormPageVo; import com.tykj.workflowcore.workflow_editer.entity.vo.FormPageVo;
...@@ -72,9 +73,9 @@ public class FormPageController { ...@@ -72,9 +73,9 @@ public class FormPageController {
@ApiOperation("通过页面id查询所对应的数据模型") @ApiOperation("通过页面id查询所对应的数据模型")
@PostMapping("/findByPageIds") @PostMapping("/findByPageIds")
public List<TableInfo> findByPageIds(@RequestBody List<Integer> pageIds){ public List<TableInfo> findByPageIds(@RequestBody SearchPageEntityVo searchPageEntityVo){
return formPageService.findByPageIds(pageIds); return formPageService.findByPageIds(searchPageEntityVo.getPageIds());
} }
......
package com.tykj.workflowcore.workflow_editer.entity.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* @author HuangXiahao
* @version V1.0
* @class SearchPageEntityVo
* @packageName com.tykj.workflowcore.workflow_editer.entity.vo
**/
@AllArgsConstructor
@NoArgsConstructor
@Data
public class SearchPageEntityVo {
List<Integer> pageIds;
}
...@@ -85,7 +85,7 @@ public class FormPageServiceImpl implements FormPageService { ...@@ -85,7 +85,7 @@ public class FormPageServiceImpl implements FormPageService {
public List<TableInfo> findByPageIds(List<Integer> pageIds) { public List<TableInfo> findByPageIds(List<Integer> pageIds) {
PredicateBuilder<FormPage> builder = Specifications.and(); PredicateBuilder<FormPage> builder = Specifications.and();
builder.in("id", pageIds); builder.in("id", pageIds.toArray());
List<FormPage> tableInfoList = formPageMapper.findAll(builder.build()); List<FormPage> tableInfoList = formPageMapper.findAll(builder.build());
StringBuffer entityIds = new StringBuffer(); StringBuffer entityIds = new StringBuffer();
for (int i = 0; i < tableInfoList.size(); i++) { for (int i = 0; i < tableInfoList.size(); i++) {
...@@ -96,14 +96,10 @@ public class FormPageServiceImpl implements FormPageService { ...@@ -96,14 +96,10 @@ public class FormPageServiceImpl implements FormPageService {
entityIds.deleteCharAt(entityIds.length()-1); entityIds.deleteCharAt(entityIds.length()-1);
} }
} }
String[] split = entityIds.toString().split(","); String[] split = entityIds.toString().split(",");
List<String> lastEntityIds = Arrays.asList(split).stream().distinct().collect(Collectors.toList()); Integer[] ids =Arrays.stream(split).mapToInt(Integer::parseInt).boxed().toArray(Integer[]::new);
//todo
Integer[] ids = (Integer[]) lastEntityIds.toArray();
SearchTableInfoVo searchTableInfoVo = new SearchTableInfoVo(); SearchTableInfoVo searchTableInfoVo = new SearchTableInfoVo();
searchTableInfoVo.setIds(ids); searchTableInfoVo.setIds(ids);
return modelService.listAllEntities(searchTableInfoVo); return modelService.listAllEntities(searchTableInfoVo);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论