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
8a89a45c
Commit
8a89a45c
authored
Jan 24, 2021
by
cq990612
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码结构
parent
05277ce6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
21 deletions
+17
-21
WorkTimeOrderService.java
.../main/java/cn/wisenergy/service/WorkTimeOrderService.java
+2
-5
WorkTimeOrderServiceImpl.java
...a/cn/wisenergy/service/impl/WorkTimeOrderServiceImpl.java
+12
-10
WorkTimeOrderController.java
...rgy/web/admin/controller/app/WorkTimeOrderController.java
+3
-6
No files found.
wisenergy-service/src/main/java/cn/wisenergy/service/WorkTimeOrderService.java
View file @
8a89a45c
package
cn
.
wisenergy
.
service
;
import
cn.wisenergy.model.app.WorkTimeOrder
;
import
cn.wisenergy.model.dto.CreateWorkOrderDto
;
import
cn.wisenergy.model.dto.ExamineGroupbyProjectDto
;
import
cn.wisenergy.model.dto.SubtotalDto
;
import
cn.wisenergy.model.dto.WorkTimeOrderDto
;
import
cn.wisenergy.model.dto.*
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -73,7 +70,7 @@ public interface WorkTimeOrderService {
* @param status 状态
* @return 自定义dto
*/
List
<
ExamineGroupbyProjectDto
>
getExamine
(
Integer
userId
,
Integer
projectId
,
Integer
type
,
Integer
page
,
Integer
size
,
Integer
status
);
PageResult
<
ExamineGroupbyProjectDto
>
getExamine
(
Integer
userId
,
Integer
projectId
,
Integer
type
,
Integer
page
,
Integer
size
,
Integer
status
);
/**
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkTimeOrderServiceImpl.java
View file @
8a89a45c
...
...
@@ -5,13 +5,11 @@ import cn.wisenergy.common.utils.exception.BASE_RESP_CODE_ENUM;
import
cn.wisenergy.common.utils.exception.BaseCustomException
;
import
cn.wisenergy.mapper.WorkTimeOrderMapper
;
import
cn.wisenergy.model.app.*
;
import
cn.wisenergy.model.dto.CreateWorkOrderDto
;
import
cn.wisenergy.model.dto.ExamineGroupbyProjectDto
;
import
cn.wisenergy.model.dto.SubtotalDto
;
import
cn.wisenergy.model.dto.WorkTimeOrderDto
;
import
cn.wisenergy.model.dto.*
;
import
cn.wisenergy.service.*
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -209,7 +207,7 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
* @return 自定义dto
*/
@Override
public
Lis
t
<
ExamineGroupbyProjectDto
>
getExamine
(
Integer
userId
,
Integer
projectId
,
Integer
type
,
Integer
page
,
Integer
size
,
Integer
status
)
{
public
PageResul
t
<
ExamineGroupbyProjectDto
>
getExamine
(
Integer
userId
,
Integer
projectId
,
Integer
type
,
Integer
page
,
Integer
size
,
Integer
status
)
{
log
.
info
(
"WorkOrderServiceImpl[]getExamine[]input.param.userId:{},projectId:{},type:{},page:{},size:{},status:{}"
+
userId
,
projectId
,
type
,
page
,
size
,
status
);
// 判断当前用户是否是管理员
isManager
(
userId
);
...
...
@@ -218,7 +216,7 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
if
(
null
!=
page
&&
null
!=
size
)
{
return
pageExamine
(
user
,
projectId
,
type
,
page
,
size
,
status
);
}
PageResult
<
ExamineGroupbyProjectDto
>
pageResult
=
new
PageResult
<>();
type
=
null
==
type
?
5
:
type
;
// 部门经理审核
if
(
2
==
user
.
getLevel
())
{
...
...
@@ -228,13 +226,13 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
wrapper
.
in
(
"status"
,
1
,
4
);
wrapper
.
eq
(
"type"
,
type
);
List
<
WorkTimeOrder
>
workTimeOrders
=
workTimeOrderMapper
.
selectList
(
wrapper
);
return
WorkTimeOrderTOEGPD
(
workTimeOrders
);
return
pageResult
.
setRows
(
WorkTimeOrderTOEGPD
(
workTimeOrders
)
);
}
// 项目经理审核
if
(
null
==
projectId
)
{
projectId
=
workUserProjectService
.
getProjectIdByUserId
(
userId
).
get
(
0
);
}
return
getExamineGroupByProjectDto
(
projectId
);
return
pageResult
.
setRows
(
getExamineGroupByProjectDto
(
projectId
)
);
}
/**
...
...
@@ -522,13 +520,15 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
// 审批分页
private
Lis
t
<
ExamineGroupbyProjectDto
>
pageExamine
(
WorkUser
user
,
Integer
projectId
,
Integer
type
,
Integer
page
,
Integer
size
,
Integer
status
)
{
private
PageResul
t
<
ExamineGroupbyProjectDto
>
pageExamine
(
WorkUser
user
,
Integer
projectId
,
Integer
type
,
Integer
page
,
Integer
size
,
Integer
status
)
{
log
.
info
(
"WorkOrderServiceImpl[]pageExamine[]input.param.user:{},projectId:{},type:{},page:{},size:{},status:{}"
+
user
,
projectId
,
type
,
page
,
size
,
status
);
PageHelper
.
startPage
(
page
,
size
);
List
<
WorkTimeOrder
>
workTimeOrders
;
workTimeOrders
=
null
;
Integer
level
=
user
.
getLevel
();
List
<
Integer
>
types
;
PageResult
<
ExamineGroupbyProjectDto
>
pageResult
=
new
PageResult
<>();
// 项目经理
if
(
1
==
level
)
{
types
=
type
==
null
?
Arrays
.
asList
(
1
,
2
,
3
,
4
)
:
new
ArrayList
<>(
type
);
...
...
@@ -539,7 +539,9 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
types
=
type
==
null
?
Arrays
.
asList
(
3
,
4
,
5
,
6
)
:
new
ArrayList
<>(
type
);
workTimeOrders
=
workTimeOrderMapper
.
queryByPage
(
status
,
null
,
types
);
}
return
WorkTimeOrderTOEGPD
(
workTimeOrders
);
PageInfo
<
WorkTimeOrder
>
pageInfo
=
new
PageInfo
<>(
workTimeOrders
);
pageResult
.
setTotal
(
pageInfo
.
getTotal
());
return
pageResult
.
setRows
(
WorkTimeOrderTOEGPD
(
workTimeOrders
));
}
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/WorkTimeOrderController.java
View file @
8a89a45c
...
...
@@ -5,10 +5,7 @@ import cn.wisenergy.common.utils.exception.CustomException;
import
cn.wisenergy.common.utils.exception.RESP_CODE_ENUM
;
import
cn.wisenergy.common.utils.exception.Result
;
import
cn.wisenergy.model.app.WorkUser
;
import
cn.wisenergy.model.dto.CreateWorkOrderDto
;
import
cn.wisenergy.model.dto.ExamineGroupbyProjectDto
;
import
cn.wisenergy.model.dto.ProjectDto
;
import
cn.wisenergy.model.dto.WorkTimeOrderDto
;
import
cn.wisenergy.model.dto.*
;
import
cn.wisenergy.service.*
;
import
cn.wisenergy.web.admin.controller.common.BaseController
;
import
io.swagger.annotations.Api
;
...
...
@@ -96,12 +93,12 @@ public class WorkTimeOrderController extends BaseController {
@ApiImplicitParam
(
name
=
"status"
,
value
=
"PC端审批状态"
,
dataType
=
"int"
),
})
@GetMapping
(
value
=
"/getExamine"
)
public
Result
<
Lis
t
<
ExamineGroupbyProjectDto
>>
getExamine
(
Integer
userId
,
Integer
projectId
,
Integer
type
,
Integer
page
,
Integer
size
,
Integer
status
)
{
public
Result
<
PageResul
t
<
ExamineGroupbyProjectDto
>>
getExamine
(
Integer
userId
,
Integer
projectId
,
Integer
type
,
Integer
page
,
Integer
size
,
Integer
status
)
{
log
.
info
(
"WorkTimeOrderController[]getExamine[]input.param.userId:{},projectId:{},type:{},page:{},size:{},status:{}"
+
userId
,
projectId
,
type
,
page
,
size
,
status
);
if
(
null
==
userId
)
{
throw
new
CustomException
(
RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
}
Lis
t
<
ExamineGroupbyProjectDto
>
examines
=
workTimeOrderService
.
getExamine
(
userId
,
projectId
,
type
,
page
,
size
,
status
);
PageResul
t
<
ExamineGroupbyProjectDto
>
examines
=
workTimeOrderService
.
getExamine
(
userId
,
projectId
,
type
,
page
,
size
,
status
);
return
getResult
(
examines
);
}
...
...
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