Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
indicators
Overview
Overview
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
zhangkb
indicators
Commits
6af4f1a9
Commit
6af4f1a9
authored
Aug 19, 2020
by
hzc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增统计任务状态接口
parent
3491e604
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
95 additions
and
1 deletion
+95
-1
TaskCtrl.java
...java/com/keymobile/indicators/api/hytobacco/TaskCtrl.java
+5
-0
TaskMapper.java
...mobile/indicators/model/mapper/indicators/TaskMapper.java
+11
-0
TaskService.java
...m/keymobile/indicators/service/dataenter/TaskService.java
+6
-1
TaskServiceImpl.java
...le/indicators/service/dataenter/impl/TaskServiceImpl.java
+32
-0
TaskMapper.xml
src/main/resources/mybatis/mapping/TaskMapper.xml
+41
-0
No files found.
src/main/java/com/keymobile/indicators/api/hytobacco/TaskCtrl.java
View file @
6af4f1a9
...
...
@@ -150,5 +150,10 @@ public class TaskCtrl {
}
return
result
;
}
@ApiOperation
(
"任务状态统计"
)
@PostMapping
(
"stateCounts"
)
public
TaskStateCounts
stateCounts
(
@RequestBody
QueryTaskParam
param
){
return
taskService
.
stateCounts
(
param
);
}
}
src/main/java/com/keymobile/indicators/model/mapper/indicators/TaskMapper.java
View file @
6af4f1a9
...
...
@@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Mapper;
import
org.apache.ibatis.annotations.Param
;
import
tk.mybatis.mapper.common.BaseMapper
;
import
java.util.Date
;
import
java.util.List
;
@Mapper
...
...
@@ -71,4 +72,14 @@ public interface TaskMapper extends BaseMapper<Task> {
* @return
*/
Task
getById
(
String
taskId
);
/**
* 审核超时数目
* 填报超时的数目
* **/
Integer
selectAuDateOrEnDateCounts
(
@Param
(
"param"
)
QueryTaskParam
param
,
@Param
(
"auditEndDate"
)
Date
auditEndDate
,
@Param
(
"endDate"
)
Date
endDate
);
/**
* 查询审核过的数目
* **/
Integer
selectAuditCount
(
QueryTaskParam
param
);
}
src/main/java/com/keymobile/indicators/service/dataenter/TaskService.java
View file @
6af4f1a9
...
...
@@ -197,5 +197,10 @@ public interface TaskService {
*/
Result
createTaskByRule
(
Integer
ruleId
,
@ApiParam
(
"收数月份, 格式: 2020-03、2020-06、2020-09、2020-12"
)
String
valueTime
,
boolean
needLast
);
/**
* 查询审核过的数目,
* 审核超时数目
* 填报超时的数目
* **/
TaskStateCounts
stateCounts
(
QueryTaskParam
param
);
}
src/main/java/com/keymobile/indicators/service/dataenter/impl/TaskServiceImpl.java
View file @
6af4f1a9
...
...
@@ -33,6 +33,8 @@ import org.springframework.scheduling.annotation.Async;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
@Service
...
...
@@ -745,6 +747,36 @@ public class TaskServiceImpl implements TaskService {
return
result
;
}
@Override
public
TaskStateCounts
stateCounts
(
QueryTaskParam
param
)
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
String
s
=
sdf
.
format
(
new
Date
());
Date
date
=
null
;
try
{
date
=
sdf
.
parse
(
s
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
TaskStateCounts
taskStateCounts
=
new
TaskStateCounts
();
//查出审核过的数目--大于APPLY_STATE_AUDITING就是审核过了
param
.
setStatus
(
Constants
.
APPLY_STATE_AUDITING
);
Integer
auditCount
=
this
.
taskMapper
.
selectAuditCount
(
param
);
//查出审核超时的数目
param
.
setStatus
(
Constants
.
APPLY_STATE_AUDITING
);
Integer
auditTimeoutCount
=
this
.
taskMapper
.
selectAuDateOrEnDateCounts
(
param
,
date
,
null
);
//查出填报超时的数目
param
.
setStatus
(
Constants
.
APPLY_STATE_DRAFT
);
Integer
addTimeoutCount
=
this
.
taskMapper
.
selectAuDateOrEnDateCounts
(
param
,
null
,
date
);
taskStateCounts
.
setAuditCount
(
auditCount
);
taskStateCounts
.
setAddTimeoutCount
(
addTimeoutCount
);
taskStateCounts
.
setAuditTimeoutCount
(
auditTimeoutCount
);
return
taskStateCounts
;
}
/**
* 获取关联的数据项和子数据项
* @param ruleId
...
...
src/main/resources/mybatis/mapping/TaskMapper.xml
View file @
6af4f1a9
...
...
@@ -108,4 +108,44 @@
<include
refid=
"findTaskWhereSql"
></include>
group by status
</select>
<select
id=
"selectAuDateOrEnDateCounts"
resultType=
"java.lang.Integer"
>
select count(id) from data_enter_task
where state = 1
<if
test=
"param.ruleLevel != null and param.ruleLevel !=''"
>
and rule_level = #{param.ruleLevel}
</if>
<if
test=
"param.status != null and param.status !=''"
>
and status = #{param.status}
</if>
<if
test=
"param.keyword != null and param.keyword !=''"
>
and rule_name like concat('%', #{param.keyword}, '%')
</if>
<if
test=
"endDate != null"
>
and end_date
<
#{endDate}
</if>
<if
test=
"auditEndDate != null"
>
and audit_end_date
<
#{auditEndDate}
</if>
</select>
<select
id=
"selectAuditCount"
resultType=
"java.lang.Integer"
>
select count(id) from data_enter_task
where state = 1
<if
test=
"ruleLevel != null and ruleLevel !=''"
>
and rule_level = #{ruleLevel}
</if>
<if
test=
"status != null and status !=''"
>
and status > #{status}
</if>
<if
test=
"keyword != null and keyword !=''"
>
and rule_name like concat('%', #{keyword}, '%')
</if>
</select>
</mapper>
\ No newline at end of file
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