Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
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
ec6b6e02
Commit
ec6b6e02
authored
Jan 26, 2021
by
cq990612
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码结构
parent
99d186ad
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
22 deletions
+24
-22
BASE_RESP_CODE_ENUM.java
...wisenergy/common/utils/exception/BASE_RESP_CODE_ENUM.java
+4
-1
WorkTimeOrderServiceImpl.java
...a/cn/wisenergy/service/impl/WorkTimeOrderServiceImpl.java
+20
-21
No files found.
wisenergy-common/src/main/java/cn/wisenergy/common/utils/exception/BASE_RESP_CODE_ENUM.java
View file @
ec6b6e02
...
...
@@ -55,7 +55,10 @@ public enum BASE_RESP_CODE_ENUM {
DEPT_NOT_FOUND
(
"633"
,
"部门信息未找到"
),
DATE_IS_ERROR
(
"634"
,
"时间不匹配"
),
CENTRE_NOT_FOUND
(
"635"
,
"中心信息未找到"
),
TIME_NOT_IS_NULL
(
"636"
,
"工时不能为0"
)
TIME_NOT_IS_NULL
(
"636"
,
"工时不能为0"
),
WORKDAY_NOT_NULL
(
"637"
,
"工时日期不能为空"
),
PROJECT_NOT_NULL
(
"638"
,
"项目类型不能为空"
),
;
/**
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkTimeOrderServiceImpl.java
View file @
ec6b6e02
...
...
@@ -186,6 +186,7 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
// 判断是否超过8小时
int
count
=
0
;
List
<
WorkTimeOrder
>
byDayToDto
=
getByDayToDto
(
workTimeOrders
.
get
(
0
).
getUserId
(),
workTimeOrders
.
get
(
0
).
getWorkDay
());
// 判断是否重复填报
isRepeat
(
workTimeOrders
);
...
...
@@ -559,22 +560,8 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
for
(
WorkTimeOrderDto
dto
:
list
)
{
if
(
null
==
dto
.
getWorkTime
()
||
0
==
dto
.
getWorkTime
())
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
TIME_NOT_IS_NULL
);
}
if
(
null
==
dto
.
getDes
())
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
DES_NOT_NULL
);
}
if
(
null
==
dto
.
getWorkDay
()
||
null
==
dto
.
getType
())
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
}
if
(
thanDate
(
dto
.
getWorkDay
()))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
WORK_TIME_OVER_NOW_DAY
);
}
isEmpty
(
dto
);
// 2、默认设置超过系统默认3天(包括驳回3天)未填报的工时将不能填报
if
(
date
.
getTime
()
-
dto
.
getWorkDay
().
getTime
()
>
submitTime
*
24
*
60
*
60
*
1000
)
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
WORK_DAY_THAN_DATE
);
...
...
@@ -596,15 +583,27 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
}
private
void
isEmpty
(
WorkTimeOrderDto
dto
)
{
if
(
null
==
dto
.
getWorkTime
()
||
0
==
dto
.
getWorkTime
())
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
TIME_NOT_IS_NULL
);
}
if
(
null
==
dto
.
getDes
()
||
""
.
equals
(
dto
.
getDes
()))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
DES_NOT_NULL
);
}
if
(
null
==
dto
.
getWorkDay
())
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
WORKDAY_NOT_NULL
);
}
if
(
null
==
dto
.
getType
()
||
0
==
dto
.
getType
())
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
PROJECT_NOT_NULL
);
}
if
(
thanDate
(
dto
.
getWorkDay
()))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
WORK_TIME_OVER_NOW_DAY
);
}
}
//3.每天工时累加不得超过八小时
private
void
timeNotEight
(
int
count
,
List
<
WorkTimeOrderDto
>
list
)
{
for
(
WorkTimeOrderDto
workOrder
:
list
)
{
if
(
null
==
workOrder
.
getWorkDay
())
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
}
if
(
0
==
workOrder
.
getWorkTime
())
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
TIME_NOT_IS_NULL
);
}
isEmpty
(
workOrder
);
count
=
count
+
workOrder
.
getWorkTime
();
if
(
count
>
8
)
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
WORK_TIME_NOT_OVER_EIGHT
);
...
...
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