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
5f45b625
Commit
5f45b625
authored
Feb 23, 2021
by
nie'hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善工时统计
parent
ba04204a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
WorkTimeOrderMapper.xml
...-mapper/src/main/resources/mapper/WorkTimeOrderMapper.xml
+2
-2
StatisticsServiceImpl.java
...java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
+7
-3
No files found.
wisenergy-mapper/src/main/resources/mapper/WorkTimeOrderMapper.xml
View file @
5f45b625
...
@@ -244,8 +244,8 @@
...
@@ -244,8 +244,8 @@
</foreach>
</foreach>
OR t.project_id IS null)
OR t.project_id IS null)
</if>
</if>
<if
test=
"
startTime
!= null"
>
<if
test=
"
firstDayOfMonth
!= null"
>
AND work_day >= #{
startTime
}
AND work_day >= #{
firstDayOfMonth
}
</if>
</if>
<if
test=
"deptId != null"
>
<if
test=
"deptId != null"
>
AND t.dept_id = #{deptId}
AND t.dept_id = #{deptId}
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
View file @
5f45b625
...
@@ -317,7 +317,10 @@ public class StatisticsServiceImpl implements StatisticsService {
...
@@ -317,7 +317,10 @@ public class StatisticsServiceImpl implements StatisticsService {
// 部门和中心级别
// 部门和中心级别
if
(
role
.
contains
(
ManagerEnum
.
IS_DEPARTMENT_DIRECTOR
.
getCode
())
||
role
.
contains
(
ManagerEnum
.
IS_CENTRE_DIRECTOR
.
getCode
()))
{
if
(
role
.
contains
(
ManagerEnum
.
IS_DEPARTMENT_DIRECTOR
.
getCode
())
||
role
.
contains
(
ManagerEnum
.
IS_CENTRE_DIRECTOR
.
getCode
()))
{
// 清除查询条件
// 清除查询条件
map
.
clear
();
map
.
remove
(
"projectIds"
);
map
.
remove
(
"centreId"
);
types
.
clear
();
// 请假、调休、外部商务、技术交流,内部培训、技术准备、管理,其他非项目/商机工作
// 请假、调休、外部商务、技术交流,内部培训、技术准备、管理,其他非项目/商机工作
for
(
WorkType
workType
:
workTypes
)
{
for
(
WorkType
workType
:
workTypes
)
{
// 查询条件排除项目和商机
// 查询条件排除项目和商机
...
@@ -326,12 +329,13 @@ public class StatisticsServiceImpl implements StatisticsService {
...
@@ -326,12 +329,13 @@ public class StatisticsServiceImpl implements StatisticsService {
}
}
}
}
// 用户仅为部门管理
// 用户仅为部门管理
,以部门主键作为查询条件之一,否则中心级别查询所有部门
if
(
role
.
contains
(
ManagerEnum
.
IS_DEPARTMENT_DIRECTOR
.
getCode
())
&&
role
.
size
()
==
1
)
{
if
(
role
.
contains
(
ManagerEnum
.
IS_DEPARTMENT_DIRECTOR
.
getCode
())
&&
role
.
size
()
==
1
)
{
map
.
put
(
"deptId"
,
user
.
getDeptId
());
map
.
put
(
"deptId"
,
user
.
getDeptId
());
}
}
map
.
put
(
"types"
,
types
);
map
.
put
(
"types"
,
types
);
List
<
WorkTimeAndCostCollect
>
workTimeAndCostCollect
=
workTimeOrderMapper
.
getWorkTimeAndCostCollect
(
map
);
List
<
WorkTimeAndCostCollect
>
workTimeAndCostCollect
=
workTimeOrderMapper
.
getWorkTimeAndCostCollect
(
map
);
// 将查询结果封装在一起
// 将查询结果封装在一起
collect
.
addAll
(
workTimeAndCostCollect
);
collect
.
addAll
(
workTimeAndCostCollect
);
...
@@ -505,7 +509,6 @@ public class StatisticsServiceImpl implements StatisticsService {
...
@@ -505,7 +509,6 @@ public class StatisticsServiceImpl implements StatisticsService {
if
(
role
.
contains
(
ManagerEnum
.
IS_CENTRE_DIRECTOR
.
getCode
())
&&
deptId
==
null
)
{
if
(
role
.
contains
(
ManagerEnum
.
IS_CENTRE_DIRECTOR
.
getCode
())
&&
deptId
==
null
)
{
deptId
=
DEFAULT_DEPT_ID
;
deptId
=
DEFAULT_DEPT_ID
;
}
}
// 默认统计截至时间为前一天
// 默认统计截至时间为前一天
if
(
StringUtil
.
isEmpty
(
endDate
))
{
if
(
StringUtil
.
isEmpty
(
endDate
))
{
Date
date
=
new
Date
();
Date
date
=
new
Date
();
...
@@ -627,6 +630,7 @@ public class StatisticsServiceImpl implements StatisticsService {
...
@@ -627,6 +630,7 @@ public class StatisticsServiceImpl implements StatisticsService {
statisticsDateAndWorkTime1
.
setCost
(
cost
);
statisticsDateAndWorkTime1
.
setCost
(
cost
);
statisticsDateAndWorkTimes
.
add
(
statisticsDateAndWorkTime1
);
statisticsDateAndWorkTimes
.
add
(
statisticsDateAndWorkTime1
);
}
}
return
projectStatistics
;
return
projectStatistics
;
}
}
...
...
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