Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
work_service
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
licc
work_service
Commits
9ff9d95a
Commit
9ff9d95a
authored
Feb 02, 2021
by
cq990612
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码结构
parent
b92fa3ce
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
WorkTimeOrderServiceImpl.java
...a/cn/wisenergy/service/impl/WorkTimeOrderServiceImpl.java
+4
-3
Trigger.java
...n/src/main/java/cn/wisenergy/web/config/auto/Trigger.java
+9
-5
No files found.
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkTimeOrderServiceImpl.java
View file @
9ff9d95a
...
...
@@ -258,9 +258,9 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
for
(
WorkTimeOrder
dto
:
addList
)
{
Date
rejectTime1
=
workCollectService
.
getByUserIdAndWorkDay
(
dto
.
getUserId
(),
dto
.
getWorkDay
()).
getRejectTime
();
if
(
null
!=
rejectTime1
)
{
WorkCollect
byUserIdAndWorkDay
=
workCollectService
.
getByUserIdAndWorkDay
(
dto
.
getUserId
(),
dto
.
getWorkDay
());
if
(
null
!=
byUserIdAndWorkDay
&&
null
!=
byUserIdAndWorkDay
.
getRejectTime
())
{
Date
rejectTime1
=
byUserIdAndWorkDay
.
getRejectTime
();
dto
.
setStatus
(
RE_SUBMIT
);
Date
rejectTime
=
DateUtil
.
convertStrToDate
(
DateUtil
.
convertDateToStr
(
rejectTime1
,
"yyyy-MM-dd"
),
"yyyy-MM-dd"
);
if
(
date
.
getTime
()
-
rejectTime
.
getTime
()
>
submitTime
*
24
*
60
*
60
*
1000
)
{
...
...
@@ -288,6 +288,7 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
// 更新collect表
int
status
=
statusYes
(
workTimeOrders
.
get
(
0
).
getUserId
(),
workTimeOrders
.
get
(
0
).
getWorkDay
());
WorkCollect
workCollect
=
workCollectService
.
getByUserIdAndWorkDay
(
workTimeOrders
.
get
(
0
).
getUserId
(),
workTimeOrders
.
get
(
0
).
getWorkDay
());
if
(
null
==
workCollect
)
{
workCollect
=
new
WorkCollect
();
BeanUtils
.
copyProperties
(
workTimeOrders
.
get
(
0
),
workCollect
);
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/config/auto/Trigger.java
View file @
9ff9d95a
...
...
@@ -16,6 +16,7 @@ import org.springframework.scheduling.config.ScheduledTaskRegistrar;
import
org.springframework.scheduling.config.TriggerTask
;
import
org.springframework.scheduling.support.CronTrigger
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.CollectionUtils
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -52,11 +53,14 @@ public class Trigger implements SchedulingConfigurer {
}
// 更新work_time_order表
List
<
WorkTimeOrder
>
workTimeOrders
=
workTimeOrderMapper
.
getAutoOrder
(
autoExamine
*
24
);
List
<
Integer
>
projectIds
=
new
ArrayList
<>();
workTimeOrders
.
forEach
(
wto
->
projectIds
.
add
(
wto
.
getWorkId
()));
workTimeOrderMapper
.
updateAutoExamine
(
projectIds
);
// 更新work_collect表
workCollectService
.
updateByWorkTimeOrder
(
workTimeOrders
);
if
(!
CollectionUtils
.
isEmpty
(
workTimeOrders
))
{
List
<
Integer
>
projectIds
=
new
ArrayList
<>();
workTimeOrders
.
forEach
(
wto
->
projectIds
.
add
(
wto
.
getWorkId
()));
workTimeOrderMapper
.
updateAutoExamine
(
projectIds
);
// 更新work_collect表
workCollectService
.
updateByWorkTimeOrder
(
workTimeOrders
);
}
}
,
triggerContext
->
{
...
...
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