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
463f9227
Commit
463f9227
authored
Mar 17, 2021
by
nie'hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善工时统计
parent
0e036896
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
20 deletions
+30
-20
WorkProjectMapper.xml
...gy-mapper/src/main/resources/mapper/WorkProjectMapper.xml
+4
-1
StatisticsServiceImpl.java
...java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
+26
-18
StatisticsController.java
...energy/web/admin/controller/app/StatisticsController.java
+0
-1
No files found.
wisenergy-mapper/src/main/resources/mapper/WorkProjectMapper.xml
View file @
463f9227
...
...
@@ -51,7 +51,7 @@
<update
id=
"updateIsConclusionById"
>
UPDATE
<include
refid=
"table"
/>
SET is_conclusion = 0
SET is_conclusion = 0
, modify_time = now()
WHERE id = #{id}
</update>
<update
id=
"updateProject"
>
...
...
@@ -224,6 +224,9 @@
<if
test=
"managerId != null and deptId == null"
>
AND manager_id = #{managerId}
</if>
<if
test=
"year != null"
>
AND YEAR (create_time)
<
= #{year} AND( (is_conclusion = 0 AND year(modify_time) >= #{year}) or (is_conclusion = 1))
</if>
</where>
</select>
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
View file @
463f9227
...
...
@@ -679,7 +679,9 @@ public class StatisticsServiceImpl implements StatisticsService {
}
else
if
(
rank
.
contains
(
LevelRankEnum
.
DEPARTMENT_LEVEL
.
getRank
()))
{
// 查询部门下所有项目,部门主键是用户的部门主键,当前权限最高级别为部门级别
map
.
put
(
"deptId"
,
deptId
);
map
.
put
(
"managerId"
,
userId
);
if
(
rank
.
contains
(
LevelRankEnum
.
PROJECT_LEVEL
.
getRank
()))
{
map
.
put
(
"managerId"
,
userId
);
}
}
else
{
// 项目/商机级别,以项目管理查询
map
.
put
(
"managerId"
,
userId
);
...
...
@@ -703,23 +705,23 @@ public class StatisticsServiceImpl implements StatisticsService {
List
<
ProjectStatisticsByMonth
>
projectStatisticsByMonths1
=
workProjectTimeCostMapper
.
selectListStatistics
(
map
);
// 将在查询时间端内未存在填报信息的项目补齐
//
if (projectId == null) {
//
// 查询项目
//
List<WorkProject> projects = workProjectMapper.getListByCriteria(map);
//
// 查询统计结果中的项目主键
//
List<Integer> queryProjectId = projectStatisticsByMonths1.stream().map(ProjectStatisticsByMonth::getProjectId).collect(Collectors.toList());
//
for (WorkProject project : projects) {
//
// 如果在查询结果中未存在所管理的项目,新建对象加入统计
//
if (!queryProjectId.contains(project.getId())) {
//
ProjectStatisticsByMonth projectStatisticsByMonth = new ProjectStatisticsByMonth();
//
projectStatisticsByMonth.setProjectName(project.getProjectName());
//
projectStatisticsByMonth.setProjectId(project.getId());
//
List<ProjectStatisticsByMonth.StatisticsDateAndWorkTime> statisticsDateAndWorkTimes = new ArrayList<>();
//
projectStatisticsByMonth.setStatisticsDateAndWorkTimes(statisticsDateAndWorkTimes);
//
projectStatisticsByMonths1.add(projectStatisticsByMonth);
//
}
//
}
//
}
if
(
projectId
==
null
)
{
// 查询项目
List
<
WorkProject
>
projects
=
workProjectMapper
.
getListByCriteria
(
map
);
// 查询统计结果中的项目主键
List
<
Integer
>
queryProjectId
=
projectStatisticsByMonths1
.
stream
().
map
(
ProjectStatisticsByMonth:
:
getProjectId
).
collect
(
Collectors
.
toList
());
for
(
WorkProject
project
:
projects
)
{
// 如果在查询结果中未存在所管理的项目,新建对象加入统计
if
(!
queryProjectId
.
contains
(
project
.
getId
()))
{
ProjectStatisticsByMonth
projectStatisticsByMonth
=
new
ProjectStatisticsByMonth
();
projectStatisticsByMonth
.
setProjectName
(
project
.
getProjectName
());
projectStatisticsByMonth
.
setProjectId
(
project
.
getId
());
List
<
ProjectStatisticsByMonth
.
StatisticsDateAndWorkTime
>
statisticsDateAndWorkTimes
=
new
ArrayList
<>();
projectStatisticsByMonth
.
setStatisticsDateAndWorkTimes
(
statisticsDateAndWorkTimes
);
projectStatisticsByMonths1
.
add
(
projectStatisticsByMonth
);
}
}
}
String
startDate
=
""
;
...
...
@@ -900,6 +902,12 @@ public class StatisticsServiceImpl implements StatisticsService {
CellRangeAddress
cellRangeAddress2
=
new
CellRangeAddress
(
1
,
2
,
1
,
1
);
sheet1
.
addMergedRegion
(
cellRangeAddress2
);
setBorderStyle
(
BorderStyle
.
THIN
,
cellRangeAddress2
,
sheet1
);
// 项目名后的合计
short
lastCellNum1
=
row_1
.
getLastCellNum
();
CellRangeAddress
cellRangeAddress6
=
new
CellRangeAddress
(
1
,
2
,
lastCellNum1
-
1
,
lastCellNum1
-
1
);
sheet1
.
addMergedRegion
(
cellRangeAddress6
);
setBorderStyle
(
BorderStyle
.
THIN
,
cellRangeAddress6
,
sheet1
);
// 合计行
CellRangeAddress
cellRangeAddress3
=
new
CellRangeAddress
(
userWorkTimeStatisticsReport
.
size
()
+
1
,
userWorkTimeStatisticsReport
.
size
()
+
1
,
0
,
1
);
sheet1
.
addMergedRegion
(
cellRangeAddress3
);
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/StatisticsController.java
View file @
463f9227
...
...
@@ -168,7 +168,6 @@ public class StatisticsController extends BaseController {
}
@ApiOperation
(
value
=
"导出项目统计明细"
,
notes
=
"导出项目明细表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"用户主键"
),
...
...
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