
40 changed files with 3037 additions and 3 deletions
@ -0,0 +1,35 @@ |
|||
package com.yxt.supervise.system.flow; |
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Builder; |
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author XuanXuan |
|||
* @date 2021/3/28 15:50 |
|||
*/ |
|||
@Data |
|||
@Builder |
|||
@NoArgsConstructor |
|||
@AllArgsConstructor |
|||
public class FlowCommentDto implements Serializable { |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private static final long serialVersionUID = 1929734226858491967L; |
|||
|
|||
/** |
|||
* 意见类别 1正常(同意)意见 2退回意见 3 驳回意见 4 委派意见 5 转办意见 6 终止流程 7 撤回流程 |
|||
*/ |
|||
private String type; |
|||
|
|||
/** |
|||
* 意见内容 |
|||
*/ |
|||
private String comment; |
|||
|
|||
} |
@ -0,0 +1,16 @@ |
|||
package com.yxt.supervise.system.flow; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
public class FlowRecordVo { |
|||
private List<FlowTask> flowList = new ArrayList<>(); |
|||
|
|||
public List<FlowTask> getFlowList() { |
|||
return flowList; |
|||
} |
|||
|
|||
public void setFlowList(List<FlowTask> flowList) { |
|||
this.flowList = flowList; |
|||
} |
|||
} |
@ -0,0 +1,102 @@ |
|||
package com.yxt.supervise.system.flow; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.yxt.common.core.domain.BaseEntity; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* <p>工作流任务<p> |
|||
* |
|||
* @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 Date createTime;*/ |
|||
|
|||
@ApiModelProperty("任务完成时间") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
|||
private Date finishTime; |
|||
|
|||
@ApiModelProperty("环节的办理人信息") |
|||
private List<TaskUserInfo> taskUserInfos; |
|||
} |
@ -0,0 +1,19 @@ |
|||
package com.yxt.supervise.system.flow; |
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author hanweijia |
|||
* @date 2021/8/20 13:53 |
|||
* @description |
|||
*/ |
|||
@Data |
|||
public class FlowTaskAllQuery implements Query { |
|||
private static final long serialVersionUID = -7395299971899690002L; |
|||
private String proDefName;//流程定义名称
|
|||
private String processDefinitionId;//流程定义id
|
|||
private String startDate;//开始日期
|
|||
private String endDate;//结束日期
|
|||
private String orgSid;//部门sid
|
|||
} |
@ -0,0 +1,116 @@ |
|||
package com.yxt.supervise.system.flow; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* <p>工作流任务<p> |
|||
* |
|||
* @author XuanXuan |
|||
* @date 2021-04-03 |
|||
*/ |
|||
@ApiModel("工作流任务相关-返回参数") |
|||
@Data |
|||
public class FlowTaskDto implements Serializable { |
|||
|
|||
@ApiModelProperty("任务编号") |
|||
private String taskId; |
|||
|
|||
@ApiModelProperty("任务名称") |
|||
private String taskName; |
|||
|
|||
@ApiModelProperty("任务Key") |
|||
private String taskDefKey; |
|||
|
|||
@ApiModelProperty("任务执行人Id") |
|||
private String assigneeSid; |
|||
|
|||
@ApiModelProperty("部门名称") |
|||
private String deptName; |
|||
|
|||
@ApiModelProperty("流程发起人部门名称") |
|||
private String startDeptName; |
|||
|
|||
@ApiModelProperty("任务执行人名称") |
|||
private String assigneeName; |
|||
|
|||
@ApiModelProperty("流程发起人Id") |
|||
private String startUserSid; |
|||
|
|||
@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; |
|||
|
|||
@ApiModelProperty("候选执行人") |
|||
private String candidate; |
|||
@ApiModelProperty("结束事件ID") |
|||
private String endActId; |
|||
|
|||
@ApiModelProperty("流程创建时间") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
private Date processCreateTime; |
|||
@ApiModelProperty("任务创建时间") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
private Date createTime; |
|||
@ApiModelProperty("任务结束时间") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
private Date endTime; |
|||
|
|||
@ApiModelProperty("任务完成时间") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
private Date finishTime; |
|||
@ApiModelProperty("业务表单参数集合") |
|||
private Map<String, Object> processVariables; |
|||
|
|||
/*@ApiModelProperty("手机端参数集合") |
|||
private Map<String, Object> appVariables; |
|||
|
|||
@ApiModelProperty("pc端参数集合") |
|||
private Map<String, Object> pcVariables;*/ |
|||
|
|||
@ApiModelProperty("是否显示撤回按钮(登录用户与待办人是否为同一个)") |
|||
private boolean hasRevokeButton = false; |
|||
@ApiModelProperty("办理的url") |
|||
private SysProUrlVo sysProUrlVo ; |
|||
} |
@ -0,0 +1,43 @@ |
|||
package com.yxt.supervise.system.flow; |
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
|
|||
/** |
|||
* @author dimengzhe |
|||
* @date 2021/8/20 13:53 |
|||
* @description |
|||
*/ |
|||
public class FlowTaskQuery implements Query { |
|||
private static final long serialVersionUID = -7395299971899690002L; |
|||
@ApiModelProperty(value = "用户sid", required = true) |
|||
private String userSid; |
|||
@ApiModelProperty(value = "zd", required = true) |
|||
private String zd; |
|||
@ApiModelProperty(value = "days", required = true) |
|||
private String days; |
|||
|
|||
public String getZd() { |
|||
return zd; |
|||
} |
|||
|
|||
public void setZd(String zd) { |
|||
this.zd = zd; |
|||
} |
|||
|
|||
public String getDays() { |
|||
return days; |
|||
} |
|||
|
|||
public void setDays(String days) { |
|||
this.days = days; |
|||
} |
|||
|
|||
public String getUserSid() { |
|||
return userSid; |
|||
} |
|||
|
|||
public void setUserSid(String userSid) { |
|||
this.userSid = userSid; |
|||
} |
|||
} |
@ -0,0 +1,51 @@ |
|||
package com.yxt.supervise.system.flow; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* <p>流程任务<p> |
|||
* |
|||
* @author XuanXuan |
|||
* @date 2021-04-03 |
|||
*/ |
|||
@ApiModel("工作流任务相关--请求参数") |
|||
@Data |
|||
public class FlowTaskVo { |
|||
|
|||
@ApiModelProperty("任务Id") |
|||
private String taskId; |
|||
|
|||
@ApiModelProperty("用户Id") |
|||
private String userId; |
|||
@ApiModelProperty("用户Sid") |
|||
private String userSid; |
|||
|
|||
@ApiModelProperty("任务意见") |
|||
private String comment; |
|||
|
|||
@ApiModelProperty("流程实例Id") |
|||
private String instanceId; |
|||
|
|||
@ApiModelProperty("节点") |
|||
private String targetKey; |
|||
|
|||
@ApiModelProperty("流程变量信息") |
|||
private Map<String, Object> values=new HashMap<>(); |
|||
|
|||
@ApiModelProperty("审批人") |
|||
private String assignee; |
|||
|
|||
@ApiModelProperty("候选人") |
|||
private List<String> candidateUsers=new ArrayList<>(); |
|||
|
|||
@ApiModelProperty("审批组") |
|||
private List<String> candidateGroups=new ArrayList<>(); |
|||
|
|||
} |
@ -0,0 +1,8 @@ |
|||
package com.yxt.supervise.system.flow; |
|||
|
|||
import com.yxt.common.core.domain.BaseEntity; |
|||
import lombok.Data; |
|||
|
|||
@Data |
|||
public class Flowable extends BaseEntity { |
|||
} |
@ -0,0 +1,117 @@ |
|||
package com.yxt.supervise.system.flow; |
|||
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.supervise.system.flow.app.FlowTaskDoQuery; |
|||
import com.yxt.supervise.system.flow.app.FlowTaskDoVo; |
|||
import com.yxt.supervise.system.flow.app.FlowTaskFinishVo; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Component |
|||
public class FlowableFallback implements FlowableFeign{ |
|||
/* @Override |
|||
public ResultBean businessStart(String procDefId, String userSid, Map<String, Object> variables) { |
|||
return null; |
|||
} |
|||
*/ |
|||
@Override |
|||
public ResultBean processPagerList(Integer pageNum, Integer pageSize) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean myprocess( String userSid, PagerQuery<FlowTaskQuery> taskQueryPagerQuery) { |
|||
return null; |
|||
} |
|||
@Override |
|||
public ResultBean todoTaskList(String userSid, PagerQuery<TaskQuery> pQuery) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean readXml(String deployId) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean getFlowViewer(String procInsId) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean doneTaskList(String userSid, PagerQuery<TaskQuery> pQuery) { |
|||
return null; |
|||
} |
|||
|
|||
|
|||
@Override |
|||
public ResultBean revokeProcess(String userSid, String businessSid, FlowTaskVo flowTaskVo) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean<FlowRecordVo> flowRecord(String procInsId, String deployId) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean<List<PCHistTaskListAndCommentList>> flowRecordAndComment(String procInsId, String deployId) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean taskReject(String businessSid, FlowTaskVo flowTaskVo) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean stopProcess(FlowTaskVo flowTaskVo) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean deleteProcess(String procInsId) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean<Page<FlowTaskDto>> todoAllTaskList(String userSid, PagerQuery<FlowTaskAllQuery> pQuery) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean<Integer> getTodoNum(String userSid) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean<Integer> getTodoNum(String userSid, String orgPath) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean<Page<FlowTaskDto>> doneAllTaskList(String userSid, PagerQuery<FlowTaskAllQuery> pQuery) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean getNextTasks(String taskId) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean<PagerVo<FlowTaskDoVo>> todoApp(PagerQuery<FlowTaskDoQuery> pagerQuery) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean<PagerVo<FlowTaskFinishVo>> finishApp(PagerQuery<FlowTaskDoQuery> pagerQuery) { |
|||
return null; |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,231 @@ |
|||
package com.yxt.supervise.system.flow; |
|||
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.supervise.system.flow.app.FlowTaskDoQuery; |
|||
import com.yxt.supervise.system.flow.app.FlowTaskDoVo; |
|||
import com.yxt.supervise.system.flow.app.FlowTaskFinishVo; |
|||
import io.swagger.annotations.Api; |
|||
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; |
|||
|
|||
@Api(tags = "Flowable") |
|||
@FeignClient( |
|||
contextId = "anrui-portal-flow-Flowable", |
|||
name = "anrui-portal", |
|||
path = "v1/flow", |
|||
fallback = FlowableFallback.class) |
|||
public interface FlowableFeign { |
|||
/** |
|||
* 业务系统发起流程申请 |
|||
* |
|||
* @param procDefId 流程定义id |
|||
* @param userSid 用户sid |
|||
* @param variables form参数 |
|||
* @return |
|||
*/ |
|||
/* @PostMapping("/businessStart/{procDefId}/{userSid}") |
|||
public ResultBean businessStart(@ApiParam(value = "流程定义id") @PathVariable(value = "procDefId") String procDefId, |
|||
@ApiParam(value = "用户sid") @PathVariable(value = "userSid") String userSid, |
|||
@ApiParam(value = "变量集合,json对象") @RequestBody Map<String, Object> variables); |
|||
*/ |
|||
/** |
|||
* 流程定义列表 一般业务中不需要查询该列表 |
|||
* |
|||
* @param pageNum 页数 |
|||
* @param pageSize 容量 |
|||
* @return |
|||
*/ |
|||
@PostMapping("/processPagerList/{userSid}") |
|||
public ResultBean processPagerList(@ApiParam(value = "当前页码", required = true) @RequestParam("pageNum") Integer pageNum, |
|||
@ApiParam(value = "每页条数", required = true) @RequestParam("pageSize") Integer pageSize); |
|||
|
|||
/** |
|||
* 我的流程 我发起的流程 |
|||
* |
|||
* @param userSid 用户sid |
|||
* @param taskQueryPagerQuery 查询参数 |
|||
* @return |
|||
*/ |
|||
@PostMapping("/myprocess/{userSid}") |
|||
public ResultBean myprocess(@ApiParam(value = "用户sid") @PathVariable(value = "userSid") String userSid, |
|||
@ApiParam(value = "变量集合,json对象") @RequestBody PagerQuery<FlowTaskQuery> taskQueryPagerQuery); |
|||
|
|||
/** |
|||
* 待办列表 |
|||
* |
|||
* @param userSid 用户sid |
|||
* @param pQuery 查询参数 |
|||
* @return |
|||
*/ |
|||
@PostMapping("/todoTaskList/{userSid}") |
|||
public ResultBean todoTaskList(@ApiParam(value = "用户sid") @PathVariable(value = "userSid") String userSid, @ApiParam(value = "变量集合,json对象") @RequestBody PagerQuery<TaskQuery> pQuery); |
|||
|
|||
@ApiOperation(value = "读取xml文件") |
|||
@GetMapping("/readXml/{deployId}") |
|||
public ResultBean readXml(@ApiParam(value = "流程定义id") @PathVariable(value = "deployId") String deployId); |
|||
|
|||
/** |
|||
* 生成流程图 |
|||
* |
|||
* @param procInsId 任务ID |
|||
*/ |
|||
@ApiOperation(value = "生成流程图") |
|||
@RequestMapping("/flowViewer/{procInsId}") |
|||
public ResultBean getFlowViewer(@PathVariable("procInsId") String procInsId); |
|||
|
|||
/** |
|||
* 已办任务的查询 |
|||
* |
|||
* @param userSid 用户sid |
|||
* @param pQuery 查询参数 |
|||
* @return |
|||
*/ |
|||
@PostMapping("/doneTaskList/{userSid}") |
|||
public ResultBean doneTaskList(@ApiParam(value = "用户sid") @PathVariable(value = "userSid") String userSid, @ApiParam(value = "变量集合,json对象") @RequestBody PagerQuery<TaskQuery> pQuery); |
|||
|
|||
/** |
|||
* 处理待办任务 |
|||
* |
|||
* @param variables 表单参数 |
|||
* @return |
|||
*/ |
|||
/* @ApiOperation(value = "办理(同意)") |
|||
@PostMapping("/complete") |
|||
public ResultBean complete(@ApiParam(value = "变量集合,json对象") @RequestBody Map<String, Object> variables); |
|||
*/ |
|||
/** |
|||
* 流程撤回 |
|||
* |
|||
* @param userSid 用户sid |
|||
* @param flowTaskVo 参数 工作流任务相关--请求参数 |
|||
* @return |
|||
*/ |
|||
@ApiOperation(value = "撤回流程") |
|||
@PostMapping(value = "/revokeProcess/{userSid}/{businessSid}") |
|||
public ResultBean revokeProcess( |
|||
@ApiParam(value = "用户sid") @PathVariable(value = "userSid") String userSid, |
|||
@ApiParam(value = "业务sid") @PathVariable(value = "businessSid") String businessSid, |
|||
@ApiParam(value = "工作流任务相关--请求参数") @RequestBody FlowTaskVo flowTaskVo); |
|||
|
|||
/** |
|||
* 流程历史流转记录 |
|||
* |
|||
* @param procInsId 流程实例id |
|||
* @param deployId 目前没用 |
|||
* @return |
|||
*/ |
|||
@ApiOperation(value = "流程历史流转记录") |
|||
@GetMapping(value = "/task/flowRecord/{procInsId}/{deployId}") |
|||
public ResultBean<FlowRecordVo> flowRecord(@ApiParam(value = "流程实例id") @PathVariable(value = "procInsId") String procInsId, |
|||
@ApiParam(value = "目前没用") @PathVariable(value = "deployId") String deployId); |
|||
|
|||
/** |
|||
* 流程历史流转记录 包含了评论的数据 |
|||
* |
|||
* @param procInsId 流程实例id |
|||
* @param deployId 目前没用 |
|||
* @return |
|||
*/ |
|||
@ApiOperation(value = "流程历史流转记录") |
|||
@GetMapping(value = "/task/flowRecordAndComment/{procInsId}/{deployId}") |
|||
public ResultBean<List<PCHistTaskListAndCommentList>>flowRecordAndComment(@ApiParam(value = "流程实例id") @PathVariable(value = "procInsId") String procInsId, |
|||
@ApiParam(value = "目前没用") @PathVariable(value = "deployId") String deployId); |
|||
|
|||
/** |
|||
* 驳回任务 |
|||
* |
|||
* @param flowTaskVo |
|||
* @return |
|||
*/ |
|||
@ApiOperation(value = "驳回任务") |
|||
@PostMapping(value = "/reject/{businessSid}") |
|||
public ResultBean taskReject(@ApiParam(value = "业务sid") @PathVariable(value = "businessSid") String businessSid, |
|||
@ApiParam(value = "工作流任务相关--请求参数") @RequestBody FlowTaskVo flowTaskVo); |
|||
|
|||
/* @ApiOperation(value = "终止任务") |
|||
@PostMapping(value = "/breakProcess/{businessSid}") |
|||
public ResultBean breakProcess(@ApiParam(value = "业务sid") @PathVariable(value = "businessSid") String businessSid, |
|||
@RequestBody FlowTaskVo flowTaskVo); |
|||
*/ |
|||
/** |
|||
* 取消申请 |
|||
* |
|||
* @param flowTaskVo |
|||
* @return |
|||
*/ |
|||
@ApiOperation(value = "取消申请") |
|||
@PostMapping(value = "/task/stopProcess") |
|||
@ResponseBody |
|||
ResultBean stopProcess(@ApiParam(value = "工作流任务相关--请求参数") @RequestBody FlowTaskVo flowTaskVo); |
|||
|
|||
/** |
|||
* 删除流程实例 |
|||
* |
|||
* @param procInsId 流程实例id |
|||
* @return |
|||
*/ |
|||
@ApiOperation(value = "删除流程实例") |
|||
@DeleteMapping(value = "/task/deleteProcess/{procInsId}") |
|||
@ResponseBody |
|||
ResultBean deleteProcess(@ApiParam(value = "流程实例id") @PathVariable(value = "procInsId") String procInsId); |
|||
|
|||
/** |
|||
* 待办列表 |
|||
* |
|||
* @param userSid 用户sid |
|||
* @param pQuery 查询参数 |
|||
* @return |
|||
*/ |
|||
@ApiOperation(value = "总待办列表") |
|||
@PostMapping("/todoAllTaskList/{userSid}") |
|||
public ResultBean<Page<FlowTaskDto>> todoAllTaskList(@ApiParam(value = "用户sid") @PathVariable(value = "userSid") String userSid, |
|||
@ApiParam(value = "变量集合,json对象") @RequestBody PagerQuery<FlowTaskAllQuery> pQuery); |
|||
|
|||
@ApiOperation(value = "业务系统查询待办任务列表数量") |
|||
@GetMapping("/getTodoNum/{userSid}") |
|||
ResultBean<Integer> getTodoNum(@PathVariable(value = "userSid") String userSid); |
|||
@ApiOperation(value = "业务系统查询待办任务列表数量") |
|||
@GetMapping("/getTodoNum/{userSid}/{orgPath}") |
|||
ResultBean<Integer> getTodoNum(@PathVariable(value = "userSid")String userSid, |
|||
@PathVariable(value = "orgPath") String orgPath); |
|||
|
|||
/** |
|||
* 已办任务的查询 |
|||
* |
|||
* @param userSid 用户sid |
|||
* @param pQuery 查询参数 |
|||
* @return |
|||
*/ |
|||
@ApiOperation(value = "总已办列表") |
|||
@PostMapping("/doneAllTaskList/{userSid}") |
|||
public ResultBean<Page<FlowTaskDto>> doneAllTaskList(@ApiParam(value = "用户sid") @PathVariable(value = "userSid") String userSid, @ApiParam(value = "变量集合,json对象") @RequestBody PagerQuery<FlowTaskAllQuery> pQuery); |
|||
|
|||
/** |
|||
* 查询下一环节 |
|||
* |
|||
* @param taskId 查询参数 |
|||
* @return |
|||
*/ |
|||
|
|||
@ApiOperation(value = "查询下一环节") |
|||
@PostMapping("/getNextTasks/{taskId}") |
|||
@ResponseBody |
|||
public ResultBean getNextTasks(@ApiParam(value = "taskId") @PathVariable(value = "taskId") String taskId); |
|||
|
|||
@ApiOperation(value = "移动端总待办列表") |
|||
@PostMapping("/todoApp") |
|||
public ResultBean<PagerVo<FlowTaskDoVo>> todoApp(@RequestBody PagerQuery<FlowTaskDoQuery> pagerQuery); |
|||
|
|||
@ApiOperation(value = "移动端总已办列表") |
|||
@PostMapping("/finishedApp") |
|||
ResultBean<PagerVo<FlowTaskFinishVo>> finishApp(@RequestBody PagerQuery<FlowTaskDoQuery> pagerQuery); |
|||
|
|||
|
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.yxt.supervise.system.flow; |
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Map; |
|||
|
|||
@Data |
|||
public class GetNodeQuery implements Query { |
|||
private static final long serialVersionUID = -5674867230708197611L; |
|||
|
|||
@ApiModelProperty(value = "环节定义id") |
|||
private String taskDefKey; |
|||
@ApiModelProperty(value = "业务sid") |
|||
private String businessSid; |
|||
|
|||
|
|||
@ApiModelProperty(value = "分支字段及业务字段") |
|||
private Map<String, Object> formVariables; |
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.yxt.supervise.system.flow; |
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Data |
|||
public class GetNodeVo implements Vo { |
|||
private static final long serialVersionUID = 8802774014747063504L; |
|||
@ApiModelProperty(value = "节点名称") |
|||
private String name; |
|||
@ApiModelProperty(value = "节点id") |
|||
private String id; |
|||
@ApiModelProperty(value = "审批组") |
|||
private List<String> candidateGroups; |
|||
@ApiModelProperty(value = "是否是最后环节") |
|||
private String endTask; |
|||
} |
@ -0,0 +1,24 @@ |
|||
package com.yxt.supervise.system.flow; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonProperty; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
import java.util.Map; |
|||
@Data |
|||
public class PCHistTaskListAndCommentList { |
|||
private static final long serialVersionUID = -3272069366532392941L; |
|||
@ApiModelProperty(value = "流程状态") |
|||
@JsonProperty("state") |
|||
private String state; |
|||
@ApiModelProperty(value = "时间") |
|||
@JsonProperty("time") |
|||
private Date time; |
|||
@ApiModelProperty(value = "审批记录") |
|||
@JsonProperty("flowableRecordVo") |
|||
private Map<String,Object> flowableRecordVo; |
|||
@ApiModelProperty("流程评论") |
|||
@JsonProperty("processCommentVo") |
|||
private Map<String,Object> processCommentVo; |
|||
} |
@ -0,0 +1,54 @@ |
|||
package com.yxt.supervise.system.flow; |
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import io.swagger.annotations.ApiModel; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* 流程业务表单url对象 SysProUrl |
|||
* |
|||
* @author XuanXuan Xuan |
|||
* @date 2021-03-30 |
|||
*/ |
|||
@Data |
|||
@ApiModel("流程业务表单url对象") |
|||
public class SysProUrlVo implements Vo { |
|||
|
|||
/** |
|||
* 表单主键 |
|||
*/ |
|||
private String url; |
|||
|
|||
/** |
|||
* 类型办理或者详情 |
|||
*/ |
|||
private String type; |
|||
|
|||
/** |
|||
* 终端:pc/mobile |
|||
*/ |
|||
private String terminal; |
|||
/** |
|||
* 表单id |
|||
*/ |
|||
private String formId; |
|||
/** |
|||
* 名称 |
|||
*/ |
|||
private String title; |
|||
|
|||
/** |
|||
* 流程定义id |
|||
*/ |
|||
private String proc_def_id; |
|||
|
|||
/** |
|||
* 节点id |
|||
*/ |
|||
private String taskDefKey; |
|||
|
|||
/** |
|||
* app插件名称(模块名称) |
|||
*/ |
|||
private String modulePluginName; |
|||
} |
@ -0,0 +1,91 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.supervise.system.flow; |
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
|
|||
/** |
|||
* Project: anrui-parent <br/> |
|||
* File: TaskQuery.java <br/> |
|||
* Class: com.yxt.anrui.portal.biz.flow.TaskQuery <br/> |
|||
* Description: <描述类的功能>. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2021/10/27 下午3:36 <br/> |
|||
* |
|||
* @author popo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
public class TaskQuery implements Query { |
|||
|
|||
|
|||
private String days; |
|||
private String zd1; |
|||
private String processDefinitionId; |
|||
private String startTime; |
|||
private String orgSid; |
|||
|
|||
public String getOrgSid() { |
|||
return orgSid; |
|||
} |
|||
|
|||
public void setOrgSid(String orgSid) { |
|||
this.orgSid = orgSid; |
|||
} |
|||
|
|||
public String getZd1() { |
|||
return zd1; |
|||
} |
|||
|
|||
public void setZd1(String zd1) { |
|||
this.zd1 = zd1; |
|||
} |
|||
|
|||
public String getProcessDefinitionId() { |
|||
return processDefinitionId; |
|||
} |
|||
|
|||
public void setProcessDefinitionId(String processDefinitionId) { |
|||
this.processDefinitionId = processDefinitionId; |
|||
} |
|||
|
|||
public String getDays() { |
|||
return days; |
|||
} |
|||
|
|||
public void setDays(String days) { |
|||
this.days = days; |
|||
} |
|||
|
|||
public String getStartTime() { |
|||
return startTime; |
|||
} |
|||
|
|||
public void setStartTime(String startTime) { |
|||
this.startTime = startTime; |
|||
} |
|||
} |
@ -0,0 +1,31 @@ |
|||
package com.yxt.supervise.system.flow; |
|||
|
|||
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; |
|||
} |
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.yxt.supervise.system.flow.app; |
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2022/7/20 10:54 |
|||
* @Description |
|||
*/ |
|||
@Data |
|||
public class AppVo implements Vo { |
|||
private static final long serialVersionUID = -8153041978260796662L; |
|||
|
|||
private String path; |
|||
private String modulePluginName; |
|||
private Integer moduleVersion; |
|||
private String msgSid; |
|||
private String json; |
|||
private String type; |
|||
private String moduleAction; |
|||
} |
@ -0,0 +1,25 @@ |
|||
package com.yxt.supervise.system.flow.app; |
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2022/7/20 9:43 |
|||
* @Description |
|||
*/ |
|||
@Data |
|||
public class FlowTaskDoQuery implements Query { |
|||
private static final long serialVersionUID = 4327143083035475848L; |
|||
@ApiModelProperty("用户sid") |
|||
@NotBlank(message = "参数错误:userSid") |
|||
private String userSid; |
|||
@ApiModelProperty("工作名称") |
|||
private String names; |
|||
|
|||
@ApiModelProperty("组织机构sid") |
|||
private String orgPath; |
|||
} |
@ -0,0 +1,50 @@ |
|||
package com.yxt.supervise.system.flow.app; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import com.yxt.common.core.vo.Vo; |
|||
import com.yxt.supervise.system.flow.SysProUrlVo; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2022/7/20 9:45 |
|||
* @Description 移动待办返回参数 |
|||
*/ |
|||
@Data |
|||
public class FlowTaskDoVo implements Vo { |
|||
private static final long serialVersionUID = 8771689666940266426L; |
|||
@ApiModelProperty(value = "环节名称") |
|||
private String taskName; |
|||
@ApiModelProperty(value = "发起部门") |
|||
private String startDeptName; |
|||
@ApiModelProperty(value = "发起人") |
|||
private String startUserName; |
|||
@ApiModelProperty(value = "工作名称") |
|||
private String procDefName; |
|||
@ApiModelProperty(value = "提交日期") |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
private Date processCreateTime; |
|||
@ApiModelProperty(value = "发起日期") |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
private Date createTime; |
|||
@ApiModelProperty(value = "流程id") |
|||
private String deployId; |
|||
@ApiModelProperty(value = "流程实例id") |
|||
private String procInsId; |
|||
@ApiModelProperty(value = "任务id") |
|||
private String taskId; |
|||
@ApiModelProperty("节点id") |
|||
private String taskDefKey; |
|||
@ApiModelProperty(value = "app集合") |
|||
private AppVo appVariables; |
|||
@JsonIgnore |
|||
private Map<String, Object> processVariables; |
|||
@ApiModelProperty("办理的url") |
|||
@JsonIgnore |
|||
private SysProUrlVo sysProUrlVo; |
|||
} |
@ -0,0 +1,58 @@ |
|||
package com.yxt.supervise.system.flow.app; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import com.fasterxml.jackson.annotation.JsonProperty; |
|||
import com.yxt.common.core.vo.Vo; |
|||
import com.yxt.supervise.system.flow.SysProUrlVo; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2022/7/29 17:31 |
|||
* @Description |
|||
*/ |
|||
@Data |
|||
public class FlowTaskFinishVo implements Vo { |
|||
private static final long serialVersionUID = -5936470750210770833L; |
|||
|
|||
@ApiModelProperty(value = "流程id") |
|||
private String deployId; |
|||
@ApiModelProperty(value = "流程实例id") |
|||
private String procInsId; |
|||
@ApiModelProperty(value = "任务id") |
|||
private String taskId; |
|||
@ApiModelProperty("节点id") |
|||
private String taskDefKey; |
|||
@ApiModelProperty(value = "app集合") |
|||
private AppVo appVariables; |
|||
@ApiModelProperty(value = "环节名称") |
|||
private String taskName; |
|||
@ApiModelProperty(value = "发起部门") |
|||
private String startDeptName; |
|||
@ApiModelProperty(value = "发起人") |
|||
private String startUserName; |
|||
@ApiModelProperty(value = "工作名称") |
|||
private String procDefName; |
|||
@ApiModelProperty(value = "提交日期") |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
private Date processCreateTime; |
|||
@ApiModelProperty(value = "发起日期") |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
private Date createTime; |
|||
@ApiModelProperty("任务结束时间") |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
private Date endTime; |
|||
@JsonIgnore |
|||
private Map<String, Object> processVariables; |
|||
@ApiModelProperty("办理的url") |
|||
@JsonIgnore |
|||
private SysProUrlVo sysProUrlVo; |
|||
@ApiModelProperty("任务执行人名称") |
|||
@JsonProperty("currentHandle") |
|||
private String assigneeName; |
|||
} |
@ -0,0 +1,37 @@ |
|||
package com.yxt.supervise.system.purchasingrequisition; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.yxt.common.core.domain.BaseEntity; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
|
|||
@Data |
|||
@ApiModel(value = "采购申请", description = "采购申请") |
|||
@TableName("purchasing_requisition") |
|||
public class PurchasingRequisition extends BaseEntity { |
|||
private static final long serialVersionUID = 1L; |
|||
@ApiModelProperty("商品名称") |
|||
private String proname; |
|||
@ApiModelProperty("商品类型") |
|||
private String protype; |
|||
@ApiModelProperty("金额") |
|||
private String money; |
|||
@ApiModelProperty("用户") |
|||
private String user; |
|||
@ApiModelProperty("数量") |
|||
private String num; |
|||
@ApiModelProperty(value = "节点状态") |
|||
private String nodeState; |
|||
@ApiModelProperty("流程定义的id") |
|||
private String procDefId; |
|||
@ApiModelProperty("流程实例的id") |
|||
private String procInstSid; |
|||
@ApiModelProperty(value = "任务id") |
|||
private String taskId; |
|||
@ApiModelProperty(value = "环节定义的ID") |
|||
private String taskDefKey; |
|||
@ApiModelProperty(value = "nodeSid") |
|||
private String nodeSid; |
|||
} |
@ -0,0 +1,33 @@ |
|||
package com.yxt.supervise.system.purchasingrequisition; |
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
|
|||
@Data |
|||
@ApiModel(value = "采购申请", description = "采购申请") |
|||
public class PurchasingRequisitionDetailsVo implements Vo { |
|||
private static final long serialVersionUID = 1L; |
|||
@ApiModelProperty("商品名称") |
|||
private String proname; |
|||
@ApiModelProperty("商品类型") |
|||
private String protype; |
|||
@ApiModelProperty("金额") |
|||
private String money; |
|||
@ApiModelProperty("用户") |
|||
private String user; |
|||
@ApiModelProperty("数量") |
|||
private String num; |
|||
@ApiModelProperty(value = "节点状态") |
|||
private String nodeState; |
|||
@ApiModelProperty("流程定义的id") |
|||
private String procDefId; |
|||
@ApiModelProperty("流程实例的id") |
|||
private String procInsId; |
|||
@ApiModelProperty(value = "任务id") |
|||
private String taskId; |
|||
@ApiModelProperty(value = "环节定义的ID") |
|||
private String taskDefKey; |
|||
} |
@ -0,0 +1,77 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.supervise.system.purchasingrequisition; |
|||
|
|||
|
|||
import com.yxt.common.core.dto.Dto; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* Project: yxt_supervise(宇信通监管) <br/> |
|||
* File: DictTypeDto.java <br/> |
|||
* Class: com.supervise.api.dicttype.DictTypeDto <br/> |
|||
* Description: 数据字典——数据类型 数据传输对象. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2022-11-11 11:40:29 <br/> |
|||
* |
|||
* @author dongjianzhao |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Data |
|||
@ApiModel(value = "数据字典——数据类型 数据传输对象", description = "数据字典——数据类型 数据传输对象") |
|||
public class PurchasingRequisitionDto implements Dto { |
|||
|
|||
private String sid; // sid
|
|||
|
|||
@ApiModelProperty("商品名称") |
|||
private String proname; |
|||
@ApiModelProperty("商品类型") |
|||
private String protype; |
|||
@ApiModelProperty("金额") |
|||
private String money; |
|||
@ApiModelProperty("用户") |
|||
private String user; |
|||
@ApiModelProperty("数量") |
|||
private String num; |
|||
@ApiModelProperty(value = "节点状态") |
|||
private String nodeState; |
|||
@ApiModelProperty("流程定义的id") |
|||
private String procDefId; |
|||
@ApiModelProperty("流程实例的id") |
|||
private String procInsId; |
|||
@ApiModelProperty(value = "任务id") |
|||
private String taskId; |
|||
@ApiModelProperty(value = "环节定义的ID") |
|||
private String taskDefKey; |
|||
@ApiModelProperty(value = "instanceSid") |
|||
private String instanceId; |
|||
@ApiModelProperty(value = "comment") |
|||
private String comment; |
|||
} |
@ -0,0 +1,119 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.supervise.system.purchasingrequisition; |
|||
|
|||
import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.supervise.system.flow.GetNodeQuery; |
|||
import com.yxt.supervise.system.flow.GetNodeVo; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.cloud.openfeign.SpringQueryMap; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.validation.Valid; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* Project: yxt_supervise(宇信通监管) <br/> |
|||
* File: DictTypeFeign.java <br/> |
|||
* Class: com.supervise.api.dicttype.DictTypeFeign <br/> |
|||
* Description: 数据字典——数据类型. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2022-11-11 11:40:29 <br/> |
|||
* |
|||
* @author dongjianzhao |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Api(tags = "数据字典——数据类型") |
|||
@FeignClient( |
|||
contextId = "yxt-supervise-PurchasingRequisition", |
|||
name = "yxt-supervise", |
|||
path = "v1/pr", |
|||
fallback = PurchasingRequisitionFeignFallback.class) |
|||
public interface PurchasingRequisitionFeign { |
|||
|
|||
@ApiOperation("根据条件分页查询数据的列表") |
|||
@PostMapping("/listPage") |
|||
@ResponseBody |
|||
public ResultBean<PagerVo<PurchasingRequisitionVo>> listPage(@RequestBody PagerQuery<PurchasingRequisitionQuery> pq); |
|||
|
|||
@ApiOperation("新增或修改") |
|||
@PostMapping("/save") |
|||
@ResponseBody |
|||
public ResultBean save(@RequestBody PurchasingRequisitionDto dto); |
|||
@ApiOperation("提交") |
|||
@PostMapping("/submit") |
|||
@ResponseBody |
|||
public ResultBean submit(@RequestBody PurchasingRequisitionDto dto); |
|||
|
|||
@ApiOperation("根据sid批量删除") |
|||
@DeleteMapping("/delBySids") |
|||
@ResponseBody |
|||
public ResultBean delBySids(@RequestBody String[] sids); |
|||
|
|||
@ApiOperation("根据SID获取一条记录") |
|||
@GetMapping("/fetchDetailsBySid/{sid}") |
|||
@ResponseBody |
|||
public ResultBean<PurchasingRequisitionDetailsVo> fetchDetailsBySid(@PathVariable("sid") String sid); |
|||
|
|||
/** flow */ |
|||
|
|||
@ApiOperation(value = "办理(同意)") |
|||
@PostMapping("/complete") |
|||
@ResponseBody |
|||
public ResultBean complete(@Valid @RequestBody BusinessVariables query); |
|||
@ApiOperation(value = "获取上一个环节") |
|||
@GetMapping(value = "/getPreviousNodesForReject") |
|||
@ResponseBody |
|||
ResultBean<List<GetNodeVo>> getPreviousNodesForReject(@Valid @SpringQueryMap GetNodeQuery query); |
|||
|
|||
@ApiOperation(value = "获取下一个环节") |
|||
@GetMapping(value = "/getNextNodesForSubmit") |
|||
@ResponseBody |
|||
ResultBean<List<GetNodeVo>> getNextNodesForSubmit(@Valid @SpringQueryMap GetNodeQuery query); |
|||
|
|||
@ApiOperation(value = "驳回任务") |
|||
@PostMapping(value = "/reject") |
|||
@ResponseBody |
|||
public ResultBean taskReject(@Valid @RequestBody PurchasingRequisitionQuery query); |
|||
|
|||
@ApiOperation(value = "撤回流程") |
|||
@PostMapping(value = "/revokeProcess") |
|||
@ResponseBody |
|||
public ResultBean revokeProcess(@Valid @RequestBody PurchasingRequisitionQuery query); |
|||
|
|||
@ApiOperation(value = "终止任务") |
|||
@PostMapping(value = "/breakProcess") |
|||
@ResponseBody |
|||
public ResultBean breakProcess(@Valid @RequestBody PurchasingRequisitionQuery query); |
|||
|
|||
} |
@ -0,0 +1,110 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.supervise.system.purchasingrequisition; |
|||
|
|||
import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.supervise.system.flow.GetNodeQuery; |
|||
import com.yxt.supervise.system.flow.GetNodeVo; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* Project: yxt_supervise(宇信通监管) <br/> |
|||
* File: DictTypeFeignFallback.java <br/> |
|||
* Class: com.supervise.api.dicttype.DictTypeFeignFallback <br/> |
|||
* Description: 数据字典——数据类型. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2022-11-11 11:40:29 <br/> |
|||
* |
|||
* @author dongjianzhao |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Component |
|||
public class PurchasingRequisitionFeignFallback implements PurchasingRequisitionFeign { |
|||
|
|||
@Override |
|||
public ResultBean<PagerVo<PurchasingRequisitionVo>> listPage(PagerQuery<PurchasingRequisitionQuery> pq){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
return rb.setMsg("接口yxt_supervise/dicttype/listPage无法访问"); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean save(PurchasingRequisitionDto dto){ |
|||
return ResultBean.fireFail().setMsg("接口yxt_supervise/dicttype/save无法访问"); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean submit(PurchasingRequisitionDto dto) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean delBySids( String[] sids){ |
|||
return ResultBean.fireFail().setMsg("接口yxt_supervise/dicttype/delBySids无法访问"); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean<PurchasingRequisitionDetailsVo> fetchDetailsBySid(String sid){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
return rb.setMsg("接口yxt_supervise/dicttype/fetchDetailsBySid无法访问"); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean complete(BusinessVariables query) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean<List<GetNodeVo>> getPreviousNodesForReject(GetNodeQuery query) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean<List<GetNodeVo>> getNextNodesForSubmit(GetNodeQuery query) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean taskReject(PurchasingRequisitionQuery query) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean revokeProcess(PurchasingRequisitionQuery query) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean breakProcess(PurchasingRequisitionQuery query) { |
|||
return null; |
|||
} |
|||
} |
@ -0,0 +1,82 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.supervise.system.purchasingrequisition; |
|||
|
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* Project: yxt_supervise(宇信通监管) <br/> |
|||
* File: DictTypeQuery.java <br/> |
|||
* Class: com.supervise.api.dicttype.DictTypeQuery <br/> |
|||
* Description: 数据字典——数据类型 查询条件. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2022-11-11 11:40:29 <br/> |
|||
* |
|||
* @author dongjianzhao |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Data |
|||
@ApiModel(value = "数据字典——数据类型 查询条件", description = "数据字典——数据类型 查询条件") |
|||
public class PurchasingRequisitionQuery implements Query { |
|||
|
|||
@ApiModelProperty("商品名称") |
|||
private String proname; |
|||
@ApiModelProperty("商品类型") |
|||
private String protype; |
|||
@ApiModelProperty("金额") |
|||
private String money; |
|||
@ApiModelProperty("用户") |
|||
private String user; |
|||
@ApiModelProperty("数量") |
|||
private String num; |
|||
@ApiModelProperty(value = "节点状态") |
|||
private String nodeState; |
|||
@ApiModelProperty("流程定义的id") |
|||
private String procDefId; |
|||
@ApiModelProperty("流程实例的id") |
|||
private String procInsId; |
|||
@ApiModelProperty(value = "任务id") |
|||
private String taskId; |
|||
@ApiModelProperty(value = "环节定义的ID") |
|||
private String taskDefKey; |
|||
@ApiModelProperty(value = "usersid") |
|||
private String userSid; |
|||
@ApiModelProperty(value = "businessSid") |
|||
private String businessSid; |
|||
@ApiModelProperty(value = "instanceId") |
|||
private String instanceId; |
|||
/** |
|||
* 终止、驳回 |
|||
*/ |
|||
@ApiModelProperty("任务意见") |
|||
private String comment; |
|||
} |
@ -0,0 +1,73 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.supervise.system.purchasingrequisition; |
|||
|
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* Project: yxt_supervise(宇信通监管) <br/> |
|||
* File: DictTypeVo.java <br/> |
|||
* Class: com.supervise.api.dicttype.DictTypeVo <br/> |
|||
* Description: 数据字典——数据类型 视图数据对象. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2022-11-11 11:40:29 <br/> |
|||
* |
|||
* @author dongjianzhao |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Data |
|||
@ApiModel(value = "数据字典——数据类型 视图数据对象", description = "数据字典——数据类型 视图数据对象") |
|||
public class PurchasingRequisitionVo implements Vo { |
|||
|
|||
private String sid; // sid
|
|||
|
|||
@ApiModelProperty("商品名称") |
|||
private String proname; |
|||
@ApiModelProperty("商品类型") |
|||
private String protype; |
|||
@ApiModelProperty("金额") |
|||
private String money; |
|||
@ApiModelProperty("用户") |
|||
private String user; |
|||
@ApiModelProperty("数量") |
|||
private String num; |
|||
@ApiModelProperty(value = "节点状态") |
|||
private String nodeState; |
|||
@ApiModelProperty("流程定义的id") |
|||
private String procDefId; |
|||
@ApiModelProperty("流程实例的id") |
|||
private String procInstSid; |
|||
@ApiModelProperty(value = "任务id") |
|||
private String taskId; |
|||
@ApiModelProperty(value = "环节定义的ID") |
|||
private String taskDefKey; |
|||
} |
@ -0,0 +1,11 @@ |
|||
package com.yxt.supervise.system.flow; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.Map; |
|||
|
|||
@Mapper |
|||
public interface FlowableMapper extends BaseMapper<Flowable> { |
|||
void insetFlowableTask(Map<String,Object> params); |
|||
} |
@ -0,0 +1,59 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.yxt.supervise.system.flow.FlowableMapper"> |
|||
<insert id="insetFlowableTask" parameterType="com.yxt.supervise.system.flow.Flowable"> |
|||
insert into `act_ru_task` ( `days`, `zd`,initiator,outcome) |
|||
VALUES |
|||
( |
|||
#{days,jdbcType=VARCHAR}, |
|||
#{zd,jdbcType=VARCHAR} |
|||
#{initiator,jdbcType=VARCHAR} |
|||
#{outcome,jdbcType=VARCHAR} |
|||
) |
|||
</insert> |
|||
<!-- |
|||
<insert id="insetFlowableTask"> |
|||
insert into `act_ru_task` (`REV`, `EXECUTION_ID`, `PROC_INST_ID`, `PROC_DEF_ID`, |
|||
`TASK_DEF_ID`, `SCOPE_ID`, `SUB_SCOPE_ID`, `SCOPE_TYPE`, `SCOPE_DEFINITION_ID`, |
|||
`PROPAGATED_STAGE_INST_ID`, `NAME`, `PARENT_TASK_ID`, `DESCRIPTION`, |
|||
`TASK_DEF_KEY`, `OWNER`, `ASSIGNEE`, `DELEGATION`, `PRIORITY`, |
|||
`CREATE_TIME`, `DUE_DATE`, `CATEGORY`, `SUSPENSION_STATE`, `TENANT_ID`, |
|||
`FORM_KEY`, `CLAIM_TIME`, `IS_COUNT_ENABLED`, `VAR_COUNT`, `ID_LINK_COUNT`, |
|||
`SUB_TASK_COUNT`, `days`, `reason`) |
|||
VALUES |
|||
( |
|||
#{item.modelSid,jdbcType=VARCHAR},<!–sid–> |
|||
#{item.modelSid,jdbcType=VARCHAR}, |
|||
#{item.modelSid,jdbcType=VARCHAR}, |
|||
#{item.modelSid,jdbcType=VARCHAR}, |
|||
#{item.modelSid,jdbcType=VARCHAR}, |
|||
#{item.modelSid,jdbcType=VARCHAR}, |
|||
#{item.modelSid,jdbcType=VARCHAR}, |
|||
#{item.modelSid,jdbcType=VARCHAR}, |
|||
#{item.modelSid,jdbcType=VARCHAR}, |
|||
#{item.modelSid,jdbcType=VARCHAR}, |
|||
#{item.modelSid,jdbcType=VARCHAR}, |
|||
#{item.modelSid,jdbcType=VARCHAR}, |
|||
#{item.modelSid,jdbcType=VARCHAR}, |
|||
#{item.modelSid,jdbcType=VARCHAR}, |
|||
#{item.modelSid,jdbcType=VARCHAR}, |
|||
#{item.modelSid,jdbcType=VARCHAR}, |
|||
#{item.modelSid,jdbcType=VARCHAR}, |
|||
#{item.modelSid,jdbcType=VARCHAR}, |
|||
#{item.modelSid,jdbcType=VARCHAR}, |
|||
#{item.modelSid,jdbcType=VARCHAR}, |
|||
#{item.modelSid,jdbcType=VARCHAR}, |
|||
#{item.modelSid,jdbcType=VARCHAR}, |
|||
#{item.modelSid,jdbcType=VARCHAR}, |
|||
#{item.modelSid,jdbcType=VARCHAR}, |
|||
#{item.modelSid,jdbcType=VARCHAR}, |
|||
#{item.modelSid,jdbcType=VARCHAR}, |
|||
#{item.modelSid,jdbcType=VARCHAR}, |
|||
#{item.modelSid,jdbcType=VARCHAR}, |
|||
#{item.modelSid,jdbcType=VARCHAR}, |
|||
#{item.modelSid,jdbcType=VARCHAR}, |
|||
#{item.modelSid,jdbcType=VARCHAR} |
|||
) |
|||
</insert> |
|||
--> |
|||
</mapper> |
@ -0,0 +1,292 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.supervise.system.flow; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.yxt.anrui.flowable.api.processcomment.ProcessCommentFeign; |
|||
import com.yxt.anrui.flowable.api.processcomment.ProcessCommentVo; |
|||
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 com.yxt.supervise.system.flow.app.FlowTaskDoQuery; |
|||
import com.yxt.supervise.system.flow.app.FlowTaskDoVo; |
|||
import com.yxt.supervise.system.flow.app.FlowTaskFinishVo; |
|||
import com.yxt.supervise.system.sysstafforg.SysStaffOrgService; |
|||
import com.yxt.supervise.system.sysstafforg.SysStaffOrgVo; |
|||
import com.yxt.supervise.system.sysuser.SysUser; |
|||
import com.yxt.supervise.system.sysuser.SysUserService; |
|||
import io.swagger.annotations.Api; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.text.SimpleDateFormat; |
|||
import java.util.ArrayList; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* Project: anrui-parent <br/> |
|||
* File: FlowableRest.java <br/> |
|||
* Class: com.yxt.anrui.portal.biz.flow.FlowableRest <br/> |
|||
* Description: <描述类的功能>. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2021/10/23 上午11:13 <br/> |
|||
* |
|||
* @author popo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("v1/flow") |
|||
@Api(tags = "业务系统中业务和工作流相关操作") |
|||
public class FlowableRest implements FlowableFeign { |
|||
|
|||
@Autowired |
|||
private FlowableService flowableService; |
|||
@Autowired |
|||
private SysStaffOrgService sysStaffOrgService; |
|||
@Autowired |
|||
private SysUserService sysUserService; |
|||
@Autowired |
|||
private ProcessCommentFeign processCommentFeign; |
|||
/* |
|||
|
|||
@Override |
|||
public ResultBean businessStart(String procDefId, String userSid, Map<String, Object> variables) { |
|||
return flowableService.businessStart(procDefId, userSid, variables); |
|||
} |
|||
*/ |
|||
|
|||
@Override |
|||
public ResultBean processPagerList(Integer pageNum, Integer pageSize) { |
|||
return flowableService.processPagerList(pageNum, pageSize); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean myprocess(String userSid, PagerQuery<FlowTaskQuery> taskQueryPagerQuery) { |
|||
return flowableService.myprocess(userSid, taskQueryPagerQuery); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean todoTaskList(String userSid, PagerQuery<TaskQuery> pQuery) { |
|||
|
|||
SysUser sysUser = sysUserService.fetchBySid(userSid); |
|||
String staffSid = sysUser.getStaffSid(); |
|||
|
|||
List<SysStaffOrgVo> sysStaffOrgListByStaffSid = sysStaffOrgService.getSysStaffOrgListByStaffSid(staffSid); |
|||
StringBuilder sb = new StringBuilder(); |
|||
for (SysStaffOrgVo s : sysStaffOrgListByStaffSid) { |
|||
sb.append(s.getOrgSidPath()); |
|||
sb.append(","); |
|||
} |
|||
sb.delete(sb.length() - 1, sb.length()); |
|||
pQuery.getParams().setOrgSid(sb.toString()); |
|||
return flowableService.todoTaskList(userSid, pQuery); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean readXml(String deployId) { |
|||
return flowableService.readXml(deployId); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean getFlowViewer(String procInsId) { |
|||
return flowableService.getFlowViewer(procInsId); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean doneTaskList(String userSid, PagerQuery<TaskQuery> pQuery) { |
|||
return flowableService.doneTaskList(userSid, pQuery); |
|||
} |
|||
|
|||
/* @Override |
|||
public ResultBean complete(Map<String, Object> variables) { |
|||
return flowableService.complete(variables); |
|||
}*/ |
|||
|
|||
@Override |
|||
public ResultBean revokeProcess(String userSid, String businessSid, FlowTaskVo flowTaskVo) { |
|||
return flowableService.revokeProcess(userSid, businessSid, flowTaskVo); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean<FlowRecordVo> flowRecord(String procInsId, String deployId) { |
|||
ResultBean<com.yxt.anrui.flowable.api.flowtask.FlowRecordVo> flowRecordVoResultBean = flowableService.flowRecord(procInsId, deployId); |
|||
com.yxt.anrui.flowable.api.flowtask.FlowRecordVo flowRecordVo = flowRecordVoResultBean.getData(); |
|||
FlowRecordVo flowRecordVo1 = new FlowRecordVo(); |
|||
BeanUtil.copyProperties(flowRecordVo,flowRecordVo1); |
|||
ResultBean<FlowRecordVo> resultBean = new ResultBean<FlowRecordVo>().success(); |
|||
resultBean.setData(flowRecordVo1); |
|||
return resultBean; |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean<List<PCHistTaskListAndCommentList>> flowRecordAndComment(String procInsId, String deployId) { |
|||
ResultBean< com.yxt.anrui.flowable.api.flowtask.FlowRecordVo> flowRecordVoResultBean = flowableService.flowRecord(procInsId, deployId); |
|||
com.yxt.anrui.flowable.api.flowtask.FlowRecordVo flowRecordVo = flowRecordVoResultBean.getData(); |
|||
// private List<com.yxt.anrui.flowable.api.flowtask.FlowTask> flowList = new ArrayList<>();
|
|||
List<PCHistTaskListAndCommentList> flowList = new ArrayList<>(); |
|||
//流转记录
|
|||
List<com.yxt.anrui.flowable.api.flowtask.FlowTask> flowList1 = flowRecordVo.getFlowList(); |
|||
flowList1.forEach(f->{ |
|||
PCHistTaskListAndCommentList a=new PCHistTaskListAndCommentList(); |
|||
a.setTime(f.getFinishTime()==null?new Date():new Date()); |
|||
Map<String, Object> stringObjectMap = BeanUtil.beanToMap(f); |
|||
a.setFlowableRecordVo(stringObjectMap); |
|||
a.setState(0+""); |
|||
flowList.add(a); |
|||
}); |
|||
//评论记录
|
|||
ResultBean<List<ProcessCommentVo>> commentList = getCommentList(procInsId,deployId); |
|||
commentList.getData().forEach(f->{ |
|||
PCHistTaskListAndCommentList a=new PCHistTaskListAndCommentList(); |
|||
Date time = f.getTime(); |
|||
a.setTime(time); |
|||
// f.setTitle(f.getTaskUserInfo().getAssigneeName()+"添加了评论");
|
|||
Map<String, Object> stringObjectMap = BeanUtil.beanToMap(f); |
|||
a.setProcessCommentVo(stringObjectMap); |
|||
a.setState(1+""); |
|||
flowList.add(a); |
|||
}); |
|||
flowList.sort((t1, t2) -> t2.getTime().compareTo(t1.getTime())); |
|||
//flowRecordVo.setFlowList(flowList);
|
|||
ResultBean<List<PCHistTaskListAndCommentList>> resultBean = new ResultBean<List<PCHistTaskListAndCommentList>>().success(); |
|||
resultBean.setData(flowList); |
|||
return resultBean; |
|||
} |
|||
|
|||
public ResultBean<List<ProcessCommentVo>> getCommentList(String procInsId, String deployId) { |
|||
ResultBean<List<ProcessCommentVo>> rb = ResultBean.fireFail(); |
|||
ResultBean<List<com.yxt.anrui.flowable.api.processcomment.ProcessCommentVo>> commentList = processCommentFeign.getCommentList(procInsId); |
|||
List<ProcessCommentVo> list=new ArrayList<>(); |
|||
commentList.getData().forEach(f->{ |
|||
ProcessCommentVo processCommentVo = new ProcessCommentVo(); |
|||
BeanUtil.copyProperties(f,processCommentVo); |
|||
//processCommentVo.setCreateTime(f.getTime());
|
|||
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); |
|||
String format = sdf.format(f.getTime()); |
|||
// processCommentVo.setTime(format);
|
|||
list.add(processCommentVo); |
|||
}); |
|||
return rb.success().setData(list); |
|||
} |
|||
@Override |
|||
public ResultBean taskReject(String businessSid, FlowTaskVo flowTaskVo) { |
|||
return flowableService.taskReject(businessSid, flowTaskVo); |
|||
} |
|||
|
|||
/* @Override |
|||
public ResultBean breakProcess(String businessSid, FlowTaskVo flowTaskVo) { |
|||
return flowableService.breakProcess(businessSid, flowTaskVo); |
|||
}*/ |
|||
|
|||
@Override |
|||
public ResultBean stopProcess(FlowTaskVo flowTaskVo) { |
|||
flowableService.stopProcess(flowTaskVo); |
|||
return ResultBean.fireSuccess(); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean deleteProcess(String procInsId) { |
|||
flowableService.deleteProcess(procInsId); |
|||
return ResultBean.fireSuccess(); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean<Page<FlowTaskDto>> todoAllTaskList(String userSid, PagerQuery<FlowTaskAllQuery> pQuery) {//待办列表
|
|||
SysUser sysUser = sysUserService.fetchBySid(userSid); |
|||
String staffSid = sysUser.getStaffSid(); |
|||
List<SysStaffOrgVo> 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<FlowTaskDto> page = new Page<>(); |
|||
|
|||
BeanUtil.copyProperties(flowableService.todoAllTaskList(userSid, pQuery).getData(),page); |
|||
|
|||
ResultBean< Page<FlowTaskDto>> success = new ResultBean< Page<FlowTaskDto>>().success(); |
|||
success.setData(page); |
|||
return success; |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean<Integer> getTodoNum(String userSid) { |
|||
ResultBean<Integer> rb=ResultBean.fireFail(); |
|||
if(StringUtils.isBlank(userSid)){ |
|||
return rb.setMsg("用户sid不能为空"); |
|||
} |
|||
return flowableService.getTodoNum(userSid); |
|||
} |
|||
@Override |
|||
public ResultBean<Integer> getTodoNum(String userSid,String orgPath) { |
|||
ResultBean<Integer> rb=ResultBean.fireFail(); |
|||
if(StringUtils.isBlank(userSid)){ |
|||
return rb.setMsg("用户sid不能为空"); |
|||
} |
|||
if(StringUtils.isBlank(orgPath)){ |
|||
return rb.setMsg("用户orgPath不能为空"); |
|||
} |
|||
return flowableService.getTodoNum(userSid,orgPath); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean<Page<FlowTaskDto>> doneAllTaskList(String userSid, PagerQuery<FlowTaskAllQuery> pQuery) {//已办列表
|
|||
ResultBean<Page<com.yxt.anrui.flowable.api.flowtask.FlowTaskDto>> pageResultBean = flowableService.doneAllTaskList(userSid, pQuery); |
|||
Page<FlowTaskDto> page = new Page<>(); |
|||
|
|||
BeanUtil.copyProperties(pageResultBean.getData(),page); |
|||
|
|||
ResultBean< Page<FlowTaskDto>> success = new ResultBean< Page<FlowTaskDto>>().success(); |
|||
success.setData(page); |
|||
return success; |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean getNextTasks(String taskId) { |
|||
return flowableService.getNextTasks(taskId); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean<PagerVo<FlowTaskDoVo>> todoApp(PagerQuery<FlowTaskDoQuery> pagerQuery) { |
|||
return null;//flowableService.todoApp(pagerQuery);
|
|||
} |
|||
|
|||
@Override |
|||
public ResultBean<PagerVo<FlowTaskFinishVo>> finishApp(PagerQuery<FlowTaskDoQuery> pagerQuery) { |
|||
return null;//flowableService.finishApp(pagerQuery);
|
|||
} |
|||
} |
@ -0,0 +1,449 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
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.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.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.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 <br/> |
|||
* File: FlowableService.java <br/> |
|||
* Class: com.yxt.anrui.portal.biz.flow.FlowableService <br/> |
|||
* Description: <描述类的功能>. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2021/10/23 上午11:14 <br/> |
|||
* |
|||
* @author popo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Service |
|||
public class FlowableService extends MybatisBaseService<FlowableMapper, Flowable> { |
|||
@Autowired |
|||
private FlowDefinitionFeign flowDefinitionFeign; |
|||
@Autowired |
|||
private FlowTaskFeign flowTaskFeign; |
|||
@Autowired |
|||
private SysFormLinkFeign sysFormLinkFeign; |
|||
@Autowired |
|||
private SysProUrlFeign sysProUrlFeign; |
|||
@Autowired |
|||
private FileUploadComponent fileUploadComponent; |
|||
/* |
|||
|
|||
public ResultBean businessStart(@ApiParam(value = "流程定义id") @PathVariable(value = "procDefId") String procDefId, |
|||
@ApiParam(value = "用户sid") @PathVariable(value = "userSid") String userSid, |
|||
@ApiParam(value = "变量集合,json对象") @RequestBody Map<String, Object> variables) { |
|||
|
|||
FlowDefinitionFeignBusinessStartDTO dto = new FlowDefinitionFeignBusinessStartDTO(); |
|||
dto.setProcDefId(procDefId); |
|||
dto.setUserSid(userSid); |
|||
dto.setVariables(variables); |
|||
variables.put("procDefId", procDefId); |
|||
variables.put("userSid", userSid); |
|||
variables.put("businessSid", UUID.randomUUID().toString()); |
|||
BusinessVariables bv = BusinessVariables.builder().build(); |
|||
bv.setFormVariables(variables); |
|||
ResultBean rb = flowDefinitionFeign.businessStart(bv); |
|||
return rb; |
|||
} |
|||
*/ |
|||
|
|||
public ResultBean myprocess(String userSid, PagerQuery<FlowTaskQuery> taskQueryPagerQuery) { |
|||
PagerQuery<BusinessTaskQuery> pq = new PagerQuery<>(); |
|||
String days = taskQueryPagerQuery.getParams().getDays(); |
|||
String zd = taskQueryPagerQuery.getParams().getZd(); |
|||
pq.setCurrent(taskQueryPagerQuery.getCurrent()); |
|||
pq.setSize(taskQueryPagerQuery.getSize()); |
|||
BusinessTaskQuery businessTaskQuery = BusinessTaskQuery.create(); |
|||
if (StringUtils.isNotBlank(zd)) { |
|||
BusinessTaskParam businessTaskParam = new BusinessTaskParam(); |
|||
businessTaskParam.setField("zd"); |
|||
businessTaskParam.setSqlOperationSymbol(SQLOperationSymbol.LIKE); |
|||
businessTaskParam.setValue(zd); |
|||
businessTaskQuery.add(businessTaskParam); |
|||
} |
|||
if (StringUtils.isNotBlank(days)) { |
|||
BusinessTaskParam businessTaskParam = new BusinessTaskParam(); |
|||
businessTaskParam.setField("days"); |
|||
businessTaskParam.setSqlOperationSymbol(SQLOperationSymbol.EQUAL); |
|||
businessTaskParam.setValue(days); |
|||
businessTaskQuery.add(businessTaskParam); |
|||
} |
|||
pq.setParams(businessTaskQuery); |
|||
return flowTaskFeign.businessMyprocess(userSid, pq); |
|||
} |
|||
|
|||
public ResultBean processPagerList(Integer pageNum, Integer pageSize) { |
|||
return flowDefinitionFeign.pagerList(pageNum, pageSize); |
|||
} |
|||
|
|||
public ResultBean todoTaskList(String userSid, PagerQuery<TaskQuery> pQuery) { |
|||
TaskQuery params = pQuery.getParams(); |
|||
if (StringUtils.isBlank(userSid)) { |
|||
return ResultBean.fireFail().setMsg("用户SID为空"); |
|||
} |
|||
PagerQuery<BusinessTaskQuery> taskQueryPagerQuery = new PagerQuery<>(); |
|||
taskQueryPagerQuery.setCurrent(pQuery.getCurrent()).setSize(pQuery.getSize()); |
|||
|
|||
String orgSid = params.getOrgSid(); |
|||
String days = params.getDays(); |
|||
String processDefinitionId = params.getProcessDefinitionId(); |
|||
String startTime = params.getStartTime(); |
|||
BusinessTaskQuery taskQuery = new BusinessTaskQuery(); |
|||
List<BusinessTaskParam> taskParamList = new ArrayList<>(); |
|||
if (StringUtils.isNotBlank(days)) { |
|||
BusinessTaskParam taskParam = new BusinessTaskParam(); |
|||
taskParam.setField("zd1"); |
|||
taskParam.setValue(days); |
|||
taskParam.setSqlOperationSymbol(SQLOperationSymbol.EQUAL); |
|||
taskParamList.add(taskParam); |
|||
} |
|||
if (StringUtils.isNotBlank(startTime)) { |
|||
BusinessTaskParam taskParam = new BusinessTaskParam(); |
|||
taskParam.setField("startTime"); |
|||
taskParam.setValue(startTime); |
|||
taskParam.setSqlOperationSymbol(SQLOperationSymbol.EQUAL); |
|||
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 doneTaskList(String userSid, PagerQuery<TaskQuery> pQuery) { |
|||
TaskQuery params = pQuery.getParams(); |
|||
if (StringUtils.isBlank(userSid)) { |
|||
return ResultBean.fireFail().setMsg("用户SID为空"); |
|||
} |
|||
PagerQuery<BusinessTaskQuery> taskQueryPagerQuery = new PagerQuery<>(); |
|||
taskQueryPagerQuery.setCurrent(pQuery.getCurrent()).setSize(pQuery.getSize()); |
|||
String zd1 = params.getZd1(); |
|||
String processDefinitionId = params.getProcessDefinitionId(); |
|||
String startTime = params.getStartTime(); |
|||
BusinessTaskQuery taskQuery = new BusinessTaskQuery(); |
|||
List<BusinessTaskParam> taskParamList = new ArrayList<>(); |
|||
if (StringUtils.isNotBlank(zd1)) { |
|||
BusinessTaskParam taskParam = new BusinessTaskParam(); |
|||
taskParam.setField("zd1"); |
|||
taskParam.setValue(zd1); |
|||
taskParam.setSqlOperationSymbol(SQLOperationSymbol.EQUAL); |
|||
taskParamList.add(taskParam); |
|||
} |
|||
if (StringUtils.isNotBlank(startTime)) { |
|||
BusinessTaskParam taskParam = new BusinessTaskParam(); |
|||
taskParam.setField("startTime"); |
|||
taskParam.setValue(startTime); |
|||
taskParam.setSqlOperationSymbol(SQLOperationSymbol.EQUAL); |
|||
taskParamList.add(taskParam); |
|||
} |
|||
if (StringUtils.isNotBlank(processDefinitionId)) { |
|||
BusinessTaskParam taskParam = new BusinessTaskParam(); |
|||
taskParam.setField("processDefinitionId"); |
|||
taskParam.setSqlOperationSymbol(SQLOperationSymbol.NONE); |
|||
taskParam.setValue(processDefinitionId); |
|||
taskParamList.add(taskParam); |
|||
} |
|||
taskQuery.setFields(taskParamList); |
|||
taskQueryPagerQuery.setParams(taskQuery); |
|||
return flowTaskFeign.businessDoneList(userSid, taskQueryPagerQuery); |
|||
} |
|||
|
|||
/** |
|||
* 撤回 |
|||
* |
|||
* @param userSid |
|||
* @param businessSid |
|||
* @param flowTaskVo |
|||
* @return |
|||
*/ |
|||
public ResultBean revokeProcess(String userSid, String businessSid, FlowTaskVo flowTaskVo) { |
|||
com.yxt.anrui.flowable.api.flowtask.FlowTaskVo fl = new com.yxt.anrui.flowable.api.flowtask.FlowTaskVo(); |
|||
BeanUtil.copyProperties(flowTaskVo, fl); |
|||
fl.setUserSid(userSid); |
|||
ResultBean<List<LatestTaskVo>> resultBean = flowTaskFeign.revokeProcess(fl); |
|||
if (!resultBean.getSuccess()) { |
|||
return resultBean; |
|||
} |
|||
String nodeState = resultBean.getData().get(0).getName_(); |
|||
String taskDefKey = resultBean.getData().get(0).getTask_def_key_(); |
|||
String incomingSourceRef = resultBean.getData().get(0).getIncomingSourceRef(); |
|||
Map<String, Object> map = new HashMap<>(); |
|||
map.put("businessSid", businessSid); |
|||
/* if (incomingSourceRef.contains("start")) { |
|||
map.put("nodeState", SysFormLinkFlowStateEnum.UNCOMMITTED.getState()); |
|||
map.put("taskDefKey", taskDefKey); |
|||
map.put("flowState", SysFormLinkFlowStateEnum.UNCOMMITTED.getCode()); |
|||
} else {*/ |
|||
map.put("nodeState", nodeState); |
|||
map.put("taskDefKey", taskDefKey); |
|||
map.put("flowState", nodeState); |
|||
/* }*/ |
|||
sysFormLinkFeign.updateFiled(map); |
|||
return new ResultBean().success(); |
|||
} |
|||
|
|||
/** |
|||
* 流程历史流转记录 |
|||
* |
|||
* @param procInsId |
|||
* @param deployId |
|||
* @return |
|||
*/ |
|||
public ResultBean<FlowRecordVo> flowRecord(String procInsId, String deployId) { |
|||
ResultBean<FlowRecordVo> flowRecordVoResultBean = flowTaskFeign.businessFlowRecord(procInsId); |
|||
return flowRecordVoResultBean;//flowTaskFeign.businessFlowRecord(procInsId, deployId);
|
|||
} |
|||
|
|||
/** |
|||
* 驳回 |
|||
* |
|||
* @param businessSid |
|||
* @param flowTaskVo |
|||
* @return |
|||
*/ |
|||
public ResultBean taskReject(String businessSid, FlowTaskVo flowTaskVo) { |
|||
com.yxt.anrui.flowable.api.flowtask.FlowTaskVo fl = new com.yxt.anrui.flowable.api.flowtask.FlowTaskVo(); |
|||
BeanUtil.copyProperties(flowTaskVo, fl); |
|||
ResultBean<List<LatestTaskVo>> resultBean = flowTaskFeign.taskReject(fl); |
|||
if (!resultBean.getSuccess()) { |
|||
return resultBean; |
|||
} |
|||
String nodeState = resultBean.getData().get(0).getName_(); |
|||
String taskDefKey = resultBean.getData().get(0).getTask_def_key_(); |
|||
String incomingSourceRef = resultBean.getData().get(0).getIncomingSourceRef(); |
|||
Map<String, Object> map = new HashMap<>(); |
|||
map.put("businessSid", businessSid); |
|||
map.put("nodeState", nodeState); |
|||
map.put("taskDefKey", taskDefKey); |
|||
// if (incomingSourceRef.contains("start")) {
|
|||
map.put("flowState", nodeState); |
|||
// }
|
|||
sysFormLinkFeign.updateFiled(map); |
|||
return new ResultBean().success(); |
|||
} |
|||
|
|||
/** |
|||
* 终止流程 |
|||
* |
|||
* @param flowTaskVo |
|||
* @return |
|||
*/ |
|||
/* public ResultBean breakProcess(String businessSid, FlowTaskVo flowTaskVo) { |
|||
com.yxt.anrui.flowable.api.flowtask.FlowTaskVo fl = new com.yxt.anrui.flowable.api.flowtask.FlowTaskVo(); |
|||
BeanUtil.copyProperties(flowTaskVo, fl); |
|||
ResultBean resultBean = flowTaskFeign.breakProcess(fl); |
|||
if (!resultBean.getSuccess()) { |
|||
return resultBean; |
|||
} |
|||
Map<String, Object> map = new HashMap<>(); |
|||
map.put("businessSid", businessSid); |
|||
map.put("nodeState", String.valueOf(resultBean.getData())); |
|||
map.put("taskDefKey", "Event_end"); |
|||
map.put("flowState", FlowComment.STOP.getRemark()); |
|||
sysFormLinkFeign.updateFiled(map); |
|||
return resultBean.success(); |
|||
}*/ |
|||
public void stopProcess(FlowTaskVo flowTaskVo) { |
|||
com.yxt.anrui.flowable.api.flowtask.FlowTaskVo fl = new com.yxt.anrui.flowable.api.flowtask.FlowTaskVo(); |
|||
BeanUtil.copyProperties(flowTaskVo, fl); |
|||
flowTaskFeign.stopProcess(flowTaskVo.getUserSid(), fl); |
|||
} |
|||
|
|||
public void deleteProcess(String procInsId) { |
|||
flowTaskFeign.deleteProcess(procInsId); |
|||
} |
|||
|
|||
|
|||
public ResultBean<Page<FlowTaskDto>> todoAllTaskList(String userSid, PagerQuery<FlowTaskAllQuery> pQuery) { |
|||
ResultBean<Page<FlowTaskDto>> rb = new ResultBean<Page<FlowTaskDto>>().fireFail(); |
|||
FlowTaskAllQuery params = pQuery.getParams(); |
|||
if (StringUtils.isBlank(userSid)) { |
|||
return rb.setMsg("用户SID为空"); |
|||
} |
|||
PagerQuery<BusinessTaskQuery> 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<BusinessTaskParam> 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<Integer> getTodoNum(String userSid) { |
|||
return flowTaskFeign.getTodoNum(userSid); |
|||
} |
|||
public ResultBean<Integer> getTodoNum(String userSid,String orgPath) { |
|||
UserAndOrgPath userAndOrgPath = new UserAndOrgPath(); |
|||
userAndOrgPath.setOrgPath(orgPath); |
|||
userAndOrgPath.setUserSid(userSid); |
|||
return flowTaskFeign.getTodoNum(userAndOrgPath); |
|||
} |
|||
|
|||
public ResultBean getNextTasks(String taskId) { |
|||
return flowTaskFeign.getNextTasks(taskId); |
|||
} |
|||
|
|||
|
|||
public ResultBean<Page<FlowTaskDto>> doneAllTaskList(String userSid, PagerQuery<FlowTaskAllQuery> pQuery) { |
|||
ResultBean<Page<FlowTaskDto>> rb = new ResultBean<Page<FlowTaskDto>>().fireFail(); |
|||
FlowTaskAllQuery params = pQuery.getParams(); |
|||
if (StringUtils.isBlank(userSid)) { |
|||
return rb.setMsg("用户SID为空"); |
|||
} |
|||
PagerQuery<BusinessTaskQuery> taskQueryPagerQuery = new PagerQuery<>(); |
|||
taskQueryPagerQuery.setCurrent(pQuery.getCurrent()).setSize(pQuery.getSize()); |
|||
String processDefinitionId = params.getProcessDefinitionId(); |
|||
String proDefName = params.getProDefName(); |
|||
String startDate = params.getStartDate(); |
|||
String endDate = params.getEndDate(); |
|||
BusinessTaskQuery taskQuery = new BusinessTaskQuery(); |
|||
List<BusinessTaskParam> 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); |
|||
} |
|||
taskQuery.setFields(taskParamList); |
|||
taskQueryPagerQuery.setParams(taskQuery); |
|||
return flowTaskFeign.businessDoneList(userSid, taskQueryPagerQuery); |
|||
} |
|||
|
|||
public ResultBean readXml(String deployId) { |
|||
return flowTaskFeign.readXml(deployId); |
|||
} |
|||
|
|||
public ResultBean getFlowViewer(String procInsId) { |
|||
return flowTaskFeign.getFlowViewer(procInsId); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.yxt.supervise.system.purchasingrequisition; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.yxt.supervise.system.region.Region; |
|||
import com.yxt.supervise.system.region.RegionListVo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/1/30 14:24 |
|||
* @Description |
|||
*/ |
|||
@Mapper |
|||
public interface PurchasingRequisitionMapper extends BaseMapper<PurchasingRequisition> { |
|||
|
|||
int updateFlowFiled(Map<String, Object> map); |
|||
} |
@ -0,0 +1,19 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.yxt.supervise.system.purchasingrequisition.PurchasingRequisitionMapper"> |
|||
<update id="updateFlowFiled"> |
|||
UPDATE purchasing_requisition |
|||
SET nodeState=#{nodeState} |
|||
, nodeSid=#{taskDefKey} |
|||
<if test="procDefId != null and procDefId != ''"> |
|||
, procDefId=#{procDefId} |
|||
</if> |
|||
<if test="procInsId != null and procInsId != ''"> |
|||
, procInsId=#{procInsId} , procInstSid=#{procInsId} |
|||
</if> |
|||
<if test="taskId != null and taskId != ''"> |
|||
, taskId=#{taskId} |
|||
</if> |
|||
WHERE sid=#{sid} |
|||
</update> |
|||
</mapper> |
@ -0,0 +1,98 @@ |
|||
package com.yxt.supervise.system.purchasingrequisition; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import com.yxt.anrui.flowable.api.utils.ProcDefEnum; |
|||
import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.supervise.system.flow.GetNodeQuery; |
|||
import com.yxt.supervise.system.flow.GetNodeVo; |
|||
import io.swagger.annotations.Api; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Controller; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/1/30 14:23 |
|||
* @Description |
|||
*/ |
|||
@Controller |
|||
@RequestMapping("v1/pr") |
|||
@Api(tags = "采购信息") |
|||
public class PurchasingRequisitionRest implements PurchasingRequisitionFeign { |
|||
|
|||
@Autowired |
|||
private PurchasingRequisitionService purchasingRequisitionService; |
|||
|
|||
@Override |
|||
public ResultBean<PagerVo<PurchasingRequisitionVo>> listPage(PagerQuery<PurchasingRequisitionQuery> pq) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
PagerVo<PurchasingRequisitionVo> pv = purchasingRequisitionService.listPageVo(pq); |
|||
return rb.success().setData(pv); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean save(PurchasingRequisitionDto dto) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
purchasingRequisitionService.saveOrUpdateDto(dto); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean submit(PurchasingRequisitionDto dto) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
purchasingRequisitionService.submit(dto); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean delBySids(String[] sids) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
if (sids == null || sids.length == 0) { |
|||
return rb.setMsg("删除失败,虚拟订单sid不能为空!"); |
|||
} |
|||
return purchasingRequisitionService.deleteBySids(sids); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean<PurchasingRequisitionDetailsVo> fetchDetailsBySid(String sid) { |
|||
ResultBean<PurchasingRequisitionDetailsVo> resultBean = ResultBean.fireFail(); |
|||
PurchasingRequisitionDetailsVo vo = purchasingRequisitionService.fetchDetailsBySid(sid); |
|||
return resultBean.success().setData(vo); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean complete(BusinessVariables bv) { |
|||
bv.setModelId(ProcDefEnum.PR.getProDefId()); |
|||
return purchasingRequisitionService.complete(bv); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean<List<GetNodeVo>> getPreviousNodesForReject(GetNodeQuery query) { |
|||
return purchasingRequisitionService.getPreviousNodesForReject(query); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean<List<GetNodeVo>> getNextNodesForSubmit(GetNodeQuery query) { |
|||
return purchasingRequisitionService.getNextNodesForSubmit(query); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean taskReject(PurchasingRequisitionQuery query) { |
|||
return purchasingRequisitionService.taskReject(query); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean revokeProcess(PurchasingRequisitionQuery query) { |
|||
return purchasingRequisitionService.revokeProcess(query); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean breakProcess(PurchasingRequisitionQuery query) { |
|||
return purchasingRequisitionService.breakProcess(query); |
|||
} |
|||
} |
@ -0,0 +1,409 @@ |
|||
package com.yxt.supervise.system.purchasingrequisition; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import cn.hutool.core.date.DateUtil; |
|||
import com.alibaba.fastjson.JSON; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.google.common.util.concurrent.ThreadFactoryBuilder; |
|||
import com.yxt.anrui.flowable.api.flow.FlowableFeign; |
|||
import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo; |
|||
import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign; |
|||
import com.yxt.anrui.flowable.api.flowtask.FlowTaskVo; |
|||
import com.yxt.anrui.flowable.api.flowtask.LatestTaskVo; |
|||
import com.yxt.anrui.flowable.api.sysformlink.SysFormLinkFeign; |
|||
import com.yxt.anrui.flowable.api.utils.ProcDefEnum; |
|||
import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; |
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import com.yxt.common.base.utils.PagerUtil; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.supervise.system.flow.GetNodeQuery; |
|||
import com.yxt.supervise.system.flow.GetNodeVo; |
|||
import com.yxt.supervise.system.region.Region; |
|||
import com.yxt.supervise.system.region.RegionListVo; |
|||
import com.yxt.supervise.system.sysstaffinfo.SysStaffinfoService; |
|||
import com.yxt.supervise.system.sysuser.SysUserService; |
|||
import com.yxt.supervise.system.sysuser.SysUserVo; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.apache.tomcat.util.threads.ThreadPoolExecutor; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.*; |
|||
import java.util.concurrent.*; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/1/30 14:24 |
|||
* @Description |
|||
*/ |
|||
@Service |
|||
public class PurchasingRequisitionService extends MybatisBaseService<PurchasingRequisitionMapper, PurchasingRequisition> { |
|||
|
|||
@Autowired |
|||
private FlowTaskFeign flowTaskFeign; |
|||
|
|||
@Autowired |
|||
private FlowableFeign flowableFeign; |
|||
@Autowired |
|||
private SysStaffinfoService sysStaffinfoService; |
|||
@Autowired |
|||
private SysUserService sysUserService; |
|||
@Autowired |
|||
private SysFormLinkFeign sysFormLinkFeign; |
|||
public ResultBean saveOrUpdateDto(PurchasingRequisitionDto dto) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
String sid = dto.getSid(); |
|||
if (StringUtils.isBlank(sid)) { |
|||
PurchasingRequisition productInformation = new PurchasingRequisition(); |
|||
BeanUtil.copyProperties(dto, productInformation, "sid"); |
|||
baseMapper.insert(productInformation); |
|||
} else { |
|||
PurchasingRequisition productInformation = fetchBySid(sid); |
|||
if (productInformation == null) { |
|||
return rb.setMsg("该商品档案不存在"); |
|||
} |
|||
BeanUtil.copyProperties(dto, productInformation, "sid"); |
|||
baseMapper.updateById(productInformation); |
|||
} |
|||
return rb.success(); |
|||
} |
|||
public ResultBean submit(PurchasingRequisitionDto dto) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
String sid = dto.getSid(); |
|||
if (StringUtils.isBlank(sid)) { |
|||
PurchasingRequisition productInformation = new PurchasingRequisition(); |
|||
BeanUtil.copyProperties(dto, productInformation, "sid"); |
|||
dto.setSid(productInformation.getSid()); |
|||
baseMapper.insert(productInformation); |
|||
} else { |
|||
PurchasingRequisition productInformation = fetchBySid(sid); |
|||
if (productInformation == null) { |
|||
return rb.setMsg("该商品档案不存在"); |
|||
} |
|||
BeanUtil.copyProperties(dto, productInformation, "sid"); |
|||
baseMapper.updateById(productInformation); |
|||
} |
|||
if (StringUtils.isBlank(sid)) { |
|||
startProcess(dto); |
|||
} else { |
|||
PurchasingRequisition pr = fetchBySid(sid); |
|||
BusinessVariables bv = new BusinessVariables(); |
|||
//流程中的参数赋值、若有网关,则赋值网关中判断的字段。
|
|||
Map<String, Object> variables = new HashMap<>(); |
|||
//用户的部门全路径sid
|
|||
bv.setOrgSidPath("fd6435f2-0005-11ec-a033-48452053aa33/3042d730-64e8-4e34-b08a-44adca4da3a5/548c9469-f5e8-4a1a-b69f-cb54b152c5d1"); |
|||
//业务sid
|
|||
bv.setBusinessSid(sid); |
|||
//用户sid
|
|||
bv.setUserSid("0331e5b5-9d60-11ed-87ce-525401028fe7"); |
|||
//若app移动端有此功能,则传递appMap参数
|
|||
Map<String, Object> appMap = new HashMap<>(); |
|||
//需和移动端沟通业务sid保存的属性具体值:appMap中sid不是固定的。移动端提供具体字段。
|
|||
variables.put("app", appMap); |
|||
variables.put("money", pr.getMoney()); |
|||
bv.setFormVariables(variables); |
|||
//流程定义id
|
|||
bv.setModelId(ProcDefEnum.PR.getProDefId()); |
|||
bv.setTaskId(dto.getTaskId()); |
|||
bv.setTaskDefKey(pr.getNodeSid()); |
|||
bv.setComment(com.yxt.common.base.utils.StringUtils.isNotBlank(dto.getComment()) ? dto.getComment() : "重新提交"); |
|||
bv.setInstanceId(pr.getProcInstSid()); |
|||
//更新已选择的车架号的状态为审批中
|
|||
//System.out.println(JSON.toJSONString(bv));
|
|||
complete(bv); |
|||
} |
|||
return rb.success(); |
|||
} |
|||
|
|||
private void startProcess(PurchasingRequisitionDto dto) { |
|||
BusinessVariables bv = new BusinessVariables(); |
|||
//流程中的参数赋值、若有网关,则赋值网关中判断的字段。
|
|||
Map<String, Object> variables = new HashMap<>(); |
|||
//用户的部门全路径sid
|
|||
bv.setOrgSidPath("fd6435f2-0005-11ec-a033-48452053aa33/3042d730-64e8-4e34-b08a-44adca4da3a5/548c9469-f5e8-4a1a-b69f-cb54b152c5d1"); |
|||
//业务sid
|
|||
bv.setBusinessSid(dto.getSid()); |
|||
//用户sid
|
|||
bv.setUserSid("0331e5b5-9d60-11ed-87ce-525401028fe7"); |
|||
bv.setFormVariables(variables); |
|||
//若app移动端有此功能,则传递appMap参数
|
|||
Map<String, Object> appMap = new HashMap<>(); |
|||
//需和移动端沟通业务sid保存的属性具体值:appMap中sid不是固定的。移动端提供具体字段。
|
|||
variables.put("money", dto.getMoney()); |
|||
variables.put("app", appMap); |
|||
//流程定义id
|
|||
bv.setModelId(ProcDefEnum.PR.getProDefId()); |
|||
// String nextNodeUserSids_ = "0331e5b5-9d60-11ed-87ce-525401028fe8";//sysOrganization.getManagerSid();
|
|||
// bv.setNextNodeUserSids(nextNodeUserSids_);
|
|||
int r = submitBusinessVehicleData(dto); |
|||
if (r == 1) { |
|||
ResultBean<UpdateFlowFieldVo> voResultBean = flowableFeign.startProcess(bv); |
|||
UpdateFlowFieldVo ufVo = voResultBean.getData(); |
|||
updateFlowFiled(BeanUtil.beanToMap(ufVo)); |
|||
try { |
|||
ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() |
|||
.setNameFormat("demo-pool-%d").build(); |
|||
ExecutorService pool = new ThreadPoolExecutor(2, 100, |
|||
0L, TimeUnit.MILLISECONDS, |
|||
new LinkedBlockingQueue<Runnable>(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy()); |
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
} |
|||
} |
|||
if (r == 2) { |
|||
// ToDo:驳回到发起人后再次提交
|
|||
if (StringUtils.isBlank(dto.getInstanceId())) { |
|||
} |
|||
bv.setTaskId(dto.getTaskId()); |
|||
bv.setTaskDefKey(dto.getTaskDefKey()); |
|||
bv.setComment(com.yxt.common.base.utils.StringUtils.isNotBlank(dto.getComment()) ? dto.getComment() : "重新提交"); |
|||
bv.setInstanceId(dto.getInstanceId()); |
|||
//更新已选择的车架号的状态为审批中
|
|||
complete(bv); |
|||
} |
|||
} |
|||
/** |
|||
* 判断提交的流程是否被允许 |
|||
* |
|||
* @param dto |
|||
* @return |
|||
*/ |
|||
private synchronized int submitBusinessVehicleData(PurchasingRequisitionDto dto ) { |
|||
int r = 0; |
|||
if (StringUtils.isBlank(dto.getSid())) { |
|||
r = 1; |
|||
} else { |
|||
if (dto.getSid() != null) { |
|||
String businessTaskId = dto.getTaskId(); |
|||
if (StringUtils.isBlank(businessTaskId) && StringUtils.isBlank(dto.getTaskId())) { |
|||
//新提交
|
|||
r = 1; |
|||
} else if (StringUtils.isNotBlank(businessTaskId) && businessTaskId.equals(dto.getTaskId())) { |
|||
//二次提交//只有数据一致的时候才能进行下一步
|
|||
r = 2; |
|||
} |
|||
} else { |
|||
r = 3; |
|||
} |
|||
} |
|||
return r; |
|||
} |
|||
/** |
|||
* 更新流程相关的状态 |
|||
* |
|||
* @param map |
|||
* @return |
|||
*/ |
|||
private int updateFlowFiled(Map<String, Object> map) { |
|||
return baseMapper.updateFlowFiled(map); |
|||
} |
|||
public ResultBean complete(BusinessVariables bv) { |
|||
String userSid = bv.getUserSid(); |
|||
SysUserVo sysUserVo = sysUserService.fetchBySidVo(userSid); |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
PurchasingRequisition pr = fetchBySid(bv.getBusinessSid()); |
|||
Map<String, Object> variables = new HashMap<>(); |
|||
Map<String, Object> appMap = new HashMap<>(); |
|||
variables.put("money", pr.getMoney()); |
|||
variables.put("app", appMap); |
|||
bv.setFormVariables(variables); |
|||
bv.setOrgSidPath(sysUserVo.getOrgSidPath()); |
|||
if (bv.getTaskId().equals(pr.getTaskId())) { |
|||
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.handleProsess(bv); |
|||
if (!resultBean.getSuccess()) { |
|||
return rb.setMsg(resultBean.getMsg()); |
|||
} |
|||
UpdateFlowFieldVo ufVo = resultBean.getData(); |
|||
updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); |
|||
if (!"Event_end".equals(ufVo.getTaskDefKey())) { |
|||
|
|||
} else { |
|||
|
|||
|
|||
} |
|||
return rb.success().setData(resultBean.getData()); |
|||
} else { |
|||
return rb.setMsg("操作失败!提交的数据不一致"); |
|||
} |
|||
} |
|||
public PagerVo<PurchasingRequisitionVo> listPageVo(PagerQuery<PurchasingRequisitionQuery> pq) { |
|||
PurchasingRequisitionQuery query = pq.getParams(); |
|||
QueryWrapper<PurchasingRequisition> qw = createQueryWrapper(query); |
|||
IPage<PurchasingRequisition> page = PagerUtil.queryToPage(pq); |
|||
IPage<PurchasingRequisition> pagging = baseMapper.selectPage(page, qw); |
|||
PagerVo<PurchasingRequisitionVo> p = PagerUtil.pageToVo(pagging, null); |
|||
return p; |
|||
} |
|||
private QueryWrapper<PurchasingRequisition> createQueryWrapper(PurchasingRequisitionQuery query) { |
|||
// todo: 这里根据具体业务调整查询条件
|
|||
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
|||
QueryWrapper<PurchasingRequisition> qw = new QueryWrapper<>(); |
|||
qw.orderByDesc("id"); |
|||
return qw; |
|||
} |
|||
|
|||
public PurchasingRequisitionDetailsVo fetchDetailsBySid(String sid) { |
|||
QueryWrapper<PurchasingRequisition> qw = new QueryWrapper<>(); |
|||
qw.eq("sid",sid); |
|||
PurchasingRequisition purchasingRequisition = baseMapper.selectOne(qw); |
|||
PurchasingRequisitionDetailsVo vo=new PurchasingRequisitionDetailsVo(); |
|||
BeanUtil.copyProperties(purchasingRequisition,vo); |
|||
return vo; |
|||
} |
|||
|
|||
public ResultBean<List<GetNodeVo>> getNextNodesForSubmit(GetNodeQuery query) { |
|||
ResultBean<List<GetNodeVo>> rb = ResultBean.fireFail(); |
|||
BusinessVariables bv = new BusinessVariables(); |
|||
BeanUtil.copyProperties(query, bv); |
|||
//流程中的参数赋值、若有网关,则赋值网关中判断的字段。
|
|||
Map<String, Object> variables = new HashMap<>(); |
|||
//根据业务sid查询排产信息
|
|||
PurchasingRequisition pr = fetchBySid(query.getBusinessSid()); |
|||
variables.put("money", pr.getMoney()); |
|||
//判断是否是储备订单,若是,则isTrue网关参数为true=============添加
|
|||
bv.setFormVariables(variables); |
|||
bv.setModelId(ProcDefEnum.PR.getProDefId()); |
|||
ResultBean<List<Map<String, Object>>> resultBean = flowTaskFeign.getNextNodesForSubmit(bv); |
|||
//判断数组是否为空,若为空则赋值,若不为空,则遍历循环将map中的数据赋值给getNodeVo
|
|||
List<GetNodeVo> voList = Optional.ofNullable(resultBean.getData()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), GetNodeVo.class)).collect(Collectors.toList()); |
|||
return rb.success().setData(voList); |
|||
} |
|||
|
|||
public ResultBean revokeProcess(PurchasingRequisitionQuery query) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
if (StringUtils.isBlank(query.getUserSid())) { |
|||
return rb.setMsg("参数错误:userSid"); |
|||
} |
|||
//根据业务sid查询排产申请
|
|||
PurchasingRequisition pr = fetchBySid(query.getBusinessSid()); |
|||
String businessTaskId = pr.getTaskId(); |
|||
if (StringUtils.isNotBlank(businessTaskId)) { |
|||
if (businessTaskId.equals(query.getTaskId())) { |
|||
FlowTaskVo flowTaskVo = new FlowTaskVo(); |
|||
BeanUtil.copyProperties(query, flowTaskVo); |
|||
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.revokeProcess(flowTaskVo); |
|||
if (!resultBean.getSuccess()) { |
|||
return rb.setMsg(resultBean.getMsg()); |
|||
} |
|||
updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); |
|||
return rb.success().setData(resultBean.getData()); |
|||
} |
|||
} |
|||
return rb.setMsg("操作失败,提交的数据不一致!"); |
|||
} |
|||
|
|||
public ResultBean<List<GetNodeVo>> getPreviousNodesForReject(GetNodeQuery query) { |
|||
ResultBean<List<GetNodeVo>> rb = new ResultBean<>(); |
|||
BusinessVariables bv = new BusinessVariables(); |
|||
BeanUtil.copyProperties(query, bv); |
|||
bv.setModelId(ProcDefEnum.PR.getProDefId()); |
|||
ResultBean<List<Map<String, Object>>> resultBean = flowTaskFeign.getPreviousNodesForReject(bv); |
|||
//判断数组是否为空,若为空则赋值,若不为空,则遍历循环将map中的数据赋值给getNodeVo
|
|||
List<GetNodeVo> voList = Optional.ofNullable(resultBean.getData()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), GetNodeVo.class)).collect(Collectors.toList()); |
|||
return rb.success().setData(voList); |
|||
} |
|||
|
|||
public ResultBean taskReject(PurchasingRequisitionQuery query) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
String businessSid = query.getBusinessSid(); |
|||
PurchasingRequisition busVehicleApply = fetchBySid(businessSid); |
|||
if (busVehicleApply == null) { |
|||
return rb.setMsg("该申请不存在"); |
|||
} |
|||
String businessTaskId = busVehicleApply.getTaskId(); |
|||
if (StringUtils.isNotBlank(businessTaskId)) { |
|||
if (businessTaskId.equals(query.getTaskId())) { |
|||
if (StringUtils.isBlank(query.getComment())) { |
|||
return rb.setMsg("请填写意见"); |
|||
} |
|||
if (StringUtils.isBlank(query.getUserSid())) { |
|||
return rb.setMsg("参数错误:userSid"); |
|||
} |
|||
FlowTaskVo flowTaskVo = new FlowTaskVo(); |
|||
BeanUtil.copyProperties(query, flowTaskVo); |
|||
Map<String, Object> variables = new HashMap<>(); |
|||
Map<String, Object> appMap = new HashMap<>(); |
|||
variables.put("app", appMap); |
|||
//根据业务sid查询排产信息
|
|||
variables.put("money", query.getMoney()); |
|||
//判断是否是储备订单,若是,则isTrue网关参数为true=============添加
|
|||
flowTaskVo.setValues(variables); |
|||
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.taskReject(flowTaskVo); |
|||
if (!resultBean.getSuccess()) { |
|||
return rb.setMsg(resultBean.getMsg()); |
|||
} |
|||
UpdateFlowFieldVo ufVo = resultBean.getData(); |
|||
Map<String, Object> map = BeanUtil.beanToMap(ufVo); |
|||
//更新业务中的流程相关的参数
|
|||
updateFlowFiled(map); |
|||
//极光推送
|
|||
|
|||
return rb.success(); |
|||
} |
|||
} |
|||
return rb.setMsg("操作失败!提交的数据不一致!"); |
|||
} |
|||
|
|||
/** |
|||
* 终止流程 |
|||
* |
|||
* @param query |
|||
* @return |
|||
*/ |
|||
public ResultBean breakProcess(PurchasingRequisitionQuery query) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
if (StringUtils.isBlank(query.getInstanceId())) { |
|||
return rb.setMsg("参数错误:instanceId"); |
|||
} |
|||
if (StringUtils.isBlank(query.getUserSid())) { |
|||
return rb.setMsg("参数错误:userSid"); |
|||
} |
|||
if (StringUtils.isBlank(query.getComment())) { |
|||
return rb.setMsg("请填写意见"); |
|||
} |
|||
PurchasingRequisition pr = fetchBySid(query.getBusinessSid()); |
|||
String businessTaskId = pr.getTaskId(); |
|||
if (StringUtils.isNotBlank(businessTaskId)) { |
|||
if (businessTaskId.equals(query.getTaskId())) { |
|||
FlowTaskVo flowTaskVo = new FlowTaskVo(); |
|||
BeanUtil.copyProperties(query, flowTaskVo); |
|||
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.breakProcess(flowTaskVo); |
|||
if (!resultBean.getSuccess()) { |
|||
return rb.setMsg(resultBean.getMsg()); |
|||
} |
|||
Map<String, Object> map = BeanUtil.beanToMap(resultBean.getData()); |
|||
updateFlowFiled(map); |
|||
return rb.success().setData(resultBean.getData()); |
|||
} |
|||
} |
|||
return rb.setMsg("操作失败!提交的数据不一致!"); |
|||
} |
|||
|
|||
public ResultBean deleteBySids(String[] sids) { |
|||
for (int i = 0; i < sids.length; i++) { |
|||
if (checkCouldChange(sids[i])) { |
|||
return new ResultBean().fail().setMsg("删除的数据中包含已经提交审批的数据,删除失败"); |
|||
} |
|||
deleteBySid(sids[i]); |
|||
} |
|||
return new ResultBean().success().setMsg("删除成功"); |
|||
} |
|||
/** |
|||
* 判断是否可以更改、删除(判断节点状态) |
|||
* |
|||
* @param sid |
|||
* @return |
|||
*/ |
|||
private boolean checkCouldChange(String sid) { |
|||
PurchasingRequisition pr = fetchBySid(sid); |
|||
// 判断是否可以更改(是否走了流程,更改了状态)
|
|||
if (StringUtils.isNotBlank(pr.getNodeState())) { |
|||
return true; |
|||
} |
|||
return false; |
|||
} |
|||
} |
Loading…
Reference in new issue