Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jz-dmp-service
Project
Project
Details
Activity
Releases
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
姚本章
jz-dmp-service
Commits
17937e6b
Commit
17937e6b
authored
Jan 11, 2021
by
sml
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页运行任务统计+获取非项目成员所有用户接口
parent
330d5784
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
174 additions
and
0 deletions
+174
-0
ProjectFlowsMapper.java
src/main/java/com/jz/dmp/azkaban/dao/ProjectFlowsMapper.java
+13
-0
DmpProjectController.java
...a/com/jz/dmp/modules/controller/DmpProjectController.java
+20
-0
IndexProjAzkabanStatuDto.java
...dmp/modules/controller/bean/IndexProjAzkabanStatuDto.java
+56
-0
DmpMemberController.java
...om/jz/dmp/modules/controller/sys/DmpMemberController.java
+24
-0
DmpMemberRequest.java
.../jz/dmp/modules/controller/sys/bean/DmpMemberRequest.java
+11
-0
DmpProjectService.java
...in/java/com/jz/dmp/modules/service/DmpProjectService.java
+11
-0
DmpProjectServiceImpl.java
...om/jz/dmp/modules/service/impl/DmpProjectServiceImpl.java
+20
-0
DmpMemberServiceImpl.java
...jz/dmp/modules/service/sys/impl/DmpMemberServiceImpl.java
+4
-0
ProjectFlowsMapper.xml
src/main/resources/azkabanmapper/ProjectFlowsMapper.xml
+11
-0
DmpMemberMapper.xml
src/main/resources/mapper/sys/DmpMemberMapper.xml
+4
-0
No files found.
src/main/java/com/jz/dmp/azkaban/dao/ProjectFlowsMapper.java
View file @
17937e6b
...
...
@@ -3,8 +3,11 @@ package com.jz.dmp.azkaban.dao;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.ibatis.annotations.Param
;
import
com.jz.dmp.azkaban.entity.ProjectFlows
;
import
com.jz.dmp.modules.controller.azkaban.bean.ProjectFlowsDto
;
import
com.jz.dmp.modules.controller.bean.IndexProjAzkabanStatuDto
;
/** mapper
* @author ybz
...
...
@@ -94,5 +97,15 @@ public interface ProjectFlowsMapper {
* @throws Exception
*/
public
void
insertBatch
(
List
<
ProjectFlows
>
projectFlowss
)
throws
Exception
;
/**
* @Title: projAzkabanStatu
* @Description: TODO(统计任务运行状况)
* @param @return
* @param @throws Exception 参数
* @return IndexProjAzkabanStatuDto 返回类型
* @throws
*/
public
IndexProjAzkabanStatuDto
projAzkabanStatu
(
@Param
(
"projectName"
)
String
projectName
)
throws
Exception
;
}
src/main/java/com/jz/dmp/modules/controller/DmpProjectController.java
View file @
17937e6b
...
...
@@ -15,6 +15,7 @@ import com.jz.common.bean.PageInfoResponse;
import
com.jz.common.constant.StatuConstant
;
import
com.jz.dmp.modules.controller.bean.DmpProjectDto
;
import
com.jz.dmp.modules.controller.bean.DmpProjectRequest
;
import
com.jz.dmp.modules.controller.bean.IndexProjAzkabanStatuDto
;
import
com.jz.dmp.modules.model.DmpProject
;
import
com.jz.dmp.modules.service.DmpProjectService
;
...
...
@@ -93,4 +94,23 @@ public class DmpProjectController {
return
baseBeanResponse
;
}
/**首页个人工作台项目运行统计
* @param dmpProjectRequest
* @return
*/
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/projAzkabanStatu"
)
@ApiOperation
(
value
=
"首页个人工作台项目运行统计"
,
notes
=
"首页个人工作台项目运行统计"
)
public
BaseBeanResponse
<
IndexProjAzkabanStatuDto
>
projAzkabanStatu
(
@RequestParam
(
name
=
"projectId"
,
required
=
true
)
Integer
projectId
,
HttpServletRequest
httpRequest
){
BaseBeanResponse
<
IndexProjAzkabanStatuDto
>
baseBeanResponse
=
new
BaseBeanResponse
<
IndexProjAzkabanStatuDto
>();
try
{
baseBeanResponse
=
dmpProjectService
.
projAzkabanStatu
(
projectId
,
httpRequest
);
}
catch
(
Exception
e
)
{
baseBeanResponse
.
setMessage
(
"项目运行统计失败"
);
baseBeanResponse
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
e
.
printStackTrace
();
}
return
baseBeanResponse
;
}
}
src/main/java/com/jz/dmp/modules/controller/bean/IndexProjAzkabanStatuDto.java
0 → 100644
View file @
17937e6b
package
com
.
jz
.
dmp
.
modules
.
controller
.
bean
;
import
java.io.Serializable
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* @ClassName: IndexProjAzkabanStatuDto
* @Description: TODO(工作台项目运行统计)
* @author ybz
* @date 2021年1月11日
*
*/
@ApiModel
(
value
=
"工作台项目运行统计封装"
,
description
=
"工作台项目运行统计封装"
)
public
class
IndexProjAzkabanStatuDto
implements
Serializable
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"未运行任务数"
)
private
Integer
unRunCount
;
@ApiModelProperty
(
value
=
"运行失败数"
)
private
Integer
failCount
;
@ApiModelProperty
(
value
=
"运行成功数"
)
private
Integer
successCount
;
public
Integer
getUnRunCount
()
{
return
unRunCount
;
}
public
void
setUnRunCount
(
Integer
unRunCount
)
{
this
.
unRunCount
=
unRunCount
;
}
public
Integer
getFailCount
()
{
return
failCount
;
}
public
void
setFailCount
(
Integer
failCount
)
{
this
.
failCount
=
failCount
;
}
public
Integer
getSuccessCount
()
{
return
successCount
;
}
public
void
setSuccessCount
(
Integer
successCount
)
{
this
.
successCount
=
successCount
;
}
}
src/main/java/com/jz/dmp/modules/controller/sys/DmpMemberController.java
View file @
17937e6b
...
...
@@ -214,4 +214,28 @@ public class DmpMemberController {
return
baseBeanResponse
;
}
/**获取项目下不是成员的所有用户
* @param dmpMemberRequest
* @return
*/
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/findListUnChoose"
)
@ApiOperation
(
value
=
"获取项目下不是成员的所有用户"
,
notes
=
"获取项目下不是成员的所有用户"
)
@ApiImplicitParam
(
name
=
"projectId"
,
value
=
"项目主键"
)
public
BaseBeanResponse
<
DmpMemberDto
>
findListUnChoose
(
@RequestParam
(
name
=
"projectId"
,
required
=
true
)
Integer
projectId
,
HttpServletRequest
httpRequest
){
//封装参数
DmpMemberRequest
dmpMemberRequest
=
new
DmpMemberRequest
();
dmpMemberRequest
.
setUnChooseProjId
(
projectId
);
BaseBeanResponse
<
DmpMemberDto
>
baseBeanResponse
=
new
BaseBeanResponse
<
DmpMemberDto
>();
try
{
baseBeanResponse
=
dmpMemberService
.
findList
(
dmpMemberRequest
,
httpRequest
);
}
catch
(
Exception
e
)
{
baseBeanResponse
.
setMessage
(
"查询失败"
);
baseBeanResponse
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
e
.
printStackTrace
();
}
return
baseBeanResponse
;
}
}
src/main/java/com/jz/dmp/modules/controller/sys/bean/DmpMemberRequest.java
View file @
17937e6b
...
...
@@ -126,6 +126,9 @@ public class DmpMemberRequest extends BasePageBean {
@ApiModelProperty
(
value
=
"项目主键"
)
private
Integer
projectId
;
@ApiModelProperty
(
value
=
"非该项目主键"
)
//过滤已经是该项目的用户
private
Integer
unChooseProjId
;
public
Integer
getUserId
()
{
return
userId
;
...
...
@@ -286,5 +289,13 @@ public class DmpMemberRequest extends BasePageBean {
public
void
setProjectId
(
Integer
projectId
)
{
this
.
projectId
=
projectId
;
}
public
Integer
getUnChooseProjId
()
{
return
unChooseProjId
;
}
public
void
setUnChooseProjId
(
Integer
unChooseProjId
)
{
this
.
unChooseProjId
=
unChooseProjId
;
}
}
src/main/java/com/jz/dmp/modules/service/DmpProjectService.java
View file @
17937e6b
...
...
@@ -8,6 +8,7 @@ import com.jz.common.bean.PageInfoResponse;
import
com.jz.dmp.modules.controller.bean.DmpProjectBatch
;
import
com.jz.dmp.modules.controller.bean.DmpProjectDto
;
import
com.jz.dmp.modules.controller.bean.DmpProjectRequest
;
import
com.jz.dmp.modules.controller.bean.IndexProjAzkabanStatuDto
;
import
com.jz.dmp.modules.model.DmpProject
;
...
...
@@ -42,5 +43,15 @@ public interface DmpProjectService {
*/
public
BaseBeanResponse
<
DmpProject
>
add
(
DmpProject
dmpProject
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**
* @Title: projAzkabanStatu
* @Description: TODO(统计azkaban任务运行情况)
* @param @param httpRequest
* @param @return 参数
* @return BaseBeanResponse<IndexProjAzkabanStatuDto> 返回类型
* @throws
*/
public
BaseBeanResponse
<
IndexProjAzkabanStatuDto
>
projAzkabanStatu
(
Integer
projectId
,
HttpServletRequest
httpRequest
)
throws
Exception
;
}
src/main/java/com/jz/dmp/modules/service/impl/DmpProjectServiceImpl.java
View file @
17937e6b
...
...
@@ -22,8 +22,10 @@ import com.jz.common.bean.PageInfoResponse;
import
com.jz.common.constant.StatuConstant
;
import
com.jz.common.persistence.BaseService
;
import
com.jz.common.utils.web.SessionUtils
;
import
com.jz.dmp.azkaban.dao.ProjectFlowsMapper
;
import
com.jz.dmp.modules.controller.bean.DmpProjectDto
;
import
com.jz.dmp.modules.controller.bean.DmpProjectRequest
;
import
com.jz.dmp.modules.controller.bean.IndexProjAzkabanStatuDto
;
import
com.jz.dmp.modules.controller.bean.MyDmpProjectConverter
;
import
com.jz.dmp.modules.dao.DmpProjectDao
;
import
com.jz.dmp.modules.model.DmpMember
;
...
...
@@ -43,6 +45,9 @@ public class DmpProjectServiceImpl extends BaseService implements DmpProjectServ
@Autowired
private
DmpProjectDao
dmpProjectDao
;
@Autowired
private
ProjectFlowsMapper
projectFlowsMapper
;
/* (non-Javadoc)
* @see com.ycxc.vmts.service.DmpProjectService#findList(com.ycxc.vmts.controller.bean.DmpProjectRequest, javax.servlet.http.HttpServletRequest)
*/
...
...
@@ -217,5 +222,20 @@ public class DmpProjectServiceImpl extends BaseService implements DmpProjectServ
return
baseBeanResponse
;
}
/**
*统计任务运行状况
*/
@Override
public
BaseBeanResponse
<
IndexProjAzkabanStatuDto
>
projAzkabanStatu
(
Integer
projectId
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
IndexProjAzkabanStatuDto
>
baseBeanResponse
=
new
BaseBeanResponse
<
IndexProjAzkabanStatuDto
>();
String
projectName
=
"jz_workflow_"
+
projectId
;
IndexProjAzkabanStatuDto
dto
=
projectFlowsMapper
.
projAzkabanStatu
(
projectName
);
baseBeanResponse
.
setCode
(
StatuConstant
.
CODE_SUCCESS
);
baseBeanResponse
.
setMessage
(
"统计成功"
);
baseBeanResponse
.
setData
(
dto
);
return
baseBeanResponse
;
}
}
src/main/java/com/jz/dmp/modules/service/sys/impl/DmpMemberServiceImpl.java
View file @
17937e6b
...
...
@@ -257,6 +257,10 @@ public class DmpMemberServiceImpl extends BaseService implements DmpMemberServic
if
(
dmpMemberRequest
.
getUpdateTimeEnd
()
!=
null
)
{
param
.
put
(
"updateTimeEnd"
,
dmpMemberRequest
.
getUpdateTimeEnd
());
}
// 项目主键(用户过滤该项目下的成员)
if
(
dmpMemberRequest
.
getUnChooseProjId
()
!=
null
)
{
param
.
put
(
"unChooseProjId"
,
dmpMemberRequest
.
getUnChooseProjId
());
}
List
<
DmpMemberDto
>
list
=
dmpMemberMapper
.
findList
(
param
);
...
...
src/main/resources/azkabanmapper/ProjectFlowsMapper.xml
View file @
17937e6b
...
...
@@ -249,5 +249,16 @@
where project_id = #{projectId,jdbcType=INTEGER}
AND data_status='1'
</select>
<!-- 统计任务运行状况 -->
<select
id=
"projAzkabanStatu"
resultType=
"com.jz.dmp.modules.controller.bean.IndexProjAzkabanStatuDto"
>
select
COUNT(CASE WHEN execFlows.exec_id is NULL THEN 1 ELSE NULL END) AS unRunCount,
COUNT(CASE WHEN execFlows.`status`='70' THEN 1 ELSE NULL END) AS failCount,
COUNT(CASE WHEN execFlows.`status`='50' THEN 1 ELSE NULL END) AS successCount
from project_flows flows left join execution_flows execFlows on flows.flow_id=execFlows.flow_id AND flows.project_id=execFlows.project_id
left join projects projects on flows.project_id=projects.id
where projects.`name`=#{projectName, jdbcType=VARCHAR};
</select>
</mapper>
src/main/resources/mapper/sys/DmpMemberMapper.xml
View file @
17937e6b
...
...
@@ -337,6 +337,10 @@
<if
test=
"projectId != null"
>
AND mprole.project_id = #{projectId,jdbcType=INTEGER}
</if>
<if
test=
"unChooseProjId != null"
>
AND mprole.project_id
<![CDATA[<>]]>
#{unChooseProjId,jdbcType=INTEGER}
OR mprole.project_id is null
</if>
AND m.data_status='1'
</where>
</select>
...
...
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