提交 92367aee authored 作者: zhoushaopan's avatar zhoushaopan

新增分页

上级 b237fd37
...@@ -53,6 +53,7 @@ public class FlowsInfoController { ...@@ -53,6 +53,7 @@ public class FlowsInfoController {
@ApiOperation(value = "查询流程信息") @ApiOperation(value = "查询流程信息")
public ResponseEntity searchFlowInfo(SearchFlowInfoVo searchFlowInfoVo){ public ResponseEntity searchFlowInfo(SearchFlowInfoVo searchFlowInfoVo){
Page<FlowsInfo> flowsInfoList = flowInfoService.searchFlowInfo(searchFlowInfoVo); Page<FlowsInfo> flowsInfoList = flowInfoService.searchFlowInfo(searchFlowInfoVo);
return ResultUtil.success(flowsInfoList,"查询成功"); return ResultUtil.success(flowsInfoList,"查询成功");
} }
......
...@@ -9,9 +9,11 @@ import com.tykj.workflowcore.workflow_editer.service.FormPageService; ...@@ -9,9 +9,11 @@ import com.tykj.workflowcore.workflow_editer.service.FormPageService;
//import com.tykj.workflowcore.workflow_editer.service.PageEntityService; //import com.tykj.workflowcore.workflow_editer.service.PageEntityService;
import com.tykj.workflowcore.workflow_editer.vo.InFormPageVo; import com.tykj.workflowcore.workflow_editer.vo.InFormPageVo;
import com.tykj.workflowcore.workflow_editer.vo.OutFormPageVo; import com.tykj.workflowcore.workflow_editer.vo.OutFormPageVo;
import com.tykj.workflowcore.workflow_editer.vo.PageFormPageVo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -57,8 +59,9 @@ public class FormPageController { ...@@ -57,8 +59,9 @@ public class FormPageController {
@ApiOperation("查看页面") @ApiOperation("查看页面")
@GetMapping("/findPages") @GetMapping("/findPages")
public List<OutFormPageVo> findPages(){ public ResponseEntity findPages(@RequestBody PageFormPageVo pageFormPageVo){
return formPageService.getAllPages();
return ResultUtil.success(formPageService.getAllPages(pageFormPageVo),"查询成功");
} }
@ApiOperation("删除页面") @ApiOperation("删除页面")
......
...@@ -37,6 +37,7 @@ public class WorkFlowController { ...@@ -37,6 +37,7 @@ public class WorkFlowController {
@Autowired @Autowired
private WorkFlowService workFlowService; private WorkFlowService workFlowService;
@PostMapping("/deploy") @PostMapping("/deploy")
@ApiOperation(value = "部署流程",notes = "0 部署成功") @ApiOperation(value = "部署流程",notes = "0 部署成功")
public Integer deploy(Long id) throws FileNotFoundException { public Integer deploy(Long id) throws FileNotFoundException {
...@@ -65,7 +66,7 @@ public class WorkFlowController { ...@@ -65,7 +66,7 @@ public class WorkFlowController {
} }
@PostMapping("/findTaskDetail") @PostMapping("/findTaskDetail")
@ApiOperation("任务个人待办详情") @ApiOperation("任务个人待办任务详情")
public Map<String, Object> findTaskDetail(String taskId){ public Map<String, Object> findTaskDetail(String taskId){
return workFlowService.findTaskDetail(taskId); return workFlowService.findTaskDetail(taskId);
} }
...@@ -74,7 +75,7 @@ public class WorkFlowController { ...@@ -74,7 +75,7 @@ public class WorkFlowController {
@ApiOperation("完成任务") @ApiOperation("完成任务")
public ResponseEntity completeTask(@RequestBody TaskVo taskVo){ public ResponseEntity completeTask(@RequestBody TaskVo taskVo){
workFlowService.completeTask(taskVo); workFlowService.completeTask(taskVo);
return ResultUtil.success("该任务已完成"); return ResultUtil.success("该任务已完成");
} }
@PostMapping("/isTransferTask") @PostMapping("/isTransferTask")
......
...@@ -68,7 +68,7 @@ public interface FlowInfoService { ...@@ -68,7 +68,7 @@ public interface FlowInfoService {
FlowsInfo disableFlow(Long flowInfoId); FlowsInfo disableFlow(Long flowInfoId);
/** /**
* 有条件的查询flowinfo * 有条件的查询flowInfo
* @param searchFlowInfoVo * @param searchFlowInfoVo
* @return * @return
*/ */
......
...@@ -4,6 +4,8 @@ import com.tykj.workflowcore.model_layer.model.TableInfo; ...@@ -4,6 +4,8 @@ import com.tykj.workflowcore.model_layer.model.TableInfo;
import com.tykj.workflowcore.workflow_editer.entity.FormPage; import com.tykj.workflowcore.workflow_editer.entity.FormPage;
import com.tykj.workflowcore.workflow_editer.vo.InFormPageVo; import com.tykj.workflowcore.workflow_editer.vo.InFormPageVo;
import com.tykj.workflowcore.workflow_editer.vo.OutFormPageVo; import com.tykj.workflowcore.workflow_editer.vo.OutFormPageVo;
import com.tykj.workflowcore.workflow_editer.vo.PageFormPageVo;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -47,9 +49,10 @@ public interface FormPageService { ...@@ -47,9 +49,10 @@ public interface FormPageService {
/** /**
* 查询全部页面 * 查询全部页面
* @param pageFormPageVo 分页
* @return 全部集合 * @return 全部集合
*/ */
List<OutFormPageVo> getAllPages(); Page<FormPage> getAllPages(PageFormPageVo pageFormPageVo);
/** /**
* 根据页面id查询tableInfo * 根据页面id查询tableInfo
......
...@@ -5,12 +5,15 @@ import com.github.wenhao.jpa.PredicateBuilder; ...@@ -5,12 +5,15 @@ import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications; import com.github.wenhao.jpa.Specifications;
import com.tykj.workflowcore.model_layer.dao.TableInfoDao; import com.tykj.workflowcore.model_layer.dao.TableInfoDao;
import com.tykj.workflowcore.model_layer.model.TableInfo; import com.tykj.workflowcore.model_layer.model.TableInfo;
import com.tykj.workflowcore.workflow_editer.entity.FlowsInfo;
import com.tykj.workflowcore.workflow_editer.entity.FormPage; import com.tykj.workflowcore.workflow_editer.entity.FormPage;
import com.tykj.workflowcore.workflow_editer.mapper.FormPageMapper; import com.tykj.workflowcore.workflow_editer.mapper.FormPageMapper;
import com.tykj.workflowcore.workflow_editer.service.FormPageService; import com.tykj.workflowcore.workflow_editer.service.FormPageService;
import com.tykj.workflowcore.workflow_editer.vo.InFormPageVo; import com.tykj.workflowcore.workflow_editer.vo.InFormPageVo;
import com.tykj.workflowcore.workflow_editer.vo.OutFormPageVo; import com.tykj.workflowcore.workflow_editer.vo.OutFormPageVo;
import com.tykj.workflowcore.workflow_editer.vo.PageFormPageVo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -62,18 +65,17 @@ public class FormPageServiceImpl implements FormPageService { ...@@ -62,18 +65,17 @@ public class FormPageServiceImpl implements FormPageService {
} }
@Override @Override
public List<OutFormPageVo> getAllPages() { public Page<FormPage> getAllPages(PageFormPageVo pageFormPageVo) {
ArrayList<OutFormPageVo> formPageVos = new ArrayList<>(); ArrayList<OutFormPageVo> formPageVos = new ArrayList<>();
List<FormPage> formPages = formPageMapper.findAll(); PredicateBuilder<FormPage> and = Specifications.and();
for (FormPage formPage : formPages) { and.eq(pageFormPageVo.getPageName()!=null,"pageName",pageFormPageVo.getPageName());
// FormPageVo formPageVo = new FormPageVo(); and.eq(pageFormPageVo.getPageDesc()!=null,"pageDesc",pageFormPageVo.getPageDesc());
// BeanUtils.copyProperties(formPage,formPageVo); and.eq(pageFormPageVo.getCreateTime()!=null,"createTime",pageFormPageVo.getCreateTime());
// formPageVos.add(formPageVo);
OutFormPageVo outFormPageVo = formPage.toEntityVo(); Page<FormPage> formPagePage = formPageMapper.findAll(and.build(), pageFormPageVo.getPageable());
formPageVos.add(outFormPageVo);
} return formPagePage;
return formPageVos;
} }
@Override @Override
......
...@@ -249,7 +249,7 @@ public class WorkFlowServiceImpl implements WorkFlowService { ...@@ -249,7 +249,7 @@ public class WorkFlowServiceImpl implements WorkFlowService {
if (nextTaskVo.getRoleId()!=null&&nextTaskVo.getRoleId().size()>0){ if (nextTaskVo.getRoleId()!=null&&nextTaskVo.getRoleId().size()>0){
taskQuery.taskCandidateGroupIn(nextTaskVo.getRoleId()).orderByTaskCreateTime().desc(); taskQuery.taskCandidateGroupIn(nextTaskVo.getRoleId()).orderByTaskCreateTime().desc();
} }
List<Task> listTask = taskQuery.endOr().list(); List<Task> listTask = taskQuery.endOr().listPage(1,5);
for (Task task : listTask) { for (Task task : listTask) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
ProcessInstance processInstance = ProcessInstance processInstance =
......
package com.tykj.workflowcore.workflow_editer.vo; package com.tykj.workflowcore.workflow_editer.vo;
import com.tykj.workflowcore.base.page.JpaCustomOrder;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
......
package com.tykj.workflowcore.workflow_editer.vo; package com.tykj.workflowcore.workflow_editer.vo;
import com.tykj.workflowcore.base.page.JpaCustomOrder;
import com.tykj.workflowcore.base.page.JpaCustomPage;
import com.tykj.workflowcore.workflow_editer.entity.FormPage; import com.tykj.workflowcore.workflow_editer.entity.FormPage;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
......
package com.tykj.workflowcore.workflow_editer.vo;
import com.tykj.workflowcore.base.page.JpaCustomPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* ClassName: PageFormPageVo
* Package: com.tykj.workflowcore.workflow_editer.vo
* Description:
* Datetime: 2021/3/11 15:33
*
* @Author: zsp
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
@Api(tags = "分页查询页面")
public class PageFormPageVo extends JpaCustomPage {
@ApiModelProperty("页面名称")
private String pageName;
@ApiModelProperty("页面描述")
private String pageDesc;
@ApiModelProperty("页面创建时间")
private Date createTime;
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论