Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
wangxiaolu-sfa-module-job
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
sfa
wangxiaolu-sfa-module-job
Commits
317fb63c
提交
317fb63c
authored
1月 16, 2025
作者:
吕本才
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1、oapi-sdk包移动到common-core包
2、创建同步任务和同步接口 3、增加启动类扫描宝
上级
c5ac3abc
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
89 行增加
和
5 行删除
+89
-5
pom.xml
pom.xml
+7
-4
SfaJobApplication.java
src/main/java/com/sfa/job/SfaJobApplication.java
+3
-1
FinanceOrderDetailSyncController.java
.../controller/finance/FinanceOrderDetailSyncController.java
+32
-0
FinanceOrderTask.java
src/main/java/com/sfa/job/xxljob/order/FinanceOrderTask.java
+47
-0
没有找到文件。
pom.xml
浏览文件 @
317fb63c
...
@@ -108,21 +108,24 @@
...
@@ -108,21 +108,24 @@
<scope>
test
</scope>
<scope>
test
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
com.larksuite.oapi
</groupId>
<artifactId>
oapi-sdk
</artifactId>
</dependency>
<dependency>
<dependency>
<groupId>
junit
</groupId>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<artifactId>
junit
</artifactId>
<scope>
test
</scope>
<scope>
test
</scope>
</dependency>
</dependency>
<!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp -->
<!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp -->
<dependency>
<dependency>
<groupId>
com.squareup.okhttp3
</groupId>
<groupId>
com.squareup.okhttp3
</groupId>
<artifactId>
okhttp
</artifactId>
<artifactId>
okhttp
</artifactId>
</dependency>
</dependency>
<!-- RuoYi wangxiaolu-link-module-bi -->
<dependency>
<groupId>
com.wangxiaolu.sfa
</groupId>
<artifactId>
wangxiaolu-link-module-bi
</artifactId>
</dependency>
</dependencies>
</dependencies>
...
...
src/main/java/com/sfa/job/SfaJobApplication.java
浏览文件 @
317fb63c
...
@@ -5,6 +5,7 @@ import org.springframework.boot.SpringApplication;
...
@@ -5,6 +5,7 @@ import org.springframework.boot.SpringApplication;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
com.sfa.common.security.annotation.EnableCustomConfig
;
import
com.sfa.common.security.annotation.EnableCustomConfig
;
import
com.sfa.common.security.annotation.EnableRyFeignClients
;
import
com.sfa.common.security.annotation.EnableRyFeignClients
;
import
org.springframework.context.annotation.ComponentScan
;
/**
/**
* 定时任务
* 定时任务
...
@@ -14,7 +15,8 @@ import com.sfa.common.security.annotation.EnableRyFeignClients;
...
@@ -14,7 +15,8 @@ import com.sfa.common.security.annotation.EnableRyFeignClients;
@EnableCustomConfig
@EnableCustomConfig
@EnableRyFeignClients
@EnableRyFeignClients
@SpringBootApplication
@SpringBootApplication
@MapperScan
({
"com.sfa.job.domain.job.mapper"
,
"com.sfa.job.domain.system.mapper"
})
@ComponentScan
(
value
=
{
"com.sfa.job"
,
"com.link.bi.domain.*"
,
"com.link.bi.service.*"
,
"com.link.bi.pojo.*"
})
@MapperScan
({
"com.sfa.job.domain.job.mapper"
,
"com.sfa.job.domain.system.mapper"
,
"com.link.bi.domain.mapper"
})
public
class
SfaJobApplication
public
class
SfaJobApplication
{
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
...
...
src/main/java/com/sfa/job/controller/finance/FinanceOrderDetailSyncController.java
0 → 100644
浏览文件 @
317fb63c
package
com
.
sfa
.
job
.
controller
.
finance
;
import
com.link.bi.pojo.response.FinanceSyncOrderDetailDto
;
import
com.link.bi.service.FinanceOrderService
;
import
com.sfa.common.core.web.controller.BaseController
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Date
;
/**
* 调度任务信息操作处理
*
* @author ruoyi
*/
@RestController
@RequestMapping
(
"/finance/order"
)
public
class
FinanceOrderDetailSyncController
extends
BaseController
{
@Autowired
private
FinanceOrderService
orderService
;
@GetMapping
(
"/syncWandiantongOrderDeatail"
)
public
FinanceSyncOrderDetailDto
syncWandiantongOrderDeatail
(
Date
startTime
,
Date
endTime
)
{
// 可以传参开始时间和结束时间,用于补充特定时间的数据采集
FinanceSyncOrderDetailDto
syncWdtOrderDetailDto
=
orderService
.
syncWandiantongOrder
(
startTime
,
endTime
,
1
);
return
syncWdtOrderDetailDto
;
}
}
src/main/java/com/sfa/job/xxljob/order/FinanceOrderTask.java
0 → 100644
浏览文件 @
317fb63c
package
com
.
sfa
.
job
.
xxljob
.
order
;
import
com.link.bi.pojo.response.FinanceSyncOrderDetailDto
;
import
com.link.bi.service.FinanceOrderDetailService
;
import
com.link.bi.service.FinanceOrderService
;
import
com.xxl.job.core.context.XxlJobContext
;
import
com.xxl.job.core.handler.annotation.XxlJob
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
/**
* @author : 吕本才
* @date : 2025-01-15 13:03:51
* @describe : 财务订单数据
*/
@Component
@Slf4j
public
class
FinanceOrderTask
{
@Autowired
FinanceOrderDetailService
orderDetailService
;
@Autowired
FinanceOrderService
orderService
;
/**
* 同步部门数据
*/
@XxlJob
(
"syncWandiantongOrderDeatail"
)
public
FinanceSyncOrderDetailDto
syncWandiantongOrderDeatail
()
{
// 暂不考虑分片
XxlJobContext
xxlJobContext
=
XxlJobContext
.
getXxlJobContext
();
int
shardingTotalCount
=
xxlJobContext
.
getShardTotal
();
int
shardingItem
=
xxlJobContext
.
getShardIndex
();
// 简单模拟分片处理,这里输出每个分片的信息
System
.
out
.
println
(
"分片总数: "
+
shardingTotalCount
+
", 当前分片: "
+
shardingItem
);
log
.
info
(
"开始同步-旺店通订单明细api接口数据"
);
// 定时任务不设定开始时间和结束时间
FinanceSyncOrderDetailDto
syncWdtOrderDetailDto
=
orderService
.
syncWandiantongOrder
(
null
,
null
,
0
);
log
.
info
(
"结束同步-旺店通订单明细api接口数据, 共同步订单{}条数据,订单明细{}条"
,
syncWdtOrderDetailDto
.
getOrderCount
(),
syncWdtOrderDetailDto
.
getOrderDetailCount
());
return
syncWdtOrderDetailDto
;
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论