Browse Source

Merge remote-tracking branch 'remotes/upstream/branch-1.0.2' into branch-1.0.2

pull/2/head
ligang 6 years ago
parent
commit
58f142bc68
  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. 14
      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 = "createTime", column = "create_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")
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 = "createTime", column = "create_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")
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() {{
SELECT("p.*");
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");
JOIN("t_escheduler_user u on u.id=p.user_id");
WHERE("p.id in " +
@ -199,7 +200,8 @@ public class ProjectMapperProvider {
return new SQL() {{
SELECT("p.*");
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");
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;
/**
* 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() {
return id;
}

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

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

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

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

Loading…
Cancel
Save