提交 3cfd4e36 编写于 作者: tangyaolong's avatar tangyaolong

多动态实例开发

上级 e14ccd2e
...@@ -52,7 +52,7 @@ public class DynamicModelConfigExService extends DynamicModelConfigServiceImpl { ...@@ -52,7 +52,7 @@ public class DynamicModelConfigExService extends DynamicModelConfigServiceImpl {
@Lazy @Lazy
private IBZWFFeignClient wfClient; private IBZWFFeignClient wfClient;
@Value("${ibiz.dynamic.publishpath:/app/file/dynamicModel/publicpath}") @Value("${ibiz.dynamic.publishpath:d:/app/file/dynamicModel/publicpath}")
private String publishPath; private String publishPath;
@Autowired @Autowired
...@@ -129,7 +129,7 @@ public class DynamicModelConfigExService extends DynamicModelConfigServiceImpl { ...@@ -129,7 +129,7 @@ public class DynamicModelConfigExService extends DynamicModelConfigServiceImpl {
List<Map<String, Object>> workflow = searchWorkFlow(publishFile.getPath()); List<Map<String, Object>> workflow = searchWorkFlow(publishFile.getPath());
//部署流程 //部署流程
if (workflow.size() > 0) { if (workflow.size() > 0) {
wfClient.deployBpmnFile(workflow); // wfClient.deployBpmnFile(workflow);
} }
//发送redis广播 //发送redis广播
Map<String, Object> message = new HashMap<>(); Map<String, Object> message = new HashMap<>();
...@@ -186,7 +186,7 @@ public class DynamicModelConfigExService extends DynamicModelConfigServiceImpl { ...@@ -186,7 +186,7 @@ public class DynamicModelConfigExService extends DynamicModelConfigServiceImpl {
file = new FileInputStream(subFile); file = new FileInputStream(subFile);
Map fileMap = new HashMap(); Map fileMap = new HashMap();
fileMap.put("filename", subFile.getName().toLowerCase()); fileMap.put("filename", subFile.getName().toLowerCase());
fileMap.put("filepath", subFile.getPath().replace(getPublishPath(), "").toLowerCase()); fileMap.put("filepath", concatFilePath(subFile.getPath().replace(getPublishPath(), "").toLowerCase(),"test"));
fileMap.put("filecontent", IOUtils.toString(file, "UTF-8")); fileMap.put("filecontent", IOUtils.toString(file, "UTF-8"));
models.add(fileMap); models.add(fileMap);
} catch (IOException e) { } catch (IOException e) {
...@@ -261,6 +261,23 @@ public class DynamicModelConfigExService extends DynamicModelConfigServiceImpl { ...@@ -261,6 +261,23 @@ public class DynamicModelConfigExService extends DynamicModelConfigServiceImpl {
return publishPath; return publishPath;
} }
/**
*
* @param filePath 原路径
* @param instId 需要补充的动态实例id
* @return 在第一层路径后加上动态实例id名字作为路径
* 原来:/sample/xxx
* 修改后:/sample/dynamic/xxx
*/
public String concatFilePath(String filePath,String instId) {
if(filePath != null && filePath.contains("\\") && filePath.split("\\\\").length > 1){
String prePath = filePath.substring(0,filePath.indexOf("\\"));
String surPath = filePath.substring(filePath.indexOf("\\")+1);
return prePath + File.separator + instId.toLowerCase() + File.separator + surPath;
}
return filePath;
}
/** /**
* 获取系统标识 * 获取系统标识
* *
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册