Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibztask
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibztask
提交
fbf8ebfe
提交
fbf8ebfe
编写于
1月 02, 2021
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ibiz4j 发布系统代码 [ibiz-task,任务调度]
上级
05eda1d3
变更
10
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
82 行增加
和
73 行删除
+82
-73
ibztask-app-web.yaml
...-app/ibztask-app-web/src/main/docker/ibztask-app-web.yaml
+4
-0
logback-spring.xml
ibztask-boot/src/main/resources/logback-spring.xml
+5
-6
JobsInfoServiceImpl.java
...n/ibizlab/core/task/service/impl/JobsInfoServiceImpl.java
+9
-8
JobsLockServiceImpl.java
...n/ibizlab/core/task/service/impl/JobsLockServiceImpl.java
+9
-8
JobsLogServiceImpl.java
...cn/ibizlab/core/task/service/impl/JobsLogServiceImpl.java
+9
-8
JobsRegistryServiceImpl.java
...izlab/core/task/service/impl/JobsRegistryServiceImpl.java
+9
-8
pom.xml
ibztask-dependencies/pom.xml
+1
-2
ibztask-provider-api.yaml
...sk-provider-api/src/main/docker/ibztask-provider-api.yaml
+4
-0
PermissionSyncJob.java
.../src/main/java/cn/ibizlab/util/job/PermissionSyncJob.java
+31
-33
application-sys.yml
ibztask-util/src/main/resources/application-sys.yml
+1
-0
未找到文件。
ibztask-app/ibztask-app-web/src/main/docker/ibztask-app-web.yaml
浏览文件 @
fbf8ebfe
...
...
@@ -14,6 +14,10 @@ services:
memory
:
400M
mode
:
replicated
replicas
:
1
restart_policy
:
condition
:
on-failure
max_attempts
:
3
window
:
120s
volumes
:
-
"
nfs:/app/file"
...
...
ibztask-boot/src/main/resources/logback-spring.xml
浏览文件 @
fbf8ebfe
...
...
@@ -20,18 +20,17 @@
<appender
name=
"file"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<!--日志文件输出的文件名-->
<FileNamePattern>
${LOG_PATH}/ibztask.%d{yyyy-MM-dd}.log
</FileNamePattern>
<FileNamePattern>
${LOG_PATH}/ibztask.%d{yyyy-MM-dd}.%i.log
</FileNamePattern>
<!--日志文件最大的大小-->
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
100MB
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<MaxHistory>
30
</MaxHistory>
</rollingPolicy>
<encoder
class=
"ch.qos.logback.classic.encoder.PatternLayoutEncoder"
>
<pattern>
${LOG_PATTERN}
</pattern>
</encoder>
<!--日志文件最大的大小-->
<triggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"
>
<MaxFileSize>
100MB
</MaxFileSize>
</triggeringPolicy>
</appender>
<!-- 日志输出级别 -->
<root
level=
"INFO"
>
...
...
ibztask-core/src/main/java/cn/ibizlab/core/task/service/impl/JobsInfoServiceImpl.java
浏览文件 @
fbf8ebfe
...
...
@@ -48,9 +48,6 @@ import org.springframework.util.StringUtils;
@Service
(
"JobsInfoServiceImpl"
)
public
class
JobsInfoServiceImpl
extends
ServiceImpl
<
JobsInfoMapper
,
JobsInfo
>
implements
IJobsInfoService
{
@Autowired
@Lazy
IJobsInfoService
proxyService
;
protected
int
batchSize
=
500
;
...
...
@@ -152,7 +149,7 @@ public class JobsInfoServiceImpl extends ServiceImpl<JobsInfoMapper, JobsInfo> i
if
(
null
==
et
)
{
return
false
;
}
else
{
return
checkKey
(
et
)
?
proxyService
.
update
(
et
)
:
proxyService
.
create
(
et
);
return
checkKey
(
et
)
?
getProxyService
().
update
(
et
)
:
getProxyService
()
.
create
(
et
);
}
}
...
...
@@ -169,10 +166,10 @@ public class JobsInfoServiceImpl extends ServiceImpl<JobsInfoMapper, JobsInfo> i
}
}
if
(
create
.
size
()
>
0
)
{
proxyService
.
createBatch
(
create
);
getProxyService
()
.
createBatch
(
create
);
}
if
(
update
.
size
()
>
0
)
{
proxyService
.
updateBatch
(
update
);
getProxyService
()
.
updateBatch
(
update
);
}
return
true
;
}
...
...
@@ -190,10 +187,10 @@ public class JobsInfoServiceImpl extends ServiceImpl<JobsInfoMapper, JobsInfo> i
}
}
if
(
create
.
size
()
>
0
)
{
proxyService
.
createBatch
(
create
);
getProxyService
()
.
createBatch
(
create
);
}
if
(
update
.
size
()
>
0
)
{
proxyService
.
updateBatch
(
update
);
getProxyService
()
.
updateBatch
(
update
);
}
}
...
...
@@ -259,6 +256,10 @@ public class JobsInfoServiceImpl extends ServiceImpl<JobsInfoMapper, JobsInfo> i
public
IJobsInfoService
getProxyService
()
{
return
cn
.
ibizlab
.
util
.
security
.
SpringContextHolder
.
getBean
(
this
.
getClass
());
}
}
...
...
ibztask-core/src/main/java/cn/ibizlab/core/task/service/impl/JobsLockServiceImpl.java
浏览文件 @
fbf8ebfe
...
...
@@ -48,9 +48,6 @@ import org.springframework.util.StringUtils;
@Service
(
"JobsLockServiceImpl"
)
public
class
JobsLockServiceImpl
extends
ServiceImpl
<
JobsLockMapper
,
JobsLock
>
implements
IJobsLockService
{
@Autowired
@Lazy
IJobsLockService
proxyService
;
protected
int
batchSize
=
500
;
...
...
@@ -136,7 +133,7 @@ public class JobsLockServiceImpl extends ServiceImpl<JobsLockMapper, JobsLock> i
if
(
null
==
et
)
{
return
false
;
}
else
{
return
checkKey
(
et
)
?
proxyService
.
update
(
et
)
:
proxyService
.
create
(
et
);
return
checkKey
(
et
)
?
getProxyService
().
update
(
et
)
:
getProxyService
()
.
create
(
et
);
}
}
...
...
@@ -153,10 +150,10 @@ public class JobsLockServiceImpl extends ServiceImpl<JobsLockMapper, JobsLock> i
}
}
if
(
create
.
size
()
>
0
)
{
proxyService
.
createBatch
(
create
);
getProxyService
()
.
createBatch
(
create
);
}
if
(
update
.
size
()
>
0
)
{
proxyService
.
updateBatch
(
update
);
getProxyService
()
.
updateBatch
(
update
);
}
return
true
;
}
...
...
@@ -174,10 +171,10 @@ public class JobsLockServiceImpl extends ServiceImpl<JobsLockMapper, JobsLock> i
}
}
if
(
create
.
size
()
>
0
)
{
proxyService
.
createBatch
(
create
);
getProxyService
()
.
createBatch
(
create
);
}
if
(
update
.
size
()
>
0
)
{
proxyService
.
updateBatch
(
update
);
getProxyService
()
.
updateBatch
(
update
);
}
}
...
...
@@ -226,6 +223,10 @@ public class JobsLockServiceImpl extends ServiceImpl<JobsLockMapper, JobsLock> i
public
IJobsLockService
getProxyService
()
{
return
cn
.
ibizlab
.
util
.
security
.
SpringContextHolder
.
getBean
(
this
.
getClass
());
}
}
...
...
ibztask-core/src/main/java/cn/ibizlab/core/task/service/impl/JobsLogServiceImpl.java
浏览文件 @
fbf8ebfe
...
...
@@ -48,9 +48,6 @@ import org.springframework.util.StringUtils;
@Service
(
"JobsLogServiceImpl"
)
public
class
JobsLogServiceImpl
extends
ServiceImpl
<
JobsLogMapper
,
JobsLog
>
implements
IJobsLogService
{
@Autowired
@Lazy
IJobsLogService
proxyService
;
protected
int
batchSize
=
500
;
...
...
@@ -136,7 +133,7 @@ public class JobsLogServiceImpl extends ServiceImpl<JobsLogMapper, JobsLog> impl
if
(
null
==
et
)
{
return
false
;
}
else
{
return
checkKey
(
et
)
?
proxyService
.
update
(
et
)
:
proxyService
.
create
(
et
);
return
checkKey
(
et
)
?
getProxyService
().
update
(
et
)
:
getProxyService
()
.
create
(
et
);
}
}
...
...
@@ -153,10 +150,10 @@ public class JobsLogServiceImpl extends ServiceImpl<JobsLogMapper, JobsLog> impl
}
}
if
(
create
.
size
()
>
0
)
{
proxyService
.
createBatch
(
create
);
getProxyService
()
.
createBatch
(
create
);
}
if
(
update
.
size
()
>
0
)
{
proxyService
.
updateBatch
(
update
);
getProxyService
()
.
updateBatch
(
update
);
}
return
true
;
}
...
...
@@ -174,10 +171,10 @@ public class JobsLogServiceImpl extends ServiceImpl<JobsLogMapper, JobsLog> impl
}
}
if
(
create
.
size
()
>
0
)
{
proxyService
.
createBatch
(
create
);
getProxyService
()
.
createBatch
(
create
);
}
if
(
update
.
size
()
>
0
)
{
proxyService
.
updateBatch
(
update
);
getProxyService
()
.
updateBatch
(
update
);
}
}
...
...
@@ -226,6 +223,10 @@ public class JobsLogServiceImpl extends ServiceImpl<JobsLogMapper, JobsLog> impl
public
IJobsLogService
getProxyService
()
{
return
cn
.
ibizlab
.
util
.
security
.
SpringContextHolder
.
getBean
(
this
.
getClass
());
}
}
...
...
ibztask-core/src/main/java/cn/ibizlab/core/task/service/impl/JobsRegistryServiceImpl.java
浏览文件 @
fbf8ebfe
...
...
@@ -48,9 +48,6 @@ import org.springframework.util.StringUtils;
@Service
(
"JobsRegistryServiceImpl"
)
public
class
JobsRegistryServiceImpl
extends
ServiceImpl
<
JobsRegistryMapper
,
JobsRegistry
>
implements
IJobsRegistryService
{
@Autowired
@Lazy
IJobsRegistryService
proxyService
;
protected
int
batchSize
=
500
;
...
...
@@ -136,7 +133,7 @@ public class JobsRegistryServiceImpl extends ServiceImpl<JobsRegistryMapper, Job
if
(
null
==
et
)
{
return
false
;
}
else
{
return
checkKey
(
et
)
?
proxyService
.
update
(
et
)
:
proxyService
.
create
(
et
);
return
checkKey
(
et
)
?
getProxyService
().
update
(
et
)
:
getProxyService
()
.
create
(
et
);
}
}
...
...
@@ -153,10 +150,10 @@ public class JobsRegistryServiceImpl extends ServiceImpl<JobsRegistryMapper, Job
}
}
if
(
create
.
size
()
>
0
)
{
proxyService
.
createBatch
(
create
);
getProxyService
()
.
createBatch
(
create
);
}
if
(
update
.
size
()
>
0
)
{
proxyService
.
updateBatch
(
update
);
getProxyService
()
.
updateBatch
(
update
);
}
return
true
;
}
...
...
@@ -174,10 +171,10 @@ public class JobsRegistryServiceImpl extends ServiceImpl<JobsRegistryMapper, Job
}
}
if
(
create
.
size
()
>
0
)
{
proxyService
.
createBatch
(
create
);
getProxyService
()
.
createBatch
(
create
);
}
if
(
update
.
size
()
>
0
)
{
proxyService
.
updateBatch
(
update
);
getProxyService
()
.
updateBatch
(
update
);
}
}
...
...
@@ -226,6 +223,10 @@ public class JobsRegistryServiceImpl extends ServiceImpl<JobsRegistryMapper, Job
public
IJobsRegistryService
getProxyService
()
{
return
cn
.
ibizlab
.
util
.
security
.
SpringContextHolder
.
getBean
(
this
.
getClass
());
}
}
...
...
ibztask-dependencies/pom.xml
浏览文件 @
fbf8ebfe
...
...
@@ -261,6 +261,7 @@
<version>
${baomidou-jobs.version}
</version>
</dependency>
</dependencies>
</dependencyManagement>
...
...
@@ -346,8 +347,6 @@
</dependency>
</dependencies>
</project>
ibztask-provider/ibztask-provider-api/src/main/docker/ibztask-provider-api.yaml
浏览文件 @
fbf8ebfe
...
...
@@ -14,6 +14,10 @@ services:
memory
:
400M
mode
:
replicated
replicas
:
1
restart_policy
:
condition
:
on-failure
max_attempts
:
3
window
:
120s
volumes
:
-
"
nfs:/app/file"
...
...
ibztask-util/src/main/java/cn/ibizlab/util/job/PermissionSyncJob.java
浏览文件 @
fbf8ebfe
...
...
@@ -13,6 +13,7 @@ import org.springframework.boot.ApplicationRunner;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.DigestUtils
;
import
java.io.InputStream
;
import
java.util.*
;
...
...
@@ -25,58 +26,55 @@ import java.util.*;
@ConditionalOnProperty
(
name
=
"ibiz.enablePermissionValid"
,
havingValue
=
"true"
)
public
class
PermissionSyncJob
implements
ApplicationRunner
{
@Autowired
@Lazy
private
IBZUAAFeignClient
client
;
@Value
(
"${ibiz.systemid:ibztask}"
)
private
String
systemId
;
@Value
(
"${ibiz.systemname:ibztask}"
)
private
String
systemName
;
@Autowired
@Lazy
IBZLiteFeignClient
liteFeign
Client
;
private
IBZUAAFeignClient
uaa
Client
;
@Autowired
@Lazy
IBZLiteFeignClient
liteClient
;
@Override
public
void
run
(
ApplicationArguments
args
)
{
try
{
Thread
.
sleep
(
10000
);
InputStream
permission
=
this
.
getClass
().
getResourceAsStream
(
"/permission/systemResource.json"
);
//获取当前系统所有实体资源能力
String
permissionResult
=
IOUtils
.
toString
(
permission
,
"UTF-8"
);
JSONObject
system
=
new
JSONObject
();
system
.
put
(
"pssystemid"
,
systemId
);
system
.
put
(
"pssystemname"
,
systemName
);
system
.
put
(
"sysstructure"
,
JSONObject
.
parseObject
(
permissionResult
));
system
.
put
(
"md5check"
,
DigestUtils
.
md5DigestAsHex
(
permissionResult
.
getBytes
()));
if
(
client
.
syncSysAuthority
(
system
))
{
log
.
info
(
"向[UAA]同步系统资源成功"
);
}
else
{
log
.
error
(
"向[UAA]同步系统资源失败"
);
InputStream
permission
=
this
.
getClass
().
getResourceAsStream
(
"/permission/systemResource.json"
);
//权限资源
if
(!
ObjectUtils
.
isEmpty
(
permission
))
{
String
strPermission
=
IOUtils
.
toString
(
permission
,
"UTF-8"
);
JSONObject
system
=
new
JSONObject
()
{{
put
(
"pssystemid"
,
systemId
);
put
(
"pssystemname"
,
systemName
);
put
(
"sysstructure"
,
JSONObject
.
parseObject
(
strPermission
));
put
(
"md5check"
,
DigestUtils
.
md5DigestAsHex
(
strPermission
.
getBytes
()));
}};
if
(
uaaClient
.
syncSysAuthority
(
system
))
{
log
.
info
(
"向[uaa]同步系统资源成功"
);
}
else
{
log
.
error
(
"向[uaa]同步系统资源失败"
);
}
}
}
catch
(
Exception
ex
)
{
log
.
error
(
String
.
format
(
"向[UAA]同步系统资源失败,请检查[UAA]服务是否正常! [%s]"
,
ex
));
}
catch
(
Exception
ex
)
{
log
.
error
(
"向[uaa]同步系统资源失败,请检查[uaa]服务是否正常运行! {}"
,
ex
.
getMessage
());
}
try
{
InputStream
sysModel
=
this
.
getClass
().
getResourceAsStream
(
"/sysmodel/ibztask.json"
);
//获取当前系统所有实体资源能力
String
strSysModel
=
IOUtils
.
toString
(
sysModel
,
"UTF-8"
);
if
(
liteFeignClient
.
syncSysModel
(
JSONObject
.
parseObject
(
strSysModel
)))
{
log
.
info
(
"向[lite]同步系统模型成功"
);
}
else
{
log
.
error
(
"向[lite]同步系统模型失败"
);
InputStream
model
=
this
.
getClass
().
getResourceAsStream
(
"/sysmodel/ibztask.json"
);
//系统模型
if
(!
ObjectUtils
.
isEmpty
(
model
))
{
String
strModel
=
IOUtils
.
toString
(
model
,
"UTF-8"
);
if
(
liteClient
.
syncSysModel
(
JSONObject
.
parseObject
(
strModel
)))
{
log
.
info
(
"向[lite]同步模型成功"
);
}
else
{
log
.
error
(
"向[lite]同步模型失败"
);
}
}
}
catch
(
Exception
ex
)
{
log
.
error
(
"向[lite]同步系统模型失败,请检查[lite]服务是否正常运行! {}"
,
ex
.
getMessage
());
}
catch
(
Exception
ex
)
{
log
.
error
(
String
.
format
(
"向[lite]同步系统模型失败,请检查[lite]服务是否正常! [%s]"
,
ex
));
}
}
}
\ No newline at end of file
ibztask-util/src/main/resources/application-sys.yml
浏览文件 @
fbf8ebfe
...
...
@@ -107,3 +107,4 @@ server:
min-response-size
:
10240
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录