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
1d32b8f2
Commit
1d32b8f2
authored
4 years ago
by
nie'hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善项目统计报表
parent
e289fd64
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
202 additions
and
79 deletions
+202
-79
WorkTimeOrderMapper.java
...rc/main/java/cn/wisenergy/mapper/WorkTimeOrderMapper.java
+1
-1
WorkUserProjectMapper.java
.../main/java/cn/wisenergy/mapper/WorkUserProjectMapper.java
+1
-0
WorkProjectMapper.xml
...gy-mapper/src/main/resources/mapper/WorkProjectMapper.xml
+14
-19
WorkProjectTimeCost.xml
...-mapper/src/main/resources/mapper/WorkProjectTimeCost.xml
+1
-4
WorkTimeOrderMapper.xml
...-mapper/src/main/resources/mapper/WorkTimeOrderMapper.xml
+19
-3
WorkUserProjectMapper.xml
...apper/src/main/resources/mapper/WorkUserProjectMapper.xml
+9
-0
ProjectTypeEnum.java
...c/main/java/cn/wisenergy/model/enums/ProjectTypeEnum.java
+2
-2
StatisticsServiceImpl.java
...java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
+155
-50
No files found.
wisenergy-mapper/src/main/java/cn/wisenergy/mapper/WorkTimeOrderMapper.java
View file @
1d32b8f2
...
...
@@ -93,6 +93,6 @@ public interface WorkTimeOrderMapper extends BaseMapper<WorkTimeOrder> {
/**
* 获取人员项目工时
*/
List
<
UserWorkTimeStatisticsByProject
>
getUserProjectWorkTimeStatistics
(
@Param
(
"startDate"
)
String
startDate
,
@Param
(
"endDate"
)
String
endDate
,
@Param
(
"
status"
)
Integer
status
,
@Param
(
"projectIds"
)
List
<
Integer
>
project
Ids
);
List
<
UserWorkTimeStatisticsByProject
>
getUserProjectWorkTimeStatistics
(
@Param
(
"startDate"
)
String
startDate
,
@Param
(
"endDate"
)
String
endDate
,
@Param
(
"
isConclusion"
)
Integer
isConclusion
,
@Param
(
"projectIds"
)
List
<
Integer
>
projectIds
,
@Param
(
"userIds"
)
List
<
Integer
>
user
Ids
);
}
This diff is collapsed.
Click to expand it.
wisenergy-mapper/src/main/java/cn/wisenergy/mapper/WorkUserProjectMapper.java
View file @
1d32b8f2
...
...
@@ -23,4 +23,5 @@ public interface WorkUserProjectMapper extends BaseMapper<WorkUserProject> {
int
insertBatch
(
@Param
(
"userIds"
)
List
<
Integer
>
userIds
,
@Param
(
"projectId"
)
Integer
projectId
);
List
<
Integer
>
selectUserIdByProjectIds
(
@Param
(
"projectIds"
)
List
<
Integer
>
projectIds
);
}
This diff is collapsed.
Click to expand it.
wisenergy-mapper/src/main/resources/mapper/WorkProjectMapper.xml
View file @
1d32b8f2
...
...
@@ -81,8 +81,11 @@
select
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"table"
/>
<where>
<if
test=
"isConclusion != null"
>
is_conclusion = #{isConclusion}
</if>
<if
test=
"managerId != null"
>
manager_id = #{managerId}
AND
manager_id = #{managerId}
</if>
<if
test=
"deptId != null"
>
OR dept_id = #{deptId}
...
...
@@ -113,15 +116,14 @@
</where>
</select>
<select
id=
"getManagerProjectsDto"
resultType=
"cn.wisenergy.model.dto.ManagerProjectsDto"
>
select p.id,p.oa_project_id,p.project_name,p.type,p.create_time,p.is_conclusion,
GROUP_CONCAT(DISTINCT(u.name)) as 'Participants',p.cost_budget,p.work_time,p.start_time,p.end_time,
ROUND(SUM(o.work_time)/8,2) as 'currentLaborCost',ROUND(SUM(o.work_time),2) as 'totalCurrentWorkingHours',
if(now() BETWEEN p.start_time and p.end_time,'否','是') as 'isItOverdue',
if(p.create_time = p.modify_time,'否','是') as 'isThereABudgetChange'
from work_project p LEFT JOIN work_time_order o on p.id = o.project_id
LEFT JOIN work_user u on p.manager_id = u.id
<where>
select p.id,p.oa_project_id,p.project_name,p.type,p.create_time,p.is_conclusion,
GROUP_CONCAT(DISTINCT(u.name)) as 'Participants',p.cost_budget,p.work_time,p.start_time,p.end_time,
ROUND(SUM(o.work_time)/8,2) as 'currentLaborCost',ROUND(SUM(o.work_time),2) as 'totalCurrentWorkingHours',
if(now() BETWEEN p.start_time and p.end_time,'否','是') as 'isItOverdue',
if(p.create_time = p.modify_time,'否','是') as 'isThereABudgetChange'
from work_project p LEFT JOIN work_time_order o on p.id = o.project_id
LEFT JOIN work_user u on p.manager_id = u.id
<where>
<if
test=
"null != userId"
>
AND p.manager_id = #{userId}
</if>
...
...
@@ -131,21 +133,14 @@ if(p.create_time = p.modify_time,'否','是') as 'isThereABudgetChange'
<if
test=
"null !=isConclusion"
>
AND p.is_conclusion = #{isConclusion}
</if>
<if
test=
"deptIds != null"
>
OR p.dept_id IN
<foreach
collection=
"deptIds"
item=
"deptId"
separator=
","
open=
"("
close=
")"
>
#{deptId}
</foreach>
</if>
</where>
GROUP BY p.id
</where>
GROUP BY p.id
</select>
...
...
This diff is collapsed.
Click to expand it.
wisenergy-mapper/src/main/resources/mapper/WorkProjectTimeCost.xml
View file @
1d32b8f2
...
...
@@ -112,10 +112,7 @@
<select
id=
"selectListByMonth"
resultMap=
"projectStatisticsByMonth"
>
select ptc.project_id AS project_id, project_name,
IF ( GROUP_CONCAT(DISTINCT MONTH (statistics_start)) = 1,
group_CONCAT(DISTINCT YEAR (statistics_start),'年',MONTH (statistics_start),'月'),
group_CONCAT(DISTINCT MONTH (statistics_start),'月')
) AS date,
group_CONCAT(DISTINCT YEAR (statistics_start),'年',MONTH (statistics_start),'月') AS date,
sum(total_time) AS total_time, sum(cost) AS cost
from work_project_time_cost ptc join work_project p on ptc.project_id = p.id
<where>
...
...
This diff is collapsed.
Click to expand it.
wisenergy-mapper/src/main/resources/mapper/WorkTimeOrderMapper.xml
View file @
1d32b8f2
...
...
@@ -298,13 +298,16 @@
SELECT u.id AS user_id ,u.`name` AS user_name, t.project_id AS project_id
,case t.type when 1 then '项目' when 2 then '商机' when 5 then '外部商务/技术交流' when 6 then '内部培训/技术准备/管理' when 7 then '其他非项目/商机工作' end AS project_type
,p.project_name AS project_name, case t.is_overtime when 1 then '加班' ELSE '正常' end AS is_overtime,SUM(t.work_time) AS work_time
from work_time_order t join work_project p on t.project_id = p.id join work_user u on t.user_id = u.id
from work_time_order t
left
join work_project p on t.project_id = p.id join work_user u on t.user_id = u.id
where
t.work_day
<
#{endDate}
t.status in (2,5) AND
t.work_day
<
= #{endDate}
<if
test=
"isConclusion != null"
>
AND p.is_conclusion = #{isConclusion}
</if>
<if
test=
"startDate != null"
>
AND t.work_day > #{startDate}
</if>
AND p.is_conclusion=#{status} AND t.type not in(3,4)
<if
test=
"projectIds != null"
>
AND project_id in
<foreach
collection=
"projectIds"
item=
"projectId"
open=
"("
close=
")"
separator=
","
>
...
...
@@ -312,5 +315,18 @@
</foreach>
</if>
GROUP BY u.id,u.`name`,t.project_id,t.type,p.project_name, t.is_overtime
<if
test=
"userIds != null"
>
UNION
SELECT u.id AS user_id ,u.`name` AS user_name, t.project_id AS project_id
,case t.type when 1 then '项目' when 2 then '商机' when 5 then '外部商务/技术交流' when 6 then '内部培训/技术准备/管理' when 7 then '其他非项目/商机工作' end AS project_type
,p.project_name AS project_name, case t.is_overtime when 1 then '加班' ELSE '正常' end AS is_overtime,SUM(t.work_time) AS work_time
from work_time_order t left join work_project p on t.project_id = p.id join work_user u on t.user_id = u.id
where
t.status in (2,5) AND t.type in(5,6,7) AND t.user_id in
<foreach
collection=
"userIds"
item=
"userId"
separator=
","
open=
"("
close=
")"
>
#{userId}
</foreach>
GROUP BY u.id,u.`name`,t.project_id,t.type,p.project_name, t.is_overtime
</if>
</select>
</mapper>
This diff is collapsed.
Click to expand it.
wisenergy-mapper/src/main/resources/mapper/WorkUserProjectMapper.xml
View file @
1d32b8f2
...
...
@@ -38,4 +38,13 @@
WHERE project_id = #{projectId}
</select>
<select
id=
"selectUserIdByProjectIds"
resultType=
"java.lang.Integer"
>
select user_id
from work_user_project
where project_id in
<foreach
collection=
"projectIds"
item=
"projectId"
open=
"("
close=
")"
separator=
","
>
#{projectId}
</foreach>
</select>
</mapper>
This diff is collapsed.
Click to expand it.
wisenergy-model/src/main/java/cn/wisenergy/model/enums/ProjectTypeEnum.java
View file @
1d32b8f2
...
...
@@ -5,8 +5,8 @@ public enum ProjectTypeEnum {
BUSINESS_OPPORTUNITY
(
2
,
"商机"
,
1
),
LEAVE
(
3
,
"请假"
,
2
),
COMPENSATORY_LEAVE
(
4
,
"调休"
,
2
),
EXTERNAL_BUSINESS
(
5
,
"外部商务
、
技术交流"
,
3
),
INTERNAL_TRAINING
(
6
,
"内部培训
、技术准备、
管理"
,
3
),
EXTERNAL_BUSINESS
(
5
,
"外部商务
/
技术交流"
,
3
),
INTERNAL_TRAINING
(
6
,
"内部培训
/技术准备/
管理"
,
3
),
OTHER_NON_PROJECTS
(
7
,
"其他非项目/商机工作"
,
3
),
;
...
...
This diff is collapsed.
Click to expand it.
wisenergy-service/src/main/java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
View file @
1d32b8f2
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