提交 fd3f4ac7 authored 作者: 马晨俊's avatar 马晨俊

mcj:修改数据库类型为oracle时反序列化问题

上级 810e38d7
......@@ -7,7 +7,7 @@ package com.zjty.inspect.enums;
* @Date : 2020-03-05 18:02
*/
public enum DatabaseType {
ORCLE,
ORACLE,
SQLSERVER,
DB2,
MYSQL,
......
......@@ -192,7 +192,7 @@ public class Inspector {
if (path1.toAbsolutePath().toString().endsWith("jar") || path1.toAbsolutePath().toString().endsWith("class")) {
continue;
}
valiWarn(rules, path1, path1.getFileName().toString(), -1);
valiWarn(rules, path1, path1.getFileName().toString(), 0);
//将文件的每一行都与规则匹配
List<String> strings = Files.readAllLines(path1);
for (int i = 0; i < strings.size(); i++) {
......@@ -265,17 +265,24 @@ public class Inspector {
/**
* rule所需要数据装配
* @param status 状态
* 1:改造
* 2:适配
*/
private void ruleTransform(Integer status) {
//如果需要改造则查询所有规则
if (status == 1) {
this.ruleList = ruleDao.findAll();
} else {
//只查询前端技术
List<Technology> front = technologyDao.findAllByBackorfrontEquals(1);
List<String> ids = front.stream().map(Technology::getId).collect(Collectors.toList());
this.ruleList = ruleDao.findAllByTechnologyIdIn(ids);
List<String> technologyIds = front.stream().map(Technology::getId).collect(Collectors.toList());
this.ruleList = ruleDao.findAllByTechnologyIdIn(technologyIds);
}
Set<String> id = ruleList.stream().map(Rule::getTechnologyId).collect(Collectors.toSet());
List<Technology> technologies = technologyDao.findAllByIdIn(new ArrayList<>(id));
//得到目前适用的技术id
Set<String> technologyIds = ruleList.stream().map(Rule::getTechnologyId).collect(Collectors.toSet());
List<Technology> technologies = technologyDao.findAllByIdIn(new ArrayList<>(technologyIds));
for (Technology technology : technologies) {
technologyHashMap.put(technology.getId(), technology);
}
......@@ -289,13 +296,13 @@ public class Inspector {
}
}
ArrayList<String> ruleSuffixKeys = new ArrayList<>();
for (String s : ruleSuffixFilePathMap.keySet()) {
if (!ruleSuffixMap.containsKey(s)) {
ruleSuffixKeys.add(s);
for (String suffix : ruleSuffixFilePathMap.keySet()) {
if (!ruleSuffixMap.containsKey(suffix)) {
ruleSuffixKeys.add(suffix);
}
}
for (String key : ruleSuffixKeys) {
ruleSuffixFilePathMap.remove(key);
for (String suffix : ruleSuffixKeys) {
ruleSuffixFilePathMap.remove(suffix);
}
}
......@@ -497,6 +504,10 @@ public class Inspector {
return supportStatus;
}
/**
* 扫描源文件
* @throws IOException
*/
public void scanFiles() throws IOException {
//以下为计算文件名称匹配正则表达式
FileSystem aDefault = FileSystems.getDefault();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论