From e1a8bb24cacdae059b036077924395e41b4a73c3 Mon Sep 17 00:00:00 2001 From: wangzhijiang <12345678> Date: Fri, 4 Mar 2022 18:01:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ActivitiModelController.java | 78 +++++++ .../wkflow/controller/CategoryController.java | 51 +++++ .../wkflow/controller/TaskController.java | 193 ++++++++++++++++++ .../wkflow/controller/workFlowController.java | 127 ++++++++++++ .../jero/modules/wkflow/entity/BusMes.java | 131 ++++++++++++ .../modules/wkflow/entity/BusProcessName.java | 64 ++++++ .../modules/wkflow/entity/BusProcessNew.java | 37 ++++ .../jero/modules/wkflow/entity/Category.java | 56 +++++ .../wkflow/entity/TaskCommonQuery.java | 49 +++++ .../feginClient/ActivitiModelFeignClient.java | 76 +++++++ .../feginClient/CategoryFeignClient.java | 47 +++++ .../wkflow/feginClient/TaskFeignClient.java | 106 ++++++++++ .../feginClient/WorkFlowFeignClient.java | 104 ++++++++++ .../impl/ActivitiModelFeignClientImpl.java | 90 ++++++++ .../impl/CategoryFeignClientImpl.java | 53 +++++ .../feginClient/impl/TaskFeignClientImpl.java | 129 ++++++++++++ .../impl/WorkFlowFeignClientImpl.java | 119 +++++++++++ 17 files changed, 1510 insertions(+) create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/ActivitiModelController.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/CategoryController.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/TaskController.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/workFlowController.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/entity/BusMes.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/entity/BusProcessName.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/entity/BusProcessNew.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/entity/Category.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/entity/TaskCommonQuery.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/ActivitiModelFeignClient.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/CategoryFeignClient.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/TaskFeignClient.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/impl/ActivitiModelFeignClientImpl.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/impl/CategoryFeignClientImpl.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/impl/TaskFeignClientImpl.java diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/ActivitiModelController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/ActivitiModelController.java new file mode 100644 index 000000000..e87c333c8 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/ActivitiModelController.java @@ -0,0 +1,78 @@ +package com.jero.modules.wkflow.controller; + +import com.jero.common.api.vo.Result; +import com.jero.common.aspect.annotation.AutoLog; +import com.jero.modules.wkflow.feginClient.impl.ActivitiModelFeignClientImpl; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@Slf4j +@Api(tags="工作流模型") +@RestController +@RequestMapping("/model") +public class ActivitiModelController { + + @Autowired + private ActivitiModelFeignClientImpl activitiModelFeignClient; + + @AutoLog(value = "创建流程模型") + @ApiOperation(value="创建流程模型", notes="创建流程模型") + @GetMapping("/createModel") + public Result createModel(@RequestParam("name")String name, + @RequestParam("desc") String desc, + @RequestParam("category") String category){ + return activitiModelFeignClient.createModel(name, desc, category); + } + + @AutoLog(value = "保存model信息") + @ApiOperation(value="保存model信息", notes="保存model信息") + @GetMapping("/saveModel") + public Result saveModel(@RequestParam("modelId")String modelId, + @RequestParam("name")String name, + @RequestParam("description") String description, + @RequestParam("jsonXml") String jsonXml, + @RequestParam("svgXml") String svgXml){ + return activitiModelFeignClient.saveModel(modelId, name, description, jsonXml,svgXml); + } + + @AutoLog(value = "删除模板") + @ApiOperation(value="删除模板", notes="删除模板") + @GetMapping("/deleteModel") + public Result deleteModel(@RequestParam(value="modelId") String modelId){ + return activitiModelFeignClient.deleteModel(modelId); + } + + @AutoLog(value = "修改流程所属分类") + @ApiOperation(value="修改流程所属分类", notes="修改流程所属分类") + @GetMapping("/updatModel") + public Result updatModel(@RequestParam("modelId")String modelId,@RequestParam("categoryId")String categoryId){ + return activitiModelFeignClient.updatModel(modelId,categoryId); + } + + @AutoLog(value = "复制流程") + @ApiOperation(value="复制流程", notes="复制流程") + @GetMapping("/copyModel") + public Result copyModel(@RequestParam(value="modelId") String modelId){ + return activitiModelFeignClient.copyModel(modelId); + } + + @AutoLog(value = "部署流程") + @ApiOperation(value="部署流程", notes="部署流程") + @GetMapping("/deploy") + public Result deploy(@RequestParam(value="modelId") String modelId){ + return activitiModelFeignClient.deploy(modelId); + } + + @AutoLog(value = "根据modelId获取model") + @ApiOperation(value="根据modelId获取model", notes="根据modelId获取model") + @GetMapping("/model/json") + public Object getEditorJson(@RequestParam("modelId")String modelId){ + return activitiModelFeignClient.getEditorJson(modelId); + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/CategoryController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/CategoryController.java new file mode 100644 index 000000000..56eecceb8 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/CategoryController.java @@ -0,0 +1,51 @@ +package com.jero.modules.wkflow.controller; + +import com.jero.common.api.vo.Result; +import com.jero.common.aspect.annotation.AutoLog; +import com.jero.modules.wkflow.entity.Category; +import com.jero.modules.wkflow.feginClient.impl.CategoryFeignClientImpl; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@Slf4j +@Api(tags="流程分类") +@RestController +@RequestMapping("/category") +public class CategoryController { + + @Autowired + private CategoryFeignClientImpl categoryFeignClient; + + @AutoLog(value = "流程分类列表") + @ApiOperation(value="流程分类列表", notes="流程分类列表") + @GetMapping("/categoryList") + public Result> categoryList(){ + return categoryFeignClient.categoryList(); + } + + @AutoLog(value = "添加流程分类") + @ApiOperation(value="添加流程分类", notes="添加流程分类") + @PostMapping("/addCategory") + public Result addCategory(@RequestBody Category category){ + return categoryFeignClient.addCategory(category); + } + + @AutoLog(value = "删除流程分类") + @ApiOperation(value="删除流程分类", notes="删除流程分类") + @GetMapping("/deleteCategory") + public Result deleteCategory(@RequestParam("objectId") String objectId){ + return categoryFeignClient.deleteCategory(objectId); + } + + @AutoLog(value = "编辑流程分类") + @ApiOperation(value="编辑流程分类", notes="编辑流程分类") + @PostMapping("/editCategory") + public Result editCategory(@RequestBody Category category){ + return categoryFeignClient.editCategory(category); + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/TaskController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/TaskController.java new file mode 100644 index 000000000..ac4cb2bb8 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/TaskController.java @@ -0,0 +1,193 @@ +package com.jero.modules.wkflow.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.jero.common.api.vo.Result; +import com.jero.common.aspect.annotation.AutoLog; +import com.jero.modules.wkflow.entity.BusMes; +import com.jero.modules.wkflow.entity.BusProcessName; +import com.jero.modules.wkflow.entity.BusProcessNew; +import com.jero.modules.wkflow.entity.TaskCommonQuery; +import com.jero.modules.wkflow.feginClient.impl.TaskFeignClientImpl; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import me.zhyd.oauth.utils.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +@Slf4j +@Api(tags="待办任务") +@RestController +@RequestMapping("/task") +public class TaskController { + + @Autowired + private TaskFeignClientImpl taskFeignClient; + + /** + * 通用接口 + * @param taskIds + * @return + */ + @AutoLog(value = "查询待办任务数据") + @ApiOperation(value="查询待办任务数据", notes="查询待办任务数据") + @GetMapping("/queryTaskByTaskIds") + public BusProcessNew queryTaskByTaskIds(@RequestParam("taskIds") String taskIds){ + return taskFeignClient.queryTaskByTaskIds(taskIds); + } + + @AutoLog(value = "根据待办id,查询任务明细数据") + @ApiOperation(value="根据待办id,查询任务明细数据", notes="根据待办id,查询任务明细数据") + @GetMapping("/queryTaskDetailByTaskIds") + public String queryTaskDetailByTaskIds(@RequestParam("taskIds") String taskIds) { + return taskFeignClient.queryTaskDetailByTaskIds(taskIds); + } + + @AutoLog(value = "保存任务") + @ApiOperation(value="保存任务", notes="保存任务") + @PostMapping("/saveTask") + public Result saveTask(@RequestBody BusMes busMes){ + return taskFeignClient.saveTask(busMes); + } + + @AutoLog(value = "我的已办任务列表") + @ApiOperation(value="我的已办任务列表", notes="我的已办任务列表") + @PostMapping("/hastodoTasksList") + public Result> HastodoTasksListByUserId(@RequestBody TaskCommonQuery taskCommonQuery){ + return taskFeignClient.HastodoTasksListByUserId(taskCommonQuery); + } + + @AutoLog(value = "我的待办任务列表") + @ApiOperation(value="我的待办任务列表", notes="我的待办任务列表") + @PostMapping("/todoTaskList") + public IPage todoTaskListByUserId(@RequestBody TaskCommonQuery taskCommonQuery){ + List busProcessNames = taskFeignClient.todoTaskListByUserId(taskCommonQuery); + List list1 = this.startPage(busProcessNames, taskCommonQuery.getCurrent(), taskCommonQuery.getSize()); + IPage pageInfo = new Page(); + if(busProcessNames!=null){ + pageInfo.setRecords(list1); + pageInfo.setCurrent(taskCommonQuery.getCurrent()); + pageInfo.setTotal(Long.valueOf(busProcessNames.size())); + pageInfo.setSize(taskCommonQuery.getSize()); + }else{ + List list = new ArrayList<>(); + pageInfo.setRecords(list); + pageInfo.setCurrent(taskCommonQuery.getCurrent()); + pageInfo.setTotal(Long.valueOf(0)); + pageInfo.setSize(taskCommonQuery.getSize()); + } + return pageInfo; + } + + @AutoLog(value = "查询草稿") + @ApiOperation(value="查询草稿", notes="查询草稿") + @PostMapping("/queryTaskDraft") + public IPage queryTaskDraft(@RequestBody TaskCommonQuery taskCommonQuery){ + List busProcessNames = taskFeignClient.queryTaskDraft(taskCommonQuery); + List list1 = this.startPage(busProcessNames, taskCommonQuery.getCurrent(), taskCommonQuery.getSize()); + IPage pageInfo = new Page(); + if(busProcessNames!=null){ + pageInfo.setRecords(list1); + pageInfo.setCurrent(taskCommonQuery.getCurrent()); + pageInfo.setTotal(Long.valueOf(busProcessNames.size())); + pageInfo.setSize(taskCommonQuery.getSize()); + }else{ + List list = new ArrayList(); + pageInfo.setRecords(list); + pageInfo.setCurrent(taskCommonQuery.getCurrent()); + pageInfo.setTotal(Long.valueOf(0)); + pageInfo.setSize(taskCommonQuery.getSize()); + } + return pageInfo; + } + + @AutoLog(value = "已办流程") + @ApiOperation(value="已办流程", notes="已办流程") + @PostMapping("/doneProcess") + public IPage doneProcess(@RequestBody TaskCommonQuery taskCommonQuery){ + IPage page = taskFeignClient.doneProcess(taskCommonQuery); + return page; + } + + @AutoLog(value = "已发流程") + @ApiOperation(value="已发流程", notes="已发流程") + @PostMapping("/IssuedProcess") + public IPage IssuedProcess(@RequestBody TaskCommonQuery taskCommonQuery){ + IPage page = taskFeignClient.issuedProcess(taskCommonQuery); + return page; + } + + @AutoLog(value = "监控流程列表") + @ApiOperation(value="监控流程列表", notes="监控流程列表") + @PostMapping("/allProcess") + public IPage allProcess(@RequestBody TaskCommonQuery taskCommonQuery){ + IPage page= taskFeignClient.allProcess(taskCommonQuery); + return page; + } + + @AutoLog(value = "已办流程-根据taskId查询已办明细") + @ApiOperation(value="已办流程-根据taskId查询已办明细", notes="已办流程-根据taskId查询已办明细") + @GetMapping("/haveFinishedFlowDetail") + public String haveFinishedFlowDetail(@RequestParam Map params){ + /** + * params + * taskId: 待办id 不能为null + */ + if(StringUtils.isEmpty((String) params.get("taskId"))){ + throw new RuntimeException("待办id不能为空。"); + } + return taskFeignClient.haveFinishedFlowDetail(params); + } + + @AutoLog(value = "删除草稿") + @ApiOperation(value="删除草稿", notes="删除草稿") + @GetMapping("/deleteDraft") + public Result deleteDraft(@RequestParam("id")String id){ + return taskFeignClient.deleteDraft(id); + } + + /** + * 开始分页 + * @param list + * @param pageNum 页码 + * @param pageSize 每页多少条数据 + * @return + */ + public static List startPage(List list, Integer pageNum, + Integer pageSize) { + if (list == null) { + return null; + } + if (list.size() == 0) { + return null; + } + + Integer count = list.size(); // 记录总数 + Integer pageCount = 0; // 页数 + if (count % pageSize == 0) { + pageCount = count / pageSize; + } else { + pageCount = count / pageSize + 1; + } + + int fromIndex = 0; // 开始索引 + int toIndex = 0; // 结束索引 + + if (pageNum != pageCount) { + fromIndex = (pageNum - 1) * pageSize; + toIndex = fromIndex + pageSize; + } else { + fromIndex = (pageNum - 1) * pageSize; + toIndex = count; + } + + List pageList = list.subList(fromIndex, toIndex); + + return pageList; + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/workFlowController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/workFlowController.java new file mode 100644 index 000000000..463c7c900 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/workFlowController.java @@ -0,0 +1,127 @@ +package com.jero.modules.wkflow.controller; + +import com.jero.common.api.vo.Result; +import com.jero.common.aspect.annotation.AutoLog; +import com.jero.modules.wkflow.entity.BusMes; +import com.jero.modules.wkflow.feginClient.impl.WorkFlowFeignClientImpl; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import net.sf.json.JSONObject; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.OutputStream; +import java.util.*; + +@Slf4j +@Api(tags="工作流管理") +@RestController +@RequestMapping("/workFlow") +public class workFlowController { + + @Autowired + private WorkFlowFeignClientImpl workFlowFeignClient; + + public Result activiti_define_start(@RequestBody JSONObject jsonObject){ + return workFlowFeignClient.activiti_define_start(jsonObject); + } + + @AutoLog(value = "启动流程-以流程定义id") + @ApiOperation(value="启动流程-以流程定义id", notes="启动流程-以流程定义id") + @PostMapping("/startProcess") + public Result startProcess(@RequestBody JSONObject jsonObject){ + String type = jsonObject.getString("type"); + if(type.equals("1")){ + jsonObject.put("id","flowId"); + return this.activiti_define_start(jsonObject); + }else{ + return null; + } + } + + @AutoLog(value = "完成任务") + @ApiOperation(value="完成任务", notes="完成任务") + @PostMapping("/completeTask") + public Result completeTaskByUserId(BusMes busMes){ + Result str = workFlowFeignClient.completeTaskByUserId(busMes); + if(str.getCode() == 500){ + str.setSuccess(false); + } + return str; + } + + @AutoLog(value = "通过流程实例id查询当前待办的流程实例是否结束") + @ApiOperation(value="通过流程实例id查询当前待办的流程实例是否结束", notes="通过流程实例id查询当前待办的流程实例是否结束") + @GetMapping("/queryTaskWhetherToEnd") + public String queryTaskWhetherToEnd(@RequestParam("prcId") String prcId) { + return workFlowFeignClient.queryTaskWhetherToEnd(prcId); + } + + @AutoLog(value = "改派") + @ApiOperation(value="改派", notes="改派") + @GetMapping("/changeAssigneeNew") + public Result run(@RequestParam("taskId")String taskId,@RequestParam("assignee") String assignee, + @RequestParam("userId")String userId,@RequestParam("pId") String pId) { + return workFlowFeignClient.run(taskId,assignee,userId,pId); + } + + @AutoLog(value = "保存任务第一步") + @ApiOperation(value="保存任务第一步", notes="保存任务第一步") + @PostMapping("/saveTaskFirst") + public Result saveTaskFirst(BusMes busMes){ + return workFlowFeignClient.saveTaskFirst(busMes); + } + + @AutoLog(value = "查询流程是否结束") + @ApiOperation(value="查询流程是否结束", notes="查询流程是否结束") + @GetMapping("/isEnd") + public String isEnd(@RequestParam("pId")String pId){ + return workFlowFeignClient.isEnd(pId); + } + + @AutoLog(value = "删除流程") + @ApiOperation(value="删除流程", notes="删除流程") + @GetMapping("/deleteProcessInstance") + public Result deleteProcessInstance(@RequestParam("pId")String pId){ + return workFlowFeignClient.deleteProcessInstance(pId); + } + + @AutoLog(value = "流程实例明细列表") + @ApiOperation(value="流程实例明细列表", notes="流程实例明细列表") + @GetMapping("/get_list_by_instance") + public List> get_list_by_instance(@RequestParam("prcNum") String prcNum,@RequestParam(value="sortWord",required = false)String sortWord,@RequestParam(value="shunxu",required = false) String shunxu){ + return workFlowFeignClient.get_list_by_instance(prcNum,sortWord,shunxu); + } + + @AutoLog(value = "获取图片") + @ApiOperation(value="获取图片", notes="获取图片") + @GetMapping("/getImg") + public void getImg(@RequestParam("prcNum")String prcNum,HttpServletResponse response) throws IOException { + OutputStream os = null; + response.setContentType("image/jpg"); + response.flushBuffer(); + os = response.getOutputStream(); + os.write(workFlowFeignClient.getImg(prcNum)); + os.flush(); + os.close(); + } + + @AutoLog(value = "强制撤回") + @ApiOperation(value="强制撤回", notes="强制撤回") + @GetMapping("/forceRecall") + public Result forceRecall(@RequestParam("prcId") String prcId){ + return workFlowFeignClient.forceRecall(prcId); + } + + @AutoLog(value = "查询流程") + @ApiOperation(value="查询流程", notes="查询流程") + @GetMapping("/modelListPage") + public Result> modelListPage(@RequestParam(value="name",required = false)String name, @RequestParam(value="category_id ",required = false)String category_id, + @RequestParam("current")int current, @RequestParam("size")int size){ + return workFlowFeignClient.modelListPage(name,category_id,current,size); + } + +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/entity/BusMes.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/entity/BusMes.java new file mode 100644 index 000000000..9efe58262 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/entity/BusMes.java @@ -0,0 +1,131 @@ +package com.jero.modules.wkflow.entity; + +public class BusMes { + + private String userId; + + private String taskId; + + private String json; + + private String taskIds; + + private String pId; + + private String prcType; + + private String createUser; + + private String createUserName; + + private String userName; + + private int size; + + private int current; + + private String id; + + private String nowStateType; + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getTaskId() { + return taskId; + } + + public void setTaskId(String taskId) { + this.taskId = taskId; + } + + public String getJson() { + return json; + } + + public void setJson(String json) { + this.json = json; + } + + public String getTaskIds() { + return taskIds; + } + + public void setTaskIds(String taskIds) { + this.taskIds = taskIds; + } + + public String getpId() { + return pId; + } + + public void setpId(String pId) { + this.pId = pId; + } + + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } + + public String getPrcType() { + return prcType; + } + + public void setPrcType(String prcType) { + this.prcType = prcType; + } + + public String getCreateUserName() { + return createUserName; + } + + public void setCreateUserName(String createUserName) { + this.createUserName = createUserName; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public int getSize() { + return size; + } + + public void setSize(int size) { + this.size = size; + } + + public int getCurrent() { + return current; + } + + public void setCurrent(int current) { + this.current = current; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getNowStateType() { return nowStateType; } + + public void setNowStateType(String nowStateType) { this.nowStateType = nowStateType; } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/entity/BusProcessName.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/entity/BusProcessName.java new file mode 100644 index 000000000..deaef9df2 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/entity/BusProcessName.java @@ -0,0 +1,64 @@ +package com.jero.modules.wkflow.entity; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; + + +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value="BusProcessName对象", description="") +public class BusProcessName implements Serializable { + + private static final long serialVersionUID=1L; + + private String id; + + private String prcName; + + private String prcId; + + private String prcMes; + + private String overTime; + + private String prcNum; + + private String creatTime; + + private String creatUser; + + private String prcType; + + private String taskIds; + + private String taskInfo; + + private String creatUserName; + + private String mes; + + private String endTime; + + private String taskAssignee; + + private String isEnd; + + private String taskBackAssignee; + + //流程节点(任务)定义key + private String taskDefinitionKey; + +// @TableField(exist = false) +// private String taskId; +// //审批时间 +// @TableField(exist = false) +// private String approvalTime; +// //状态 1通过 2驳回 +// @TableField(exist = false) +// private String status; +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/entity/BusProcessNew.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/entity/BusProcessNew.java new file mode 100644 index 000000000..e00a44de4 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/entity/BusProcessNew.java @@ -0,0 +1,37 @@ +package com.jero.modules.wkflow.entity; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value="BusProcessNew对象", description="") +public class BusProcessNew { + + private String id; + + private String msgType; + + private String standId; + + private String clauseId; + + private String userId; + + private String username; + + private String mesg; + + private String taskInfo; + + private String parentId; + + private String taskId; + + private String pId; + + private String finishFlag; +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/entity/Category.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/entity/Category.java new file mode 100644 index 000000000..b1f011939 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/entity/Category.java @@ -0,0 +1,56 @@ +package com.jero.modules.wkflow.entity; + +import java.util.Date; + +public class Category { + + private String objectId; + + private int isDeleted; + + private Date createTime; + + private String code; + + private String type; + + public String getObjectId() { + return objectId; + } + + public void setObjectId(String objectId) { + this.objectId = objectId; + } + + public int getIsDeleted() { + return isDeleted; + } + + public void setIsDeleted(int isDeleted) { + this.isDeleted = isDeleted; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/entity/TaskCommonQuery.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/entity/TaskCommonQuery.java new file mode 100644 index 000000000..a60fcc051 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/entity/TaskCommonQuery.java @@ -0,0 +1,49 @@ +package com.jero.modules.wkflow.entity; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@Data +@EqualsAndHashCode(callSuper = false) +public class TaskCommonQuery { + + @ApiModelProperty(value = "当前页") + private int current; + + @ApiModelProperty(value = "数量") + private int size; + + @ApiModelProperty(value = "名称") + private String name; + + @ApiModelProperty(value = "开始时间从") + private String startTime; + + @ApiModelProperty(value = "到") + private String endTime; + + @ApiModelProperty(value = "结束时间从") + private String finishStartTime; + + @ApiModelProperty(value = "到") + private String finishEndTime; + + @ApiModelProperty(value = "流程分类") + private String category_id; + + @ApiModelProperty(value = "用户Id") + private String userId; + + @ApiModelProperty(value = "流程名称") + private String prcName; + + @ApiModelProperty(value = "流程编号") + private String prcNum; + + @ApiModelProperty(value = "流程类型") + private String prcType; + + @ApiModelProperty(value = "高级搜索字符串") + private String advanceSearchVOStr; +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/ActivitiModelFeignClient.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/ActivitiModelFeignClient.java new file mode 100644 index 000000000..309ba7274 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/ActivitiModelFeignClient.java @@ -0,0 +1,76 @@ +package com.jero.modules.wkflow.feginClient; + +import com.jero.common.api.vo.Result; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; + +@FeignClient(value = "weilai-wkflow") +public interface ActivitiModelFeignClient { + + /** + * 创建流程模型 + * @param name + * @param desc + * @param category + * @return + */ + @RequestMapping(value = "/bat-wkflow/createModel",method = RequestMethod.GET) + Result createModel(@RequestParam("name")String name, + @RequestParam("desc") String desc, + @RequestParam("category") String category); + + /** + * 根据modelId获取model + * @param modelId + * @return + */ + @RequestMapping(value = "/bat-wkflow/model/json",method = RequestMethod.GET) + Object getEditorJson(@RequestParam("modelId")String modelId); + + /** + * 保存model信息 + * @param modelId + * @return + */ + @RequestMapping(value = "/bat-wkflow/model/save",method = RequestMethod.GET) + Result saveModel(@RequestParam("modelId")String modelId, + @RequestParam("name")String name, + @RequestParam("description") String description, + @RequestParam("jsonXml") String jsonXml, + @RequestParam("svgXml") String svgXml); + + /** + * 复制流程 + * @param modelId + * @return + */ + @RequestMapping(value = "/bat-wkflow/copyModel",method = RequestMethod.GET) + Result copyModel(@RequestParam("modelId")String modelId); + + /** + * 删除模板 + * @param modelId + * @return + */ + @RequestMapping(value = "/bat-wkflow/deleteModel",method = RequestMethod.GET) + Result deleteModel(@RequestParam("modelId")String modelId); + + /** + * 部署流程 + * @param modelId + * @return + */ + @RequestMapping(value = "/bat-wkflow/deploy",method = RequestMethod.GET) + Result deploy(@RequestParam("modelId")String modelId); + + /** + * 修改流程所属分类 + * @param modelId + * @param categoryId + * @return + */ + @RequestMapping(value = "/bat-wkflow/updatModel",method = RequestMethod.GET) + Result updatModel(@RequestParam("modelId")String modelId,@RequestParam("categoryId")String categoryId); +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/CategoryFeignClient.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/CategoryFeignClient.java new file mode 100644 index 000000000..035bf7c88 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/CategoryFeignClient.java @@ -0,0 +1,47 @@ +package com.jero.modules.wkflow.feginClient; + +import com.jero.common.api.vo.Result; +import com.jero.modules.wkflow.entity.Category; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; + +import java.util.List; + + +@FeignClient(value = "weilai-wkflow") +public interface CategoryFeignClient { + + /** + * 流程分类列表 + * @return + */ + @RequestMapping(value = "/bat-wkflow/category/category/list",method = RequestMethod.GET) + Result> categoryList(); + + /** + * 添加流程分类 + * @param category + * @return + */ + @RequestMapping(value = "/bat-wkflow/category/category/add",method = RequestMethod.POST) + Result addCategory(@RequestBody Category category); + + /** + * 删除流程分类 + * @param objectId + * @return + */ + @RequestMapping(value = "/bat-wkflow/category/category/delete",method = RequestMethod.GET) + Result deleteCategory(@RequestParam("objectId") String objectId); + + /** + * 编辑流程分类 + * @param category + * @return + */ + @RequestMapping(value = "/bat-wkflow/category/category/edit",method = RequestMethod.POST) + Result editCategory(@RequestBody Category category); +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/TaskFeignClient.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/TaskFeignClient.java new file mode 100644 index 000000000..dadbedaa9 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/TaskFeignClient.java @@ -0,0 +1,106 @@ +package com.jero.modules.wkflow.feginClient; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.jero.common.api.vo.Result; +import com.jero.modules.wkflow.entity.BusMes; +import com.jero.modules.wkflow.entity.BusProcessName; +import com.jero.modules.wkflow.entity.BusProcessNew; +import com.jero.modules.wkflow.entity.TaskCommonQuery; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; + +import java.util.List; +import java.util.Map; + +@FeignClient(value = "weilai-wkflow") +public interface TaskFeignClient { + /** + * 查询待办任务数据 + * @param taskIds + * @return + */ + @RequestMapping(value = "/bat-wkflow/queryDetail",method = RequestMethod.GET) + BusProcessNew queryTaskByTaskIds(@RequestParam("taskIds") String taskIds); + + /** + * 根据待办id,查询任务明细数据 + * @param taskIds + * @return + */ + @RequestMapping(value = "/bat-wkflow/zcfgrklcDetail",method = RequestMethod.GET) + String queryTaskDetailByTaskIds(@RequestParam("taskIds") String taskIds); + + /** + * 保存任务 + * @param busMes + * @return + */ + @RequestMapping(value = "/bat-wkflow/saveTask",method = RequestMethod.POST) + Result saveTask(@RequestBody BusMes busMes); + + /** + * 我的已办任务列表 + * @param taskCommonQuery + * @return + */ + @RequestMapping(value = "/bat-wkflow/hastodoTasksList",method = RequestMethod.POST) + Result> HastodoTasksListByUserId(@RequestBody TaskCommonQuery taskCommonQuery); + + /** + * 我的待办任务列表 + * @param taskCommonQuery + * @return + */ + @RequestMapping(value = "/bat-wkflow/todoTaskList",method = RequestMethod.POST) + List todoTaskListByUserId(@RequestBody TaskCommonQuery taskCommonQuery); + + /** + * 查询草稿 + * @param taskCommonQuery + */ + @RequestMapping(value = "/bat-wkflow/queryTaskDraft",method = RequestMethod.POST) + List queryTaskDraft(@RequestBody TaskCommonQuery taskCommonQuery); + + /** + * 已办流程 + * @param taskCommonQuery + * @return + */ + @RequestMapping(value = "/bat-wkflow/doneProcess",method = RequestMethod.POST) + IPage doneProcess(@RequestBody TaskCommonQuery taskCommonQuery); + + /** + * 已发流程 + * @param taskCommonQuery + * @return + */ + @RequestMapping(value = "/bat-wkflow/issuedProcess",method = RequestMethod.POST) + IPage issuedProcess(@RequestBody TaskCommonQuery taskCommonQuery); + + /** + * 监控流程列表 + * @param taskCommonQuery + * @return + */ + @RequestMapping(value = "/bat-wkflow/allProcess",method = RequestMethod.POST) + IPage allProcess(@RequestBody TaskCommonQuery taskCommonQuery); + + /** + * 已办流程-根据taskId查询已办明细 + * @param params + * @return + */ + @RequestMapping(value = "/bat-wkflow/datas/datas/haveFinishedFlowDetail",method = RequestMethod.GET) + String haveFinishedFlowDetail(@RequestParam Map params); + + /** + * 删除草稿 + * @param id + * @return + */ + @RequestMapping(value = "/bat-wkflow/deleteDraft",method = RequestMethod.GET) + Result deleteDraft(@RequestParam("id") String id); +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/WorkFlowFeignClient.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/WorkFlowFeignClient.java index a9562b50d..e1f4cddbf 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/WorkFlowFeignClient.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/WorkFlowFeignClient.java @@ -1,11 +1,17 @@ package com.jero.modules.wkflow.feginClient; import com.alibaba.fastjson.JSONObject; +import com.jero.common.api.vo.Result; +import com.jero.modules.wkflow.entity.BusMes; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; +import java.util.List; +import java.util.Map; + @FeignClient(value = "weilai-wkflow") public interface WorkFlowFeignClient { @RequestMapping(value = "/bat-wkflow/task/testGet",method = RequestMethod.GET) @@ -13,4 +19,102 @@ public interface WorkFlowFeignClient { @RequestMapping(value = "/bat-wkflow/task/testPost",method = RequestMethod.POST,headers = {"content-type=application/json"}) JSONObject testPost(String jsonObject); + + /** + * 启动流程-以流程定义id + * @param jsonObject + * @return + */ + @RequestMapping(value = "/bat-wkflow/activiti_define_start_user",method = RequestMethod.POST,headers = {"content-type=application/json"}) + Result activiti_define_start(String jsonObject); + + /** + * 完成任务 + * @param busMes + * @return + */ + @RequestMapping(value = "/bat-wkflow/completeTask",method = RequestMethod.POST) + Result completeTaskByUserId(@RequestBody BusMes busMes); + + /** + * 通过流程实例id查询当前待办的流程实例是否结束 + * @param prcId + * @return + */ + @RequestMapping(value = "/bat-wkflow/task/queryTaskWhetherToEnd",method = RequestMethod.GET) + String queryTaskWhetherToEnd(@RequestParam("prcId") String prcId); + + /** + * 改派 + * @param taskId + * @param assignee + * @param userId + * @param pId + * @return + */ + @RequestMapping(value = "/bat-wkflow/changeAssigneeNew",method = RequestMethod.GET) + Result run(@RequestParam("taskId") String taskId, @RequestParam("assignee") String assignee, + @RequestParam("userId") String userId, @RequestParam("pId") String pId); + + /** + * 保存任务第一步 + * @param busMes + */ + @RequestMapping(value = "/bat-wkflow/saveTaskFirst",method = RequestMethod.POST) + Result saveTaskFirst(@RequestBody BusMes busMes); + + /** + * 查询流程是否结束 + * @param pId + * @return + */ + @RequestMapping(value = "/bat-wkflow/isEnd",method = RequestMethod.GET) + String isEnd(@RequestParam("pId") String pId); + + /** + * 删除流程 + * @param pId + * @return + */ + @RequestMapping(value = "/bat-wkflow/deleteProcessInstance",method = RequestMethod.GET) + Result deleteProcessInstance(@RequestParam("pId") String pId); + + /** + * 流程实例明细列表 + * @param prcNum + * @param sortWord + * @param shunxu + * @return + */ + @RequestMapping(value = "/bat-wkflow/task/get_list_by_instance",method = RequestMethod.GET) + List> get_list_by_instance(@RequestParam("prcNum") String prcNum, @RequestParam(value="sortWord",required = false)String sortWord, @RequestParam(value="shunxu",required = false) String shunxu); + + /** + * 获取图片 + * @param prcNum + * @return + */ + @RequestMapping(value = "/bat-wkflow/instance/getImg",method = RequestMethod.GET) + byte[] getImg(@RequestParam("prcNum") String prcNum); + + /** + * 强制撤回 + * @param prcId + * @return + */ + @RequestMapping(value = "/bat-wkflow/forceRecall",method = RequestMethod.GET) + Result forceRecall(@RequestParam("prcId") String prcId); + + /** + * 查询流程 + * @param name + * @param category_id + * @param current + * @param size + * @return + */ + @RequestMapping(value = "/bat-wkflow/modelListPage",method = RequestMethod.GET) + Result> modelListPage(@RequestParam("name")String name, @RequestParam("category_id")String category_id, + @RequestParam("current")int current, @RequestParam("size")int size); + } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/impl/ActivitiModelFeignClientImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/impl/ActivitiModelFeignClientImpl.java new file mode 100644 index 000000000..0e6389a1e --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/impl/ActivitiModelFeignClientImpl.java @@ -0,0 +1,90 @@ +package com.jero.modules.wkflow.feginClient.impl; + +import com.jero.common.api.vo.Result; +import com.jero.modules.wkflow.feginClient.ActivitiModelFeignClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.RequestParam; + +@Component +public class ActivitiModelFeignClientImpl { + + @Autowired + private ActivitiModelFeignClient activitiModelFeignClient; + + /** + * 创建流程模型 + * @param name + * @param desc + * @param category + * @return + */ + public Result createModel(@RequestParam("name")String name, + @RequestParam("desc") String desc, + @RequestParam("category") String category){ + return activitiModelFeignClient.createModel(name, desc, category); + } + + /** + * 保存model信息 + * @param modelId + * @param name + * @param description + * @param jsonXml + * @param svgXml + * @return + */ + public Result saveModel(@RequestParam("modelId")String modelId, + @RequestParam("name")String name, + @RequestParam("description") String description, + @RequestParam("jsonXml") String jsonXml, + @RequestParam("svgXml") String svgXml){ + return activitiModelFeignClient.saveModel(modelId,name,description,jsonXml,svgXml); + } + + /** + * 删除模板 + * @param modelId + * @return + */ + public Result deleteModel(@RequestParam("modelId")String modelId){ + return activitiModelFeignClient.deleteModel(modelId); + } + + /** + * 修改流程所属分类 + * @param modelId + * @param categoryId + * @return + */ + public Result updatModel(@RequestParam("modelId")String modelId,@RequestParam("categoryId")String categoryId){ + return activitiModelFeignClient.updatModel(modelId,categoryId); + } + + /** + * 复制流程 + * @param modelId + * @return + */ + public Result copyModel(@RequestParam("modelId")String modelId){ + return activitiModelFeignClient.copyModel(modelId); + } + + /** + * 部署流程 + * @param modelId + * @return + */ + public Result deploy(@RequestParam("modelId")String modelId){ + return activitiModelFeignClient.deploy(modelId); + } + + /** + * 根据modelId获取model + * @param modelId + * @return + */ + public Object getEditorJson(@RequestParam("modelId")String modelId){ + return activitiModelFeignClient.getEditorJson(modelId); + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/impl/CategoryFeignClientImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/impl/CategoryFeignClientImpl.java new file mode 100644 index 000000000..7003195f2 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/impl/CategoryFeignClientImpl.java @@ -0,0 +1,53 @@ +package com.jero.modules.wkflow.feginClient.impl; + +import com.jero.common.api.vo.Result; +import com.jero.modules.wkflow.entity.Category; +import com.jero.modules.wkflow.feginClient.CategoryFeignClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; + +import java.util.List; + +@Component +public class CategoryFeignClientImpl { + + @Autowired + private CategoryFeignClient categoryFeignClient; + + /** + * 流程分类列表 + * @return + */ + public Result> categoryList(){ + return categoryFeignClient.categoryList(); + } + + /** + * 添加流程分类 + * @param category + * @return + */ + public Result addCategory(@RequestBody Category category){ + return categoryFeignClient.addCategory(category); + } + + /** + * 删除流程分类 + * @param objectId + * @return + */ + public Result deleteCategory(@RequestParam("objectId") String objectId){ + return categoryFeignClient.deleteCategory(objectId); + } + + /** + * 编辑流程分类 + * @param category + * @return + */ + public Result editCategory(@RequestBody Category category){ + return categoryFeignClient.editCategory(category); + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/impl/TaskFeignClientImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/impl/TaskFeignClientImpl.java new file mode 100644 index 000000000..d469107c8 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/impl/TaskFeignClientImpl.java @@ -0,0 +1,129 @@ +package com.jero.modules.wkflow.feginClient.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.jero.common.api.vo.Result; +import com.jero.modules.wkflow.entity.BusMes; +import com.jero.modules.wkflow.entity.BusProcessName; +import com.jero.modules.wkflow.entity.BusProcessNew; +import com.jero.modules.wkflow.entity.TaskCommonQuery; +import com.jero.modules.wkflow.feginClient.TaskFeignClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; + +import java.util.List; +import java.util.Map; + +@Component +public class TaskFeignClientImpl { + + @Autowired + private TaskFeignClient taskFeignClient; + + /** + * 查询待办任务数据 + * @param taskIds + * @return + */ + public BusProcessNew queryTaskByTaskIds(@RequestParam("taskIds") String taskIds){ + return taskFeignClient.queryTaskByTaskIds(taskIds); + } + + /** + * 根据待办id,查询任务明细数据 + * @param taskIds + * @return + */ + public String queryTaskDetailByTaskIds(@RequestParam("taskIds") String taskIds){ + return taskFeignClient.queryTaskDetailByTaskIds(taskIds); + } + + /** + * 保存任务 + * @param busMes + * @return + */ + public Result saveTask(@RequestBody BusMes busMes){ + Result stringWrapper = taskFeignClient.saveTask(busMes); + return stringWrapper; + } + + /** + * 我的已办任务列表 + * @param taskCommonQuery + * @return + */ + public Result> HastodoTasksListByUserId(@RequestBody TaskCommonQuery taskCommonQuery){ + Result> mapWrapper = taskFeignClient.HastodoTasksListByUserId(taskCommonQuery); + return mapWrapper; + } + + /** + * 我的待办任务列表 + * @param taskCommonQuery + * @return + */ + public List todoTaskListByUserId(@RequestBody TaskCommonQuery taskCommonQuery){ + List mapWrapper = taskFeignClient.todoTaskListByUserId(taskCommonQuery); + return mapWrapper; + } + + /** + * 查询草稿 + * @param taskCommonQuery + * @return + */ + public List queryTaskDraft(@RequestBody TaskCommonQuery taskCommonQuery){ + List busProcessNames = taskFeignClient.queryTaskDraft(taskCommonQuery); + return busProcessNames; + } + + /** + * 已办流程 + * @param taskCommonQuery + * @return + */ + public IPage doneProcess(@RequestBody TaskCommonQuery taskCommonQuery){ + IPage busProcessNames = taskFeignClient.doneProcess(taskCommonQuery); + return busProcessNames; + } + + /** + * 已发流程 + * @param taskCommonQuery + * @return + */ + public IPage issuedProcess(@RequestBody TaskCommonQuery taskCommonQuery){ + IPage busProcessNames = taskFeignClient.issuedProcess(taskCommonQuery); + return busProcessNames; + } + + /** + * 监控流程列表 + * @param taskCommonQuery + * @return + */ + public IPage allProcess(@RequestBody TaskCommonQuery taskCommonQuery){ + return taskFeignClient.allProcess(taskCommonQuery); + } + + /** + * 已办流程-根据taskId查询已办明细 + * @param params + * @return + */ + public String haveFinishedFlowDetail(@RequestParam Map params) { + return taskFeignClient.haveFinishedFlowDetail(params); + } + + /** + * 删除草稿 + * @param id + * @return + */ + public Result deleteDraft(@RequestParam("id")String id){ + return taskFeignClient.deleteDraft(id); + } + +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/impl/WorkFlowFeignClientImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/impl/WorkFlowFeignClientImpl.java index 7d515475d..cd8b1ddb6 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/impl/WorkFlowFeignClientImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/impl/WorkFlowFeignClientImpl.java @@ -1,9 +1,16 @@ package com.jero.modules.wkflow.feginClient.impl; import com.alibaba.fastjson.JSONObject; +import com.jero.common.api.vo.Result; +import com.jero.modules.wkflow.entity.BusMes; import com.jero.modules.wkflow.feginClient.WorkFlowFeignClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; + +import java.util.List; +import java.util.Map; @Component public class WorkFlowFeignClientImpl{ @@ -18,4 +25,116 @@ public class WorkFlowFeignClientImpl{ public JSONObject testPost(JSONObject jsonObject) { return workFlowFeignClient.testPost(jsonObject.toString()); } + + /** + * 启动流程-以流程定义id + * @param jsonObject + * @return + */ + public Result activiti_define_start(@RequestBody net.sf.json.JSONObject jsonObject){ + Result stringWrapper = workFlowFeignClient.activiti_define_start(jsonObject.toString()); + return Result.OK(stringWrapper.getResult()); + } + + /** + * 完成任务 + * @param busMes + * @return + */ + public Result completeTaskByUserId( BusMes busMes){ + Result stringWrapper = workFlowFeignClient.completeTaskByUserId(busMes); + return stringWrapper; + } + + /** + * 通过流程实例id查询当前待办的流程实例是否结束 + * @param prcId + * @return + */ + public String queryTaskWhetherToEnd(@RequestParam("prcId") String prcId) { + return workFlowFeignClient.queryTaskWhetherToEnd(prcId); + } + + /** + * 改派 + * @param taskId + * @param assignee + * @param userId + * @param pId + * @return + */ + public Result run(@RequestParam("taskId")String taskId,@RequestParam("assignee") String assignee, + @RequestParam("userId")String userId,@RequestParam("pId") String pId){ + Result run = workFlowFeignClient.run(taskId, assignee,userId,pId); + return run; + } + + /** + * 保存任务第一步 + * @param busMes + * @return + */ + public Result saveTaskFirst(BusMes busMes){ + return workFlowFeignClient.saveTaskFirst(busMes); + } + + /** + * 查询流程是否结束 + * @param pId + * @return + */ + public String isEnd(@RequestParam("pId")String pId){ + return workFlowFeignClient.isEnd(pId); + } + + /** + * 删除流程 + * @param pId + * @return + */ + public Result deleteProcessInstance(@RequestParam("pId")String pId){ + return workFlowFeignClient.deleteProcessInstance(pId); + } + + /** + * 流程实例明细列表 + * @param prcNum + * @param sortWord + * @param shunxu + * @return + */ + public List> get_list_by_instance(@RequestParam("prcNum") String prcNum, @RequestParam(value="sortWord",required = false)String sortWord, @RequestParam(value="shunxu",required = false) String shunxu){ + return workFlowFeignClient.get_list_by_instance(prcNum,sortWord,shunxu); + } + + /** + * 获取图片 + * @param prcNum + * @return + */ + public byte[] getImg(@RequestParam("prcNum")String prcNum){ + return workFlowFeignClient.getImg(prcNum); + } + + /** + * 强制撤回 + * @param prcId + * @return + */ + public Result forceRecall(@RequestParam("prcId") String prcId){ + return workFlowFeignClient.forceRecall(prcId); + } + + /** + * 查询流程 + * @param name + * @param category_id + * @param current + * @param size + * @return + */ + public Result> modelListPage(@RequestParam("name")String name, @RequestParam("category_id")String category_id, + @RequestParam("current")int current, @RequestParam("size")int size){ + return workFlowFeignClient.modelListPage(name,category_id,current,size); + } }