Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzlite
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzlite
提交
6d497d93
提交
6d497d93
编写于
1月 20, 2021
作者:
zhouweidong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化初始化模型逻辑
上级
a8b1399d
变更
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
28 行增加
和
13 行删除
+28
-13
DynamicModelConfigExService.java
.../core/extensions/service/DynamicModelConfigExService.java
+28
-13
未找到文件。
ibzlite-core/src/main/java/cn/ibizlab/core/extensions/service/DynamicModelConfigExService.java
浏览文件 @
6d497d93
...
@@ -52,8 +52,8 @@ public class DynamicModelConfigExService extends DynamicModelConfigServiceImpl {
...
@@ -52,8 +52,8 @@ public class DynamicModelConfigExService extends DynamicModelConfigServiceImpl {
@Lazy
@Lazy
private
IBZWFFeignClient
wfClient
;
private
IBZWFFeignClient
wfClient
;
@Value
(
"${ibiz.dynamic.publi
c
path:/app/file/dynamicModel/publicpath}"
)
@Value
(
"${ibiz.dynamic.publi
sh
path:/app/file/dynamicModel/publicpath}"
)
private
String
publi
c
Path
;
private
String
publi
sh
Path
;
@Autowired
@Autowired
RedisTemplate
<
String
,
Object
>
redisOperations
;
RedisTemplate
<
String
,
Object
>
redisOperations
;
...
@@ -103,7 +103,7 @@ public class DynamicModelConfigExService extends DynamicModelConfigServiceImpl {
...
@@ -103,7 +103,7 @@ public class DynamicModelConfigExService extends DynamicModelConfigServiceImpl {
List
<
FileItem
>
items
=
JSONArray
.
parseArray
(
strModelFile
,
FileItem
.
class
);
List
<
FileItem
>
items
=
JSONArray
.
parseArray
(
strModelFile
,
FileItem
.
class
);
if
(!
ObjectUtils
.
isEmpty
(
items
)
&&
items
.
size
()
>
1
)
if
(!
ObjectUtils
.
isEmpty
(
items
)
&&
items
.
size
()
>
1
)
throw
new
BadRequestAlertException
(
String
.
format
(
"模型解析失败,[%s]模型文件过多"
,
et
.
getConfigid
()),
"DynamicModelConfig"
,
"unzip"
);
throw
new
BadRequestAlertException
(
String
.
format
(
"模型解析失败,[%s]模型文件过多"
,
et
.
getConfigid
()),
"DynamicModelConfig"
,
"unzip"
);
File
publishFile
=
new
File
(
publicPath
+
systemId
);
File
publishFile
=
new
File
(
getPublishPath
()
+
systemId
);
//删除发布目录中的历史文件
//删除发布目录中的历史文件
if
(
publishFile
.
exists
())
{
if
(
publishFile
.
exists
())
{
FileHelper
.
deleteDir
(
publishFile
.
getPath
());
FileHelper
.
deleteDir
(
publishFile
.
getPath
());
...
@@ -143,10 +143,10 @@ public class DynamicModelConfigExService extends DynamicModelConfigServiceImpl {
...
@@ -143,10 +143,10 @@ public class DynamicModelConfigExService extends DynamicModelConfigServiceImpl {
*/
*/
@SneakyThrows
@SneakyThrows
public
List
<
Map
<
String
,
Object
>>
getDynamicModel
(
String
systemId
)
{
public
List
<
Map
<
String
,
Object
>>
getDynamicModel
(
String
systemId
)
{
String
pub
lishPath
=
publicPath
+
systemId
;
String
pub
Path
=
getPublishPath
()
+
systemId
;
List
<
Map
<
String
,
Object
>>
delogics
=
searchLogic
(
pub
lish
Path
);
List
<
Map
<
String
,
Object
>>
delogics
=
searchLogic
(
pubPath
);
if
(
ObjectUtils
.
isEmpty
(
delogics
))
{
if
(
ObjectUtils
.
isEmpty
(
delogics
))
{
throw
new
BadRequestAlertException
(
String
.
format
(
"在发布目录[%s]中没有找到系统[%s]动态模型文件"
,
pub
lish
Path
,
systemId
),
"DynamicModelConfig"
,
"getDynamicModel"
);
throw
new
BadRequestAlertException
(
String
.
format
(
"在发布目录[%s]中没有找到系统[%s]动态模型文件"
,
pubPath
,
systemId
),
"DynamicModelConfig"
,
"getDynamicModel"
);
}
}
return
delogics
;
return
delogics
;
}
}
...
@@ -154,12 +154,12 @@ public class DynamicModelConfigExService extends DynamicModelConfigServiceImpl {
...
@@ -154,12 +154,12 @@ public class DynamicModelConfigExService extends DynamicModelConfigServiceImpl {
/**
/**
* 从发布目录中查询 bpmn及drl
* 从发布目录中查询 bpmn及drl
*
*
* @param p
ublishP
ath
* @param path
* @return
* @return
*/
*/
public
List
<
Map
<
String
,
Object
>>
searchLogic
(
String
p
ublishP
ath
)
{
public
List
<
Map
<
String
,
Object
>>
searchLogic
(
String
path
)
{
List
<
Map
<
String
,
Object
>>
models
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
models
=
new
ArrayList
<>();
File
publish
=
new
File
(
p
ublishP
ath
);
File
publish
=
new
File
(
path
);
if
(!
publish
.
exists
())
{
if
(!
publish
.
exists
())
{
throw
new
BadRequestAlertException
(
String
.
format
(
"发布目录[%s]不存在"
,
publish
.
getPath
()),
"DynamicModelConfig"
,
"search"
);
throw
new
BadRequestAlertException
(
String
.
format
(
"发布目录[%s]不存在"
,
publish
.
getPath
()),
"DynamicModelConfig"
,
"search"
);
}
}
...
@@ -177,7 +177,7 @@ public class DynamicModelConfigExService extends DynamicModelConfigServiceImpl {
...
@@ -177,7 +177,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
(
publicPath
,
""
).
toLowerCase
());
fileMap
.
put
(
"filepath"
,
subFile
.
getPath
().
replace
(
getPublishPath
()
,
""
).
toLowerCase
());
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
)
{
...
@@ -198,12 +198,12 @@ public class DynamicModelConfigExService extends DynamicModelConfigServiceImpl {
...
@@ -198,12 +198,12 @@ public class DynamicModelConfigExService extends DynamicModelConfigServiceImpl {
/**
/**
* 从查询工作流 bpmn
* 从查询工作流 bpmn
*
*
* @param pub
lish
Path
* @param pubPath
* @return
* @return
*/
*/
public
List
<
Map
<
String
,
Object
>>
searchWorkFlow
(
String
pub
lish
Path
)
{
public
List
<
Map
<
String
,
Object
>>
searchWorkFlow
(
String
pubPath
)
{
List
<
Map
<
String
,
Object
>>
models
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
models
=
new
ArrayList
<>();
File
publish
=
new
File
(
pub
lish
Path
);
File
publish
=
new
File
(
pubPath
);
if
(!
publish
.
exists
())
{
if
(!
publish
.
exists
())
{
throw
new
BadRequestAlertException
(
String
.
format
(
"发布目录[%s]不存在"
,
publish
.
getPath
()),
"DynamicModelConfig"
,
"search"
);
throw
new
BadRequestAlertException
(
String
.
format
(
"发布目录[%s]不存在"
,
publish
.
getPath
()),
"DynamicModelConfig"
,
"search"
);
}
}
...
@@ -237,6 +237,21 @@ public class DynamicModelConfigExService extends DynamicModelConfigServiceImpl {
...
@@ -237,6 +237,21 @@ public class DynamicModelConfigExService extends DynamicModelConfigServiceImpl {
return
models
;
return
models
;
}
}
/**
* 获取发布目录
*
* @return
*/
public
String
getPublishPath
()
{
if
(!
StringUtils
.
isEmpty
(
publishPath
))
{
publishPath
=
publishPath
.
replace
(
"\\\\"
,
File
.
separator
).
replace
(
"\\"
,
File
.
separator
).
replace
(
"/"
,
File
.
separator
);
if
(!
publishPath
.
endsWith
(
File
.
separator
))
{
publishPath
=
publishPath
+
File
.
separator
;
}
}
return
publishPath
;
}
/**
/**
* 获取系统标识
* 获取系统标识
*
*
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录