24282 il y a 2 ans
Parent
commit
e8f403b674

+ 8 - 0
hx-flow/src/main/java/com/fjhx/flow/controller/flow/FlowExampleController.java

@@ -74,4 +74,12 @@ public class FlowExampleController {
         return flowExampleService.getApprovalRecord(dto.getId());
     }
 
+    /**
+     * 获取流程分页列表
+     */
+    @PostMapping("/page")
+    public Page<FlowExampleVo> page(@RequestBody FlowExampleSelectDto dto) {
+        return flowExampleService.getPage(dto);
+    }
+
 }

+ 4 - 0
hx-flow/src/main/java/com/fjhx/flow/entity/flow/dto/FlowExampleSelectDto.java

@@ -19,5 +19,9 @@ public class FlowExampleSelectDto extends BaseSelectDto {
      */
     private Long flowInfoId;
 
+    /**
+     * 0未发起 1进行中 2已结束
+     */
+    private Integer status;
 
 }

+ 6 - 0
hx-flow/src/main/java/com/fjhx/flow/service/flow/FlowExampleService.java

@@ -6,6 +6,7 @@ import com.fjhx.flow.entity.flow.po.FlowExample;
 import com.fjhx.flow.entity.flow.po.FlowInfo;
 import com.fjhx.flow.entity.flow.vo.ApprovalRecordVo;
 import com.fjhx.flow.entity.flow.vo.FlowExampleVo;
+import com.ruoyi.common.core.domain.BaseSelectDto;
 import com.ruoyi.common.core.service.BaseService;
 
 import java.util.List;
@@ -46,4 +47,9 @@ public interface FlowExampleService extends BaseService<FlowExample> {
      */
     ApprovalRecordVo getApprovalRecord(Long id);
 
+    /**
+     * 获取流程分页列表
+     */
+    Page<FlowExampleVo> getPage(FlowExampleSelectDto dto);
+
 }

+ 15 - 0
hx-flow/src/main/java/com/fjhx/flow/service/flow/impl/FlowExampleServiceImpl.java

@@ -138,6 +138,21 @@ public class FlowExampleServiceImpl extends ServiceImpl<FlowExampleMapper, FlowE
         return result;
     }
 
+    @Override
+    public Page<FlowExampleVo> getPage(FlowExampleSelectDto dto) {
+
+        IWrapper<FlowExample> wrapper = getWrapper()
+                .func(q -> {
+                    if (Objects.equals(1, dto.getStatus())) {
+                        q.in("fe", FlowExample::getStatus, 0, 1);
+                    } else {
+                        q.in("fe", FlowExample::getStatus, 2, 3);
+                    }
+                });
+
+        return doSelectExample(dto, wrapper);
+    }
+
     private List<ApprovalRecordVo.ButtonInfo> getButtonInfoList(FlowExample flowExample,
                                                                 List<FlowDefinitionNode> flowDefinitionNodeList) {
 

+ 3 - 3
hx-flow/src/main/java/com/fjhx/flow/service/flow/impl/FlowProcessServiceImpl.java

@@ -194,9 +194,9 @@ public class FlowProcessServiceImpl implements FlowProcessService {
             throw new ServiceException("没有找到流程");
         }
 
-        if (flowExample.getStatus() > 1) {
-            throw new ServiceException("流程已结束");
-        }
+        // if (flowExample.getStatus() > 1) {
+        //     throw new ServiceException("流程已结束");
+        // }
 
         if (ObjectUtil.notEqual(flowExample.getVersion(), dto.getVersion())) {
             throw new ServiceException("流程已被处理");