Browse Source

Merge pull request #276 from qiaozhanwei/branch-1.0.2

project process define count and process instance running count
pull/2/head
乔占卫 6 years ago committed by GitHub
parent
commit
d01a8b0e39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProjectMapper.java
  2. 6
      escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProjectMapperProvider.java
  3. 26
      escheduler-dao/src/main/java/cn/escheduler/dao/model/Project.java
  4. 12
      escheduler-ui/src/js/conf/home/pages/projects/pages/list/_source/list.vue
  5. 2
      escheduler-ui/src/js/module/i18n/locale/en_US.js
  6. 2
      escheduler-ui/src/js/module/i18n/locale/zh_CN.js

4
escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProjectMapper.java

@ -115,6 +115,8 @@ public interface ProjectMapper {
@Result(property = "perm", column = "perm", javaType = Integer.class, jdbcType = JdbcType.INTEGER), @Result(property = "perm", column = "perm", javaType = Integer.class, jdbcType = JdbcType.INTEGER),
@Result(property = "createTime", column = "create_time", javaType = Timestamp.class, jdbcType = JdbcType.DATE), @Result(property = "createTime", column = "create_time", javaType = Timestamp.class, jdbcType = JdbcType.DATE),
@Result(property = "updateTime", column = "update_time", javaType = Timestamp.class, jdbcType = JdbcType.DATE), @Result(property = "updateTime", column = "update_time", javaType = Timestamp.class, jdbcType = JdbcType.DATE),
@Result(property = "defCount", column = "def_count", javaType = Integer.class, jdbcType = JdbcType.INTEGER),
@Result(property = "instRunningCount", column = "inst_running_count", javaType = Integer.class, jdbcType = JdbcType.INTEGER),
}) })
@SelectProvider(type = ProjectMapperProvider.class, method = "queryProjectListPaging") @SelectProvider(type = ProjectMapperProvider.class, method = "queryProjectListPaging")
List<Project> queryProjectListPaging(@Param("userId") Integer userId, List<Project> queryProjectListPaging(@Param("userId") Integer userId,
@ -145,6 +147,8 @@ public interface ProjectMapper {
@Result(property = "perm", column = "perm", javaType = Integer.class, jdbcType = JdbcType.INTEGER), @Result(property = "perm", column = "perm", javaType = Integer.class, jdbcType = JdbcType.INTEGER),
@Result(property = "createTime", column = "create_time", javaType = Timestamp.class, jdbcType = JdbcType.DATE), @Result(property = "createTime", column = "create_time", javaType = Timestamp.class, jdbcType = JdbcType.DATE),
@Result(property = "updateTime", column = "update_time", javaType = Timestamp.class, jdbcType = JdbcType.DATE), @Result(property = "updateTime", column = "update_time", javaType = Timestamp.class, jdbcType = JdbcType.DATE),
@Result(property = "defCount", column = "def_count", javaType = Integer.class, jdbcType = JdbcType.INTEGER),
@Result(property = "instRunningCount", column = "inst_running_count", javaType = Integer.class, jdbcType = JdbcType.INTEGER),
}) })
@SelectProvider(type = ProjectMapperProvider.class, method = "queryAllProjectListPaging") @SelectProvider(type = ProjectMapperProvider.class, method = "queryAllProjectListPaging")
List<Project> queryAllProjectListPaging( List<Project> queryAllProjectListPaging(

6
escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProjectMapperProvider.java

@ -157,7 +157,8 @@ public class ProjectMapperProvider {
return new SQL() {{ return new SQL() {{
SELECT("p.*"); SELECT("p.*");
SELECT("u.user_name as user_name"); SELECT("u.user_name as user_name");
SELECT("(SELECT COUNT(*) FROM t_escheduler_process_definition AS def WHERE def.project_id = p.id) AS def_count");
SELECT("(SELECT COUNT(*) FROM t_escheduler_process_definition def, t_escheduler_process_instance inst WHERE def.id = inst.process_definition_id AND def.project_id = p.id AND inst.state=1 ) as inst_running_count");
FROM(TABLE_NAME + " p"); FROM(TABLE_NAME + " p");
JOIN("t_escheduler_user u on u.id=p.user_id"); JOIN("t_escheduler_user u on u.id=p.user_id");
WHERE("p.id in " + WHERE("p.id in " +
@ -199,7 +200,8 @@ public class ProjectMapperProvider {
return new SQL() {{ return new SQL() {{
SELECT("p.*"); SELECT("p.*");
SELECT("u.user_name as user_name"); SELECT("u.user_name as user_name");
SELECT("(SELECT COUNT(*) FROM t_escheduler_process_definition AS def WHERE def.project_id = p.id) AS def_count");
SELECT("(SELECT COUNT(*) FROM t_escheduler_process_definition def, t_escheduler_process_instance inst WHERE def.id = inst.process_definition_id AND def.project_id = p.id AND inst.state=1 ) as inst_running_count");
FROM(TABLE_NAME + " p"); FROM(TABLE_NAME + " p");
JOIN("t_escheduler_user u on p.user_id = u.id"); JOIN("t_escheduler_user u on p.user_id = u.id");

26
escheduler-dao/src/main/java/cn/escheduler/dao/model/Project.java

@ -63,6 +63,32 @@ public class Project {
*/ */
private int perm; private int perm;
/**
* process define count
*/
private int defCount;
/**
* process instance running count
*/
private int instRunningCount;
public int getDefCount() {
return defCount;
}
public void setDefCount(int defCount) {
this.defCount = defCount;
}
public int getInstRunningCount() {
return instRunningCount;
}
public void setInstRunningCount(int instRunningCount) {
this.instRunningCount = instRunningCount;
}
public int getId() { public int getId() {
return id; return id;
} }

12
escheduler-ui/src/js/conf/home/pages/projects/pages/list/_source/list.vue

@ -12,6 +12,12 @@
<th> <th>
<span>{{$t('Owned Users')}}</span> <span>{{$t('Owned Users')}}</span>
</th> </th>
<th>
<span>{{$t('Process Define Count')}}</span>
</th>
<th>
<span>{{$t('Process Instance Running Count')}}</span>
</th>
<th> <th>
<span>{{$t('Description')}}</span> <span>{{$t('Description')}}</span>
</th> </th>
@ -37,6 +43,12 @@
<td> <td>
<span>{{item.userName || '-'}}</span> <span>{{item.userName || '-'}}</span>
</td> </td>
<td>
<span>{{item.defCount}}</span>
</td>
<td>
<span>{{item.instRunningCount}}</span>
</td>
<td> <td>
<span>{{item.desc}}</span> <span>{{item.desc}}</span>
</td> </td>

2
escheduler-ui/src/js/module/i18n/locale/en_US.js

@ -452,4 +452,6 @@ export default {
'Pre Statement': 'Pre Statement', 'Pre Statement': 'Pre Statement',
'Post Statement': 'Post Statement', 'Post Statement': 'Post Statement',
'Statement cannot be empty': 'Statement cannot be empty', 'Statement cannot be empty': 'Statement cannot be empty',
'Process Define Count':'Process Define Count',
'Process Instance Running Count':'Process Instance Running Count',
} }

2
escheduler-ui/src/js/module/i18n/locale/zh_CN.js

@ -452,4 +452,6 @@ export default {
'Pre Statement': '前置sql', 'Pre Statement': '前置sql',
'Post Statement': '后置sql', 'Post Statement': '后置sql',
'Statement cannot be empty': '语句不能为空', 'Statement cannot be empty': '语句不能为空',
'Process Define Count':'流程定义个数',
'Process Instance Running Count':'运行流程实例个数',
} }

Loading…
Cancel
Save