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
58170ac7
Commit
58170ac7
authored
Mar 06, 2021
by
nie'hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善项目工时统计
parent
1898c2b4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
138 additions
and
21 deletions
+138
-21
WorkProjectMapper.java
.../src/main/java/cn/wisenergy/mapper/WorkProjectMapper.java
+7
-0
WorkProjectMapper.xml
...gy-mapper/src/main/resources/mapper/WorkProjectMapper.xml
+26
-1
StatisticsServiceImpl.java
...java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
+104
-19
AutoStatistics.java
...ain/java/cn/wisenergy/web/config/auto/AutoStatistics.java
+1
-1
No files found.
wisenergy-mapper/src/main/java/cn/wisenergy/mapper/WorkProjectMapper.java
View file @
58170ac7
...
...
@@ -55,4 +55,11 @@ public interface WorkProjectMapper extends BaseMapper<WorkProject> {
List
<
Integer
>
getProjectIdByManager
(
Integer
userId
);
List
<
WorkProject
>
getListByCentreIdAndIsConclusion
(
@Param
(
"centreId"
)
Integer
centreId
,
@Param
(
"isConclusion"
)
Integer
isConclusion
);
/**
* 如果项目为已结项,返回最后一次统计时间的年月。为未结项,返回当前年月
* @param projectId
* @return
*/
String
getLastDate
(
Integer
projectId
);
}
wisenergy-mapper/src/main/resources/mapper/WorkProjectMapper.xml
View file @
58170ac7
...
...
@@ -191,7 +191,18 @@
from
<include
refid=
"table"
/>
<where>
<include
refid=
"criteria"
/>
<if
test=
"isConclusion != null"
>
AND is_conclusion = #{isConclusion}
</if>
<if
test=
"deptId != null and managerId == null"
>
AND dept_id = #{deptId}
</if>
<if
test=
"deptId != null and managerId != null"
>
AND (dept_id = #{deptId} OR manager_id = #{managerId})
</if>
<if
test=
"managerId != null and deptId == null"
>
AND manager_id = #{managerId}
</if>
</where>
</select>
...
...
@@ -212,5 +223,19 @@
</if>
</select>
<select
id=
"getLastDate"
resultType=
"java.lang.String"
>
SELECT
CONCAT(YEAR (IF (is_conclusion = 0,max(work_day),now())),
'年',
MONTH (IF (is_conclusion = 0,max(work_day),now())),
'月'
)
FROM
work_project p
JOIN work_time_order t ON p.id = t.project_id
WHERE
p.id = #{projectId}
</select>
</mapper>
wisenergy-service/src/main/java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
View file @
58170ac7
This diff is collapsed.
Click to expand it.
wisenergy-web-admin/src/main/java/cn/wisenergy/web/config/auto/AutoStatistics.java
View file @
58170ac7
...
...
@@ -26,7 +26,7 @@ public class AutoStatistics {
private
WorkProjectTimeCostMapper
workProjectTimeCostMapper
;
@Transactional
@Scheduled
(
cron
=
"0
0
0 * * ?"
)
@Scheduled
(
cron
=
"0
5
0 * * ?"
)
public
void
autoStatistics
(){
log
.
info
(
"AutoStatistics[]autoStatistics[]自动统计任务"
);
Date
date
=
DateUtil
.
add
(
new
Date
(),
Calendar
.
MONTH
,
-
3
);
...
...
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