Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzou
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzou
提交
88cda962
提交
88cda962
编写于
3月 28, 2021
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
zhouweidong 部署微服务接口 [ibz-ou,microservice]
上级
32bd8517
变更
33
隐藏空白字符变更
内嵌
并排
正在显示
33 个修改的文件
包含
146 行增加
和
143 行删除
+146
-143
config.xml
config.xml
+5
-0
SysDepartmentSearchContext.java
...cn/ibizlab/core/ou/filter/SysDepartmentSearchContext.java
+7
-0
SysDepartmentServiceImpl.java
...bizlab/core/ou/service/impl/SysDepartmentServiceImpl.java
+2
-3
SysDeptMemberServiceImpl.java
...bizlab/core/ou/service/impl/SysDeptMemberServiceImpl.java
+2
-3
SysEmployeeServiceImpl.java
.../ibizlab/core/ou/service/impl/SysEmployeeServiceImpl.java
+2
-3
SysOrganizationServiceImpl.java
...zlab/core/ou/service/impl/SysOrganizationServiceImpl.java
+2
-3
SysPostServiceImpl.java
...a/cn/ibizlab/core/ou/service/impl/SysPostServiceImpl.java
+2
-3
SysTeamMemberServiceImpl.java
...bizlab/core/ou/service/impl/SysTeamMemberServiceImpl.java
+2
-3
SysTeamServiceImpl.java
...a/cn/ibizlab/core/ou/service/impl/SysTeamServiceImpl.java
+2
-3
h2_table.xml
ibzou-core/src/main/resources/liquibase/h2_table.xml
+3
-3
SysDepartmentMapper.xml
...resources/mapper/ou/sysdepartment/SysDepartmentMapper.xml
+0
-1
SysDeptMemberMapper.xml
...resources/mapper/ou/sysdeptmember/SysDeptMemberMapper.xml
+0
-1
SysEmployeeMapper.xml
...ain/resources/mapper/ou/sysemployee/SysEmployeeMapper.xml
+0
-1
SysOrganizationMapper.xml
...urces/mapper/ou/sysorganization/SysOrganizationMapper.xml
+0
-1
SysPostMapper.xml
...re/src/main/resources/mapper/ou/syspost/SysPostMapper.xml
+0
-1
SysTeamMapper.xml
...re/src/main/resources/mapper/ou/systeam/SysTeamMapper.xml
+0
-1
SysTeamMemberMapper.xml
...resources/mapper/ou/systeammember/SysTeamMemberMapper.xml
+0
-1
Dockerfile
ibzou-provider/ibzou-provider-api/src/main/docker/Dockerfile
+1
-1
ibzou-provider-api-k8s.yaml
...-provider-api/src/main/docker/ibzou-provider-api-k8s.yaml
+31
-4
ibzou-provider-api.yaml
...bzou-provider-api/src/main/docker/ibzou-provider-api.yaml
+15
-1
SysDepartmentMapping.java
...ain/java/cn/ibizlab/api/mapping/SysDepartmentMapping.java
+0
-1
SysDeptMemberMapping.java
...ain/java/cn/ibizlab/api/mapping/SysDeptMemberMapping.java
+0
-1
SysEmployeeMapping.java
.../main/java/cn/ibizlab/api/mapping/SysEmployeeMapping.java
+0
-1
SysOrganizationMapping.java
...n/java/cn/ibizlab/api/mapping/SysOrganizationMapping.java
+0
-1
SysPostMapping.java
.../src/main/java/cn/ibizlab/api/mapping/SysPostMapping.java
+0
-1
SysTeamMapping.java
.../src/main/java/cn/ibizlab/api/mapping/SysTeamMapping.java
+0
-1
SysTeamMemberMapping.java
...ain/java/cn/ibizlab/api/mapping/SysTeamMemberMapping.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
ibzou-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
+1
-0
AuthorizationTokenFilter.java
...va/cn/ibizlab/util/security/AuthorizationTokenFilter.java
+1
-1
未找到文件。
config.xml
浏览文件 @
88cda962
...
...
@@ -37,6 +37,11 @@
git clone -b master $para2 ibzou/
export NODE_OPTIONS=--max-old-space-size=4096
cd ibzou/
mvn clean package -Papi
cd ibzou-provider/ibzou-provider-api
mvn -Papi docker:build
mvn -Papi docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/ibzou-provider-api.yaml ibzlab-rt --with-registry-auth
</command>
</hudson.tasks.Shell>
</builders>
...
...
ibzou-core/src/main/java/cn/ibizlab/core/ou/filter/SysDepartmentSearchContext.java
浏览文件 @
88cda962
...
...
@@ -84,6 +84,13 @@ public class SysDepartmentSearchContext extends QueryWrapperContext<SysDepartmen
this
.
getSearchCond
().
isNull
(
"pdeptid"
);
}
}
}
private
String
n_bcode_eq
;
//[业务编码]
public
void
setN_bcode_eq
(
String
n_bcode_eq
)
{
this
.
n_bcode_eq
=
n_bcode_eq
;
if
(!
ObjectUtils
.
isEmpty
(
this
.
n_bcode_eq
)){
this
.
getSearchCond
().
eq
(
"bcode"
,
n_bcode_eq
);
}
}
private
String
n_bcode_like
;
//[业务编码]
public
void
setN_bcode_like
(
String
n_bcode_like
)
{
...
...
ibzou-core/src/main/java/cn/ibizlab/core/ou/service/impl/SysDepartmentServiceImpl.java
浏览文件 @
88cda962
...
...
@@ -121,9 +121,8 @@ public class SysDepartmentServiceImpl extends ServiceImpl<SysDepartmentMapper, S
@Transactional
public
SysDepartment
get
(
String
key
)
{
SysDepartment
et
=
getById
(
key
);
if
(
et
==
null
){
et
=
new
SysDepartment
();
et
.
setDeptid
(
key
);
if
(
et
==
null
)
{
throw
new
BadRequestAlertException
(
"数据不存在"
,
this
.
getClass
().
getSimpleName
(),
key
);
}
else
{
}
...
...
ibzou-core/src/main/java/cn/ibizlab/core/ou/service/impl/SysDeptMemberServiceImpl.java
浏览文件 @
88cda962
...
...
@@ -113,9 +113,8 @@ public class SysDeptMemberServiceImpl extends ServiceImpl<SysDeptMemberMapper, S
@Transactional
public
SysDeptMember
get
(
String
key
)
{
SysDeptMember
et
=
getById
(
key
);
if
(
et
==
null
){
et
=
new
SysDeptMember
();
et
.
setMemberid
(
key
);
if
(
et
==
null
)
{
throw
new
BadRequestAlertException
(
"数据不存在"
,
this
.
getClass
().
getSimpleName
(),
key
);
}
else
{
}
...
...
ibzou-core/src/main/java/cn/ibizlab/core/ou/service/impl/SysEmployeeServiceImpl.java
浏览文件 @
88cda962
...
...
@@ -119,9 +119,8 @@ public class SysEmployeeServiceImpl extends ServiceImpl<SysEmployeeMapper, SysEm
@Transactional
public
SysEmployee
get
(
String
key
)
{
SysEmployee
et
=
getById
(
key
);
if
(
et
==
null
){
et
=
new
SysEmployee
();
et
.
setUserid
(
key
);
if
(
et
==
null
)
{
throw
new
BadRequestAlertException
(
"数据不存在"
,
this
.
getClass
().
getSimpleName
(),
key
);
}
else
{
}
...
...
ibzou-core/src/main/java/cn/ibizlab/core/ou/service/impl/SysOrganizationServiceImpl.java
浏览文件 @
88cda962
...
...
@@ -125,9 +125,8 @@ public class SysOrganizationServiceImpl extends ServiceImpl<SysOrganizationMappe
@Transactional
public
SysOrganization
get
(
String
key
)
{
SysOrganization
et
=
getById
(
key
);
if
(
et
==
null
){
et
=
new
SysOrganization
();
et
.
setOrgid
(
key
);
if
(
et
==
null
)
{
throw
new
BadRequestAlertException
(
"数据不存在"
,
this
.
getClass
().
getSimpleName
(),
key
);
}
else
{
et
.
setDepts
(
sysdepartmentService
.
selectByOrgid
(
key
));
...
...
ibzou-core/src/main/java/cn/ibizlab/core/ou/service/impl/SysPostServiceImpl.java
浏览文件 @
88cda962
...
...
@@ -109,9 +109,8 @@ public class SysPostServiceImpl extends ServiceImpl<SysPostMapper, SysPost> impl
@Transactional
public
SysPost
get
(
String
key
)
{
SysPost
et
=
getById
(
key
);
if
(
et
==
null
){
et
=
new
SysPost
();
et
.
setPostid
(
key
);
if
(
et
==
null
)
{
throw
new
BadRequestAlertException
(
"数据不存在"
,
this
.
getClass
().
getSimpleName
(),
key
);
}
else
{
}
...
...
ibzou-core/src/main/java/cn/ibizlab/core/ou/service/impl/SysTeamMemberServiceImpl.java
浏览文件 @
88cda962
...
...
@@ -113,9 +113,8 @@ public class SysTeamMemberServiceImpl extends ServiceImpl<SysTeamMemberMapper, S
@Transactional
public
SysTeamMember
get
(
String
key
)
{
SysTeamMember
et
=
getById
(
key
);
if
(
et
==
null
){
et
=
new
SysTeamMember
();
et
.
setTeammemberid
(
key
);
if
(
et
==
null
)
{
throw
new
BadRequestAlertException
(
"数据不存在"
,
this
.
getClass
().
getSimpleName
(),
key
);
}
else
{
}
...
...
ibzou-core/src/main/java/cn/ibizlab/core/ou/service/impl/SysTeamServiceImpl.java
浏览文件 @
88cda962
...
...
@@ -103,9 +103,8 @@ public class SysTeamServiceImpl extends ServiceImpl<SysTeamMapper, SysTeam> impl
@Transactional
public
SysTeam
get
(
String
key
)
{
SysTeam
et
=
getById
(
key
);
if
(
et
==
null
){
et
=
new
SysTeam
();
et
.
setTeamid
(
key
);
if
(
et
==
null
)
{
throw
new
BadRequestAlertException
(
"数据不存在"
,
this
.
getClass
().
getSimpleName
(),
key
);
}
else
{
}
...
...
ibzou-core/src/main/resources/liquibase/h2_table.xml
浏览文件 @
88cda962
...
...
@@ -4,7 +4,7 @@
<!--输出实体[SYS_DEPT]数据结构 -->
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-sys_dept-
79
-1"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-sys_dept-
80
-1"
>
<createTable
tableName=
"IBZDEPT"
>
<column
name=
"DEPTID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_SYS_DEPT_DEPTID"
/>
...
...
@@ -225,10 +225,10 @@
</changeSet>
<!--输出实体[SYS_DEPT]外键关系 -->
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-sys_dept-
79
-8"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-sys_dept-
80
-8"
>
<addForeignKeyConstraint
baseColumnNames=
"PDEPTID"
baseTableName=
"IBZDEPT"
constraintName=
"DER1N_SYS_DEPT_SYS_DEPT_PDEPTI"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"DEPTID"
referencedTableName=
"IBZDEPT"
validate=
"true"
/>
</changeSet>
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-sys_dept-
79
-9"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-sys_dept-
80
-9"
>
<addForeignKeyConstraint
baseColumnNames=
"ORGID"
baseTableName=
"IBZDEPT"
constraintName=
"DER1N_SYS_DEPT_SYS_ORG_ORGID"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"ORGID"
referencedTableName=
"IBZORG"
validate=
"true"
/>
</changeSet>
<!--输出实体[SYS_DEPTMEMBER]外键关系 -->
...
...
ibzou-core/src/main/resources/mapper/ou/sysdepartment/SysDepartmentMapper.xml
浏览文件 @
88cda962
<?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">
<mapper
namespace=
"cn.ibizlab.core.ou.mapper.SysDepartmentMapper"
>
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
...
...
ibzou-core/src/main/resources/mapper/ou/sysdeptmember/SysDeptMemberMapper.xml
浏览文件 @
88cda962
<?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">
<mapper
namespace=
"cn.ibizlab.core.ou.mapper.SysDeptMemberMapper"
>
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
...
...
ibzou-core/src/main/resources/mapper/ou/sysemployee/SysEmployeeMapper.xml
浏览文件 @
88cda962
<?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">
<mapper
namespace=
"cn.ibizlab.core.ou.mapper.SysEmployeeMapper"
>
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
...
...
ibzou-core/src/main/resources/mapper/ou/sysorganization/SysOrganizationMapper.xml
浏览文件 @
88cda962
<?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">
<mapper
namespace=
"cn.ibizlab.core.ou.mapper.SysOrganizationMapper"
>
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
...
...
ibzou-core/src/main/resources/mapper/ou/syspost/SysPostMapper.xml
浏览文件 @
88cda962
<?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">
<mapper
namespace=
"cn.ibizlab.core.ou.mapper.SysPostMapper"
>
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
...
...
ibzou-core/src/main/resources/mapper/ou/systeam/SysTeamMapper.xml
浏览文件 @
88cda962
<?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">
<mapper
namespace=
"cn.ibizlab.core.ou.mapper.SysTeamMapper"
>
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
...
...
ibzou-core/src/main/resources/mapper/ou/systeammember/SysTeamMemberMapper.xml
浏览文件 @
88cda962
<?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">
<mapper
namespace=
"cn.ibizlab.core.ou.mapper.SysTeamMemberMapper"
>
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
...
...
ibzou-provider/ibzou-provider-api/src/main/docker/Dockerfile
浏览文件 @
88cda962
...
...
@@ -10,6 +10,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Duser.timezone=$TZ -Djava.security.egd=file:/dev/./urandom -jar /ibzou-provider-api.jar
EXPOSE
808
1
EXPOSE
4000
1
ADD
ibzou-provider-api.jar /ibzou-provider-api.jar
ibzou-provider/ibzou-provider-api/src/main/docker/ibzou-provider-api-k8s.yaml
浏览文件 @
88cda962
...
...
@@ -22,7 +22,34 @@ spec:
image
:
registry.cn-shanghai.aliyuncs.com/ibizsys/ibzou-provider-api:latest
imagePullPolicy
:
Always
ports
:
-
containerPort
:
8081
-
containerPort
:
40001
env
:
-
name
:
SPRING_CLOUD_NACOS_DISCOVERY_IP
value
:
"
172.16.180.237"
-
name
:
SERVER_PORT
value
:
"
40001"
-
name
:
SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR
value
:
"
172.16.100.243:8848"
-
name
:
SPRING_REDIS_HOST
value
:
"
172.16.100.243"
-
name
:
SPRING_REDIS_PORT
value
:
"
6379"
-
name
:
SPRING_REDIS_DATABASE
value
:
"
0"
-
name
:
SPRING_DATASOURCE_USERNAME
value
:
"
a_A_5d9d78509"
-
name
:
SPRING_DATASOURCE_PASSWORD
value
:
"
@6dEfb3@"
-
name
:
SPRING_DATASOURCE_URL
value
:
"
jdbc:mysql://172.16.180.232:3306/a_A_5d9d78509?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true"
-
name
:
SPRING_DATASOURCE_DRIVER-CLASS-NAME
value
:
"
com.mysql.jdbc.Driver"
-
name
:
SPRING_DATASOURCE_DEFAULTSCHEMA
value
:
"
a_A_5d9d78509"
-
name
:
NACOS
value
:
"
172.16.100.243:8848"
-
name
:
SPRING_CLOUD_NACOS_DISCOVERY_GROUP
value
:
"
ibizdev"
volumeMounts
:
-
name
:
data
mountPath
:
/app/file
...
...
@@ -42,9 +69,9 @@ spec:
type
:
NodePort
ports
:
-
name
:
http
port
:
808
1
targetPort
:
808
1
nodePort
:
808
1
port
:
4000
1
targetPort
:
4000
1
nodePort
:
4000
1
protocol
:
TCP
selector
:
app
:
ibzou-provider-api
...
...
ibzou-provider/ibzou-provider-api/src/main/docker/ibzou-provider-api.yaml
浏览文件 @
88cda962
...
...
@@ -3,9 +3,23 @@ services:
ibzou-provider-api
:
image
:
registry.cn-shanghai.aliyuncs.com/ibizsys/ibzou-provider-api:latest
ports
:
-
"
8081:808
1"
-
"
40001:4000
1"
networks
:
-
agent_network
environment
:
-
SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.180.237
-
SERVER_PORT=40001
-
SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.100.243:8848
-
SPRING_REDIS_HOST=172.16.100.243
-
SPRING_REDIS_PORT=6379
-
SPRING_REDIS_DATABASE=0
-
SPRING_DATASOURCE_USERNAME=a_A_5d9d78509
-
SPRING_DATASOURCE_PASSWORD=@6dEfb3@
-
SPRING_DATASOURCE_URL=jdbc:mysql://172.16.180.232:3306/a_A_5d9d78509?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true
-
SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
-
SPRING_DATASOURCE_DEFAULTSCHEMA=a_A_5d9d78509
-
NACOS=172.16.100.243:8848
-
SPRING_CLOUD_NACOS_DISCOVERY_GROUP=ibizdev
deploy
:
resources
:
limits
:
...
...
ibzou-provider/ibzou-provider-api/src/main/java/cn/ibizlab/api/mapping/SysDepartmentMapping.java
浏览文件 @
88cda962
...
...
@@ -12,4 +12,3 @@ public interface SysDepartmentMapping extends MappingBase<SysDepartmentDTO, SysD
}
ibzou-provider/ibzou-provider-api/src/main/java/cn/ibizlab/api/mapping/SysDeptMemberMapping.java
浏览文件 @
88cda962
...
...
@@ -12,4 +12,3 @@ public interface SysDeptMemberMapping extends MappingBase<SysDeptMemberDTO, SysD
}
ibzou-provider/ibzou-provider-api/src/main/java/cn/ibizlab/api/mapping/SysEmployeeMapping.java
浏览文件 @
88cda962
...
...
@@ -12,4 +12,3 @@ public interface SysEmployeeMapping extends MappingBase<SysEmployeeDTO, SysEmplo
}
ibzou-provider/ibzou-provider-api/src/main/java/cn/ibizlab/api/mapping/SysOrganizationMapping.java
浏览文件 @
88cda962
...
...
@@ -12,4 +12,3 @@ public interface SysOrganizationMapping extends MappingBase<SysOrganizationDTO,
}
ibzou-provider/ibzou-provider-api/src/main/java/cn/ibizlab/api/mapping/SysPostMapping.java
浏览文件 @
88cda962
...
...
@@ -12,4 +12,3 @@ public interface SysPostMapping extends MappingBase<SysPostDTO, SysPost> {
}
ibzou-provider/ibzou-provider-api/src/main/java/cn/ibizlab/api/mapping/SysTeamMapping.java
浏览文件 @
88cda962
...
...
@@ -12,4 +12,3 @@ public interface SysTeamMapping extends MappingBase<SysTeamDTO, SysTeam> {
}
ibzou-provider/ibzou-provider-api/src/main/java/cn/ibizlab/api/mapping/SysTeamMemberMapping.java
浏览文件 @
88cda962
...
...
@@ -12,4 +12,3 @@ public interface SysTeamMemberMapping extends MappingBase<SysTeamMemberDTO, SysT
}
ibzou-util/src/main/java/cn/ibizlab/util/aspect/DELogicAspect.java
浏览文件 @
88cda962
package
cn
.
ibizlab
.
util
.
aspect
;
import
lombok.SneakyThrows
;
import
lombok.extern.slf4j.Slf4j
;
import
cn.ibizlab.util.domain.DELogic
;
import
cn.ibizlab.util.domain.EntityBase
;
import
cn.ibizlab.util.errors.BadRequestAlertException
;
import
cn.ibizlab.util.helper.DEFieldCacheMap
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.IOUtils
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.annotation.Around
;
...
...
@@ -22,6 +20,8 @@ import org.kie.api.builder.Results;
import
org.kie.api.runtime.KieContainer
;
import
org.kie.api.runtime.KieSession
;
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.Expression
;
import
org.springframework.expression.ExpressionParser
;
...
...
@@ -35,7 +35,6 @@ import org.springframework.util.StringUtils;
import
javax.xml.stream.XMLInputFactory
;
import
javax.xml.stream.XMLStreamReader
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.lang.reflect.Method
;
...
...
@@ -109,7 +108,7 @@ public class DELogicAspect {
* @param 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
))
{
executeLogic
(
bpmnFile
,
entity
,
action
);
}
...
...
@@ -122,7 +121,7 @@ public class DELogicAspect {
* @param 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
))
{
executeLogic
(
bpmnFile
,
entity
,
action
);
}
...
...
@@ -135,7 +134,7 @@ public class DELogicAspect {
* @param 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
))
{
executeLogic
(
bpmnFile
,
entity
,
action
);
}
...
...
@@ -147,32 +146,37 @@ public class DELogicAspect {
* @param bpmnFile
* @param entity
*/
private
void
executeLogic
(
File
bpmnFile
,
Object
entity
,
String
action
)
{
log
.
debug
(
"开始执行实体处理逻辑[{}:{}:{}:本地模式]"
,
entity
.
getClass
().
getSimpleName
(),
action
,
bpmnFile
.
getName
());
String
bpmnId
=
DigestUtils
.
md5DigestAsHex
(
bpmnFile
.
getPath
().
getBytes
());
DELogic
logic
=
getDELogic
(
bpmnFile
);
if
(
logic
==
null
)
{
return
;
}
if
(
deLogicMap
.
containsKey
(
bpmnId
)
&&
logic
.
getMd5
().
equals
(
deLogicMap
.
get
(
bpmnId
).
getMd5
()))
{
logic
=
deLogicMap
.
get
(
bpmnId
);
}
else
{
reloadLogic
(
logic
);
deLogicMap
.
put
(
bpmnId
,
logic
);
}
KieContainer
container
=
logic
.
getContainer
();
KieSession
kieSession
=
container
.
getKieBase
().
newKieSession
();
Process
mainProcess
=
logic
.
getProcess
();
//主流程参数
fillGlobalParam
(
kieSession
,
mainProcess
,
entity
);
//子流程参数
if
(!
ObjectUtils
.
isEmpty
(
logic
.
getRefLogic
()))
{
for
(
DELogic
subLogic
:
logic
.
getRefLogic
())
{
fillGlobalParam
(
kieSession
,
subLogic
.
getProcess
(),
entity
);
private
void
executeLogic
(
Resource
bpmnFile
,
Object
entity
,
String
action
)
{
try
{
log
.
debug
(
"开始执行实体处理逻辑[{}:{}:{}:本地模式]"
,
entity
.
getClass
().
getSimpleName
(),
action
,
bpmnFile
.
getFilename
());
String
bpmnId
=
DigestUtils
.
md5DigestAsHex
(
bpmnFile
.
getURL
().
getPath
().
getBytes
());
DELogic
logic
=
getDELogic
(
bpmnFile
);
if
(
logic
==
null
)
{
return
;
}
if
(
deLogicMap
.
containsKey
(
bpmnId
)
&&
logic
.
getMd5
().
equals
(
deLogicMap
.
get
(
bpmnId
).
getMd5
()))
{
logic
=
deLogicMap
.
get
(
bpmnId
);
}
else
{
reloadLogic
(
logic
);
deLogicMap
.
put
(
bpmnId
,
logic
);
}
KieContainer
container
=
logic
.
getContainer
();
KieSession
kieSession
=
container
.
getKieBase
().
newKieSession
();
Process
mainProcess
=
logic
.
getProcess
();
//主流程参数
fillGlobalParam
(
kieSession
,
mainProcess
,
entity
);
//子流程参数
if
(!
ObjectUtils
.
isEmpty
(
logic
.
getRefLogic
()))
{
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 {
*
* @param logic
*/
private
void
reloadLogic
(
DELogic
logic
)
{
private
void
reloadLogic
(
DELogic
logic
)
throws
IOException
{
KieServices
kieServices
=
KieServices
.
get
();
KieFileSystem
kieFileSystem
=
kieServices
.
newKieFileSystem
();
for
(
Fil
e
bpmn
:
logic
.
getRefRuleFiles
())
{
kieFileSystem
.
write
(
ResourceFactory
.
new
FileResource
(
bpmn
));
for
(
Resourc
e
bpmn
:
logic
.
getRefRuleFiles
())
{
kieFileSystem
.
write
(
ResourceFactory
.
new
UrlResource
(
bpmn
.
getURL
()
));
}
KieBuilder
kieBuilder
=
kieServices
.
newKieBuilder
(
kieFileSystem
).
buildAll
();
Results
results
=
kieBuilder
.
getResults
();
...
...
@@ -239,28 +243,29 @@ public class DELogicAspect {
* @param bpmnFile
* @return
*/
@SneakyThrows
private
DELogic
getDELogic
(
File
bpmnFile
)
{
private
DELogic
getDELogic
(
Resource
bpmnFile
)
{
DELogic
logic
=
null
;
XMLStreamReader
reader
=
null
;
InputStream
bpmn
=
null
;
try
{
if
(
bpmnFile
.
exists
())
{
XMLInputFactory
factory
=
XMLInputFactory
.
newInstance
();
bpmn
=
new
FileInputStream
(
bpmnFile
);
bpmn
=
bpmnFile
.
getInputStream
(
);
reader
=
factory
.
createXMLStreamReader
(
bpmn
);
BpmnModel
model
=
bpmnXMLConverter
.
convertToBpmnModel
(
reader
);
Process
mainProcess
=
model
.
getMainProcess
();
if
(
mainProcess
==
null
)
{
return
null
;
}
log
.
debug
(
"正在加载 BPMN:{}"
,
bpmnFile
.
getURL
().
getPath
());
List
<
DELogic
>
refLogics
=
new
ArrayList
<>();
List
<
Fil
e
>
refFiles
=
new
ArrayList
<>();
List
<
Resourc
e
>
refFiles
=
new
ArrayList
<>();
//自己 bpmn 及 drl
refFiles
.
add
(
bpmnFile
);
Fil
e
drlFile
=
getDrl
(
bpmnFile
);
Resourc
e
drlFile
=
getDrl
(
bpmnFile
);
if
(
drlFile
!=
null
&&
drlFile
.
exists
())
{
refFiles
.
add
(
drlFile
);
log
.
debug
(
"正在加载 DRL:{}"
,
drlFile
.
getURL
().
getPath
());
}
//子 bpmn 及 drl
if
(!
ObjectUtils
.
isEmpty
(
model
.
getMainProcess
())
&&
!
ObjectUtils
.
isEmpty
(
model
.
getMainProcess
().
getFlowElementMap
()))
{
...
...
@@ -268,11 +273,7 @@ public class DELogicAspect {
if
(
item
instanceof
CallActivity
)
{
CallActivity
subBpmn
=
(
CallActivity
)
item
;
String
bpmnFileName
=
subBpmn
.
getName
();
log
.
debug
(
"正在加载 BPMN:{}"
,
bpmnFileName
);
File
subBpmnFile
=
getSubBpmn
(
bpmnFileName
);
if
(
ObjectUtils
.
isEmpty
(
subBpmnFile
))
{
log
.
debug
(
"BPMN:{},缺少文件:{} "
,
bpmnFileName
,
subBpmnFile
);
}
Resource
subBpmnFile
=
getSubBpmn
(
bpmnFileName
);
DELogic
refLogic
=
getDELogic
(
subBpmnFile
);
if
(
refLogic
!=
null
)
{
refLogics
.
add
(
refLogic
);
...
...
@@ -292,7 +293,7 @@ public class DELogicAspect {
logic
.
setMd5
(
getMd5
(
refFiles
));
}
}
catch
(
Exception
e
)
{
log
.
error
(
"执行处理逻辑失败"
+
e
);
log
.
error
(
"执行处理逻辑失败"
+
e
);
}
finally
{
try
{
if
(
reader
!=
null
)
{
...
...
@@ -302,7 +303,7 @@ public class DELogicAspect {
bpmn
.
close
();
}
}
catch
(
Exception
e
)
{
log
.
error
(
"执行处理逻辑失败"
+
e
);
log
.
error
(
"执行处理逻辑失败"
+
e
);
}
}
return
logic
;
...
...
@@ -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
());
}
log
.
error
(
"获取实体信息失败,未能在[{}]中找到参数为实体类对象的行为,如create.update等"
,
service
.
getSimpleName
());
log
.
error
(
"获取实体信息失败,未能在[{}]中找到参数为实体类对象的行为,如create.update等"
,
service
.
getSimpleName
());
return
null
;
}
...
...
@@ -340,19 +341,19 @@ public class DELogicAspect {
* @param subFiles
* @return
*/
private
String
getMd5
(
List
<
Fil
e
>
subFiles
)
{
private
String
getMd5
(
List
<
Resourc
e
>
subFiles
)
{
try
{
StringBuffer
buffer
=
new
StringBuffer
();
for
(
Fil
e
file
:
subFiles
)
{
for
(
Resourc
e
file
:
subFiles
)
{
InputStream
bpmnFile
=
null
;
try
{
bpmnFile
=
new
FileInputStream
(
file
);
bpmnFile
=
file
.
getInputStream
(
);
if
(!
ObjectUtils
.
isEmpty
(
bpmnFile
))
{
String
strBpmn
=
IOUtils
.
toString
(
bpmnFile
,
"UTF-8"
);
buffer
.
append
(
strBpmn
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"处理逻辑版本检查失败"
+
e
);
log
.
error
(
"处理逻辑版本检查失败"
+
e
);
}
finally
{
if
(
bpmnFile
!=
null
)
{
bpmnFile
.
close
();
...
...
@@ -365,12 +366,12 @@ public class DELogicAspect {
return
null
;
}
}
catch
(
Exception
e
)
{
log
.
error
(
"处理逻辑版本检查失败"
+
e
);
log
.
error
(
"处理逻辑版本检查失败"
+
e
);
return
null
;
}
}
/**
/**
* 本地逻辑
*
* @param entity
...
...
@@ -378,10 +379,8 @@ public class DELogicAspect {
* @param logicExecMode
* @return
*/
private
File
getLocalModel
(
String
entity
,
String
action
,
LogicExecMode
logicExecMode
)
{
String
logicName
=
String
.
format
(
"%s.bpmn"
,
logicExecMode
.
text
);
String
filePath
=
File
.
separator
+
"rules"
+
File
.
separator
+
entity
+
File
.
separator
+
action
.
toLowerCase
()
+
File
.
separator
+
logicName
;
return
getBpmnFile
(
filePath
);
private
Resource
getLocalModel
(
String
entity
,
String
action
,
LogicExecMode
logicExecMode
)
{
return
new
ClassPathResource
(
"rules"
+
File
.
separator
+
entity
+
File
.
separator
+
action
.
toLowerCase
()
+
File
.
separator
+
logicExecMode
.
text
+
".bpmn"
);
}
/**
...
...
@@ -390,9 +389,8 @@ public class DELogicAspect {
* @param logicName
* @return
*/
private
File
getSubBpmn
(
String
logicName
)
{
String
filePath
=
String
.
format
(
"/rules/%s"
,
logicName
);
return
getBpmnFile
(
filePath
);
private
Resource
getSubBpmn
(
String
logicName
)
{
return
new
ClassPathResource
(
String
.
format
(
"rules/%s"
,
logicName
));
}
/**
...
...
@@ -401,41 +399,10 @@ public class DELogicAspect {
* @param bpmn
* @return
*/
private
File
getDrl
(
File
bpmn
)
{
if
(
bpmn
.
getPath
().
endsWith
(
"RuleFlow.bpmn"
))
{
return
getBpmnFile
(
bpmn
.
getPath
().
replace
(
"RuleFlow.bpmn"
,
"Rule.drl"
));
}
else
{
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
;
private
Resource
getDrl
(
Resource
bpmn
)
{
String
filePath
=
((
ClassPathResource
)
bpmn
).
getPath
();
filePath
=
filePath
.
endsWith
(
"RuleFlow.bpmn"
)
?
filePath
.
replace
(
"RuleFlow.bpmn"
,
"Rule.drl"
)
:
filePath
.
replace
(
".bpmn"
,
".drl"
);
return
new
ClassPathResource
(
filePath
);
}
/**
...
...
@@ -446,8 +413,8 @@ public class DELogicAspect {
* @param action
* @return
*/
private
boolean
isValid
(
Fil
e
bpmn
,
Object
entity
,
Object
action
)
{
String
logicId
=
String
.
format
(
"%s%s%s"
,
entity
.
getClass
().
getSimpleName
(),
action
,
bpmn
.
get
N
ame
()).
toLowerCase
();
private
boolean
isValid
(
Resourc
e
bpmn
,
Object
entity
,
Object
action
)
{
String
logicId
=
String
.
format
(
"%s%s%s"
,
entity
.
getClass
().
getSimpleName
(),
action
,
bpmn
.
get
Filen
ame
()).
toLowerCase
();
if
(
validLogic
.
containsKey
(
logicId
))
{
return
true
;
}
else
{
...
...
ibzou-util/src/main/java/cn/ibizlab/util/client/IBZWFFeignClient.java
浏览文件 @
88cda962
...
...
@@ -24,4 +24,5 @@ public interface IBZWFFeignClient
JSONObject
wfstart
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"appname"
)
String
appname
,
@PathVariable
(
"entity"
)
String
entity
,
@PathVariable
(
"businessKey"
)
String
businessKey
,
@RequestBody
JSONObject
instance
);
}
ibzou-util/src/main/java/cn/ibizlab/util/domain/DELogic.java
浏览文件 @
88cda962
...
...
@@ -2,6 +2,7 @@ package cn.ibizlab.util.domain;
import
lombok.Data
;
import
org.flowable.bpmn.model.Process
;
import
org.springframework.core.io.Resource
;
import
org.kie.api.runtime.KieContainer
;
import
java.io.File
;
import
java.io.Serializable
;
...
...
@@ -14,6 +15,6 @@ public class DELogic implements Serializable {
Process
process
;
KieContainer
container
;
List
<
DELogic
>
refLogic
;
List
<
Fil
e
>
refRuleFiles
;
List
<
Resourc
e
>
refRuleFiles
;
String
md5
;
}
ibzou-util/src/main/java/cn/ibizlab/util/filter/SearchContextBase.java
浏览文件 @
88cda962
...
...
@@ -67,6 +67,7 @@ public class SearchContextBase implements ISearchContext{
* 工作流流程标识
*/
public
String
processDefinitionKey
;
/**
* 获取工作流步骤标识
*/
...
...
ibzou-util/src/main/java/cn/ibizlab/util/security/AuthenticationUser.java
浏览文件 @
88cda962
...
...
@@ -254,6 +254,7 @@ public class AuthenticationUser implements UserDetails
if
(
this
.
sessionParams
==
null
)
{
sessionParams
=
getUserSessionParam
();
sessionParams
.
put
(
"srfdynainstid"
,
this
.
getSrfdynainstid
());
sessionParams
.
put
(
"srfpersonid"
,
this
.
getUserid
());
sessionParams
.
put
(
"srfpersonname"
,
this
.
getPersonname
());
sessionParams
.
put
(
"srforgsectorid"
,
this
.
getMdeptid
());
...
...
ibzou-util/src/main/java/cn/ibizlab/util/security/AuthorizationTokenFilter.java
浏览文件 @
88cda962
...
...
@@ -3,7 +3,6 @@ package cn.ibizlab.util.security;
import
io.jsonwebtoken.ExpiredJwtException
;
import
lombok.extern.slf4j.Slf4j
;
import
cn.ibizlab.util.service.AuthenticationUserService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
;
import
org.springframework.security.core.context.SecurityContextHolder
;
...
...
@@ -22,6 +21,7 @@ import javax.servlet.http.HttpServletRequest;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.util.*
;
import
org.springframework.util.StringUtils
;
@Slf4j
@Component
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录