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
e289fd64
Commit
e289fd64
authored
4 years ago
by
nie'hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
人员工时统计报表,项目统计报表
parent
02912147
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
146 additions
and
62 deletions
+146
-62
BASE_RESP_CODE_ENUM.java
...wisenergy/common/utils/exception/BASE_RESP_CODE_ENUM.java
+1
-0
WorkProjectMapper.xml
...gy-mapper/src/main/resources/mapper/WorkProjectMapper.xml
+3
-2
WorkProjectTimeCost.xml
...-mapper/src/main/resources/mapper/WorkProjectTimeCost.xml
+6
-6
WorkUserRoleMapper.xml
...y-mapper/src/main/resources/mapper/WorkUserRoleMapper.xml
+1
-0
StatisticsService.java
...src/main/java/cn/wisenergy/service/StatisticsService.java
+4
-3
StatisticsServiceImpl.java
...java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
+123
-44
WorkProjectServiceImpl.java
...ava/cn/wisenergy/service/impl/WorkProjectServiceImpl.java
+8
-6
StatisticsController.java
...energy/web/admin/controller/app/StatisticsController.java
+0
-1
No files found.
wisenergy-common/src/main/java/cn/wisenergy/common/utils/exception/BASE_RESP_CODE_ENUM.java
View file @
e289fd64
...
...
@@ -76,6 +76,7 @@ public enum BASE_RESP_CODE_ENUM {
REPEAT_WITH_OLDTIME
(
"654"
,
"日期与旧时间冲突"
),
BUDGET_CANNOT_BELESSTHAN_ZERO
(
"655"
,
"预算不能小于0"
),
ITEMOADUPLICATE
(
"656"
,
"项目OA重复"
),
NO_AUTHORITY
(
"657"
,
"暂无该权限"
)
;
...
...
This diff is collapsed.
Click to expand it.
wisenergy-mapper/src/main/resources/mapper/WorkProjectMapper.xml
View file @
e289fd64
...
...
@@ -81,10 +81,10 @@
select
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"table"
/>
<where>
<if
test=
"manager
_i
d != null"
>
<if
test=
"manager
I
d != null"
>
manager_id = #{managerId}
</if>
<if
test=
"dept
_i
d != null"
>
<if
test=
"dept
I
d != null"
>
OR dept_id = #{deptId}
</if>
<if
test=
"deptIds != null"
>
...
...
@@ -95,6 +95,7 @@
</if>
</where>
</select>
<select
id=
"getProjectsByIds"
resultType=
"cn.wisenergy.model.app.WorkProject"
>
select
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"table"
/>
...
...
This diff is collapsed.
Click to expand it.
wisenergy-mapper/src/main/resources/mapper/WorkProjectTimeCost.xml
View file @
e289fd64
...
...
@@ -50,20 +50,20 @@
INSERT INTO work_project_time_cost (
project_id,
user_id,
is_overtime,
statistics_start,
statistics_end,
total_time,
cost
cost,
create_time
)
SELECT
project_id,
t.user_id,
is_overtime,
min(work_day),
max(work_day),
sum(work_time / 8),
sum(work_time / 8 * s.day_salary)
sum(work_time / 8 * s.day_salary),
now() AS create_time
FROM
work_time_order t
JOIN work_user_salary s ON t.user_id = s.user_id
...
...
@@ -76,8 +76,8 @@
is_overtime,
YEAR (work_day),
MONTH (work_day)
ON DUPLICATE KEY UPDATE
is_over
time =
VALUES(
is_over
time),
ON DUPLICATE KEY UPDATE
create_
time =
VALUES(
create_
time),
statistics_end =
VALUES(statistics_end),
total_time =
...
...
This diff is collapsed.
Click to expand it.
wisenergy-mapper/src/main/resources/mapper/WorkUserRoleMapper.xml
View file @
e289fd64
...
...
@@ -23,6 +23,7 @@
FROM work_user_role
WHERE user_id = #{userId}
</select>
<select
id=
"getRoleUserLevel"
resultType=
"cn.wisenergy.model.dto.UserRoleLevelDto"
>
select ur.user_id as 'user_id',r.id as 'role_id',l.name as 'level_name',l.rank as 'rank'
from work_user_role ur join work_role r on ur.role_id = r.id
...
...
This diff is collapsed.
Click to expand it.
wisenergy-service/src/main/java/cn/wisenergy/service/StatisticsService.java
View file @
e289fd64
...
...
@@ -28,7 +28,7 @@ public interface StatisticsService {
List
<
Object
>
getMonthlyStatistics
(
Integer
userId
);
/**
* 获取负责项目
在本月
的工时汇总:花费工时,工时成本
* 获取负责项目的工时汇总:花费工时,工时成本
*
* @param userId
*/
...
...
@@ -44,7 +44,7 @@ public interface StatisticsService {
HSSFWorkbook
exportWorkTimeExcel
(
GetMonthlyCollectParam
param
);
/**
* 获取用户
所在未结项目的
工时统计
* 获取用户
管理项目人员
工时统计
*
* @param startDate
* @param endDate
...
...
@@ -58,7 +58,8 @@ public interface StatisticsService {
*
* @param userId
* @param deptId
* @param date
* @param year
* @param projectId
* @return
*/
List
<
ProjectStatisticsByMonth
>
getProjectStatistics
(
Integer
userId
,
Integer
deptId
,
Integer
year
,
Integer
projectId
);
...
...
This diff is collapsed.
Click to expand it.
wisenergy-service/src/main/java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
View file @
e289fd64
This diff is collapsed.
Click to expand it.
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkProjectServiceImpl.java
View file @
e289fd64
...
...
@@ -66,7 +66,7 @@ public class WorkProjectServiceImpl implements WorkProjectService {
private
WorkProjectChangeService
workProjectChangeService
;
@Autowired
private
WorkUserDeptService
workUserDeptService
;
private
UserRoleLevelUtils
userRoleLevelUtils
;
/**
* 功能:根据项目id获取项目
...
...
@@ -145,8 +145,9 @@ public class WorkProjectServiceImpl implements WorkProjectService {
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
}
WorkUser
user
=
workUserService
.
getById
(
userId
);
List
<
Integer
>
role
=
userRoleLevelUtils
.
getRole
(
user
.
getId
());
//普通用户
if
(
user
.
getLevel
().
equals
(
ManagerEnum
.
NOT_MANAGER
))
{
if
(
role
.
contains
(
ManagerEnum
.
NOT_MANAGER
.
getCode
()
))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
THE_USER_NOT_MANAGER_PLASE_MANAGER_LOGIN
);
}
//存放项目列表
...
...
@@ -154,14 +155,15 @@ public class WorkProjectServiceImpl implements WorkProjectService {
//存放查询条件
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
// 查询项目表中管理为用户的项目集合,
用户为项目经理,但level可能不为1
map
.
put
(
"managerId"
,
userId
);
// 查询项目表中管理为用户的项目集合,
map
.
put
(
"managerId"
,
userId
);
//用户是部门级别,查询该部门下的所有项目
if
(
user
.
getLevel
().
equals
(
ManagerEnum
.
IS_DEPARTMENT_DIRECTOR
.
getCode
()))
{
if
(
role
.
contains
(
ManagerEnum
.
IS_DEPARTMENT_DIRECTOR
.
getCode
()))
{
map
.
remove
(
"managerId"
);
map
.
put
(
"deptId"
,
user
.
getDeptId
());
}
//中心级别的用户查看中心下所有部门的所有项目
if
(
user
.
getLevel
().
equal
s
(
ManagerEnum
.
IS_CENTRE_DIRECTOR
.
getCode
()))
{
if
(
role
.
contain
s
(
ManagerEnum
.
IS_CENTRE_DIRECTOR
.
getCode
()))
{
//获取中心信息
WorkCentre
workCentre
=
workCentreMapper
.
getByManagerId
(
user
.
getId
());
if
(
workCentre
==
null
)
{
...
...
This diff is collapsed.
Click to expand it.
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/StatisticsController.java
View file @
e289fd64
...
...
@@ -128,5 +128,4 @@ public class StatisticsController extends BaseController {
return
getResult
(
projectStatisticsByMonths
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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