Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
邬吉朋
ops
Commits
452c13ee
"...java/com/git@gitlab.ruzhoukj.com:wangcaixuan/rz-gb.git" did not exist on "db8f601025c9b8570578ec8b5233a38ade3f2a35"
Commit
452c13ee
authored
Feb 25, 2025
by
zhuxiang
Browse files
增加绩效计算定时任务,每日八点执行
parent
1cdf589a
Changes
4
Show whitespace changes
Inline
Side-by-side
src/main/java/com/ruzhoukj/sms/controller/ReportDataInfoController.java
View file @
452c13ee
...
@@ -67,7 +67,7 @@ public class ReportDataInfoController extends BaseController {
...
@@ -67,7 +67,7 @@ public class ReportDataInfoController extends BaseController {
@GetMapping
(
"/test"
)
@GetMapping
(
"/test"
)
public
void
test
()
{
public
void
test
()
{
reportDataInfoService
.
test
();
reportDataInfoService
.
countPerformance
();
}
}
}
}
src/main/java/com/ruzhoukj/sms/service/ReportDataInfoService.java
View file @
452c13ee
...
@@ -18,7 +18,7 @@ import java.util.List;
...
@@ -18,7 +18,7 @@ import java.util.List;
public
interface
ReportDataInfoService
extends
IService
<
ReportDataInfoEntity
>
{
public
interface
ReportDataInfoService
extends
IService
<
ReportDataInfoEntity
>
{
List
<
ReportDataInfoVO
>
queryList
(
ReportDataInfoDTO
reportDataInfoDTO
);
List
<
ReportDataInfoVO
>
queryList
(
ReportDataInfoDTO
reportDataInfoDTO
);
void
test
();
void
countPerformance
();
boolean
saveOrUpdateReportData
(
ReportDataInfoDTO
reportDataInfoDTO
);
boolean
saveOrUpdateReportData
(
ReportDataInfoDTO
reportDataInfoDTO
);
}
}
src/main/java/com/ruzhoukj/sms/service/impl/ReportDataInfoServiceImpl.java
View file @
452c13ee
...
@@ -2,6 +2,7 @@ package com.ruzhoukj.sms.service.impl;
...
@@ -2,6 +2,7 @@ package com.ruzhoukj.sms.service.impl;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.platform.utils.StringUtils
;
import
com.platform.utils.StringUtils
;
import
com.ruzhoukj.sms.dao.ReportDataInfoDao
;
import
com.ruzhoukj.sms.dao.ReportDataInfoDao
;
...
@@ -40,8 +41,11 @@ public class ReportDataInfoServiceImpl extends ServiceImpl<ReportDataInfoDao, Re
...
@@ -40,8 +41,11 @@ public class ReportDataInfoServiceImpl extends ServiceImpl<ReportDataInfoDao, Re
}
}
@Override
@Override
public
void
test
()
{
public
void
countPerformance
()
{
ReportDataInfoEntity
reportDataInfoEntity
=
getById
(
"1894302342735548417"
);
//查看已填写完成,未计算的绩效
List
<
ReportDataInfoEntity
>
reportDataInfoEntityList
=
baseMapper
.
selectList
(
new
LambdaQueryWrapper
<
ReportDataInfoEntity
>()
.
eq
(
ReportDataInfoEntity:
:
getStatus
,
3
));
reportDataInfoEntityList
.
forEach
(
reportDataInfoEntity
->
{
String
content
=
reportDataInfoEntity
.
getAllContent
();
String
content
=
reportDataInfoEntity
.
getAllContent
();
// 解析JSON字符串为JSONArray
// 解析JSON字符串为JSONArray
JSONArray
jsonArray
=
JSONArray
.
parseArray
(
content
);
JSONArray
jsonArray
=
JSONArray
.
parseArray
(
content
);
...
@@ -77,6 +81,7 @@ public class ReportDataInfoServiceImpl extends ServiceImpl<ReportDataInfoDao, Re
...
@@ -77,6 +81,7 @@ public class ReportDataInfoServiceImpl extends ServiceImpl<ReportDataInfoDao, Re
}
else
{
}
else
{
System
.
out
.
println
(
"No data available in the JSON array."
);
System
.
out
.
println
(
"No data available in the JSON array."
);
}
}
});
}
}
/**
/**
...
...
src/main/java/com/ruzhoukj/sms/task/PerformanceTask.java
0 → 100644
View file @
452c13ee
package
com.ruzhoukj.sms.task
;
import
com.ruzhoukj.sms.service.ReportDataInfoService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
@Component
@Slf4j
public
class
PerformanceTask
{
@Resource
private
ReportDataInfoService
reportDataInfoService
;
//每天八点查询一次绩效
@Scheduled
(
cron
=
"0 0 20 * * ?"
)
private
void
performanceTask
()
{
reportDataInfoService
.
countPerformance
();
}
}
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