From a474e9e5d1cf47d6128115b4bdac10e99601f124 Mon Sep 17 00:00:00 2001
From: gssong <1742057357@qq.com>
Date: 星期五, 07 六月 2024 21:27:05 +0800
Subject: [PATCH] add 补充全部流程key监听示例
---
ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/TestLeaveServiceImpl.java | 95 +++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 87 insertions(+), 8 deletions(-)
diff --git a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/TestLeaveServiceImpl.java b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/TestLeaveServiceImpl.java
index b938a98..c59b7ad 100644
--- a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/TestLeaveServiceImpl.java
+++ b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/TestLeaveServiceImpl.java
@@ -115,12 +115,26 @@
}
/**
+ * 鎵ц鍔炵悊浠诲姟鐩戝惉
+ *
+ * @param processTaskEvent 鍙傛暟
+ */
+ @EventListener(condition = "#processTaskEvent.keyNode=='leave1_Activity_14633hx'")
+ public void leave1Task(ProcessTaskEvent processTaskEvent) {
+ log.info("褰撳墠浠诲姟鎵ц浜唟}", processTaskEvent.toString());
+ TestLeave testLeave = baseMapper.selectById(Long.valueOf(processTaskEvent.getBusinessKey()));
+ testLeave.setStatus(BusinessStatusEnum.WAITING.getStatus());
+ baseMapper.updateById(testLeave);
+ }
+
+
+ /**
* 鎬讳綋娴佺▼鐩戝惉(渚嬪: 鎻愪氦 閫�鍥� 鎾ら攢 缁堟 浣滃簾绛�)
*
* @param processEvent 鍙傛暟
*/
@EventListener(condition = "#processEvent.key=='leave1'")
- public void processHandler(ProcessEvent processEvent) {
+ public void leave1(ProcessEvent processEvent) {
log.info("褰撳墠浠诲姟鎵ц浜唟}", processEvent.toString());
TestLeave testLeave = baseMapper.selectById(Long.valueOf(processEvent.getBusinessKey()));
testLeave.setStatus(processEvent.getStatus());
@@ -131,17 +145,82 @@
}
/**
- * 鎵ц鍔炵悊浠诲姟鐩戝惉
+ * 鎬讳綋娴佺▼鐩戝惉(渚嬪: 鎻愪氦 閫�鍥� 鎾ら攢 缁堟 浣滃簾绛�)
*
- * @param processTaskEvent 鍙傛暟
+ * @param processEvent 鍙傛暟
*/
- @EventListener(condition = "#processTaskEvent.keyNode=='leave1_Activity_14633hx'")
- public void processTaskHandler(ProcessTaskEvent processTaskEvent) {
- log.info("褰撳墠浠诲姟鎵ц浜唟}", processTaskEvent.toString());
- TestLeave testLeave = baseMapper.selectById(Long.valueOf(processTaskEvent.getBusinessKey()));
- testLeave.setStatus(BusinessStatusEnum.WAITING.getStatus());
+ @EventListener(condition = "#processEvent.key=='leave2'")
+ public void leave2(ProcessEvent processEvent) {
+ log.info("褰撳墠浠诲姟鎵ц浜唟}", processEvent.toString());
+ TestLeave testLeave = baseMapper.selectById(Long.valueOf(processEvent.getBusinessKey()));
+ testLeave.setStatus(processEvent.getStatus());
+ if (processEvent.isSubmit()) {
+ testLeave.setStatus(BusinessStatusEnum.WAITING.getStatus());
+ }
baseMapper.updateById(testLeave);
}
+ /**
+ * 鎬讳綋娴佺▼鐩戝惉(渚嬪: 鎻愪氦 閫�鍥� 鎾ら攢 缁堟 浣滃簾绛�)
+ *
+ * @param processEvent 鍙傛暟
+ */
+ @EventListener(condition = "#processEvent.key=='leave3'")
+ public void leave3(ProcessEvent processEvent) {
+ log.info("褰撳墠浠诲姟鎵ц浜唟}", processEvent.toString());
+ TestLeave testLeave = baseMapper.selectById(Long.valueOf(processEvent.getBusinessKey()));
+ testLeave.setStatus(processEvent.getStatus());
+ if (processEvent.isSubmit()) {
+ testLeave.setStatus(BusinessStatusEnum.WAITING.getStatus());
+ }
+ baseMapper.updateById(testLeave);
+ }
+ /**
+ * 鎬讳綋娴佺▼鐩戝惉(渚嬪: 鎻愪氦 閫�鍥� 鎾ら攢 缁堟 浣滃簾绛�)
+ *
+ * @param processEvent 鍙傛暟
+ */
+ @EventListener(condition = "#processEvent.key=='leave4'")
+ public void leave4(ProcessEvent processEvent) {
+ log.info("褰撳墠浠诲姟鎵ц浜唟}", processEvent.toString());
+ TestLeave testLeave = baseMapper.selectById(Long.valueOf(processEvent.getBusinessKey()));
+ testLeave.setStatus(processEvent.getStatus());
+ if (processEvent.isSubmit()) {
+ testLeave.setStatus(BusinessStatusEnum.WAITING.getStatus());
+ }
+ baseMapper.updateById(testLeave);
+ }
+
+ /**
+ * 鎬讳綋娴佺▼鐩戝惉(渚嬪: 鎻愪氦 閫�鍥� 鎾ら攢 缁堟 浣滃簾绛�)
+ *
+ * @param processEvent 鍙傛暟
+ */
+ @EventListener(condition = "#processEvent.key=='leave5'")
+ public void leave5(ProcessEvent processEvent) {
+ log.info("褰撳墠浠诲姟鎵ц浜唟}", processEvent.toString());
+ TestLeave testLeave = baseMapper.selectById(Long.valueOf(processEvent.getBusinessKey()));
+ testLeave.setStatus(processEvent.getStatus());
+ if (processEvent.isSubmit()) {
+ testLeave.setStatus(BusinessStatusEnum.WAITING.getStatus());
+ }
+ baseMapper.updateById(testLeave);
+ }
+
+ /**
+ * 鎬讳綋娴佺▼鐩戝惉(渚嬪: 鎻愪氦 閫�鍥� 鎾ら攢 缁堟 浣滃簾绛�)
+ *
+ * @param processEvent 鍙傛暟
+ */
+ @EventListener(condition = "#processEvent.key=='leave6'")
+ public void leave6(ProcessEvent processEvent) {
+ log.info("褰撳墠浠诲姟鎵ц浜唟}", processEvent.toString());
+ TestLeave testLeave = baseMapper.selectById(Long.valueOf(processEvent.getBusinessKey()));
+ testLeave.setStatus(processEvent.getStatus());
+ if (processEvent.isSubmit()) {
+ testLeave.setStatus(BusinessStatusEnum.WAITING.getStatus());
+ }
+ baseMapper.updateById(testLeave);
+ }
}
--
Gitblit v1.9.3