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
d5b09a95
Commit
d5b09a95
authored
Feb 26, 2021
by
cq990612
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码结构
parent
8dad775c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
3 deletions
+14
-3
DateUtil.java
...mon/src/main/java/cn/wisenergy/common/utils/DateUtil.java
+10
-0
WorkCollectServiceImpl.java
...ava/cn/wisenergy/service/impl/WorkCollectServiceImpl.java
+1
-1
WorkTimeOrderServiceImpl.java
...a/cn/wisenergy/service/impl/WorkTimeOrderServiceImpl.java
+3
-2
No files found.
wisenergy-common/src/main/java/cn/wisenergy/common/utils/DateUtil.java
View file @
d5b09a95
...
@@ -361,6 +361,16 @@ public class DateUtil {
...
@@ -361,6 +361,16 @@ public class DateUtil {
return
Integer
.
parseInt
(
String
.
valueOf
(
betweenDays
));
return
Integer
.
parseInt
(
String
.
valueOf
(
betweenDays
));
}
}
public
static
boolean
isThanDay
(
Date
startDate
,
Date
endDate
,
int
thanDay
)
{
long
betweenDays
=
(
endDate
.
getTime
()
-
startDate
.
getTime
())
/
(
1000
*
3600
*
24
);
long
than
=
(
endDate
.
getTime
()
-
startDate
.
getTime
())
%
(
1000
*
3600
*
24
);
if
((
betweenDays
>
thanDay
)
||
(
betweenDays
==
thanDay
&&
than
!=
0
))
{
return
true
;
}
else
{
return
false
;
}
}
/**
/**
* 获取当前月份天数的数组
* 获取当前月份天数的数组
*
*
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkCollectServiceImpl.java
View file @
d5b09a95
...
@@ -118,7 +118,7 @@ public class WorkCollectServiceImpl implements WorkCollectService {
...
@@ -118,7 +118,7 @@ public class WorkCollectServiceImpl implements WorkCollectService {
if
(
null
!=
workCollect
.
getRejectTime
())
{
if
(
null
!=
workCollect
.
getRejectTime
())
{
Date
rejectTime
=
workCollect
.
getRejectTime
();
Date
rejectTime
=
workCollect
.
getRejectTime
();
rejectTime
=
DateUtil
.
convertStrToDate
(
DateUtil
.
convertDateToStr
(
rejectTime
,
"yyyy-MM-dd"
),
"yyyy-MM-dd"
);
rejectTime
=
DateUtil
.
convertStrToDate
(
DateUtil
.
convertDateToStr
(
rejectTime
,
"yyyy-MM-dd"
),
"yyyy-MM-dd"
);
if
(
date
.
getTime
()
-
rejectTime
.
getTime
()
>
submitAdopt
.
getSubmitTime
()
*
24
*
60
*
60
*
1000
)
{
if
(
DateUtil
.
isThanDay
(
rejectTime
,
date
,
submitAdopt
.
getSubmitTime
())
)
{
modifyTime
=
0
;
modifyTime
=
0
;
}
}
}
}
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkTimeOrderServiceImpl.java
View file @
d5b09a95
...
@@ -81,6 +81,7 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
...
@@ -81,6 +81,7 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
@Autowired
@Autowired
private
WorkTypeManagerService
workTypeManagerService
;
private
WorkTypeManagerService
workTypeManagerService
;
// 工单状态
// 工单状态
private
final
static
Integer
COMPLETED
=
StatusEnum
.
COMPLETED
.
getCode
();
private
final
static
Integer
COMPLETED
=
StatusEnum
.
COMPLETED
.
getCode
();
private
final
static
Integer
APPROVED
=
StatusEnum
.
APPROVED
.
getCode
();
private
final
static
Integer
APPROVED
=
StatusEnum
.
APPROVED
.
getCode
();
private
final
static
Integer
REJECTED
=
StatusEnum
.
REJECTED
.
getCode
();
private
final
static
Integer
REJECTED
=
StatusEnum
.
REJECTED
.
getCode
();
...
@@ -262,13 +263,13 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
...
@@ -262,13 +263,13 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
Date
rejectTime1
=
byUserIdAndWorkDay
.
getRejectTime
();
Date
rejectTime1
=
byUserIdAndWorkDay
.
getRejectTime
();
dto
.
setStatus
(
RE_SUBMIT
);
dto
.
setStatus
(
RE_SUBMIT
);
Date
rejectTime
=
DateUtil
.
convertStrToDate
(
DateUtil
.
convertDateToStr
(
rejectTime1
,
"yyyy-MM-dd"
),
"yyyy-MM-dd"
);
Date
rejectTime
=
DateUtil
.
convertStrToDate
(
DateUtil
.
convertDateToStr
(
rejectTime1
,
"yyyy-MM-dd"
),
"yyyy-MM-dd"
);
if
(
date
.
getTime
()
-
rejectTime
.
getTime
()
>
submitTime
*
24
*
60
*
60
*
1000
)
{
if
(
DateUtil
.
isThanDay
(
rejectTime
,
date
,
submitTime
)
)
{
throw
new
BaseCustomException
(
"627"
,
"超过"
+
submitTime
+
"天的不能填报"
);
throw
new
BaseCustomException
(
"627"
,
"超过"
+
submitTime
+
"天的不能填报"
);
}
}
}
}
// 4、默认设置超过系统默认3天(包括驳回3天)未填报的工时将不能填报
// 4、默认设置超过系统默认3天(包括驳回3天)未填报的工时将不能填报
if
(!
REJECTED
.
equals
(
dto
.
getStatus
())
&&
!
RE_SUBMIT
.
equals
(
dto
.
getStatus
()))
{
if
(!
REJECTED
.
equals
(
dto
.
getStatus
())
&&
!
RE_SUBMIT
.
equals
(
dto
.
getStatus
()))
{
if
(
date
.
getTime
()
-
dto
.
getWorkDay
().
getTime
()
>
submitTime
*
24
*
60
*
60
*
1000
)
{
if
(
DateUtil
.
isThanDay
(
dto
.
getWorkDay
(),
date
,
submitTime
)
)
{
throw
new
BaseCustomException
(
"627"
,
"超过"
+
submitTime
+
"天的不能填报"
);
throw
new
BaseCustomException
(
"627"
,
"超过"
+
submitTime
+
"天的不能填报"
);
}
}
}
}
...
...
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