Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibztask
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibztask
提交
354fe565
提交
354fe565
编写于
4月 02, 2021
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ibiz4j 发布系统代码 [ibiz-task,任务调度]
上级
e68798c1
变更
18
隐藏空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
84 行增加
和
119 行删除
+84
-119
JobsInfoServiceImpl.java
...n/ibizlab/core/task/service/impl/JobsInfoServiceImpl.java
+2
-3
JobsLockServiceImpl.java
...n/ibizlab/core/task/service/impl/JobsLockServiceImpl.java
+2
-3
JobsLogServiceImpl.java
...cn/ibizlab/core/task/service/impl/JobsLogServiceImpl.java
+2
-3
JobsRegistryServiceImpl.java
...izlab/core/task/service/impl/JobsRegistryServiceImpl.java
+2
-3
JobsInfoMapper.xml
...rc/main/resources/mapper/task/jobsinfo/JobsInfoMapper.xml
+0
-1
JobsLockMapper.xml
...rc/main/resources/mapper/task/jobslock/JobsLockMapper.xml
+0
-1
JobsLogMapper.xml
.../src/main/resources/mapper/task/jobslog/JobsLogMapper.xml
+0
-1
JobsRegistryMapper.xml
...resources/mapper/task/jobsregistry/JobsRegistryMapper.xml
+0
-1
JobsInfoMapping.java
...src/main/java/cn/ibizlab/api/mapping/JobsInfoMapping.java
+0
-1
JobsLockMapping.java
...src/main/java/cn/ibizlab/api/mapping/JobsLockMapping.java
+0
-1
JobsLogMapping.java
.../src/main/java/cn/ibizlab/api/mapping/JobsLogMapping.java
+0
-1
JobsRegistryMapping.java
...main/java/cn/ibizlab/api/mapping/JobsRegistryMapping.java
+0
-1
DELogicAspect.java
...l/src/main/java/cn/ibizlab/util/aspect/DELogicAspect.java
+64
-97
IBZWFFeignClient.java
...rc/main/java/cn/ibizlab/util/client/IBZWFFeignClient.java
+1
-0
DELogic.java
...sk-util/src/main/java/cn/ibizlab/util/domain/DELogic.java
+2
-1
SearchContextBase.java
...c/main/java/cn/ibizlab/util/filter/SearchContextBase.java
+1
-0
AuthenticationUser.java
...ain/java/cn/ibizlab/util/security/AuthenticationUser.java
+7
-0
AuthorizationTokenFilter.java
...va/cn/ibizlab/util/security/AuthorizationTokenFilter.java
+1
-1
未找到文件。
ibztask-core/src/main/java/cn/ibizlab/core/task/service/impl/JobsInfoServiceImpl.java
浏览文件 @
354fe565
...
@@ -100,9 +100,8 @@ public class JobsInfoServiceImpl extends ServiceImpl<JobsInfoMapper, JobsInfo> i
...
@@ -100,9 +100,8 @@ public class JobsInfoServiceImpl extends ServiceImpl<JobsInfoMapper, JobsInfo> i
@Transactional
@Transactional
public
JobsInfo
get
(
String
key
)
{
public
JobsInfo
get
(
String
key
)
{
JobsInfo
et
=
getById
(
key
);
JobsInfo
et
=
getById
(
key
);
if
(
et
==
null
){
if
(
et
==
null
)
{
et
=
new
JobsInfo
();
throw
new
BadRequestAlertException
(
"数据不存在"
,
this
.
getClass
().
getSimpleName
(),
key
);
et
.
setId
(
key
);
}
}
else
{
else
{
}
}
...
...
ibztask-core/src/main/java/cn/ibizlab/core/task/service/impl/JobsLockServiceImpl.java
浏览文件 @
354fe565
...
@@ -100,9 +100,8 @@ public class JobsLockServiceImpl extends ServiceImpl<JobsLockMapper, JobsLock> i
...
@@ -100,9 +100,8 @@ public class JobsLockServiceImpl extends ServiceImpl<JobsLockMapper, JobsLock> i
@Transactional
@Transactional
public
JobsLock
get
(
String
key
)
{
public
JobsLock
get
(
String
key
)
{
JobsLock
et
=
getById
(
key
);
JobsLock
et
=
getById
(
key
);
if
(
et
==
null
){
if
(
et
==
null
)
{
et
=
new
JobsLock
();
throw
new
BadRequestAlertException
(
"数据不存在"
,
this
.
getClass
().
getSimpleName
(),
key
);
et
.
setId
(
key
);
}
}
else
{
else
{
}
}
...
...
ibztask-core/src/main/java/cn/ibizlab/core/task/service/impl/JobsLogServiceImpl.java
浏览文件 @
354fe565
...
@@ -100,9 +100,8 @@ public class JobsLogServiceImpl extends ServiceImpl<JobsLogMapper, JobsLog> impl
...
@@ -100,9 +100,8 @@ public class JobsLogServiceImpl extends ServiceImpl<JobsLogMapper, JobsLog> impl
@Transactional
@Transactional
public
JobsLog
get
(
String
key
)
{
public
JobsLog
get
(
String
key
)
{
JobsLog
et
=
getById
(
key
);
JobsLog
et
=
getById
(
key
);
if
(
et
==
null
){
if
(
et
==
null
)
{
et
=
new
JobsLog
();
throw
new
BadRequestAlertException
(
"数据不存在"
,
this
.
getClass
().
getSimpleName
(),
key
);
et
.
setId
(
key
);
}
}
else
{
else
{
}
}
...
...
ibztask-core/src/main/java/cn/ibizlab/core/task/service/impl/JobsRegistryServiceImpl.java
浏览文件 @
354fe565
...
@@ -100,9 +100,8 @@ public class JobsRegistryServiceImpl extends ServiceImpl<JobsRegistryMapper, Job
...
@@ -100,9 +100,8 @@ public class JobsRegistryServiceImpl extends ServiceImpl<JobsRegistryMapper, Job
@Transactional
@Transactional
public
JobsRegistry
get
(
String
key
)
{
public
JobsRegistry
get
(
String
key
)
{
JobsRegistry
et
=
getById
(
key
);
JobsRegistry
et
=
getById
(
key
);
if
(
et
==
null
){
if
(
et
==
null
)
{
et
=
new
JobsRegistry
();
throw
new
BadRequestAlertException
(
"数据不存在"
,
this
.
getClass
().
getSimpleName
(),
key
);
et
.
setId
(
key
);
}
}
else
{
else
{
}
}
...
...
ibztask-core/src/main/resources/mapper/task/jobsinfo/JobsInfoMapper.xml
浏览文件 @
354fe565
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.ibizlab.core.task.mapper.JobsInfoMapper"
>
<mapper
namespace=
"cn.ibizlab.core.task.mapper.JobsInfoMapper"
>
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
...
...
ibztask-core/src/main/resources/mapper/task/jobslock/JobsLockMapper.xml
浏览文件 @
354fe565
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.ibizlab.core.task.mapper.JobsLockMapper"
>
<mapper
namespace=
"cn.ibizlab.core.task.mapper.JobsLockMapper"
>
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
...
...
ibztask-core/src/main/resources/mapper/task/jobslog/JobsLogMapper.xml
浏览文件 @
354fe565
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.ibizlab.core.task.mapper.JobsLogMapper"
>
<mapper
namespace=
"cn.ibizlab.core.task.mapper.JobsLogMapper"
>
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
...
...
ibztask-core/src/main/resources/mapper/task/jobsregistry/JobsRegistryMapper.xml
浏览文件 @
354fe565
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.ibizlab.core.task.mapper.JobsRegistryMapper"
>
<mapper
namespace=
"cn.ibizlab.core.task.mapper.JobsRegistryMapper"
>
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
...
...
ibztask-provider/ibztask-provider-api/src/main/java/cn/ibizlab/api/mapping/JobsInfoMapping.java
浏览文件 @
354fe565
...
@@ -12,4 +12,3 @@ public interface JobsInfoMapping extends MappingBase<JobsInfoDTO, JobsInfo> {
...
@@ -12,4 +12,3 @@ public interface JobsInfoMapping extends MappingBase<JobsInfoDTO, JobsInfo> {
}
}
ibztask-provider/ibztask-provider-api/src/main/java/cn/ibizlab/api/mapping/JobsLockMapping.java
浏览文件 @
354fe565
...
@@ -12,4 +12,3 @@ public interface JobsLockMapping extends MappingBase<JobsLockDTO, JobsLock> {
...
@@ -12,4 +12,3 @@ public interface JobsLockMapping extends MappingBase<JobsLockDTO, JobsLock> {
}
}
ibztask-provider/ibztask-provider-api/src/main/java/cn/ibizlab/api/mapping/JobsLogMapping.java
浏览文件 @
354fe565
...
@@ -12,4 +12,3 @@ public interface JobsLogMapping extends MappingBase<JobsLogDTO, JobsLog> {
...
@@ -12,4 +12,3 @@ public interface JobsLogMapping extends MappingBase<JobsLogDTO, JobsLog> {
}
}
ibztask-provider/ibztask-provider-api/src/main/java/cn/ibizlab/api/mapping/JobsRegistryMapping.java
浏览文件 @
354fe565
...
@@ -12,4 +12,3 @@ public interface JobsRegistryMapping extends MappingBase<JobsRegistryDTO, JobsRe
...
@@ -12,4 +12,3 @@ public interface JobsRegistryMapping extends MappingBase<JobsRegistryDTO, JobsRe
}
}
ibztask-util/src/main/java/cn/ibizlab/util/aspect/DELogicAspect.java
浏览文件 @
354fe565
package
cn
.
ibizlab
.
util
.
aspect
;
package
cn
.
ibizlab
.
util
.
aspect
;
import
lombok.SneakyThrows
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
cn.ibizlab.util.domain.DELogic
;
import
cn.ibizlab.util.domain.DELogic
;
import
cn.ibizlab.util.domain.EntityBase
;
import
cn.ibizlab.util.domain.EntityBase
;
import
cn.ibizlab.util.errors.BadRequestAlertException
;
import
cn.ibizlab.util.errors.BadRequestAlertException
;
import
cn.ibizlab.util.helper.DEFieldCacheMap
;
import
cn.ibizlab.util.helper.DEFieldCacheMap
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.io.IOUtils
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.annotation.Around
;
import
org.aspectj.lang.annotation.Around
;
...
@@ -22,6 +20,8 @@ import org.kie.api.builder.Results;
...
@@ -22,6 +20,8 @@ import org.kie.api.builder.Results;
import
org.kie.api.runtime.KieContainer
;
import
org.kie.api.runtime.KieContainer
;
import
org.kie.api.runtime.KieSession
;
import
org.kie.api.runtime.KieSession
;
import
org.kie.internal.io.ResourceFactory
;
import
org.kie.internal.io.ResourceFactory
;
import
org.springframework.core.io.ClassPathResource
;
import
org.springframework.core.io.Resource
;
import
org.springframework.expression.EvaluationContext
;
import
org.springframework.expression.EvaluationContext
;
import
org.springframework.expression.Expression
;
import
org.springframework.expression.Expression
;
import
org.springframework.expression.ExpressionParser
;
import
org.springframework.expression.ExpressionParser
;
...
@@ -35,7 +35,6 @@ import org.springframework.util.StringUtils;
...
@@ -35,7 +35,6 @@ import org.springframework.util.StringUtils;
import
javax.xml.stream.XMLInputFactory
;
import
javax.xml.stream.XMLInputFactory
;
import
javax.xml.stream.XMLStreamReader
;
import
javax.xml.stream.XMLStreamReader
;
import
java.io.File
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Method
;
...
@@ -109,7 +108,7 @@ public class DELogicAspect {
...
@@ -109,7 +108,7 @@ public class DELogicAspect {
* @param action
* @param action
*/
*/
private
void
executeBeforeLogic
(
EntityBase
entity
,
String
action
)
{
private
void
executeBeforeLogic
(
EntityBase
entity
,
String
action
)
{
Fil
e
bpmnFile
=
getLocalModel
(
entity
.
getClass
().
getSimpleName
(),
action
,
LogicExecMode
.
BEFORE
);
Resourc
e
bpmnFile
=
getLocalModel
(
entity
.
getClass
().
getSimpleName
(),
action
,
LogicExecMode
.
BEFORE
);
if
(
bpmnFile
!=
null
&&
bpmnFile
.
exists
()
&&
isValid
(
bpmnFile
,
entity
,
action
))
{
if
(
bpmnFile
!=
null
&&
bpmnFile
.
exists
()
&&
isValid
(
bpmnFile
,
entity
,
action
))
{
executeLogic
(
bpmnFile
,
entity
,
action
);
executeLogic
(
bpmnFile
,
entity
,
action
);
}
}
...
@@ -122,7 +121,7 @@ public class DELogicAspect {
...
@@ -122,7 +121,7 @@ public class DELogicAspect {
* @param action
* @param action
*/
*/
private
void
executeAfterLogic
(
EntityBase
entity
,
String
action
)
{
private
void
executeAfterLogic
(
EntityBase
entity
,
String
action
)
{
Fil
e
bpmnFile
=
getLocalModel
(
entity
.
getClass
().
getSimpleName
(),
action
,
LogicExecMode
.
AFTER
);
Resourc
e
bpmnFile
=
getLocalModel
(
entity
.
getClass
().
getSimpleName
(),
action
,
LogicExecMode
.
AFTER
);
if
(
bpmnFile
!=
null
&&
bpmnFile
.
exists
()
&&
isValid
(
bpmnFile
,
entity
,
action
))
{
if
(
bpmnFile
!=
null
&&
bpmnFile
.
exists
()
&&
isValid
(
bpmnFile
,
entity
,
action
))
{
executeLogic
(
bpmnFile
,
entity
,
action
);
executeLogic
(
bpmnFile
,
entity
,
action
);
}
}
...
@@ -135,7 +134,7 @@ public class DELogicAspect {
...
@@ -135,7 +134,7 @@ public class DELogicAspect {
* @param action
* @param action
*/
*/
private
void
executeLogic
(
EntityBase
entity
,
String
action
)
{
private
void
executeLogic
(
EntityBase
entity
,
String
action
)
{
Fil
e
bpmnFile
=
getLocalModel
(
entity
.
getClass
().
getSimpleName
(),
action
,
LogicExecMode
.
EXEC
);
Resourc
e
bpmnFile
=
getLocalModel
(
entity
.
getClass
().
getSimpleName
(),
action
,
LogicExecMode
.
EXEC
);
if
(
bpmnFile
!=
null
&&
bpmnFile
.
exists
()
&&
isValid
(
bpmnFile
,
entity
,
action
))
{
if
(
bpmnFile
!=
null
&&
bpmnFile
.
exists
()
&&
isValid
(
bpmnFile
,
entity
,
action
))
{
executeLogic
(
bpmnFile
,
entity
,
action
);
executeLogic
(
bpmnFile
,
entity
,
action
);
}
}
...
@@ -147,32 +146,37 @@ public class DELogicAspect {
...
@@ -147,32 +146,37 @@ public class DELogicAspect {
* @param bpmnFile
* @param bpmnFile
* @param entity
* @param entity
*/
*/
private
void
executeLogic
(
File
bpmnFile
,
Object
entity
,
String
action
)
{
private
void
executeLogic
(
Resource
bpmnFile
,
Object
entity
,
String
action
)
{
log
.
debug
(
"开始执行实体处理逻辑[{}:{}:{}:本地模式]"
,
entity
.
getClass
().
getSimpleName
(),
action
,
bpmnFile
.
getName
());
try
{
String
bpmnId
=
DigestUtils
.
md5DigestAsHex
(
bpmnFile
.
getPath
().
getBytes
());
log
.
debug
(
"开始执行实体处理逻辑[{}:{}:{}:本地模式]"
,
entity
.
getClass
().
getSimpleName
(),
action
,
bpmnFile
.
getFilename
());
DELogic
logic
=
getDELogic
(
bpmnFile
);
String
bpmnId
=
DigestUtils
.
md5DigestAsHex
(
bpmnFile
.
getURL
().
getPath
().
getBytes
());
if
(
logic
==
null
)
{
DELogic
logic
=
getDELogic
(
bpmnFile
);
return
;
if
(
logic
==
null
)
{
}
return
;
if
(
deLogicMap
.
containsKey
(
bpmnId
)
&&
logic
.
getMd5
().
equals
(
deLogicMap
.
get
(
bpmnId
).
getMd5
()))
{
}
logic
=
deLogicMap
.
get
(
bpmnId
);
if
(
deLogicMap
.
containsKey
(
bpmnId
)
&&
logic
.
getMd5
().
equals
(
deLogicMap
.
get
(
bpmnId
).
getMd5
()))
{
}
else
{
logic
=
deLogicMap
.
get
(
bpmnId
);
reloadLogic
(
logic
);
}
else
{
deLogicMap
.
put
(
bpmnId
,
logic
);
reloadLogic
(
logic
);
}
deLogicMap
.
put
(
bpmnId
,
logic
);
KieContainer
container
=
logic
.
getContainer
();
}
KieSession
kieSession
=
container
.
getKieBase
().
newKieSession
();
KieContainer
container
=
logic
.
getContainer
();
Process
mainProcess
=
logic
.
getProcess
();
KieSession
kieSession
=
container
.
getKieBase
().
newKieSession
();
//主流程参数
Process
mainProcess
=
logic
.
getProcess
();
fillGlobalParam
(
kieSession
,
mainProcess
,
entity
);
//主流程参数
//子流程参数
fillGlobalParam
(
kieSession
,
mainProcess
,
entity
);
if
(!
ObjectUtils
.
isEmpty
(
logic
.
getRefLogic
()))
{
//子流程参数
for
(
DELogic
subLogic
:
logic
.
getRefLogic
())
{
if
(!
ObjectUtils
.
isEmpty
(
logic
.
getRefLogic
()))
{
fillGlobalParam
(
kieSession
,
subLogic
.
getProcess
(),
entity
);
for
(
DELogic
subLogic
:
logic
.
getRefLogic
())
{
fillGlobalParam
(
kieSession
,
subLogic
.
getProcess
(),
entity
);
}
}
}
kieSession
.
startProcess
(
mainProcess
.
getId
());
log
.
debug
(
"实体处理逻辑[{}:{}:{}:本地模式]执行结束"
,
entity
.
getClass
().
getSimpleName
(),
action
,
bpmnFile
.
getFilename
());
}
catch
(
IOException
e
)
{
log
.
error
(
"实体处理逻辑[{}:{}:{}:本地模式]发生异常"
,
entity
.
getClass
().
getSimpleName
(),
action
,
bpmnFile
.
getFilename
());
throw
new
BadRequestAlertException
(
"执行实体处理逻辑发生异常"
+
e
.
getMessage
(),
"DELogicAspect"
,
"executeLogic"
);
}
}
kieSession
.
startProcess
(
mainProcess
.
getId
());
log
.
debug
(
"实体处理逻辑[{}:{}:{}:本地模式]执行结束"
,
entity
.
getClass
().
getSimpleName
(),
action
,
bpmnFile
.
getName
());
}
}
/**
/**
...
@@ -180,11 +184,11 @@ public class DELogicAspect {
...
@@ -180,11 +184,11 @@ public class DELogicAspect {
*
*
* @param logic
* @param logic
*/
*/
private
void
reloadLogic
(
DELogic
logic
)
{
private
void
reloadLogic
(
DELogic
logic
)
throws
IOException
{
KieServices
kieServices
=
KieServices
.
get
();
KieServices
kieServices
=
KieServices
.
get
();
KieFileSystem
kieFileSystem
=
kieServices
.
newKieFileSystem
();
KieFileSystem
kieFileSystem
=
kieServices
.
newKieFileSystem
();
for
(
Fil
e
bpmn
:
logic
.
getRefRuleFiles
())
{
for
(
Resourc
e
bpmn
:
logic
.
getRefRuleFiles
())
{
kieFileSystem
.
write
(
ResourceFactory
.
new
FileResource
(
bpmn
));
kieFileSystem
.
write
(
ResourceFactory
.
new
UrlResource
(
bpmn
.
getURL
()
));
}
}
KieBuilder
kieBuilder
=
kieServices
.
newKieBuilder
(
kieFileSystem
).
buildAll
();
KieBuilder
kieBuilder
=
kieServices
.
newKieBuilder
(
kieFileSystem
).
buildAll
();
Results
results
=
kieBuilder
.
getResults
();
Results
results
=
kieBuilder
.
getResults
();
...
@@ -239,28 +243,29 @@ public class DELogicAspect {
...
@@ -239,28 +243,29 @@ public class DELogicAspect {
* @param bpmnFile
* @param bpmnFile
* @return
* @return
*/
*/
@SneakyThrows
private
DELogic
getDELogic
(
Resource
bpmnFile
)
{
private
DELogic
getDELogic
(
File
bpmnFile
)
{
DELogic
logic
=
null
;
DELogic
logic
=
null
;
XMLStreamReader
reader
=
null
;
XMLStreamReader
reader
=
null
;
InputStream
bpmn
=
null
;
InputStream
bpmn
=
null
;
try
{
try
{
if
(
bpmnFile
.
exists
())
{
if
(
bpmnFile
.
exists
())
{
XMLInputFactory
factory
=
XMLInputFactory
.
newInstance
();
XMLInputFactory
factory
=
XMLInputFactory
.
newInstance
();
bpmn
=
new
FileInputStream
(
bpmnFile
);
bpmn
=
bpmnFile
.
getInputStream
(
);
reader
=
factory
.
createXMLStreamReader
(
bpmn
);
reader
=
factory
.
createXMLStreamReader
(
bpmn
);
BpmnModel
model
=
bpmnXMLConverter
.
convertToBpmnModel
(
reader
);
BpmnModel
model
=
bpmnXMLConverter
.
convertToBpmnModel
(
reader
);
Process
mainProcess
=
model
.
getMainProcess
();
Process
mainProcess
=
model
.
getMainProcess
();
if
(
mainProcess
==
null
)
{
if
(
mainProcess
==
null
)
{
return
null
;
return
null
;
}
}
log
.
debug
(
"正在加载 BPMN:{}"
,
bpmnFile
.
getURL
().
getPath
());
List
<
DELogic
>
refLogics
=
new
ArrayList
<>();
List
<
DELogic
>
refLogics
=
new
ArrayList
<>();
List
<
Fil
e
>
refFiles
=
new
ArrayList
<>();
List
<
Resourc
e
>
refFiles
=
new
ArrayList
<>();
//自己 bpmn 及 drl
//自己 bpmn 及 drl
refFiles
.
add
(
bpmnFile
);
refFiles
.
add
(
bpmnFile
);
Fil
e
drlFile
=
getDrl
(
bpmnFile
);
Resourc
e
drlFile
=
getDrl
(
bpmnFile
);
if
(
drlFile
!=
null
&&
drlFile
.
exists
())
{
if
(
drlFile
!=
null
&&
drlFile
.
exists
())
{
refFiles
.
add
(
drlFile
);
refFiles
.
add
(
drlFile
);
log
.
debug
(
"正在加载 DRL:{}"
,
drlFile
.
getURL
().
getPath
());
}
}
//子 bpmn 及 drl
//子 bpmn 及 drl
if
(!
ObjectUtils
.
isEmpty
(
model
.
getMainProcess
())
&&
!
ObjectUtils
.
isEmpty
(
model
.
getMainProcess
().
getFlowElementMap
()))
{
if
(!
ObjectUtils
.
isEmpty
(
model
.
getMainProcess
())
&&
!
ObjectUtils
.
isEmpty
(
model
.
getMainProcess
().
getFlowElementMap
()))
{
...
@@ -268,11 +273,7 @@ public class DELogicAspect {
...
@@ -268,11 +273,7 @@ public class DELogicAspect {
if
(
item
instanceof
CallActivity
)
{
if
(
item
instanceof
CallActivity
)
{
CallActivity
subBpmn
=
(
CallActivity
)
item
;
CallActivity
subBpmn
=
(
CallActivity
)
item
;
String
bpmnFileName
=
subBpmn
.
getName
();
String
bpmnFileName
=
subBpmn
.
getName
();
log
.
debug
(
"正在加载 BPMN:{}"
,
bpmnFileName
);
Resource
subBpmnFile
=
getSubBpmn
(
bpmnFileName
);
File
subBpmnFile
=
getSubBpmn
(
bpmnFileName
);
if
(
ObjectUtils
.
isEmpty
(
subBpmnFile
))
{
log
.
debug
(
"BPMN:{},缺少文件:{} "
,
bpmnFileName
,
subBpmnFile
);
}
DELogic
refLogic
=
getDELogic
(
subBpmnFile
);
DELogic
refLogic
=
getDELogic
(
subBpmnFile
);
if
(
refLogic
!=
null
)
{
if
(
refLogic
!=
null
)
{
refLogics
.
add
(
refLogic
);
refLogics
.
add
(
refLogic
);
...
@@ -292,7 +293,7 @@ public class DELogicAspect {
...
@@ -292,7 +293,7 @@ public class DELogicAspect {
logic
.
setMd5
(
getMd5
(
refFiles
));
logic
.
setMd5
(
getMd5
(
refFiles
));
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"执行处理逻辑失败"
+
e
);
log
.
error
(
"执行处理逻辑失败"
+
e
);
}
finally
{
}
finally
{
try
{
try
{
if
(
reader
!=
null
)
{
if
(
reader
!=
null
)
{
...
@@ -302,7 +303,7 @@ public class DELogicAspect {
...
@@ -302,7 +303,7 @@ public class DELogicAspect {
bpmn
.
close
();
bpmn
.
close
();
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"执行处理逻辑失败"
+
e
);
log
.
error
(
"执行处理逻辑失败"
+
e
);
}
}
}
}
return
logic
;
return
logic
;
...
@@ -327,10 +328,10 @@ public class DELogicAspect {
...
@@ -327,10 +328,10 @@ public class DELogicAspect {
}
}
}
}
}
}
if
(!
ObjectUtils
.
isEmpty
(
service
.
getSuperclass
())
&&
!
service
.
getSuperclass
().
getName
().
equals
(
Object
.
class
.
getName
()))
{
if
(!
ObjectUtils
.
isEmpty
(
service
.
getSuperclass
())
&&
!
service
.
getSuperclass
().
getName
().
equals
(
Object
.
class
.
getName
()))
{
return
getEntity
(
service
.
getSuperclass
());
return
getEntity
(
service
.
getSuperclass
());
}
}
log
.
error
(
"获取实体信息失败,未能在[{}]中找到参数为实体类对象的行为,如create.update等"
,
service
.
getSimpleName
());
log
.
error
(
"获取实体信息失败,未能在[{}]中找到参数为实体类对象的行为,如create.update等"
,
service
.
getSimpleName
());
return
null
;
return
null
;
}
}
...
@@ -340,19 +341,19 @@ public class DELogicAspect {
...
@@ -340,19 +341,19 @@ public class DELogicAspect {
* @param subFiles
* @param subFiles
* @return
* @return
*/
*/
private
String
getMd5
(
List
<
Fil
e
>
subFiles
)
{
private
String
getMd5
(
List
<
Resourc
e
>
subFiles
)
{
try
{
try
{
StringBuffer
buffer
=
new
StringBuffer
();
StringBuffer
buffer
=
new
StringBuffer
();
for
(
Fil
e
file
:
subFiles
)
{
for
(
Resourc
e
file
:
subFiles
)
{
InputStream
bpmnFile
=
null
;
InputStream
bpmnFile
=
null
;
try
{
try
{
bpmnFile
=
new
FileInputStream
(
file
);
bpmnFile
=
file
.
getInputStream
(
);
if
(!
ObjectUtils
.
isEmpty
(
bpmnFile
))
{
if
(!
ObjectUtils
.
isEmpty
(
bpmnFile
))
{
String
strBpmn
=
IOUtils
.
toString
(
bpmnFile
,
"UTF-8"
);
String
strBpmn
=
IOUtils
.
toString
(
bpmnFile
,
"UTF-8"
);
buffer
.
append
(
strBpmn
);
buffer
.
append
(
strBpmn
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"处理逻辑版本检查失败"
+
e
);
log
.
error
(
"处理逻辑版本检查失败"
+
e
);
}
finally
{
}
finally
{
if
(
bpmnFile
!=
null
)
{
if
(
bpmnFile
!=
null
)
{
bpmnFile
.
close
();
bpmnFile
.
close
();
...
@@ -365,12 +366,12 @@ public class DELogicAspect {
...
@@ -365,12 +366,12 @@ public class DELogicAspect {
return
null
;
return
null
;
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"处理逻辑版本检查失败"
+
e
);
log
.
error
(
"处理逻辑版本检查失败"
+
e
);
return
null
;
return
null
;
}
}
}
}
/**
/**
* 本地逻辑
* 本地逻辑
*
*
* @param entity
* @param entity
...
@@ -378,10 +379,8 @@ public class DELogicAspect {
...
@@ -378,10 +379,8 @@ public class DELogicAspect {
* @param logicExecMode
* @param logicExecMode
* @return
* @return
*/
*/
private
File
getLocalModel
(
String
entity
,
String
action
,
LogicExecMode
logicExecMode
)
{
private
Resource
getLocalModel
(
String
entity
,
String
action
,
LogicExecMode
logicExecMode
)
{
String
logicName
=
String
.
format
(
"%s.bpmn"
,
logicExecMode
.
text
);
return
new
ClassPathResource
(
"rules"
+
File
.
separator
+
entity
+
File
.
separator
+
action
.
toLowerCase
()
+
File
.
separator
+
logicExecMode
.
text
+
".bpmn"
);
String
filePath
=
File
.
separator
+
"rules"
+
File
.
separator
+
entity
+
File
.
separator
+
action
.
toLowerCase
()
+
File
.
separator
+
logicName
;
return
getBpmnFile
(
filePath
);
}
}
/**
/**
...
@@ -390,9 +389,8 @@ public class DELogicAspect {
...
@@ -390,9 +389,8 @@ public class DELogicAspect {
* @param logicName
* @param logicName
* @return
* @return
*/
*/
private
File
getSubBpmn
(
String
logicName
)
{
private
Resource
getSubBpmn
(
String
logicName
)
{
String
filePath
=
String
.
format
(
"/rules/%s"
,
logicName
);
return
new
ClassPathResource
(
String
.
format
(
"rules/%s"
,
logicName
));
return
getBpmnFile
(
filePath
);
}
}
/**
/**
...
@@ -401,41 +399,10 @@ public class DELogicAspect {
...
@@ -401,41 +399,10 @@ public class DELogicAspect {
* @param bpmn
* @param bpmn
* @return
* @return
*/
*/
private
File
getDrl
(
File
bpmn
)
{
private
Resource
getDrl
(
Resource
bpmn
)
{
if
(
bpmn
.
getPath
().
endsWith
(
"RuleFlow.bpmn"
))
{
String
filePath
=
((
ClassPathResource
)
bpmn
).
getPath
();
return
getBpmnFile
(
bpmn
.
getPath
().
replace
(
"RuleFlow.bpmn"
,
"Rule.drl"
));
filePath
=
filePath
.
endsWith
(
"RuleFlow.bpmn"
)
?
filePath
.
replace
(
"RuleFlow.bpmn"
,
"Rule.drl"
)
:
filePath
.
replace
(
".bpmn"
,
".drl"
);
}
else
{
return
new
ClassPathResource
(
filePath
);
return
getBpmnFile
(
bpmn
.
getPath
().
replace
(
".bpmn"
,
".drl"
));
}
}
/**
* 获取 bpmn
*
* @param filePath
* @return
*/
private
File
getBpmnFile
(
String
filePath
)
{
InputStream
in
=
null
;
File
bpmn
=
null
;
try
{
in
=
this
.
getClass
().
getResourceAsStream
(
filePath
.
replace
(
"\\"
,
"/"
));
if
(
in
!=
null
)
{
bpmn
=
new
File
(
filePath
);
FileUtils
.
copyToFile
(
in
,
bpmn
);
}
}
catch
(
IOException
e
)
{
log
.
error
(
"执行处理逻辑失败,无法获取逻辑文件"
+
e
);
}
finally
{
if
(
in
!=
null
)
{
try
{
in
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
return
bpmn
;
}
}
/**
/**
...
@@ -446,8 +413,8 @@ public class DELogicAspect {
...
@@ -446,8 +413,8 @@ public class DELogicAspect {
* @param action
* @param action
* @return
* @return
*/
*/
private
boolean
isValid
(
Fil
e
bpmn
,
Object
entity
,
Object
action
)
{
private
boolean
isValid
(
Resourc
e
bpmn
,
Object
entity
,
Object
action
)
{
String
logicId
=
String
.
format
(
"%s%s%s"
,
entity
.
getClass
().
getSimpleName
(),
action
,
bpmn
.
get
N
ame
()).
toLowerCase
();
String
logicId
=
String
.
format
(
"%s%s%s"
,
entity
.
getClass
().
getSimpleName
(),
action
,
bpmn
.
get
Filen
ame
()).
toLowerCase
();
if
(
validLogic
.
containsKey
(
logicId
))
{
if
(
validLogic
.
containsKey
(
logicId
))
{
return
true
;
return
true
;
}
else
{
}
else
{
...
...
ibztask-util/src/main/java/cn/ibizlab/util/client/IBZWFFeignClient.java
浏览文件 @
354fe565
...
@@ -24,4 +24,5 @@ public interface IBZWFFeignClient
...
@@ -24,4 +24,5 @@ public interface IBZWFFeignClient
JSONObject
wfstart
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"appname"
)
String
appname
,
JSONObject
wfstart
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"appname"
)
String
appname
,
@PathVariable
(
"entity"
)
String
entity
,
@PathVariable
(
"entity"
)
String
entity
,
@PathVariable
(
"businessKey"
)
String
businessKey
,
@RequestBody
JSONObject
instance
);
@PathVariable
(
"businessKey"
)
String
businessKey
,
@RequestBody
JSONObject
instance
);
}
}
ibztask-util/src/main/java/cn/ibizlab/util/domain/DELogic.java
浏览文件 @
354fe565
...
@@ -2,6 +2,7 @@ package cn.ibizlab.util.domain;
...
@@ -2,6 +2,7 @@ package cn.ibizlab.util.domain;
import
lombok.Data
;
import
lombok.Data
;
import
org.flowable.bpmn.model.Process
;
import
org.flowable.bpmn.model.Process
;
import
org.springframework.core.io.Resource
;
import
org.kie.api.runtime.KieContainer
;
import
org.kie.api.runtime.KieContainer
;
import
java.io.File
;
import
java.io.File
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -14,6 +15,6 @@ public class DELogic implements Serializable {
...
@@ -14,6 +15,6 @@ public class DELogic implements Serializable {
Process
process
;
Process
process
;
KieContainer
container
;
KieContainer
container
;
List
<
DELogic
>
refLogic
;
List
<
DELogic
>
refLogic
;
List
<
Fil
e
>
refRuleFiles
;
List
<
Resourc
e
>
refRuleFiles
;
String
md5
;
String
md5
;
}
}
ibztask-util/src/main/java/cn/ibizlab/util/filter/SearchContextBase.java
浏览文件 @
354fe565
...
@@ -67,6 +67,7 @@ public class SearchContextBase implements ISearchContext{
...
@@ -67,6 +67,7 @@ public class SearchContextBase implements ISearchContext{
* 工作流流程标识
* 工作流流程标识
*/
*/
public
String
processDefinitionKey
;
public
String
processDefinitionKey
;
/**
/**
* 获取工作流步骤标识
* 获取工作流步骤标识
*/
*/
...
...
ibztask-util/src/main/java/cn/ibizlab/util/security/AuthenticationUser.java
浏览文件 @
354fe565
...
@@ -52,6 +52,11 @@ public class AuthenticationUser implements UserDetails
...
@@ -52,6 +52,11 @@ public class AuthenticationUser implements UserDetails
* 租户
* 租户
*/
*/
private
String
srfdcid
;
private
String
srfdcid
;
/**
* 系统标识
*/
private
String
srfsystemid
;
/**
/**
/**
* 动态实例标识
* 动态实例标识
*/
*/
...
@@ -254,6 +259,8 @@ public class AuthenticationUser implements UserDetails
...
@@ -254,6 +259,8 @@ public class AuthenticationUser implements UserDetails
if
(
this
.
sessionParams
==
null
)
if
(
this
.
sessionParams
==
null
)
{
{
sessionParams
=
getUserSessionParam
();
sessionParams
=
getUserSessionParam
();
sessionParams
.
put
(
"srfsystemid"
,
this
.
getSrfsystemid
());
sessionParams
.
put
(
"srfdynainstid"
,
this
.
getSrfdynainstid
());
sessionParams
.
put
(
"srfpersonid"
,
this
.
getUserid
());
sessionParams
.
put
(
"srfpersonid"
,
this
.
getUserid
());
sessionParams
.
put
(
"srfpersonname"
,
this
.
getPersonname
());
sessionParams
.
put
(
"srfpersonname"
,
this
.
getPersonname
());
sessionParams
.
put
(
"srforgsectorid"
,
this
.
getMdeptid
());
sessionParams
.
put
(
"srforgsectorid"
,
this
.
getMdeptid
());
...
...
ibztask-util/src/main/java/cn/ibizlab/util/security/AuthorizationTokenFilter.java
浏览文件 @
354fe565
...
@@ -3,7 +3,6 @@ package cn.ibizlab.util.security;
...
@@ -3,7 +3,6 @@ package cn.ibizlab.util.security;
import
io.jsonwebtoken.ExpiredJwtException
;
import
io.jsonwebtoken.ExpiredJwtException
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
cn.ibizlab.util.service.AuthenticationUserService
;
import
cn.ibizlab.util.service.AuthenticationUserService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
;
import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
;
import
org.springframework.security.core.context.SecurityContextHolder
;
import
org.springframework.security.core.context.SecurityContextHolder
;
...
@@ -22,6 +21,7 @@ import javax.servlet.http.HttpServletRequest;
...
@@ -22,6 +21,7 @@ import javax.servlet.http.HttpServletRequest;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.*
;
import
java.util.*
;
import
org.springframework.util.StringUtils
;
@Slf4j
@Slf4j
@Component
@Component
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录