diff --git a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/BusinessTaskParam.java b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/BusinessTaskParam.java new file mode 100644 index 00000000..04961016 --- /dev/null +++ b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/BusinessTaskParam.java @@ -0,0 +1,35 @@ +package com.yxt.supervise.feign.flowable; + +import lombok.Data; +/** + * task 查询参数 + */ +@Data +public class BusinessTaskParam { + + public BusinessTaskParam(){} + + public BusinessTaskParam(String field, String value) { + this.field = field; + this.sqlOperationSymbol = SQLOperationSymbol.EQUAL; + this.value = value; + } + + public BusinessTaskParam(String field, String value, SQLOperationSymbol sqlOperationSymbol) { + this.field = field; + this.sqlOperationSymbol = sqlOperationSymbol; + this.value = value; + } + /** + * 字段 + */ + private String field; + /** + * 运算符号 + */ + private SQLOperationSymbol sqlOperationSymbol; + /** + * 值 + */ + private String value; +} diff --git a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/BusinessTaskQuery.java b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/BusinessTaskQuery.java new file mode 100644 index 00000000..d1295eff --- /dev/null +++ b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/BusinessTaskQuery.java @@ -0,0 +1,28 @@ +package com.yxt.supervise.feign.flowable; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * task 查询参数 集合 + */ +@Data +public class BusinessTaskQuery implements Query { + private List fields = new ArrayList<>(); + + public static BusinessTaskQuery create(){ + BusinessTaskQuery bt = new BusinessTaskQuery(); + return bt; + } + public BusinessTaskQuery add(BusinessTaskParam param){ + if(fields==null){ + fields = new ArrayList<>(); + } + fields.add(param); + return this; + } + +} diff --git a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/BusinessVariables.java b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/BusinessVariables.java new file mode 100644 index 00000000..1e12b7fa --- /dev/null +++ b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/BusinessVariables.java @@ -0,0 +1,65 @@ +package com.yxt.supervise.feign.flowable; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.HashMap; +import java.util.Map; + +/** + * 业务系统调用flowable流程传递参数的格式 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class BusinessVariables { + /** + * 分公司sid + */ + public static final String ORGPATH="orgPath"; + /** + * 流程定义的id + */ + private String modelId; + /** + * 审批意见 + */ + private String comment; + /** + * 流程实例的id + */ + private String instanceId; + /** + * taskId + */ + private String taskId; + /** + * 当前用户的id + */ + private String userSid; + /** + * 当前用户部门的全路径 + */ + private String orgSidPath; + /** + * 业务sid + */ + private String businessSid; + /** + * 环节定义的ID + */ + private String taskDefKey; + /** + * nextNodeUserSids 下一环节的用户sid + */ + private String nextNodeUserSids; + /** + * 业务参数,按需传递 + */ + private Map formVariables =new HashMap<>(); + /* @ApiModelProperty("机构sid:切换结构使用") + private String orgPath;*/ +} diff --git a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/SQLOperationSymbol.java b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/SQLOperationSymbol.java new file mode 100644 index 00000000..e801f9fb --- /dev/null +++ b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/SQLOperationSymbol.java @@ -0,0 +1,38 @@ +package com.yxt.supervise.feign.flowable; + +/** + * sql语句运算符号,“=”,“like”,"in",">","<" + */ +public enum SQLOperationSymbol { + EQUAL("=","相等"), + LIKE("like","模糊查询"), + LT("<","大于"),//LESS THAN小于 + GT(">","小于"),//GT 就是 GREATER THAN大于  + GE(">=","大于等于"),// GREATER THAN OR EQUAL 大于等于 + LE("<=","小于等于"),//LESS THAN OR EQUAL 小于等于 + NE("<>","不等于"),//NOT EQUAL不等于 + NONE("","无"); + private String symbol; + private String desc; + + SQLOperationSymbol(String symbol, String desc) { + this.symbol = symbol; + this.desc = desc; + } + + public String getSymbol() { + return symbol; + } + + public void setSymbol(String symbol) { + this.symbol = symbol; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } +} diff --git a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/StartProcessInstanceQuery.java b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/StartProcessInstanceQuery.java new file mode 100644 index 00000000..d4e86848 --- /dev/null +++ b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/StartProcessInstanceQuery.java @@ -0,0 +1,27 @@ +package com.yxt.supervise.feign.flowable; + +import com.yxt.common.core.query.Query; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Map; + +/** + * @author dimengzhe + * @date 2021/7/29 15:03 + * @description + */ +@Data +public class StartProcessInstanceQuery implements Query { + private static final long serialVersionUID = -6372254084412955318L; + + @ApiModelProperty(value = "流程定义key", required = true) +// private String processDefinitionKey; + private String processDefinitionId; + + @ApiModelProperty(value = "用户sid", required = true) + private String userSid; + + @ApiModelProperty(value = "启动流程变量") + private Map variables; +} diff --git a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/UpdateFlowFieldVo.java b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/UpdateFlowFieldVo.java new file mode 100644 index 00000000..d33718a7 --- /dev/null +++ b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/UpdateFlowFieldVo.java @@ -0,0 +1,68 @@ +package com.yxt.supervise.feign.flowable; + +public class UpdateFlowFieldVo { + + private String sid; + private String procDefId; + private String nodeState; + private String procInsId; + private String taskDefKey; + private String taskId; + private String nextNodeUserSids; + + public String getNextNodeUserSids() { + return nextNodeUserSids; + } + + public void setNextNodeUserSids(String nextNodeUserSids) { + this.nextNodeUserSids = nextNodeUserSids; + } + + public String getSid() { + return sid; + } + + public void setSid(String sid) { + this.sid = sid; + } + + public String getProcDefId() { + return procDefId; + } + + public void setProcDefId(String procDefId) { + this.procDefId = procDefId; + } + + public String getNodeState() { + return nodeState; + } + + public void setNodeState(String nodeState) { + this.nodeState = nodeState; + } + + public String getProcInsId() { + return procInsId; + } + + public void setProcInsId(String procInsId) { + this.procInsId = procInsId; + } + + public String getTaskDefKey() { + return taskDefKey; + } + + public void setTaskDefKey(String taskDefKey) { + this.taskDefKey = taskDefKey; + } + + public String getTaskId() { + return taskId; + } + + public void setTaskId(String taskId) { + this.taskId = taskId; + } +} diff --git a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/UserAndOrgPath.java b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/UserAndOrgPath.java new file mode 100644 index 00000000..39be10f9 --- /dev/null +++ b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/UserAndOrgPath.java @@ -0,0 +1,15 @@ +package com.yxt.supervise.feign.flowable; + +import lombok.Data; + +@Data +public class UserAndOrgPath { + /** + * 用户sid + */ + private String userSid; + /** + * 组织及部门sid全路径 + */ + private String orgPath; +} diff --git a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/AppUserVo.java b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/AppUserVo.java new file mode 100644 index 00000000..b36c0859 --- /dev/null +++ b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/AppUserVo.java @@ -0,0 +1,23 @@ +package com.yxt.supervise.feign.flowable.flowtask; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.yxt.common.core.vo.Vo; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @Author dimengzhe + * @Date 2022/7/28 16:24 + * @Description + */ +@Data +public class AppUserVo implements Vo { + private static final long serialVersionUID = -3220584066025636920L; + @ApiModelProperty(value = "名称") + @JsonProperty("name") + private String assigneeName; + @ApiModelProperty(value = "头像") + @JsonProperty("image") + private String assigneeHeadImage; + +} diff --git a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/CompleteTaskQuery.java b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/CompleteTaskQuery.java new file mode 100644 index 00000000..f8767574 --- /dev/null +++ b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/CompleteTaskQuery.java @@ -0,0 +1,42 @@ +package com.yxt.supervise.feign.flowable.flowtask; + +import com.yxt.common.core.query.Query; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Map; + +/** + * @author dimengzhe + * @date 2021/8/4 18:22 + * @description + */ +@Data +public class CompleteTaskQuery implements Query { + private static final long serialVersionUID = 5847441978537887466L; + + @ApiModelProperty(value = "用户sid") + private String userSid; + + @ApiModelProperty("任务Id") + private String taskId; + + @ApiModelProperty("用户Id") + private String userId; + + @ApiModelProperty("任务意见") + private String comment; + + @ApiModelProperty("流程实例Id") + private String instanceId; + + + + + + @ApiModelProperty(value = "流程标题", required = false) + private String formTitle; + + @ApiModelProperty(value = "任务参数", required = false) + private Map variables; +} diff --git a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/FlowTask.java b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/FlowTask.java new file mode 100644 index 00000000..36d0a678 --- /dev/null +++ b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/FlowTask.java @@ -0,0 +1,106 @@ +package com.yxt.supervise.feign.flowable.flowtask; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.domain.BaseEntity; +import com.yxt.supervise.system.flow.FlowCommentDto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + *

工作流任务

+ * + * @author XuanXuan + * @date 2021-04-03 + */ +@ApiModel("工作流任务相关-返回参数") +@Data +public class FlowTask extends BaseEntity implements Serializable { + + @ApiModelProperty("任务编号") + private String taskId; + + @ApiModelProperty("任务名称") + private String taskName; + + @ApiModelProperty("任务Key") + private String taskDefKey; + + @ApiModelProperty("任务执行人Id") + private Long assigneeId; + + @ApiModelProperty("部门名称") + private String deptName; + + @ApiModelProperty("流程发起人部门名称") + private String startDeptName; + + @ApiModelProperty("任务执行人名称") + private String assigneeName; + + @ApiModelProperty("任务执行人头像") + private String assigneeHeadImage; + + @ApiModelProperty("流程发起人Id") + private String startUserId; + + @ApiModelProperty("流程发起人名称") + private String startUserName; + + @ApiModelProperty("流程类型") + private String category; + + @ApiModelProperty("流程变量信息") + private Object procVars; + + @ApiModelProperty("局部变量信息") + private Object taskLocalVars; + + @ApiModelProperty("流程部署编号") + private String deployId; + + @ApiModelProperty("流程ID") + private String procDefId; + + @ApiModelProperty("流程key") + private String procDefKey; + + @ApiModelProperty("流程定义名称") + private String procDefName; + + @ApiModelProperty("流程定义内置使用版本") + private int procDefVersion; + + @ApiModelProperty("流程实例ID") + private String procInsId; + + @ApiModelProperty("历史流程实例ID") + private String hisProcInsId; + + @ApiModelProperty("任务耗时") + private String duration; + + @ApiModelProperty("任务意见") + private FlowCommentDto comment = new FlowCommentDto(); + + @ApiModelProperty("候选执行人") + private String candidate; + + /* @ApiModelProperty("任务创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" ) + private String createTime;*/ + + @ApiModelProperty("任务完成时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private String finishTime; + + @ApiModelProperty("流程完成时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS" ) + private String processEndTime; + + @ApiModelProperty("环节的办理人信息") + private List taskUserInfos; +} diff --git a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/FlowTaskFeign.java b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/FlowTaskFeign.java new file mode 100644 index 00000000..0c27bdc3 --- /dev/null +++ b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/FlowTaskFeign.java @@ -0,0 +1,186 @@ +package com.yxt.supervise.feign.flowable.flowtask; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yxt.supervise.feign.flowable.UserAndOrgPath; +import com.yxt.supervise.feign.flowable.utils.RecordQuery; +import com.yxt.supervise.feign.flowable.BusinessTaskQuery; +import com.yxt.supervise.feign.flowable.BusinessVariables; +import com.yxt.supervise.feign.flowable.StartProcessInstanceQuery; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.supervise.system.flow.FlowRecordVo; +import com.yxt.supervise.system.flow.FlowTaskDto; +import com.yxt.supervise.system.flow.FlowTaskQuery; +import com.yxt.supervise.system.flow.FlowTaskVo; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * @author dimengzhe + * @date 2021/7/29 14:37 + * @description + */ +@FeignClient( + contextId = "supervise-flowable-FlowTask", + name = "supervise-flowable", + path = "v1/flowable/task", + fallback = FlowTaskFeignFallBack.class) +public interface FlowTaskFeign { + + @ApiOperation(value = "启动流程") + @PostMapping("/startProcessInstanceByKey") + @ResponseBody + ResultBean startProcessInstanceByKey(@RequestBody StartProcessInstanceQuery startProcessInstanceQuery); + + @ApiOperation(value = "业务系统审批") + @PostMapping("/businessComplete") + @ResponseBody + ResultBean businessComplete(@RequestBody BusinessVariables dto); + + @ApiOperation(value = "审批") + @PostMapping("/complete") + @ResponseBody + ResultBean complete(@RequestBody FlowTaskVo flowTaskVo); + + @ApiOperation(value = "待办任务列表") + @PostMapping("/todoList") + @ResponseBody + ResultBean todoList(@RequestBody PagerQuery taskQueryPagerQuery); + + @ApiOperation(value = "业务系统查询待办任务列表") + @PostMapping("/businessTodoList/{userSid}") + @ResponseBody + ResultBean> businessTodoList(@ApiParam(value = "当前用户sid") @PathVariable(value = "userSid") String userSid, + @RequestBody PagerQuery taskQueryPagerQuery); + + @ApiOperation(value = "业务系统查询待办任务列表包含url") + @PostMapping("/businessTodoListForApp/{userSid}") + @ResponseBody + ResultBean> businessTodoListForApp(@ApiParam(value = "当前用户sid") @PathVariable(value = "userSid") String userSid, + @RequestBody PagerQuery taskQueryPagerQuery); + + @ApiOperation(value = "业务系统查询待办任务列表数量") + @GetMapping("/getTodoNum/{userSid}") + ResultBean getTodoNum(@PathVariable(value = "userSid") String userSid); + + @ApiOperation(value = "业务系统查询待办任务列表数量") + @PostMapping("/getTodoNum") + @ResponseBody + ResultBean getTodoNum(@RequestBody UserAndOrgPath uaop); + + @ApiOperation(value = "已办任务列表") + @PostMapping("/doneList") + @ResponseBody + ResultBean doneList(@RequestBody PagerQuery taskQueryPagerQuery); + + @ApiOperation(value = "业务系统查询已办任务列表") + @PostMapping("/businessDoneList/{userSid}") + @ResponseBody + ResultBean businessDoneList(@ApiParam(value = "当前用户sid") @PathVariable(value = "userSid") String userSid, + @RequestBody PagerQuery taskQueryPagerQuery); + + @ApiOperation(value = "业务系统查询已办任务列表_移动端") + @PostMapping("/businessDoneListForApp/{userSid}") + @ResponseBody + ResultBean> businessDoneListForApp(@ApiParam(value = "当前用户sid") @PathVariable(value = "userSid") String userSid, + @RequestBody PagerQuery taskQueryPagerQuery); + + @ApiOperation(value = "流程历史流转记录") + @PostMapping(value = "/flowRecord") + @ResponseBody + ResultBean flowRecord(@RequestBody RecordQuery recordQuery); + + @ApiOperation(value = "取消申请") + @PostMapping(value = "/stopProcess/{userSid}") + @ResponseBody + ResultBean stopProcess(@ApiParam(value = "当前用户sid") @PathVariable(value = "userSid") String userSid, + @RequestBody FlowTaskVo flowTaskVo); + + @ApiOperation(value = "我的流程分页列表") + @PostMapping(value = "/myprocess") + @ResponseBody + ResultBean myprocess(@RequestBody PagerQuery taskQueryPagerQuery); + + @ApiOperation(value = "业务系统查询我的流程分页列表") + @PostMapping(value = "/businessMyprocess/{userSid}") + @ResponseBody + ResultBean businessMyprocess(@ApiParam(value = "当前用户sid") @PathVariable(value = "userSid") String userSid, + @RequestBody PagerQuery taskQueryPagerQuery); + + @ApiOperation(value = "获取流程变量") + @GetMapping(value = "/processVariables/{taskId}") + @ResponseBody + ResultBean processVariables(@ApiParam(value = "流程任务Id") @PathVariable(value = "taskId") String taskId); + + /** + * 生成流程图 + * + * @param procInsId 任务ID + */ + @RequestMapping("/flowViewer/{procInsId}") + public ResultBean getFlowViewer(@PathVariable("procInsId") String procInsId); + + @ApiOperation(value = "获取所有可回退的节点") + @PostMapping(value = "/returnList") + public ResultBean findReturnTaskList(@RequestBody FlowTaskVo flowTaskVo); + + + @ApiOperation(value = "退回任务") + @PostMapping(value = "/return") + public ResultBean taskReturn(@RequestBody FlowTaskVo flowTaskVo); + + @ApiOperation(value = "驳回任务") + @PostMapping(value = "/reject") + public ResultBean> taskReject(@RequestBody FlowTaskVo flowTaskVo); + + @ApiOperation(value = "撤回流程", response = FlowTaskDto.class) + @PostMapping(value = "/revokeProcess") + public ResultBean> revokeProcess(@RequestBody FlowTaskVo flowTaskVo); + + @ApiOperation(value = "终止流程") + @PostMapping(value = "/breakProcess") + public ResultBean breakProcess(@RequestBody FlowTaskVo flowTaskVo); + + @ApiOperation(value = "流程历史流转记录") + @GetMapping(value = "/flowRecord/{procInsId}/{deployId}") + public ResultBean flowRecord(@PathVariable(value = "procInsId") String procInsId, + @PathVariable(value = "deployId") String deployId); + + @ApiOperation(value = "业务系统流程历史流转记录") + @GetMapping(value = "/businessFlowRecord/{procInsId}") + public ResultBean businessFlowRecord(@PathVariable(value = "procInsId") String procInsId); + + @ApiOperation(value = "删除流程实例") + @DeleteMapping(value = "/deleteProcess/{procInsId}") + @ResponseBody + ResultBean deleteProcess(@PathVariable(value = "procInsId") String procInsId); + + @ApiOperation(value = "获取当前环节的下一分支节点") + @PostMapping(value = "/getNextTasks/{taskId}") + public ResultBean getNextTasks(@PathVariable(value = "taskId") String taskId); + + @ApiOperation(value = "根据流程实例的id获取最新待办环节") + @PostMapping(value = "/getLatestTasks/{procId}") + ResultBean> getLatestTasks(@PathVariable(value = "procId") String procId); + + + @ApiOperation(value = "根据流程实例的id获取最新待办环节") + @PostMapping(value = "/getProcessCirculationNodesByMap") + ResultBean getProcessCirculationNodesByMap(@RequestBody BusinessVariables bv); + + @ApiOperation("获取流程图") + @GetMapping("/readXml/{sid}") + ResultBean readXml(@PathVariable(value = "sid") String sid); + + @ApiOperation(value = "获取下一个环节") + @PostMapping(value = "/getNextNodesForSubmit") + ResultBean getNextNodesForSubmit(@RequestBody BusinessVariables bv); + + @ApiOperation(value = "根据流程实例的id获取最新待办环节") + @PostMapping(value = "/获取上一个环节") + ResultBean getPreviousNodesForReject(@RequestBody BusinessVariables bv); +} diff --git a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/FlowTaskFeignFallBack.java b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/FlowTaskFeignFallBack.java new file mode 100644 index 00000000..00e80890 --- /dev/null +++ b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/FlowTaskFeignFallBack.java @@ -0,0 +1,181 @@ +package com.yxt.supervise.feign.flowable.flowtask; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yxt.supervise.feign.flowable.UserAndOrgPath; +import com.yxt.supervise.feign.flowable.utils.RecordQuery; +import com.yxt.supervise.feign.flowable.BusinessTaskQuery; +import com.yxt.supervise.feign.flowable.BusinessVariables; +import com.yxt.supervise.feign.flowable.StartProcessInstanceQuery; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.supervise.system.flow.FlowTaskDto; +import com.yxt.supervise.system.flow.FlowTaskQuery; +import com.yxt.supervise.system.flow.FlowTaskVo; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @author dimengzhe + * @date 2021/8/20 15:43 + * @description + */ +@Component +public class FlowTaskFeignFallBack implements FlowTaskFeign { + @Override + public ResultBean startProcessInstanceByKey(StartProcessInstanceQuery startProcessInstanceQuery) { + return null; + } + + @Override + public ResultBeanbusinessComplete (BusinessVariables dto) { + return null; + } + + @Override + public ResultBean complete(FlowTaskVo flowTaskVo) { + return null; + } + + @Override + public ResultBean> todoList(PagerQuery taskQueryPagerQuery) { + return null; + } + + @Override + public ResultBean> businessTodoList(String userSid, PagerQuery taskQueryPagerQuery) { + return null; + } + + @Override + public ResultBean> businessTodoListForApp(String userSid, PagerQuery taskQueryPagerQuery) { + return null; + } + + @Override + public ResultBean getTodoNum(String userSid) { + return null; + } + + @Override + public ResultBean getTodoNum(UserAndOrgPath uaop) { + return null; + } + + + @Override + public ResultBean doneList(PagerQuery taskQueryPagerQuery) { + return null; + } + + @Override + public ResultBean businessDoneList(String userSid, PagerQuery taskQueryPagerQuery) { + return null; + } + + @Override + public ResultBean businessDoneListForApp(String userSid, PagerQuery taskQueryPagerQuery) { + return null; + } + + @Override + public ResultBean flowRecord(RecordQuery recordQuery) { + return null; + } + + @Override + public ResultBean stopProcess(String userSid, FlowTaskVo flowTaskVo) { + return null; + } + + + @Override + public ResultBean myprocess(PagerQuery taskQueryPagerQuery) { + return null; + } + + @Override + public ResultBean businessMyprocess(String userSid, PagerQuery taskQueryPagerQuery) { + return null; + } + + @Override + public ResultBean processVariables(String taskId) { + return null; + } + + @Override + public ResultBean getFlowViewer(String procInsId) { + return null; + } + + @Override + public ResultBean findReturnTaskList(FlowTaskVo flowTaskVo) { + return null; + } + + @Override + public ResultBean taskReturn(FlowTaskVo flowTaskVo) { + return null; + } + + @Override + public ResultBean taskReject(FlowTaskVo flowTaskVo) { + return null; + } + @Override + public ResultBean revokeProcess(FlowTaskVo flowTaskVo) { + return null; + } + + @Override + public ResultBean breakProcess(FlowTaskVo flowTaskVo) { + return null; + } + + @Override + public ResultBean flowRecord(String procInsId, String deployId) { + return null; + } + + @Override + public ResultBean businessFlowRecord(String procInsId) { + return null; + } + + @Override + public ResultBean deleteProcess(String procInsId) { + return null; + } + + @Override + public ResultBean getNextTasks(String procInsId) { + return null; + } + + @Override + public ResultBean getLatestTasks(String procId) { + return null; + } + + @Override + public ResultBean getProcessCirculationNodesByMap(BusinessVariables bv) { + return null; + } + + @Override + public ResultBean readXml(String deployId) { + return null; + } + + @Override + public ResultBean getNextNodesForSubmit(BusinessVariables bv) { + return null; + } + + @Override + public ResultBean getPreviousNodesForReject(BusinessVariables bv) { + return null; + } + +} diff --git a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/FlowTaskQueryOne.java b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/FlowTaskQueryOne.java new file mode 100644 index 00000000..36544bfb --- /dev/null +++ b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/FlowTaskQueryOne.java @@ -0,0 +1,46 @@ +package com.yxt.supervise.feign.flowable.flowtask; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author dimengzhe + * @date 2021/9/2 15:41 + * @description + */ +@Data +@ApiModel("工作流任务相关--请求参数") +public class FlowTaskQueryOne { + + @ApiModelProperty("任务Id") + private String taskId; + + @ApiModelProperty("用户sid") + private String userSid; + + @ApiModelProperty("任务意见") + private String comment; + + @ApiModelProperty("流程实例Id") + private String instanceId; + + @ApiModelProperty("节点") + private String targetKey; + + @ApiModelProperty("流程变量信息") + private Map values=new HashMap<>(); + + @ApiModelProperty("审批人") + private String assignee; + + @ApiModelProperty("候选人") + private List candidateUsers; + + @ApiModelProperty("审批组") + private List candidateGroups; +} diff --git a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/FlowViewerDto.java b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/FlowViewerDto.java new file mode 100644 index 00000000..5f07e484 --- /dev/null +++ b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/FlowViewerDto.java @@ -0,0 +1,26 @@ +package com.yxt.supervise.feign.flowable.flowtask; + +import java.io.Serializable; + +/** + * @author Xuan xuan + * @date 2021/4/21 20:55 + */ +public class FlowViewerDto implements Serializable { + + private String key; + private boolean completed; + public String getKey() { + return key; + } + public void setKey(String key) { + this.key = key; + } + public boolean isCompleted() { + return completed; + } + public void setCompleted(boolean completed) { + this.completed = completed; + } + +} diff --git a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/LatestTaskVo.java b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/LatestTaskVo.java new file mode 100644 index 00000000..abb1e213 --- /dev/null +++ b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/LatestTaskVo.java @@ -0,0 +1,34 @@ +package com.yxt.supervise.feign.flowable.flowtask; + +import com.yxt.common.core.vo.Vo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @Description + * @Author liuguohui + * @Date 2022/1/11 + */ +@ApiModel("最近环节") +@Data +public class LatestTaskVo implements Vo { + + @ApiModelProperty(value = "name_") + private String name_; + + @ApiModelProperty(value = "task_def_key_") + private String task_def_key_; + + @ApiModelProperty(value = "id_") + private String id_; + + @ApiModelProperty(value = "name_") + private String ASSIGNEE_; + + @ApiModelProperty(value = "orgPath") + private String orgPath; + + @ApiModelProperty(value = "incomingSourceRef") + private String incomingSourceRef; +} diff --git a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/TaskQuery.java b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/TaskQuery.java new file mode 100644 index 00000000..a3da35ce --- /dev/null +++ b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/TaskQuery.java @@ -0,0 +1,34 @@ +package com.yxt.supervise.feign.flowable.flowtask; + +import com.yxt.common.core.query.Query; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author dimengzhe + * @date 2021/8/6 10:50 + * @description + */ +@Data +public class TaskQuery implements Query { + private static final long serialVersionUID = -6335769975925521118L; + @ApiModelProperty(value = "用户sid") + private String userSid; + @ApiModelProperty(value = "表单名称") + private String formName; + @ApiModelProperty(value = "开始时间") + private String startTime; + @ApiModelProperty(value = "结束时间") + private String endTime; + @ApiModelProperty(value = "业务系统的sid") + private String businessKey; + @ApiModelProperty(value = "待办人") + private String assignee; + @ApiModelProperty(value = "流程实例id") + private String processInstanceId; + @ApiModelProperty(value = "审批状态") + private Integer flowStatus; + @ApiModelProperty(value = "节点名称") + private String taskName; + +} diff --git a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/TaskQueryParamsVo.java b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/TaskQueryParamsVo.java new file mode 100644 index 00000000..5c0c75dd --- /dev/null +++ b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/TaskQueryParamsVo.java @@ -0,0 +1,111 @@ +package com.yxt.supervise.feign.flowable.flowtask; + +import com.yxt.supervise.feign.flowable.utils.ORDERBY; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +/** + * QueryParamsVo + * + * @author bruce.liu + * @date 2021/04/22 15:03 + */ +@Data +@ApiModel(value = "TaskQueryParamsVo", description = "查询任务实例的参数") +public class TaskQueryParamsVo implements Serializable { + //用户的工号 + @ApiModelProperty( + value = "用户的工号", + example = "00004737" + ) + private String userCode; + //系统标识 + @ApiModelProperty( + value = "系统标识", + example = "flow" + ) + private String appSn; + //系统标识 + @ApiModelProperty( + value = "系统标识列表", + example = "flow itp" + ) + private List appSns; + //表单名称 + @ApiModelProperty( + value = "表单名称", + example = "费用报销" + ) + private String formName; + //开始时间 + @ApiModelProperty( + value = "开始时间", + example = "2020-08-05 08:12:41" + ) + private String startTime; + //结束时间 + @ApiModelProperty( + value = "结束时间", + example = "2020-08-05 08:12:41" + ) + private String endTime; + //业务系统的id + @ApiModelProperty( + value = "业务主键", + example = "1234656" + ) + private String businessKey; + //待办人 + @ApiModelProperty( + value = "待办人", + example = "00004737" + ) + private String assignee; + //排序字段 1 升序 0 降序 + @ApiModelProperty( + value = "排序字段 1 升序 0 降序", + example = "0" + ) + private Integer orderFlag = 0; + //流程实例ID + @ApiModelProperty( + value = "流程实例ID", + example = "sfsafsfasfasfhkshdfwiey" + ) + private String processInstanceId; + //模型key + @ApiModelProperty( + value = "流程模型key", + example = "modelKey" + ) + private String modelKey; + //流程状态 1 审批中,2结束 + @ApiModelProperty( + value = "流程状态 1 审批中,2结束", + example = "1" + ) + private Integer flowStatus; + @ApiModelProperty( + value = "查询关键字", + example = "财务" + ) + private String keyword; + @ApiModelProperty( + value = "节点名称", + example = "部门经理" + ) + //节点名称 + private String taskName; + /** + * 排序 key:字段 value 是规则 + */ + @ApiModelProperty( + value = "排序 key:字段 value 是规则" + ) + private Map orderbyMap; +} diff --git a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/TaskUserInfo.java b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/TaskUserInfo.java new file mode 100644 index 00000000..727de604 --- /dev/null +++ b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/TaskUserInfo.java @@ -0,0 +1,31 @@ +package com.yxt.supervise.feign.flowable.flowtask; + +public class TaskUserInfo { + private String assigneeName; + private String assigneeHeadImage; + private String assigneeSid; + + public String getAssigneeSid() { + return assigneeSid; + } + + public void setAssigneeSid(String assigneeSid) { + this.assigneeSid = assigneeSid; + } + + public String getAssigneeName() { + return assigneeName; + } + + public void setAssigneeName(String assigneeName) { + this.assigneeName = assigneeName; + } + + public String getAssigneeHeadImage() { + return assigneeHeadImage; + } + + public void setAssigneeHeadImage(String assigneeHeadImage) { + this.assigneeHeadImage = assigneeHeadImage; + } +} diff --git a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/TaskVo.java b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/TaskVo.java new file mode 100644 index 00000000..55d5427e --- /dev/null +++ b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/flowtask/TaskVo.java @@ -0,0 +1,81 @@ +package com.yxt.supervise.feign.flowable.flowtask; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.vo.Vo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * @author dimengzhe + * @date 2021/8/6 10:29 + * @description 待办工作返回参数 + */ +@Data +@ApiModel("工作流任务相关-返回参数") +public class TaskVo implements Vo { + private static final long serialVersionUID = 6590730229583603323L; + + @ApiModelProperty(value = "任务编号") + private String taskId; + @ApiModelProperty(value = "任务名称") + private String taskName; + @ApiModelProperty(value = "任务定义key") + private String taskDefKey; + @ApiModelProperty(value = "任务执行人sid") + private String assigneeSid; + + @ApiModelProperty(value = "任务执行人名称") + private String assigneeName; + + @ApiModelProperty("流程发起人sId") + private String startUserSid; + + @ApiModelProperty("流程发起人姓名") + private String startName; + @ApiModelProperty("流程类型") + private String category; + + @ApiModelProperty("流程变量信息") + private Object procVars; + + @ApiModelProperty("局部变量信息") + private Object taskLocalVars; + + @ApiModelProperty("流程部署编号") + private String deployId; + + @ApiModelProperty("流程ID") + private String procDefId; + + @ApiModelProperty("流程key") + private String procDefKey; + + @ApiModelProperty("流程定义名称") + private String procDefName; + + @ApiModelProperty("流程定义内置使用版本") + private int procDefVersion; + + @ApiModelProperty("流程实例ID") + private String procInsId; + + @ApiModelProperty("历史流程实例ID") + private String hisProcInsId; + + @ApiModelProperty("任务耗时") + private String duration; + + @ApiModelProperty("候选执行人") + private String candidate; + + @ApiModelProperty("任务创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @ApiModelProperty("任务完成时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date finishTime; +} diff --git a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/utils/CharsetKit.java b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/utils/CharsetKit.java new file mode 100644 index 00000000..63a69744 --- /dev/null +++ b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/utils/CharsetKit.java @@ -0,0 +1,88 @@ +package com.yxt.supervise.feign.flowable.utils; + + +import com.yxt.common.base.utils.StringUtils; + +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; + +/** + * 字符集工具类 + * + * @author ruoyi + */ +public class CharsetKit +{ + /** ISO-8859-1 */ + public static final String ISO_8859_1 = "ISO-8859-1"; + /** UTF-8 */ + public static final String UTF_8 = "UTF-8"; + /** GBK */ + public static final String GBK = "GBK"; + + /** ISO-8859-1 */ + public static final Charset CHARSET_ISO_8859_1 = Charset.forName(ISO_8859_1); + /** UTF-8 */ + public static final Charset CHARSET_UTF_8 = Charset.forName(UTF_8); + /** GBK */ + public static final Charset CHARSET_GBK = Charset.forName(GBK); + + /** + * 转换为Charset对象 + * + * @param charset 字符集,为空则返回默认字符集 + * @return Charset + */ + public static Charset charset(String charset) + { + return StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset); + } + + /** + * 转换字符串的字符集编码 + * + * @param source 字符串 + * @param srcCharset 源字符集,默认ISO-8859-1 + * @param destCharset 目标字符集,默认UTF-8 + * @return 转换后的字符集 + */ + public static String convert(String source, String srcCharset, String destCharset) + { + return convert(source, Charset.forName(srcCharset), Charset.forName(destCharset)); + } + + /** + * 转换字符串的字符集编码 + * + * @param source 字符串 + * @param srcCharset 源字符集,默认ISO-8859-1 + * @param destCharset 目标字符集,默认UTF-8 + * @return 转换后的字符集 + */ + public static String convert(String source, Charset srcCharset, Charset destCharset) + { + if (null == srcCharset) + { + srcCharset = StandardCharsets.ISO_8859_1; + } + + if (null == destCharset) + { + destCharset = StandardCharsets.UTF_8; + } + + if (StringUtils.isEmpty(source) || srcCharset.equals(destCharset)) + { + return source; + } + return new String(source.getBytes(srcCharset), destCharset); + } + + /** + * @return 系统字符集编码 + */ + public static String systemCharset() + { + return Charset.defaultCharset().name(); + } +} diff --git a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/utils/Convert.java b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/utils/Convert.java new file mode 100644 index 00000000..b3471ccd --- /dev/null +++ b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/utils/Convert.java @@ -0,0 +1,1006 @@ +package com.yxt.supervise.feign.flowable.utils; + +import com.yxt.common.base.utils.StringUtils; +import org.apache.commons.lang3.ArrayUtils; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.text.NumberFormat; +import java.util.Set; + +/** + * 类型转换器 + * + * @author ruoyi + */ +public class Convert +{ + /** + * 转换为字符串
+ * 如果给定的值为null,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static String toStr(Object value, String defaultValue) + { + if (null == value) + { + return defaultValue; + } + if (value instanceof String) + { + return (String) value; + } + return value.toString(); + } + + /** + * 转换为字符串
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static String toStr(Object value) + { + return toStr(value, null); + } + + /** + * 转换为字符
+ * 如果给定的值为null,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Character toChar(Object value, Character defaultValue) + { + if (null == value) + { + return defaultValue; + } + if (value instanceof Character) + { + return (Character) value; + } + + final String valueStr = toStr(value, null); + return StringUtils.isEmpty(valueStr) ? defaultValue : valueStr.charAt(0); + } + + /** + * 转换为字符
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Character toChar(Object value) + { + return toChar(value, null); + } + + /** + * 转换为byte
+ * 如果给定的值为null,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Byte toByte(Object value, Byte defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Byte) + { + return (Byte) value; + } + if (value instanceof Number) + { + return ((Number) value).byteValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return Byte.parseByte(valueStr); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为byte
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Byte toByte(Object value) + { + return toByte(value, null); + } + + /** + * 转换为Short
+ * 如果给定的值为null,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Short toShort(Object value, Short defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Short) + { + return (Short) value; + } + if (value instanceof Number) + { + return ((Number) value).shortValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return Short.parseShort(valueStr.trim()); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为Short
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Short toShort(Object value) + { + return toShort(value, null); + } + + /** + * 转换为Number
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Number toNumber(Object value, Number defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Number) + { + return (Number) value; + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return NumberFormat.getInstance().parse(valueStr); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为Number
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Number toNumber(Object value) + { + return toNumber(value, null); + } + + /** + * 转换为int
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Integer toInt(Object value, Integer defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Integer) + { + return (Integer) value; + } + if (value instanceof Number) + { + return ((Number) value).intValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return Integer.parseInt(valueStr.trim()); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为int
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Integer toInt(Object value) + { + return toInt(value, null); + } + + /** + * 转换为Integer数组
+ * + * @param str 被转换的值 + * @return 结果 + */ + public static Integer[] toIntArray(String str) + { + return toIntArray(",", str); + } + + /** + * 转换为Long数组
+ * + * @param str 被转换的值 + * @return 结果 + */ + public static Long[] toLongArray(String str) + { + return toLongArray(",", str); + } + + /** + * 转换为Integer数组
+ * + * @param split 分隔符 + * @param split 被转换的值 + * @return 结果 + */ + public static Integer[] toIntArray(String split, String str) + { + if (StringUtils.isEmpty(str)) + { + return new Integer[] {}; + } + String[] arr = str.split(split); + final Integer[] ints = new Integer[arr.length]; + for (int i = 0; i < arr.length; i++) + { + final Integer v = toInt(arr[i], 0); + ints[i] = v; + } + return ints; + } + + /** + * 转换为Long数组
+ * + * @param split 分隔符 + * @param str 被转换的值 + * @return 结果 + */ + public static Long[] toLongArray(String split, String str) + { + if (StringUtils.isEmpty(str)) + { + return new Long[] {}; + } + String[] arr = str.split(split); + final Long[] longs = new Long[arr.length]; + for (int i = 0; i < arr.length; i++) + { + final Long v = toLong(arr[i], null); + longs[i] = v; + } + return longs; + } + + /** + * 转换为String数组
+ * + * @param str 被转换的值 + * @return 结果 + */ + public static String[] toStrArray(String str) + { + return toStrArray(",", str); + } + + /** + * 转换为String数组
+ * + * @param split 分隔符 + * @param split 被转换的值 + * @return 结果 + */ + public static String[] toStrArray(String split, String str) + { + return str.split(split); + } + + /** + * 转换为long
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Long toLong(Object value, Long defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Long) + { + return (Long) value; + } + if (value instanceof Number) + { + return ((Number) value).longValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + // 支持科学计数法 + return new BigDecimal(valueStr.trim()).longValue(); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为long
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Long toLong(Object value) + { + return toLong(value, null); + } + + /** + * 转换为double
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Double toDouble(Object value, Double defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Double) + { + return (Double) value; + } + if (value instanceof Number) + { + return ((Number) value).doubleValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + // 支持科学计数法 + return new BigDecimal(valueStr.trim()).doubleValue(); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为double
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Double toDouble(Object value) + { + return toDouble(value, null); + } + + /** + * 转换为Float
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Float toFloat(Object value, Float defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Float) + { + return (Float) value; + } + if (value instanceof Number) + { + return ((Number) value).floatValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return Float.parseFloat(valueStr.trim()); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为Float
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Float toFloat(Object value) + { + return toFloat(value, null); + } + + /** + * 转换为boolean
+ * String支持的值为:true、false、yes、ok、no,1,0 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Boolean toBool(Object value, Boolean defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Boolean) + { + return (Boolean) value; + } + String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + valueStr = valueStr.trim().toLowerCase(); + switch (valueStr) + { + case "true": + return true; + case "false": + return false; + case "yes": + return true; + case "ok": + return true; + case "no": + return false; + case "1": + return true; + case "0": + return false; + default: + return defaultValue; + } + } + + /** + * 转换为boolean
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Boolean toBool(Object value) + { + return toBool(value, null); + } + + /** + * 转换为Enum对象
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * + * @param clazz Enum的Class + * @param value 值 + * @param defaultValue 默认值 + * @return Enum + */ + public static > E toEnum(Class clazz, Object value, E defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (clazz.isAssignableFrom(value.getClass())) + { + @SuppressWarnings("unchecked") + E myE = (E) value; + return myE; + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return Enum.valueOf(clazz, valueStr); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为Enum对象
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * + * @param clazz Enum的Class + * @param value 值 + * @return Enum + */ + public static > E toEnum(Class clazz, Object value) + { + return toEnum(clazz, value, null); + } + + /** + * 转换为BigInteger
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static BigInteger toBigInteger(Object value, BigInteger defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof BigInteger) + { + return (BigInteger) value; + } + if (value instanceof Long) + { + return BigInteger.valueOf((Long) value); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return new BigInteger(valueStr); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为BigInteger
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static BigInteger toBigInteger(Object value) + { + return toBigInteger(value, null); + } + + /** + * 转换为BigDecimal
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static BigDecimal toBigDecimal(Object value, BigDecimal defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof BigDecimal) + { + return (BigDecimal) value; + } + if (value instanceof Long) + { + return new BigDecimal((Long) value); + } + if (value instanceof Double) + { + return new BigDecimal((Double) value); + } + if (value instanceof Integer) + { + return new BigDecimal((Integer) value); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return new BigDecimal(valueStr); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为BigDecimal
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static BigDecimal toBigDecimal(Object value) + { + return toBigDecimal(value, null); + } + + /** + * 将对象转为字符串
+ * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 + * + * @param obj 对象 + * @return 字符串 + */ + public static String utf8Str(Object obj) + { + return str(obj, CharsetKit.CHARSET_UTF_8); + } + + /** + * 将对象转为字符串
+ * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 + * + * @param obj 对象 + * @param charsetName 字符集 + * @return 字符串 + */ + public static String str(Object obj, String charsetName) + { + return str(obj, Charset.forName(charsetName)); + } + + /** + * 将对象转为字符串
+ * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 + * + * @param obj 对象 + * @param charset 字符集 + * @return 字符串 + */ + public static String str(Object obj, Charset charset) + { + if (null == obj) + { + return null; + } + + if (obj instanceof String) + { + return (String) obj; + } + else if (obj instanceof byte[]) + { + return str((byte[]) obj, charset); + } + else if (obj instanceof Byte[]) + { + byte[] bytes = ArrayUtils.toPrimitive((Byte[]) obj); + return str(bytes, charset); + } + else if (obj instanceof ByteBuffer) + { + return str((ByteBuffer) obj, charset); + } + return obj.toString(); + } + + /** + * 将byte数组转为字符串 + * + * @param bytes byte数组 + * @param charset 字符集 + * @return 字符串 + */ + public static String str(byte[] bytes, String charset) + { + return str(bytes, StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset)); + } + + /** + * 解码字节码 + * + * @param data 字符串 + * @param charset 字符集,如果此字段为空,则解码的结果取决于平台 + * @return 解码后的字符串 + */ + public static String str(byte[] data, Charset charset) + { + if (data == null) + { + return null; + } + + if (null == charset) + { + return new String(data); + } + return new String(data, charset); + } + + /** + * 将编码的byteBuffer数据转换为字符串 + * + * @param data 数据 + * @param charset 字符集,如果为空使用当前系统字符集 + * @return 字符串 + */ + public static String str(ByteBuffer data, String charset) + { + if (data == null) + { + return null; + } + + return str(data, Charset.forName(charset)); + } + + /** + * 将编码的byteBuffer数据转换为字符串 + * + * @param data 数据 + * @param charset 字符集,如果为空使用当前系统字符集 + * @return 字符串 + */ + public static String str(ByteBuffer data, Charset charset) + { + if (null == charset) + { + charset = Charset.defaultCharset(); + } + return charset.decode(data).toString(); + } + + // ----------------------------------------------------------------------- 全角半角转换 + /** + * 半角转全角 + * + * @param input String. + * @return 全角字符串. + */ + public static String toSBC(String input) + { + return toSBC(input, null); + } + + /** + * 半角转全角 + * + * @param input String + * @param notConvertSet 不替换的字符集合 + * @return 全角字符串. + */ + public static String toSBC(String input, Set notConvertSet) + { + char c[] = input.toCharArray(); + for (int i = 0; i < c.length; i++) + { + if (null != notConvertSet && notConvertSet.contains(c[i])) + { + // 跳过不替换的字符 + continue; + } + + if (c[i] == ' ') + { + c[i] = '\u3000'; + } + else if (c[i] < '\177') + { + c[i] = (char) (c[i] + 65248); + + } + } + return new String(c); + } + + /** + * 全角转半角 + * + * @param input String. + * @return 半角字符串 + */ + public static String toDBC(String input) + { + return toDBC(input, null); + } + + /** + * 替换全角为半角 + * + * @param text 文本 + * @param notConvertSet 不替换的字符集合 + * @return 替换后的字符 + */ + public static String toDBC(String text, Set notConvertSet) + { + char c[] = text.toCharArray(); + for (int i = 0; i < c.length; i++) + { + if (null != notConvertSet && notConvertSet.contains(c[i])) + { + // 跳过不替换的字符 + continue; + } + + if (c[i] == '\u3000') + { + c[i] = ' '; + } + else if (c[i] > '\uFF00' && c[i] < '\uFF5F') + { + c[i] = (char) (c[i] - 65248); + } + } + String returnString = new String(c); + + return returnString; + } + + /** + * 数字金额大写转换 先写个完整的然后将如零拾替换成零 + * + * @param n 数字 + * @return 中文大写数字 + */ + public static String digitUppercase(double n) + { + String[] fraction = { "角", "分" }; + String[] digit = { "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" }; + String[][] unit = { { "元", "万", "亿" }, { "", "拾", "佰", "仟" } }; + + String head = n < 0 ? "负" : ""; + n = Math.abs(n); + + String s = ""; + for (int i = 0; i < fraction.length; i++) + { + s += (digit[(int) (Math.floor(n * 10 * Math.pow(10, i)) % 10)] + fraction[i]).replaceAll("(零.)+", ""); + } + if (s.length() < 1) + { + s = "整"; + } + int integerPart = (int) Math.floor(n); + + for (int i = 0; i < unit[0].length && integerPart > 0; i++) + { + String p = ""; + for (int j = 0; j < unit[1].length && n > 0; j++) + { + p = digit[integerPart % 10] + unit[1][j] + p; + integerPart = integerPart / 10; + } + s = p.replaceAll("(零.)*零$", "").replaceAll("^$", "零") + unit[0][i] + s; + } + return head + s.replaceAll("(零.)*零元", "元").replaceFirst("(零.)+", "").replaceAll("(零.)+", "零").replaceAll("^整$", "零元整"); + } +} diff --git a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/utils/Excel.java b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/utils/Excel.java new file mode 100644 index 00000000..decfd775 --- /dev/null +++ b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/utils/Excel.java @@ -0,0 +1,165 @@ +package com.yxt.supervise.feign.flowable.utils; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.math.BigDecimal; + +/** + * 自定义导出Excel数据注解 + * + * @author ruoyi + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface Excel +{ + /** + * 导出时在excel中排序 + */ + public int sort() default Integer.MAX_VALUE; + + /** + * 导出到Excel中的名字. + */ + public String name() default ""; + + /** + * 日期格式, 如: yyyy-MM-dd + */ + public String dateFormat() default ""; + + /** + * 如果是字典类型,请设置字典的type值 (如: sys_user_sex) + */ + public String dictType() default ""; + + /** + * 读取内容转表达式 (如: 0=男,1=女,2=未知) + */ + public String readConverterExp() default ""; + + /** + * 分隔符,读取字符串组内容 + */ + public String separator() default ","; + + /** + * BigDecimal 精度 默认:-1(默认不开启BigDecimal格式化) + */ + public int scale() default -1; + + /** + * BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN + */ + public int roundingMode() default BigDecimal.ROUND_HALF_EVEN; + + /** + * 导出类型(0数字 1字符串) + */ + public ColumnType cellType() default ColumnType.STRING; + + /** + * 导出时在excel中每个列的高度 单位为字符 + */ + public double height() default 14; + + /** + * 导出时在excel中每个列的宽 单位为字符 + */ + public double width() default 16; + + /** + * 文字后缀,如% 90 变成90% + */ + public String suffix() default ""; + + /** + * 当值为空时,字段的默认值 + */ + public String defaultValue() default ""; + + /** + * 提示信息 + */ + public String prompt() default ""; + + /** + * 设置只能选择不能输入的列内容. + */ + public String[] combo() default {}; + + /** + * 是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写. + */ + public boolean isExport() default true; + + /** + * 另一个类中的属性名称,支持多级获取,以小数点隔开 + */ + public String targetAttr() default ""; + + /** + * 是否自动统计数据,在最后追加一行统计数据总和 + */ + public boolean isStatistics() default false; + + /** + * 导出字段对齐方式(0:默认;1:靠左;2:居中;3:靠右) + */ + Align align() default Align.AUTO; + + public enum Align + { + AUTO(0), LEFT(1), CENTER(2), RIGHT(3); + private final int value; + + Align(int value) + { + this.value = value; + } + + public int value() + { + return this.value; + } + } + + /** + * 字段类型(0:导出导入;1:仅导出;2:仅导入) + */ + Type type() default Type.ALL; + + public enum Type + { + ALL(0), EXPORT(1), IMPORT(2); + private final int value; + + Type(int value) + { + this.value = value; + } + + public int value() + { + return this.value; + } + } + + public enum ColumnType + { + NUMERIC(0), STRING(1), IMAGE(2); + private final int value; + + ColumnType(int value) + { + this.value = value; + } + + public int value() + { + return this.value; + } + } +} \ No newline at end of file diff --git a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/utils/ORDERBY.java b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/utils/ORDERBY.java new file mode 100644 index 00000000..351d9796 --- /dev/null +++ b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/utils/ORDERBY.java @@ -0,0 +1,14 @@ +package com.yxt.supervise.feign.flowable.utils; + +/** + * @author bruce.liu + * @Description 排序的enum + * @time 2021年4月16日 + */ +public enum ORDERBY { + DESC, ASC; + + public ORDERBY reverse() { + return (this == ASC) ? DESC : ASC; + } +} diff --git a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/utils/ProcDefEnum.java b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/utils/ProcDefEnum.java new file mode 100644 index 00000000..184e21ca --- /dev/null +++ b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/utils/ProcDefEnum.java @@ -0,0 +1,104 @@ +package com.yxt.supervise.feign.flowable.utils; + +/** + * 流程定义:流程名称与代号枚举类 + */ +public enum ProcDefEnum { + + /***************************正式流程id***********************************/ + + ORDERDEPOSITAPPROVE("简易订单-订金收取", "process_pkyns85b:4:575004"), + ORDERDEPOSITVEHICLEAPPROVE("简易订单-车辆预定", "process_pkyns85b:5:575008"), + ORDERAPPROVE("订单审批", "order_approve_96asleqi:1:227504"), + SALESPOLICY("销售政策审批流程", "process_biw9gfh7:2:727504"),//TODO:正式新2022-11-25 + FINBILLAPPLICATION("开票申请流程", "process_t5ksueur:1:252833"), + BUSCENTERADVANCEGINVOICEAPPLY("提前开票申请流程", "advance_ginvoiceapply:1:242664"), + ARREARSCARRYVEHICLE("欠款提车审批流程", "process_8ax1xxn3:1:795004"), + VEHICLEAPPLY("排产申请流程", "process_9egcg169:12:735004"),//TODO:正式新2022-11-25 + SCMCARTRANSFER("库存地点变更申请", "process_3bc4p2em:8:725008"), //TODO:正式新2022-11-25 + BASEVEHICLEACTUALSALES("未售买断", "process_6qx07b75:8:725012"),//ToDo:正式新2022-11-25 + FINCOSTAPPLY("费用申请", "process_u0pahv0s:6:725016"),//ToDo:正式新2022-11-25 + FINPAYAPPLY("付款申请", "process_gin2tntb:4:725020"),//ToDo:正式新2022-11-25 + RECORDAPPLICATION("入库申请", "process_xbwq2c7p:3:675024"),//TODO + SCMVEHICLERETURN("采购退库", "process_md8aeoap:2:722508"),//ToDo:正式新2022-11-25 + SEALAPPLY("盖章申请", "process_7h0z66tp:1:240064"), + SALESORDER("销售订单审批流程", "process_p5ils2rn:7:827504"), + BASEOUTSOURCINGAPPLICATION("外采申请", "process_5tqysnjc:5:722504"),//ToDo:正式新2022-11-25 + BASEMODELMODPRICE("车型调价申请", "process_kydcif7k:7:722512"),//ToDo:正式新2022-11-25 + BASEINTERNALPURCHASE("调车申请", "process_i6luw5xq:3:722516"),//ToDo:正式新2022-11-25 + BASEACCADJAPPLY("调账申请", "process_r6pyzqoz:2:722520"), //ToDo:正式新2022-11-25 + BUSDELIVEREDAPPLY("出库申请", "process_wgt1n66l:3:770004"), + BASESHUNINVOICAPPLY("调车开票申请", "process_u4xrvaso:1:400008"), + BASEVEHINSTALLMODPRICE("上装调价申请", "process_s0a0svth:1:492508"), + SCMVEHREBATEWITHAPPLY("单车返利预提申请", "process_qegarc7r:1:535004"), + SCMVEHREBATECHECKAPPLY("单车返利核对申请", "process_3xtbbru8:1:560004"), + SCMSPECIALREBATEWITHAPPLY("专项返利预提申请", "process_l0yxpgs2:1:590004"), + SCMSPECIALREBATECHECKAPPLY("专项返利核对申请", "process_qw22vupn:1:590008"), + SCMSPECIALREBATECHEDISTRIBUTE("专项返利分配申请", "process_h3w1aval:1:615004"), + SCMCOLLECTIONREBATEWITHAPPLY("回款返利预提申请", "process_k4lodiyg:1:630004"), + SCMCOLLECTIONREBATECHECKAPPLY("回款返利核对申请", "process_fgrv1mbv:1:630008"), + CONTRACTAPPLY("合同审核", "process_gd8c9xd5:1:545008"), + BASEDISPACKAGEAPPLY("优惠包申请流程", "process_l8i6tqho:1:967504"), + PR("采购申请", "process_xb9q6w5v:8:1307630"), + + + /******************************测试流程id*********************************************/ + + /*ORDERDEPOSITAPPROVE("简易订单-订金收取", "process_pkyns85b:4:575004"), + ORDERDEPOSITVEHICLEAPPROVE("简易订单-车辆预定", "process_pkyns85b:5:575008"), + ORDERAPPROVE("订单审批", "order_approve_96asleqi:1:227504"), + RECORDAPPLICATION("入库申请", "process_xbwq2c7p:3:675024"), + SEALAPPLY("盖章申请", "process_7h0z66tp:1:240064"), + SALESORDER("销售订单审批流程", "process_p5ils2rn:7:1123496"), + BUSDELIVEREDAPPLY("出库申请", "process_wgt1n66l:2:357504"), + BASESHUNINVOICAPPLY("调车开票申请", "process_u4xrvaso:1:400008"), + BASEVEHINSTALLMODPRICE("上装调价申请", "process_s0a0svth:1:492508"), + SCMVEHREBATEWITHAPPLY("单车返利预提申请", "process_qegarc7r:1:535004"), + SCMVEHREBATECHECKAPPLY("单车返利核对申请", "process_3xtbbru8:1:560004"), + SCMSPECIALREBATEWITHAPPLY("专项返利预提申请", "process_l0yxpgs2:1:590004"), + SCMSPECIALREBATECHECKAPPLY("专项返利核对申请", "process_qw22vupn:1:590008"), + SCMSPECIALREBATECHEDISTRIBUTE("专项返利分配申请", "process_h3w1aval:1:615004"), + SCMCOLLECTIONREBATEWITHAPPLY("回款返利预提申请", "process_k4lodiyg:1:630004"), + SCMCOLLECTIONREBATECHECKAPPLY("回款返利核对申请", "process_fgrv1mbv:1:630008"), + CONTRACTAPPLY("合同审核", "process_gd8c9xd5:1:545008"), + SCMCARTRANSFER("库存地点变更申请", "process_3bc4p2em:8:860004"), //TODO:测试 + BASEVEHICLEACTUALSALES("未售买断", "process_6qx07b75:9:852504"),//ToDo:测试 + VEHICLEAPPLY("排产申请流程", "process_9egcg169:12:910004"),//TODO:测试 + FINCOSTAPPLY("费用申请","process_u0pahv0s:6:902504"),//ToDo:测试 + FINPAYAPPLY("付款申请","process_gin2tntb:4:902508"),//ToDo:测试 + ARREARSCARRYVEHICLE("欠款提车审批流程", "process_8ax1xxn3:2:862512"),//测试(新)2022、11、22 + BUSCENTERADVANCEGINVOICEAPPLY("提前开票申请流程", "process_zt1gov6e:4:862504"), //测试 + FINBILLAPPLICATION("开票申请流程", "process_sndce6s9:2:937504"),//测试(新)2022、11、22 + BASEOUTSOURCINGAPPLICATION("外采申请", "process_5tqysnjc:5:867504"),//测试外采流程定义id + BASEMODELMODPRICE("车型调价申请", "process_kydcif7k:7:867520"),//测试车型调价流程定义id + BASEINTERNALPURCHASE("调车申请", "process_i6luw5xq:4:892504"),//测试调车流程定义id + BASEACCADJAPPLY("调账申请", "process_r6pyzqoz:2:867516"), //测试调账流程定义id + SCMVEHICLERETURN("采购退库", "process_md8aeoap:2:867508"),//测试采购退库流程定义id + SALESPOLICY("销售政策审批流程", "process_biw9gfh7:2:867524"),//测试销售政策流程定义id + BASEDISPACKAGEAPPLY("优惠包申请流程", "process_l8i6tqho:1:967504"),//测试优惠包申请流程定义id*/ + ; + + ProcDefEnum(String proDefName, String proDefId) { + this.proDefName = proDefName; + this.proDefId = proDefId; + + } + + /** + * 流程类型名称 + */ + private final String proDefName; + + /** + * 流程代号 + */ + private final String proDefId; + + public String getProDefName() { + return proDefName; + } + + public String getProDefId() { + return proDefId; + } +} diff --git a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/utils/ProcessStateEnum.java b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/utils/ProcessStateEnum.java new file mode 100644 index 00000000..ec0c8f7a --- /dev/null +++ b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/utils/ProcessStateEnum.java @@ -0,0 +1,38 @@ +package com.yxt.supervise.feign.flowable.utils; + +/** + * @author 10095 + * @version 1.0 + * @Description: 流程状态枚举类 + * @date 2022/03/01 + */ +public enum ProcessStateEnum { + + STARTED("审批中", "started"), + FINISHED("已办结", "finished") + ; + + + ProcessStateEnum(String stateName, String stateCode) { + this.stateName = stateName; + this.stateCode = stateCode; + } + + /** + * 状态名称 + */ + private final String stateName; + + /** + * 状态代号 + */ + private final String stateCode; + + public String getStateName() { + return stateName; + } + + public String getStateCode() { + return stateCode; + } +} diff --git a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/utils/RecordQuery.java b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/utils/RecordQuery.java new file mode 100644 index 00000000..f2af2b27 --- /dev/null +++ b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/utils/RecordQuery.java @@ -0,0 +1,19 @@ +package com.yxt.supervise.feign.flowable.utils; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @author dimengzhe + * @date 2021/8/23 14:18 + * @description + */ +@Data +public class RecordQuery implements Query { + private static final long serialVersionUID = 480213691108105877L; + + private String procInsId; + private String deployId; + + +} diff --git a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/utils/ServletUtils.java b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/utils/ServletUtils.java new file mode 100644 index 00000000..792cfbaf --- /dev/null +++ b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/utils/ServletUtils.java @@ -0,0 +1,137 @@ +package com.yxt.supervise.feign.flowable.utils; + +import com.yxt.common.base.utils.StringUtils; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; +import java.io.IOException; + +/** + * 客户端工具类 + * + * @author ruoyi + */ +public class ServletUtils +{ + /** + * 获取String参数 + */ + public static String getParameter(String name) + { + return getRequest().getParameter(name); + } + + /** + * 获取String参数 + */ + public static String getParameter(String name, String defaultValue) + { + return Convert.toStr(getRequest().getParameter(name), defaultValue); + } + + /** + * 获取Integer参数 + */ + public static Integer getParameterToInt(String name) + { + return Convert.toInt(getRequest().getParameter(name)); + } + + /** + * 获取Integer参数 + */ + public static Integer getParameterToInt(String name, Integer defaultValue) + { + return Convert.toInt(getRequest().getParameter(name), defaultValue); + } + + /** + * 获取request + */ + public static HttpServletRequest getRequest() + { + return getRequestAttributes().getRequest(); + } + + /** + * 获取response + */ + public static HttpServletResponse getResponse() + { + return getRequestAttributes().getResponse(); + } + + /** + * 获取session + */ + public static HttpSession getSession() + { + return getRequest().getSession(); + } + + public static ServletRequestAttributes getRequestAttributes() + { + RequestAttributes attributes = RequestContextHolder.getRequestAttributes(); + return (ServletRequestAttributes) attributes; + } + + /** + * 将字符串渲染到客户端 + * + * @param response 渲染对象 + * @param string 待渲染的字符串 + * @return null + */ + public static String renderString(HttpServletResponse response, String string) + { + try + { + response.setStatus(200); + response.setContentType("application/json"); + response.setCharacterEncoding("utf-8"); + response.getWriter().print(string); + } + catch (IOException e) + { + e.printStackTrace(); + } + return null; + } + + /** + * 是否是Ajax异步请求 + * + * @param request + */ + public static boolean isAjaxRequest(HttpServletRequest request) + { + String accept = request.getHeader("accept"); + if (accept != null && accept.indexOf("application/json") != -1) + { + return true; + } + + String xRequestedWith = request.getHeader("X-Requested-With"); + if (xRequestedWith != null && xRequestedWith.indexOf("XMLHttpRequest") != -1) + { + return true; + } + + String uri = request.getRequestURI(); + if (StringUtils.inString(uri, ".json", ".xml")) + { + return true; + } + + String ajax = request.getParameter("__ajax"); + if (StringUtils.inString(ajax, "json", "xml")) + { + return true; + } + return false; + } +} diff --git a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/utils/SqlUtil.java b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/utils/SqlUtil.java new file mode 100644 index 00000000..c99f0188 --- /dev/null +++ b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/feign/flowable/utils/SqlUtil.java @@ -0,0 +1,37 @@ +package com.yxt.supervise.feign.flowable.utils; + + +import com.yxt.common.base.utils.StringUtils; + +/** + * sql操作工具类 + * + * @author ruoyi + */ +public class SqlUtil +{ + /** + * 仅支持字母、数字、下划线、空格、逗号、小数点(支持多个字段排序) + */ + public static String SQL_PATTERN = "[a-zA-Z0-9_\\ \\,\\.]+"; + + /** + * 检查字符,防止注入绕过 + */ + public static String escapeOrderBySql(String value) + { + if (StringUtils.isNotEmpty(value) && !isValidOrderBySql(value)) + { + //throw new BaseException("参数不符合规范,不能进行查询"); + } + return value; + } + + /** + * 验证 order by 语法是否符合规范 + */ + public static boolean isValidOrderBySql(String value) + { + return value.matches(SQL_PATTERN); + } +} diff --git a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/system/flow/FlowableRest.java b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/system/flow/FlowableRest.java index 0e283fa6..35bfd013 100644 --- a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/system/flow/FlowableRest.java +++ b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/system/flow/FlowableRest.java @@ -25,6 +25,7 @@ *********************************************************/ package com.yxt.supervise.system.flow; +import cn.hutool.core.bean.BeanUtil; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.result.ResultBean; @@ -35,6 +36,7 @@ import com.yxt.supervise.system.sysuser.SysUserService; import com.yxt.supervise.feign.wh.ShStorehouseFeign; import com.yxt.supervise.feign.wh.ShStorehouseQuery; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -58,10 +60,10 @@ import java.util.List; @RequestMapping("v1/flow") @Api(tags = "业务系统中业务和工作流相关操作") //public class FlowableRest implements FlowableFeign { -public class FlowableRest{ -// -// @Autowired -// private FlowableService flowableService; +public class FlowableRest { + + @Autowired + private FlowableService flowableService; @Autowired private SysStaffOrgService sysStaffOrgService; @Autowired @@ -213,29 +215,40 @@ public class FlowableRest{ // return ResultBean.fireSuccess(); // } // -// @Override -// public ResultBean> todoAllTaskList(String userSid, PagerQuery pQuery) {//待办列表 -// SysUser sysUser = sysUserService.fetchBySid(userSid); -// String staffSid = sysUser.getStaffSid(); -// List sysStaffOrgListByStaffSid = sysStaffOrgService.getSysStaffOrgListByStaffSid(staffSid); -// StringBuilder sb = new StringBuilder(); -// for (SysStaffOrgVo s : sysStaffOrgListByStaffSid) { -// sb.append(s.getOrgSidPath()); -// sb.append(","); -// } -// if (sb.length() > 0) { -// sb.delete(sb.length() - 1, sb.length()); -// } -// pQuery.getParams().setOrgSid(sb.toString()); -// Page page = new Page<>(); -// -// BeanUtil.copyProperties(flowableService.todoAllTaskList(userSid, pQuery).getData(),page); -// -// ResultBean< Page> success = new ResultBean< Page>().success(); -// success.setData(page); -// return success; -// } -// + + /** + * 待办列表 + * + * @param userSid 用户sid + * @param pQuery 查询参数 + * @return + */ + @ApiOperation(value = "总待办列表") + @PostMapping("/todoAllTaskList/{userSid}") + public ResultBean> todoAllTaskList(@PathVariable("userSid") String userSid, PagerQuery pQuery) {//待办列表 + System.out.println("llll--userSid: "+userSid); + SysUser sysUser = sysUserService.fetchBySid(userSid); + String staffSid = sysUser.getStaffSid(); + List sysStaffOrgListByStaffSid = sysStaffOrgService.getSysStaffOrgListByStaffSid(staffSid); + StringBuilder sb = new StringBuilder(); + for (SysStaffOrgVo s : sysStaffOrgListByStaffSid) { + sb.append(s.getOrgSidPath()); + sb.append(","); + } + if (sb.length() > 0) { + sb.delete(sb.length() - 1, sb.length()); + } + pQuery.getParams().setOrgSid(sb.toString()); + Page page = new Page<>(); + + BeanUtil.copyProperties(flowableService.todoAllTaskList(userSid, pQuery).getData(), page); + + ResultBean> success = new ResultBean>().success(); + success.setData(page); + return success; + } + + // // @Override // public ResultBean getTodoNum(String userSid) { // ResultBean rb=ResultBean.fireFail(); @@ -300,24 +313,26 @@ public class FlowableRest{ // //BeanUtil.copyProperties(flowableService.todoAllTaskList(userSid, pQuery).getData(),page); // ResultBean< Page> success = new ResultBean< Page>().success(); ResultBean success = new ResultBean(); - FlowTaskVo flowTaskVo=new FlowTaskVo(); + FlowTaskVo flowTaskVo = new FlowTaskVo(); flowTaskVo.setTodoNumber(5); - List list=new ArrayList<>(); + List list = new ArrayList<>(); list.add("【一级风险】"); list.add("【二级风险】"); list.add("【三级风险】"); list.add("【四级风险】"); flowTaskVo.setNotice(list); - String [] urls={"http://jianguan.yyundong.com/img/banner001.jpg"}; + String[] urls = {"http://jianguan.yyundong.com/img/banner001.jpg"}; flowTaskVo.setImageUrl(urls); flowTaskVo.setPendingWork(6); success.success().setData(flowTaskVo); return success; } + @PostMapping("/storeHouseListPage") public ResultBean task(@RequestBody PagerQuery pq) { return shStorehouseFeign.listPage(pq); } + @GetMapping("/fetchDetailsBySid/{sid}") public ResultBean fetchDetailsBySid(@PathVariable("sid") String sid) { return shStorehouseFeign.fetchDetailsBySid(sid); diff --git a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/system/flow/FlowableService.java b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/system/flow/FlowableService.java index 1075005a..eda2d8a5 100644 --- a/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/system/flow/FlowableService.java +++ b/yxt_supervise/supervise-system/supervise-system-biz/src/main/java/com/yxt/supervise/system/flow/FlowableService.java @@ -23,56 +23,56 @@ // * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * // *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* // *********************************************************/ -//package com.yxt.supervise.system.flow; +package com.yxt.supervise.system.flow; // //import cn.hutool.core.bean.BeanUtil; //import com.alibaba.fastjson.JSON; //import com.alibaba.fastjson.JSONObject; -//import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; //import com.yxt.anrui.flowable.api.flow.UserAndOrgPath; //import com.yxt.anrui.flowable.api.flowdefinition.FlowDefinitionFeign; //import com.yxt.anrui.flowable.api.flowtask.FlowRecordVo; //import com.yxt.anrui.flowable.api.flowtask.FlowTaskDto; -//import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign; +import com.yxt.supervise.feign.flowable.flowtask.FlowTaskFeign; //import com.yxt.anrui.flowable.api.flowtask.LatestTaskVo; //import com.yxt.anrui.flowable.api.sysformlink.SysFormLinkFeign; //import com.yxt.anrui.flowable.api.sysprourl.SysProUrlFeign; -//import com.yxt.anrui.flowable.sqloperationsymbol.BusinessTaskParam; -//import com.yxt.anrui.flowable.sqloperationsymbol.BusinessTaskQuery; -//import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; -//import com.yxt.anrui.flowable.sqloperationsymbol.SQLOperationSymbol; +import com.yxt.supervise.feign.flowable.BusinessTaskParam; +import com.yxt.supervise.feign.flowable.BusinessTaskQuery; +import com.yxt.supervise.feign.flowable.BusinessVariables; +import com.yxt.supervise.feign.flowable.SQLOperationSymbol; //import com.yxt.common.base.config.component.FileUploadComponent; -//import com.yxt.common.base.service.MybatisBaseService; -//import com.yxt.common.base.utils.ConstantUtils; -//import com.yxt.common.base.utils.StringUtils; -//import com.yxt.common.core.query.PagerQuery; -//import com.yxt.common.core.result.ResultBean; -//import com.yxt.common.core.vo.PagerVo; -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.stereotype.Service; -// -//import java.util.*; -//import java.util.stream.Collectors; -// -///** -// * Project: anrui-parent
-// * File: FlowableService.java
-// * Class: com.yxt.anrui.portal.biz.flow.FlowableService
-// * Description: <描述类的功能>.
-// * Copyright: Copyright (c) 2011
-// * Company: https://gitee.com/liuzp315
-// * Makedate: 2021/10/23 上午11:14
-// * -// * @author popo -// * @version 1.0 -// * @since 1.0 -// */ -//@Service -//public class FlowableService extends MybatisBaseService { +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.ConstantUtils; +import com.yxt.common.base.utils.StringUtils; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * Project: anrui-parent
+ * File: FlowableService.java
+ * Class: com.yxt.anrui.portal.biz.flow.FlowableService
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2021/10/23 上午11:14
+ * + * @author popo + * @version 1.0 + * @since 1.0 + */ +@Service +public class FlowableService extends MybatisBaseService { // @Autowired // private FlowDefinitionFeign flowDefinitionFeign; -// @Autowired -// private FlowTaskFeign flowTaskFeign; + @Autowired + private FlowTaskFeign flowTaskFeign; // @Autowired // private SysFormLinkFeign sysFormLinkFeign; // @Autowired @@ -319,62 +319,62 @@ // } // // -// public ResultBean> todoAllTaskList(String userSid, PagerQuery pQuery) { -// ResultBean> rb = new ResultBean>().fireFail(); -// FlowTaskAllQuery params = pQuery.getParams(); -// if (StringUtils.isBlank(userSid)) { -// return rb.setMsg("用户SID为空"); -// } -// PagerQuery taskQueryPagerQuery = new PagerQuery<>(); -// taskQueryPagerQuery.setCurrent(pQuery.getCurrent()).setSize(pQuery.getSize()); -// -// String orgSid = params.getOrgSid(); -// String processDefinitionId = params.getProcessDefinitionId(); -// String proDefName = params.getProDefName(); -// String startDate = params.getStartDate(); -// String endDate = params.getEndDate(); -// BusinessTaskQuery taskQuery = new BusinessTaskQuery(); -// List taskParamList = new ArrayList<>(); -// if (StringUtils.isNotBlank(proDefName)) { -// BusinessTaskParam taskParam = new BusinessTaskParam(); -// taskParam.setField("proDefName"); -// taskParam.setValue(proDefName); -// taskParam.setSqlOperationSymbol(SQLOperationSymbol.LIKE); -// taskParamList.add(taskParam); -// } -// if (StringUtils.isNotBlank(startDate)) { -// BusinessTaskParam taskParam = new BusinessTaskParam(); -// taskParam.setField("startDate"); -// taskParam.setValue(startDate); -// taskParam.setSqlOperationSymbol(SQLOperationSymbol.GE); -// taskParamList.add(taskParam); -// } -// if (StringUtils.isNotBlank(endDate)) { -// BusinessTaskParam taskParam = new BusinessTaskParam(); -// taskParam.setField("endDate"); -// taskParam.setValue(endDate); -// taskParam.setSqlOperationSymbol(SQLOperationSymbol.LE); -// taskParamList.add(taskParam); -// } -// if (StringUtils.isNotBlank(processDefinitionId)) { -// BusinessTaskParam taskParam = new BusinessTaskParam(); -// taskParam.setField("processDefinitionId"); -// taskParam.setSqlOperationSymbol(SQLOperationSymbol.NONE); -// taskParam.setValue(processDefinitionId); -// taskParamList.add(taskParam); -// } -// if (StringUtils.isNotBlank(orgSid)) { -// BusinessTaskParam taskParam = new BusinessTaskParam(); -// taskParam.setField(BusinessVariables.ORGPATH); -// taskParam.setSqlOperationSymbol(SQLOperationSymbol.NONE); -// taskParam.setValue(orgSid); -// taskParamList.add(taskParam); -// } -// -// taskQuery.setFields(taskParamList); -// taskQueryPagerQuery.setParams(taskQuery); -// return flowTaskFeign.businessTodoList(userSid, taskQueryPagerQuery); -// } + public ResultBean> todoAllTaskList(String userSid, PagerQuery pQuery) { + ResultBean> rb = new ResultBean>().fireFail(); + FlowTaskAllQuery params = pQuery.getParams(); + if (StringUtils.isBlank(userSid)) { + return rb.setMsg("用户SID为空"); + } + PagerQuery taskQueryPagerQuery = new PagerQuery<>(); + taskQueryPagerQuery.setCurrent(pQuery.getCurrent()).setSize(pQuery.getSize()); + + String orgSid = params.getOrgSid(); + String processDefinitionId = params.getProcessDefinitionId(); + String proDefName = params.getProDefName(); + String startDate = params.getStartDate(); + String endDate = params.getEndDate(); + BusinessTaskQuery taskQuery = new BusinessTaskQuery(); + List taskParamList = new ArrayList<>(); + if (StringUtils.isNotBlank(proDefName)) { + BusinessTaskParam taskParam = new BusinessTaskParam(); + taskParam.setField("proDefName"); + taskParam.setValue(proDefName); + taskParam.setSqlOperationSymbol(SQLOperationSymbol.LIKE); + taskParamList.add(taskParam); + } + if (StringUtils.isNotBlank(startDate)) { + BusinessTaskParam taskParam = new BusinessTaskParam(); + taskParam.setField("startDate"); + taskParam.setValue(startDate); + taskParam.setSqlOperationSymbol(SQLOperationSymbol.GE); + taskParamList.add(taskParam); + } + if (StringUtils.isNotBlank(endDate)) { + BusinessTaskParam taskParam = new BusinessTaskParam(); + taskParam.setField("endDate"); + taskParam.setValue(endDate); + taskParam.setSqlOperationSymbol(SQLOperationSymbol.LE); + taskParamList.add(taskParam); + } + if (StringUtils.isNotBlank(processDefinitionId)) { + BusinessTaskParam taskParam = new BusinessTaskParam(); + taskParam.setField("processDefinitionId"); + taskParam.setSqlOperationSymbol(SQLOperationSymbol.NONE); + taskParam.setValue(processDefinitionId); + taskParamList.add(taskParam); + } + if (StringUtils.isNotBlank(orgSid)) { + BusinessTaskParam taskParam = new BusinessTaskParam(); + taskParam.setField(BusinessVariables.ORGPATH); + taskParam.setSqlOperationSymbol(SQLOperationSymbol.NONE); + taskParam.setValue(orgSid); + taskParamList.add(taskParam); + } + + taskQuery.setFields(taskParamList); + taskQueryPagerQuery.setParams(taskQuery); + return flowTaskFeign.businessTodoList(userSid, taskQueryPagerQuery); + } // // public ResultBean getTodoNum(String userSid) { // return flowTaskFeign.getTodoNum(userSid); @@ -445,5 +445,5 @@ // public ResultBean getFlowViewer(String procInsId) { // return flowTaskFeign.getFlowViewer(procInsId); // } -// -//} + +}