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
86d31ace
Commit
86d31ace
authored
Feb 25, 2021
by
nie'hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善工时统计
parent
0d9a3b77
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
6 deletions
+17
-6
WorkProjectTimeCostMapper.java
...n/java/cn/wisenergy/mapper/WorkProjectTimeCostMapper.java
+7
-0
LevelEnum.java
...del/src/main/java/cn/wisenergy/model/enums/LevelEnum.java
+1
-1
StatisticsServiceImpl.java
...java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
+9
-5
No files found.
wisenergy-mapper/src/main/java/cn/wisenergy/mapper/WorkProjectTimeCostMapper.java
View file @
86d31ace
...
...
@@ -34,6 +34,13 @@ public interface WorkProjectTimeCostMapper {
*/
List
<
ProjectStatisticsByMonth
>
selectListByMonth
(
@Param
(
"year"
)
Integer
year
,
@Param
(
"deptId"
)
Integer
deptId
,
@Param
(
"projectId"
)
Integer
projectId
);
/**
* 部门编号不为空,查询部门下所有项目所有人员统计。部门主键为空时,查询项目下的所有人员的统计
* @param year
* @param deptId
* @param projectId
* @return
*/
List
<
ProjectStatisticsByMonth
>
selectListStatistics
(
@Param
(
"year"
)
Integer
year
,
@Param
(
"deptId"
)
Integer
deptId
,
@Param
(
"projectId"
)
Integer
projectId
);
...
...
wisenergy-model/src/main/java/cn/wisenergy/model/enums/LevelEnum.java
View file @
86d31ace
...
...
@@ -7,7 +7,7 @@ package cn.wisenergy.model.enums;
public
enum
LevelEnum
{
EXAMINE
(
"工时审批"
),
USER_STATISTICS
(
"人员统计报表"
),
PROJECT_STATI
T
STICS
(
"项目统计报表"
),
PROJECT_STATISTICS
(
"项目统计报表"
),
PROJECT_MANAGER
(
"项目/商机管理"
),
TIMEEXPORT
(
"工时导出"
),
SYSTEMSETTINGS
(
"系统设置"
),
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
View file @
86d31ace
...
...
@@ -394,8 +394,6 @@ public class StatisticsServiceImpl implements StatisticsService {
Date
date
=
DateUtil
.
convertStrToDate
(
param
.
getYear
()
+
"-"
+
param
.
getMonth
(),
"yyyy-MM"
);
// 传参的时间当月总天数
int
dayCount
=
DateUtil
.
getMonthDaysArray
(
date
).
length
;
// 当天
Date
today
=
new
Date
();
// 需要导出的信息
List
<
StatisticsTableDto
>
list
=
dayWorkTimeOfMonth
.
getList
();
// 创建工作簿
...
...
@@ -404,6 +402,7 @@ public class StatisticsServiceImpl implements StatisticsService {
HSSFSheet
sheet
=
sheets
.
createSheet
(
"Sheet1"
);
// 普通样式对象
HSSFCellStyle
cellStyle
=
this
.
createOrdinaryCellStyle
(
sheets
);
cellStyle
.
setFillForegroundColor
(
HSSFColor
.
HSSFColorPredefined
.
WHITE
.
getIndex
());
// 节假日样式,底色为绿色,其余样式与普通相同
HSSFCellStyle
cellStyle1
=
this
.
createOrdinaryCellStyle
(
sheets
);
...
...
@@ -513,7 +512,9 @@ public class StatisticsServiceImpl implements StatisticsService {
log
.
info
(
"StatisticsServiceImpl[]getUserWorkTimeStatisticsReport[]"
+
userId
+
deptId
+
startDate
+
endDate
+
isConclusion
);
List
<
Integer
>
role
=
UserRoleLevelUtils
.
getRole
(
userId
);
// 判断是否有该权限
UserRoleLevelUtils
.
isManagerLevel
(
userId
,
LevelEnum
.
PROJECT_STATITSTICS
.
getLevelName
());
if
(!
UserRoleLevelUtils
.
isManagerLevel
(
userId
,
LevelEnum
.
USER_STATISTICS
.
getLevelName
()))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
NO_AUTHORITY
);
}
// 获取用户信息
WorkUser
user
=
workUserService
.
getById
(
userId
);
// 获取用户权限的级别
...
...
@@ -610,14 +611,17 @@ public class StatisticsServiceImpl implements StatisticsService {
public
List
<
ProjectStatisticsByMonth
>
getProjectStatistics
(
Integer
userId
,
Integer
deptId
,
Integer
year
,
Integer
projectId
)
{
log
.
info
(
"StatisticsServiceImpl[]getProjectStatistics[]input.param"
+
userId
+
deptId
+
year
+
projectId
);
// 获取权限
UserRoleLevelUtils
.
isManagerLevel
(
userId
,
LevelEnum
.
PROJECT_STATITSTICS
.
getLevelName
());
if
(!
UserRoleLevelUtils
.
isManagerLevel
(
userId
,
LevelEnum
.
PROJECT_STATISTICS
.
getLevelName
()))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
NO_AUTHORITY
);
}
// 默认查询时间为当前
if
(
year
==
null
)
{
year
=
DateUtil
.
getYear
(
new
Date
());
}
// 部门主键和项目主键不能同时为空
if
(
deptId
==
null
&&
projectId
==
null
)
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
)
;
deptId
=
DEFAULT_DEPT_ID
;
}
// 部门为空,查询某个项目的全周期统计,不为空,查询部门在某年的全部项目按月总计信息
...
...
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