提交 beed36b5 编写于 作者: zhouweidong's avatar zhouweidong

适配动态系统zip目录调整

上级 ebf50d0c
...@@ -42,6 +42,8 @@ import java.util.Map; ...@@ -42,6 +42,8 @@ import java.util.Map;
@Service("MetaDynamicModelExService") @Service("MetaDynamicModelExService")
public class MetaDynamicModelExService extends MetaDynamicModelServiceImpl { public class MetaDynamicModelExService extends MetaDynamicModelServiceImpl {
private static final String wf_regex="\\w+WFv\\d+.json.bpmn";
@Override @Override
protected Class currentModelClass() { protected Class currentModelClass() {
return com.baomidou.mybatisplus.core.toolkit.ReflectionKit.getSuperClassGenericType(this.getClass().getSuperclass(), 1); return com.baomidou.mybatisplus.core.toolkit.ReflectionKit.getSuperClassGenericType(this.getClass().getSuperclass(), 1);
...@@ -233,7 +235,7 @@ public class MetaDynamicModelExService extends MetaDynamicModelServiceImpl { ...@@ -233,7 +235,7 @@ public class MetaDynamicModelExService extends MetaDynamicModelServiceImpl {
List<Map<String, Object>> models = new ArrayList<>(); List<Map<String, Object>> models = new ArrayList<>();
File publish = new File(path); File publish = new File(path);
if (!publish.exists()) { if (!publish.exists()) {
throw new BadRequestAlertException(String.format("发布目录[%s]不存在", publish.getPath()), "MetaDynamicModel", "search"); throw new BadRequestAlertException(String.format("发布目录[%s]不存在", publish.getPath()), "MetaDynamicModel", "searchLogic");
} }
File[] subFiles = publish.listFiles(); File[] subFiles = publish.listFiles();
if (null != subFiles) { if (null != subFiles) {
...@@ -243,7 +245,7 @@ public class MetaDynamicModelExService extends MetaDynamicModelServiceImpl { ...@@ -243,7 +245,7 @@ public class MetaDynamicModelExService extends MetaDynamicModelServiceImpl {
if (!ObjectUtils.isEmpty(subModels)) { if (!ObjectUtils.isEmpty(subModels)) {
models.addAll(subModels); models.addAll(subModels);
} }
} else if (subFile.isFile() && (!subFile.getName().equalsIgnoreCase("PSWFVERSION.json.bpmn")) && (subFile.getName().endsWith(".bpmn") || subFile.getName().endsWith(".drl"))) { } else if (subFile.isFile() && (!subFile.getName().matches(wf_regex)) && (subFile.getName().endsWith(".bpmn") || subFile.getName().endsWith(".drl"))) {
InputStream file = null; InputStream file = null;
try { try {
file = new FileInputStream(subFile); file = new FileInputStream(subFile);
...@@ -277,7 +279,7 @@ public class MetaDynamicModelExService extends MetaDynamicModelServiceImpl { ...@@ -277,7 +279,7 @@ public class MetaDynamicModelExService extends MetaDynamicModelServiceImpl {
List<Map<String, Object>> models = new ArrayList<>(); List<Map<String, Object>> models = new ArrayList<>();
File publish = new File(pubPath); File publish = new File(pubPath);
if (!publish.exists()) { if (!publish.exists()) {
throw new BadRequestAlertException(String.format("发布目录[%s]不存在", publish.getPath()), "MetaDynamicModel", "search"); throw new BadRequestAlertException(String.format("发布目录[%s]不存在", publish.getPath()), "MetaDynamicModel", "searchWorkFlow");
} }
File[] subFiles = publish.listFiles(); File[] subFiles = publish.listFiles();
if (null != subFiles) { if (null != subFiles) {
...@@ -287,7 +289,7 @@ public class MetaDynamicModelExService extends MetaDynamicModelServiceImpl { ...@@ -287,7 +289,7 @@ public class MetaDynamicModelExService extends MetaDynamicModelServiceImpl {
if (!ObjectUtils.isEmpty(subModels)) { if (!ObjectUtils.isEmpty(subModels)) {
models.addAll(subModels); models.addAll(subModels);
} }
} else if (subFile.isFile() && (subFile.getName().equalsIgnoreCase("PSWFVERSION.json.bpmn"))) { } else if (subFile.isFile() && (subFile.getName().matches(wf_regex))) {
InputStream file = null; InputStream file = null;
try { try {
file = new FileInputStream(subFile); file = new FileInputStream(subFile);
...@@ -338,7 +340,7 @@ public class MetaDynamicModelExService extends MetaDynamicModelServiceImpl { ...@@ -338,7 +340,7 @@ public class MetaDynamicModelExService extends MetaDynamicModelServiceImpl {
try { try {
File file = new File(filePath + File.separator + "PSSYSTEM.json"); File file = new File(filePath + File.separator + "PSSYSTEM.json");
if (!file.exists()) { if (!file.exists()) {
throw new BadRequestAlertException(String.format("无法找到动态系统模型文件[%s]", file.getPath()), "MetaDynamicModel", "getSystemId"); throw new BadRequestAlertException(String.format("无法找到动态系统模型文件[%s]", file.getPath()), "MetaDynamicModel", "getSystem");
} }
in = new FileInputStream(file); in = new FileInputStream(file);
bytes = new byte[in.available()]; bytes = new byte[in.available()];
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册