计量中心项目
This commit is contained in:
109
jlzx-single/yxt-single-workflow/yxt-single-workflow-biz/pom.xml
Normal file
109
jlzx-single/yxt-single-workflow/yxt-single-workflow-biz/pom.xml
Normal file
@@ -0,0 +1,109 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.yxt</groupId>
|
||||
<artifactId>yxt-parent</artifactId>
|
||||
<version>0.0.1</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
<groupId>com.yxt.workflow</groupId>
|
||||
<artifactId>yxt-single-workflow-biz</artifactId>
|
||||
<version>0.0.1</version>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.yxt.workflow</groupId>
|
||||
<artifactId>yxt-single-workflow-api</artifactId>
|
||||
<version>0.0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yxt</groupId>
|
||||
<artifactId>yxt-common-base</artifactId>
|
||||
<version>0.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yxt.jlzx</groupId>
|
||||
<artifactId>jlzx-single-system-api</artifactId>
|
||||
<version>0.0.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.yxt.jlzx</groupId>
|
||||
<artifactId>jlzx-single-system-api</artifactId>
|
||||
<version>0.0.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- <dependency>
|
||||
<groupId>com.yxt.jlzx</groupId>
|
||||
<artifactId>jlzx-single-system-biz</artifactId>
|
||||
<version>0.0.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>-->
|
||||
|
||||
<!-- <dependency>
|
||||
<groupId>com.yxt.jlzx</groupId>
|
||||
<artifactId>jlzx-single-system-biz</artifactId>
|
||||
<version>0.0.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.yxt.jlzx</groupId>
|
||||
<artifactId>jlzx-single-cxjl-biz</artifactId>
|
||||
<version>0.0.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>-->
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/java</directory>
|
||||
<includes>
|
||||
<include>**/*Mapper.xml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>**/*.yml</include>
|
||||
</includes>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
|
||||
</resources>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.yxt.workflow.biz;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/09 17:54
|
||||
* @description
|
||||
*/
|
||||
@EnableDiscoveryClient
|
||||
@SpringBootApplication(scanBasePackages = {
|
||||
"com.yxt.common.base.config",
|
||||
"com.yxt.workflow"
|
||||
})
|
||||
@EnableFeignClients(basePackages = {"com.yxt.jlzx.system"})
|
||||
public class WorkFlowApplication
|
||||
{
|
||||
public static void main( String[] args )
|
||||
{
|
||||
SpringApplication.run(WorkFlowApplication.class, args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.yxt.workflow.biz.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.yxt.common.core.domain.BaseEntity;
|
||||
|
||||
|
||||
@TableName("yxt_instancestage")
|
||||
public class YxtInstanceStage extends BaseEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String processSid;
|
||||
private String instanceSid;
|
||||
private String stageSid;
|
||||
private String stageName;
|
||||
private String stageChar;
|
||||
private int useTime;
|
||||
private int isRemind;
|
||||
private int isOver;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
package com.yxt.workflow.biz.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.yxt.common.core.domain.BaseEntity;
|
||||
|
||||
|
||||
@TableName("yxt_process")
|
||||
public class YxtProcess extends BaseEntity {
|
||||
public String getProcessName() {
|
||||
return processName;
|
||||
}
|
||||
public void setProcessName(String processName) {
|
||||
this.processName = processName;
|
||||
}
|
||||
public String getProcessType() {
|
||||
return processType;
|
||||
}
|
||||
public void setProcessType(String processType) {
|
||||
this.processType = processType;
|
||||
}
|
||||
public String getTableName() {
|
||||
return tableName;
|
||||
}
|
||||
public void setTableName(String tableName) {
|
||||
this.tableName = tableName;
|
||||
}
|
||||
public String getPageName() {
|
||||
return pageName;
|
||||
}
|
||||
public void setPageName(String pageName) {
|
||||
this.pageName = pageName;
|
||||
}
|
||||
public String getPageOperate() {
|
||||
return this.pageOperate;
|
||||
}
|
||||
public void setPageOperate(String pageOperate) {
|
||||
this.pageOperate = pageOperate;
|
||||
}
|
||||
public String getPageCreate() {
|
||||
return this.pageCreate;
|
||||
}
|
||||
public void setPageCreate(String pageCreate) {
|
||||
this.pageCreate = pageCreate;
|
||||
}
|
||||
public String getSummary() {
|
||||
return summary;
|
||||
}
|
||||
public void setSummary(String summary) {
|
||||
this.summary = summary;
|
||||
}
|
||||
public String getImgPath() {
|
||||
return imgPath;
|
||||
}
|
||||
public void setImgPath(String imgPath) {
|
||||
this.imgPath = imgPath;
|
||||
}
|
||||
public int getSerialNum() {
|
||||
return serialNum;
|
||||
}
|
||||
public void setSerialNum(int serialNum) {
|
||||
this.serialNum = serialNum;
|
||||
}
|
||||
public int getIsAppendix() {
|
||||
return isAppendix;
|
||||
}
|
||||
public void setIsAppendix(int isAppendix) {
|
||||
this.isAppendix = isAppendix;
|
||||
}
|
||||
public String getAuthorizers() {
|
||||
return this.authorizers;
|
||||
}
|
||||
public void setAuthorizers(String authorizers) {
|
||||
this.authorizers = authorizers;
|
||||
}
|
||||
public String getAuthorizeDepts() {
|
||||
return this.authorizeDepts;
|
||||
}
|
||||
public void setAuthorizeDepts(String authorizeDepts) {
|
||||
this.authorizeDepts = authorizeDepts;
|
||||
}
|
||||
public String getAuthorizeRoles() {
|
||||
return this.authorizeRoles;
|
||||
}
|
||||
public void setAuthorizeRoles(String authorizeRoles) {
|
||||
this.authorizeRoles = authorizeRoles;
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String processName;
|
||||
private String processType;
|
||||
private String tableName;
|
||||
|
||||
private String pageName;
|
||||
private String pageOperate;
|
||||
private String pageCreate;
|
||||
private String summary;
|
||||
private String imgPath;
|
||||
private int serialNum;
|
||||
private int isAppendix;
|
||||
private String authorizers;
|
||||
private String authorizeDepts;
|
||||
private String authorizeRoles;
|
||||
private String authorizersName;
|
||||
private String authorizeDeptsName;
|
||||
private String authorizeRolesName;
|
||||
public String getAuthorizersName() {
|
||||
return authorizersName;
|
||||
}
|
||||
public void setAuthorizersName(String authorizersName) {
|
||||
this.authorizersName = authorizersName;
|
||||
}
|
||||
public String getAuthorizeDeptsName() {
|
||||
return authorizeDeptsName;
|
||||
}
|
||||
public void setAuthorizeDeptsName(String authorizeDeptsName) {
|
||||
this.authorizeDeptsName = authorizeDeptsName;
|
||||
}
|
||||
public String getAuthorizeRolesName() {
|
||||
return authorizeRolesName;
|
||||
}
|
||||
public void setAuthorizeRolesName(String authorizeRolesName) {
|
||||
this.authorizeRolesName = authorizeRolesName;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
package com.yxt.workflow.biz.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.yxt.common.core.domain.BaseEntity;
|
||||
|
||||
@TableName("yxt_processaction")
|
||||
public class YxtProcessAction extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String processSid;
|
||||
private String nodeSid;
|
||||
private String actionName;
|
||||
|
||||
private int actionNumber;
|
||||
private String preNodeSid;
|
||||
private String nexNodeSid;
|
||||
private int isNodeFirstAction;
|
||||
private int isFirstAction;
|
||||
private int isLastAction;
|
||||
private String actionPerson;
|
||||
private String authorizers;
|
||||
private String authorizeDepts;
|
||||
private String authorizeRoles;
|
||||
private String extendStatus;
|
||||
private String actionPersonName;
|
||||
private String authorizersName;
|
||||
private String authorizeDeptsName;
|
||||
private String authorizeRolesName;
|
||||
|
||||
|
||||
public String getActionPersonName() {
|
||||
return actionPersonName;
|
||||
}
|
||||
public void setActionPersonName(String actionPersonName) {
|
||||
this.actionPersonName = actionPersonName;
|
||||
}
|
||||
public String getAuthorizersName() {
|
||||
return authorizersName;
|
||||
}
|
||||
public void setAuthorizersName(String authorizersName) {
|
||||
this.authorizersName = authorizersName;
|
||||
}
|
||||
public String getAuthorizeDeptsName() {
|
||||
return authorizeDeptsName;
|
||||
}
|
||||
public void setAuthorizeDeptsName(String authorizeDeptsName) {
|
||||
this.authorizeDeptsName = authorizeDeptsName;
|
||||
}
|
||||
public String getAuthorizeRolesName() {
|
||||
return authorizeRolesName;
|
||||
}
|
||||
public void setAuthorizeRolesName(String authorizeRolesName) {
|
||||
this.authorizeRolesName = authorizeRolesName;
|
||||
}
|
||||
public String getProcessSid() {
|
||||
return processSid;
|
||||
}
|
||||
public void setProcessSid(String processSid) {
|
||||
this.processSid = processSid;
|
||||
}
|
||||
public String getNodeSid() {
|
||||
return nodeSid;
|
||||
}
|
||||
public void setNodeSid(String nodeSid) {
|
||||
this.nodeSid = nodeSid;
|
||||
}
|
||||
|
||||
public String getActionName() {
|
||||
return actionName;
|
||||
}
|
||||
public void setActionName(String actionName) {
|
||||
this.actionName = actionName;
|
||||
}
|
||||
public int getActionNumber() {
|
||||
return actionNumber;
|
||||
}
|
||||
public void setActionNumber(int actionNumber) {
|
||||
this.actionNumber = actionNumber;
|
||||
}
|
||||
public String getPreNodeSid() {
|
||||
return preNodeSid;
|
||||
}
|
||||
public void setPreNodeSid(String preNodeSid) {
|
||||
this.preNodeSid = preNodeSid;
|
||||
}
|
||||
public String getNexNodeSid() {
|
||||
return nexNodeSid;
|
||||
}
|
||||
public void setNexNodeSid(String nexNodeSid) {
|
||||
this.nexNodeSid = nexNodeSid;
|
||||
}
|
||||
public int getIsFirstAction() {
|
||||
return isFirstAction;
|
||||
}
|
||||
public void setIsFirstAction(int isFirstAction) {
|
||||
this.isFirstAction = isFirstAction;
|
||||
}
|
||||
public String getActionPerson() {
|
||||
return actionPerson;
|
||||
}
|
||||
public void setActionPerson(String actionPerson) {
|
||||
this.actionPerson = actionPerson;
|
||||
}
|
||||
public String getAuthorizers() {
|
||||
return authorizers;
|
||||
}
|
||||
public void setAuthorizers(String authorizers) {
|
||||
this.authorizers = authorizers;
|
||||
}
|
||||
public String getAuthorizeDepts() {
|
||||
return authorizeDepts;
|
||||
}
|
||||
public void setAuthorizeDepts(String authorizeDepts) {
|
||||
this.authorizeDepts = authorizeDepts;
|
||||
}
|
||||
public String getAuthorizeRoles() {
|
||||
return authorizeRoles;
|
||||
}
|
||||
public void setAuthorizeRoles(String authorizeRoles) {
|
||||
this.authorizeRoles = authorizeRoles;
|
||||
}
|
||||
public String getExtendStatus() {
|
||||
return extendStatus;
|
||||
}
|
||||
public void setExtendStatus(String extendStatus) {
|
||||
this.extendStatus = extendStatus;
|
||||
}
|
||||
public int getIsLastAction() {
|
||||
return isLastAction;
|
||||
}
|
||||
public void setIsLastAction(int isLastAction) {
|
||||
this.isLastAction = isLastAction;
|
||||
}
|
||||
public int getIsNodeFirstAction() {
|
||||
return isNodeFirstAction;
|
||||
}
|
||||
public void setIsNodeFirstAction(int isNodeFirstAction) {
|
||||
this.isNodeFirstAction = isNodeFirstAction;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,254 @@
|
||||
package com.yxt.workflow.biz.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.yxt.common.core.domain.BaseEntity;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@TableName("yxt_processinstance")
|
||||
public class YxtProcessInstance extends BaseEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String processSid; //流程sid
|
||||
private String drafterSid; //发起人
|
||||
private String drafterTime; //发起时间
|
||||
private String drafterName; //发起人姓名
|
||||
private String PriorProcesserSid; //上次更新人 //BaseEntity中的modify_time 上次更新时间
|
||||
private String priorNodeSid;
|
||||
private String PriorActionSid;
|
||||
private String currentProcesserSid;
|
||||
private String currentNodeSid;
|
||||
private String currentActionSid;
|
||||
private String formSid;
|
||||
private String formTitle;
|
||||
private String docPath;
|
||||
|
||||
private String createDept;
|
||||
private String createDeptSid;
|
||||
private String expireTime; //期望完成时间
|
||||
private String senderSid;
|
||||
private String sendTime;
|
||||
private String issuePersonSid;
|
||||
private String issueTime;
|
||||
private int isReturn;
|
||||
private String transactors;
|
||||
private String endPersonSid;
|
||||
private String endTime;
|
||||
|
||||
private int allUseTime;
|
||||
private int allIsOver;
|
||||
|
||||
|
||||
//----额外增加字段yxt_mtl 2020-08-28
|
||||
private String p_Sid; //父级流程实例sid
|
||||
private int priority; //优先级
|
||||
private String parent_Node_Name; //父流程依赖的节点名称
|
||||
private String order_No; //流程实例编号
|
||||
private String variable; //可用参数
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public int getAllUseTime() {
|
||||
return allUseTime;
|
||||
}
|
||||
public void setAllUseTime(int allUseTime) {
|
||||
this.allUseTime = allUseTime;
|
||||
}
|
||||
public int getAllIsOver() {
|
||||
return allIsOver;
|
||||
}
|
||||
public void setAllIsOver(int allIsOver) {
|
||||
this.allIsOver = allIsOver;
|
||||
}
|
||||
public String getDrafterName() {
|
||||
return drafterName;
|
||||
}
|
||||
public void setDrafterName(String drafterName) {
|
||||
this.drafterName = drafterName;
|
||||
}
|
||||
public String getProcessSid() {
|
||||
return processSid;
|
||||
}
|
||||
public void setProcessSid(String processSid) {
|
||||
this.processSid = processSid;
|
||||
}
|
||||
public String getDrafterSid() {
|
||||
return drafterSid;
|
||||
}
|
||||
public void setDrafterSid(String drafterSid) {
|
||||
this.drafterSid = drafterSid;
|
||||
}
|
||||
|
||||
public String getDrafterTime() {
|
||||
return drafterTime;
|
||||
}
|
||||
public String getPriorProcesserSid() {
|
||||
return PriorProcesserSid;
|
||||
}
|
||||
public void setPriorProcesserSid(String priorProcesserSid) {
|
||||
PriorProcesserSid = priorProcesserSid;
|
||||
}
|
||||
public String getPriorNodeSid() {
|
||||
return priorNodeSid;
|
||||
}
|
||||
public void setPriorNodeSid(String priorNodeSid) {
|
||||
this.priorNodeSid = priorNodeSid;
|
||||
}
|
||||
public String getPriorActionSid() {
|
||||
return PriorActionSid;
|
||||
}
|
||||
public void setPriorActionSid(String priorActionSid) {
|
||||
PriorActionSid = priorActionSid;
|
||||
}
|
||||
public String getCurrentProcesserSid() {
|
||||
return currentProcesserSid;
|
||||
}
|
||||
public void setCurrentProcesserSid(String currentProcesserSid) {
|
||||
this.currentProcesserSid = currentProcesserSid;
|
||||
}
|
||||
public String getCurrentNodeSid() {
|
||||
return currentNodeSid;
|
||||
}
|
||||
public void setCurrentNodeSid(String currentNodeSid) {
|
||||
this.currentNodeSid = currentNodeSid;
|
||||
}
|
||||
public String getCurrentActionSid() {
|
||||
return currentActionSid;
|
||||
}
|
||||
public void setCurrentActionSid(String currentActionSid) {
|
||||
this.currentActionSid = currentActionSid;
|
||||
}
|
||||
public String getFormSid() {
|
||||
return formSid;
|
||||
}
|
||||
public void setFormSid(String formSid) {
|
||||
this.formSid = formSid;
|
||||
}
|
||||
public String getFormTitle() {
|
||||
return formTitle;
|
||||
}
|
||||
public void setFormTitle(String formTitle) {
|
||||
this.formTitle = formTitle;
|
||||
}
|
||||
public String getDocPath() {
|
||||
return docPath;
|
||||
}
|
||||
public void setDocPath(String docPath) {
|
||||
this.docPath = docPath;
|
||||
}
|
||||
public String getCreateDept() {
|
||||
return createDept;
|
||||
}
|
||||
public void setCreateDept(String createDept) {
|
||||
this.createDept = createDept;
|
||||
}
|
||||
public String getCreateDeptSid() {
|
||||
return createDeptSid;
|
||||
}
|
||||
public void setCreateDeptSid(String createDeptSid) {
|
||||
this.createDeptSid = createDeptSid;
|
||||
}
|
||||
|
||||
public String getSenderSid() {
|
||||
return senderSid;
|
||||
}
|
||||
public void setSenderSid(String senderSid) {
|
||||
this.senderSid = senderSid;
|
||||
}
|
||||
|
||||
public String getIssuePersonSid() {
|
||||
return issuePersonSid;
|
||||
}
|
||||
public void setIssuePersonSid(String issuePersonSid) {
|
||||
this.issuePersonSid = issuePersonSid;
|
||||
}
|
||||
|
||||
public int getIsReturn() {
|
||||
return isReturn;
|
||||
}
|
||||
public void setIsReturn(int isReturn) {
|
||||
this.isReturn = isReturn;
|
||||
}
|
||||
public String getTransactors() {
|
||||
return transactors;
|
||||
}
|
||||
public void setTransactors(String transactors) {
|
||||
this.transactors = transactors;
|
||||
}
|
||||
public String getEndPersonSid() {
|
||||
return endPersonSid;
|
||||
}
|
||||
public void setEndPersonSid(String endPersonSid) {
|
||||
this.endPersonSid = endPersonSid;
|
||||
}
|
||||
public String getExpireTime() {
|
||||
return expireTime;
|
||||
}
|
||||
public void setExpireTime(String expireTime) {
|
||||
this.expireTime = expireTime;
|
||||
}
|
||||
public String getSendTime() {
|
||||
return sendTime;
|
||||
}
|
||||
public void setSendTime(String sendTime) {
|
||||
this.sendTime = sendTime;
|
||||
}
|
||||
public String getIssueTime() {
|
||||
return issueTime;
|
||||
}
|
||||
public void setIssueTime(String issueTime) {
|
||||
this.issueTime = issueTime;
|
||||
}
|
||||
public String getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
public void setEndTime(String endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
public void setDrafterTime(String drafterTime) {
|
||||
this.drafterTime = drafterTime;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//----额外增加字段yxt_mtl 2020-08-28
|
||||
public String getP_Sid() {
|
||||
return p_Sid;
|
||||
}
|
||||
public void setP_Sid(String p_Sid) {
|
||||
this.p_Sid = p_Sid;
|
||||
}
|
||||
public int getPriority() {
|
||||
return priority;
|
||||
}
|
||||
public void setPriority(int priority) {
|
||||
this.priority = priority;
|
||||
}
|
||||
public String getParent_Node_Name() {
|
||||
return parent_Node_Name;
|
||||
}
|
||||
public void setParent_Node_Name(String parent_Node_Name) {
|
||||
this.parent_Node_Name = parent_Node_Name;
|
||||
}
|
||||
public String getOrder_No() {
|
||||
return order_No;
|
||||
}
|
||||
public void setOrder_No(String order_No) {
|
||||
this.order_No = order_No;
|
||||
}
|
||||
public String getVariable() {
|
||||
return variable;
|
||||
}
|
||||
public void setVariable(String variable) {
|
||||
this.variable = variable;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.yxt.workflow.biz.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.yxt.common.core.domain.BaseEntity;
|
||||
|
||||
|
||||
@TableName("yxt_processnode")
|
||||
public class YxtProcessNode extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String processSid;
|
||||
private String nodeName;
|
||||
private int nodeNumber;
|
||||
|
||||
private String preNodeSid;
|
||||
private String nexNodeSid;
|
||||
private int isFirstNode;
|
||||
private int isLastNode;
|
||||
private int appendixFunc;
|
||||
private String allowFields;
|
||||
private String extendStatus;
|
||||
private String stageSid;
|
||||
private int timeLimit;
|
||||
public String getProcessSid() {
|
||||
return processSid;
|
||||
}
|
||||
public void setProcessSid(String processSid) {
|
||||
this.processSid = processSid;
|
||||
}
|
||||
public String getNodeName() {
|
||||
return nodeName;
|
||||
}
|
||||
public void setNodeName(String nodeName) {
|
||||
this.nodeName = nodeName;
|
||||
}
|
||||
public int getNodeNumber() {
|
||||
return nodeNumber;
|
||||
}
|
||||
public void setNodeNumber(int nodeNumber) {
|
||||
this.nodeNumber = nodeNumber;
|
||||
}
|
||||
public String getPreNodeSid() {
|
||||
return preNodeSid;
|
||||
}
|
||||
public void setPreNodeSid(String preNodeSid) {
|
||||
this.preNodeSid = preNodeSid;
|
||||
}
|
||||
public String getNexNodeSid() {
|
||||
return nexNodeSid;
|
||||
}
|
||||
public void setNexNodeSid(String nexNodeSid) {
|
||||
this.nexNodeSid = nexNodeSid;
|
||||
}
|
||||
public int getIsFirstNode() {
|
||||
return isFirstNode;
|
||||
}
|
||||
public void setIsFirstNode(int isFirstNode) {
|
||||
this.isFirstNode = isFirstNode;
|
||||
}
|
||||
public int getAppendixFunc() {
|
||||
return appendixFunc;
|
||||
}
|
||||
public void setAppendixFunc(int appendixFunc) {
|
||||
this.appendixFunc = appendixFunc;
|
||||
}
|
||||
public String getAllowFields() {
|
||||
return allowFields;
|
||||
}
|
||||
public void setAllowFields(String allowFields) {
|
||||
this.allowFields = allowFields;
|
||||
}
|
||||
public String getExtendStatus() {
|
||||
return extendStatus;
|
||||
}
|
||||
public void setExtendStatus(String extendStatus) {
|
||||
this.extendStatus = extendStatus;
|
||||
}
|
||||
public int getIsLastNode() {
|
||||
return isLastNode;
|
||||
}
|
||||
public void setIsLastNode(int isLastNode) {
|
||||
this.isLastNode = isLastNode;
|
||||
}
|
||||
|
||||
public String getStageSid() {
|
||||
return stageSid;
|
||||
}
|
||||
public void setStageSid(String stageSid) {
|
||||
this.stageSid = stageSid;
|
||||
}
|
||||
public int getTimeLimit() {
|
||||
return timeLimit;
|
||||
}
|
||||
public void setTimeLimit(int timeLimit) {
|
||||
this.timeLimit = timeLimit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,196 @@
|
||||
package com.yxt.workflow.biz.entity;
|
||||
|
||||
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.yxt.common.core.domain.BaseEntity;
|
||||
|
||||
@TableName("yxt_processrecord")
|
||||
public class YxtProcessRecord extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String processSid; //流程sid
|
||||
private String instanceSid; //实例sid
|
||||
//createtime任务创建时间
|
||||
private String currentProcesserSid; //处理人sid
|
||||
private String currentProcessTime; //任务完成时间
|
||||
private String currentNodeSid;
|
||||
private String currentActionSid;
|
||||
|
||||
private String nextProcesserSid;
|
||||
private String nextNodeSid;
|
||||
private String nextActionSid;
|
||||
private String opinion;
|
||||
private String useTime;
|
||||
private String handwriting;
|
||||
|
||||
private int isRemind;
|
||||
private String currentDeptName;
|
||||
private String currentDeptSid;
|
||||
|
||||
|
||||
//----额外增加字段yxt_mtl 2020-08-28
|
||||
private String task_Name; //任务名称 即环节名称
|
||||
private String display_Name; //任务显示名称
|
||||
private int task_Type; //任务类型
|
||||
private int perform_Type; //参与类型
|
||||
private Date expire_Time; //任务期望完成时间
|
||||
private String action_Url; //任务处理的url(表单url)
|
||||
private String pre_Task_Sid; //前一个任务的sid
|
||||
private String variable; //可用参数
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public String getProcessSid() {
|
||||
return processSid;
|
||||
}
|
||||
public void setProcessSid(String processSid) {
|
||||
this.processSid = processSid;
|
||||
}
|
||||
public String getInstanceSid() {
|
||||
return instanceSid;
|
||||
}
|
||||
public void setInstanceSid(String instanceSid) {
|
||||
this.instanceSid = instanceSid;
|
||||
}
|
||||
public String getCurrentProcesserSid() {
|
||||
return currentProcesserSid;
|
||||
}
|
||||
public void setCurrentProcesserSid(String currentProcesserSid) {
|
||||
this.currentProcesserSid = currentProcesserSid;
|
||||
}
|
||||
|
||||
public String getCurrentProcessTime() {
|
||||
return currentProcessTime;
|
||||
}
|
||||
public void setCurrentProcessTime(String currentProcessTime) {
|
||||
this.currentProcessTime = currentProcessTime;
|
||||
}
|
||||
public String getCurrentNodeSid() {
|
||||
return currentNodeSid;
|
||||
}
|
||||
public void setCurrentNodeSid(String currentNodeSid) {
|
||||
this.currentNodeSid = currentNodeSid;
|
||||
}
|
||||
public String getCurrentActionSid() {
|
||||
return currentActionSid;
|
||||
}
|
||||
public void setCurrentActionSid(String currentActionSid) {
|
||||
this.currentActionSid = currentActionSid;
|
||||
}
|
||||
public String getNextProcesserSid() {
|
||||
return nextProcesserSid;
|
||||
}
|
||||
public void setNextProcesserSid(String nextProcesserSid) {
|
||||
this.nextProcesserSid = nextProcesserSid;
|
||||
}
|
||||
public String getNextNodeSid() {
|
||||
return nextNodeSid;
|
||||
}
|
||||
public void setNextNodeSid(String nextNodeSid) {
|
||||
this.nextNodeSid = nextNodeSid;
|
||||
}
|
||||
public String getNextActionSid() {
|
||||
return nextActionSid;
|
||||
}
|
||||
public void setNextActionSid(String nextActionSid) {
|
||||
this.nextActionSid = nextActionSid;
|
||||
}
|
||||
public String getOpinion() {
|
||||
return opinion;
|
||||
}
|
||||
public void setOpinion(String opinion) {
|
||||
this.opinion = opinion;
|
||||
}
|
||||
|
||||
public String getUseTime() {
|
||||
return useTime;
|
||||
}
|
||||
public void setUseTime(String useTime) {
|
||||
this.useTime = useTime;
|
||||
}
|
||||
public String getHandwriting() {
|
||||
return handwriting;
|
||||
}
|
||||
public void setHandwriting(String handwriting) {
|
||||
this.handwriting = handwriting;
|
||||
}
|
||||
public int getIsRemind() {
|
||||
return isRemind;
|
||||
}
|
||||
public void setIsRemind(int isRemind) {
|
||||
this.isRemind = isRemind;
|
||||
}
|
||||
public String getCurrentDeptName() {
|
||||
return currentDeptName;
|
||||
}
|
||||
public void setCurrentDeptName(String currentDeptName) {
|
||||
this.currentDeptName = currentDeptName;
|
||||
}
|
||||
public String getCurrentDeptSid() {
|
||||
return currentDeptSid;
|
||||
}
|
||||
public void setCurrentDeptSid(String currentDeptSid) {
|
||||
this.currentDeptSid = currentDeptSid;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//----额外增加字段yxt_mtl 2020-08-28
|
||||
public String getTask_Name() {
|
||||
return task_Name;
|
||||
}
|
||||
public void setTask_Name(String task_Name) {
|
||||
this.task_Name = task_Name;
|
||||
}
|
||||
public String getDisplay_Name() {
|
||||
return display_Name;
|
||||
}
|
||||
public void setDisplay_Name(String display_Name) {
|
||||
this.display_Name = display_Name;
|
||||
}
|
||||
public int getTask_Type() {
|
||||
return task_Type;
|
||||
}
|
||||
public void setTask_Type(int task_Type) {
|
||||
this.task_Type = task_Type;
|
||||
}
|
||||
public int getPerform_Type() {
|
||||
return perform_Type;
|
||||
}
|
||||
public void setPerform_Type(int perform_Type) {
|
||||
this.perform_Type = perform_Type;
|
||||
}
|
||||
public Date getExpire_Time() {
|
||||
return expire_Time;
|
||||
}
|
||||
public void setExpire_Time(Date expire_Time) {
|
||||
this.expire_Time = expire_Time;
|
||||
}
|
||||
public String getAction_Url() {
|
||||
return action_Url;
|
||||
}
|
||||
public void setAction_Url(String action_Url) {
|
||||
this.action_Url = action_Url;
|
||||
}
|
||||
public String getPre_Task_Sid() {
|
||||
return pre_Task_Sid;
|
||||
}
|
||||
public void setPre_Task_Sid(String pre_Task_Sid) {
|
||||
this.pre_Task_Sid = pre_Task_Sid;
|
||||
}
|
||||
public String getVariable() {
|
||||
return variable;
|
||||
}
|
||||
public void setVariable(String variable) {
|
||||
this.variable = variable;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.yxt.workflow.biz.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.yxt.common.core.domain.BaseEntity;
|
||||
|
||||
@TableName("yxt_processstage")
|
||||
public class YxtProcessStage extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String processSid;
|
||||
private String stageName;
|
||||
private String stageChar;
|
||||
|
||||
private int stageLimit;
|
||||
private int remindLimit;
|
||||
public String getProcessSid() {
|
||||
return processSid;
|
||||
}
|
||||
public void setProcessSid(String processSid) {
|
||||
this.processSid = processSid;
|
||||
}
|
||||
public String getStageName() {
|
||||
return stageName;
|
||||
}
|
||||
public void setStageName(String stageName) {
|
||||
this.stageName = stageName;
|
||||
}
|
||||
public String getStageChar() {
|
||||
return stageChar;
|
||||
}
|
||||
public void setStageChar(String stageChar) {
|
||||
this.stageChar = stageChar;
|
||||
}
|
||||
public int getStageLimit() {
|
||||
return stageLimit;
|
||||
}
|
||||
public void setStageLimit(int stageLimit) {
|
||||
this.stageLimit = stageLimit;
|
||||
}
|
||||
public int getRemindLimit() {
|
||||
return remindLimit;
|
||||
}
|
||||
public void setRemindLimit(int remindLimit) {
|
||||
this.remindLimit = remindLimit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,244 @@
|
||||
package com.yxt.workflow.biz.historder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.yxt.common.base.config.RedisUtil;
|
||||
import com.yxt.jlzx.system.api.user.User;
|
||||
import com.yxt.jlzx.system.api.user.UserApi;
|
||||
import com.yxt.workflow.api.order.WfOrderApi;
|
||||
import com.yxt.workflow.biz.histtask.WfHistTaskService;
|
||||
import com.yxt.workflow.biz.order.WfOrderService;
|
||||
import com.yxt.workflow.biz.task.WfTaskService;
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.workflow.api.historder.WfHistOrder;
|
||||
import com.yxt.workflow.api.historder.WfHistOrderApi;
|
||||
import com.yxt.workflow.api.historder.WfHistOrderDto;
|
||||
import com.yxt.workflow.api.historder.WfHistOrderQuery;
|
||||
import com.yxt.workflow.api.historder.WfHistOrderVo;
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/09 17:03
|
||||
* @description 流程实例
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("v1/wfhistorders")
|
||||
@Api(tags = "流程实例历史记录管理")
|
||||
public class WfHistOrderApiImpl implements WfHistOrderApi{
|
||||
@Autowired
|
||||
private WfHistOrderService WfHistOrderService;
|
||||
|
||||
@Autowired
|
||||
private UserApi userApi;
|
||||
|
||||
@Autowired(required = false)
|
||||
private HttpServletRequest httpServletRequest;
|
||||
|
||||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
@Autowired
|
||||
private WfOrderService wfOrderService;
|
||||
|
||||
@Autowired
|
||||
private WfHistTaskService wfHistTaskService;
|
||||
|
||||
@Autowired
|
||||
private WfTaskService wfTaskService;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param WfHistOrderDto 角色dto对象
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean save(WfHistOrderDto dto)
|
||||
{
|
||||
ResultBean<String> resultBean=ResultBean.fireFail();
|
||||
WfHistOrder order=new WfHistOrder();
|
||||
dto.fillEntity(order);
|
||||
if(!WfHistOrderService.save(order))
|
||||
return resultBean;
|
||||
return resultBean.success().setData(order.getSid());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean update(@Valid WfHistOrderDto dto, String sid)
|
||||
throws Exception {
|
||||
WfHistOrder order=WfHistOrderService.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return ResultBean.fireFail().setMsg("该流程实例不存在");
|
||||
|
||||
if(0==WfHistOrderService.updateBySid(dto.toMap(), sid))
|
||||
return ResultBean.fireFail().setMsg("更新失败");
|
||||
return ResultBean.fireSuccess().setMsg("更新成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 真删除
|
||||
*
|
||||
* @param sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean delete(String sid)
|
||||
{
|
||||
WfHistOrder order=WfHistOrderService.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return ResultBean.fireFail().setMsg("该流程实例不存在");
|
||||
if(0==WfHistOrderService.deleteBySid(sid))
|
||||
return ResultBean.fireFail();
|
||||
return ResultBean.fireSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* 假删除,根据formsid删除
|
||||
*
|
||||
* @param sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean updateDelete(String formSid)
|
||||
{
|
||||
WfHistOrder order=WfHistOrderService.fetchByFormSid(formSid);
|
||||
if(null==order)
|
||||
return ResultBean.fireFail().setMsg("该流程实例不存在");
|
||||
WfHistOrderService.updateDelete(formSid);
|
||||
return ResultBean.fireSuccess();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
*
|
||||
* @param pagerQuery 查询条件
|
||||
* @return 分页列表
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<PagerVo<WfHistOrderVo>> pageList(
|
||||
PagerQuery<WfHistOrderQuery> pagerQuery) {
|
||||
ResultBean<PagerVo<WfHistOrderVo>> rb = ResultBean.fireFail();
|
||||
|
||||
IPage<WfHistOrderVo> page = WfHistOrderService.pageList(pagerQuery);
|
||||
//把Ipage转换为PageVo
|
||||
PagerVo<WfHistOrderVo> pv_result = PagerUtil.pageToVo(page, null);
|
||||
|
||||
return rb.success().setData(pv_result);
|
||||
}
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param sid
|
||||
* @return 详情
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<WfHistOrderVo> getVo(String sid)
|
||||
{
|
||||
ResultBean<WfHistOrderVo> resultBean=ResultBean.fireFail();
|
||||
WfHistOrder order=WfHistOrderService.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return resultBean;
|
||||
WfHistOrderVo WfHistOrderVo=new WfHistOrderVo();
|
||||
WfHistOrderVo.fromEntity(order);
|
||||
return new ResultBean().success().setData(WfHistOrderVo);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean<List<WfHistOrderVo>> list(WfHistOrderQuery query) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 管理员删除删除公文, isDelete修改状态 2021.09.10
|
||||
* @param formSid
|
||||
* @return
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public ResultBean deleteAdmin(String formSid,String isdelete) {
|
||||
|
||||
//获取用户的token
|
||||
String token = httpServletRequest.getHeader("token");
|
||||
String userName = redisUtil.get(token);
|
||||
|
||||
//根据用户名获取用户信息
|
||||
ResultBean<User> userResultBean = userApi.selectByUserNameOne(userName);
|
||||
if(userResultBean.getData().getIsAdmin() != 1) {
|
||||
return new ResultBean().fail().setMsg("该账户不是管理员,无法删除");
|
||||
}
|
||||
|
||||
//查询是否存在流程
|
||||
WfHistOrder order = WfHistOrderService.fetchByFormSid(formSid);
|
||||
if(null==order){
|
||||
return ResultBean.fireFail().setMsg("该流程实例不存在");
|
||||
}
|
||||
|
||||
//校验isDelete不能为空
|
||||
if(isdelete ==null || isdelete.length()<=0){
|
||||
return ResultBean.fireFail().setMsg("删除状态不能为空,请检查");
|
||||
}
|
||||
|
||||
if(0==WfHistOrderService.deleteadmin(formSid,isdelete)){
|
||||
return ResultBean.fireFail();
|
||||
}
|
||||
|
||||
wfOrderService.deleteadmin(formSid,isdelete);
|
||||
|
||||
return ResultBean.fireSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员彻底删除公文 2021.09.10
|
||||
*/
|
||||
@Override
|
||||
public ResultBean removeadmind(String orderSid) {
|
||||
//获取用户的token
|
||||
String token = httpServletRequest.getHeader("token");
|
||||
String userName = redisUtil.get(token);
|
||||
|
||||
//根据用户名获取用户信息
|
||||
ResultBean<User> userResultBean = userApi.selectByUserNameOne(userName);
|
||||
if(userResultBean.getData().getIsAdmin() != 1) {
|
||||
return new ResultBean().fail().setMsg("该账户不是管理员,无法删除");
|
||||
}
|
||||
|
||||
WfHistOrder order=WfHistOrderService.fetchBySid(orderSid);
|
||||
if(null==order)
|
||||
return ResultBean.fireFail().setMsg("该流程实例不存在");
|
||||
|
||||
if(0==WfHistOrderService.deleteBySid(orderSid)){
|
||||
return ResultBean.fireFail().setMsg("操作失败");
|
||||
}
|
||||
|
||||
//删除流程实例中数据
|
||||
wfHistTaskService.histtaskdeleteadmin(orderSid);
|
||||
|
||||
wfTaskService.taskdeleteadmin(orderSid);
|
||||
|
||||
wfOrderService.deleteBySid(orderSid);
|
||||
|
||||
return ResultBean.fireSuccess();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.yxt.workflow.biz.historder;
|
||||
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.yxt.workflow.api.historder.WfHistOrder;
|
||||
import com.yxt.workflow.api.historder.WfHistOrderQuery;
|
||||
import com.yxt.workflow.api.historder.WfHistOrderVo;
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/09 17:16
|
||||
* @description
|
||||
*/
|
||||
@Mapper
|
||||
public interface WfHistOrderMapper extends BaseMapper<WfHistOrder>{
|
||||
//分页列表
|
||||
IPage<WfHistOrderVo> pageList(IPage<WfHistOrderQuery> page,@Param(Constants.WRAPPER) Wrapper<WfHistOrderVo> qw);
|
||||
|
||||
WfHistOrder fetchByFormSid(String formSid);
|
||||
|
||||
void updateDelete(String formSid);
|
||||
|
||||
/**
|
||||
* 管理员删除公文 2021.09.10
|
||||
* @param formSid
|
||||
*/
|
||||
Integer deleteadmin(@Param("formSid") String formSid,@Param("isdelete") String isdelete);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?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.workflow.biz.historder.WfHistOrderMapper">
|
||||
<select id="pageList" resultType="com.yxt.workflow.api.historder.WfHistOrderVo">
|
||||
select sid,processSid,pSid,createBySid,expireTime,updateBySid,modifyTime,priority,parentNodeName,orderNo,createDeptSid,createDeptName,createrName,title,imperativeGrade,formSid,endTime from wf_hist_order
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
<select id="fetchByFormSid" resultType="com.yxt.workflow.api.historder.WfHistOrder">
|
||||
select * from wf_hist_order where formSid=#{formSid}
|
||||
</select>
|
||||
|
||||
<update id="updateDelete">
|
||||
update wf_hist_order
|
||||
SET
|
||||
isDelete = 1
|
||||
WHERE formSid = #{formSid}
|
||||
</update>
|
||||
<update id="deleteadmin">
|
||||
update wf_hist_order
|
||||
SET isDelete = #{isdelete}
|
||||
WHERE formSid = #{formSid}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.yxt.workflow.biz.historder;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.base.utils.PagerUtil;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.workflow.api.historder.WfHistOrder;
|
||||
import com.yxt.workflow.api.historder.WfHistOrderQuery;
|
||||
import com.yxt.workflow.api.historder.WfHistOrderVo;
|
||||
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/09 17:16
|
||||
* @description
|
||||
*/
|
||||
@Service
|
||||
public class WfHistOrderService extends MybatisBaseService<WfHistOrderMapper,WfHistOrder>{
|
||||
// 分页列表
|
||||
public IPage<WfHistOrderVo> pageList(PagerQuery<WfHistOrderQuery> pagerQuery) {
|
||||
// mybits所用的分页对对象
|
||||
IPage<WfHistOrderQuery> page = PagerUtil.queryToPage(pagerQuery);
|
||||
// mybits所用的查询条件封装类
|
||||
QueryWrapper<WfHistOrderVo> qw = buildQueryWrapper(pagerQuery.getParams());
|
||||
return baseMapper.pageList(page, qw);
|
||||
}
|
||||
/**
|
||||
* 解析和组装查询条件,封装在qw中
|
||||
* @param pagerQuery
|
||||
* @return
|
||||
*/
|
||||
private QueryWrapper<WfHistOrderVo> buildQueryWrapper(WfHistOrderQuery pagerQuery)
|
||||
{
|
||||
QueryWrapper<WfHistOrderVo> qw = new QueryWrapper<>();
|
||||
if (pagerQuery != null) {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(pagerQuery.getProcessSid()))
|
||||
qw.eq("processSid", pagerQuery.getProcessSid());
|
||||
qw.orderByDesc("createTime");
|
||||
}
|
||||
|
||||
return qw;
|
||||
|
||||
}
|
||||
public WfHistOrder fetchByFormSid(String formSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.fetchByFormSid(formSid);
|
||||
}
|
||||
public void updateDelete(String formSid) {
|
||||
// TODO Auto-generated method stub
|
||||
baseMapper.updateDelete(formSid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员删除公文 2021.09.10
|
||||
* @param formSid
|
||||
*/
|
||||
public Integer deleteadmin(String formSid,String isdelete) {
|
||||
return baseMapper.deleteadmin(formSid,isdelete);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package com.yxt.workflow.biz.histtask;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
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 com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.workflow.api.histtask.WfHistTask;
|
||||
import com.yxt.workflow.api.histtask.WfHistTaskApi;
|
||||
import com.yxt.workflow.api.histtask.WfHistTaskDto;
|
||||
import com.yxt.workflow.api.histtask.WfHistTaskQuery;
|
||||
import com.yxt.workflow.api.histtask.WfHistTaskVo;
|
||||
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/15 18:36
|
||||
* @description 任务
|
||||
*/
|
||||
//@Controller
|
||||
@RequestMapping("v1/wfhisttasks")
|
||||
@Api(tags = "流程任务历史记录管理")
|
||||
public class WfHistTaskApiImpl implements WfHistTaskApi{
|
||||
@Autowired
|
||||
private WfHistTaskService service;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param WfHistTaskDto 角色dto对象
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean save(WfHistTaskDto dto)
|
||||
{
|
||||
ResultBean<String> resultBean=ResultBean.fireFail();
|
||||
WfHistTask task=new WfHistTask();
|
||||
dto.fillEntity(task);
|
||||
if(!service.save(task))
|
||||
return resultBean;
|
||||
return resultBean.success().setData(task.getSid());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean update(@Valid WfHistTaskDto dto, String sid)
|
||||
throws Exception {
|
||||
WfHistTask order=service.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return ResultBean.fireFail().setMsg("该流程实例不存在");
|
||||
|
||||
if(0==service.updateBySid(dto.toMap(), sid))
|
||||
return ResultBean.fireFail().setMsg("更新失败");
|
||||
return ResultBean.fireSuccess().setMsg("更新成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean delete(String sid)
|
||||
{
|
||||
WfHistTask order=service.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return ResultBean.fireFail().setMsg("该流程实例不存在");
|
||||
if(0==service.deleteBySid(sid))
|
||||
return ResultBean.fireFail();
|
||||
return ResultBean.fireSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
*
|
||||
* @param pagerQuery 查询条件
|
||||
* @return 分页列表
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<PagerVo<WfHistTaskVo>> pageList(
|
||||
PagerQuery<WfHistTaskQuery> pagerQuery) {
|
||||
/*ResultBean<PagerVo<WfHistTaskVo>> rb = ResultBean.fireFail();
|
||||
|
||||
IPage<WfHistTaskVo> page = service.pageList(pagerQuery);
|
||||
//把Ipage转换为PageVo
|
||||
PagerVo<WfHistTaskVo> pv_result = PagerUtil.pageToVo(page, null);
|
||||
|
||||
return rb.success().setData(pv_result);*/
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param sid
|
||||
* @return 详情
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<WfHistTaskVo> getVo(String sid)
|
||||
{
|
||||
ResultBean<WfHistTaskVo> resultBean=ResultBean.fireFail();
|
||||
WfHistTask order=service.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return resultBean;
|
||||
WfHistTaskVo WfHistTaskVo=new WfHistTaskVo();
|
||||
WfHistTaskVo.fromEntity(order);
|
||||
return new ResultBean().success().setData(WfHistTaskVo);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean<List<WfHistTaskVo>> list(WfHistTaskQuery query) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.yxt.workflow.biz.histtask;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.yxt.workflow.api.histtask.WfHistTask;
|
||||
import com.yxt.workflow.api.histtask.WfHistTaskDidVo;
|
||||
import com.yxt.workflow.api.histtask.WfHistTaskQuery;
|
||||
import com.yxt.workflow.api.histtask.WfHistTaskVo;
|
||||
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/19 09:43
|
||||
* @description
|
||||
*/
|
||||
@Mapper
|
||||
public interface WfHistTaskMapper extends BaseMapper<WfHistTask>{
|
||||
|
||||
//不分页列表(历史任务记录,流程审批记录)
|
||||
List<WfHistTaskVo> list(@Param(Constants.WRAPPER) Wrapper<WfHistTaskVo> qw);
|
||||
// 已办工作分页列表
|
||||
IPage<WfHistTaskDidVo> pageList(IPage<WfHistTaskQuery> page,@Param(Constants.WRAPPER) Wrapper<WfHistTaskDidVo> qw);
|
||||
|
||||
//管理员查看所有的公文 2021.09.09
|
||||
IPage<WfHistTaskDidVo> pageList1(IPage<WfHistTaskQuery> page,@Param(Constants.WRAPPER) Wrapper<WfHistTaskDidVo> qw);
|
||||
|
||||
// 管理员查看所有的公文 2021.09.09
|
||||
IPage<WfHistTaskDidVo> pageList2(IPage<WfHistTaskQuery> page,@Param(Constants.WRAPPER) Wrapper<WfHistTaskDidVo> qw);
|
||||
|
||||
// 管理员查看所有的公文 2021.09.10
|
||||
IPage<WfHistTaskDidVo> pageList3(IPage<WfHistTaskQuery> page,@Param(Constants.WRAPPER) Wrapper<WfHistTaskDidVo> qw);
|
||||
|
||||
//管理员彻底删除公文流程 2021.09.10
|
||||
Integer histtaskdeleteadmin(@Param("orderSid") String orderSid);
|
||||
|
||||
//2021.09.15查找领导签发最新的信息
|
||||
List<WfHistTaskVo> getIssueInformation(@Param(Constants.WRAPPER) Wrapper<WfHistTaskVo> qw);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
<?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.workflow.biz.histtask.WfHistTaskMapper">
|
||||
|
||||
<select id="list" resultType="com.yxt.workflow.api.histtask.WfHistTaskVo">
|
||||
SELECT sid,
|
||||
operName,
|
||||
operPost,
|
||||
taskName,
|
||||
operOpinion,
|
||||
createTime,
|
||||
finishTime,
|
||||
useMinutes,
|
||||
actionName,
|
||||
taskType,
|
||||
preTaskSid,
|
||||
orderSid,
|
||||
nextOperName,
|
||||
nextOperDeptName,
|
||||
nextOperPost,
|
||||
nextTaskName
|
||||
FROM wf_Hist_task ${ew.customSqlSegment}
|
||||
</select>
|
||||
<select id="pageList" resultType="com.yxt.workflow.api.histtask.WfHistTaskDidVo">
|
||||
SELECT DISTINCT o.sid AS orderSid,
|
||||
p.sid AS processSid,
|
||||
p.processName,
|
||||
p.instanceUrl3,
|
||||
o.title,
|
||||
o.createDeptName,
|
||||
o.createDeptSid,
|
||||
o.createrName,
|
||||
o.createTime,
|
||||
o.imperativeGrade,
|
||||
o.lastTaskName as taskName,
|
||||
o.lastTaskSid as taskSid,
|
||||
a.actorSid,
|
||||
o.formSid,
|
||||
o.updateBySid=a.actorSid AS isRecall
|
||||
FROM wf_hist_task_actor a
|
||||
JOIN wf_hist_order o ON o.sid = a.orderSid
|
||||
JOIN wf_process p ON o.processSid = p.sid
|
||||
JOIN wf_hist_task t ON t.sid=a.taskSid
|
||||
${ew.customSqlSegment}
|
||||
|
||||
</select>
|
||||
<select id="pageList1" resultType="com.yxt.workflow.api.histtask.WfHistTaskDidVo">
|
||||
SELECT DISTINCT o.sid AS orderSid,
|
||||
p.sid AS processSid,
|
||||
p.processName,
|
||||
p.instanceUrl3,
|
||||
o.title,
|
||||
o.createDeptName,
|
||||
o.createDeptSid,
|
||||
o.createrName,
|
||||
o.createTime,
|
||||
o.imperativeGrade,
|
||||
o.lastTaskName as taskName,
|
||||
o.lastTaskSid as taskSid,
|
||||
o.formSid
|
||||
FROM wf_hist_task_actor a
|
||||
JOIN wf_hist_order o ON o.sid = a.orderSid
|
||||
JOIN wf_process p ON o.processSid = p.sid
|
||||
JOIN wf_hist_task t ON t.sid=a.taskSid
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
<select id="pageList2" resultType="com.yxt.workflow.api.histtask.WfHistTaskDidVo">
|
||||
SELECT DISTINCT o.sid AS orderSid,
|
||||
p.sid AS processSid,
|
||||
p.processName,
|
||||
p.instanceUrl3,
|
||||
o.title,
|
||||
o.createDeptName,
|
||||
o.createDeptSid,
|
||||
o.createrName,
|
||||
o.createTime,
|
||||
o.imperativeGrade,
|
||||
o.lastTaskName as taskName,
|
||||
o.lastTaskSid as taskSid,
|
||||
a.actorSid,
|
||||
o.formSid,
|
||||
o.updateBySid=a.actorSid AS isRecall
|
||||
FROM wf_hist_task_actor a
|
||||
JOIN wf_hist_order o ON o.sid = a.orderSid and o.updateBySid=a.actorSid
|
||||
JOIN wf_process p ON o.processSid = p.sid
|
||||
JOIN wf_hist_task t ON t.sid=a.taskSid
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
<select id="pageList3" resultType="com.yxt.workflow.api.histtask.WfHistTaskDidVo">
|
||||
SELECT DISTINCT o.sid AS orderSid,
|
||||
p.sid AS processSid,
|
||||
p.processName,
|
||||
p.instanceUrl3,
|
||||
o.title,
|
||||
o.createDeptName,
|
||||
o.createDeptSid,
|
||||
o.createrName,
|
||||
o.createTime,
|
||||
o.imperativeGrade,
|
||||
-- o.lastTaskName as taskName,
|
||||
t.taskName as taskName,
|
||||
o.lastTaskSid as taskSid,
|
||||
o.formSid
|
||||
FROM wf_hist_order o
|
||||
JOIN wf_process p ON o.processSid = p.sid
|
||||
JOIN wf_task t ON o.Sid = t.orderSid
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
<delete id="histtaskdeleteadmin">
|
||||
delete from wf_hist_task where orderSid = #{orderSid}
|
||||
</delete>
|
||||
<select id="getIssueInformation" resultType="com.yxt.workflow.api.histtask.WfHistTaskVo">
|
||||
SELECT t.sid,
|
||||
t.operName,
|
||||
t.operPost,
|
||||
t.taskName,
|
||||
t.operOpinion,
|
||||
t.createTime,
|
||||
t.finishTime,
|
||||
t.useMinutes,
|
||||
t.actionName,
|
||||
t.taskType,
|
||||
t.preTaskSid,
|
||||
t.orderSid,
|
||||
t.nextOperName,
|
||||
t.nextOperDeptName,
|
||||
t.nextOperPost,
|
||||
t.nextTaskName
|
||||
FROM wf_Hist_task as t
|
||||
JOIN (select max(id) as id, orderSid,taskName,operName from wf_hist_task group by orderSid,taskName,operName) as h
|
||||
ON t.id = h.id
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,325 @@
|
||||
package com.yxt.workflow.biz.histtask;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.yxt.common.base.utils.StringUtils;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.base.utils.DateUtils;
|
||||
import com.yxt.common.base.utils.PagerUtil;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.workflow.api.histtask.WfHistTask;
|
||||
import com.yxt.workflow.api.histtask.WfHistTaskDidVo;
|
||||
import com.yxt.workflow.api.histtask.WfHistTaskQuery;
|
||||
import com.yxt.workflow.api.histtask.WfHistTaskRecordQuery;
|
||||
import com.yxt.workflow.api.histtask.WfHistTaskVo;
|
||||
import com.yxt.workflow.api.histtaskactor.WfHistTaskActor;
|
||||
import com.yxt.workflow.biz.histtaskactor.WfHistTaskActorService;
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/09 17:16
|
||||
* @description
|
||||
*/
|
||||
@Service
|
||||
public class WfHistTaskService extends
|
||||
MybatisBaseService<WfHistTaskMapper, WfHistTask> {
|
||||
@Autowired
|
||||
private WfHistTaskActorService wfHistTaskActorService;
|
||||
|
||||
// 不分页列表---历史任务列表
|
||||
public List<WfHistTaskVo> list(WfHistTaskRecordQuery query) {
|
||||
|
||||
QueryWrapper<WfHistTaskVo> qw = buildQueryWrapper(query);
|
||||
return baseMapper.list(qw);
|
||||
}
|
||||
|
||||
// 2021.09.15 查询如果有多个领导签发,则只查询最新的签发信息
|
||||
public List<WfHistTaskVo> getIssueInformation(WfHistTaskRecordQuery query) {
|
||||
|
||||
QueryWrapper<WfHistTaskVo> qw = issueQueryWrapper(query);
|
||||
return baseMapper.getIssueInformation(qw);
|
||||
}
|
||||
|
||||
//2021.09.15 如果是的单位领导签发,则根据以下条件查询
|
||||
private QueryWrapper<WfHistTaskVo> issueQueryWrapper(
|
||||
WfHistTaskRecordQuery query) {
|
||||
QueryWrapper<WfHistTaskVo> qw = new QueryWrapper<>();
|
||||
if (query != null) {
|
||||
if (query.getOrderSid() != null
|
||||
&& org.apache.commons.lang3.StringUtils
|
||||
.isNotBlank(query.getOrderSid()))
|
||||
qw.eq("t.orderSid", query.getOrderSid());
|
||||
if (query.getTaskName() != null
|
||||
&& org.apache.commons.lang3.StringUtils
|
||||
.isNotBlank(query.getTaskName()))
|
||||
qw.eq("t.taskName", query.getTaskName());
|
||||
if (query.getTaskType() != null
|
||||
&& org.apache.commons.lang3.StringUtils
|
||||
.isNotBlank(query.getTaskType()))
|
||||
qw.eq("t.taskType", query.getTaskType());
|
||||
qw.orderByAsc("t.createTime");
|
||||
}
|
||||
return qw;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 不分页列表构造条件
|
||||
*
|
||||
* @param pagerQuery
|
||||
* @return
|
||||
*/
|
||||
private QueryWrapper<WfHistTaskVo> buildQueryWrapper(
|
||||
WfHistTaskRecordQuery query) {
|
||||
QueryWrapper<WfHistTaskVo> qw = new QueryWrapper<>();
|
||||
if (query != null) {
|
||||
if (query.getOrderSid() != null
|
||||
&& org.apache.commons.lang3.StringUtils
|
||||
.isNotBlank(query.getOrderSid()))
|
||||
qw.eq("orderSid", query.getOrderSid());
|
||||
if (query.getTaskName() != null
|
||||
&& org.apache.commons.lang3.StringUtils
|
||||
.isNotBlank(query.getTaskName()))
|
||||
qw.eq("taskName", query.getTaskName());
|
||||
if (query.getTaskType() != null
|
||||
&& org.apache.commons.lang3.StringUtils
|
||||
.isNotBlank(query.getTaskType()))
|
||||
qw.eq("taskType", query.getTaskType());
|
||||
qw.orderByAsc("createTime");
|
||||
|
||||
}
|
||||
|
||||
return qw;
|
||||
|
||||
}
|
||||
|
||||
// 已办任务列表查询条件
|
||||
private QueryWrapper<WfHistTaskDidVo> buildHistQueryWrapper(
|
||||
WfHistTaskQuery query) {
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
QueryWrapper<WfHistTaskDidVo> qw = new QueryWrapper<>();
|
||||
if (query != null) {
|
||||
if (query.getActorSid() != null && org.apache.commons.lang3.StringUtils.isNotBlank(query.getActorSid()))
|
||||
qw.eq("a.actorSid", query.getActorSid());
|
||||
|
||||
if (query.getProcessSid() != null && org.apache.commons.lang3.StringUtils .isNotBlank(query.getProcessSid()))
|
||||
qw.eq("p.sid", query.getProcessSid());
|
||||
|
||||
if (query.getTitle() != null && org.apache.commons.lang3.StringUtils.isNotBlank(query.getTitle()))
|
||||
qw.like("o.title", query.getTitle());
|
||||
|
||||
if (query.getCreateEndTime() != null) {
|
||||
Date date=query.getCreateEndTime();
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.setTime(date);
|
||||
c.add(Calendar.DAY_OF_MONTH, 1);//利用Calendar 实现 Date日期+1天
|
||||
|
||||
date = c.getTime();
|
||||
String createEndTime = formatter.format(date);
|
||||
qw.lt("o.createTime",createEndTime);
|
||||
}
|
||||
|
||||
if (query.getCreateStartTime() != null) {
|
||||
Date date=query.getCreateStartTime();
|
||||
String createStartTime = formatter.format(date);
|
||||
qw.gt("o.createTime", createStartTime);
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(query.getProcessTypeSid())) {
|
||||
qw.eq("p.processTypeSid", query.getProcessTypeSid());
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getCreaterName())) {
|
||||
qw.like("o.createrName", query.getCreaterName());
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getTaskType())) {
|
||||
qw.eq("t.taskType", query.getTaskType());
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getState())) {
|
||||
qw.eq("o.state", query.getState());
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(query.getCreateBySid())) {
|
||||
qw.like("o.createBySid", query.getCreateBySid());
|
||||
}
|
||||
qw.eq("o.isDelete",0);
|
||||
qw.groupBy("o.sid");
|
||||
qw.orderByDesc("o.createTime");
|
||||
}
|
||||
|
||||
return qw;
|
||||
|
||||
}
|
||||
|
||||
// 已办任务列表查询
|
||||
public IPage<WfHistTaskDidVo> pageList(
|
||||
PagerQuery<WfHistTaskQuery> pagerQuery) {
|
||||
// mybits转换IPage
|
||||
IPage<WfHistTaskQuery> page = PagerUtil.queryToPage(pagerQuery);
|
||||
// mybits的QueryWrapper
|
||||
QueryWrapper<WfHistTaskDidVo> qw = buildHistQueryWrapper(pagerQuery.getParams());
|
||||
return baseMapper.pageList(page, qw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员查看所有的已办公文 2021.09.09
|
||||
*/
|
||||
public IPage<WfHistTaskDidVo> pageList2(
|
||||
PagerQuery<WfHistTaskQuery> pagerQuery) {
|
||||
// mybits转换IPage
|
||||
IPage<WfHistTaskQuery> page = PagerUtil.queryToPage(pagerQuery);
|
||||
// mybits的QueryWrapper
|
||||
QueryWrapper<WfHistTaskDidVo> qw = buildHistQueryWrapper(pagerQuery
|
||||
.getParams());
|
||||
return baseMapper.pageList2(page, qw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员查看所有的公文 2021.09.09
|
||||
* @param pagerQuery
|
||||
* @return
|
||||
*/
|
||||
public IPage<WfHistTaskDidVo> pageList1(PagerQuery<WfHistTaskQuery> pagerQuery){
|
||||
// mybits转换IPage
|
||||
IPage<WfHistTaskQuery> page = PagerUtil.queryToPage(pagerQuery);
|
||||
// mybits的QueryWrapper
|
||||
QueryWrapper<WfHistTaskDidVo> qw = buildHistQueryWrapper(pagerQuery
|
||||
.getParams());
|
||||
return baseMapper.pageList1(page, qw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员查看所有的公文 2021.09.10
|
||||
* @param pagerQuery
|
||||
* @return
|
||||
*/
|
||||
public IPage<WfHistTaskDidVo> pageList3(PagerQuery<WfHistTaskQuery> pagerQuery){
|
||||
// mybits转换IPage
|
||||
IPage<WfHistTaskQuery> page = PagerUtil.queryToPage(pagerQuery);
|
||||
// mybits的QueryWrapper
|
||||
QueryWrapper<WfHistTaskDidVo> qw = viewHistQueryWrapper(pagerQuery
|
||||
.getParams());
|
||||
return baseMapper.pageList3(page, qw);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 管理员查看所有的公文条件查询 2021.09.10
|
||||
*/
|
||||
private QueryWrapper<WfHistTaskDidVo> viewHistQueryWrapper(
|
||||
WfHistTaskQuery query) {
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
QueryWrapper<WfHistTaskDidVo> qw = new QueryWrapper<>();
|
||||
if (query != null) {
|
||||
// if (query.getActorSid() != null
|
||||
// && org.apache.commons.lang3.StringUtils
|
||||
// .isNotBlank(query.getActorSid()))
|
||||
// qw.eq("a.actorSid", query.getActorSid());
|
||||
if (query.getProcessSid() != null
|
||||
&& org.apache.commons.lang3.StringUtils
|
||||
.isNotBlank(query.getProcessSid()))
|
||||
qw.eq("p.sid", query.getProcessSid());
|
||||
if (query.getTitle() != null
|
||||
&& org.apache.commons.lang3.StringUtils
|
||||
.isNotBlank(query.getTitle()))
|
||||
qw.like("o.title", query.getTitle());
|
||||
|
||||
if (query.getCreateEndTime() != null) {
|
||||
Date date=query.getCreateEndTime();
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.setTime(date);
|
||||
c.add(Calendar.DAY_OF_MONTH, 1);//利用Calendar 实现 Date日期+1天
|
||||
|
||||
date = c.getTime();
|
||||
String createEndTime = formatter.format(date);
|
||||
qw.lt("o.createTime",createEndTime);
|
||||
}
|
||||
|
||||
if (query.getCreateStartTime() != null) {
|
||||
Date date=query.getCreateStartTime();
|
||||
String createStartTime = formatter.format(date);
|
||||
qw.gt("o.createTime", createStartTime);
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(query.getProcessTypeSid())) {
|
||||
qw.eq("p.processTypeSid", query.getProcessTypeSid());
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getCreaterName())) {
|
||||
qw.like("o.createrName", query.getCreaterName());
|
||||
}
|
||||
// if (StringUtils.isNotBlank(query.getTaskType())) {
|
||||
// qw.eq("t.taskType", query.getTaskType());
|
||||
// }
|
||||
// if (StringUtils.isNotBlank(query.getState())) {
|
||||
// qw.eq("o.state", query.getState());
|
||||
// }
|
||||
if (StringUtils.isNotBlank(query.getProcessTypeSid())) {
|
||||
qw.like("o.createrName", query.getCreaterName());
|
||||
}
|
||||
qw.orderByDesc("o.createTime");
|
||||
|
||||
/**
|
||||
* 是否已删除 0 正常 1已删除
|
||||
*/
|
||||
qw.eq("o.isDelete",query.getIsDelete());
|
||||
}
|
||||
return qw;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 保存历史任务
|
||||
*
|
||||
* @param hist_task
|
||||
* @return
|
||||
*/
|
||||
public boolean saveHistTask(WfHistTask hist_task) {
|
||||
|
||||
// 设置完成时间
|
||||
hist_task.setFinishTime(new Date());
|
||||
// 计算任务用时
|
||||
try {
|
||||
hist_task.setUseMinutes(DateUtils.dateDiff(
|
||||
DateUtils.dateConvertStr(hist_task.getCreateTime()),
|
||||
DateUtils.dateConvertStr(hist_task.getFinishTime()), "yyyy-MM-dd HH:mm:ss"));
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// 保存历史任务
|
||||
save(hist_task);
|
||||
// 保存历史任务参与者
|
||||
/*
|
||||
* List<WfTaskActor> list_actors = hist_task.listActors;
|
||||
* List<WfHistTaskActor> list_histactors = new ArrayList<>(); for (int i
|
||||
* = 0; i < list_actors.size(); i++)
|
||||
* list_histactors.add((WfHistTaskActor) list_actors.get(i));
|
||||
*/
|
||||
WfHistTaskActor histTaskActor = new WfHistTaskActor();
|
||||
histTaskActor.setActorSid(hist_task.getCreateBySid());
|
||||
histTaskActor.setTaskSid(hist_task.getSid());
|
||||
histTaskActor.setOrderSid(hist_task.getOrderSid());
|
||||
return wfHistTaskActorService.save(histTaskActor);
|
||||
|
||||
// 保存histOrderactor的参与者
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员彻底删除公文 2021.09.10
|
||||
*/
|
||||
public Integer histtaskdeleteadmin(String orderSid){
|
||||
return baseMapper.histtaskdeleteadmin(orderSid);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package com.yxt.workflow.biz.histtaskactor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
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 com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.workflow.api.histtaskactor.WfHistTaskActor;
|
||||
import com.yxt.workflow.api.histtaskactor.WfHistTaskActorApi;
|
||||
import com.yxt.workflow.api.histtaskactor.WfHistTaskActorDto;
|
||||
import com.yxt.workflow.api.histtaskactor.WfHistTaskActorQuery;
|
||||
import com.yxt.workflow.api.histtaskactor.WfHistTaskActorVo;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/15 18:36
|
||||
* @description 任务
|
||||
*/
|
||||
//@Controller
|
||||
@RequestMapping("v1/wfhisttaskactors")
|
||||
@Api(tags = "流程任务历史参与者管理")
|
||||
public class WfHistTaskActorApiImpl implements WfHistTaskActorApi{
|
||||
@Autowired
|
||||
private WfHistTaskActorService service;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param WfHistTaskActorDto 角色dto对象
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean save(WfHistTaskActorDto dto)
|
||||
{
|
||||
ResultBean<String> resultBean=ResultBean.fireFail();
|
||||
WfHistTaskActor task=new WfHistTaskActor();
|
||||
dto.fillEntity(task);
|
||||
if(!service.save(task))
|
||||
return resultBean;
|
||||
return resultBean.success().setData(task.getSid());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean update(@Valid WfHistTaskActorDto dto, String sid)
|
||||
throws Exception {
|
||||
WfHistTaskActor order=service.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return ResultBean.fireFail().setMsg("该流程实例不存在");
|
||||
|
||||
if(0==service.updateBySid(dto.toMap(), sid))
|
||||
return ResultBean.fireFail().setMsg("更新失败");
|
||||
return ResultBean.fireSuccess().setMsg("更新成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean delete(String sid)
|
||||
{
|
||||
WfHistTaskActor order=service.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return ResultBean.fireFail().setMsg("该流程实例不存在");
|
||||
if(0==service.deleteBySid(sid))
|
||||
return ResultBean.fireFail();
|
||||
return ResultBean.fireSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
*
|
||||
* @param pagerQuery 查询条件
|
||||
* @return 分页列表
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<PagerVo<WfHistTaskActorVo>> pageList(
|
||||
PagerQuery<WfHistTaskActorQuery> pagerQuery) {
|
||||
ResultBean<PagerVo<WfHistTaskActorVo>> rb = ResultBean.fireFail();
|
||||
|
||||
IPage<WfHistTaskActorVo> page = service.pageList(pagerQuery);
|
||||
//把Ipage转换为PageVo
|
||||
PagerVo<WfHistTaskActorVo> pv_result = PagerUtil.pageToVo(page, null);
|
||||
|
||||
return rb.success().setData(pv_result);
|
||||
}
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param sid
|
||||
* @return 详情
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<WfHistTaskActorVo> getVo(String sid)
|
||||
{
|
||||
ResultBean<WfHistTaskActorVo> resultBean=ResultBean.fireFail();
|
||||
WfHistTaskActor order=service.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return resultBean;
|
||||
WfHistTaskActorVo WfHistTaskActorVo=new WfHistTaskActorVo();
|
||||
WfHistTaskActorVo.fromEntity(order);
|
||||
return new ResultBean().success().setData(WfHistTaskActorVo);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean<List<WfHistTaskActorVo>> list(WfHistTaskActorQuery query) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.yxt.workflow.biz.histtaskactor;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.yxt.workflow.api.histtaskactor.WfHistTaskActor;
|
||||
import com.yxt.workflow.api.histtaskactor.WfHistTaskActorQuery;
|
||||
import com.yxt.workflow.api.histtaskactor.WfHistTaskActorVo;
|
||||
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/19 16:43
|
||||
* @description
|
||||
*/
|
||||
@Mapper
|
||||
public interface WfHistTaskActorMapper extends BaseMapper<WfHistTaskActor>{
|
||||
//分页列表
|
||||
IPage<WfHistTaskActorVo> pageList(IPage<WfHistTaskActorQuery> page,@Param(Constants.WRAPPER) Wrapper<WfHistTaskActorVo> qw);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<?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.workflow.biz.histtaskactor.WfHistTaskActorMapper">
|
||||
<select id="pageList" resultType="com.yxt.workflow.api.histtaskactor.WfHistTaskActorVo">
|
||||
SELECT sid,taskSid,actorSid,orderSid FROM wf_hist_task_actor
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.yxt.workflow.biz.histtaskactor;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.base.utils.PagerUtil;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.workflow.api.histtaskactor.WfHistTaskActor;
|
||||
import com.yxt.workflow.api.histtaskactor.WfHistTaskActorQuery;
|
||||
import com.yxt.workflow.api.histtaskactor.WfHistTaskActorVo;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/09 17:16
|
||||
* @description
|
||||
*/
|
||||
@Service
|
||||
public class WfHistTaskActorService extends MybatisBaseService<WfHistTaskActorMapper,WfHistTaskActor>{
|
||||
// 鍒嗛〉鍒楄〃
|
||||
public IPage<WfHistTaskActorVo> pageList(PagerQuery<WfHistTaskActorQuery> pagerQuery) {
|
||||
// mybits鎵<73>鐢ㄧ殑鍒嗛〉瀵瑰璞<EE87AE>
|
||||
IPage<WfHistTaskActorQuery> page = PagerUtil.queryToPage(pagerQuery);
|
||||
// mybits鎵<73>鐢ㄧ殑鏌ヨ鏉′欢灏佽绫<EE978A>
|
||||
QueryWrapper<WfHistTaskActorVo> qw = buildQueryWrapper(pagerQuery.getParams());
|
||||
return baseMapper.pageList(page, qw);
|
||||
}
|
||||
/**
|
||||
* 瑙f瀽鍜岀粍瑁呮煡璇㈡潯浠讹紝灏佽鍦╭w涓<77>
|
||||
* @param pagerQuery
|
||||
* @return
|
||||
*/
|
||||
private QueryWrapper<WfHistTaskActorVo> buildQueryWrapper(WfHistTaskActorQuery pagerQuery)
|
||||
{
|
||||
QueryWrapper<WfHistTaskActorVo> qw = new QueryWrapper<>();
|
||||
if (pagerQuery != null) {
|
||||
if (pagerQuery.getTaskSid()!=null && org.apache.commons.lang3.StringUtils.isNotBlank(pagerQuery.getTaskSid()))
|
||||
qw.eq("taskSid", pagerQuery.getTaskSid());
|
||||
if (pagerQuery.getActorSid()!=null && org.apache.commons.lang3.StringUtils.isNotBlank(pagerQuery.getActorSid()))
|
||||
qw.eq("actorSid", pagerQuery.getActorSid());
|
||||
if (pagerQuery.getOrderSid()!=null && org.apache.commons.lang3.StringUtils.isNotBlank(pagerQuery.getOrderSid()))
|
||||
qw.eq("orderSid", pagerQuery.getOrderSid());
|
||||
qw.orderByAsc("createTime");
|
||||
}
|
||||
|
||||
return qw;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
package com.yxt.workflow.biz.order;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.yxt.common.base.config.RedisUtil;
|
||||
import com.yxt.jlzx.system.api.user.User;
|
||||
import com.yxt.jlzx.system.api.user.UserApi;
|
||||
import com.yxt.workflow.api.historder.WfHistOrder;
|
||||
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 com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.workflow.api.order.WfOrder;
|
||||
import com.yxt.workflow.api.order.WfOrderApi;
|
||||
import com.yxt.workflow.api.order.WfOrderDto;
|
||||
import com.yxt.workflow.api.order.WfOrderQuery;
|
||||
import com.yxt.workflow.api.order.WfOrderVo;
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/09 17:03
|
||||
* @description 流程实例
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("v1/wforders")
|
||||
@Api(tags = "流程实例管理")
|
||||
public class WfOrderApiImpl implements WfOrderApi{
|
||||
@Autowired
|
||||
private WfOrderService wfOrderService;
|
||||
|
||||
@Autowired
|
||||
private UserApi userApi;
|
||||
|
||||
@Autowired(required = false)
|
||||
private HttpServletRequest httpServletRequest;
|
||||
|
||||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param WfOrderDto 角色dto对象
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean save(WfOrderDto dto)
|
||||
{
|
||||
ResultBean<String> resultBean=ResultBean.fireFail();
|
||||
WfOrder order=new WfOrder();
|
||||
dto.fillEntity(order);
|
||||
if(!wfOrderService.save(order))
|
||||
return resultBean;
|
||||
return resultBean.success().setData(order.getSid());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean update(@Valid WfOrderDto dto, String sid)
|
||||
throws Exception {
|
||||
WfOrder order=wfOrderService.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return ResultBean.fireFail().setMsg("该流程实例不存在");
|
||||
|
||||
if(0==wfOrderService.updateBySid(dto.toMap(), sid))
|
||||
return ResultBean.fireFail().setMsg("更新失败");
|
||||
return ResultBean.fireSuccess().setMsg("更新成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean delete(String sid)
|
||||
{
|
||||
WfOrder order=wfOrderService.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return ResultBean.fireFail().setMsg("该流程实例不存在");
|
||||
if(0==wfOrderService.deleteBySid(sid))
|
||||
return ResultBean.fireFail();
|
||||
return ResultBean.fireSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
*
|
||||
* @param pagerQuery 查询条件
|
||||
* @return 分页列表
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<PagerVo<WfOrderVo>> pageList(
|
||||
PagerQuery<WfOrderQuery> pagerQuery) {
|
||||
ResultBean<PagerVo<WfOrderVo>> rb = ResultBean.fireFail();
|
||||
|
||||
IPage<WfOrderVo> page = wfOrderService.pageList(pagerQuery);
|
||||
//把Ipage转换为PageVo
|
||||
PagerVo<WfOrderVo> pv_result = PagerUtil.pageToVo(page, null);
|
||||
|
||||
return rb.success().setData(pv_result);
|
||||
}
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param sid
|
||||
* @return 详情
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<WfOrderVo> getVo(String sid)
|
||||
{
|
||||
ResultBean<WfOrderVo> resultBean=ResultBean.fireFail();
|
||||
WfOrder order=wfOrderService.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return resultBean;
|
||||
WfOrderVo wfOrderVo=new WfOrderVo();
|
||||
wfOrderVo.fromEntity(order);
|
||||
return new ResultBean().success().setData(wfOrderVo);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean<List<WfOrderVo>> list(WfOrderQuery query) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 管理员根据表单formSid删除流程实例 2021.09.10
|
||||
* @param formSid
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ResultBean deleteAdmin(String formSid, String isdelete) {
|
||||
|
||||
//获取用户的token
|
||||
String token = httpServletRequest.getHeader("token");
|
||||
String userName = redisUtil.get(token);
|
||||
|
||||
//根据用户名获取用户信息
|
||||
ResultBean<User> userResultBean = userApi.selectByUserNameOne(userName);
|
||||
if(userResultBean.getData().getIsAdmin() != 1) {
|
||||
return new ResultBean().fail().setMsg("该账户不是管理员,无法删除");
|
||||
}
|
||||
//查询是否存在流程
|
||||
WfOrder order = wfOrderService.fetchByFormSid(formSid);
|
||||
|
||||
//校验isDelete不能为空
|
||||
if(isdelete ==null && isdelete.length()<=0){
|
||||
return ResultBean.fireFail().setMsg("删除状态不能为空,请检查");
|
||||
}
|
||||
|
||||
wfOrderService.deleteadmin(formSid,isdelete);
|
||||
|
||||
return ResultBean.fireSuccess();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.yxt.workflow.biz.order;
|
||||
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.yxt.workflow.api.order.WfOrder;
|
||||
import com.yxt.workflow.api.order.WfOrderQuery;
|
||||
import com.yxt.workflow.api.order.WfOrderVo;
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/09 17:16
|
||||
* @description
|
||||
*/
|
||||
@Mapper
|
||||
public interface WfOrderMapper extends BaseMapper<WfOrder>{
|
||||
//分页列表
|
||||
IPage<WfOrderVo> pageList(IPage<WfOrderQuery> page,@Param(Constants.WRAPPER) Wrapper<WfOrderVo> qw);
|
||||
|
||||
|
||||
WfOrder fetchByFormSid(@Param("formSid")String formSid);
|
||||
|
||||
//管理员根据表单formSid删除流程实例 2021.09.10
|
||||
void deleteadmin(@Param("formSid") String formSid, @Param("isdelete") String isdelete);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?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.workflow.biz.order.WfOrderMapper">
|
||||
<select id="pageList" resultType="com.yxt.workflow.api.order.WfOrderVo">
|
||||
select sid,processSid,pSid,createBySid,expireTime,updateBySid,modifyTime,priority,parentNodeName,orderNo,createDeptSid,createDeptName,createrName,title,imperativeGrade,formSid from wf_order
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
<select id="fetchByFormSid" resultType="com.yxt.workflow.api.order.WfOrder">
|
||||
select * from wf_order where formSid=#{formSid}
|
||||
</select>
|
||||
<update id="deleteadmin">
|
||||
update wf_order
|
||||
SET isDelete = #{isdelete}
|
||||
WHERE formSid = #{formSid}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,150 @@
|
||||
package com.yxt.workflow.biz.order;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.base.utils.DateUtils;
|
||||
import com.yxt.common.base.utils.PagerUtil;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.workflow.api.historder.WfHistOrder;
|
||||
import com.yxt.workflow.api.order.WfOrder;
|
||||
import com.yxt.workflow.api.order.WfOrderFormsDto;
|
||||
import com.yxt.workflow.api.order.WfOrderQuery;
|
||||
import com.yxt.workflow.api.order.WfOrderTaskDto;
|
||||
import com.yxt.workflow.api.order.WfOrderVo;
|
||||
import com.yxt.workflow.biz.historder.WfHistOrderService;
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/09 17:16
|
||||
* @description
|
||||
*/
|
||||
@Service
|
||||
public class WfOrderService extends MybatisBaseService<WfOrderMapper,WfOrder>{
|
||||
|
||||
@Autowired
|
||||
private WfHistOrderService wfHistOrderService;
|
||||
// 分页列表
|
||||
public IPage<WfOrderVo> pageList(PagerQuery<WfOrderQuery> pagerQuery) {
|
||||
// mybits所用的分页对对象
|
||||
IPage<WfOrderQuery> page = PagerUtil.queryToPage(pagerQuery);
|
||||
// mybits所用的查询条件封装类
|
||||
QueryWrapper<WfOrderVo> qw = buildQueryWrapper(pagerQuery.getParams());
|
||||
return baseMapper.pageList(page, qw);
|
||||
}
|
||||
/**
|
||||
* 解析和组装查询条件,封装在qw中
|
||||
* @param pagerQuery
|
||||
* @return
|
||||
*/
|
||||
private QueryWrapper<WfOrderVo> buildQueryWrapper(WfOrderQuery pagerQuery)
|
||||
{
|
||||
QueryWrapper<WfOrderVo> qw = new QueryWrapper<>();
|
||||
if (pagerQuery != null) {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(pagerQuery.getProcessSid()))
|
||||
qw.eq("processSid", pagerQuery.getProcessSid());
|
||||
qw.orderByDesc("createTime");
|
||||
}
|
||||
|
||||
return qw;
|
||||
|
||||
}
|
||||
|
||||
//创建
|
||||
//事务操作
|
||||
public boolean createOrder(WfOrder order)
|
||||
{
|
||||
if(null==order)
|
||||
return false;
|
||||
save(order);
|
||||
|
||||
|
||||
WfHistOrder hist_order=new WfHistOrder();
|
||||
BeanUtil.copyProperties(order, hist_order);
|
||||
wfHistOrderService.save(hist_order);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//完成实例
|
||||
//事务操作
|
||||
public boolean finishOrder(String orderSid)
|
||||
{
|
||||
//删除wf_order表中的数据
|
||||
this.deleteBySid(orderSid);
|
||||
|
||||
//修改wf_hist_order表中的字段:end_Time,state=0
|
||||
Map<String,Object> map=new HashMap<>();
|
||||
map.put("state", 0);
|
||||
map.put("endTime", new Date());
|
||||
map.put("lastTaskName", "流程结束");
|
||||
wfHistOrderService.updateBySid(map, orderSid);
|
||||
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
/**
|
||||
* 更新流程实例中的表单字段(标题、紧急程度)
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
public boolean updateOrderFormInfo(WfOrderFormsDto dto)
|
||||
{
|
||||
Map<String,Object> map=dto.toMap();
|
||||
String sid=map.get("sid").toString();
|
||||
map.put("modifyTime", DateUtils.dateConvertStr(new Date()));
|
||||
wfHistOrderService.updateBySid(map);
|
||||
if(0==updateBySid(map,sid))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新流程实例中的节点字段(更新人、最新tasksid、最新taskname)
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
public boolean updateOrderTaskInfo(WfOrderTaskDto dto)
|
||||
{
|
||||
Map<String,Object> map=dto.toMap();
|
||||
String sid=map.get("sid").toString();
|
||||
map.put("modifyTime", DateUtils.dateConvertStr(new Date()));
|
||||
wfHistOrderService.updateBySid(map);
|
||||
map.remove("lastTaskSid");
|
||||
map.remove("lastTaskName");
|
||||
if(0==updateBySid(map,sid))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员根据表单formSid删除流程实例 2021.09.10
|
||||
* @param formSid
|
||||
* @return
|
||||
*/
|
||||
public WfOrder fetchByFormSid(String formSid) {
|
||||
return baseMapper.fetchByFormSid(formSid);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
管理员根据表单formSid删除流程实例 2021.09.10
|
||||
*/
|
||||
public void deleteadmin(String formSid, String isdelete) {
|
||||
baseMapper.deleteadmin(formSid,isdelete);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package com.yxt.workflow.biz.process;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
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 com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.workflow.api.process.WfProcess;
|
||||
import com.yxt.workflow.api.process.WfProcessApi;
|
||||
import com.yxt.workflow.api.process.WfProcessDto;
|
||||
import com.yxt.workflow.api.process.WfProcessQuery;
|
||||
import com.yxt.workflow.api.process.WfProcessVo;
|
||||
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/15 18:17
|
||||
* @description 流程定义
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("v1/wfprocesses")
|
||||
@Api(tags = "流程定义管理")
|
||||
public class WfProcessApiImpl implements WfProcessApi{
|
||||
@Autowired
|
||||
private WfProcessService service;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param WfProcessDto 角色dto对象
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean save(WfProcessDto dto)
|
||||
{
|
||||
ResultBean<String> resultBean=ResultBean.fireFail();
|
||||
WfProcess order=new WfProcess();
|
||||
dto.fillEntity(order);
|
||||
if(!service.save(order))
|
||||
return resultBean;
|
||||
return resultBean.success().setData(order.getSid());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean update(@Valid WfProcessDto dto, String sid)
|
||||
throws Exception {
|
||||
WfProcess order=service.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return ResultBean.fireFail().setMsg("该流程实例不存在");
|
||||
|
||||
if(0==service.updateBySid(dto.toMap(), sid))
|
||||
return ResultBean.fireFail().setMsg("更新失败");
|
||||
return ResultBean.fireSuccess().setMsg("更新成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean delete(String sid)
|
||||
{
|
||||
WfProcess order=service.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return ResultBean.fireFail().setMsg("该流程实例不存在");
|
||||
if(0==service.deleteBySid(sid))
|
||||
return ResultBean.fireFail();
|
||||
return ResultBean.fireSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
*
|
||||
* @param pagerQuery 查询条件
|
||||
* @return 分页列表
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<PagerVo<WfProcessVo>> pageList(
|
||||
PagerQuery<WfProcessQuery> pagerQuery) {
|
||||
ResultBean<PagerVo<WfProcessVo>> rb = ResultBean.fireFail();
|
||||
|
||||
IPage<WfProcessVo> page = service.pageList(pagerQuery);
|
||||
//把Ipage转换为PageVo
|
||||
PagerVo<WfProcessVo> pv_result = PagerUtil.pageToVo(page, null);
|
||||
|
||||
return rb.success().setData(pv_result);
|
||||
}
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param sid
|
||||
* @return 详情
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<WfProcessVo> getVo(String sid)
|
||||
{
|
||||
ResultBean<WfProcessVo> resultBean=ResultBean.fireFail();
|
||||
WfProcess process=service.fetchBySid(sid);
|
||||
if(null==process)
|
||||
return resultBean;
|
||||
WfProcessVo wfProcessVo=new WfProcessVo();
|
||||
wfProcessVo.fromEntity(process);
|
||||
wfProcessVo.setIsAppendix(wfProcessVo.getExtendStatus().equals("")?"0":wfProcessVo.getExtendStatus().split(",")[0]);
|
||||
return new ResultBean().success().setData(wfProcessVo);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean<List<WfProcessVo>> list(WfProcessQuery query) {
|
||||
|
||||
ResultBean<List<WfProcessVo>> resultBean=ResultBean.fireFail();
|
||||
return resultBean.success().setData(service.list(query));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.yxt.workflow.biz.process;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.yxt.workflow.api.process.WfProcess;
|
||||
import com.yxt.workflow.api.process.WfProcessQuery;
|
||||
import com.yxt.workflow.api.process.WfProcessVo;
|
||||
import com.yxt.workflow.api.processtype.WfProcessTypeVo;
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/15 18:25
|
||||
* @description
|
||||
*/
|
||||
@Mapper
|
||||
public interface WfProcessMapper extends BaseMapper<WfProcess>{
|
||||
//分页列表
|
||||
IPage<WfProcessVo> pageList(IPage<WfProcessQuery> page,@Param(Constants.WRAPPER) Wrapper<WfProcessVo> qw);
|
||||
// 不分页列表
|
||||
List<WfProcessVo> list(@Param(Constants.WRAPPER) Wrapper<WfProcessVo> qw);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?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.workflow.biz.process.WfProcessMapper">
|
||||
<select id="pageList" resultType="com.yxt.workflow.api.process.WfProcessVo">
|
||||
SELECT p.sid,p.processName,p.displayName,p.processTypeSid,t.processTypeName,p.instanceUrl,p.instanceUrl2,p.instanceUrl3,p.state,p.ver,p.remarks,p.imgUrl,p.sortNo,p.extendStatus FROM wf_process p JOIN wf_processtype t ON t.sid=p.processTypeSid
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
<select id="list" resultType="com.yxt.workflow.api.process.WfProcessVo">
|
||||
SELECT p.sid,p.processName,p.displayName,p.processTypeSid,t.processTypeName,p.instanceUrl,p.instanceUrl2,p.instanceUrl3,p.state,p.ver,p.remarks,p.imgUrl,p.sortNo,p.extendStatus FROM wf_process p JOIN wf_processtype t ON t.sid=p.processTypeSid
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.yxt.workflow.biz.process;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.base.utils.PagerUtil;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.workflow.api.process.WfProcess;
|
||||
import com.yxt.workflow.api.process.WfProcessQuery;
|
||||
import com.yxt.workflow.api.process.WfProcessVo;
|
||||
import com.yxt.workflow.api.processtype.WfProcessTypeQuery;
|
||||
import com.yxt.workflow.api.processtype.WfProcessTypeVo;
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/15 18:21
|
||||
* @description
|
||||
*/
|
||||
@Service
|
||||
public class WfProcessService extends MybatisBaseService<WfProcessMapper,WfProcess>{
|
||||
// 分页列表
|
||||
public IPage<WfProcessVo> pageList(PagerQuery<WfProcessQuery> pagerQuery) {
|
||||
// mybits所用的分页对对象
|
||||
IPage<WfProcessQuery> page = PagerUtil.queryToPage(pagerQuery);
|
||||
// mybits所用的查询条件封装类
|
||||
QueryWrapper<WfProcessVo> qw = buildQueryWrapper(pagerQuery.getParams());
|
||||
return baseMapper.pageList(page, qw);
|
||||
}
|
||||
|
||||
// 不分页列表
|
||||
public List<WfProcessVo> list(WfProcessQuery query) {
|
||||
|
||||
// mybits所用的查询条件封装类
|
||||
QueryWrapper<WfProcessVo> qw = buildQueryWrapper(query);
|
||||
return baseMapper.list(qw);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 解析和组装查询条件,封装在qw中
|
||||
* @param pagerQuery
|
||||
* @return
|
||||
*/
|
||||
private QueryWrapper<WfProcessVo> buildQueryWrapper(WfProcessQuery pagerQuery)
|
||||
{
|
||||
QueryWrapper<WfProcessVo> qw = new QueryWrapper<>();
|
||||
if (pagerQuery != null) {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(pagerQuery.getProcessName()))
|
||||
qw.like("p.processName", pagerQuery.getProcessName());
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(pagerQuery.getProcessTypeSid()))
|
||||
qw.eq("p.processTypeSid", pagerQuery.getProcessTypeSid());
|
||||
if (pagerQuery.getState()!=-9)
|
||||
qw.eq("p.state", pagerQuery.getState());
|
||||
qw.eq("p.isDelete", 0);
|
||||
qw.eq("t.isDelete", 0);
|
||||
qw.orderByAsc("p.sortNo");
|
||||
}
|
||||
|
||||
return qw;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
package com.yxt.workflow.biz.processaction;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.workflow.api.processaction.WfProcessAction;
|
||||
import com.yxt.workflow.api.processaction.WfProcessActionApi;
|
||||
import com.yxt.workflow.api.processaction.WfProcessActionDto;
|
||||
import com.yxt.workflow.api.processaction.WfProcessActionQuery;
|
||||
import com.yxt.workflow.api.processaction.WfProcessActionSimpleVo;
|
||||
import com.yxt.workflow.api.processaction.WfProcessActionVo;
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/15 18:17
|
||||
* @description 流程定义
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("v1/wfprocessactions")
|
||||
@Api(tags = "流程动作管理")
|
||||
public class WfProcessActionApiImpl implements WfProcessActionApi{
|
||||
@Autowired
|
||||
private WfProcessActionService service;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param WfProcessActionDto 角色dto对象
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean save(WfProcessActionDto dto)
|
||||
{
|
||||
ResultBean<String> resultBean=ResultBean.fireFail();
|
||||
WfProcessAction order=new WfProcessAction();
|
||||
dto.fillEntity(order);
|
||||
if(!service.save(order))
|
||||
return resultBean;
|
||||
return resultBean.success().setData(order.getSid());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean update(@Valid WfProcessActionDto dto, String sid)
|
||||
throws Exception {
|
||||
WfProcessAction order=service.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return ResultBean.fireFail().setMsg("该流程实例不存在");
|
||||
|
||||
if(0==service.updateBySid(dto.toMap(), sid))
|
||||
return ResultBean.fireFail().setMsg("更新失败");
|
||||
return ResultBean.fireSuccess().setMsg("更新成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean delete(String sid)
|
||||
{
|
||||
WfProcessAction order=service.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return ResultBean.fireFail().setMsg("该流程实例不存在");
|
||||
if(0==service.deleteBySid(sid))
|
||||
return ResultBean.fireFail();
|
||||
return ResultBean.fireSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
*
|
||||
* @param pagerQuery 查询条件
|
||||
* @return 分页列表
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<PagerVo<WfProcessActionVo>> pageList(
|
||||
PagerQuery<WfProcessActionQuery> pagerQuery) {
|
||||
ResultBean<PagerVo<WfProcessActionVo>> rb = ResultBean.fireFail();
|
||||
|
||||
IPage<WfProcessActionVo> page = service.pageList(pagerQuery);
|
||||
//把Ipage转换为PageVo
|
||||
PagerVo<WfProcessActionVo> pv_result = PagerUtil.pageToVo(page, null);
|
||||
|
||||
return rb.success().setData(pv_result);
|
||||
}
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param sid
|
||||
* @return 详情
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<WfProcessActionVo> getVo(String sid)
|
||||
{
|
||||
ResultBean<WfProcessActionVo> resultBean=ResultBean.fireFail();
|
||||
WfProcessAction order=service.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return resultBean;
|
||||
WfProcessActionVo WfProcessActionVo=new WfProcessActionVo();
|
||||
WfProcessActionVo.fromEntity(order);
|
||||
return new ResultBean().success().setData(WfProcessActionVo);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean<List<WfProcessActionVo>> list(WfProcessActionQuery query) {
|
||||
|
||||
ResultBean<List<WfProcessActionVo>> resultBean = ResultBean.fireFail();
|
||||
List<WfProcessActionVo> list = service.list(query);
|
||||
if (null == list)
|
||||
return resultBean;
|
||||
return resultBean.success().setData(list);
|
||||
}
|
||||
@Override
|
||||
public ResultBean<List<WfProcessActionSimpleVo>> simpleList(WfProcessActionQuery query) {
|
||||
|
||||
ResultBean<List<WfProcessActionSimpleVo>> resultBean = ResultBean.fireFail();
|
||||
List<WfProcessActionSimpleVo> list = service.simpleList(query);
|
||||
if (null == list)
|
||||
return resultBean;
|
||||
return resultBean.success().setData(list);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.yxt.workflow.biz.processaction;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.yxt.workflow.api.processaction.WfProcessAction;
|
||||
import com.yxt.workflow.api.processaction.WfProcessActionQuery;
|
||||
import com.yxt.workflow.api.processaction.WfProcessActionSimpleVo;
|
||||
import com.yxt.workflow.api.processaction.WfProcessActionVo;
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/15 18:25
|
||||
* @description
|
||||
*/
|
||||
@Mapper
|
||||
public interface WfProcessActionMapper extends BaseMapper<WfProcessAction>{
|
||||
//分页列表
|
||||
IPage<WfProcessActionVo> pageList(IPage<WfProcessActionQuery> page,@Param(Constants.WRAPPER) Wrapper<WfProcessActionVo> qw);
|
||||
// 不分页列表
|
||||
List<WfProcessActionVo> list(@Param(Constants.WRAPPER) Wrapper<WfProcessActionVo> qw);
|
||||
// 不分页简单列表
|
||||
List<WfProcessActionSimpleVo> simpleList(@Param(Constants.WRAPPER) Wrapper<WfProcessActionSimpleVo> qw);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?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.workflow.biz.processaction.WfProcessActionMapper">
|
||||
<select id="pageList" resultType="com.yxt.workflow.api.processaction.WfProcessActionVo">
|
||||
SELECT a.sid,a.processSid,a.nodeSid,n.nodeName,a.actionName,a.actionNumber,a.nextNodeSid,n1.NodeName AS nextNodeName,a.isLastAction,a.actionUserSid,a.actionPersonName,a.authorizers,a.authorizeDepts,a.authorizeRoles,a.extendStatus,a.state,a.customOpinion,a.remarks FROM wf_processaction a JOIN wf_processnode n ON a.nodeSid=n.sid JOIN wf_processnode n1 ON a.nextNodeSid=n1.sid
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
<select id="list" resultType="com.yxt.workflow.api.processaction.WfProcessActionVo">
|
||||
SELECT a.sid,a.processSid,a.nodeSid,n.nodeName,a.actionName,a.actionNumber,a.nextNodeSid,n1.NodeName AS nextNodeName,a.isLastAction,a.actionUserSid,a.actionPersonName,a.authorizers,a.authorizeDepts,a.authorizeRoles,a.extendStatus,a.state,a.customOpinion,a.remarks FROM wf_processaction a JOIN wf_processnode n ON a.nodeSid=n.sid JOIN wf_processnode n1 ON a.nextNodeSid=n1.sid
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
<select id="simpleList" resultType="com.yxt.workflow.api.processaction.WfProcessActionSimpleVo">
|
||||
SELECT sid,actionName FROM wf_processaction
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.yxt.workflow.biz.processaction;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.base.utils.PagerUtil;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.workflow.api.processaction.WfProcessAction;
|
||||
import com.yxt.workflow.api.processaction.WfProcessActionQuery;
|
||||
import com.yxt.workflow.api.processaction.WfProcessActionSimpleVo;
|
||||
import com.yxt.workflow.api.processaction.WfProcessActionVo;
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/15 18:21
|
||||
* @description
|
||||
*/
|
||||
@Service
|
||||
public class WfProcessActionService extends
|
||||
MybatisBaseService<WfProcessActionMapper, WfProcessAction> {
|
||||
// 分页列表
|
||||
public IPage<WfProcessActionVo> pageList(
|
||||
PagerQuery<WfProcessActionQuery> pagerQuery) {
|
||||
// mybits所用的分页对对象
|
||||
IPage<WfProcessActionQuery> page = PagerUtil.queryToPage(pagerQuery);
|
||||
// mybits所用的查询条件封装类
|
||||
QueryWrapper<WfProcessActionVo> qw = buildQueryWrapper(pagerQuery
|
||||
.getParams());
|
||||
return baseMapper.pageList(page, qw);
|
||||
}
|
||||
|
||||
// 不分页列表
|
||||
public List<WfProcessActionVo> list(WfProcessActionQuery query) {
|
||||
|
||||
// mybits所用的查询条件封装类
|
||||
QueryWrapper<WfProcessActionVo> qw = buildQueryWrapper(query);
|
||||
return baseMapper.list(qw);
|
||||
}
|
||||
|
||||
// 不分页简单列表
|
||||
public List<WfProcessActionSimpleVo> simpleList(WfProcessActionQuery query) {
|
||||
|
||||
QueryWrapper<WfProcessActionSimpleVo> qw = new QueryWrapper<>();
|
||||
if (query != null) {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(query
|
||||
.getNodeSid()))
|
||||
qw.eq("nodeSid", query.getNodeSid());
|
||||
qw.orderByAsc("actionNumber");
|
||||
}
|
||||
|
||||
return baseMapper.simpleList(qw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析和组装查询条件,封装在qw中
|
||||
*
|
||||
* @param pagerQuery
|
||||
* @return
|
||||
*/
|
||||
private QueryWrapper<WfProcessActionVo> buildQueryWrapper(
|
||||
WfProcessActionQuery pagerQuery) {
|
||||
QueryWrapper<WfProcessActionVo> qw = new QueryWrapper<>();
|
||||
if (pagerQuery != null) {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(pagerQuery
|
||||
.getNodeSid()))
|
||||
qw.eq("a.nodeSid", pagerQuery.getNodeSid());
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(pagerQuery
|
||||
.getActionName()))
|
||||
qw.like("a.actionName", pagerQuery.getActionName());
|
||||
|
||||
qw.orderByAsc("a.actionNumber");
|
||||
}
|
||||
|
||||
return qw;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
package com.yxt.workflow.biz.processauth;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.workflow.api.processauth.WfProcessAuth;
|
||||
import com.yxt.workflow.api.processauth.WfProcessAuthApi;
|
||||
import com.yxt.workflow.api.processauth.WfProcessAuthDto;
|
||||
import com.yxt.workflow.api.processauth.WfProcessAuthQuery;
|
||||
import com.yxt.workflow.api.processauth.WfProcessAuthVo;
|
||||
import com.yxt.workflow.api.processauth.WfProcessAuthsVo;
|
||||
|
||||
/**
|
||||
* @author yxt_hwj
|
||||
* @date 2020/12/04 18:36
|
||||
* @description 任务
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("v1/wfprocessauths")
|
||||
@Api(tags = "流程授权管理")
|
||||
public class WfProcessAuthApiImpl implements WfProcessAuthApi{
|
||||
@Autowired
|
||||
private WfProcessAuthService service;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param WfProcessAuthDto 角色dto对象
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean save(WfProcessAuthDto dto)
|
||||
{
|
||||
ResultBean<String> resultBean=ResultBean.fireFail();
|
||||
if(null==dto)
|
||||
return resultBean;
|
||||
List<WfProcessAuth> list=new ArrayList<>();
|
||||
for(int i=0;i<dto.getDepartmentSids().size();i++)
|
||||
{
|
||||
WfProcessAuth auth=new WfProcessAuth();
|
||||
auth.setProcessSid(dto.getProcessSid());
|
||||
auth.setDepartmentSid(dto.getDepartmentSids().get(i));
|
||||
list.add(auth);
|
||||
}
|
||||
if(!service.save(list))
|
||||
return resultBean.setMsg("授权失败,请选中部门后在授权");
|
||||
return resultBean.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean update(@Valid WfProcessAuthDto dto, String sid)
|
||||
throws Exception {
|
||||
WfProcessAuth Processstage=service.fetchBySid(sid);
|
||||
if(null==Processstage)
|
||||
return ResultBean.fireFail().setMsg("该流程阶段不存在");
|
||||
|
||||
if(0==service.updateBySid(dto.toMap(), sid))
|
||||
return ResultBean.fireFail().setMsg("更新失败");
|
||||
return ResultBean.fireSuccess().setMsg("更新成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean delete(String sid)
|
||||
{
|
||||
WfProcessAuth order=service.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return ResultBean.fireFail().setMsg("该流程阶段不存在");
|
||||
if(0==service.deleteBySid(sid))
|
||||
return ResultBean.fireFail();
|
||||
return ResultBean.fireSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
*
|
||||
* @param pagerQuery 查询条件
|
||||
* @return 分页列表
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<PagerVo<WfProcessAuthVo>> pageList(PagerQuery<WfProcessAuthQuery> pagerQuery) {
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param sid
|
||||
* @return 详情
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<WfProcessAuthVo> getVo(String sid)
|
||||
{
|
||||
/*ResultBean<WfProcessAuthVo> resultBean=ResultBean.fireFail();
|
||||
WfProcessAuth order=service.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return resultBean;
|
||||
WfProcessAuthVo WfProcessAuthVo=new WfProcessAuthVo();
|
||||
WfProcessAuthVo.fromEntity(order);
|
||||
return new ResultBean().success().setData(WfProcessAuthVo);*/
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<WfProcessAuthsVo> lists(WfProcessAuthQuery query) {
|
||||
ResultBean<WfProcessAuthsVo> resultBean = ResultBean.fireFail();
|
||||
List<WfProcessAuthVo> list = service.list(query);
|
||||
WfProcessAuthsVo vo=new WfProcessAuthsVo();
|
||||
if (null == list)
|
||||
return resultBean;
|
||||
if(0==list.size())
|
||||
return resultBean.success().setData(vo);
|
||||
|
||||
vo.setProcessSid(list.get(0).getProcessSid());
|
||||
vo.setDepartmentSids(new ArrayList<String>());
|
||||
for(int i=0;i<list.size();i++)
|
||||
{
|
||||
vo.getDepartmentSids().add(list.get(i).getDepartmentSid());
|
||||
}
|
||||
return resultBean.success().setData(vo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<List<WfProcessAuthVo>> list(
|
||||
@Valid WfProcessAuthQuery query) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.yxt.workflow.biz.processauth;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.yxt.workflow.api.processauth.WfProcessAuth;
|
||||
import com.yxt.workflow.api.processauth.WfProcessAuthQuery;
|
||||
import com.yxt.workflow.api.processauth.WfProcessAuthVo;
|
||||
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/16 09:43
|
||||
* @description
|
||||
*/
|
||||
@Mapper
|
||||
public interface WfProcessAuthMapper extends BaseMapper<WfProcessAuth>{
|
||||
|
||||
List<WfProcessAuthVo> list(@Param(Constants.WRAPPER) Wrapper<WfProcessAuthVo> qw);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<?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.workflow.biz.processauth.WfProcessAuthMapper">
|
||||
<select id="list" resultType="com.yxt.workflow.api.processauth.WfProcessAuthVo">
|
||||
SELECT processSid,
|
||||
departmentSid
|
||||
FROM wf_Processauth
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.yxt.workflow.biz.processauth;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.workflow.api.processauth.WfProcessAuth;
|
||||
import com.yxt.workflow.api.processauth.WfProcessAuthDto;
|
||||
import com.yxt.workflow.api.processauth.WfProcessAuthQuery;
|
||||
import com.yxt.workflow.api.processauth.WfProcessAuthVo;
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/09 17:16
|
||||
* @description
|
||||
*/
|
||||
@Service
|
||||
public class WfProcessAuthService extends MybatisBaseService<WfProcessAuthMapper, WfProcessAuth> {
|
||||
|
||||
public List<WfProcessAuthVo> list(WfProcessAuthQuery query) {
|
||||
QueryWrapper<WfProcessAuthVo> qw = buildQueryWrapper(query);
|
||||
return baseMapper.list(qw);
|
||||
}
|
||||
|
||||
|
||||
//查询条件
|
||||
private QueryWrapper<WfProcessAuthVo> buildQueryWrapper(
|
||||
WfProcessAuthQuery pagerQuery) {
|
||||
QueryWrapper<WfProcessAuthVo> qw = new QueryWrapper<>();
|
||||
if (pagerQuery != null) {
|
||||
if (pagerQuery.getProcessSid() != null
|
||||
&& org.apache.commons.lang3.StringUtils
|
||||
.isNotBlank(pagerQuery.getProcessSid()))
|
||||
qw.eq("processSid", pagerQuery.getProcessSid());
|
||||
|
||||
}
|
||||
return qw;
|
||||
|
||||
}
|
||||
|
||||
public boolean save(List<WfProcessAuth> list)
|
||||
{
|
||||
if(list==null || list.size()==0)
|
||||
return false;
|
||||
//先删除
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("processSid", list.get(0).getProcessSid());
|
||||
baseMapper.deleteByMap(map);
|
||||
//后新增
|
||||
return this.saveBatch(list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
package com.yxt.workflow.biz.processnode;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.workflow.api.processnode.WfProcessNode;
|
||||
import com.yxt.workflow.api.processnode.WfProcessNodeApi;
|
||||
import com.yxt.workflow.api.processnode.WfProcessNodeDto;
|
||||
import com.yxt.workflow.api.processnode.WfProcessNodeQuery;
|
||||
import com.yxt.workflow.api.processnode.WfProcessNodeSimpleVo;
|
||||
import com.yxt.workflow.api.processnode.WfProcessNodeVo;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/15 18:17
|
||||
* @description 流程定义
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("v1/wfprocessnodes")
|
||||
@Api(tags = "流程环节管理")
|
||||
public class WfProcessNodeApiImpl implements WfProcessNodeApi{
|
||||
@Autowired
|
||||
private WfProcessNodeService service;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param WfProcessNodeDto 角色dto对象
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean save(WfProcessNodeDto dto)
|
||||
{
|
||||
ResultBean<String> resultBean=ResultBean.fireFail();
|
||||
WfProcessNode order=new WfProcessNode();
|
||||
dto.fillEntity(order);
|
||||
if(!service.save(order))
|
||||
return resultBean;
|
||||
return resultBean.success().setData(order.getSid());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean update(@Valid WfProcessNodeDto dto, String sid)
|
||||
throws Exception {
|
||||
WfProcessNode order=service.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return ResultBean.fireFail().setMsg("该流程实例不存在");
|
||||
|
||||
if(0==service.updateBySid(dto.toMap(), sid))
|
||||
return ResultBean.fireFail().setMsg("更新失败");
|
||||
return ResultBean.fireSuccess().setMsg("更新成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean delete(String sid)
|
||||
{
|
||||
WfProcessNode order=service.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return ResultBean.fireFail().setMsg("该流程实例不存在");
|
||||
if(0==service.deleteBySid(sid))
|
||||
return ResultBean.fireFail();
|
||||
return ResultBean.fireSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
*
|
||||
* @param pagerQuery 查询条件
|
||||
* @return 分页列表
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<PagerVo<WfProcessNodeVo>> pageList(
|
||||
PagerQuery<WfProcessNodeQuery> pagerQuery) {
|
||||
ResultBean<PagerVo<WfProcessNodeVo>> rb = ResultBean.fireFail();
|
||||
|
||||
IPage<WfProcessNodeVo> page = service.pageList(pagerQuery);
|
||||
//把Ipage转换为PageVo
|
||||
PagerVo<WfProcessNodeVo> pv_result = PagerUtil.pageToVo(page, null);
|
||||
|
||||
return rb.success().setData(pv_result);
|
||||
}
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param sid
|
||||
* @return 详情
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<WfProcessNodeVo> getVo(String sid)
|
||||
{
|
||||
ResultBean<WfProcessNodeVo> resultBean=ResultBean.fireFail();
|
||||
WfProcessNode order=service.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return resultBean;
|
||||
WfProcessNodeVo WfProcessNodeVo=new WfProcessNodeVo();
|
||||
WfProcessNodeVo.fromEntity(order);
|
||||
return new ResultBean().success().setData(WfProcessNodeVo);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean<List<WfProcessNodeVo>> list(WfProcessNodeQuery query) {
|
||||
|
||||
ResultBean<List<WfProcessNodeVo>> resultBean = ResultBean.fireFail();
|
||||
List<WfProcessNodeVo> list = service.list(query);
|
||||
if (null == list)
|
||||
return resultBean;
|
||||
return resultBean.success().setData(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<List<WfProcessNodeSimpleVo>> simpleList(WfProcessNodeQuery query) {
|
||||
|
||||
ResultBean<List<WfProcessNodeSimpleVo>> resultBean = ResultBean.fireFail();
|
||||
List<WfProcessNodeSimpleVo> list = service.simpleList(query);
|
||||
if (null == list)
|
||||
return resultBean;
|
||||
return resultBean.success().setData(list);
|
||||
}
|
||||
|
||||
|
||||
//获取流程首环节
|
||||
/*@Override
|
||||
public ResultBean<WfProcessNodeVo> getFirstNode(String processSid)
|
||||
{
|
||||
ResultBean<WfProcessNodeVo> resultBean = ResultBean.fireFail();
|
||||
WfProcessNode node=service.getFirstNode(processSid);
|
||||
WfProcessNodeVo vo=new WfProcessNodeVo();
|
||||
vo.fromEntity(node);
|
||||
return resultBean.success().setData(vo);
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.yxt.workflow.biz.processnode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.yxt.workflow.api.processaction.WfProcessActionVo;
|
||||
import com.yxt.workflow.api.processnode.WfProcessNode;
|
||||
import com.yxt.workflow.api.processnode.WfProcessNodeQuery;
|
||||
import com.yxt.workflow.api.processnode.WfProcessNodeSimpleVo;
|
||||
import com.yxt.workflow.api.processnode.WfProcessNodeVo;
|
||||
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/15 18:25
|
||||
* @description
|
||||
*/
|
||||
@Mapper
|
||||
public interface WfProcessNodeMapper extends BaseMapper<WfProcessNode>{
|
||||
//分页列表
|
||||
IPage<WfProcessNodeVo> pageList(IPage<WfProcessNodeQuery> page,@Param(Constants.WRAPPER) Wrapper<WfProcessNodeVo> qw);
|
||||
// 不分页列表
|
||||
List<WfProcessNodeVo> list(@Param(Constants.WRAPPER) Wrapper<WfProcessNodeVo> qw);
|
||||
// 不分页简单列表
|
||||
List<WfProcessNodeSimpleVo> simpleList(@Param(Constants.WRAPPER) Wrapper<WfProcessNodeSimpleVo> qw);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?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.workflow.biz.processnode.WfProcessNodeMapper">
|
||||
<select id="pageList" resultType="com.yxt.workflow.api.processnode.WfProcessNodeVo">
|
||||
select sid,processSid,nodeName,nodeNumber,allowFields,extendStatus,stageSid,timeLimit,state,remarks from wf_processnode
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
<select id="list" resultType="com.yxt.workflow.api.processnode.WfProcessNodeVo">
|
||||
select sid,processSid,nodeName,nodeNumber,allowFields,extendStatus,stageSid,timeLimit,state,remarks from wf_processnode
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
<select id="simpleList" resultType="com.yxt.workflow.api.processnode.WfProcessNodeSimpleVo">
|
||||
SELECT sid,nodeName FROM wf_processnode
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.yxt.workflow.biz.processnode;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.base.utils.PagerUtil;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.workflow.api.processaction.WfProcessActionQuery;
|
||||
import com.yxt.workflow.api.processaction.WfProcessActionVo;
|
||||
import com.yxt.workflow.api.processnode.WfProcessNode;
|
||||
import com.yxt.workflow.api.processnode.WfProcessNodeQuery;
|
||||
import com.yxt.workflow.api.processnode.WfProcessNodeSimpleVo;
|
||||
import com.yxt.workflow.api.processnode.WfProcessNodeVo;
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/15 18:21
|
||||
* @description
|
||||
*/
|
||||
@Service
|
||||
public class WfProcessNodeService extends
|
||||
MybatisBaseService<WfProcessNodeMapper, WfProcessNode> {
|
||||
// 分页列表
|
||||
public IPage<WfProcessNodeVo> pageList(
|
||||
PagerQuery<WfProcessNodeQuery> pagerQuery) {
|
||||
// mybits所用的分页对对象
|
||||
IPage<WfProcessNodeQuery> page = PagerUtil.queryToPage(pagerQuery);
|
||||
// mybits所用的查询条件封装类
|
||||
QueryWrapper<WfProcessNodeVo> qw = buildQueryWrapper(pagerQuery
|
||||
.getParams());
|
||||
return baseMapper.pageList(page, qw);
|
||||
}
|
||||
|
||||
// 不分页列表
|
||||
public List<WfProcessNodeVo> list(WfProcessNodeQuery pagerQuery) {
|
||||
|
||||
// mybits所用的查询条件封装类
|
||||
QueryWrapper<WfProcessNodeVo> qw = buildQueryWrapper(pagerQuery);
|
||||
return baseMapper.list(qw);
|
||||
}
|
||||
|
||||
// 不分页列表
|
||||
public List<WfProcessNodeSimpleVo> simpleList(WfProcessNodeQuery query) {
|
||||
|
||||
QueryWrapper<WfProcessNodeSimpleVo> qw = new QueryWrapper<>();
|
||||
if (query != null) {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(query
|
||||
.getProcessSid()))
|
||||
qw.eq("processSid", query.getProcessSid());
|
||||
qw.orderByAsc("nodeNumber");
|
||||
}
|
||||
return baseMapper.simpleList(qw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析和组装查询条件,封装在qw中
|
||||
*
|
||||
* @param pagerQuery
|
||||
* @return
|
||||
*/
|
||||
private QueryWrapper<WfProcessNodeVo> buildQueryWrapper(
|
||||
WfProcessNodeQuery pagerQuery) {
|
||||
QueryWrapper<WfProcessNodeVo> qw = new QueryWrapper<>();
|
||||
if (pagerQuery != null) {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(pagerQuery
|
||||
.getProcessSid()))
|
||||
qw.eq("processSid", pagerQuery.getProcessSid());
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(pagerQuery
|
||||
.getNodeName()))
|
||||
qw.like("nodeName", pagerQuery.getNodeName());
|
||||
qw.orderByAsc("nodeNumber");
|
||||
}
|
||||
|
||||
return qw;
|
||||
|
||||
}
|
||||
|
||||
// 获取流程首环节
|
||||
public WfProcessNode getFirstNode(String processSid) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("processSid", processSid);
|
||||
List<WfProcessNode> list = this.listByMap(map);
|
||||
if (list == null || list.size() == 0)
|
||||
return null;
|
||||
return list.get(0);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package com.yxt.workflow.biz.processstage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.workflow.api.processstage.WfProcessStage;
|
||||
import com.yxt.workflow.api.processstage.WfProcessStageApi;
|
||||
import com.yxt.workflow.api.processstage.WfProcessStageDto;
|
||||
import com.yxt.workflow.api.processstage.WfProcessStageQuery;
|
||||
import com.yxt.workflow.api.processstage.WfProcessStageVo;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
/**
|
||||
* @author yxt_hwj
|
||||
* @date 2020/10/15 18:36
|
||||
* @description 任务
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("v1/wfprocessstages")
|
||||
@Api(tags = "流程阶段管理")
|
||||
public class WfProcessStageApiImpl implements WfProcessStageApi{
|
||||
@Autowired
|
||||
private WfProcessStageService service;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param WfProcessstageDto 角色dto对象
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean save(WfProcessStageDto dto)
|
||||
{
|
||||
ResultBean<String> resultBean=ResultBean.fireFail();
|
||||
WfProcessStage processstage=new WfProcessStage();
|
||||
dto.fillEntity(processstage);
|
||||
if(!service.save(processstage))
|
||||
return resultBean;
|
||||
return resultBean.success().setData(processstage.getSid());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean update(@Valid WfProcessStageDto dto, String sid)
|
||||
throws Exception {
|
||||
WfProcessStage Processstage=service.fetchBySid(sid);
|
||||
if(null==Processstage)
|
||||
return ResultBean.fireFail().setMsg("该流程阶段不存在");
|
||||
|
||||
if(0==service.updateBySid(dto.toMap(), sid))
|
||||
return ResultBean.fireFail().setMsg("更新失败");
|
||||
return ResultBean.fireSuccess().setMsg("更新成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean delete(String sid)
|
||||
{
|
||||
WfProcessStage order=service.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return ResultBean.fireFail().setMsg("该流程阶段不存在");
|
||||
if(0==service.deleteBySid(sid))
|
||||
return ResultBean.fireFail();
|
||||
return ResultBean.fireSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
*
|
||||
* @param pagerQuery 查询条件
|
||||
* @return 分页列表
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<PagerVo<WfProcessStageVo>> pageList(PagerQuery<WfProcessStageQuery> pagerQuery) {
|
||||
ResultBean<PagerVo<WfProcessStageVo>> rb = ResultBean.fireFail();
|
||||
|
||||
IPage<WfProcessStageVo> page = service.pageList(pagerQuery);
|
||||
//把Ipage转换为PageVo
|
||||
PagerVo<WfProcessStageVo> pv_result = PagerUtil.pageToVo(page, null);
|
||||
|
||||
return rb.success().setData(pv_result);
|
||||
}
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param sid
|
||||
* @return 详情
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<WfProcessStageVo> getVo(String sid)
|
||||
{
|
||||
ResultBean<WfProcessStageVo> resultBean=ResultBean.fireFail();
|
||||
WfProcessStage order=service.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return resultBean;
|
||||
WfProcessStageVo WfProcessstageVo=new WfProcessStageVo();
|
||||
WfProcessstageVo.fromEntity(order);
|
||||
return new ResultBean().success().setData(WfProcessstageVo);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean<List<WfProcessStageVo>> list(WfProcessStageQuery query) {
|
||||
ResultBean<List<WfProcessStageVo>> resultBean = ResultBean.fireFail();
|
||||
List<WfProcessStageVo> list = service.processStageList(query);
|
||||
if (null == list)
|
||||
return resultBean;
|
||||
return resultBean.success().setData(list);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.yxt.workflow.biz.processstage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.yxt.workflow.api.processstage.WfProcessStage;
|
||||
import com.yxt.workflow.api.processstage.WfProcessStageQuery;
|
||||
import com.yxt.workflow.api.processstage.WfProcessStageVo;
|
||||
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/16 09:43
|
||||
* @description
|
||||
*/
|
||||
@Mapper
|
||||
public interface WfProcessStageMapper extends BaseMapper<WfProcessStage>{
|
||||
//待办分页列表
|
||||
IPage<WfProcessStageVo> pageList(IPage<WfProcessStageQuery> page,@Param(Constants.WRAPPER) Wrapper<WfProcessStageVo> qw);
|
||||
|
||||
List<WfProcessStageVo> processStageList(@Param(Constants.WRAPPER) Wrapper<WfProcessStageVo> qw);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?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.workflow.biz.processstage.WfProcessStageMapper">
|
||||
<select id="pageList" resultType="com.yxt.workflow.api.processstage.WfProcessStageVo">
|
||||
SELECT t.sid,
|
||||
t.processSid,
|
||||
t.stageName,
|
||||
DATE_FORMAT(t.createTime, '%Y-%m-%d %H:%m:%s') AS createTime,
|
||||
t.stageChar,
|
||||
t.stageLimit,
|
||||
t.remindLimit,t.sortNo
|
||||
FROM wf_Processstage t
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
<select id="processStageList" resultType="com.yxt.workflow.api.processstage.WfProcessStageVo">
|
||||
SELECT t.sid,
|
||||
t.processSid,
|
||||
t.stageName,
|
||||
DATE_FORMAT(t.createTime, '%Y-%m-%d %H:%m:%s') AS createTime,
|
||||
t.stageChar,
|
||||
t.stageLimit,
|
||||
t.remindLimit,t.sortNo
|
||||
FROM wf_Processstage t
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.yxt.workflow.biz.processstage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.base.utils.PagerUtil;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.workflow.api.processstage.WfProcessStage;
|
||||
import com.yxt.workflow.api.processstage.WfProcessStageQuery;
|
||||
import com.yxt.workflow.api.processstage.WfProcessStageVo;
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/09 17:16
|
||||
* @description
|
||||
*/
|
||||
@Service
|
||||
public class WfProcessStageService extends MybatisBaseService<WfProcessStageMapper, WfProcessStage> {
|
||||
@Autowired
|
||||
private WfProcessStageService wfHistProcessstageService;
|
||||
|
||||
|
||||
//待办列表
|
||||
public IPage<WfProcessStageVo> pageList(PagerQuery<WfProcessStageQuery> pagerQuery) {
|
||||
IPage<WfProcessStageQuery> page = PagerUtil.queryToPage(pagerQuery);
|
||||
QueryWrapper<WfProcessStageVo> qw = buildQueryWrapper(pagerQuery.getParams());
|
||||
|
||||
return baseMapper.pageList(page, qw);
|
||||
}
|
||||
|
||||
|
||||
public List<WfProcessStageVo> processStageList(WfProcessStageQuery query) {
|
||||
QueryWrapper<WfProcessStageVo> qw = buildQueryWrapper(query);
|
||||
return baseMapper.processStageList(qw);
|
||||
}
|
||||
|
||||
|
||||
//查询条件
|
||||
private QueryWrapper<WfProcessStageVo> buildQueryWrapper(
|
||||
WfProcessStageQuery pagerQuery) {
|
||||
QueryWrapper<WfProcessStageVo> qw = new QueryWrapper<>();
|
||||
if (pagerQuery != null) {
|
||||
if (pagerQuery.getProcessSid() != null
|
||||
&& org.apache.commons.lang3.StringUtils
|
||||
.isNotBlank(pagerQuery.getProcessSid()))
|
||||
qw.eq("t.processSid", pagerQuery.getProcessSid());
|
||||
|
||||
qw.orderByAsc("t.createTime");
|
||||
}
|
||||
return qw;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
package com.yxt.workflow.biz.processtype;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.workflow.api.processtype.WfProcessType;
|
||||
import com.yxt.workflow.api.processtype.WfProcessTypeApi;
|
||||
import com.yxt.workflow.api.processtype.WfProcessTypeDto;
|
||||
import com.yxt.workflow.api.processtype.WfProcessTypeQuery;
|
||||
import com.yxt.workflow.api.processtype.WfProcessTypeVo;
|
||||
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/11/03 18:17
|
||||
* @description 流程类别
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("v1/wfprocesstypes")
|
||||
@Api(tags = "流程类别管理")
|
||||
public class WfProcessTypeApiImpl implements WfProcessTypeApi{
|
||||
@Autowired
|
||||
private WfProcessTypeService service;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param WfProcessTypeDto 角色dto对象
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean save(WfProcessTypeDto dto)
|
||||
{
|
||||
ResultBean<String> resultBean=ResultBean.fireFail();
|
||||
WfProcessType order=new WfProcessType();
|
||||
dto.fillEntity(order);
|
||||
if(!service.save(order))
|
||||
return resultBean;
|
||||
return resultBean.success().setData(order.getSid());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean update(@Valid WfProcessTypeDto dto, String sid)
|
||||
throws Exception {
|
||||
WfProcessType order=service.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return ResultBean.fireFail().setMsg("该流程实例不存在");
|
||||
|
||||
if(0==service.updateBySid(dto.toMap(), sid))
|
||||
return ResultBean.fireFail().setMsg("更新失败");
|
||||
return ResultBean.fireSuccess().setMsg("更新成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean delete(String sid)
|
||||
{
|
||||
WfProcessType order=service.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return ResultBean.fireFail().setMsg("该流程实例不存在");
|
||||
if(0==service.deleteBySid(sid))
|
||||
return ResultBean.fireFail();
|
||||
return ResultBean.fireSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
*
|
||||
* @param pagerQuery 查询条件
|
||||
* @return 分页列表
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<PagerVo<WfProcessTypeVo>> pageList(
|
||||
PagerQuery<WfProcessTypeQuery> pagerQuery) {
|
||||
ResultBean<PagerVo<WfProcessTypeVo>> rb = ResultBean.fireFail();
|
||||
|
||||
IPage<WfProcessTypeVo> page = service.pageList(pagerQuery);
|
||||
//把Ipage转换为PageVo
|
||||
PagerVo<WfProcessTypeVo> pv_result = PagerUtil.pageToVo(page, null);
|
||||
|
||||
return rb.success().setData(pv_result);
|
||||
}
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param sid
|
||||
* @return 详情
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<WfProcessTypeVo> getVo(String sid)
|
||||
{
|
||||
ResultBean<WfProcessTypeVo> resultBean=ResultBean.fireFail();
|
||||
WfProcessType order=service.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return resultBean;
|
||||
WfProcessTypeVo WfProcessTypeVo=new WfProcessTypeVo();
|
||||
WfProcessTypeVo.fromEntity(order);
|
||||
return new ResultBean().success().setData(WfProcessTypeVo);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean<List<WfProcessTypeVo>> list(WfProcessTypeQuery query) {
|
||||
|
||||
ResultBean<List<WfProcessTypeVo>> rb = ResultBean.fireFail();
|
||||
|
||||
List<WfProcessTypeVo> list = service.list(query);
|
||||
|
||||
return rb.success().setData(list);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.yxt.workflow.biz.processtype;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.yxt.workflow.api.processtype.WfProcessType;
|
||||
import com.yxt.workflow.api.processtype.WfProcessTypeQuery;
|
||||
import com.yxt.workflow.api.processtype.WfProcessTypeVo;
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/15 18:25
|
||||
* @description
|
||||
*/
|
||||
@Mapper
|
||||
public interface WfProcessTypeMapper extends BaseMapper<WfProcessType>{
|
||||
//分页列表
|
||||
IPage<WfProcessTypeVo> pageList(IPage<WfProcessTypeQuery> page,@Param(Constants.WRAPPER) Wrapper<WfProcessTypeVo> qw);
|
||||
// 不分页列表
|
||||
List<WfProcessTypeVo> list(@Param(Constants.WRAPPER) Wrapper<WfProcessTypeVo> qw);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?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.workflow.biz.processtype.WfProcessTypeMapper">
|
||||
<select id="pageList" resultType="com.yxt.workflow.api.processtype.WfProcessTypeVo">
|
||||
select sid,processTypeName,sortNo from wf_processtype
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
<select id="list" resultType="com.yxt.workflow.api.processtype.WfProcessTypeVo">
|
||||
select sid,processTypeName,sortNo from wf_processtype
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.yxt.workflow.biz.processtype;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.base.utils.PagerUtil;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.workflow.api.processaction.WfProcessActionQuery;
|
||||
import com.yxt.workflow.api.processaction.WfProcessActionVo;
|
||||
import com.yxt.workflow.api.processtype.WfProcessType;
|
||||
import com.yxt.workflow.api.processtype.WfProcessTypeQuery;
|
||||
import com.yxt.workflow.api.processtype.WfProcessTypeVo;
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/15 18:21
|
||||
* @description
|
||||
*/
|
||||
@Service
|
||||
public class WfProcessTypeService extends MybatisBaseService<WfProcessTypeMapper,WfProcessType>{
|
||||
// 分页列表
|
||||
public IPage<WfProcessTypeVo> pageList(PagerQuery<WfProcessTypeQuery> pagerQuery) {
|
||||
// mybits所用的分页对对象
|
||||
IPage<WfProcessTypeQuery> page = PagerUtil.queryToPage(pagerQuery);
|
||||
// mybits所用的查询条件封装类
|
||||
QueryWrapper<WfProcessTypeVo> qw = buildQueryWrapper(pagerQuery.getParams());
|
||||
return baseMapper.pageList(page, qw);
|
||||
}
|
||||
// 不分页列表
|
||||
public List<WfProcessTypeVo> list(WfProcessTypeQuery query) {
|
||||
|
||||
// mybits所用的查询条件封装类
|
||||
QueryWrapper<WfProcessTypeVo> qw = buildQueryWrapper(query);
|
||||
return baseMapper.list(qw);
|
||||
}
|
||||
/**
|
||||
* 解析和组装查询条件,封装在qw中
|
||||
* @param pagerQuery
|
||||
* @return
|
||||
*/
|
||||
private QueryWrapper<WfProcessTypeVo> buildQueryWrapper(WfProcessTypeQuery query)
|
||||
{
|
||||
QueryWrapper<WfProcessTypeVo> qw = new QueryWrapper<>();
|
||||
if (query != null) {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(query.getProcessTypeName()))
|
||||
qw.like("processTypeName", query.getProcessTypeName());
|
||||
qw.eq("isDelete",0);
|
||||
|
||||
qw.orderByAsc("sortNo");
|
||||
}
|
||||
|
||||
return qw;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
package com.yxt.workflow.biz.task;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
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 com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.workflow.api.task.WfTask;
|
||||
import com.yxt.workflow.api.task.WfTaskApi;
|
||||
import com.yxt.workflow.api.task.WfTaskDto;
|
||||
import com.yxt.workflow.api.task.WfTaskQuery;
|
||||
import com.yxt.workflow.api.task.WfTaskVo;
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/15 18:36
|
||||
* @description 任务
|
||||
*/
|
||||
//@Controller
|
||||
@RequestMapping("v1/wftasks")
|
||||
@Api(tags = "流程任务管理")
|
||||
public class WfTaskApiImpl implements WfTaskApi{
|
||||
@Autowired
|
||||
private WfTaskService service;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param WfTaskDto 角色dto对象
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean save(WfTaskDto dto)
|
||||
{
|
||||
ResultBean<String> resultBean=ResultBean.fireFail();
|
||||
WfTask task=new WfTask();
|
||||
dto.fillEntity(task);
|
||||
if(!service.save(task))
|
||||
return resultBean;
|
||||
return resultBean.success().setData(task.getSid());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean update(@Valid WfTaskDto dto, String sid)
|
||||
throws Exception {
|
||||
WfTask order=service.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return ResultBean.fireFail().setMsg("该流程实例不存在");
|
||||
|
||||
if(0==service.updateBySid(dto.toMap(), sid))
|
||||
return ResultBean.fireFail().setMsg("更新失败");
|
||||
return ResultBean.fireSuccess().setMsg("更新成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean delete(String sid)
|
||||
{
|
||||
WfTask order=service.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return ResultBean.fireFail().setMsg("该流程实例不存在");
|
||||
if(0==service.deleteBySid(sid))
|
||||
return ResultBean.fireFail();
|
||||
return ResultBean.fireSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
*
|
||||
* @param pagerQuery 查询条件
|
||||
* @return 分页列表
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<PagerVo<WfTaskVo>> pageList(
|
||||
PagerQuery<WfTaskQuery> pagerQuery) {
|
||||
ResultBean<PagerVo<WfTaskVo>> rb = ResultBean.fireFail();
|
||||
|
||||
IPage<WfTaskVo> page = service.pageList(pagerQuery);
|
||||
//把Ipage转换为PageVo
|
||||
PagerVo<WfTaskVo> pv_result = PagerUtil.pageToVo(page, null);
|
||||
|
||||
return rb.success().setData(pv_result);
|
||||
}
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param sid
|
||||
* @return 详情
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<WfTaskVo> getVo(String sid)
|
||||
{
|
||||
ResultBean<WfTaskVo> resultBean=ResultBean.fireFail();
|
||||
WfTask order=service.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return resultBean;
|
||||
WfTaskVo WfTaskVo=new WfTaskVo();
|
||||
WfTaskVo.fromEntity(order);
|
||||
return new ResultBean().success().setData(WfTaskVo);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean<List<WfTaskVo>> list(WfTaskQuery query) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.yxt.workflow.biz.task;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.yxt.workflow.api.task.*;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.yxt.workflow.api.histtask.WfHistTaskVo;
|
||||
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/16 09:43
|
||||
* @description
|
||||
*/
|
||||
@Mapper
|
||||
public interface WfTaskMapper extends BaseMapper<WfTask>{
|
||||
//待办分页列表
|
||||
IPage<WfTaskVo> pageList(IPage<WfTaskQuery> page,@Param(Constants.WRAPPER) Wrapper<WfTaskVo> qw);
|
||||
// 待阅、待办数量
|
||||
List<WfTaskCountVo> getTaskCounts(@Param(Constants.WRAPPER) Wrapper<WfTaskCountVo> qw);
|
||||
//不分页列表(待阅记录)
|
||||
List<WfHistTaskVo> unReadList(@Param(Constants.WRAPPER) Wrapper<WfHistTaskVo> qw);
|
||||
|
||||
//菜单栏待办数量
|
||||
List<WfMenuTaskCountVo> getMenuTaskCounts(@Param(Constants.WRAPPER)Wrapper<WfMenuTaskCountVo> qw );
|
||||
|
||||
//======= LYM 添加开始 =============
|
||||
//查询是否单位管理员
|
||||
Integer getfindBySid(@Param("userSid") String uesrSid);
|
||||
|
||||
//======= LYM 添加结束 =============
|
||||
|
||||
//管理员彻底删除公文 2021.09.10
|
||||
Integer taskdeletesdmin(@Param("orderSid") String orderSid);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
<?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.workflow.biz.task.WfTaskMapper">
|
||||
|
||||
<select id="pageList" resultType="com.yxt.workflow.api.task.WfTaskVo">
|
||||
SELECT t.sid AS taskSid,
|
||||
t.orderSid,
|
||||
t.nodeSid,
|
||||
p.sid AS processSid,
|
||||
p.processName,
|
||||
p.instanceUrl2,
|
||||
p.instanceUrl3,
|
||||
o.title,
|
||||
o.createDeptName,
|
||||
o.createrName,
|
||||
t.createTime,
|
||||
o.imperativeGrade,
|
||||
t.taskName,
|
||||
t.preTaskSid,
|
||||
t.createBySid AS actorSid,
|
||||
o.formSid,o.createBySid
|
||||
FROM wf_task t
|
||||
JOIN wf_process p ON t.processSid = p.sid
|
||||
JOIN wf_hist_order o ON t.orderSid = o.sid
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
<select id="unReadList" resultType="com.yxt.workflow.api.histtask.WfHistTaskVo">
|
||||
SELECT sid,
|
||||
operName,
|
||||
operPost,
|
||||
taskName,
|
||||
createTime,
|
||||
taskType
|
||||
FROM wf_task ${ew.customSqlSegment}
|
||||
</select>
|
||||
<select id="getTaskCounts" resultType="com.yxt.workflow.api.task.WfTaskCountVo">
|
||||
SELECT t.taskType, COUNT(t.id) AS count
|
||||
FROM wf_task t
|
||||
JOIN wf_process p ON t.processSid = p.sid
|
||||
JOIN wf_processType pt ON pt.sid = p.processTypeSid
|
||||
JOIN wf_hist_order o ON t.orderSid = o.sid
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
<select id="getMenuTaskCounts" resultType="com.yxt.workflow.api.task.WfMenuTaskCountVo">
|
||||
SELECT t.taskType,COUNT(t.id) AS count
|
||||
FROM wf_task t
|
||||
JOIN wf_process p ON t.processSid = p.sid
|
||||
JOIN wf_processType pt ON pt.sid = p.processTypeSid
|
||||
JOIN wf_hist_order o ON t.orderSid = o.sid
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
<select id="getfindBySid" resultType="java.lang.Integer">
|
||||
SELECT isAdmin
|
||||
FROM jlzx_system.user
|
||||
WHERE sid = #{userSid} and isDelete=0
|
||||
</select>
|
||||
|
||||
<delete id="taskdeletesdmin">
|
||||
delete from wf_task where orderSid = #{orderSid}
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,444 @@
|
||||
package com.yxt.workflow.biz.task;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.yxt.workflow.api.task.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.base.utils.PagerUtil;
|
||||
import com.yxt.common.base.utils.StringUtils;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.workflow.api.histtask.WfHistTask;
|
||||
import com.yxt.workflow.api.histtask.WfHistTaskRecordQuery;
|
||||
import com.yxt.workflow.api.histtask.WfHistTaskVo;
|
||||
import com.yxt.workflow.api.order.WfOrderFormsDto;
|
||||
import com.yxt.workflow.api.order.WfOrderTaskDto;
|
||||
import com.yxt.workflow.api.taskactor.WfTaskActor;
|
||||
import com.yxt.workflow.biz.histtask.WfHistTaskService;
|
||||
import com.yxt.workflow.biz.order.WfOrderService;
|
||||
import com.yxt.workflow.biz.taskactor.WfTaskActorService;
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/09 17:16
|
||||
* @description
|
||||
*/
|
||||
@Service
|
||||
public class WfTaskService extends MybatisBaseService<WfTaskMapper, WfTask> {
|
||||
@Autowired
|
||||
private WfHistTaskService wfHistTaskService;
|
||||
|
||||
@Autowired
|
||||
private WfTaskActorService wfTaskActorService;
|
||||
@Autowired
|
||||
private WfOrderService wfOrderService;
|
||||
//待办列表
|
||||
public IPage<WfTaskVo> pageList(PagerQuery<WfTaskQuery> pagerQuery) {
|
||||
IPage<WfTaskQuery> page = PagerUtil.queryToPage(pagerQuery);
|
||||
QueryWrapper<WfTaskVo> qw = buildQueryWrapper(pagerQuery.getParams());
|
||||
|
||||
return baseMapper.pageList(page, qw);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//待办任务列表查询条件
|
||||
private QueryWrapper<WfTaskVo> buildQueryWrapper(
|
||||
WfTaskQuery query) {
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
QueryWrapper<WfTaskVo> qw = new QueryWrapper<>();
|
||||
if (query != null) {
|
||||
if (StringUtils.isNotBlank(query.getProcessSid()))
|
||||
qw.eq("p.sid", query.getProcessSid());
|
||||
|
||||
if (query.getTitle() != null
|
||||
&& org.apache.commons.lang3.StringUtils
|
||||
.isNotBlank(query.getTitle()))
|
||||
qw.like("o.title", query.getTitle());
|
||||
if (query.getActorSid() != null
|
||||
&& org.apache.commons.lang3.StringUtils
|
||||
.isNotBlank(query.getActorSid()))
|
||||
qw.eq("t.createBySid", query.getActorSid());
|
||||
|
||||
if (query.getCreateEndTime() != null) {
|
||||
Date date=query.getCreateEndTime();
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.setTime(date);
|
||||
c.add(Calendar.DAY_OF_MONTH, 1);//利用Calendar 实现 Date日期+1天
|
||||
|
||||
date = c.getTime();
|
||||
String createEndTime = formatter.format(date);
|
||||
qw.lt("t.createTime",createEndTime);
|
||||
}
|
||||
|
||||
if (query.getCreateStartTime() != null) {
|
||||
Date date=query.getCreateStartTime();
|
||||
String createStartTime = formatter.format(date);
|
||||
qw.gt("t.createTime", createStartTime);
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getProcessTypeSid())) {
|
||||
qw.eq("p.processTypeSid", query.getProcessTypeSid());
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getTaskType())) {
|
||||
qw.eq("t.taskType", query.getTaskType());
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getImperativeGrade())) {
|
||||
qw.eq("o.imperativeGrade", query.getImperativeGrade());
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getProcessTypeSid())) {
|
||||
qw.like("o.createrName", query.getCreaterName());
|
||||
}
|
||||
qw.eq("o.isDelete", 0);
|
||||
qw.orderByDesc("t.createTime");
|
||||
}
|
||||
|
||||
return qw;
|
||||
|
||||
}
|
||||
// 不分页列表---待阅列表
|
||||
public List<WfHistTaskVo> unReadList(WfHistTaskRecordQuery query) {
|
||||
|
||||
QueryWrapper<WfHistTaskVo> qw = buildQueryWrapper(query);
|
||||
return baseMapper.unReadList(qw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 不分页待阅列表构造条件
|
||||
*
|
||||
* @param pagerQuery
|
||||
* @return
|
||||
*/
|
||||
private QueryWrapper<WfHistTaskVo> buildQueryWrapper(
|
||||
WfHistTaskRecordQuery query) {
|
||||
QueryWrapper<WfHistTaskVo> qw = new QueryWrapper<>();
|
||||
if (query != null) {
|
||||
if (query.getOrderSid() != null
|
||||
&& org.apache.commons.lang3.StringUtils
|
||||
.isNotBlank(query.getOrderSid()))
|
||||
qw.eq("orderSid", query.getOrderSid());
|
||||
if (query.getTaskName() != null
|
||||
&& org.apache.commons.lang3.StringUtils
|
||||
.isNotBlank(query.getTaskName()))
|
||||
qw.eq("taskName", query.getTaskName());
|
||||
if (query.getTaskType() != null
|
||||
&& org.apache.commons.lang3.StringUtils
|
||||
.isNotBlank(query.getTaskType()))
|
||||
qw.eq("taskType", query.getTaskType());
|
||||
qw.orderByAsc("createTime");
|
||||
}
|
||||
|
||||
return qw;
|
||||
|
||||
}
|
||||
|
||||
|
||||
//待办和待阅数量
|
||||
public List<WfTaskCountVo> getTaskCounts(WfTaskCountQuery query) {
|
||||
|
||||
QueryWrapper<WfTaskCountVo> qw = buildTaskCountQueryWrapper(query);
|
||||
List<WfTaskCountVo> test = baseMapper.getTaskCounts(qw);
|
||||
return baseMapper.getTaskCounts(qw);
|
||||
}
|
||||
|
||||
//获取菜单栏中的待办数量
|
||||
public List<WfMenuTaskCountVo> getMenuTaskCounts(WfMenuTaskCountQuery query){
|
||||
QueryWrapper<WfMenuTaskCountVo> qw = buildMenuTaskCountQueryWrapper(query);
|
||||
String i = "可以返回";
|
||||
List<WfMenuTaskCountVo> test = baseMapper.getMenuTaskCounts(qw);
|
||||
|
||||
return test;
|
||||
}
|
||||
|
||||
//获取菜单栏中待办数量查询条件
|
||||
private QueryWrapper<WfMenuTaskCountVo> buildMenuTaskCountQueryWrapper(
|
||||
WfMenuTaskCountQuery query){
|
||||
QueryWrapper<WfMenuTaskCountVo> qw = new QueryWrapper<>();
|
||||
if(query != null){
|
||||
if(query.getActorSid() != null && org.apache.commons.lang3.StringUtils.isNotBlank(query.getActorSid())){
|
||||
qw.eq("t.createBySid",query.getActorSid());
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getProcessTypeSid())) {
|
||||
qw.eq("p.processTypeSid", query.getProcessTypeSid());
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getTaskType())) {
|
||||
qw.eq("t.taskType", query.getTaskType());
|
||||
}
|
||||
qw.eq("o.isDelete", 0);
|
||||
|
||||
qw.groupBy("t.taskType");
|
||||
qw.orderByAsc("t.taskType");
|
||||
|
||||
}
|
||||
return qw;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//待办和待阅数量查询条件
|
||||
private QueryWrapper<WfTaskCountVo> buildTaskCountQueryWrapper(
|
||||
WfTaskCountQuery query) {
|
||||
QueryWrapper<WfTaskCountVo> qw = new QueryWrapper<>();
|
||||
if (query != null) {
|
||||
|
||||
if (query.getActorSid() != null
|
||||
&& org.apache.commons.lang3.StringUtils
|
||||
.isNotBlank(query.getActorSid()))
|
||||
qw.eq("t.createBySid", query.getActorSid());
|
||||
|
||||
if (StringUtils.isNotBlank(query.getProcessTypeSid())) {
|
||||
qw.eq("p.processTypeSid", query.getProcessTypeSid());
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getTaskType())) {
|
||||
qw.eq("t.taskType", query.getTaskType());
|
||||
}
|
||||
qw.eq("o.isDelete", 0);
|
||||
|
||||
qw.groupBy("t.taskType");
|
||||
qw.orderByAsc("t.taskType");
|
||||
}
|
||||
return qw;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 创建第一个任务
|
||||
*
|
||||
* @param newTask
|
||||
* @return
|
||||
*/
|
||||
/*public boolean createFirstTask(WfTask newTask) {
|
||||
if (null == newTask)
|
||||
return false;
|
||||
saveTask(newTask);
|
||||
return true;
|
||||
}*/
|
||||
|
||||
/**
|
||||
* 生成新任务(非第一个任务)
|
||||
*
|
||||
* @param newTask
|
||||
* @return
|
||||
*/
|
||||
public boolean createTask(WfTask newTask,WfHistTask histTask) {
|
||||
if (null == newTask)
|
||||
return false;
|
||||
//如果某一个子任务已经提交,则其他子任务不再生成新任务
|
||||
boolean isExistChildFinish=false;
|
||||
if(StringUtils.isNotBlank(histTask.getPreTaskSid()))
|
||||
{
|
||||
Map<String,Object> map=new HashMap<>();
|
||||
map.put("preTaskSid", histTask.getPreTaskSid());
|
||||
List<WfHistTask> list=wfHistTaskService.listByMap(map);
|
||||
if(list!=null && list.size()>0)
|
||||
isExistChildFinish= true;
|
||||
}
|
||||
|
||||
moveTask(histTask);
|
||||
|
||||
if(!isExistChildFinish)
|
||||
{
|
||||
saveTask(newTask);
|
||||
String updateBySid=histTask.getCreateBySid();
|
||||
if(histTask.getActionName().equals("撤回"))
|
||||
updateBySid=newTask.getCreateBySid();
|
||||
updateOrderFormInfo(newTask.getOrderSid(),
|
||||
updateBySid, newTask.getSid(),
|
||||
newTask.getTaskName());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
// 修改wf_order表中的字段:上次更新人和wf_hist_order中lastTaskSid
|
||||
private boolean updateOrderFormInfo(String orderSid, String updateBySid,
|
||||
String lastTaskSid, String lastTaskName) {
|
||||
|
||||
WfOrderTaskDto formsDto = new WfOrderTaskDto();
|
||||
formsDto.setSid(orderSid);
|
||||
formsDto.setUpdateBySid(updateBySid);
|
||||
formsDto.setLastTaskSid(lastTaskSid);
|
||||
formsDto.setLastTaskName(lastTaskName);
|
||||
return wfOrderService.updateOrderTaskInfo(formsDto);
|
||||
}
|
||||
/**
|
||||
* 批量生成新任务(非第一个任务)
|
||||
*
|
||||
* @param newTask
|
||||
* @return
|
||||
*/
|
||||
public boolean createBatchTask(List<WfTaskOpers> opers,WfTask task) {
|
||||
if (null == task || null==opers)
|
||||
return false;
|
||||
|
||||
|
||||
//循环usersids,每一个用户生成一个任务
|
||||
|
||||
for(int i=0;i<opers.size();i++)
|
||||
{
|
||||
WfTask newTask = new WfTask();
|
||||
String newTaskSid=newTask.getSid();
|
||||
BeanUtil.copyProperties(task, newTask);
|
||||
|
||||
newTask.setSid(newTaskSid);
|
||||
newTask.setCreateBySid(opers.get(i).getCreateBySid());
|
||||
newTask.setOperName(opers.get(i).getOperName());
|
||||
//newTask.setOperPost(opers.get(i).getOperPost());
|
||||
newTask.setOperDeptName(opers.get(i).getOperDeptName());
|
||||
|
||||
saveTask(newTask);
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 结束任务
|
||||
*
|
||||
* @param task
|
||||
* @return
|
||||
*/
|
||||
public boolean finishTask(WfHistTask histTask) {
|
||||
//WfHistTask histTask=new WfHistTask();
|
||||
//BeanUtil.copyProperties(task, histTask);
|
||||
//histTask.setOperOpinion(operOpinion);
|
||||
return moveTask(histTask);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 迁移任务,把task表中的记录迁移到histtask中,然后删除task表中记录
|
||||
*
|
||||
* @param oldTask
|
||||
* @return
|
||||
*/
|
||||
public boolean moveTask(WfHistTask histTask) {
|
||||
|
||||
if (null == histTask)
|
||||
return false;
|
||||
|
||||
|
||||
wfHistTaskService.saveHistTask(histTask);
|
||||
deleteTask(histTask.getSid());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 鑾峰彇浠诲姟鍙婁换鍔″弬涓庤<E6B693>呭垪琛<E59EAA>
|
||||
*
|
||||
* @param sid
|
||||
* @return
|
||||
*/
|
||||
/*
|
||||
* private WfTask fetchTaskBySid(String sid) { WfTask
|
||||
* task=this.fetchBySid(sid); Map<String,Object> map=new HashMap<>();
|
||||
* map.put("taskSid", task.getSid()); List<WfTaskActor>
|
||||
* list_actors=wfTaskActorService.listByMap(map);
|
||||
*
|
||||
* task.listActors=list_actors;
|
||||
*
|
||||
*
|
||||
* return task; }
|
||||
*/
|
||||
|
||||
/**
|
||||
* 保存任务和任务参与者
|
||||
*
|
||||
* @param newTask
|
||||
* @return
|
||||
*/
|
||||
public boolean saveTask(WfTask newTask) {
|
||||
//先判断当前流程实例中当前用户是否已经有当前nodesid的task记录,如果存在则不再新增。
|
||||
Map<String,Object> map=new HashMap<>();
|
||||
map.put("orderSid", newTask.getOrderSid());
|
||||
map.put("nodeSid", newTask.getNodeSid());
|
||||
map.put("createBySid", newTask.getCreateBySid());
|
||||
map.put("taskType", "0");
|
||||
List<WfTask> list=baseMapper.selectByMap(map);
|
||||
if(list!=null && list.size()>0)
|
||||
return true;
|
||||
|
||||
|
||||
|
||||
//保存任务
|
||||
save(newTask);
|
||||
// 保存任务参与者
|
||||
|
||||
// wfTaskActorService.saveBatch(newTask.listActors);
|
||||
WfTaskActor taskActor = new WfTaskActor();
|
||||
taskActor.setActorSid(newTask.getCreateBySid());
|
||||
taskActor.setTaskSid(newTask.getSid());
|
||||
taskActor.setOrderSid(newTask.getOrderSid());
|
||||
wfTaskActorService.save(taskActor);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除任务和任务参与者
|
||||
*
|
||||
* @param taskSid
|
||||
* @return
|
||||
*/
|
||||
private boolean deleteTask(String taskSid) {
|
||||
this.deleteBySid(taskSid);
|
||||
wfTaskActorService.deleteByTaskSid(taskSid);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 生成传阅任务,在task中按照传阅的人数,每一个人生成一个新任务
|
||||
* 参与者阅读后,把task和actors中的记录迁移到histtask和histactor中
|
||||
* @return
|
||||
*/
|
||||
public void createUnReadTasks(List<WfTaskOpers> opers,WfTask task)
|
||||
{
|
||||
//循环usersids,每一个用户生成一个任务
|
||||
|
||||
for(int i=0;i<opers.size();i++)
|
||||
{
|
||||
WfTask newTask = new WfTask();
|
||||
newTask.setPreTaskSid(task.getSid());
|
||||
newTask.setProcessSid(task.getProcessSid());
|
||||
newTask.setOrderSid(task.getOrderSid());
|
||||
newTask.setNodeSid("");
|
||||
newTask.setTaskName("待阅");
|
||||
newTask.setDisplayName(newTask.getTaskName());
|
||||
newTask.setTaskType(1); //待阅
|
||||
newTask.setPerformType(0);
|
||||
newTask.setCreateBySid(opers.get(i).getCreateBySid());
|
||||
|
||||
newTask.setOperName(opers.get(i).getOperName());
|
||||
newTask.setOperPost(opers.get(i).getOperPost());
|
||||
newTask.setOperDeptName(opers.get(i).getOperDeptName());
|
||||
|
||||
saveTask(newTask);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//======= LYM 添加开始 =============
|
||||
//查询是否是管理员
|
||||
public Integer selectBySid(String uesrSid){
|
||||
return baseMapper.getfindBySid(uesrSid);
|
||||
}
|
||||
//======= LYM 添加结束 =============
|
||||
|
||||
//管理员彻底删除公文 2021.09.10
|
||||
public Integer taskdeleteadmin(String orderSid){
|
||||
return baseMapper.taskdeletesdmin(orderSid);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
package com.yxt.workflow.biz.taskactor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
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 com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.workflow.api.taskactor.WfTaskActor;
|
||||
import com.yxt.workflow.api.taskactor.WfTaskActorApi;
|
||||
import com.yxt.workflow.api.taskactor.WfTaskActorDto;
|
||||
import com.yxt.workflow.api.taskactor.WfTaskActorQuery;
|
||||
import com.yxt.workflow.api.taskactor.WfTaskActorVo;
|
||||
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/15 18:36
|
||||
* @description 任务
|
||||
*/
|
||||
//@Controller
|
||||
@RequestMapping("v1/wftaskactoractors")
|
||||
@Api(tags = "流程任务参与者管理")
|
||||
public class WfTaskActorApiImpl implements WfTaskActorApi{
|
||||
@Autowired
|
||||
private WfTaskActorService service;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param WfTaskActorDto 角色dto对象
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean save(WfTaskActorDto dto)
|
||||
{
|
||||
ResultBean<String> resultBean=ResultBean.fireFail();
|
||||
WfTaskActor task=new WfTaskActor();
|
||||
dto.fillEntity(task);
|
||||
if(!service.save(task))
|
||||
return resultBean;
|
||||
return resultBean.success().setData(task.getSid());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean update(@Valid WfTaskActorDto dto, String sid)
|
||||
throws Exception {
|
||||
WfTaskActor order=service.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return ResultBean.fireFail().setMsg("该流程实例不存在");
|
||||
|
||||
if(0==service.updateBySid(dto.toMap(), sid))
|
||||
return ResultBean.fireFail().setMsg("更新失败");
|
||||
return ResultBean.fireSuccess().setMsg("更新成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean delete(String sid)
|
||||
{
|
||||
WfTaskActor order=service.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return ResultBean.fireFail().setMsg("该流程实例不存在");
|
||||
if(0==service.deleteBySid(sid))
|
||||
return ResultBean.fireFail();
|
||||
return ResultBean.fireSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
*
|
||||
* @param pagerQuery 查询条件
|
||||
* @return 分页列表
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<PagerVo<WfTaskActorVo>> pageList(
|
||||
PagerQuery<WfTaskActorQuery> pagerQuery) {
|
||||
ResultBean<PagerVo<WfTaskActorVo>> rb = ResultBean.fireFail();
|
||||
|
||||
IPage<WfTaskActorVo> page = service.pageList(pagerQuery);
|
||||
//把Ipage转换为PageVo
|
||||
PagerVo<WfTaskActorVo> pv_result = PagerUtil.pageToVo(page, null);
|
||||
|
||||
return rb.success().setData(pv_result);
|
||||
}
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param sid
|
||||
* @return 详情
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<WfTaskActorVo> getVo(String sid)
|
||||
{
|
||||
ResultBean<WfTaskActorVo> resultBean=ResultBean.fireFail();
|
||||
WfTaskActor order=service.fetchBySid(sid);
|
||||
if(null==order)
|
||||
return resultBean;
|
||||
WfTaskActorVo WfTaskActorVo=new WfTaskActorVo();
|
||||
WfTaskActorVo.fromEntity(order);
|
||||
return new ResultBean().success().setData(WfTaskActorVo);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean<List<WfTaskActorVo>> list(WfTaskActorQuery query) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.yxt.workflow.biz.taskactor;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.yxt.workflow.api.taskactor.WfTaskActor;
|
||||
import com.yxt.workflow.api.taskactor.WfTaskActorQuery;
|
||||
import com.yxt.workflow.api.taskactor.WfTaskActorVo;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/19 16:43
|
||||
* @description
|
||||
*/
|
||||
@Mapper
|
||||
public interface WfTaskActorMapper extends BaseMapper<WfTaskActor>{
|
||||
//分页列表
|
||||
IPage<WfTaskActorVo> pageList(IPage<WfTaskActorQuery> page,@Param(Constants.WRAPPER) Wrapper<WfTaskActorVo> qw);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<?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.workflow.biz.taskactor.WfTaskActorMapper">
|
||||
<select id="pageList" resultType="com.yxt.workflow.api.taskactor.WfTaskActorVo">
|
||||
SELECT sid,taskSid,actorSid,orderSid FROM wf_task_actor
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.yxt.workflow.biz.taskactor;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.base.utils.PagerUtil;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.workflow.api.taskactor.WfTaskActor;
|
||||
import com.yxt.workflow.api.taskactor.WfTaskActorQuery;
|
||||
import com.yxt.workflow.api.taskactor.WfTaskActorVo;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/09 17:16
|
||||
* @description
|
||||
*/
|
||||
@Service
|
||||
public class WfTaskActorService extends MybatisBaseService<WfTaskActorMapper,WfTaskActor>{
|
||||
// 鍒嗛〉鍒楄〃
|
||||
public IPage<WfTaskActorVo> pageList(PagerQuery<WfTaskActorQuery> pagerQuery) {
|
||||
// mybits鎵<73>鐢ㄧ殑鍒嗛〉瀵瑰璞<EE87AE>
|
||||
IPage<WfTaskActorQuery> page = PagerUtil.queryToPage(pagerQuery);
|
||||
// mybits鎵<73>鐢ㄧ殑鏌ヨ鏉′欢灏佽绫<EE978A>
|
||||
QueryWrapper<WfTaskActorVo> qw = buildQueryWrapper(pagerQuery.getParams());
|
||||
return baseMapper.pageList(page, qw);
|
||||
}
|
||||
/**
|
||||
* 瑙f瀽鍜岀粍瑁呮煡璇㈡潯浠讹紝灏佽鍦╭w涓<77>
|
||||
* @param pagerQuery
|
||||
* @return
|
||||
*/
|
||||
private QueryWrapper<WfTaskActorVo> buildQueryWrapper(WfTaskActorQuery pagerQuery)
|
||||
{
|
||||
QueryWrapper<WfTaskActorVo> qw = new QueryWrapper<>();
|
||||
if (pagerQuery != null) {
|
||||
if (pagerQuery.getTaskSid()!=null && org.apache.commons.lang3.StringUtils.isNotBlank(pagerQuery.getTaskSid()))
|
||||
qw.eq("taskSid", pagerQuery.getTaskSid());
|
||||
if (pagerQuery.getActorSid()!=null && org.apache.commons.lang3.StringUtils.isNotBlank(pagerQuery.getActorSid()))
|
||||
qw.eq("actorSid", pagerQuery.getActorSid());
|
||||
if (pagerQuery.getOrderSid()!=null && org.apache.commons.lang3.StringUtils.isNotBlank(pagerQuery.getOrderSid()))
|
||||
qw.eq("orderSid", pagerQuery.getOrderSid());
|
||||
qw.orderByAsc("createTime");
|
||||
}
|
||||
|
||||
return qw;
|
||||
|
||||
}
|
||||
|
||||
public void deleteByTaskSid(String taskSid)
|
||||
{
|
||||
Map<String,Object> map=new HashMap<>();
|
||||
map.put("taskSid", taskSid);
|
||||
List<WfTaskActor> list_actors=listByMap(map);
|
||||
for(int i=0;i<list_actors.size();i++)
|
||||
deleteBySid(list_actors.get(i).getSid());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,503 @@
|
||||
package com.yxt.workflow.biz.wfmanager;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import com.yxt.jlzx.system.api.user.UserApi;
|
||||
import com.yxt.jlzx.system.api.user.UserInfoVo;
|
||||
import com.yxt.workflow.api.task.*;
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.workflow.api.histtask.WfHistTaskDidVo;
|
||||
import com.yxt.workflow.api.histtask.WfHistTaskQuery;
|
||||
import com.yxt.workflow.api.histtask.WfHistTaskRecordQuery;
|
||||
import com.yxt.workflow.api.histtask.WfHistTaskVo;
|
||||
import com.yxt.workflow.api.order.WfOrder;
|
||||
import com.yxt.workflow.api.order.WfOrderDto;
|
||||
import com.yxt.workflow.api.order.WfOrderFormsDto;
|
||||
import com.yxt.workflow.api.process.WfProcess;
|
||||
import com.yxt.workflow.api.process.WfProcessQuery;
|
||||
import com.yxt.workflow.api.processaction.WfProcessActionExtraVo;
|
||||
import com.yxt.workflow.api.processnode.WfProcessNode;
|
||||
import com.yxt.workflow.api.processnode.WfProcessNodeVo;
|
||||
import com.yxt.workflow.api.processtype.WfProcessTypeQuery;
|
||||
import com.yxt.workflow.api.processtype.WfProcessTypeVo;
|
||||
import com.yxt.workflow.api.wfmanger.WfMBackTaskDto;
|
||||
import com.yxt.workflow.api.wfmanger.WfMRecallTaskDto;
|
||||
import com.yxt.workflow.api.wfmanger.WfMSimpleTaskDto;
|
||||
import com.yxt.workflow.api.wfmanger.WfMTaskDto;
|
||||
import com.yxt.workflow.api.wfmanger.WfManagerApi;
|
||||
import com.yxt.workflow.api.wfmanger.WfProcessNodeActionsVo;
|
||||
import com.yxt.workflow.api.wfmanger.WfProcessTreeVo;
|
||||
import com.yxt.workflow.api.wfmanger.WfReadTaskDto;
|
||||
import com.yxt.workflow.biz.histtask.WfHistTaskService;
|
||||
import com.yxt.workflow.biz.order.WfOrderService;
|
||||
import com.yxt.workflow.biz.process.WfProcessService;
|
||||
import com.yxt.workflow.biz.processnode.WfProcessNodeService;
|
||||
import com.yxt.workflow.biz.processtype.WfProcessTypeService;
|
||||
import com.yxt.workflow.biz.task.WfTaskService;
|
||||
|
||||
/**
|
||||
* @author yxt_mtl
|
||||
* @date 2020/10/20 14:36
|
||||
* @description 流程管理器
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("v1/wfmanager")
|
||||
@Api(tags = "流程管理器")
|
||||
public class WfManagerApiImpl implements WfManagerApi {
|
||||
@Autowired
|
||||
private WfManagerService managerService;
|
||||
@Autowired
|
||||
private WfTaskService taskService;
|
||||
@Autowired
|
||||
private WfHistTaskService histTaskService;
|
||||
@Autowired
|
||||
private WfOrderService wfOrderService;
|
||||
@Autowired
|
||||
private WfProcessService wfProcessService;
|
||||
@Autowired
|
||||
private WfProcessNodeService wfProcessNodeService;
|
||||
@Autowired
|
||||
private WfProcessTypeService wfProcessTypeService;
|
||||
@Autowired
|
||||
private UserApi userApi;
|
||||
|
||||
|
||||
/**
|
||||
* 启动流程。
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<WfTaskVo> startProcess(WfOrderDto dto) {
|
||||
ResultBean<WfTaskVo> resultBean = ResultBean.fireFail();
|
||||
if(dto==null)
|
||||
return resultBean.setData(null);
|
||||
WfOrder order = new WfOrder();
|
||||
dto.fillEntity(order);
|
||||
WfTaskVo vo=managerService.startProcess(order);
|
||||
if(null==vo)
|
||||
return resultBean.setData(null);
|
||||
return resultBean.success().setData(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行流程
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ResultBean runProcess(WfMTaskDto dto) {
|
||||
ResultBean resultBean = ResultBean.fireFail();
|
||||
if(dto==null)
|
||||
return resultBean.setData(null);
|
||||
if(StringUtils.isNoneBlank(dto.getNextUserSid()) && !dto.getNextUserSid().equals("-1"))
|
||||
{
|
||||
if (!managerService.runProcess(dto))
|
||||
return resultBean.setData(null);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!managerService.runBatchProcess(dto))
|
||||
return resultBean.setData(null);
|
||||
}
|
||||
return resultBean.success();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 结束流程
|
||||
*
|
||||
* @param taskSid
|
||||
* 任务sid
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ResultBean endProcess(WfMSimpleTaskDto dto) {
|
||||
ResultBean resultBean = ResultBean.fireFail();
|
||||
if(dto==null)
|
||||
return resultBean.setData(null);
|
||||
if (!managerService.endProcess(dto))
|
||||
return resultBean.setData(null);
|
||||
return resultBean.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 退回流程
|
||||
*
|
||||
* @param WfMTaskDto
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<String> backProcess(WfMBackTaskDto dto) {
|
||||
ResultBean<String> resultBean = ResultBean.fireFail();
|
||||
if(dto==null)
|
||||
return resultBean.setData(null);
|
||||
String nextUserSid=managerService.backProcess(dto);
|
||||
if (nextUserSid.equals(""))
|
||||
return resultBean.setData("");
|
||||
return resultBean.setData(nextUserSid).success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤回流程
|
||||
*
|
||||
* @param taskSid
|
||||
* 任务sid
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ResultBean recallProcess(WfMRecallTaskDto dto) {
|
||||
ResultBean resultBean = ResultBean.fireFail();
|
||||
if(dto==null)
|
||||
return resultBean.setData(null);
|
||||
if (!managerService.recallProcess(dto))
|
||||
return resultBean.setData(null);
|
||||
return resultBean.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 阅读(task迁移到histTask中)
|
||||
* @param WfMTaskDto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ResultBean readTask(WfReadTaskDto dto) {
|
||||
ResultBean resultBean = ResultBean.fireFail();
|
||||
if(dto==null)
|
||||
return resultBean.setData(null);
|
||||
if (!managerService.readTask(dto))
|
||||
return resultBean.setData(null);
|
||||
return resultBean.success();
|
||||
}
|
||||
/**
|
||||
* 更新流程实例中表单的数据(标题和紧急程度)
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
public ResultBean updateMfOrderForms(WfOrderFormsDto dto) {
|
||||
ResultBean resultBean = ResultBean.fireFail();
|
||||
if(dto==null)
|
||||
return resultBean.setData(null);
|
||||
if (!wfOrderService.updateOrderFormInfo(dto))
|
||||
return resultBean;
|
||||
return resultBean.success();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 待办工作列表
|
||||
*
|
||||
* @param pagerQuery
|
||||
* 查询条件
|
||||
* @return 待办工作列表
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<PagerVo<WfTaskVo>> webTaskPageList(PagerQuery<WfTaskQuery> pagerQuery) {
|
||||
ResultBean<PagerVo<WfTaskVo>> rb = ResultBean.fireFail();
|
||||
//如果是管理员账号,则ActorSid字段允许为空 2021.09.09
|
||||
if(null==pagerQuery || null==pagerQuery.getParams().getActorSid() || org.apache.commons.lang3.StringUtils
|
||||
.isBlank(pagerQuery.getParams().getActorSid()))
|
||||
if(null==pagerQuery)
|
||||
return rb.setData(null);
|
||||
IPage<WfTaskVo> page = taskService.pageList(pagerQuery);
|
||||
|
||||
// 把Ipage转换为PageVo
|
||||
PagerVo<WfTaskVo> pv_result = PagerUtil.pageToVo(page, null);
|
||||
return rb.success().setData(pv_result);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 已办工作列表
|
||||
*
|
||||
* @param pagerQuery
|
||||
* 查询条件
|
||||
* @return 已办工作列表
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<PagerVo<WfHistTaskDidVo>> histTaskPageList(PagerQuery<WfHistTaskQuery> pagerQuery) {
|
||||
ResultBean<PagerVo<WfHistTaskDidVo>> rb = ResultBean.fireFail();
|
||||
if(null==pagerQuery || null==pagerQuery.getParams().getActorSid() || org.apache.commons.lang3.StringUtils
|
||||
.isBlank(pagerQuery.getParams().getActorSid()))
|
||||
return rb.setData(null);
|
||||
|
||||
|
||||
//======添加开始 ========
|
||||
//查询登录账号是否为单位管理员
|
||||
UserInfoVo vo = userApi.fetchUserInfoBysid(pagerQuery.getParams().getActorSid()).getData();
|
||||
// Integer isAdmin = taskService.selectBySid(pagerQuery.getParams().getActorSid());
|
||||
Integer isAdmin = vo.getIsAdmin();
|
||||
|
||||
//如果是则将参与用户赋值为null
|
||||
if( isAdmin == 1 && pagerQuery.getParams().getState().equals("0") && pagerQuery.getParams().getTaskType().equals("0")){
|
||||
pagerQuery.getParams().setActorSid(null);
|
||||
}
|
||||
//======添加结束========
|
||||
|
||||
IPage<WfHistTaskDidVo> page = histTaskService.pageList(pagerQuery);
|
||||
// 把Ipage转换为PageVo
|
||||
PagerVo<WfHistTaskDidVo> pv_result = PagerUtil.pageToVo(page, null);
|
||||
|
||||
return rb.success().setData(pv_result);
|
||||
}
|
||||
/**
|
||||
* 共文库查看
|
||||
*
|
||||
* @param pagerQuery
|
||||
* 查询条件
|
||||
* @return 共文库查看
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<PagerVo<WfHistTaskDidVo>> histTaskGongWenPageList(PagerQuery<WfHistTaskQuery> pagerQuery) {
|
||||
ResultBean<PagerVo<WfHistTaskDidVo>> rb = ResultBean.fireFail();
|
||||
|
||||
//查询登录账号是否为单位管理员
|
||||
Integer isAdmin = taskService.selectBySid(pagerQuery.getParams().getActorSid());
|
||||
|
||||
//如果是则将参与用户赋值为null
|
||||
if( isAdmin == 1){
|
||||
pagerQuery.getParams().setActorSid(null);
|
||||
}
|
||||
|
||||
IPage<WfHistTaskDidVo> page = histTaskService.pageList(pagerQuery);
|
||||
// 把Ipage转换为PageVo
|
||||
PagerVo<WfHistTaskDidVo> pv_result = PagerUtil.pageToVo(page, null);
|
||||
|
||||
return rb.success().setData(pv_result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员查看所有的已办公文 2021.09.09
|
||||
* @param pagerQuery
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<PagerVo<WfHistTaskDidVo>> histviewyibangongwen(PagerQuery<WfHistTaskQuery> pagerQuery) {
|
||||
ResultBean<PagerVo<WfHistTaskDidVo>> rb = ResultBean.fireFail();
|
||||
|
||||
//查询登录账号是否为单位管理员
|
||||
Integer isAdmin = taskService.selectBySid(pagerQuery.getParams().getActorSid());
|
||||
|
||||
//如果是则将参与用户赋值为null
|
||||
if( isAdmin == 1){
|
||||
pagerQuery.getParams().setActorSid(null);
|
||||
}
|
||||
|
||||
IPage<WfHistTaskDidVo> page = histTaskService.pageList2(pagerQuery);
|
||||
// 把Ipage转换为PageVo
|
||||
PagerVo<WfHistTaskDidVo> pv_result = PagerUtil.pageToVo(page, null);
|
||||
|
||||
return rb.success().setData(pv_result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员查看所有的公文 2021.09.09
|
||||
* @param pagerQuery
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<PagerVo<WfHistTaskDidVo>> histviewallgongwen(PagerQuery<WfHistTaskQuery> pagerQuery) {
|
||||
ResultBean<PagerVo<WfHistTaskDidVo>> rb = ResultBean.fireFail();
|
||||
|
||||
//查询登录账号是否为单位管理员
|
||||
Integer isAdmin = taskService.selectBySid(pagerQuery.getParams().getActorSid());
|
||||
|
||||
//如果是则将参与用户赋值为null
|
||||
if( isAdmin == 1){
|
||||
pagerQuery.getParams().setActorSid(null);
|
||||
}
|
||||
|
||||
IPage<WfHistTaskDidVo> page = histTaskService.pageList1(pagerQuery);
|
||||
// 把Ipage转换为PageVo
|
||||
PagerVo<WfHistTaskDidVo> pv_result = PagerUtil.pageToVo(page, null);
|
||||
|
||||
return rb.success().setData(pv_result);
|
||||
}
|
||||
|
||||
/*
|
||||
* 查询所有的公文列表 2021.09.10
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<PagerVo<WfHistTaskDidVo>> viewallgongwen(PagerQuery<WfHistTaskQuery> pagerQuery) {
|
||||
ResultBean<PagerVo<WfHistTaskDidVo>> rb = ResultBean.fireFail();
|
||||
|
||||
//查询登录账号是否为单位管理员
|
||||
Integer isAdmin = taskService.selectBySid(pagerQuery.getParams().getActorSid());
|
||||
|
||||
//如果是则将参与用户赋值为null
|
||||
if( isAdmin == 1){
|
||||
pagerQuery.getParams().setActorSid(null);
|
||||
}
|
||||
|
||||
IPage<WfHistTaskDidVo> page = histTaskService.pageList3(pagerQuery);
|
||||
// 把Ipage转换为PageVo
|
||||
PagerVo<WfHistTaskDidVo> pv_result = PagerUtil.pageToVo(page, null);
|
||||
|
||||
return rb.success().setData(pv_result);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 历史任务列表(流程记录)
|
||||
*
|
||||
* @param pagerQuery
|
||||
* 查询条件
|
||||
* @return 已办工作列表
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<List<WfHistTaskVo>> histTaskList(WfHistTaskRecordQuery query) {
|
||||
ResultBean<List<WfHistTaskVo>> rb = ResultBean.fireFail();
|
||||
if(query==null)
|
||||
return rb.setData(null);
|
||||
List<WfHistTaskVo> list=managerService.histTaskList(query);
|
||||
if (list==null)
|
||||
return rb.setData(null);
|
||||
return rb.success().setData(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 流程类别与流程列表
|
||||
*
|
||||
* @param pagerQuery
|
||||
* 查询条件
|
||||
* @return 流程类别与流程列表
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<List<WfProcessTreeVo>> getProcessTree(String sourceSid) {
|
||||
ResultBean<List<WfProcessTreeVo>> rb = ResultBean.fireFail();
|
||||
|
||||
List<WfProcessTreeVo> processTreeVos=new ArrayList<WfProcessTreeVo>();
|
||||
|
||||
List<WfProcessTypeVo> processType_list=wfProcessTypeService.list(new WfProcessTypeQuery());
|
||||
for(int i=0;i<processType_list.size();i++)
|
||||
{
|
||||
WfProcessTreeVo processTreeVo=new WfProcessTreeVo();
|
||||
processTreeVo.setProcessTypeVo(processType_list.get(i));
|
||||
WfProcessQuery processQuery=new WfProcessQuery();
|
||||
processQuery.setState(-9);
|
||||
processQuery.setProcessTypeSid(processType_list.get(i).getSid());
|
||||
processTreeVo.setProcessList(wfProcessService.list(processQuery));
|
||||
processTreeVos.add(processTreeVo);
|
||||
}
|
||||
|
||||
return rb.success().setData(processTreeVos);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据任务sid,获取环节及其动作列表,初始化流程提交页面
|
||||
* @param taskSid
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<WfProcessNodeActionsVo> getRunProcessInfo(String taskSid)
|
||||
{
|
||||
ResultBean<WfProcessNodeActionsVo> rb = ResultBean.fireFail();
|
||||
WfProcessNodeActionsVo vo=managerService.getNodeAndAcitonsVo(taskSid);
|
||||
if(null==vo)
|
||||
return rb.setData(null);
|
||||
return rb.success().setData(vo);
|
||||
}
|
||||
/**
|
||||
* 根据任务sid,获取环节信息
|
||||
* @param taskSid
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<WfProcessNodeVo> getNodesInfo(String taskSid)
|
||||
{
|
||||
ResultBean<WfProcessNodeVo> rb = ResultBean.fireFail();
|
||||
WfTask task=taskService.fetchBySid(taskSid);
|
||||
if(null==task)
|
||||
return rb.setData(null);
|
||||
WfProcessNode node=wfProcessNodeService.fetchBySid(task.getNodeSid());
|
||||
if(null==node)
|
||||
return rb.setData(null);
|
||||
WfProcessNodeVo vo=new WfProcessNodeVo();
|
||||
vo.fromEntity(node);
|
||||
WfProcess process=wfProcessService.fetchBySid(node.getProcessSid());
|
||||
if(null==process)
|
||||
return rb.setData(null);
|
||||
//如果流程无附件,则附件默认不可操作,否则按照环节中设置的内容判断
|
||||
if(process.getExtendStatus()==null || process.getExtendStatus().equals("") || process.getExtendStatus().split(",")[0].equals("0"))
|
||||
{
|
||||
vo.setIsAppendix("0");
|
||||
vo.setIsOperAppendix("0");
|
||||
}
|
||||
else
|
||||
{
|
||||
vo.setIsAppendix("1");
|
||||
vo.setIsOperAppendix(vo.getExtendStatus().equals("")?"0":vo.getExtendStatus().split(",")[0]);
|
||||
}
|
||||
//是否可以套红
|
||||
vo.setIsOperRedHead((vo.getExtendStatus().equals("") || vo.getExtendStatus().split(",").length<2)?"0":vo.getExtendStatus().split(",")[1]);
|
||||
return rb.success().setData(vo);
|
||||
}
|
||||
/**
|
||||
* 根据动作sid,获取提交页面中有关信息(自定义意见,默认用户,是否可以修改用户,是否显示分发,是否为办结动作)
|
||||
* @param actionSid
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<WfProcessActionExtraVo> getActionExtraInfo(String actionSid)
|
||||
{
|
||||
ResultBean<WfProcessActionExtraVo> rb = ResultBean.fireFail();
|
||||
WfProcessActionExtraVo vo=managerService.getActionExtraInfo(actionSid);
|
||||
return rb.success().setData(vo);
|
||||
}
|
||||
/**
|
||||
* 获取待办、待阅数量
|
||||
* @param WfMTaskDto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<List<WfTaskCountVo>> getTaskCounts(WfTaskCountQuery query) {
|
||||
//传进来的参数 用户的Sid 任务类别 0 流程类别
|
||||
ResultBean<List<WfTaskCountVo>> rb = ResultBean.fireFail();
|
||||
if(query==null)
|
||||
return rb.setData(null);
|
||||
List<WfTaskCountVo> list=taskService.getTaskCounts(query);
|
||||
if (list==null)
|
||||
return rb.setData(null);
|
||||
return rb.success().setData(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取菜单栏中待办的数量
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<List<WfMenuTaskCountVo>> getMenuTaskCounts(WfMenuTaskCountQuery query) {
|
||||
ResultBean<List<WfMenuTaskCountVo>> rb = ResultBean.fireFail();
|
||||
if(query == null){
|
||||
return rb.setData(null);
|
||||
}
|
||||
List<WfMenuTaskCountVo> list=taskService.getMenuTaskCounts(query);
|
||||
if(list == null){
|
||||
return rb.setData(null);
|
||||
}
|
||||
return rb.success().setData(list);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,721 @@
|
||||
package com.yxt.workflow.biz.wfmanager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
|
||||
import com.yxt.workflow.api.histtask.WfHistTask;
|
||||
import com.yxt.workflow.api.histtask.WfHistTaskRecordQuery;
|
||||
import com.yxt.workflow.api.histtask.WfHistTaskVo;
|
||||
import com.yxt.workflow.api.order.WfOrder;
|
||||
import com.yxt.workflow.api.order.WfOrderTaskDto;
|
||||
import com.yxt.workflow.api.processaction.WfProcessAction;
|
||||
import com.yxt.workflow.api.processaction.WfProcessActionExtraVo;
|
||||
import com.yxt.workflow.api.processaction.WfProcessActionQuery;
|
||||
import com.yxt.workflow.api.processnode.WfProcessNode;
|
||||
import com.yxt.workflow.api.processnode.WfProcessNodeVo;
|
||||
import com.yxt.workflow.api.task.WfTask;
|
||||
import com.yxt.workflow.api.task.WfTaskVo;
|
||||
import com.yxt.workflow.api.wfmanger.WfMBackTaskDto;
|
||||
import com.yxt.workflow.api.wfmanger.WfMRecallTaskDto;
|
||||
import com.yxt.workflow.api.wfmanger.WfMSimpleTaskDto;
|
||||
import com.yxt.workflow.api.wfmanger.WfMTaskDto;
|
||||
import com.yxt.workflow.api.wfmanger.WfProcessNodeActionsVo;
|
||||
import com.yxt.workflow.api.wfmanger.WfReadTaskDto;
|
||||
import com.yxt.workflow.biz.histtask.WfHistTaskService;
|
||||
import com.yxt.workflow.biz.order.WfOrderService;
|
||||
import com.yxt.workflow.biz.processaction.WfProcessActionService;
|
||||
import com.yxt.workflow.biz.processnode.WfProcessNodeService;
|
||||
import com.yxt.workflow.biz.task.WfTaskService;
|
||||
|
||||
/**
|
||||
* 负责提供与流程相关的管理服务
|
||||
*
|
||||
* @author yxt_mtl
|
||||
* @since 2020-10-20
|
||||
*/
|
||||
@Service
|
||||
public class WfManagerService {
|
||||
|
||||
@Autowired
|
||||
private WfOrderService wfOrderService;
|
||||
|
||||
@Autowired
|
||||
private WfTaskService wfTaskService;
|
||||
@Autowired
|
||||
private WfHistTaskService wfHistTaskService;
|
||||
@Autowired
|
||||
private WfProcessNodeService nodeService;
|
||||
@Autowired
|
||||
private WfProcessActionService actionService;
|
||||
|
||||
// 启动流程。
|
||||
// 1.wf_order、wf_hist_order各插入一条数据,sid相同
|
||||
// 2.task表中插入流程第一个环节的信息
|
||||
// 返回首环节和环节动作列表
|
||||
public WfTaskVo startProcess(WfOrder order) {
|
||||
|
||||
order.setExpireTime(new Date());
|
||||
order.setUpdateBySid(order.getCreateBySid());
|
||||
order.setCreateTime(new Date());
|
||||
order.setModifyTime(order.getCreateTime());
|
||||
order.setPriority(1);
|
||||
order.setParentNodeName("");
|
||||
order.setOrderNo("1");
|
||||
order.setVariable("");
|
||||
order.setVer(1);
|
||||
|
||||
// 获取流程的第一个环节
|
||||
WfProcessNode firstNode = nodeService.getFirstNode(order
|
||||
.getProcessSid());
|
||||
if (firstNode == null)
|
||||
return null;
|
||||
// wf_order插入记录,wf_hist_order插入记录
|
||||
wfOrderService.createOrder(order);
|
||||
|
||||
// wf_task插入记录
|
||||
WfTask task = new WfTask();
|
||||
task.setPreTaskSid("");
|
||||
task.setProcessSid(order.getProcessSid());
|
||||
task.setOrderSid(order.getSid());
|
||||
task.setNodeSid(firstNode.getSid());
|
||||
task.setTaskName(firstNode.getNodeName());
|
||||
task.setDisplayName(task.getTaskName());
|
||||
task.setTaskType(0); //0为待办,1为待阅
|
||||
task.setPerformType(0);
|
||||
task.setCreateBySid(order.getCreateBySid());
|
||||
task.setCreateTime(order.getCreateTime());
|
||||
task.setOperPost(firstNode.getRemarks());
|
||||
task.setOperName(order.getCreaterName());
|
||||
task.setOperDeptName(order.getCreateDeptName());
|
||||
if (0 != firstNode.getTimeLimit()) {
|
||||
|
||||
task.setExpireTime(new Date());
|
||||
}
|
||||
task.setActionUrl("");
|
||||
task.setVariable("");
|
||||
task.setVer(1);
|
||||
|
||||
if (!wfTaskService.saveTask(task))
|
||||
return null;
|
||||
|
||||
WfTaskVo taskVo = new WfTaskVo();
|
||||
taskVo.fromEntity(task);
|
||||
taskVo.setTaskSid(task.getSid());
|
||||
return taskVo;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理流程。 意见页面提交时 一。修改wf_order表中的字段:上次更新时间、上次更新人 二、对task、hist_task进行操作
|
||||
* 1.需要把task表中的记录A1转入对应的hist_task、hist_task_actor中, 2.删除task表中的当前记录A1,
|
||||
* 3.在task表中插入新记录A2,并且A2中parent_task_id为A1的id。
|
||||
*
|
||||
* @param WfMTaskDto
|
||||
* @return
|
||||
*/
|
||||
public boolean runProcess(WfMTaskDto dto) {
|
||||
/*
|
||||
* // 当前任务 WfTask currentTask =
|
||||
* wfTaskService.fetchBySid(dto.getCurrentTaskSid()); if (null ==
|
||||
* currentTask) return false; // 如果当前任务办理人不是当前操作用户,则返回错误 if
|
||||
* (!dto.getOperUserSid().equals(currentTask.getCreateBySid())) return
|
||||
* false; // 动作 WfProcessAction action =
|
||||
* actionService.fetchBySid(dto.getActionSid()); if (null == action)
|
||||
* return false;
|
||||
*
|
||||
* // 获取流程的环节 WfProcessNode node =
|
||||
* nodeService.fetchBySid(action.getNextNodeSid()); if (node == null)
|
||||
* return false;
|
||||
*
|
||||
*
|
||||
* // wf_task插入记录 WfTask newTask = new WfTask();
|
||||
* newTask.setPreTaskSid(currentTask.getSid());
|
||||
* newTask.setProcessSid(currentTask.getProcessSid());
|
||||
* newTask.setOrderSid(currentTask.getOrderSid());
|
||||
* newTask.setNodeSid(node.getSid());
|
||||
* newTask.setTaskName(node.getNodeName());
|
||||
* newTask.setDisplayName(newTask.getTaskName());
|
||||
* newTask.setTaskType(0); newTask.setPerformType(0);
|
||||
*
|
||||
*
|
||||
* newTask.setCreateBySid(dto.getNextUserSid());
|
||||
* newTask.setOperName(dto.getNextOperName());
|
||||
* newTask.setOperPost(node.getRemarks());
|
||||
* newTask.setOperDeptName(dto.getNextOperDeptName());
|
||||
*/
|
||||
WfTask newTask = new WfTask();
|
||||
WfHistTask histTask = new WfHistTask();
|
||||
if (!createRunTask(dto, newTask, histTask))
|
||||
return false;
|
||||
|
||||
newTask.setCreateBySid(dto.getNextUserSid());
|
||||
newTask.setOperName(dto.getNextOperName());
|
||||
newTask.setOperDeptName(dto.getNextOperDeptName());
|
||||
|
||||
// if userSid=0,则表示退回上一处理人;
|
||||
if (dto.getNextUserSid().equals("0")) {
|
||||
WfHistTask preTask = wfHistTaskService.fetchBySid(histTask
|
||||
.getPreTaskSid());
|
||||
if (null == preTask)
|
||||
return false;
|
||||
newTask.setCreateBySid(preTask.getCreateBySid());
|
||||
newTask.setOperName(preTask.getOperName());
|
||||
// newTask.setOperPost(preTask.getOperPost());
|
||||
newTask.setOperDeptName(preTask.getOperDeptName());
|
||||
}
|
||||
// if userSid=9,则表示为发起人
|
||||
if (dto.getNextUserSid().equals("9")) {
|
||||
WfOrder order = wfOrderService.fetchBySid(newTask.getOrderSid());
|
||||
if (order == null)
|
||||
return false;
|
||||
newTask.setCreateBySid(order.getCreateBySid());
|
||||
newTask.setOperName(order.getCreaterName());
|
||||
// newTask.setOperPost("发起人");
|
||||
newTask.setOperDeptName(order.getCreateDeptName());
|
||||
}
|
||||
|
||||
histTask.setNextOperName(newTask.getOperName());
|
||||
histTask.setNextOperDeptName(newTask.getOperDeptName());
|
||||
|
||||
// 判断是否有分发列表,分发时下一处理人是多个
|
||||
/*
|
||||
* if (dto.getOpers() != null && dto.getOpers().size() > 1) { for(int
|
||||
* x=1;x<dto.getOpers().size();x++)
|
||||
* histTask.setNextOperName(histTask.getOperName
|
||||
* ()+","+dto.getOpers().get(x).getOperName()); }
|
||||
*/
|
||||
|
||||
// 把上一任务记录从task表中的记录迁移到hist_task、hist_task_actor,并在task表中插入新任务记录
|
||||
if (wfTaskService.createTask(newTask, histTask)) {
|
||||
// 修改wf_order表中的字段:上次更新人和wf_hist_order中lastTaskSid
|
||||
/*updateOrderFormInfo(newTask.getOrderSid(),
|
||||
histTask.getCreateBySid(), newTask.getSid(),
|
||||
newTask.getTaskName());*/
|
||||
|
||||
// 判断是否有分发列表,创建多个待阅任务
|
||||
if (dto.getOpers() != null && dto.getOpers().size() > 0) {
|
||||
// wfTaskService.createBatchTask(dto.getOpers(), newTask);
|
||||
wfTaskService.createUnReadTasks(dto.getOpers(), newTask);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理流程。同时提交给多个人。每个人生成一个待办任务
|
||||
* 意见页面提交时 一。修改wf_order表中的字段:上次更新时间、上次更新人
|
||||
* 二、对task、hist_task进行操作 1.需要把task表中的记录A1转入对应的hist_task、hist_task_actor中,
|
||||
* 2.删除task表中的当前记录A1, 3.在task表中插入新记录A2,并且A2中parent_task_id为A1的id。
|
||||
*
|
||||
* @param WfMTaskDto
|
||||
* @return
|
||||
*/
|
||||
public boolean runBatchProcess(WfMTaskDto dto) {
|
||||
|
||||
WfTask newTask = new WfTask();
|
||||
WfHistTask histTask = new WfHistTask();
|
||||
if (!createRunTask(dto, newTask, histTask))
|
||||
return false;
|
||||
|
||||
// 判断是否有分发列表,分发时下一处理人是多个
|
||||
if (dto.getOpers() != null && dto.getOpers().size() > 0) {
|
||||
histTask.setNextOperName(dto.getOpers().get(0).getOperName());
|
||||
histTask.setNextOperDeptName(dto.getOpers().get(0)
|
||||
.getOperDeptName());
|
||||
for (int x = 1; x < dto.getOpers().size(); x++) {
|
||||
histTask.setNextOperName(histTask.getNextOperName() + ","
|
||||
+ dto.getOpers().get(x).getOperName());
|
||||
histTask.setNextOperDeptName(histTask.getNextOperDeptName()
|
||||
+ "," + dto.getOpers().get(x).getOperDeptName());
|
||||
}
|
||||
}
|
||||
|
||||
// 把上一任务记录从task表中的记录迁移到hist_task、hist_task_actor
|
||||
if (wfTaskService.moveTask(histTask)) {
|
||||
// 修改wf_order表中的字段:上次更新人和wf_hist_order中lastTaskSid
|
||||
updateOrderFormInfo(newTask.getOrderSid(),
|
||||
histTask.getCreateBySid(), newTask.getSid(),
|
||||
newTask.getTaskName());
|
||||
|
||||
// 判断是否有分发列表,创建待办多个任务
|
||||
if (dto.getOpers() != null && dto.getOpers().size() > 0) {
|
||||
wfTaskService.createBatchTask(dto.getOpers(), newTask);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean createRunTask(WfMTaskDto dto, WfTask newTask,
|
||||
WfHistTask histTask) {
|
||||
// 当前任务
|
||||
WfTask currentTask = wfTaskService.fetchBySid(dto.getCurrentTaskSid());
|
||||
if (null == currentTask)
|
||||
return false;
|
||||
// 如果当前任务办理人不是当前操作用户,则返回错误
|
||||
if (!dto.getOperUserSid().equals(currentTask.getCreateBySid()))
|
||||
return false;
|
||||
// 动作
|
||||
WfProcessAction action = actionService.fetchBySid(dto.getActionSid());
|
||||
if (null == action)
|
||||
return false;
|
||||
|
||||
// 获取流程的下一环节
|
||||
WfProcessNode node = nodeService.fetchBySid(action.getNextNodeSid());
|
||||
if (node == null)
|
||||
return false;
|
||||
|
||||
// wf_task插入记录
|
||||
|
||||
newTask.setPreTaskSid(currentTask.getSid());
|
||||
newTask.setProcessSid(currentTask.getProcessSid());
|
||||
newTask.setOrderSid(currentTask.getOrderSid());
|
||||
newTask.setNodeSid(node.getSid());
|
||||
newTask.setTaskName(node.getNodeName());
|
||||
newTask.setDisplayName(newTask.getTaskName());
|
||||
newTask.setTaskType(0);
|
||||
newTask.setPerformType(0);
|
||||
newTask.setOperPost(node.getRemarks());
|
||||
|
||||
if (0 != node.getTimeLimit()) {
|
||||
// Calendar.get
|
||||
/*
|
||||
* DateTimeFormatter df = DateTimeFormatter
|
||||
* .ofPattern("yyyy-MM-dd HH:mm:ss"); LocalDateTime ld =
|
||||
* LocalDateTime.now();
|
||||
*/
|
||||
newTask.setExpireTime(new Date());
|
||||
}
|
||||
newTask.setActionUrl("");
|
||||
newTask.setVariable("");
|
||||
newTask.setVer(1);
|
||||
|
||||
// 历史任务
|
||||
BeanUtil.copyProperties(currentTask, histTask);
|
||||
histTask.setActionName(action.getActionName());
|
||||
histTask.setNextOperPost(newTask.getOperPost());
|
||||
histTask.setNextTaskName(newTask.getTaskName());
|
||||
histTask.setOperOpinion(dto.getOperOpinion());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 结束流程 1.删除wf_order表中的数据 2.修改wf_hist_order表中的字段:end_Time,state=0
|
||||
* 3.把task表中的数据转入到hist_task、hist_task_actor 4.删除task表中的数据
|
||||
*
|
||||
* @param taskSid
|
||||
* 任务sid
|
||||
* @param operOpinion
|
||||
* 办理人意见
|
||||
* @return
|
||||
*/
|
||||
public boolean endProcess(WfMSimpleTaskDto dto) {
|
||||
WfTask task = wfTaskService.fetchBySid(dto.getTaskSid());
|
||||
if (null == task)
|
||||
return false;
|
||||
// 如果当前任务办理人不是当前操作用户,则返回错误
|
||||
if (!dto.getOperUserSid().equals(task.getCreateBySid()))
|
||||
return false;
|
||||
|
||||
// 动作
|
||||
WfProcessAction action = actionService.fetchBySid(dto.getActionSid());
|
||||
if (null == action)
|
||||
return false;
|
||||
|
||||
// 1.删除wf_order表中的数据
|
||||
// 2.修改wf_hist_order表中的字段:end_Time,state=0
|
||||
wfOrderService.finishOrder(task.getOrderSid());
|
||||
|
||||
// 把task表中的记录迁移到hist_task、hist_task_actor
|
||||
WfHistTask histTask = new WfHistTask();
|
||||
BeanUtil.copyProperties(task, histTask);
|
||||
histTask.setActionName(action.getActionName());
|
||||
histTask.setOperOpinion(dto.getOperOpinion());
|
||||
if (wfTaskService.finishTask(histTask)) {
|
||||
// 创建待阅任务列表
|
||||
// 判断是否有分发列表
|
||||
if (dto.getOpers() != null && dto.getOpers().size() > 0) {
|
||||
wfTaskService.createUnReadTasks(dto.getOpers(), task);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 退回流程。 意见页面退回时.直接获取上一任务信息,生成新任务信息 一。修改wf_order表中的字段:上次更新时间、上次更新人
|
||||
* 二、对task、hist_task进行操作 1.需要把task表中的记录A1转入对应的hist_task、hist_task_actor中,
|
||||
* 2.删除task表中的当前记录A1, 3.在task表中插入新记录A2,并且A2中parent_task_id为A1的id。
|
||||
*
|
||||
* @param WfMTaskDto
|
||||
* @return 退回后的待办用户sid
|
||||
*/
|
||||
public String backProcess(WfMBackTaskDto dto) {
|
||||
|
||||
// 获取当前任务
|
||||
WfTask currentTask = wfTaskService.fetchBySid(dto.getCurrentTaskSid());
|
||||
if (null == currentTask)
|
||||
return "";
|
||||
// 如果当前任务办理人不是当前操作用户,则返回错误
|
||||
if (!dto.getOperUserSid().equals(currentTask.getCreateBySid()))
|
||||
return "";
|
||||
// 获取上一任务
|
||||
WfHistTask preTask = wfHistTaskService.fetchBySid(currentTask
|
||||
.getPreTaskSid());
|
||||
if (null == preTask)
|
||||
return "";
|
||||
|
||||
// 生成新任务
|
||||
WfTask newTask = new WfTask();
|
||||
newTask.setPreTaskSid(currentTask.getSid());
|
||||
newTask.setProcessSid(preTask.getProcessSid());
|
||||
newTask.setOrderSid(preTask.getOrderSid());
|
||||
newTask.setNodeSid(preTask.getNodeSid());
|
||||
newTask.setTaskName(preTask.getTaskName());
|
||||
newTask.setDisplayName(newTask.getTaskName());
|
||||
newTask.setTaskType(preTask.getTaskType());
|
||||
newTask.setPerformType(preTask.getPerformType());
|
||||
newTask.setCreateBySid(preTask.getCreateBySid());
|
||||
newTask.setExpireTime(preTask.getExpireTime());
|
||||
newTask.setActionUrl(preTask.getActionUrl());
|
||||
newTask.setVariable(preTask.getVariable());
|
||||
newTask.setVer(preTask.getVer());
|
||||
|
||||
newTask.setOperName(preTask.getOperName());
|
||||
newTask.setOperPost(preTask.getOperPost());
|
||||
newTask.setOperDeptName(preTask.getOperDeptName());
|
||||
|
||||
// 历史任务
|
||||
WfHistTask histTask = new WfHistTask();
|
||||
BeanUtil.copyProperties(currentTask, histTask);
|
||||
histTask.setActionName("退回");
|
||||
histTask.setOperOpinion(dto.getOperOpinion());
|
||||
histTask.setNextOperName(newTask.getOperName());
|
||||
histTask.setNextOperPost(newTask.getOperPost());
|
||||
histTask.setNextOperDeptName(newTask.getOperDeptName());
|
||||
histTask.setNextTaskName(newTask.getTaskName());
|
||||
|
||||
// 把上一任务记录从task表中的记录迁移到hist_task、hist_task_actor,并在task表中插入新任务记录
|
||||
if(wfTaskService.createTask(newTask, histTask))
|
||||
return newTask.getCreateBySid();
|
||||
else
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤回流程。待办列表中撤回. 直接获取上一任务信息,生成新任务信息 一。修改wf_order表中的字段:上次更新时间、上次更新人
|
||||
* 二、对task、hist_task进行操作 1.需要把task表中的记录A1转入对应的hist_task、hist_task_actor中,
|
||||
* 2.删除task表中的当前记录A1, 3.在task表中插入新记录A2,并且A2中parent_task_id为A1的id。
|
||||
*
|
||||
* @param WfMTaskDto
|
||||
* @return
|
||||
*/
|
||||
public boolean recallProcess(WfMRecallTaskDto dto) {
|
||||
|
||||
// 获取当前任务
|
||||
WfTask currentTask = wfTaskService.fetchBySid(dto.getTaskSid());
|
||||
if (null == currentTask)
|
||||
return false;
|
||||
// 获取上一任务
|
||||
WfHistTask preTask = wfHistTaskService.fetchBySid(currentTask
|
||||
.getPreTaskSid());
|
||||
|
||||
// 如果上一任务办理人不是当前操作用户,则返回错误
|
||||
if (!dto.getOperUserSid().equals(preTask.getCreateBySid()))
|
||||
return false;
|
||||
// 生成新任务
|
||||
WfTask newTask = new WfTask();
|
||||
newTask.setPreTaskSid(currentTask.getSid());
|
||||
newTask.setProcessSid(preTask.getProcessSid());
|
||||
newTask.setOrderSid(preTask.getOrderSid());
|
||||
newTask.setNodeSid(preTask.getNodeSid());
|
||||
newTask.setTaskName(preTask.getTaskName());
|
||||
newTask.setDisplayName(newTask.getTaskName());
|
||||
newTask.setTaskType(preTask.getTaskType());
|
||||
newTask.setPerformType(preTask.getPerformType());
|
||||
newTask.setCreateBySid(preTask.getCreateBySid());
|
||||
newTask.setExpireTime(preTask.getExpireTime());
|
||||
newTask.setActionUrl(preTask.getActionUrl());
|
||||
newTask.setVariable(preTask.getVariable());
|
||||
newTask.setVer(preTask.getVer());
|
||||
newTask.setOperName(preTask.getOperName());
|
||||
newTask.setOperPost(preTask.getOperPost());
|
||||
newTask.setOperDeptName(preTask.getOperDeptName());
|
||||
|
||||
WfHistTask histTask = new WfHistTask();
|
||||
BeanUtil.copyProperties(currentTask, histTask);
|
||||
histTask.setActionName("撤回");
|
||||
histTask.setOperName(preTask.getOperName());
|
||||
histTask.setOperDeptName(preTask.getOperDeptName());
|
||||
histTask.setOperPost(preTask.getOperPost());
|
||||
histTask.setOperOpinion("撤回");
|
||||
histTask.setNextOperName(newTask.getOperName());
|
||||
histTask.setNextOperPost(newTask.getOperPost());
|
||||
histTask.setNextOperDeptName(newTask.getOperDeptName());
|
||||
histTask.setNextTaskName(newTask.getTaskName());
|
||||
|
||||
// 把上一任务记录从task表中的记录迁移到hist_task、hist_task_actor,并在task表中插入新任务记录
|
||||
return wfTaskService.createTask(newTask, histTask);
|
||||
// 修改wf_order表中的字段:上次更新人和wf_hist_order中lastTaskSid
|
||||
//return updateOrderFormInfo(newTask.getOrderSid(),newTask.getCreateBySid(), newTask.getSid(),newTask.getTaskName());
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 阅读(task迁移到histTask中)
|
||||
*
|
||||
* @param WfMTaskDto
|
||||
* @return
|
||||
*/
|
||||
public boolean readTask(WfReadTaskDto dto) {
|
||||
// 获取当前任务
|
||||
WfTask currentTask = wfTaskService.fetchBySid(dto.getTaskSid());
|
||||
if (null == currentTask)
|
||||
return false;
|
||||
// 如果不是待阅工作,则返回
|
||||
if (currentTask.getTaskType() != 1)
|
||||
return false;
|
||||
// 如果办理人不是当前操作用户,则返回错误
|
||||
if (!dto.getOperUserSid().equals(currentTask.getCreateBySid()))
|
||||
return false;
|
||||
WfHistTask histTask = new WfHistTask();
|
||||
BeanUtil.copyProperties(currentTask, histTask);
|
||||
// histTask.setTaskName("已阅");
|
||||
// histTask.setActionName("");
|
||||
histTask.setOperOpinion(dto.getOperOpinion());
|
||||
if (wfTaskService.finishTask(histTask)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 修改wf_order表中的字段:上次更新人和wf_hist_order中lastTaskSid
|
||||
private boolean updateOrderFormInfo(String orderSid, String updateBySid,
|
||||
String lastTaskSid, String lastTaskName) {
|
||||
|
||||
WfOrderTaskDto formsDto = new WfOrderTaskDto();
|
||||
formsDto.setSid(orderSid);
|
||||
formsDto.setUpdateBySid(updateBySid);
|
||||
formsDto.setLastTaskSid(lastTaskSid);
|
||||
formsDto.setLastTaskName(lastTaskName);
|
||||
return wfOrderService.updateOrderTaskInfo(formsDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取任务对应的环节及其动作列表
|
||||
*
|
||||
* @param taskSid
|
||||
* @return
|
||||
*/
|
||||
public WfProcessNodeActionsVo getNodeAndAcitonsVo(String taskSid) {
|
||||
WfTask task = wfTaskService.fetchBySid(taskSid);
|
||||
if (null == task)
|
||||
return null;
|
||||
WfProcessNode node = nodeService.fetchBySid(task.getNodeSid());
|
||||
if (node == null)
|
||||
return null;
|
||||
|
||||
WfProcessNodeActionsVo nodeActionsVo = new WfProcessNodeActionsVo();
|
||||
nodeActionsVo.setOrderSid(task.getOrderSid());
|
||||
WfProcessNodeVo nodeVo = new WfProcessNodeVo();
|
||||
nodeVo.fromEntity(node);
|
||||
nodeActionsVo.setNodeVo(nodeVo);
|
||||
|
||||
// 查询环节对应的动作列表
|
||||
WfProcessActionQuery actionQuery = new WfProcessActionQuery();
|
||||
actionQuery.setNodeSid(node.getSid());
|
||||
nodeActionsVo.setActionVoList(actionService.list(actionQuery));
|
||||
|
||||
return nodeActionsVo;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据动作sid,获取提交页面中有关信息(自定义意见,默认用户,是否可以修改用户,是否显示分发,是否为办结动作)
|
||||
*
|
||||
* @param actionSid
|
||||
* @return
|
||||
*/
|
||||
public WfProcessActionExtraVo getActionExtraInfo(String actionSid) {
|
||||
WfProcessAction action = actionService.fetchBySid(actionSid);
|
||||
if (null == action)
|
||||
return null;
|
||||
WfProcessActionExtraVo actionExtraVo = new WfProcessActionExtraVo();
|
||||
actionExtraVo.setSid(action.getSid());
|
||||
actionExtraVo.setActionUserSid(action.getActionUserSid());
|
||||
actionExtraVo.setActionPersonName(action.getActionPersonName()); // 应该根据usersid显示姓名
|
||||
|
||||
actionExtraVo.setIsLastAction(action.getIsLastAction());
|
||||
// 如果是办结动作,则不予许修改用户
|
||||
if (action.getIsLastAction() == 1)
|
||||
actionExtraVo.setIsShowSelectUser(0);
|
||||
else {
|
||||
// actionPerson=0|9|-1,不允许修改用户
|
||||
if (action.getActionUserSid() != null
|
||||
&& (action.getActionUserSid().equals("0") || action
|
||||
.getActionUserSid().equals("9") || action
|
||||
.getActionUserSid().equals("-1")))
|
||||
actionExtraVo.setIsShowSelectUser(0);
|
||||
else
|
||||
actionExtraVo.setIsShowSelectUser(1);
|
||||
}
|
||||
|
||||
// 是否显示分发
|
||||
if (action.getExtendStatus() == null
|
||||
|| action.getExtendStatus().trim().equals(""))
|
||||
actionExtraVo.setIsShowSend(0);
|
||||
else {
|
||||
actionExtraVo.setIsShowSend(Integer.parseInt(action
|
||||
.getExtendStatus().split(",")[0]));
|
||||
}
|
||||
|
||||
// 自定义意见
|
||||
List<String> opinions = new ArrayList<>();
|
||||
if (action.getCustomOpinion() != null
|
||||
&& !action.getCustomOpinion().trim().equals("")) {
|
||||
|
||||
String[] arrays = action.getCustomOpinion().split("/");
|
||||
for (int i = 0; i < arrays.length; i++) {
|
||||
opinions.add(arrays[i]);
|
||||
}
|
||||
}
|
||||
actionExtraVo.setCustomOpinions(opinions);
|
||||
|
||||
return actionExtraVo;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 历史任务列表(流程记录)
|
||||
*
|
||||
* @param pagerQuery
|
||||
* 查询条件
|
||||
* @return 已办工作列表
|
||||
*/
|
||||
public List<WfHistTaskVo> histTaskList(WfHistTaskRecordQuery query) {
|
||||
|
||||
//2021.09.15验证是否时单位领导签发
|
||||
if(!("单位领导签发").equals(query.getTaskName())) {
|
||||
if (null == query)
|
||||
return null;
|
||||
// 办理记录
|
||||
query.setTaskType("0");
|
||||
List<WfHistTaskVo> list = wfHistTaskService.list(query);
|
||||
|
||||
if (list == null)
|
||||
return null;
|
||||
// 办理记录
|
||||
// getRecords(list);
|
||||
|
||||
// 待阅记录
|
||||
query.setTaskType("1");
|
||||
List<WfHistTaskVo> list_unread = wfTaskService.unReadList(query);
|
||||
if (list_unread != null && list_unread.size() > 0) {
|
||||
for (int i = 0; i < list_unread.size(); i++)
|
||||
list.add(list_unread.get(i));
|
||||
}
|
||||
|
||||
// 已阅读记录
|
||||
List<WfHistTaskVo> list_read = wfHistTaskService.list(query);
|
||||
|
||||
if (list_read != null && list_read.size() > 0) {
|
||||
for (int i = 0; i < list_read.size(); i++)
|
||||
list.add(list_read.get(i));
|
||||
}
|
||||
Collections.sort(list,
|
||||
Comparator.comparing(WfHistTaskVo::getCreateTime));
|
||||
return list;
|
||||
}else{
|
||||
List<WfHistTaskVo> list = getleadIssue(query);
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 2021.09.15
|
||||
* 获取单位领导签发意见,如果有多个领导意见,就只显示每个领导的最新意见
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
public List<WfHistTaskVo> getleadIssue(WfHistTaskRecordQuery query){
|
||||
if (null == query)
|
||||
return null;
|
||||
// 办理记录
|
||||
query.setTaskType("0");
|
||||
List<WfHistTaskVo> list = wfHistTaskService.getIssueInformation(query);
|
||||
|
||||
if (list == null)
|
||||
return null;
|
||||
// 办理记录
|
||||
// getRecords(list);
|
||||
|
||||
// 待阅记录
|
||||
query.setTaskType("1");
|
||||
List<WfHistTaskVo> list_unread = wfTaskService.unReadList(query);
|
||||
if (list_unread != null && list_unread.size() > 0) {
|
||||
for (int i = 0; i < list_unread.size(); i++)
|
||||
list.add(list_unread.get(i));
|
||||
}
|
||||
|
||||
// 已阅读记录
|
||||
List<WfHistTaskVo> list_read = wfHistTaskService.list(query);
|
||||
|
||||
if (list_read != null && list_read.size() > 0) {
|
||||
for (int i = 0; i < list_read.size(); i++)
|
||||
list.add(list_read.get(i));
|
||||
}
|
||||
Collections.sort(list,
|
||||
Comparator.comparing(WfHistTaskVo::getCreateTime));
|
||||
|
||||
return list;
|
||||
}
|
||||
/*
|
||||
* private void getRecords(List<WfHistTaskVo> list) {
|
||||
*
|
||||
* // 办理记录 for (int i = 0; i < list.size(); i++) { String
|
||||
* sid=list.get(i).getSid(); List<WfHistTaskVo>
|
||||
* listvo=list.stream().filter(s->
|
||||
* s.getPreTaskSid().equals(sid)).collect(Collectors.toList());
|
||||
* if(listvo.size()>0) {
|
||||
* list.get(i).setNextOperName(listvo.get(0).getOperName());
|
||||
* list.get(i).setNextOperPost(listvo.get(0).getOperPost());
|
||||
* list.get(i).setNextTaskName(listvo.get(0).getTaskName()); for(int
|
||||
* x=1;x<listvo.size();x++) {
|
||||
* list.get(i).setNextOperName(list.get(i).getNextOperName
|
||||
* ()+","+listvo.get(x).getOperName());
|
||||
*
|
||||
* } } else { Map<String, Object> map = new HashMap<>();
|
||||
* map.put("preTaskSid", list.get(i).getSid()); map.put("taskType", "0"); //
|
||||
* 待办 List<WfTask> list_task = wfTaskService.listByMap(map); //
|
||||
* 如果task表中有数据,表示没有办结,则可以获取最后一条记录的待办信息 if (list_task != null &&
|
||||
* list_task.size() > 0) { // WfProcessNode //
|
||||
* node=nodeService.fetchBySid(list_task.get(0).getNodeSid()) //
|
||||
* 根据task表中createBySid获取用户的姓名、岗位和taskname
|
||||
*
|
||||
* list.get(i).setNextOperName(list_task.get(0).getOperName());
|
||||
* list.get(i).setNextOperPost(list_task.get(0).getOperPost());
|
||||
* list.get(i).setNextTaskName(list_task.get(0).getTaskName());
|
||||
*
|
||||
* for(int x=1;x<list_task.size();x++) {
|
||||
* list.get(i).setNextOperName(list.get
|
||||
* (i).getNextOperName()+","+list_task.get(x).getOperName());
|
||||
*
|
||||
* } } } } }
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
/*********************************************************
|
||||
*********************************************************
|
||||
******************** *******************
|
||||
************* ************
|
||||
******* _oo0oo_ *******
|
||||
*** o8888888o ***
|
||||
* 88" . "88 *
|
||||
* (| -_- |) *
|
||||
* 0\ = /0 *
|
||||
* ___/`---'\___ *
|
||||
* .' \\| |// '. *
|
||||
* / \\||| : |||// \ *
|
||||
* / _||||| -:- |||||- \ *
|
||||
* | | \\\ - /// | | *
|
||||
* | \_| ''\---/'' |_/ | *
|
||||
* \ .-\__ '-' ___/-. / *
|
||||
* ___'. .' /--.--\ `. .'___ *
|
||||
* ."" '< `.___\_<|>_/___.' >' "". *
|
||||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
|
||||
* \ \ `_. \_ __\ /__ _/ .-` / / *
|
||||
* =====`-.____`.___ \_____/___.-`___.-'===== *
|
||||
* `=---=' *
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
|
||||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
|
||||
*********************************************************/
|
||||
package com.yxt.workflow.conf;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.service.ApiInfo;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
|
||||
|
||||
/**
|
||||
* Project: jlcyry <br/>
|
||||
* File: Swagger2Config.java <br/>
|
||||
* Class: com.yxt.jlzx.jlcyry.conf.Swagger2Config <br/>
|
||||
* Description: <描述类的功能>. <br/>
|
||||
* Copyright: Copyright (c) 2011 <br/>
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
||||
* Makedate: 2020/8/25 23:27 <br/>
|
||||
*
|
||||
* @author liupopo
|
||||
* @version 1.0
|
||||
* @since 1.0
|
||||
*/
|
||||
@Configuration
|
||||
@EnableSwagger2
|
||||
@EnableKnife4j
|
||||
public class Swagger2Config {
|
||||
@Bean
|
||||
public Docket createRestApi() {
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.apiInfo(apiInfo()).select()
|
||||
.apis(RequestHandlerSelectors.basePackage("com.yxt"))
|
||||
.paths(PathSelectors.any()).build();
|
||||
}
|
||||
|
||||
private ApiInfo apiInfo() {
|
||||
return new ApiInfoBuilder().title("计量中心/流程引擎").description("计量中心OA流程引擎").version("1.0")
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
spring:
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/workflow?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=GMT%2B8&failOverReadOnly=false
|
||||
username: root
|
||||
password: root
|
||||
redis:
|
||||
database: 6 # Redis数据库索引(默认为0)
|
||||
host: 127.0.0.1
|
||||
jedis:
|
||||
pool:
|
||||
max-active: -1 #连接池最大连接数(使用负值表示没有限制)
|
||||
max-idle: 8 #连接池中的最大空闲连接
|
||||
max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
min-idle: 0 # 连接池中的最小空闲连接
|
||||
password:
|
||||
port: 6379
|
||||
timeout: 0 # 连接超时时间(毫秒)
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: 127.0.0.1:8848
|
||||
|
||||
# 日志配置
|
||||
logging:
|
||||
level:
|
||||
com.yxt: debug
|
||||
org.mybatis: debug
|
||||
org.springframework: warn
|
||||
|
||||
image:
|
||||
upload:
|
||||
#path: /Users/popo/works/projects/hbuilderx/gg815/gg_admin/target/classes/static/upload/
|
||||
#path: D:\\works\\projects\\hbuilderx\\gg815\\gg_admin\\target\\classes\\static\\upload\\
|
||||
#path: /home/lzh/webapps/hbhx_kzdapi/BOOT-INF/classes/static/img/
|
||||
path: D:\\jlzx\\upload\\
|
||||
url:
|
||||
prefix: http://127.0.0.1:8111/upload/
|
||||
#prefix: http://211.90.39.140:8008/
|
||||
#prefix: http://b92.bwyljy.com/img/
|
||||
#prefix: http://192.168.0.119:8089/lv-qggz-state-ww/img/
|
||||
@@ -0,0 +1,34 @@
|
||||
spring:
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://39.104.142.92:3306/workflow?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=GMT%2B8&failOverReadOnly=false
|
||||
username: root
|
||||
password: 123456
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: 39.104.100.138:8848
|
||||
redis:
|
||||
database: 2 # Redis数据库索引(默认为0)
|
||||
host: 39.104.100.138
|
||||
jedis:
|
||||
pool:
|
||||
max-active: -1 #连接池最大连接数(使用负值表示没有限制)
|
||||
max-idle: 8 #连接池中的最大空闲连接
|
||||
max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
min-idle: 0 # 连接池中的最小空闲连接
|
||||
password: 123456
|
||||
port: 6379
|
||||
timeout: 0 # 连接超时时间(毫秒)
|
||||
|
||||
# 日志配置
|
||||
logging:
|
||||
level:
|
||||
com.yxt: debug
|
||||
org.mybatis: debug
|
||||
org.springframework: warn
|
||||
|
||||
image:
|
||||
upload:
|
||||
path: D:\\jlzx\\upload\\
|
||||
url:
|
||||
prefix: http://39.104.100.138:8111/upload/
|
||||
@@ -0,0 +1,36 @@
|
||||
spring:
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://192.168.103.6:3306/workflow?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=GMT%2B8&failOverReadOnly=false
|
||||
username: root
|
||||
password: yxt_@jlzx_root
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: 192.168.103.6:8848
|
||||
redis:
|
||||
database: 2 # Redis数据库索引(默认为0)
|
||||
host: 192.168.103.6
|
||||
jedis:
|
||||
pool:
|
||||
max-active: -1 #连接池最大连接数(使用负值表示没有限制)
|
||||
max-idle: 8 #连接池中的最大空闲连接
|
||||
max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
min-idle: 0 # 连接池中的最小空闲连接
|
||||
password: 123456
|
||||
port: 6379
|
||||
timeout: 0 # 连接超时时间(毫秒)
|
||||
|
||||
# 日志配置
|
||||
logging:
|
||||
level:
|
||||
com.yxt: debug
|
||||
org.mybatis: debug
|
||||
org.springframework: warn
|
||||
|
||||
image:
|
||||
upload:
|
||||
path: E:\jlzx\upload\
|
||||
url:
|
||||
# prefix: http://192.168.103.6:8111/upload/
|
||||
prefix: http://jlyw1.hebjlzy.com:8111/upload/
|
||||
@@ -0,0 +1,36 @@
|
||||
spring:
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://192.168.103.5:3306/workflow?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=GMT%2B8&failOverReadOnly=false
|
||||
username: root
|
||||
password: 1LAiGz$t1*Iw
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: 127.0.0.1:8848
|
||||
redis:
|
||||
database: 2 # Redis数据库索引(默认为0)
|
||||
host: 127.0.0.1
|
||||
jedis:
|
||||
pool:
|
||||
max-active: -1 #连接池最大连接数(使用负值表示没有限制)
|
||||
max-idle: 8 #连接池中的最大空闲连接
|
||||
max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
min-idle: 0 # 连接池中的最小空闲连接
|
||||
password:
|
||||
port: 6379
|
||||
timeout: 0 # 连接超时时间(毫秒)
|
||||
|
||||
# 日志配置
|
||||
logging:
|
||||
level:
|
||||
com.yxt: debug
|
||||
org.mybatis: debug
|
||||
org.springframework: warn
|
||||
|
||||
image:
|
||||
upload:
|
||||
path: D:\jlzx\upload\
|
||||
url:
|
||||
# prefix: http://192.168.103.6:8111/upload/
|
||||
prefix: http://jlyw.hebjlzy.com:8111/upload/
|
||||
@@ -0,0 +1,24 @@
|
||||
spring:
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/jlzx_jlcyry?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=GMT%2B8&failOverReadOnly=false
|
||||
username: root
|
||||
password: root
|
||||
|
||||
# 日志配置
|
||||
logging:
|
||||
level:
|
||||
com.yxt: debug
|
||||
org.mybatis: debug
|
||||
org.springframework: warn
|
||||
|
||||
image:
|
||||
upload:
|
||||
#path: /Users/popo/works/projects/hbuilderx/gg815/gg_admin/target/classes/static/upload/
|
||||
path: D:\\works\\projects\\hbuilderx\\gg815\\gg_admin\\target\\classes\\static\\upload\\
|
||||
#path: /home/lzh/webapps/hbhx_kzdapi/BOOT-INF/classes/static/img/
|
||||
url:
|
||||
prefix: http://192.168.56.1:8108/upload/
|
||||
#prefix: http://211.90.39.140:8008/
|
||||
#prefix: http://b92.bwyljy.com/img/
|
||||
#prefix: http://192.168.0.119:8089/lv-qggz-state-ww/img/
|
||||
@@ -0,0 +1,48 @@
|
||||
spring:
|
||||
application:
|
||||
name: yxt-workflow
|
||||
profiles:
|
||||
active: dev
|
||||
# 资源信息
|
||||
messages:
|
||||
# 国际化资源文件路径
|
||||
basename: i18n/messages
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 50MB
|
||||
max-request-size: 100MB
|
||||
output:
|
||||
ansi:
|
||||
enabled: ALWAYS
|
||||
|
||||
server:
|
||||
port: 8104
|
||||
|
||||
#mybatis
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath*:**Mapper.xml
|
||||
global-config:
|
||||
refresh: true
|
||||
db-config:
|
||||
id-type: 0
|
||||
db-type: mysql
|
||||
configuration:
|
||||
map-underscore-to-camel-case: false
|
||||
cache-enabled: true
|
||||
call-setters-on-nulls: true
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
|
||||
#hystrix的超时时间
|
||||
hystrix:
|
||||
command:
|
||||
default:
|
||||
execution:
|
||||
timeout:
|
||||
enabled: true
|
||||
isolation:
|
||||
thread:
|
||||
timeoutInMilliseconds: 30000
|
||||
#ribbon的超时时间
|
||||
ribbon:
|
||||
ReadTimeout: 30000
|
||||
ConnectTimeout: 30000
|
||||
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
|
||||
<property name="log.base" value="logs/yxt_workflow" />
|
||||
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 :
|
||||
|%blue(%thread) 线程 如 :DiscoveryClient-CacheRefreshExecutor-0-->
|
||||
<!--<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>-->
|
||||
<pattern>%yellow(%date{yyyy-MM-dd HH:mm:ss}) |%highlight(%-5level) |%green(%logger:%line) |%black(%msg%n)</pattern>
|
||||
<!--<charset>UTF-8</charset> -->
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 彩色日志 -->
|
||||
<!-- 彩色日志依赖的渲染类 -->
|
||||
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
|
||||
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
|
||||
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
|
||||
<!-- 彩色日志格式 -->
|
||||
<property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
|
||||
|
||||
<appender name="FILEOUT"
|
||||
class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.base}.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.base}.%d{yyyyMMdd}.%i.log.zip
|
||||
</fileNamePattern>
|
||||
<!-- 当文件大小超过10MB时触发滚动 -->
|
||||
<timeBasedFileNamingAndTriggeringPolicy
|
||||
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>1MB</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<!--<pattern>%date [%thread] %-5level %logger{35} - %msg%n</pattern>-->
|
||||
<Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36}
|
||||
-%msg%n</Pattern>
|
||||
<!--<charset>UTF-8</charset> -->
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<root level="INFO">
|
||||
<appender-ref ref="STDOUT" />
|
||||
<appender-ref ref="FILEOUT" />
|
||||
</root>
|
||||
|
||||
</configuration>
|
||||
Reference in New Issue
Block a user