Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
35e5e187
Commit
35e5e187
authored
Aug 03, 2022
by
李灿灿
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
定时任务加入到Job服务中
parent
57a3f1fe
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
2 deletions
+70
-2
DaprInsurancesProperties.java
.../v1/yifu/common/dapr/config/DaprInsurancesProperties.java
+30
-0
daprConfig.properties
...yifu-common-dapr/src/main/resources/daprConfig.properties
+3
-0
TInsuranceDetailController.java
...ifu/insurances/controller/TInsuranceDetailController.java
+1
-2
UpdateOverdueTask.java
...com/yifu/cloud/plus/v1/job/compont/UpdateOverdueTask.java
+36
-0
No files found.
yifu-common/yifu-common-dapr/src/main/java/com/yifu/cloud/plus/v1/yifu/common/dapr/config/DaprInsurancesProperties.java
0 → 100644
View file @
35e5e187
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
dapr
.
config
;
import
lombok.Data
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.PropertySource
;
import
org.springframework.stereotype.Component
;
/**
* @author licancan
* @description 商险模块dapr属性
* @date 2022-08-03 10:25:48
*/
@Data
@Component
@PropertySource
(
"classpath:daprConfig.properties"
)
@ConfigurationProperties
(
value
=
"dapr.insurances"
,
ignoreInvalidFields
=
false
)
public
class
DaprInsurancesProperties
{
/**
* dapr sidercar url 如:http://localhost:3511/v1.0/invoke/
*/
String
appUrl
;
/**
* app_id 如:"yifu_insurances_sider"
*/
String
appId
;
}
yifu-common/yifu-common-dapr/src/main/resources/daprConfig.properties
View file @
35e5e187
...
...
@@ -12,3 +12,6 @@ dapr.check.appId=yifu-check
dapr.archives.appUrl
=
http://yifu-archives.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
dapr.archives.appId
=
yifu-archives
dapr.insurances.appUrl
=
http://yifu-insurances.qas-mvp.svc.cluster.local:3511/v1.0/invoke/
dapr.insurances.appId
=
yifu-insurances
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/controller/TInsuranceDetailController.java
View file @
35e5e187
...
...
@@ -47,10 +47,9 @@ public class TInsuranceDetailController {
* @param
* @return void
*/
@Operation
(
summary
=
"每日定时刷新商险到期数据"
,
description
=
"每日定时刷新商险到期数据"
)
@SysLog
(
"每日定时刷新商险到期数据"
)
@Inner
@
Ge
tMapping
(
"/inner/updateOverdueByTask"
)
@
Pos
tMapping
(
"/inner/updateOverdueByTask"
)
public
void
updateOverdueByTask
()
{
tInsuranceDetailService
.
updateOverdueByTask
();
}
...
...
yifu-job/yifu-job-api/src/main/java/com/yifu/cloud/plus/v1/job/compont/UpdateOverdueTask.java
0 → 100644
View file @
35e5e187
package
com
.
yifu
.
cloud
.
plus
.
v1
.
job
.
compont
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprInsurancesProperties
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
/**
* @author licancan
* @description 商险模块到期定时任务
* @date 2022-08-03 10:39:14
*/
@Component
(
value
=
"updateOverdueTask"
)
@Slf4j
@EnableConfigurationProperties
(
DaprInsurancesProperties
.
class
)
public
class
UpdateOverdueTask
{
@Resource
private
DaprInsurancesProperties
daprInsurancesProperties
;
/**
* 更新商险到期定时任务
*
* @author licancan
* @param
* @return void
*/
public
void
updateOverdueTask
()
throws
Exception
{
log
.
info
(
"-------------更新商险到期-定时任务开始------------"
);
HttpDaprUtil
.
invokeMethodPost
(
daprInsurancesProperties
.
getAppUrl
(),
daprInsurancesProperties
.
getAppId
(),
"/insuranceDetail/inner/updateOverdueByTask"
,
""
,
Void
.
class
,
SecurityConstants
.
FROM_IN
);
log
.
info
(
"------------更新商险到期-定时任务结束------------"
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment