diff --git a/src/main/java/cn/palmte/work/controller/backend/ProcessController.java b/src/main/java/cn/palmte/work/controller/backend/ProcessController.java index 4e408bb..7a6907b 100644 --- a/src/main/java/cn/palmte/work/controller/backend/ProcessController.java +++ b/src/main/java/cn/palmte/work/controller/backend/ProcessController.java @@ -482,11 +482,14 @@ public class ProcessController { entity.setTaxRate(form.getTaxRate()); entity.setContractNo(form.getContractNo()); entity.setContractName(form.getContractName()); - - entity.setApplyDept(form.getApplyDept()); entity.setSealTypes(SealTypeArray.of(form.getSealTypes())); entity.setAttachmentUri(JSON.toJSONString(form.getAttachments())); + entity.setApplyDept(form.getApplyDept()); + entity.setApplyDeptId(form.getApplyDeptId()); + entity.setApplyDeptLeaderId(form.getApplyDeptLeaderId()); + entity.setApplyDeptLeaderName(form.getApplyDeptLeaderName()); + entityManager.merge(entity); if (processType == ProcessType.sale_contract) { @@ -585,7 +588,8 @@ public class ProcessController { @ResponseBody @PostMapping("/query") - public Page list(@RequestBody ProcessQueryForm form, Pageable pageable) { + public Page list(@RequestBody ProcessQueryForm form, Pageable pageable, + @RequestParam(defaultValue = "false") boolean forAudit) { // 从 0 开始 PageRequest pageRequest = new PageRequest(pageable.getPageNumber() - 1, pageable.getPageSize(), new Sort(Sort.Direction.DESC, "lastUpdateAt", "createAt")); @@ -606,6 +610,10 @@ public class ProcessController { return repository.findAll(Example.of(projectProcess, exampleMatcher), pageRequest); } + private boolean isAdministrator(Admin admin) { + return admin != null && "admin".equals(admin.getUserName()); + } + // 审核 @Data static class AuditForm { @@ -646,7 +654,7 @@ public class ProcessController { if (admin == null) { throw ErrorMessageException.failed("权限不足"); } - if (Objects.equals("admin", admin.getUserName())) { + if (isAdministrator(admin)) { processService.revoke(id); } else {