Sfoglia il codice sorgente

新增请假流程事件,增加判断大于3天和大于7天流程条件

chenjun 1 anno fa
parent
commit
1e677e99ec

+ 30 - 0
zjugis-business/src/main/java/com/zjugis/business/flow/leave/event/LeaveEvent.java

@@ -192,4 +192,34 @@ public class LeaveEvent extends BaseController {
             throw new BusinessException("执行事件出错,请联系管理员!");
         }
     }
+
+    @PostMapping("/greatThan3")
+    public String greatThan3(@ParamModel Map flowInstance, @ParamModel Map flowDirectionInstance, @ParamModel Map previousActivityInstance, @ParamModel Map previousGatewayInstance, @ParamModel Map nextActivityTemplate, @ParamModel Map nextGatewayInstance) {
+        try {
+            String flowInstanceId = flowInstance.get("id").toString();
+            LeaveDO entity = leaveService.findByInstanceId(flowInstanceId);
+            if(entity != null && entity.getLeaveHours() != null
+                    && entity.getLeaveHours() > (7.5*3)){
+                return "true";
+            }
+            return "false";
+        } catch (Exception ex) {
+            return error(ex.getMessage(), ErrorCode.DEFAULT);
+        }
+    }
+
+    @PostMapping("/greatThan7")
+    public String greatThan7(@ParamModel Map flowInstance, @ParamModel Map flowDirectionInstance, @ParamModel Map previousActivityInstance, @ParamModel Map previousGatewayInstance, @ParamModel Map nextActivityTemplate, @ParamModel Map nextGatewayInstance) {
+        try {
+            String flowInstanceId = flowInstance.get("id").toString();
+            LeaveDO entity = leaveService.findByInstanceId(flowInstanceId);
+            if(entity != null && entity.getLeaveHours() != null
+                    && entity.getLeaveHours() > (7.5*7)){
+                return "true";
+            }
+            return "false";
+        } catch (Exception ex) {
+            return error(ex.getMessage(), ErrorCode.DEFAULT);
+        }
+    }
 }