待我审核
parent
b10654376d
commit
a84c4c31c3
|
@ -177,10 +177,6 @@ public class ProcessController {
|
||||||
*/
|
*/
|
||||||
@GetMapping("/review")
|
@GetMapping("/review")
|
||||||
public String review(Model model) {
|
public String review(Model model) {
|
||||||
Admin admin = getLoginUser();
|
|
||||||
// 超级管理员,只有查看权限,不能编辑和删除除非是自己的
|
|
||||||
model.addAttribute("adminId", admin.getId());
|
|
||||||
model.addAttribute("isAdmin", isAdministrator(admin));
|
|
||||||
model.addAttribute("processTypes", ProcessType.values());
|
model.addAttribute("processTypes", ProcessType.values());
|
||||||
return "/admin/business/process-review";
|
return "/admin/business/process-review";
|
||||||
}
|
}
|
||||||
|
@ -662,22 +658,27 @@ public class ProcessController {
|
||||||
.withMatcher("projectNo", ExampleMatcher.GenericPropertyMatcher::contains)
|
.withMatcher("projectNo", ExampleMatcher.GenericPropertyMatcher::contains)
|
||||||
.withMatcher("projectTitle", ExampleMatcher.GenericPropertyMatcher::contains)
|
.withMatcher("projectTitle", ExampleMatcher.GenericPropertyMatcher::contains)
|
||||||
.withMatcher("applyPersonName", ExampleMatcher.GenericPropertyMatcher::contains);
|
.withMatcher("applyPersonName", ExampleMatcher.GenericPropertyMatcher::contains);
|
||||||
|
|
||||||
// 只展示自己创建的草稿
|
|
||||||
Admin admin = getLoginUser();
|
Admin admin = getLoginUser();
|
||||||
if (!isAdministrator(admin)) {
|
|
||||||
Integer loginUserId = admin.getId();
|
Integer loginUserId = admin.getId();
|
||||||
|
|
||||||
|
// 待我审核
|
||||||
if (forAudit) {
|
if (forAudit) {
|
||||||
|
// 超级管理员也看不到,除非该他审核
|
||||||
return repository.findAll((root, query, cb) -> {
|
return repository.findAll((root, query, cb) -> {
|
||||||
Predicate predicate = QueryByExamplePredicateBuilder.getPredicate(root, cb, Example.of(projectProcess, exampleMatcher));
|
Predicate predicate = QueryByExamplePredicateBuilder.getPredicate(root, cb, Example.of(projectProcess, exampleMatcher));
|
||||||
// 添加新的条件
|
// 添加新的条件
|
||||||
// Predicate equal = cb.equal(root.get("applyPersonId"), loginUserId);
|
|
||||||
Expression<Integer> findInSet = cb.function("find_in_set", Integer.class, cb.literal(loginUserId), root.get("currentAuditId"));
|
Expression<Integer> findInSet = cb.function("find_in_set", Integer.class, cb.literal(loginUserId), root.get("currentAuditId"));
|
||||||
return cb.and(predicate, cb.greaterThan(findInSet, 0));
|
return cb.and(predicate, cb.greaterThan(findInSet, 0));
|
||||||
}, pageRequest);
|
}, pageRequest);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
// 已办流程
|
// 已办流程
|
||||||
|
|
||||||
|
if (isAdministrator(admin)) {
|
||||||
|
// 超级好管理员不需要
|
||||||
|
return repository.findAll(Example.of(projectProcess, exampleMatcher), pageRequest);
|
||||||
|
}
|
||||||
|
|
||||||
return repository.findAll((root, query, cb) -> {
|
return repository.findAll((root, query, cb) -> {
|
||||||
Predicate predicate = QueryByExamplePredicateBuilder.getPredicate(root, cb, Example.of(projectProcess, exampleMatcher));
|
Predicate predicate = QueryByExamplePredicateBuilder.getPredicate(root, cb, Example.of(projectProcess, exampleMatcher));
|
||||||
// 添加新的条件
|
// 添加新的条件
|
||||||
|
@ -694,11 +695,6 @@ public class ProcessController {
|
||||||
return cb.and(predicate, or);
|
return cb.and(predicate, or);
|
||||||
}, pageRequest);
|
}, pageRequest);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// 超级好管理员不需要
|
|
||||||
return repository.findAll(Example.of(projectProcess, exampleMatcher), pageRequest);
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isAdministrator(Admin admin) {
|
private boolean isAdministrator(Admin admin) {
|
||||||
return admin != null && admin.getRoleType() == SysRole.ROLE_TYPE_SYSTEM;
|
return admin != null && admin.getRoleType() == SysRole.ROLE_TYPE_SYSTEM;
|
||||||
|
|
|
@ -114,11 +114,7 @@
|
||||||
<el-table-column label="操作" fixed="right" width="140">
|
<el-table-column label="操作" fixed="right" width="140">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="text" @click="showDetail(scope.row, scope)">查看详情</el-button>
|
<el-button type="text" @click="showDetail(scope.row, scope)">查看详情</el-button>
|
||||||
<#if isAdmin>
|
|
||||||
<el-button type="text" @click="auditProcess(scope.row, scope)">审核</el-button>
|
<el-button type="text" @click="auditProcess(scope.row, scope)">审核</el-button>
|
||||||
<#else>
|
|
||||||
<el-button type="text" @click="auditProcess(scope.row, scope)">审核</el-button>
|
|
||||||
</#if>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue