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
a47f10d5
Commit
a47f10d5
authored
Jan 30, 2021
by
cq990612
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码结构
parent
c2e2d8fb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
BASE_RESP_CODE_ENUM.java
...wisenergy/common/utils/exception/BASE_RESP_CODE_ENUM.java
+2
-0
WorkTimeOrderServiceImpl.java
...a/cn/wisenergy/service/impl/WorkTimeOrderServiceImpl.java
+12
-5
No files found.
wisenergy-common/src/main/java/cn/wisenergy/common/utils/exception/BASE_RESP_CODE_ENUM.java
View file @
a47f10d5
...
...
@@ -62,6 +62,8 @@ public enum BASE_RESP_CODE_ENUM {
PASSWORD_FORMAT_ERROR
(
"640"
,
"密码由6到16位数字组成"
),
INCOMPLETE_WORK_ORDER_INFORMATION
(
"621"
,
"请填写完整的工单信息"
),
NOT_MANAGER_TYPE
(
"642"
,
"没有可以管理的类型项目"
),
HAVE_ORDER_DELETE
(
"643"
,
"有工单被用户删除,审批失败,请重新审批"
),
ORDER_EXAMINE
(
"644"
,
"该工单已经被审批,请刷新查看"
),
;
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkTimeOrderServiceImpl.java
View file @
a47f10d5
...
...
@@ -24,7 +24,9 @@ import org.springframework.util.CollectionUtils;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
/**
* <p>
...
...
@@ -263,7 +265,11 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
workTimeOrder
.
setDeptId
(
workUserDeptService
.
getDeptIdByUserId
(
dto
.
getUserId
()));
BeanUtils
.
copyProperties
(
dto
,
workTimeOrder
);
totalTime
+=
dto
.
getWorkTime
();
if
(
2
==
dto
.
getStatus
()
||
5
==
dto
.
getStatus
())
{
WorkTimeOrder
workTimeOrder1
=
workTimeOrderMapper
.
selectById
(
dto
.
getWorkId
());
if
(
2
==
workTimeOrder1
.
getStatus
()||
5
==
workTimeOrder1
.
getStatus
()){
if
(!
dto
.
getStatus
().
equals
(
workTimeOrder1
.
getStatus
()))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
ORDER_EXAMINE
);
}
continue
;
}
BeanUtils
.
copyProperties
(
workTimeOrder
,
dto
);
...
...
@@ -518,7 +524,9 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
}
List
<
WorkTimeOrder
>
workTimeOrders
=
workTimeOrderMapper
.
selectBatchIds
(
ids
);
if
(
ids
.
size
()
!=
workTimeOrders
.
size
())
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
HAVE_ORDER_DELETE
);
}
// 更新collect表
workCollectService
.
updateByWorkTimeOrder
(
workTimeOrders
);
...
...
@@ -733,7 +741,6 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
}
if
(
null
==
dto
.
getWorkTime
()
||
0
==
dto
.
getWorkTime
())
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
TIME_NOT_IS_NULL
);
}
...
...
@@ -894,7 +901,7 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
if
(
0
!=
level
)
{
Integer
deptId
=
user
.
getDeptId
();
workTimeOrders
=
workTimeOrderMapper
.
queryByPage
(
status
,
projectId
,
type
,
deptId
);
workTimeOrders
=
workTimeOrderMapper
.
queryByPage
(
status
,
projectId
,
type
,
deptId
);
}
...
...
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