|
@@ -0,0 +1,68 @@
|
|
|
|
+package org.jeecg.modules.activiti.listener;
|
|
|
|
+
|
|
|
|
+import org.activiti.engine.delegate.*;
|
|
|
|
+import org.apache.shiro.SecurityUtils;
|
|
|
|
+import org.jeecg.common.system.api.ISysBaseAPI;
|
|
|
|
+import org.jeecg.common.system.vo.LoginUser;
|
|
|
|
+import org.jeecg.modules.activiti.mapper.TbTableInfoMapper;
|
|
|
|
+import org.jeecg.modules.oa.entity.SealArchives;
|
|
|
|
+import org.jeecg.modules.oa.entity.SealTurn;
|
|
|
|
+import org.jeecg.modules.oa.mapper.SealArchivesMapper;
|
|
|
|
+import org.jeecg.modules.oa.mapper.SealTurnMapper;
|
|
|
|
+import org.jeecg.modules.oa.service.IActivitiService;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
|
+
|
|
|
|
+import javax.annotation.Resource;
|
|
|
|
+import java.util.HashMap;
|
|
|
|
+import java.util.Map;
|
|
|
|
+
|
|
|
|
+//流程监听,固资在转移、报废等操作时回写状态
|
|
|
|
+@Component
|
|
|
|
+public class ListenerApplySeal implements TaskListener, ExecutionListener {
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private SealArchivesMapper sealArchivesMapper;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 执行监听
|
|
|
|
+ *
|
|
|
|
+ * @param delegateExecution
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public void notify(DelegateExecution delegateExecution) throws Exception {
|
|
|
|
+
|
|
|
|
+ String eventName = delegateExecution.getEventName();
|
|
|
|
+ if ("start".equals(eventName)) {
|
|
|
|
+ // 流程开始
|
|
|
|
+ } else if ("end".equals(eventName)) {
|
|
|
|
+ //todo
|
|
|
|
+ Map<String, Object> variables = delegateExecution.getVariables();
|
|
|
|
+// //印章类别
|
|
|
|
+// String type = String.valueOf(variables.get("sealType"));
|
|
|
|
+// //印章名称
|
|
|
|
+// String name = String.valueOf(variables.get("sealName"));
|
|
|
|
+// //
|
|
|
|
+// SealArchives sealArchives = new SealArchives();
|
|
|
|
+// sealArchivesMapper.insert(sealArchives);
|
|
|
|
+ } else if ("take".equals(eventName)) {
|
|
|
|
+ // 连线监听器
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 任务监听
|
|
|
|
+ *
|
|
|
|
+ * @param delegateTask
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public void notify(DelegateTask delegateTask) {
|
|
|
|
+ String eventName = delegateTask.getEventName();
|
|
|
|
+ if ("create".endsWith(eventName)) {
|
|
|
|
+ } else if ("assignment".endsWith(eventName)) {
|
|
|
|
+ } else if ("complete".endsWith(eventName)) {
|
|
|
|
+ } else if ("delete".endsWith(eventName)) {
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|