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
1f64c0d2
Commit
1f64c0d2
authored
Mar 16, 2021
by
nie'hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善工时统计
parent
3b1976c3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
WorkProjectTimeCost.xml
...-mapper/src/main/resources/mapper/WorkProjectTimeCost.xml
+3
-0
StatisticsServiceImpl.java
...java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
+15
-5
No files found.
wisenergy-mapper/src/main/resources/mapper/WorkProjectTimeCost.xml
View file @
1f64c0d2
...
...
@@ -95,6 +95,9 @@
<if
test=
"deptId != null and managerId != null"
>
AND (p.dept_id = #{deptId} OR p.manager_id = #{managerId})
</if>
<if
test=
"deptId != null and managerId == null"
>
AND p.dept_id = #{deptId}
</if>
<if
test=
"centreId != null"
>
AND centre_id = #{centreId}
</if>
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
View file @
1f64c0d2
...
...
@@ -321,9 +321,12 @@ public class StatisticsServiceImpl implements StatisticsService {
workTimeAndCostCollects
.
addAll
(
workTimeAndCostCollect
);
}
else
if
(
rank
.
contains
(
LevelRankEnum
.
DEPARTMENT_LEVEL
.
getRank
()))
{
// 如果用户的审批权限的级别最高为部门级别
// 如果用户同时为项目级别和部门级别
if
(
rank
.
contains
(
LevelRankEnum
.
PROJECT_LEVEL
.
getRank
()))
{
map
.
put
(
"managerId"
,
user
.
getId
());
}
// 获取部门下的所有项目和商机的工时统计
map
.
put
(
"deptId"
,
user
.
getDeptId
());
map
.
put
(
"managerId"
,
user
.
getId
());
workTimeAndCostCollects
=
workProjectTimeCostMapper
.
selectList
(
map
);
// 除项目和项目的类型
...
...
@@ -337,10 +340,17 @@ public class StatisticsServiceImpl implements StatisticsService {
}
// 获取查询结果中的类型
if
(!
rank
.
contains
(
LevelRankEnum
.
PROJECT_LEVEL
.
getRank
()))
{
List
<
Integer
>
typeList
=
workTimeAndCostCollects
.
stream
().
map
(
WorkTimeAndCostCollect:
:
getType
).
collect
(
Collectors
.
toList
());
List
<
Integer
>
typeList
=
workTimeAndCostCollects
.
stream
().
map
(
WorkTimeAndCostCollect:
:
getType
).
collect
(
Collectors
.
toList
());
if
(
typeList
.
size
()
<
workTypes
.
size
())
{
int
j
;
// 用户仅为项目商机级别用户,仅展示项目和商机类型
if
(
rank
.
contains
(
LevelRankEnum
.
PROJECT_LEVEL
.
getRank
())
&&
rank
.
size
()
==
1
)
{
j
=
2
;
}
else
{
// 用户不仅或不为项目商机级别
j
=
workTypes
.
size
();
}
// 如果查询结果不包含查询条件中的类型,造对象传前端
for
(
int
i
=
0
;
i
<
workTypes
.
size
()
;
i
++)
{
for
(
int
i
=
0
;
i
<
j
;
i
++)
{
WorkType
workType
=
workTypes
.
get
(
i
);
if
(!
typeList
.
contains
(
workType
.
getId
()))
{
WorkTimeAndCostCollect
workTimeAndCostCollect1
=
new
WorkTimeAndCostCollect
();
...
...
@@ -773,7 +783,7 @@ public class StatisticsServiceImpl implements StatisticsService {
row_1Cell1
.
setCellValue
(
"序号"
);
// 单位\姓名
HSSFCell
row_1Cell2
=
row_1
.
createCell
(
1
);
row_1Cell2
.
setCellValue
(
" 单位(小时)\n 姓名"
);
row_1Cell2
.
setCellValue
(
"
单位(小时)\n 姓名"
);
// 画斜线
HSSFPatriarch
drawingPatriarch
=
sheet1
.
createDrawingPatriarch
();
HSSFClientAnchor
hssfClientAnchor
=
new
HSSFClientAnchor
(
0
,
0
,
1023
,
255
,
(
short
)
1
,
1
,
(
short
)
1
,
2
);
...
...
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