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
34b9ba79
Commit
34b9ba79
authored
Mar 17, 2021
by
nie'hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善工时统计
parent
97c07cfd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
26 deletions
+23
-26
StatisticsServiceImpl.java
...java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
+22
-24
StatisticsController.java
...energy/web/admin/controller/app/StatisticsController.java
+1
-2
No files found.
wisenergy-service/src/main/java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
View file @
34b9ba79
...
@@ -167,7 +167,7 @@ public class StatisticsServiceImpl implements StatisticsService {
...
@@ -167,7 +167,7 @@ public class StatisticsServiceImpl implements StatisticsService {
map
.
remove
(
"status"
);
map
.
remove
(
"status"
);
map
.
remove
(
"startModifyTime"
);
map
.
remove
(
"startModifyTime"
);
//待审核包括:新提交和重新提交的
//
待审核包括:新提交和重新提交的
List
<
Integer
>
statusArray
=
new
ArrayList
<>();
List
<
Integer
>
statusArray
=
new
ArrayList
<>();
statusArray
.
add
(
WorkOrderStatus
.
WAIT_AUDIT
.
getCode
());
statusArray
.
add
(
WorkOrderStatus
.
WAIT_AUDIT
.
getCode
());
statusArray
.
add
(
WorkOrderStatus
.
RE_SUBMIT
.
getCode
());
statusArray
.
add
(
WorkOrderStatus
.
RE_SUBMIT
.
getCode
());
...
@@ -175,11 +175,9 @@ public class StatisticsServiceImpl implements StatisticsService {
...
@@ -175,11 +175,9 @@ public class StatisticsServiceImpl implements StatisticsService {
map
.
put
(
"startWorkDay"
,
firstDayOfMonth
);
map
.
put
(
"startWorkDay"
,
firstDayOfMonth
);
map
.
put
(
"statusArray"
,
statusArray
);
map
.
put
(
"statusArray"
,
statusArray
);
// 用户在该权限对应的级别
// 用户在该权限对应的级别
List
<
Integer
>
rank
=
this
.
getUserRank
(
roleUserLevel
,
LevelEnum
.
EXAMINE
.
getLevelName
());
List
<
Integer
>
rank
=
this
.
getUserRank
(
roleUserLevel
,
LevelEnum
.
EXAMINE
.
getLevelName
());
// 项目和商机的
未审批
的数
// 项目和商机的
待审核
的数
Integer
notCompletedCount1
=
0
;
Integer
notCompletedCount1
=
0
;
// 项目商机级别,查询用户负责项目商机未审批条数
// 项目商机级别,查询用户负责项目商机未审批条数
if
(
rank
.
contains
(
LevelRankEnum
.
PROJECT_LEVEL
.
getRank
()))
{
if
(
rank
.
contains
(
LevelRankEnum
.
PROJECT_LEVEL
.
getRank
()))
{
...
@@ -705,23 +703,23 @@ public class StatisticsServiceImpl implements StatisticsService {
...
@@ -705,23 +703,23 @@ public class StatisticsServiceImpl implements StatisticsService {
List
<
ProjectStatisticsByMonth
>
projectStatisticsByMonths1
=
workProjectTimeCostMapper
.
selectListStatistics
(
map
);
List
<
ProjectStatisticsByMonth
>
projectStatisticsByMonths1
=
workProjectTimeCostMapper
.
selectListStatistics
(
map
);
// 将在查询时间端内未存在填报信息的项目补齐
// 将在查询时间端内未存在填报信息的项目补齐
if
(
projectId
==
null
)
{
//
if (projectId == null) {
// 查询项目
//
// 查询项目
List
<
WorkProject
>
projects
=
workProjectMapper
.
getListByCriteria
(
map
);
//
List<WorkProject> projects = workProjectMapper.getListByCriteria(map);
// 查询统计结果中的项目主键
//
// 查询统计结果中的项目主键
List
<
Integer
>
queryProjectId
=
projectStatisticsByMonths1
.
stream
().
map
(
ProjectStatisticsByMonth:
:
getProjectId
).
collect
(
Collectors
.
toList
());
//
List<Integer> queryProjectId = projectStatisticsByMonths1.stream().map(ProjectStatisticsByMonth::getProjectId).collect(Collectors.toList());
for
(
WorkProject
project
:
projects
)
{
//
for (WorkProject project : projects) {
// 如果在查询结果中未存在所管理的项目,新建对象加入统计
//
// 如果在查询结果中未存在所管理的项目,新建对象加入统计
if
(!
queryProjectId
.
contains
(
project
.
getId
()))
{
//
if (!queryProjectId.contains(project.getId())) {
ProjectStatisticsByMonth
projectStatisticsByMonth
=
new
ProjectStatisticsByMonth
();
//
ProjectStatisticsByMonth projectStatisticsByMonth = new ProjectStatisticsByMonth();
projectStatisticsByMonth
.
setProjectName
(
project
.
getProjectName
());
//
projectStatisticsByMonth.setProjectName(project.getProjectName());
projectStatisticsByMonth
.
setProjectId
(
project
.
getId
());
//
projectStatisticsByMonth.setProjectId(project.getId());
List
<
ProjectStatisticsByMonth
.
StatisticsDateAndWorkTime
>
statisticsDateAndWorkTimes
=
new
ArrayList
<>();
//
List<ProjectStatisticsByMonth.StatisticsDateAndWorkTime> statisticsDateAndWorkTimes = new ArrayList<>();
projectStatisticsByMonth
.
setStatisticsDateAndWorkTimes
(
statisticsDateAndWorkTimes
);
//
projectStatisticsByMonth.setStatisticsDateAndWorkTimes(statisticsDateAndWorkTimes);
projectStatisticsByMonths1
.
add
(
projectStatisticsByMonth
);
//
projectStatisticsByMonths1.add(projectStatisticsByMonth);
}
//
}
}
//
}
}
//
}
String
startDate
=
""
;
String
startDate
=
""
;
...
@@ -776,7 +774,7 @@ public class StatisticsServiceImpl implements StatisticsService {
...
@@ -776,7 +774,7 @@ public class StatisticsServiceImpl implements StatisticsService {
HSSFRow
row0
=
sheet1
.
createRow
(
0
);
HSSFRow
row0
=
sheet1
.
createRow
(
0
);
HSSFCell
row0Cell0
=
row0
.
createCell
(
0
);
HSSFCell
row0Cell0
=
row0
.
createCell
(
0
);
row0Cell0
.
setCellValue
(
"部门:"
+
dept
.
getDeptName
()
+
" 时间:"
+
statisticsStart
+
"-"
+
statisticsEnd
);
row0Cell0
.
setCellValue
(
"部门:"
+
dept
.
getDeptName
()
+
" 时间:"
+
statisticsStart
+
"-"
+
statisticsEnd
);
row0
.
setHeight
((
short
)
500
);
// 获取合计,写入项目名称和正常工时加班工时表头,除开请假和调休,这两种类型没有正常和加班之分
// 获取合计,写入项目名称和正常工时加班工时表头,除开请假和调休,这两种类型没有正常和加班之分
UserWorkTimeStatisticsByProject
userWorkTimeStatisticsByProject
=
userWorkTimeStatisticsReport
.
get
(
userWorkTimeStatisticsReport
.
size
()
-
1
);
UserWorkTimeStatisticsByProject
userWorkTimeStatisticsByProject
=
userWorkTimeStatisticsReport
.
get
(
userWorkTimeStatisticsReport
.
size
()
-
1
);
...
@@ -932,11 +930,11 @@ public class StatisticsServiceImpl implements StatisticsService {
...
@@ -932,11 +930,11 @@ public class StatisticsServiceImpl implements StatisticsService {
}
}
sheet1
.
getRow
(
0
).
getCell
(
0
).
setCellStyle
(
ordinaryCellStyle1
);
sheet1
.
getRow
(
0
).
getCell
(
0
).
setCellStyle
(
ordinaryCellStyle1
);
// 设置姓名\单位(小时)单元格
德
样式,左对齐
// 设置姓名\单位(小时)单元格
的
样式,左对齐
HSSFCellStyle
ordinaryCellStyle3
=
this
.
createOrdinaryCellStyle
(
sheets
);
HSSFCellStyle
ordinaryCellStyle3
=
this
.
createOrdinaryCellStyle
(
sheets
);
ordinaryCellStyle3
.
setAlignment
(
HorizontalAlignment
.
LEFT
);
ordinaryCellStyle3
.
setAlignment
(
HorizontalAlignment
.
LEFT
);
row_1Cell2
.
setCellStyle
(
ordinaryCellStyle3
);
row_1Cell2
.
setCellStyle
(
ordinaryCellStyle3
);
sheet1
.
setZoom
(
8
,
5
);
this
.
closeSheets
(
sheets
);
this
.
closeSheets
(
sheets
);
return
sheets
;
return
sheets
;
}
}
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/StatisticsController.java
View file @
34b9ba79
...
@@ -102,9 +102,8 @@ public class StatisticsController extends BaseController {
...
@@ -102,9 +102,8 @@ public class StatisticsController extends BaseController {
String
deptName
=
sheets
.
getSheet
(
"Sheet1"
).
getRow
(
1
).
getCell
(
1
).
getStringCellValue
();
String
deptName
=
sheets
.
getSheet
(
"Sheet1"
).
getRow
(
1
).
getCell
(
1
).
getStringCellValue
();
// 文件名
// 文件名
String
fileName
=
deptName
+
"-"
+
param
.
getYear
()
+
"年"
+
param
.
getMonth
()
+
"月工时汇总"
;
String
fileName
=
deptName
+
"-"
+
param
.
getYear
()
+
"年"
+
param
.
getMonth
()
+
"月工时汇总"
;
this
.
downExcel
(
response
,
sheets
,
fileName
);
this
.
downExcel
(
response
,
sheets
,
fileName
);
}
finally
{
}
finally
{
try
{
try
{
sheets
.
close
();
sheets
.
close
();
...
...
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