mirror of
https://gitee.com/vben/vben-java.git
synced 2026-10-06 14:13:12 +08:00
流程优化
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
### 🍿 项目简介
|
||||
### 🍿 项目简介
|
||||
|
||||
[](https://gitee.com/vben/vben-java)
|
||||
[]()
|
||||
|
||||
@@ -322,7 +322,7 @@
|
||||
|
||||
<dependency>
|
||||
<groupId>com.zsvg</groupId>
|
||||
<artifactId>vben-wf</artifactId>
|
||||
<artifactId>vben-bpm</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
|
||||
<dependency>
|
||||
<groupId>com.zsvg</groupId>
|
||||
<artifactId>vben-wf</artifactId>
|
||||
<artifactId>vben-bpm</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -208,7 +208,7 @@ springdoc:
|
||||
- group: 4.辅助工具
|
||||
packages-to-scan: vben.base.tool
|
||||
- group: 5.工作流
|
||||
packages-to-scan: vben.wf
|
||||
packages-to-scan: vben.bpm
|
||||
|
||||
# 防止XSS攻击
|
||||
xss:
|
||||
@@ -218,7 +218,7 @@ xss:
|
||||
excludeUrls:
|
||||
- /system/notice
|
||||
- /oa/flow/tmpl
|
||||
- /wf/bus/tmpl
|
||||
- /bpm/bus/tmpl
|
||||
|
||||
--- # 分布式锁 lock4j 全局配置
|
||||
lock4j:
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
|
||||
<dependency>
|
||||
<groupId>com.zsvg</groupId>
|
||||
<artifactId>vben-wf</artifactId>
|
||||
<artifactId>vben-bpm</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -208,7 +208,7 @@ springdoc:
|
||||
- group: 4.辅助工具
|
||||
packages-to-scan: vben.base.tool
|
||||
- group: 5.工作流
|
||||
packages-to-scan: vben.wf
|
||||
packages-to-scan: vben.bpm
|
||||
|
||||
# 防止XSS攻击
|
||||
xss:
|
||||
@@ -218,7 +218,7 @@ xss:
|
||||
excludeUrls:
|
||||
- /system/notice
|
||||
- /oa/flow/tmpl
|
||||
- /wf/bus/tmpl
|
||||
- /bpm/bus/tmpl
|
||||
|
||||
--- # 分布式锁 lock4j 全局配置
|
||||
lock4j:
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
|
||||
<dependency>
|
||||
<groupId>com.zsvg</groupId>
|
||||
<artifactId>vben-wf</artifactId>
|
||||
<artifactId>vben-bpm</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -208,7 +208,7 @@ springdoc:
|
||||
- group: 4.辅助工具
|
||||
packages-to-scan: vben.base.tool
|
||||
- group: 5.工作流
|
||||
packages-to-scan: vben.wf
|
||||
packages-to-scan: vben.bpm
|
||||
|
||||
# 防止XSS攻击
|
||||
xss:
|
||||
@@ -218,7 +218,7 @@ xss:
|
||||
excludeUrls:
|
||||
- /system/notice
|
||||
- /oa/flow/tmpl
|
||||
- /wf/bus/tmpl
|
||||
- /bpm/bus/tmpl
|
||||
|
||||
--- # 分布式锁 lock4j 全局配置
|
||||
lock4j:
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package vben.setup.wf.bus;
|
||||
package vben.setup.bpm.bus;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
@@ -10,8 +10,8 @@ import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
@Table(name = "wf_bus_cate")
|
||||
public class WfBusCateEntity {
|
||||
@Table(name = "bpm_bus_cate")
|
||||
public class BpmBusCateEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
@@ -0,0 +1,8 @@
|
||||
package vben.setup.bpm.bus;
|
||||
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface BpmBusCateRepo extends JpaRepository<BpmBusCateEntity,String> {
|
||||
|
||||
}
|
||||
+14
-14
@@ -1,18 +1,18 @@
|
||||
package vben.setup.wf.bus;
|
||||
package vben.setup.bpm.bus;
|
||||
|
||||
import jakarta.transaction.Transactional;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import vben.setup.wf.proc.WfProcDefEntity;
|
||||
import vben.setup.wf.proc.WfProcDefRepo;
|
||||
import vben.setup.bpm.proc.BpmProcDefEntity;
|
||||
import vben.setup.bpm.proc.BpmProcDefRepo;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Transactional
|
||||
public class WfBusInitService {
|
||||
public class BpmBusInitService {
|
||||
|
||||
public void init() {
|
||||
WfBusCateEntity cate = new WfBusCateEntity();
|
||||
BpmBusCateEntity cate = new BpmBusCateEntity();
|
||||
cate.setId(1L);
|
||||
cate.setName("人事管理");
|
||||
cate.setAvtag(true);
|
||||
@@ -20,7 +20,7 @@ public class WfBusInitService {
|
||||
cate.setUptim(cate.getCrtim());
|
||||
cateRepo.save(cate);
|
||||
|
||||
WfBusCateEntity cate2 = new WfBusCateEntity();
|
||||
BpmBusCateEntity cate2 = new BpmBusCateEntity();
|
||||
cate2.setId(2L);
|
||||
cate2.setName("财务管理");
|
||||
cate2.setAvtag(true);
|
||||
@@ -28,19 +28,19 @@ public class WfBusInitService {
|
||||
cate2.setUptim(cate.getCrtim());
|
||||
cateRepo.save(cate2);
|
||||
|
||||
WfBusTmplEntity tmpl = new WfBusTmplEntity();
|
||||
BpmBusTmplEntity tmpl = new BpmBusTmplEntity();
|
||||
tmpl.setId(101L);
|
||||
tmpl.setName("请假申请");
|
||||
tmpl.setAvtag(true);
|
||||
tmpl.setUptim(tmpl.getCrtim());
|
||||
tmpl.setCatid(1L);
|
||||
tmpl.setFpath("wf/bus/leave/edit.vue");
|
||||
tmpl.setFpath("bpm/bus/leave/edit.vue");
|
||||
tmpl.setFtype(1);
|
||||
tmpl.setPrdid(101L);
|
||||
tmpl.setCruid("1");
|
||||
tmplRepo.save(tmpl);
|
||||
|
||||
WfProcDefEntity def=new WfProcDefEntity();
|
||||
BpmProcDefEntity def=new BpmProcDefEntity();
|
||||
def.setId(101L);
|
||||
def.setName("请假申请");
|
||||
def.setUptim(def.getCrtim());
|
||||
@@ -181,7 +181,7 @@ public class WfBusInitService {
|
||||
""");
|
||||
defRepo.save(def);
|
||||
|
||||
WfBusTmplEntity tmpl2 = new WfBusTmplEntity();
|
||||
BpmBusTmplEntity tmpl2 = new BpmBusTmplEntity();
|
||||
tmpl2.setId(102L);
|
||||
tmpl2.setName("费用报销");
|
||||
tmpl2.setAvtag(true);
|
||||
@@ -195,7 +195,7 @@ public class WfBusInitService {
|
||||
""");
|
||||
tmplRepo.save(tmpl2);
|
||||
|
||||
WfProcDefEntity def2=new WfProcDefEntity();
|
||||
BpmProcDefEntity def2=new BpmProcDefEntity();
|
||||
def2.setId(102L);
|
||||
def2.setName("费用报销");
|
||||
def2.setUptim(def.getCrtim());
|
||||
@@ -338,10 +338,10 @@ public class WfBusInitService {
|
||||
|
||||
}
|
||||
|
||||
private final WfBusCateRepo cateRepo;
|
||||
private final BpmBusCateRepo cateRepo;
|
||||
|
||||
private final WfBusTmplRepo tmplRepo;
|
||||
private final BpmBusTmplRepo tmplRepo;
|
||||
|
||||
private final WfProcDefRepo defRepo;
|
||||
private final BpmProcDefRepo defRepo;
|
||||
|
||||
}
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package vben.setup.wf.bus;
|
||||
package vben.setup.bpm.bus;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.persistence.*;
|
||||
@@ -8,8 +8,8 @@ import java.util.Date;
|
||||
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name = "wf_bus_leave")
|
||||
public class WfBusLeaveEntity {
|
||||
@Table(name = "bpm_bus_leave")
|
||||
public class BpmBusLeaveEntity {
|
||||
|
||||
//<<<----------------------BaseMainEntity字段开始-----------------------
|
||||
/**
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package vben.setup.wf.bus;
|
||||
package vben.setup.bpm.bus;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.persistence.Column;
|
||||
@@ -12,8 +12,8 @@ import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
@Table(name = "wf_bus_main")
|
||||
public class WfBusMainEntity {
|
||||
@Table(name = "bpm_bus_main")
|
||||
public class BpmBusMainEntity {
|
||||
|
||||
@Id
|
||||
@Column(length = 32)
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
package vben.setup.wf.bus;
|
||||
package vben.setup.bpm.bus;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.persistence.*;
|
||||
@@ -9,8 +9,8 @@ import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
@Table(name = "wf_bus_tmpl")
|
||||
public class WfBusTmplEntity {
|
||||
@Table(name = "bpm_bus_tmpl")
|
||||
public class BpmBusTmplEntity {
|
||||
|
||||
@Id
|
||||
@Schema(description = "主键ID")
|
||||
@@ -47,7 +47,7 @@ public class WfBusTmplEntity {
|
||||
private Long catid;
|
||||
|
||||
@Transient
|
||||
private String wfXml;
|
||||
private String bpmXml;
|
||||
|
||||
@Schema(description = "流程定义ID")
|
||||
private Long prdid;
|
||||
@@ -0,0 +1,8 @@
|
||||
package vben.setup.bpm.bus;
|
||||
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface BpmBusTmplRepo extends JpaRepository<BpmBusTmplEntity,String> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package vben.setup.bpm.org;
|
||||
|
||||
public class BpmOrgInitService {
|
||||
}
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package vben.setup.wf.org;
|
||||
package vben.setup.bpm.org;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.persistence.Column;
|
||||
@@ -11,8 +11,8 @@ import java.util.Date;
|
||||
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name = "wf_org_node")
|
||||
public class WfOrgNodeEntity {
|
||||
@Table(name = "bpm_org_node")
|
||||
public class BpmOrgNodeEntity {
|
||||
|
||||
@Id
|
||||
@Column(length = 32)
|
||||
+7
-7
@@ -1,4 +1,4 @@
|
||||
package vben.setup.wf.org;
|
||||
package vben.setup.bpm.org;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Data;
|
||||
@@ -7,8 +7,8 @@ import lombok.Data;
|
||||
//层级角色
|
||||
@Data
|
||||
@Entity
|
||||
@Table(name = "wf_org_role")
|
||||
public class WfOrgRoleEntity {
|
||||
@Table(name = "bpm_org_role")
|
||||
public class BpmOrgRoleEntity {
|
||||
@Id
|
||||
@Column(length = 36)
|
||||
private String id;//主键
|
||||
@@ -22,19 +22,19 @@ public class WfOrgRoleEntity {
|
||||
|
||||
private String treid;//角色树ID
|
||||
|
||||
public WfOrgRoleEntity() {
|
||||
public BpmOrgRoleEntity() {
|
||||
}
|
||||
|
||||
public WfOrgRoleEntity(String id) {
|
||||
public BpmOrgRoleEntity(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public WfOrgRoleEntity(String id, String name) {
|
||||
public BpmOrgRoleEntity(String id, String name) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public WfOrgRoleEntity(String id, String name, Integer ornum) {
|
||||
public BpmOrgRoleEntity(String id, String name, Integer ornum) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.ornum = ornum;
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package vben.setup.wf.org;
|
||||
package vben.setup.bpm.org;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
@@ -12,8 +12,8 @@ import lombok.Data;
|
||||
*/
|
||||
@Data
|
||||
@Entity
|
||||
@Table(name = "wf_org_tree_cate")
|
||||
public class WfOrgTreeCateEntity {
|
||||
@Table(name = "bpm_org_tree_cate")
|
||||
public class BpmOrgTreeCateEntity {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package vben.setup.wf.org;
|
||||
package vben.setup.bpm.org;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
@@ -10,8 +10,8 @@ import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
@Table(name = "wf_org_tree")
|
||||
public class WfOrgTreeEntity {
|
||||
@Table(name = "bpm_org_tree")
|
||||
public class BpmOrgTreeEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package vben.setup.wf.proc;
|
||||
package vben.setup.bpm.proc;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.persistence.Column;
|
||||
@@ -12,9 +12,9 @@ import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
@Table(name = "wf_proc_audit")
|
||||
@Table(name = "bpm_proc_audit")
|
||||
@Schema(description = "流程审批")
|
||||
public class WfProcAuditEntity {
|
||||
public class BpmProcAuditEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package vben.setup.wf.proc;
|
||||
package vben.setup.bpm.proc;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.persistence.Column;
|
||||
@@ -9,9 +9,9 @@ import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
@Table(name = "wf_proc_cond")
|
||||
@Table(name = "bpm_proc_cond")
|
||||
@Schema(description = "流程条件")
|
||||
public class WfProcCondEntity {
|
||||
public class BpmProcCondEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package vben.setup.wf.proc;
|
||||
package vben.setup.bpm.proc;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.persistence.*;
|
||||
@@ -9,9 +9,9 @@ import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
@Table(name = "wf_proc_def")
|
||||
@Table(name = "bpm_proc_def")
|
||||
@Schema(description = "流程定义")
|
||||
public class WfProcDefEntity {
|
||||
public class BpmProcDefEntity {
|
||||
|
||||
|
||||
/**
|
||||
@@ -0,0 +1,8 @@
|
||||
package vben.setup.bpm.proc;
|
||||
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface BpmProcDefRepo extends JpaRepository<BpmProcDefEntity,String> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package vben.setup.bpm.proc;
|
||||
|
||||
public class BpmProcInitService {
|
||||
}
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
package vben.setup.wf.proc;
|
||||
package vben.setup.bpm.proc;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.persistence.Column;
|
||||
@@ -12,9 +12,9 @@ import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
@Table(name = "wf_proc_inst")
|
||||
@Table(name = "bpm_proc_inst")
|
||||
@Schema(description = "流程实例")
|
||||
public class WfProcInstEntity {
|
||||
public class BpmProcInstEntity {
|
||||
|
||||
|
||||
/**
|
||||
@@ -95,7 +95,7 @@ public class WfProcInstEntity {
|
||||
@Schema(description = "状态")
|
||||
private String state;
|
||||
|
||||
public WfProcInstEntity() {
|
||||
public BpmProcInstEntity() {
|
||||
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package vben.setup.wf.proc;
|
||||
package vben.setup.bpm.proc;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.persistence.Column;
|
||||
@@ -12,9 +12,9 @@ import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
@Table(name = "wf_proc_node")
|
||||
@Table(name = "bpm_proc_node")
|
||||
@Schema(description = "流程节点")
|
||||
public class WfProcNodeEntity {
|
||||
public class BpmProcNodeEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package vben.setup.wf.proc;
|
||||
package vben.setup.bpm.proc;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.persistence.Column;
|
||||
@@ -12,9 +12,9 @@ import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
@Table(name = "wf_proc_node_hi")
|
||||
@Table(name = "bpm_proc_node_hi")
|
||||
@Schema(description = "流程节点历史")
|
||||
public class WfProcNodeHiEntity {
|
||||
public class BpmProcNodeHiEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package vben.setup.wf.proc;
|
||||
package vben.setup.bpm.proc;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.persistence.Column;
|
||||
@@ -9,9 +9,9 @@ import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
@Table(name = "wf_proc_param")
|
||||
@Table(name = "bpm_proc_param")
|
||||
@Schema(description = "流程参数")
|
||||
public class WfProcParamEntity {
|
||||
public class BpmProcParamEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package vben.setup.wf.proc;
|
||||
package vben.setup.bpm.proc;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.persistence.Column;
|
||||
@@ -12,9 +12,9 @@ import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
@Table(name = "wf_proc_task")
|
||||
@Table(name = "bpm_proc_task")
|
||||
@Schema(description = "流程任务")
|
||||
public class WfProcTaskEntity {
|
||||
public class BpmProcTaskEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package vben.setup.wf.proc;
|
||||
package vben.setup.bpm.proc;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.persistence.Column;
|
||||
@@ -12,9 +12,9 @@ import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
@Table(name = "wf_proc_task_hi")
|
||||
@Table(name = "bpm_proc_task_hi")
|
||||
@Schema(description = "流程任务历史")
|
||||
public class WfProcTaskHiEntity {
|
||||
public class BpmProcTaskHiEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package vben.setup.wf.todo;
|
||||
package vben.setup.bpm.todo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.persistence.Column;
|
||||
@@ -11,9 +11,9 @@ import java.util.Date;
|
||||
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name = "wf_todo_done")
|
||||
@Table(name = "bpm_todo_done")
|
||||
@Schema(description = "流程待办完结")
|
||||
public class WfTodoDoneEntity {
|
||||
public class BpmTodoDoneEntity {
|
||||
|
||||
@Id
|
||||
@Column(length = 32)
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
package vben.setup.wf.todo;
|
||||
package vben.setup.bpm.todo;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@@ -9,9 +9,9 @@ import java.util.Date;
|
||||
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name = "wf_todo_hist")
|
||||
@Table(name = "bpm_todo_hist")
|
||||
@Schema(description = "待办历史记录")
|
||||
public class WfTodoHistEntity {
|
||||
public class BpmTodoHistEntity {
|
||||
|
||||
@Id
|
||||
@Column(length = 32)
|
||||
@@ -54,7 +54,7 @@ public class WfTodoHistEntity {
|
||||
private String cruid;
|
||||
|
||||
// @ManyToMany
|
||||
// @JoinTable(name = "wf_todo_user", joinColumns = {@JoinColumn(name = "tid")},
|
||||
// @JoinTable(name = "bpm_todo_user", joinColumns = {@JoinColumn(name = "tid")},
|
||||
// inverseJoinColumns = {@JoinColumn(name = "uid")})
|
||||
// private List<SysOrg> tamen;
|
||||
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
package vben.setup.wf.todo;
|
||||
package vben.setup.bpm.todo;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@@ -12,9 +12,9 @@ import java.util.Date;
|
||||
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name = "wf_todo_main")
|
||||
@Table(name = "bpm_todo_main")
|
||||
@Schema(description = "流程待办")
|
||||
public class WfTodoMainEntity {
|
||||
public class BpmTodoMainEntity {
|
||||
|
||||
@Id
|
||||
@Column(length = 32)
|
||||
@@ -57,7 +57,7 @@ public class WfTodoMainEntity {
|
||||
private String cruid;
|
||||
|
||||
// @ManyToMany
|
||||
// @JoinTable(name = "wf_todo_user", joinColumns = {@JoinColumn(name = "tid")},
|
||||
// @JoinTable(name = "bpm_todo_user", joinColumns = {@JoinColumn(name = "tid")},
|
||||
// inverseJoinColumns = {@JoinColumn(name = "uid")})
|
||||
// private List<SysOrg> tamen;
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package vben.setup.wf.todo;
|
||||
package vben.setup.bpm.todo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.persistence.Column;
|
||||
@@ -10,9 +10,9 @@ import lombok.Data;
|
||||
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name = "wf_todo_user")
|
||||
@Table(name = "bpm_todo_user")
|
||||
@Schema(description = "用户待办记录")
|
||||
public class WfTodoUserEntity {
|
||||
public class BpmTodoUserEntity {
|
||||
|
||||
@Id
|
||||
@Column(length = 32)
|
||||
@@ -14,7 +14,7 @@ import vben.setup.sys.perm.menu.SysPermMenuInitService;
|
||||
import vben.setup.sys.perm.role.SysPermRoleInitService;
|
||||
import vben.setup.tool.dict.ToolDictInitService;
|
||||
import vben.setup.tool.num.ToolNumInitService;
|
||||
import vben.setup.wf.bus.WfBusInitService;
|
||||
import vben.setup.bpm.bus.BpmBusInitService;
|
||||
|
||||
/**
|
||||
* 数据初始化
|
||||
@@ -36,9 +36,9 @@ public class DataInitService {
|
||||
groupInitService.init();
|
||||
|
||||
menuInitService.initBase();
|
||||
menuInitService.initWf();
|
||||
menuInitService.initBpm();
|
||||
apiInitService.initBase();
|
||||
apiInitService.initWf();
|
||||
apiInitService.initBpm();
|
||||
roleInitService.init();
|
||||
|
||||
configInitService.init();
|
||||
@@ -48,7 +48,7 @@ public class DataInitService {
|
||||
numInitService.init();
|
||||
|
||||
//流程相关数据
|
||||
wfBusInitService.init();
|
||||
bpmBusInitService.init();
|
||||
}
|
||||
|
||||
private final JdbcHelper jdbcHelper;
|
||||
@@ -75,7 +75,7 @@ public class DataInitService {
|
||||
|
||||
private final ToolNumInitService numInitService;
|
||||
|
||||
private final WfBusInitService wfBusInitService;
|
||||
private final BpmBusInitService bpmBusInitService;
|
||||
|
||||
|
||||
}
|
||||
|
||||
+4
-4
@@ -453,7 +453,7 @@ public class SysPermApiInitService {
|
||||
insert(list);
|
||||
}
|
||||
|
||||
public void initWf() {
|
||||
public void initBpm() {
|
||||
List<SysPermApiEntity> list = new ArrayList<>();
|
||||
|
||||
SysPermApiEntity a603001 = new SysPermApiEntity();
|
||||
@@ -461,7 +461,7 @@ public class SysPermApiInitService {
|
||||
a603001.setOrnum(603001);
|
||||
a603001.setName("流程查询");
|
||||
a603001.setMenid(6030L);
|
||||
a603001.setPerm("wfbus:main:query");
|
||||
a603001.setPerm("bpmbus:main:query");
|
||||
list.add(a603001);
|
||||
|
||||
SysPermApiEntity a603002 = new SysPermApiEntity();
|
||||
@@ -469,7 +469,7 @@ public class SysPermApiInitService {
|
||||
a603002.setOrnum(603002);
|
||||
a603002.setName("流程新增");
|
||||
a603002.setMenid(6030L);
|
||||
a603002.setPerm("wfbus:main:add");
|
||||
a603002.setPerm("bpmbus:main:add");
|
||||
list.add(a603002);
|
||||
|
||||
SysPermApiEntity a603003 = new SysPermApiEntity();
|
||||
@@ -477,7 +477,7 @@ public class SysPermApiInitService {
|
||||
a603003.setOrnum(603003);
|
||||
a603003.setName("流程编辑");
|
||||
a603003.setMenid(6030L);
|
||||
a603003.setPerm("wfbus:main:edit");
|
||||
a603003.setPerm("bpmbus:main:edit");
|
||||
list.add(a603003);
|
||||
|
||||
insert(list);
|
||||
|
||||
+11
-11
@@ -288,14 +288,14 @@ public class SysPermMenuInitService {
|
||||
insert(list);
|
||||
}
|
||||
|
||||
public void initWf() {
|
||||
public void initBpm() {
|
||||
List<SysPermMenuEntity> list=new ArrayList<>();
|
||||
SysPermMenuEntity m6000 = new SysPermMenuEntity();
|
||||
m6000.setId(6000L);
|
||||
m6000.setIcon("streamline-sharp:text-flow-rows");
|
||||
m6000.setName("流程管理");
|
||||
m6000.setOrnum(6000);
|
||||
m6000.setPath("wf");
|
||||
m6000.setPath("bpm");
|
||||
m6000.setPid(0L);
|
||||
m6000.setType("1");
|
||||
m6000.setComp("Layout");
|
||||
@@ -303,7 +303,7 @@ public class SysPermMenuInitService {
|
||||
|
||||
SysPermMenuEntity m6010 = new SysPermMenuEntity();
|
||||
m6010.setId(6010L);
|
||||
m6010.setComp("wf/bus/cate/index");
|
||||
m6010.setComp("bpm/bus/cate/index");
|
||||
m6010.setIcon("tabler:category-plus");
|
||||
m6010.setName("流程分类");
|
||||
m6010.setOrnum(6010);
|
||||
@@ -313,7 +313,7 @@ public class SysPermMenuInitService {
|
||||
|
||||
SysPermMenuEntity m6020 = new SysPermMenuEntity();
|
||||
m6020.setId(6020L);
|
||||
m6020.setComp("wf/bus/tmpl/index");
|
||||
m6020.setComp("bpm/bus/tmpl/index");
|
||||
m6020.setIcon("carbon:prompt-template");
|
||||
m6020.setName("流程模板");
|
||||
m6020.setOrnum(6020);
|
||||
@@ -323,7 +323,7 @@ public class SysPermMenuInitService {
|
||||
|
||||
SysPermMenuEntity m6021 = new SysPermMenuEntity();
|
||||
m6021.setId(6021L);
|
||||
m6021.setComp("wf/bus/tmpl/edit");
|
||||
m6021.setComp("bpm/bus/tmpl/edit");
|
||||
m6021.setIcon("carbon:prompt-template");
|
||||
m6021.setName("流程模板编辑");
|
||||
m6021.setOrnum(6021);
|
||||
@@ -335,7 +335,7 @@ public class SysPermMenuInitService {
|
||||
|
||||
SysPermMenuEntity m6030 = new SysPermMenuEntity();
|
||||
m6030.setId(6030L);
|
||||
m6030.setComp("wf/bus/main/index");
|
||||
m6030.setComp("bpm/bus/main/index");
|
||||
m6030.setIcon("ri:instance-line");
|
||||
m6030.setName("流程清单");
|
||||
m6030.setOrnum(6030);
|
||||
@@ -345,7 +345,7 @@ public class SysPermMenuInitService {
|
||||
|
||||
SysPermMenuEntity m6031 = new SysPermMenuEntity();
|
||||
m6031.setId(6031L);
|
||||
m6031.setComp("wf/bus/main/edit");
|
||||
m6031.setComp("bpm/bus/main/edit");
|
||||
m6031.setIcon("ri:instance-line");
|
||||
m6031.setName("流程编辑");
|
||||
m6031.setOrnum(6031);
|
||||
@@ -357,7 +357,7 @@ public class SysPermMenuInitService {
|
||||
|
||||
SysPermMenuEntity m6032 = new SysPermMenuEntity();
|
||||
m6032.setId(6032L);
|
||||
m6032.setComp("wf/bus/main/view");
|
||||
m6032.setComp("bpm/bus/main/view");
|
||||
m6032.setIcon("ri:instance-line");
|
||||
m6032.setName("流程查看");
|
||||
m6032.setOrnum(6032);
|
||||
@@ -369,7 +369,7 @@ public class SysPermMenuInitService {
|
||||
|
||||
SysPermMenuEntity m6040 = new SysPermMenuEntity();
|
||||
m6040.setId(6040L);
|
||||
m6040.setComp("wf/todo/index");
|
||||
m6040.setComp("bpm/todo/index");
|
||||
m6040.setIcon("ri:todo-line");
|
||||
m6040.setName("流程待办");
|
||||
m6040.setOrnum(6040);
|
||||
@@ -379,7 +379,7 @@ public class SysPermMenuInitService {
|
||||
|
||||
SysPermMenuEntity m6050 = new SysPermMenuEntity();
|
||||
m6050.setId(6050L);
|
||||
m6050.setComp("wf/org/tree/index");
|
||||
m6050.setComp("bpm/org/tree/index");
|
||||
m6050.setIcon("mdi:workflow-outline");
|
||||
m6050.setName("流程组织");
|
||||
m6050.setOrnum(6050);
|
||||
@@ -389,7 +389,7 @@ public class SysPermMenuInitService {
|
||||
|
||||
SysPermMenuEntity m6051 = new SysPermMenuEntity();
|
||||
m6051.setId(6051L);
|
||||
m6051.setComp("wf/org/node/index");
|
||||
m6051.setComp("bpm/org/node/index");
|
||||
m6051.setIcon("mdi:workflow-outline");
|
||||
m6051.setName("流程组织节点");
|
||||
m6051.setOrnum(6051);
|
||||
|
||||
+4
-4
@@ -39,10 +39,10 @@ public class SysPermRoleInitService {
|
||||
role2.setOrgs(List.of(new SysOrg("u6"),new SysOrg("u7"),new SysOrg("u8"),new SysOrg("u9")));
|
||||
role2.setMenus(menuRepo.findByNameContaining("流程"));
|
||||
List<SysPermApiEntity> apiList = new ArrayList<>();
|
||||
apiList.add(apiRepo.findByPerm("wfbus:main:query"));
|
||||
apiList.add(apiRepo.findByPerm("wfbus:main:add"));
|
||||
apiList.add(apiRepo.findByPerm("wfbus:main:edit"));
|
||||
// apiList.add(apiRepo.findByPerm("wfbus:main:appv"));
|
||||
apiList.add(apiRepo.findByPerm("bpmbus:main:query"));
|
||||
apiList.add(apiRepo.findByPerm("bpmbus:main:add"));
|
||||
apiList.add(apiRepo.findByPerm("bpmbus:main:edit"));
|
||||
// apiList.add(apiRepo.findByPerm("bpmbus:main:appv"));
|
||||
role2.setApis(apiList);
|
||||
list.add(role2);
|
||||
insert(list);
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
package vben.setup.wf.bus;
|
||||
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface WfBusCateRepo extends JpaRepository<WfBusCateEntity,String> {
|
||||
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package vben.setup.wf.bus;
|
||||
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface WfBusTmplRepo extends JpaRepository<WfBusTmplEntity,String> {
|
||||
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package vben.setup.wf.org;
|
||||
|
||||
public class WfOrgInitService {
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package vben.setup.wf.proc;
|
||||
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface WfProcDefRepo extends JpaRepository<WfProcDefEntity,String> {
|
||||
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package vben.setup.wf.proc;
|
||||
|
||||
public class WfProcInitService {
|
||||
}
|
||||
@@ -210,7 +210,7 @@ xss:
|
||||
excludeUrls:
|
||||
- /system/notice
|
||||
- /oa/flow/tmpl
|
||||
- /wf/bus/tmpl
|
||||
- /bpm/bus/tmpl
|
||||
|
||||
--- # 分布式锁 lock4j 全局配置
|
||||
lock4j:
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
<modules>
|
||||
<module>vben-base</module>
|
||||
<module>vben-wf</module>
|
||||
<module>vben-bpm</module>
|
||||
</modules>
|
||||
|
||||
<artifactId>vben-modules</artifactId>
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package vben.base.auth.home;
|
||||
package vben.base.auth.root;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -9,7 +9,7 @@
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>vben-wf</artifactId>
|
||||
<artifactId>vben-bpm</artifactId>
|
||||
|
||||
<description>
|
||||
工作流模块
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package vben.wf.bus.cate;
|
||||
package vben.bpm.bus.cate;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.List;
|
||||
* 流程分类
|
||||
*/
|
||||
@Data
|
||||
public class WfBusCate {
|
||||
public class BpmBusCate {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
@@ -30,7 +30,7 @@ public class WfBusCate {
|
||||
/**
|
||||
* 子菜单
|
||||
*/
|
||||
private List<WfBusCate> children = new ArrayList<>();
|
||||
private List<BpmBusCate> children = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 是否可用
|
||||
+10
-10
@@ -1,4 +1,4 @@
|
||||
package vben.wf.bus.cate;
|
||||
package vben.bpm.bus.cate;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -12,11 +12,11 @@ import java.util.List;
|
||||
* 流程分类管理
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("wf/bus/cate")
|
||||
@RequestMapping("bpm/bus/cate")
|
||||
@RequiredArgsConstructor
|
||||
public class WfBusCateApi {
|
||||
public class BpmBusCateApi {
|
||||
|
||||
private final WfBusCateService service;
|
||||
private final BpmBusCateService service;
|
||||
|
||||
/**
|
||||
* 流程分类列表查询
|
||||
@@ -24,8 +24,8 @@ public class WfBusCateApi {
|
||||
* @return 分类列表集合
|
||||
*/
|
||||
@GetMapping("list")
|
||||
public R<List<WfBusCate>> list(String name) {
|
||||
Sqler sqler = new Sqler("t.*","wf_bus_cate");
|
||||
public R<List<BpmBusCate>> list(String name) {
|
||||
Sqler sqler = new Sqler("t.*","bpm_bus_cate");
|
||||
//sqler.addSelect("t.pid,t.notes,t.crtim,t.uptim,t.ornum");
|
||||
sqler.addLike("t.name", name);
|
||||
sqler.addOrder("t.ornum");
|
||||
@@ -49,8 +49,8 @@ public class WfBusCateApi {
|
||||
* @return 流程分类对象
|
||||
*/
|
||||
@GetMapping("info/{id}")
|
||||
public R<WfBusCate> info(@PathVariable Long id) {
|
||||
WfBusCate main = service.findById(id);
|
||||
public R<BpmBusCate> info(@PathVariable Long id) {
|
||||
BpmBusCate main = service.findById(id);
|
||||
return R.ok(main);
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public class WfBusCateApi {
|
||||
* @return 流程分类ID
|
||||
*/
|
||||
@PostMapping
|
||||
public R<Long> post(@RequestBody WfBusCate main) {
|
||||
public R<Long> post(@RequestBody BpmBusCate main) {
|
||||
if(main.getPid()==null){
|
||||
main.setPid(0L);
|
||||
}
|
||||
@@ -74,7 +74,7 @@ public class WfBusCateApi {
|
||||
* @return 流程分类ID
|
||||
*/
|
||||
@PutMapping
|
||||
public R<Long> put(@RequestBody WfBusCate main) {
|
||||
public R<Long> put(@RequestBody BpmBusCate main) {
|
||||
if(main.getPid()==null){
|
||||
main.setPid(0L);
|
||||
}
|
||||
+13
-13
@@ -1,4 +1,4 @@
|
||||
package vben.wf.bus.cate;
|
||||
package vben.bpm.bus.cate;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
@@ -14,16 +14,16 @@ import java.util.List;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class WfBusCateDao {
|
||||
public class BpmBusCateDao {
|
||||
|
||||
public WfBusCate findById(Long id) {
|
||||
String sql = "select * from wf_bus_cate where id = ?";
|
||||
return jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(WfBusCate.class), id);
|
||||
public BpmBusCate findById(Long id) {
|
||||
String sql = "select * from bpm_bus_cate where id = ?";
|
||||
return jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(BpmBusCate.class), id);
|
||||
}
|
||||
|
||||
public void insert(WfBusCate cate) {
|
||||
public void insert(BpmBusCate cate) {
|
||||
cate.setId(IdUtils.getSnowflakeNextId());
|
||||
Isqler isqler = new Isqler("wf_bus_cate");
|
||||
Isqler isqler = new Isqler("bpm_bus_cate");
|
||||
isqler.add("id", cate.getId());
|
||||
isqler.add("name", cate.getName());
|
||||
isqler.add("pid", cate.getPid());
|
||||
@@ -37,8 +37,8 @@ public class WfBusCateDao {
|
||||
jdbcHelper.getTp().update(isqler.getSql(), isqler.getParams());
|
||||
}
|
||||
|
||||
public void update(WfBusCate cate) {
|
||||
Usqler usqler = new Usqler("wf_bus_cate");
|
||||
public void update(BpmBusCate cate) {
|
||||
Usqler usqler = new Usqler("bpm_bus_cate");
|
||||
usqler.addWhere("id=?", cate.getId());
|
||||
usqler.add("name", cate.getName());
|
||||
usqler.add("pid", cate.getPid());
|
||||
@@ -51,12 +51,12 @@ public class WfBusCateDao {
|
||||
}
|
||||
|
||||
public void deleteById(Long id) {
|
||||
String sql = "delete from wf_bus_cate where id=?";
|
||||
String sql = "delete from bpm_bus_cate where id=?";
|
||||
jdbcHelper.getTp().update(sql, id);
|
||||
}
|
||||
|
||||
public List<Stree> findTree(Long id){
|
||||
Sqler sqler = new Sqler("wf_bus_cate");
|
||||
Sqler sqler = new Sqler("bpm_bus_cate");
|
||||
sqler.addSelect("pid");
|
||||
sqler.addWhere("t.avtag = 1");
|
||||
if (id!=null) {
|
||||
@@ -67,9 +67,9 @@ public class WfBusCateDao {
|
||||
return jdbcHelper.findStreeList(sqler);
|
||||
}
|
||||
|
||||
public List<WfBusCate> findList(Sqler sqler) {
|
||||
public List<BpmBusCate> findList(Sqler sqler) {
|
||||
return jdbcHelper.getTp().query(sqler.getSql(), sqler.getParams(),
|
||||
new BeanPropertyRowMapper<>(WfBusCate.class));
|
||||
new BeanPropertyRowMapper<>(BpmBusCate.class));
|
||||
}
|
||||
|
||||
private final JdbcHelper jdbcHelper;
|
||||
+7
-7
@@ -1,4 +1,4 @@
|
||||
package vben.wf.bus.cate;
|
||||
package vben.bpm.bus.cate;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -13,15 +13,15 @@ import java.util.List;
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@RequiredArgsConstructor
|
||||
public class WfBusCateService {
|
||||
public class BpmBusCateService {
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
public List<WfBusCate> findList(Sqler sqler) {
|
||||
public List<BpmBusCate> findList(Sqler sqler) {
|
||||
return dao.findList(sqler);
|
||||
}
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
public WfBusCate findById(Long id) {
|
||||
public BpmBusCate findById(Long id) {
|
||||
return dao.findById(id);
|
||||
}
|
||||
|
||||
@@ -30,12 +30,12 @@ public class WfBusCateService {
|
||||
return dao.findTree(id);
|
||||
}
|
||||
|
||||
public void insert(WfBusCate main) {
|
||||
public void insert(BpmBusCate main) {
|
||||
main.setCruid(LoginHelper.getUserId());
|
||||
dao.insert(main);
|
||||
}
|
||||
|
||||
public void update(WfBusCate main) {
|
||||
public void update(BpmBusCate main) {
|
||||
main.setUpuid(LoginHelper.getUserId());
|
||||
main.setUptim(new Date());
|
||||
dao.update(main);
|
||||
@@ -48,6 +48,6 @@ public class WfBusCateService {
|
||||
return ids.length;
|
||||
}
|
||||
|
||||
private final WfBusCateDao dao;
|
||||
private final BpmBusCateDao dao;
|
||||
|
||||
}
|
||||
+4
-4
@@ -1,7 +1,7 @@
|
||||
package vben.wf.bus.leave;
|
||||
package vben.bpm.bus.leave;
|
||||
|
||||
import lombok.Data;
|
||||
import vben.wf.bus.main.WfBusMain;
|
||||
import vben.bpm.bus.main.BpmBusMain;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.Date;
|
||||
* 请假申请
|
||||
*/
|
||||
@Data
|
||||
public class WfBusLeave {
|
||||
public class BpmBusLeave {
|
||||
|
||||
//<<<----------------------BaseMainEntity字段开始-----------------------
|
||||
/**
|
||||
@@ -86,6 +86,6 @@ public class WfBusLeave {
|
||||
/**
|
||||
* 流程对象
|
||||
*/
|
||||
private WfBusMain flowBo;
|
||||
private BpmBusMain flowBo;
|
||||
|
||||
}
|
||||
+9
-9
@@ -1,4 +1,4 @@
|
||||
package vben.wf.bus.leave;
|
||||
package vben.bpm.bus.leave;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -10,11 +10,11 @@ import vben.common.jdbc.sqler.Sqler;
|
||||
* 请假申请
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("wf/bus/leave")
|
||||
@RequestMapping("bpm/bus/leave")
|
||||
@RequiredArgsConstructor
|
||||
public class WfBusLeaveApi {
|
||||
public class BpmBusLeaveApi {
|
||||
|
||||
private final WfBusLeaveService service;
|
||||
private final BpmBusLeaveService service;
|
||||
|
||||
/**
|
||||
* 请假分页查询
|
||||
@@ -23,7 +23,7 @@ public class WfBusLeaveApi {
|
||||
*/
|
||||
@GetMapping
|
||||
public R<PageData> get(String name) {
|
||||
Sqler sqler = new Sqler("wf_bus_leave");
|
||||
Sqler sqler = new Sqler("bpm_bus_leave");
|
||||
sqler.addLike("t.name", name);
|
||||
sqler.addSelect("t.notes");
|
||||
return R.ok(service.findPageData(sqler));
|
||||
@@ -35,8 +35,8 @@ public class WfBusLeaveApi {
|
||||
* @return 请假对象
|
||||
*/
|
||||
@GetMapping("info/{id}")
|
||||
public R<WfBusLeave> info(@PathVariable Long id) {
|
||||
WfBusLeave main = service.findById(id);
|
||||
public R<BpmBusLeave> info(@PathVariable Long id) {
|
||||
BpmBusLeave main = service.findById(id);
|
||||
return R.ok(main);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class WfBusLeaveApi {
|
||||
* @return 请假ID
|
||||
*/
|
||||
@PostMapping
|
||||
public R<Long> post(@RequestBody WfBusLeave main) {
|
||||
public R<Long> post(@RequestBody BpmBusLeave main) {
|
||||
return R.ok(null,service.insert(main));
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class WfBusLeaveApi {
|
||||
* @return 请假ID
|
||||
*/
|
||||
@PutMapping
|
||||
public R<Long> put(@RequestBody WfBusLeave main) throws Exception {
|
||||
public R<Long> put(@RequestBody BpmBusLeave main) throws Exception {
|
||||
return R.ok(null,service.update(main));
|
||||
}
|
||||
|
||||
+7
-7
@@ -1,4 +1,4 @@
|
||||
package vben.wf.bus.leave;
|
||||
package vben.bpm.bus.leave;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
@@ -14,21 +14,21 @@ import java.lang.reflect.Field;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class WfBusLeaveDao {
|
||||
public class BpmBusLeaveDao {
|
||||
|
||||
private static final String table = "wf_bus_leave";
|
||||
private static final String table = "bpm_bus_leave";
|
||||
|
||||
public PageData findPageData(Sqler sqler) {
|
||||
return jdbcHelper.findPageData(sqler);
|
||||
}
|
||||
|
||||
public WfBusLeave findById(Long id) {
|
||||
public BpmBusLeave findById(Long id) {
|
||||
String sql = "select * from "+table+" where id = ?";
|
||||
return jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(WfBusLeave.class), id);
|
||||
return jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(BpmBusLeave.class), id);
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
public void insert(WfBusLeave main) {
|
||||
public void insert(BpmBusLeave main) {
|
||||
Isqler sqler = new Isqler(table);
|
||||
Class<?> clazz = main.getClass();
|
||||
Field[] fields = clazz.getDeclaredFields();
|
||||
@@ -42,7 +42,7 @@ public class WfBusLeaveDao {
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
public void update(WfBusLeave main) {
|
||||
public void update(BpmBusLeave main) {
|
||||
Usqler sqler = new Usqler(table);
|
||||
sqler.addWhere("id=?", main.getId());
|
||||
Class<?> clazz = main.getClass();
|
||||
+13
-13
@@ -1,4 +1,4 @@
|
||||
package vben.wf.bus.leave;
|
||||
package vben.bpm.bus.leave;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -8,25 +8,25 @@ import vben.common.core.utils.IdUtils;
|
||||
import vben.common.jdbc.dto.PageData;
|
||||
import vben.common.jdbc.sqler.Sqler;
|
||||
import vben.common.satoken.utils.LoginHelper;
|
||||
import vben.wf.bus.main.WfBusMain;
|
||||
import vben.wf.bus.main.WfBusMainService;
|
||||
import vben.bpm.bus.main.BpmBusMain;
|
||||
import vben.bpm.bus.main.BpmBusMainService;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@RequiredArgsConstructor
|
||||
public class WfBusLeaveService {
|
||||
public class BpmBusLeaveService {
|
||||
|
||||
public PageData findPageData(Sqler sqler) {
|
||||
return dao.findPageData(sqler);
|
||||
}
|
||||
|
||||
public WfBusLeave findById(Long id) {
|
||||
public BpmBusLeave findById(Long id) {
|
||||
return dao.findById(id);
|
||||
}
|
||||
|
||||
public Long insert(WfBusLeave main) {
|
||||
public Long insert(BpmBusLeave main) {
|
||||
if(main.getSttim() != null&&main.getEntim()!=null) {
|
||||
long day = DateUtils.betweenDay(main.getSttim(), main.getEntim(), true);
|
||||
main.setDays((int) day + 1);
|
||||
@@ -37,22 +37,22 @@ public class WfBusLeaveService {
|
||||
|
||||
|
||||
//启动流程
|
||||
WfBusMain flowBo = main.getFlowBo();
|
||||
BpmBusMain flowBo = main.getFlowBo();
|
||||
flowBo.setId(Long.valueOf(main.getId()));
|
||||
flowBo.setCruid(main.getCruid());
|
||||
wfBusMainService.insert(flowBo);
|
||||
bpmBusMainService.insert(flowBo);
|
||||
return main.getId();
|
||||
}
|
||||
|
||||
public Long update(WfBusLeave main) {
|
||||
public Long update(BpmBusLeave main) {
|
||||
main.setUpuid(LoginHelper.getUserId());
|
||||
main.setUptim(new Date());
|
||||
dao.update(main);
|
||||
|
||||
|
||||
//流转流程
|
||||
WfBusMain flowBo = main.getFlowBo();
|
||||
wfBusMainService.update(flowBo);
|
||||
BpmBusMain flowBo = main.getFlowBo();
|
||||
bpmBusMainService.update(flowBo);
|
||||
return main.getId();
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class WfBusLeaveService {
|
||||
return ids.length;
|
||||
}
|
||||
|
||||
private final WfBusMainService wfBusMainService;
|
||||
private final BpmBusMainService bpmBusMainService;
|
||||
|
||||
private final WfBusLeaveDao dao;
|
||||
private final BpmBusLeaveDao dao;
|
||||
}
|
||||
+5
-5
@@ -1,8 +1,8 @@
|
||||
package vben.wf.bus.main;
|
||||
package vben.bpm.bus.main;
|
||||
|
||||
import lombok.Data;
|
||||
import vben.wf.root.domain.Zproc;
|
||||
import vben.wf.root.domain.bo.WfStartBo;
|
||||
import vben.bpm.root.domain.Zproc;
|
||||
import vben.bpm.root.domain.bo.BpmStartBo;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.Date;
|
||||
* 流程记录
|
||||
*/
|
||||
@Data
|
||||
public class WfBusMain {
|
||||
public class BpmBusMain {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
@@ -85,5 +85,5 @@ public class WfBusMain {
|
||||
/**
|
||||
* 流程启动对象
|
||||
*/
|
||||
private WfStartBo wfStartBo;
|
||||
private BpmStartBo bpmStartBo;
|
||||
}
|
||||
+14
-14
@@ -1,4 +1,4 @@
|
||||
package vben.wf.bus.main;
|
||||
package vben.bpm.bus.main;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -11,21 +11,21 @@ import vben.common.jdbc.sqler.Sqler;
|
||||
* 流程记录管理
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("wf/bus/main")
|
||||
@RequestMapping("bpm/bus/main")
|
||||
@RequiredArgsConstructor
|
||||
public class WfBusMainApi {
|
||||
public class BpmBusMainApi {
|
||||
|
||||
private final WfBusMainService service;
|
||||
private final BpmBusMainService service;
|
||||
|
||||
/**
|
||||
* 流程分页查询
|
||||
* @param name 流程主题
|
||||
* @return 分页数据
|
||||
*/
|
||||
@SaCheckPermission("wfbus:main:query")
|
||||
@SaCheckPermission("bpmbus:main:query")
|
||||
@GetMapping
|
||||
public R<PageData> get(String name) {
|
||||
Sqler sqler = new Sqler("wf_bus_main");
|
||||
Sqler sqler = new Sqler("bpm_bus_main");
|
||||
sqler.addLike("t.name", name);
|
||||
sqler.addSelect("t.state,t.notes");
|
||||
sqler.addDescOrder("t.crtim");
|
||||
@@ -38,10 +38,10 @@ public class WfBusMainApi {
|
||||
* @param id 流程ID
|
||||
* @return 流程对象
|
||||
*/
|
||||
@SaCheckPermission("wfbus:main:query")
|
||||
@SaCheckPermission("bpmbus:main:query")
|
||||
@GetMapping("info/{id}")
|
||||
public R<WfBusMain> info(@PathVariable Long id) {
|
||||
WfBusMain main = service.findById(id);
|
||||
public R<BpmBusMain> info(@PathVariable Long id) {
|
||||
BpmBusMain main = service.findById(id);
|
||||
return R.ok(main);
|
||||
}
|
||||
|
||||
@@ -50,9 +50,9 @@ public class WfBusMainApi {
|
||||
* @param main 流程对象
|
||||
* @return 流程ID
|
||||
*/
|
||||
@SaCheckPermission("wfbus:main:add")
|
||||
@SaCheckPermission("bpmbus:main:add")
|
||||
@PostMapping
|
||||
public R<Long> post(@RequestBody WfBusMain main) {
|
||||
public R<Long> post(@RequestBody BpmBusMain main) {
|
||||
return R.ok(null,service.insert(main));
|
||||
}
|
||||
|
||||
@@ -61,9 +61,9 @@ public class WfBusMainApi {
|
||||
* @param main 流程对象
|
||||
* @return 流程ID
|
||||
*/
|
||||
@SaCheckPermission("wfbus:main:edit")
|
||||
@SaCheckPermission("bpmbus:main:edit")
|
||||
@PutMapping
|
||||
public R<Long> put(@RequestBody WfBusMain main) throws Exception {
|
||||
public R<Long> put(@RequestBody BpmBusMain main) throws Exception {
|
||||
return R.ok(null,service.update(main));
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public class WfBusMainApi {
|
||||
* @param ids 流程ID串
|
||||
* @return 流程数量
|
||||
*/
|
||||
@SaCheckPermission("wfbus:main:delete")
|
||||
@SaCheckPermission("bpmbus:main:delete")
|
||||
@DeleteMapping("{ids}")
|
||||
public R<Integer> delete(@PathVariable Long[] ids) {
|
||||
return R.ok(service.delete(ids));
|
||||
+12
-12
@@ -1,4 +1,4 @@
|
||||
package vben.wf.bus.main;
|
||||
package vben.bpm.bus.main;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
@@ -11,19 +11,19 @@ import vben.common.jdbc.sqler.Usqler;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class WfBusMainDao {
|
||||
public class BpmBusMainDao {
|
||||
|
||||
public PageData findPageData(Sqler sqler) {
|
||||
return jdbcHelper.findPageData(sqler);
|
||||
}
|
||||
|
||||
public WfBusMain findById(Long id) {
|
||||
String sql = "select * from wf_bus_main where id = ?";
|
||||
return jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(WfBusMain.class), id);
|
||||
public BpmBusMain findById(Long id) {
|
||||
String sql = "select * from bpm_bus_main where id = ?";
|
||||
return jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(BpmBusMain.class), id);
|
||||
}
|
||||
|
||||
public void insert(WfBusMain main) {
|
||||
Isqler sqler = new Isqler("wf_bus_main");
|
||||
public void insert(BpmBusMain main) {
|
||||
Isqler sqler = new Isqler("bpm_bus_main");
|
||||
sqler.add("id", main.getId());
|
||||
sqler.add("name", main.getName());
|
||||
sqler.add("avtag", main.getAvtag());
|
||||
@@ -39,8 +39,8 @@ public class WfBusMainDao {
|
||||
jdbcHelper.getTp().update(sqler.getSql(), sqler.getParams());
|
||||
}
|
||||
|
||||
public void update(WfBusMain main) {
|
||||
Usqler sqler = new Usqler("wf_bus_main");
|
||||
public void update(BpmBusMain main) {
|
||||
Usqler sqler = new Usqler("bpm_bus_main");
|
||||
sqler.addWhere("id=?", main.getId());
|
||||
sqler.add("name", main.getName());
|
||||
sqler.add("avtag", main.getAvtag());
|
||||
@@ -57,13 +57,13 @@ public class WfBusMainDao {
|
||||
}
|
||||
|
||||
public void deleteById(Long id) {
|
||||
String sql = "delete from wf_bus_main where id=?";
|
||||
String sql = "delete from bpm_bus_main where id=?";
|
||||
jdbcHelper.getTp().update(sql, id);
|
||||
}
|
||||
|
||||
|
||||
public void updateState(WfBusMain main) {
|
||||
Usqler sqler = new Usqler("wf_bus_main");
|
||||
public void updateState(BpmBusMain main) {
|
||||
Usqler sqler = new Usqler("bpm_bus_main");
|
||||
sqler.addWhere("id=?", main.getId());
|
||||
sqler.add("state", main.getState());
|
||||
jdbcHelper.getTp().update(sqler.getSql(), sqler.getParams());
|
||||
+14
-14
@@ -1,4 +1,4 @@
|
||||
package vben.wf.bus.main;
|
||||
package vben.bpm.bus.main;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -9,8 +9,8 @@ import vben.common.core.utils.StrUtils;
|
||||
import vben.common.jdbc.dto.PageData;
|
||||
import vben.common.jdbc.sqler.Sqler;
|
||||
import vben.common.satoken.utils.LoginHelper;
|
||||
import vben.wf.root.WfService;
|
||||
import vben.wf.root.domain.Zproc;
|
||||
import vben.bpm.root.BpmService;
|
||||
import vben.bpm.root.domain.Zproc;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@@ -18,14 +18,14 @@ import java.util.Date;
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class WfBusMainService {
|
||||
public class BpmBusMainService {
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
public PageData findPageData(Sqler sqler) {
|
||||
return dao.findPageData(sqler);
|
||||
}
|
||||
|
||||
public Long insert(WfBusMain main) {
|
||||
public Long insert(BpmBusMain main) {
|
||||
if(main.getCruid() == null) {
|
||||
main.setCruid(LoginHelper.getUserId());
|
||||
}
|
||||
@@ -41,12 +41,12 @@ public class WfBusMainService {
|
||||
zproc.setProna(main.getName());
|
||||
zproc.setInuid(main.getCruid());
|
||||
zproc.setPrdid(main.getPrdid());
|
||||
zproc.setAtids(main.getWfStartBo().getAtids());
|
||||
zproc.setOpnot(main.getWfStartBo().getOpnot());
|
||||
zproc.setOpurg(main.getWfStartBo().getOpurg());
|
||||
zproc.setAtids(main.getBpmStartBo().getAtids());
|
||||
zproc.setOpnot(main.getBpmStartBo().getOpnot());
|
||||
zproc.setOpurg(main.getBpmStartBo().getOpurg());
|
||||
|
||||
try {
|
||||
wfService.start(zproc);
|
||||
bpmService.start(zproc);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new ServiceException("流程启动异常:"+e.getMessage());
|
||||
@@ -54,7 +54,7 @@ public class WfBusMainService {
|
||||
return main.getId();
|
||||
}
|
||||
|
||||
public Long update(WfBusMain main) {
|
||||
public Long update(BpmBusMain main) {
|
||||
main.setUpuid(LoginHelper.getUserId());
|
||||
main.setUptim(new Date());
|
||||
dao.update(main);
|
||||
@@ -62,7 +62,7 @@ public class WfBusMainService {
|
||||
main.getZproc().setProna(main.getName());
|
||||
main.getZproc().setProid(main.getId());
|
||||
main.getZproc().setInuid(main.getCruid());
|
||||
String state= wfService.flow(main.getZproc());
|
||||
String state= bpmService.flow(main.getZproc());
|
||||
if(StrUtils.isNotBlank(state)){
|
||||
main.setState(state);
|
||||
dao.update(main);
|
||||
@@ -71,7 +71,7 @@ public class WfBusMainService {
|
||||
}
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
public WfBusMain findById(Long id) {
|
||||
public BpmBusMain findById(Long id) {
|
||||
return dao.findById(id);
|
||||
}
|
||||
|
||||
@@ -83,9 +83,9 @@ public class WfBusMainService {
|
||||
return ids.length;
|
||||
}
|
||||
|
||||
private final WfService wfService;
|
||||
private final BpmService bpmService;
|
||||
|
||||
private final WfBusMainDao dao;
|
||||
private final BpmBusMainDao dao;
|
||||
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package vben.wf.bus.tmpl;
|
||||
package vben.bpm.bus.tmpl;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.util.Date;
|
||||
* 流程模板
|
||||
*/
|
||||
@Data
|
||||
public class WfBusTmpl {
|
||||
public class BpmBusTmpl {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
@@ -63,7 +63,7 @@ public class WfBusTmpl {
|
||||
/**
|
||||
* 流程定义XML
|
||||
*/
|
||||
private String wfXml;
|
||||
private String bpmXml;
|
||||
|
||||
/**
|
||||
* 流程定义ID
|
||||
+10
-10
@@ -1,4 +1,4 @@
|
||||
package vben.wf.bus.tmpl;
|
||||
package vben.bpm.bus.tmpl;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -14,11 +14,11 @@ import java.util.List;
|
||||
* 流程模板
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("wf/bus/tmpl")
|
||||
@RequestMapping("bpm/bus/tmpl")
|
||||
@RequiredArgsConstructor
|
||||
public class WfBusTmplApi {
|
||||
public class BpmBusTmplApi {
|
||||
|
||||
private final WfBusTmplService service;
|
||||
private final BpmBusTmplService service;
|
||||
|
||||
/**
|
||||
* 流程模板树状查询
|
||||
@@ -37,7 +37,7 @@ public class WfBusTmplApi {
|
||||
*/
|
||||
@GetMapping
|
||||
public R<PageData> get(String name) {
|
||||
Sqler sqler = new Sqler("wf_bus_tmpl");
|
||||
Sqler sqler = new Sqler("bpm_bus_tmpl");
|
||||
sqler.addLike("t.name", name);
|
||||
sqler.addOrder("t.ornum");
|
||||
sqler.selectCUinfo();
|
||||
@@ -51,7 +51,7 @@ public class WfBusTmplApi {
|
||||
*/
|
||||
@GetMapping("list")
|
||||
public R<List<SidName>> list(Long catid) {
|
||||
Sqler sqler = new Sqler("wf_bus_tmpl");
|
||||
Sqler sqler = new Sqler("bpm_bus_tmpl");
|
||||
sqler.addEqual("t.catid", catid);
|
||||
sqler.addOrder("t.ornum");
|
||||
return R.ok(service.findIdNameList(sqler));
|
||||
@@ -63,8 +63,8 @@ public class WfBusTmplApi {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("info/{id}")
|
||||
public R<WfBusTmpl> info(@PathVariable Long id) {
|
||||
WfBusTmpl main = service.findById(id);
|
||||
public R<BpmBusTmpl> info(@PathVariable Long id) {
|
||||
BpmBusTmpl main = service.findById(id);
|
||||
return R.ok(main);
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ public class WfBusTmplApi {
|
||||
* @return 流程模板ID
|
||||
*/
|
||||
@PostMapping
|
||||
public R<Long> post(@RequestBody WfBusTmpl main) {
|
||||
public R<Long> post(@RequestBody BpmBusTmpl main) {
|
||||
return R.ok(null,service.insert(main));
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ public class WfBusTmplApi {
|
||||
* @return 流程模板ID
|
||||
*/
|
||||
@PutMapping
|
||||
public R<Long> put(@RequestBody WfBusTmpl main) {
|
||||
public R<Long> put(@RequestBody BpmBusTmpl main) {
|
||||
return R.ok(null,service.update(main));
|
||||
}
|
||||
|
||||
+10
-10
@@ -1,4 +1,4 @@
|
||||
package vben.wf.bus.tmpl;
|
||||
package vben.bpm.bus.tmpl;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
@@ -9,17 +9,17 @@ import vben.common.jdbc.sqler.Usqler;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class WfBusTmplDao {
|
||||
public class BpmBusTmplDao {
|
||||
|
||||
|
||||
|
||||
public WfBusTmpl findById(Long id) {
|
||||
String sql = "select * from wf_bus_tmpl where id = ?";
|
||||
return jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(WfBusTmpl.class), id);
|
||||
public BpmBusTmpl findById(Long id) {
|
||||
String sql = "select * from bpm_bus_tmpl where id = ?";
|
||||
return jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(BpmBusTmpl.class), id);
|
||||
}
|
||||
|
||||
public void insert(WfBusTmpl main) {
|
||||
Isqler sqler = new Isqler("wf_bus_tmpl");
|
||||
public void insert(BpmBusTmpl main) {
|
||||
Isqler sqler = new Isqler("bpm_bus_tmpl");
|
||||
sqler.add("id", main.getId());
|
||||
sqler.add("name", main.getName());
|
||||
sqler.add("avtag", main.getAvtag());
|
||||
@@ -38,8 +38,8 @@ public class WfBusTmplDao {
|
||||
jdbcHelper.getTp().update(sqler.getSql(), sqler.getParams());
|
||||
}
|
||||
|
||||
public void update(WfBusTmpl main) {
|
||||
Usqler sqler = new Usqler("wf_bus_tmpl");
|
||||
public void update(BpmBusTmpl main) {
|
||||
Usqler sqler = new Usqler("bpm_bus_tmpl");
|
||||
sqler.addWhere("id=?", main.getId());
|
||||
sqler.add("name", main.getName());
|
||||
sqler.add("avtag", main.getAvtag());
|
||||
@@ -57,7 +57,7 @@ public class WfBusTmplDao {
|
||||
}
|
||||
|
||||
public void deleteById(Long id) {
|
||||
String sql = "delete from wf_bus_tmpl where id=?";
|
||||
String sql = "delete from bpm_bus_tmpl where id=?";
|
||||
jdbcHelper.getTp().update(sql, id);
|
||||
}
|
||||
|
||||
+18
-18
@@ -1,8 +1,9 @@
|
||||
package vben.wf.bus.tmpl;
|
||||
package vben.bpm.bus.tmpl;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import vben.bpm.proc.def.BpmProcDef;
|
||||
import vben.common.core.utils.IdUtils;
|
||||
import vben.common.jdbc.dto.PageData;
|
||||
import vben.common.jdbc.dto.SidName;
|
||||
@@ -10,8 +11,7 @@ import vben.common.jdbc.dto.Stree;
|
||||
import vben.common.jdbc.sqler.JdbcHelper;
|
||||
import vben.common.jdbc.sqler.Sqler;
|
||||
import vben.common.satoken.utils.LoginHelper;
|
||||
import vben.wf.proc.def.WfProcDef;
|
||||
import vben.wf.proc.def.WfProcDefDao;
|
||||
import vben.bpm.proc.def.BpmProcDefDao;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@@ -20,7 +20,7 @@ import java.util.List;
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class WfBusTmplService {
|
||||
public class BpmBusTmplService {
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
public PageData findPageData(Sqler sqler) {
|
||||
@@ -30,8 +30,8 @@ public class WfBusTmplService {
|
||||
|
||||
public List<Stree> findTreeList() {
|
||||
String sql="SELECT id,pid,name,TYPE FROM ( " +
|
||||
" SELECT id,pid,name,'cate' type,ORNUM FROM wf_bus_cate WHERE avtag=1 " +
|
||||
" UNION ALL SELECT id,catid AS pid,name,'tmpl' type,ORNUM FROM wf_bus_tmpl WHERE avtag=1 " +
|
||||
" SELECT id,pid,name,'cate' type,ORNUM FROM bpm_bus_cate WHERE avtag=1 " +
|
||||
" UNION ALL SELECT id,catid AS pid,name,'tmpl' type,ORNUM FROM bpm_bus_tmpl WHERE avtag=1 " +
|
||||
")t ORDER BY ornum";
|
||||
// List<ZflatTree> list = jdbcHelper.getTp().query(sql, new BeanPropertyRowMapper<>(ZflatTree.class));
|
||||
return jdbcHelper.findStreeList(sql);
|
||||
@@ -42,34 +42,34 @@ public class WfBusTmplService {
|
||||
return jdbcHelper.findSidNameList(sqler);
|
||||
}
|
||||
|
||||
public Long insert(WfBusTmpl main) {
|
||||
public Long insert(BpmBusTmpl main) {
|
||||
main.setId(IdUtils.getSnowflakeNextId());
|
||||
main.setCruid(LoginHelper.getUserId());
|
||||
saveWfDef(main);
|
||||
saveBpmDef(main);
|
||||
tmplDao.insert(main);
|
||||
return main.getId();
|
||||
}
|
||||
|
||||
public Long update(WfBusTmpl main) {
|
||||
saveWfDef(main);
|
||||
public Long update(BpmBusTmpl main) {
|
||||
saveBpmDef(main);
|
||||
main.setUpuid(LoginHelper.getUserId());
|
||||
main.setUptim(new Date());
|
||||
tmplDao.update(main);
|
||||
return main.getId();
|
||||
}
|
||||
|
||||
private void saveWfDef(WfBusTmpl main) {
|
||||
WfProcDef def = new WfProcDef();
|
||||
private void saveBpmDef(BpmBusTmpl main) {
|
||||
BpmProcDef def = new BpmProcDef();
|
||||
def.setId(IdUtils.getSnowflakeNextId());
|
||||
def.setName(main.getName());
|
||||
def.setDixml(main.getWfXml());
|
||||
def.setDixml(main.getBpmXml());
|
||||
String exxml = "<?xml version=\"1.0\" encoding=\"gb2312\"?>"
|
||||
+ "\n<process" + main.getWfXml().split("bpmn2:process")[1]
|
||||
+ "\n<process" + main.getBpmXml().split("bpmn2:process")[1]
|
||||
.replaceAll("bpmn2:", "")
|
||||
.replaceAll("activiti:", "") + "process>";
|
||||
def.setExxml(exxml);
|
||||
def.setBusid(main.getId());
|
||||
wfProcDefDao.insert(def);
|
||||
bpmProcDefDao.insert(def);
|
||||
main.setPrdid(def.getId());
|
||||
}
|
||||
|
||||
@@ -81,14 +81,14 @@ public class WfBusTmplService {
|
||||
}
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
public WfBusTmpl findById(Long id) {
|
||||
public BpmBusTmpl findById(Long id) {
|
||||
return tmplDao.findById(id);
|
||||
}
|
||||
|
||||
|
||||
private final WfProcDefDao wfProcDefDao;
|
||||
private final BpmProcDefDao bpmProcDefDao;
|
||||
|
||||
private final WfBusTmplDao tmplDao;
|
||||
private final BpmBusTmplDao tmplDao;
|
||||
|
||||
private final JdbcHelper jdbcHelper;
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package vben.wf.form.def;
|
||||
package vben.bpm.form.def;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.util.Date;
|
||||
|
||||
|
||||
@Data
|
||||
public class WfFormDef implements Serializable {
|
||||
public class BpmFormDef implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
+10
-10
@@ -1,4 +1,4 @@
|
||||
package vben.wf.form.def;
|
||||
package vben.bpm.form.def;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
@@ -10,16 +10,16 @@ import vben.common.jdbc.sqler.Usqler;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class WfFormDefDao {
|
||||
public class BpmFormDefDao {
|
||||
|
||||
|
||||
public WfFormDef findById(Long id) {
|
||||
String sql = "select * from wf_proc_def where id = ?";
|
||||
return jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(WfFormDef.class), id);
|
||||
public BpmFormDef findById(Long id) {
|
||||
String sql = "select * from bpm_proc_def where id = ?";
|
||||
return jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(BpmFormDef.class), id);
|
||||
}
|
||||
|
||||
public void insert(WfFormDef main) {
|
||||
Isqler sqler = new Isqler("wf_form_def");
|
||||
public void insert(BpmFormDef main) {
|
||||
Isqler sqler = new Isqler("bpm_form_def");
|
||||
if(main.getId()==null){
|
||||
main.setId(IdUtils.getSnowflakeNextId());
|
||||
}
|
||||
@@ -28,15 +28,15 @@ public class WfFormDefDao {
|
||||
jdbcHelper.getTp().update(sqler.getSql(), sqler.getParams());
|
||||
}
|
||||
|
||||
public void update(WfFormDef main) {
|
||||
Usqler sqler = new Usqler("wf_form_def");
|
||||
public void update(BpmFormDef main) {
|
||||
Usqler sqler = new Usqler("bpm_form_def");
|
||||
sqler.addWhere("id=?", main.getId());
|
||||
sqler.add("venum", main.getVenum());
|
||||
jdbcHelper.getTp().update(sqler.getSql(), sqler.getParams());
|
||||
}
|
||||
|
||||
public void deleteById(Long id) {
|
||||
jdbcHelper.update("delete from wf_form_def where id=?", id);
|
||||
jdbcHelper.update("delete from bpm_form_def where id=?", id);
|
||||
}
|
||||
|
||||
private final JdbcHelper jdbcHelper;
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package vben.wf.form.inst;
|
||||
package vben.bpm.form.inst;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -7,7 +7,7 @@ import java.io.Serializable;
|
||||
|
||||
|
||||
@Data
|
||||
public class WfFormInst implements Serializable {
|
||||
public class BpmFormInst implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
+5
-5
@@ -1,4 +1,4 @@
|
||||
package vben.wf.org.node;
|
||||
package vben.bpm.org.node;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.util.List;
|
||||
|
||||
//层级节点
|
||||
@Data
|
||||
public class WfOrgNode {
|
||||
public class BpmOrgNode {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
@@ -23,7 +23,7 @@ public class WfOrgNode {
|
||||
/**
|
||||
* 子节点
|
||||
*/
|
||||
private List<WfOrgNode> children = new ArrayList<>(); //行项目
|
||||
private List<BpmOrgNode> children = new ArrayList<>(); //行项目
|
||||
|
||||
/**
|
||||
* 父ID
|
||||
@@ -71,10 +71,10 @@ public class WfOrgNode {
|
||||
*/
|
||||
private String memna;
|
||||
|
||||
public WfOrgNode() {
|
||||
public BpmOrgNode() {
|
||||
}
|
||||
|
||||
public WfOrgNode(String id) {
|
||||
public BpmOrgNode(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
+13
-13
@@ -1,4 +1,4 @@
|
||||
package vben.wf.org.node;
|
||||
package vben.bpm.org.node;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -14,9 +14,9 @@ import vben.common.jdbc.sqler.Sqler;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("wf/org/node")
|
||||
@RequestMapping("bpm/org/node")
|
||||
@RequiredArgsConstructor
|
||||
public class WfOrgNodeApi {
|
||||
public class BpmOrgNodeApi {
|
||||
|
||||
// @GetMapping
|
||||
// public R get(String treid, String name, String pid, String notes) {
|
||||
@@ -45,7 +45,7 @@ public class WfOrgNodeApi {
|
||||
// //查询层级树
|
||||
// @GetMapping("treea")
|
||||
// public R getTreea(String treid) {
|
||||
// Sqler sqler = new Sqler("wf_org_node");
|
||||
// Sqler sqler = new Sqler("bpm_org_node");
|
||||
// sqler.addSelect("t.pid");
|
||||
// sqler.addEqual("t.treid", treid);
|
||||
// sqler.addOrder("t.ornum");
|
||||
@@ -69,7 +69,7 @@ public class WfOrgNodeApi {
|
||||
//查询层级树
|
||||
@GetMapping("tree")
|
||||
public R getTree(String name,String treid,String id) {
|
||||
Sqler sqler = new Sqler("wf_org_node");
|
||||
Sqler sqler = new Sqler("bpm_org_node");
|
||||
sqler.addSelect("t.pid");
|
||||
sqler.addLike("t.name", name);
|
||||
sqler.addEqual("t.treid", treid);
|
||||
@@ -83,14 +83,14 @@ public class WfOrgNodeApi {
|
||||
}
|
||||
|
||||
@GetMapping("list")
|
||||
public R<List<WfOrgNode>> list(String name) {
|
||||
Sqler sqler = new Sqler("wf_org_node");
|
||||
public R<List<BpmOrgNode>> list(String name) {
|
||||
Sqler sqler = new Sqler("bpm_org_node");
|
||||
sqler.addSelect("t.pid,t.notes,t.crtim,t.uptim,t.ornum,t.tier");
|
||||
sqler.addLike("t.name", name);
|
||||
sqler.addOrder("t.ornum");
|
||||
sqler.addLeftJoin("o.name memna","sys_org o","o.id=t.memid");
|
||||
List<WfOrgNode> list = jdbcHelper.getTp().query(sqler.getSql(), sqler.getParams(),
|
||||
new BeanPropertyRowMapper<>(WfOrgNode.class));
|
||||
List<BpmOrgNode> list = jdbcHelper.getTp().query(sqler.getSql(), sqler.getParams(),
|
||||
new BeanPropertyRowMapper<>(BpmOrgNode.class));
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@@ -106,19 +106,19 @@ public class WfOrgNodeApi {
|
||||
|
||||
@GetMapping("info/{id}")
|
||||
public R info(@PathVariable String id, HttpServletRequest request) {
|
||||
WfOrgNode main = service.findById(id);
|
||||
BpmOrgNode main = service.findById(id);
|
||||
return R.ok(main);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody WfOrgNode main) {
|
||||
public R post(@RequestBody BpmOrgNode main) {
|
||||
main.setOrnum(service.getCount(main.getPid(),main.getTreid())+1);
|
||||
service.insert(main);
|
||||
return R.ok(main.getId());
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody WfOrgNode main) throws Exception {
|
||||
public R put(@RequestBody BpmOrgNode main) throws Exception {
|
||||
service.update(main);
|
||||
return R.ok(main.getId());
|
||||
}
|
||||
@@ -136,6 +136,6 @@ public class WfOrgNodeApi {
|
||||
|
||||
private final JdbcHelper jdbcHelper;
|
||||
|
||||
private final WfOrgNodeService service;
|
||||
private final BpmOrgNodeService service;
|
||||
|
||||
}
|
||||
+10
-10
@@ -1,4 +1,4 @@
|
||||
package vben.wf.org.node;
|
||||
package vben.bpm.org.node;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
@@ -9,16 +9,16 @@ import vben.common.jdbc.sqler.Usqler;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class WfOrgNodeDao {
|
||||
public class BpmOrgNodeDao {
|
||||
|
||||
public WfOrgNode findById(String id) {
|
||||
String sql = "select t.*,o.name memna from wf_org_node t left join sys_org o on o.id=t.memid where t.id = ?";
|
||||
WfOrgNode node = jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(WfOrgNode.class), id);
|
||||
public BpmOrgNode findById(String id) {
|
||||
String sql = "select t.*,o.name memna from bpm_org_node t left join sys_org o on o.id=t.memid where t.id = ?";
|
||||
BpmOrgNode node = jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(BpmOrgNode.class), id);
|
||||
return node;
|
||||
}
|
||||
|
||||
public void insert(WfOrgNode tree) {
|
||||
Isqler sqler = new Isqler("wf_org_node");
|
||||
public void insert(BpmOrgNode tree) {
|
||||
Isqler sqler = new Isqler("bpm_org_node");
|
||||
sqler.add("id", tree.getId());
|
||||
sqler.add("name", tree.getName());
|
||||
sqler.add("notes", tree.getNotes());
|
||||
@@ -32,8 +32,8 @@ public class WfOrgNodeDao {
|
||||
jdbcHelper.getTp().update(sqler.getSql(), sqler.getParams());
|
||||
}
|
||||
|
||||
public void update(WfOrgNode tree) {
|
||||
Usqler sqler = new Usqler("wf_org_node");
|
||||
public void update(BpmOrgNode tree) {
|
||||
Usqler sqler = new Usqler("bpm_org_node");
|
||||
sqler.addWhere("id=?", tree.getId());
|
||||
sqler.add("name", tree.getName());
|
||||
sqler.add("notes", tree.getNotes());
|
||||
@@ -47,7 +47,7 @@ public class WfOrgNodeDao {
|
||||
}
|
||||
|
||||
public void deleteById(String id) {
|
||||
String sql = "delete from wf_org_node where id=?";
|
||||
String sql = "delete from bpm_org_node where id=?";
|
||||
jdbcHelper.getTp().update(sql, id);
|
||||
}
|
||||
|
||||
+26
-26
@@ -1,4 +1,4 @@
|
||||
package vben.wf.org.node;
|
||||
package vben.bpm.org.node;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
@@ -21,21 +21,21 @@ import java.util.List;
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@RequiredArgsConstructor
|
||||
public class WfOrgNodeService {
|
||||
public class BpmOrgNodeService {
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
public WfOrgNode findById(String id) {
|
||||
public BpmOrgNode findById(String id) {
|
||||
return dao.findById(id);
|
||||
}
|
||||
|
||||
public String insert(WfOrgNode main) {
|
||||
public String insert(BpmOrgNode main) {
|
||||
if (main.getId() == null || "".equals(main.getId())) {
|
||||
main.setId(IdUtils.getSnowflakeNextIdStr());
|
||||
}
|
||||
if (main.getPid() == null ) {
|
||||
main.setTier(main.getId());
|
||||
} else {
|
||||
String tier = jdbcHelper.findString("select tier from wf_org_node where id=?", main.getPid());
|
||||
String tier = jdbcHelper.findString("select tier from bpm_org_node where id=?", main.getPid());
|
||||
main.setTier(tier + "_" + main.getId());
|
||||
}
|
||||
dao.insert(main);
|
||||
@@ -43,12 +43,12 @@ public class WfOrgNodeService {
|
||||
}
|
||||
|
||||
|
||||
public String update(WfOrgNode main) throws Exception {
|
||||
public String update(BpmOrgNode main) throws Exception {
|
||||
main.setUptim(new Date());
|
||||
if (main.getPid()==null) {
|
||||
main.setTier(main.getId() + ";");
|
||||
} else {
|
||||
String tier = jdbcHelper.findString("select tier from wf_org_node where id=?", main.getPid());
|
||||
String tier = jdbcHelper.findString("select tier from bpm_org_node where id=?", main.getPid());
|
||||
main.setTier(tier + "_" + main.getId());
|
||||
String[] arr = tier.split("_");
|
||||
for (String str : arr) {
|
||||
@@ -58,7 +58,7 @@ public class WfOrgNodeService {
|
||||
}
|
||||
}
|
||||
dao.update(main);
|
||||
String oldTier = jdbcHelper.findString("select tier from wf_org_node where id=?", main.getId());
|
||||
String oldTier = jdbcHelper.findString("select tier from bpm_org_node where id=?", main.getId());
|
||||
if(!oldTier.equals(main.getTier())){
|
||||
dealTier(oldTier, main.getTier(), main.getId());
|
||||
}
|
||||
@@ -73,9 +73,9 @@ public class WfOrgNodeService {
|
||||
}
|
||||
|
||||
private void dealTier(String oldTier, String newTier, String id) {
|
||||
String sql = "select id,tier as name from wf_org_node where tier like ? and id<>?";
|
||||
String sql = "select id,tier as name from bpm_org_node where tier like ? and id<>?";
|
||||
List<SidName> list = jdbcHelper.findSidNameList(sql, oldTier + "%", id);
|
||||
String updateSql = "update wf_org_node set tier=? where id=?";
|
||||
String updateSql = "update bpm_org_node set tier=? where id=?";
|
||||
List<Object[]> updateList = new ArrayList<Object[]>();
|
||||
batchReady(oldTier, newTier, list, updateList);
|
||||
jdbcHelper.batch(updateSql, updateList);
|
||||
@@ -91,8 +91,8 @@ public class WfOrgNodeService {
|
||||
}
|
||||
}
|
||||
|
||||
public List<WfOrgNode> findAll(Sqler sqler) {
|
||||
List<WfOrgNode> list = jdbcHelper.getTp().query(sqler.getSql(), sqler.getParams(), new BeanPropertyRowMapper<>(WfOrgNode.class));
|
||||
public List<BpmOrgNode> findAll(Sqler sqler) {
|
||||
List<BpmOrgNode> list = jdbcHelper.getTp().query(sqler.getSql(), sqler.getParams(), new BeanPropertyRowMapper<>(BpmOrgNode.class));
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -100,20 +100,20 @@ public class WfOrgNodeService {
|
||||
return jdbcHelper.findPageData(sqler);
|
||||
}
|
||||
|
||||
public List<WfOrgNode> findTree(Sqler sqler) {
|
||||
List<WfOrgNode> list = jdbcHelper.getTp().query(sqler.getSql(), sqler.getParams(), new BeanPropertyRowMapper<>(WfOrgNode.class));
|
||||
public List<BpmOrgNode> findTree(Sqler sqler) {
|
||||
List<BpmOrgNode> list = jdbcHelper.getTp().query(sqler.getSql(), sqler.getParams(), new BeanPropertyRowMapper<>(BpmOrgNode.class));
|
||||
return buildByRecursive(list);
|
||||
}
|
||||
|
||||
//使用递归方法建树
|
||||
private List<WfOrgNode> buildByRecursive(List<WfOrgNode> nodes) {
|
||||
List<WfOrgNode> list = new ArrayList<>();
|
||||
for (WfOrgNode node : nodes) {
|
||||
private List<BpmOrgNode> buildByRecursive(List<BpmOrgNode> nodes) {
|
||||
List<BpmOrgNode> list = new ArrayList<>();
|
||||
for (BpmOrgNode node : nodes) {
|
||||
if (node.getPid() == null) {
|
||||
list.add(findChildrenByTier(node, nodes));
|
||||
} else {
|
||||
boolean flag = false;
|
||||
for (WfOrgNode node2 : nodes) {
|
||||
for (BpmOrgNode node2 : nodes) {
|
||||
if (node.getPid().equals(node2.getId())) {
|
||||
flag = true;
|
||||
break;
|
||||
@@ -128,8 +128,8 @@ public class WfOrgNodeService {
|
||||
}
|
||||
|
||||
//递归查找子节点
|
||||
private WfOrgNode findChildrenByTier(WfOrgNode node, List<WfOrgNode> nodes) {
|
||||
for (WfOrgNode item : nodes) {
|
||||
private BpmOrgNode findChildrenByTier(BpmOrgNode node, List<BpmOrgNode> nodes) {
|
||||
for (BpmOrgNode item : nodes) {
|
||||
if (node.getId().equals(item.getPid())) {
|
||||
if (node.getChildren() == null) {
|
||||
node.setChildren(new ArrayList<>());
|
||||
@@ -183,14 +183,14 @@ public class WfOrgNodeService {
|
||||
|
||||
public Integer getCount(String pid,String treid){
|
||||
if(StrUtils.isNotBlank(pid)){
|
||||
String countSql="select count(1) from wf_org_node where pid=?";
|
||||
String countSql="select count(1) from bpm_org_node where pid=?";
|
||||
Integer count = jdbcHelper.getTp().queryForObject(countSql, new Object[]{pid}, Integer.class);
|
||||
if(count==null){
|
||||
count=0;
|
||||
}
|
||||
return count;
|
||||
}else{
|
||||
String countSql="select count(1) from wf_org_node where pid is null and treid=?";
|
||||
String countSql="select count(1) from bpm_org_node where pid is null and treid=?";
|
||||
Integer count = jdbcHelper.getTp().queryForObject(countSql,new Object[]{treid}, Integer.class);
|
||||
if(count==null){
|
||||
count=0;
|
||||
@@ -201,7 +201,7 @@ public class WfOrgNodeService {
|
||||
|
||||
|
||||
public void move(TreeMoveBo bo) throws Exception {
|
||||
WfOrgNode dragDept= dao.findById(bo.getDraid());
|
||||
BpmOrgNode dragDept= dao.findById(bo.getDraid());
|
||||
if(dragDept.getPid()!=null){
|
||||
dragDept.setPid(dragDept.getPid());
|
||||
}
|
||||
@@ -235,7 +235,7 @@ public class WfOrgNodeService {
|
||||
}
|
||||
else if ("before".equals(bo.getType()))
|
||||
{
|
||||
WfOrgNode dropDept= dao.findById(bo.getDroid());
|
||||
BpmOrgNode dropDept= dao.findById(bo.getDroid());
|
||||
if(dropDept.getPid()!=null){
|
||||
dropDept.setPid(dropDept.getPid());
|
||||
dragDept.setPid(dropDept.getPid());;
|
||||
@@ -270,7 +270,7 @@ public class WfOrgNodeService {
|
||||
}
|
||||
else if ("after".equals(bo.getType()))
|
||||
{
|
||||
WfOrgNode dropDept= dao.findById(bo.getDroid());
|
||||
BpmOrgNode dropDept= dao.findById(bo.getDroid());
|
||||
if(dropDept.getPid()!=null){
|
||||
dropDept.setPid(dropDept.getPid());
|
||||
}
|
||||
@@ -290,7 +290,7 @@ public class WfOrgNodeService {
|
||||
|
||||
private final JdbcHelper jdbcHelper;
|
||||
|
||||
private final WfOrgNodeDao dao;
|
||||
private final BpmOrgNodeDao dao;
|
||||
|
||||
|
||||
}
|
||||
+6
-6
@@ -1,11 +1,11 @@
|
||||
package vben.wf.org.role;
|
||||
package vben.bpm.org.role;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
//层级角色
|
||||
@Data
|
||||
public class WfOrgRole {
|
||||
public class BpmOrgRole {
|
||||
|
||||
private String id;//主键
|
||||
|
||||
@@ -17,19 +17,19 @@ public class WfOrgRole {
|
||||
|
||||
private String treid;//角色树ID
|
||||
|
||||
public WfOrgRole() {
|
||||
public BpmOrgRole() {
|
||||
}
|
||||
|
||||
public WfOrgRole(String id) {
|
||||
public BpmOrgRole(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public WfOrgRole(String id, String name) {
|
||||
public BpmOrgRole(String id, String name) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public WfOrgRole(String id, String name, Integer ornum) {
|
||||
public BpmOrgRole(String id, String name, Integer ornum) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.ornum = ornum;
|
||||
+11
-11
@@ -1,4 +1,4 @@
|
||||
package vben.wf.org.role;
|
||||
package vben.bpm.org.role;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
@@ -9,16 +9,16 @@ import vben.common.jdbc.sqler.Usqler;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class WfOrgRoleDao {
|
||||
public class BpmOrgRoleDao {
|
||||
|
||||
public WfOrgRole findById(String id) {
|
||||
String sql = "select * from wf_org_role where id = ?";
|
||||
WfOrgRole role = jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(WfOrgRole.class), id);
|
||||
public BpmOrgRole findById(String id) {
|
||||
String sql = "select * from bpm_org_role where id = ?";
|
||||
BpmOrgRole role = jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(BpmOrgRole.class), id);
|
||||
return role;
|
||||
}
|
||||
|
||||
public void insert(WfOrgRole tree) {
|
||||
Isqler isqler = new Isqler("wf_org_role");
|
||||
public void insert(BpmOrgRole tree) {
|
||||
Isqler isqler = new Isqler("bpm_org_role");
|
||||
isqler.add("id", tree.getId());
|
||||
isqler.add("name", tree.getName());
|
||||
isqler.add("notes", tree.getNotes());
|
||||
@@ -27,8 +27,8 @@ public class WfOrgRoleDao {
|
||||
jdbcHelper.getTp().update(isqler.getSql(), isqler.getParams());
|
||||
}
|
||||
|
||||
public void update(WfOrgRole tree) {
|
||||
Usqler usqler = new Usqler("wf_org_role");
|
||||
public void update(BpmOrgRole tree) {
|
||||
Usqler usqler = new Usqler("bpm_org_role");
|
||||
usqler.addWhere("id=?", tree.getId());
|
||||
usqler.add("name", tree.getName());
|
||||
usqler.add("notes", tree.getNotes());
|
||||
@@ -38,12 +38,12 @@ public class WfOrgRoleDao {
|
||||
}
|
||||
|
||||
public void deleteById(String id) {
|
||||
String sql = "delete from wf_org_role where id=?";
|
||||
String sql = "delete from bpm_org_role where id=?";
|
||||
jdbcHelper.getTp().update(sql, id);
|
||||
}
|
||||
|
||||
public void deleteByTreid(String treid) {
|
||||
String sql = "delete from wf_org_role where treid=?";
|
||||
String sql = "delete from bpm_org_role where treid=?";
|
||||
jdbcHelper.getTp().update(sql, treid);
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,14 +1,14 @@
|
||||
package vben.wf.org.tree;
|
||||
package vben.bpm.org.tree;
|
||||
|
||||
import lombok.Data;
|
||||
import vben.wf.org.role.WfOrgRole;
|
||||
import vben.bpm.org.role.BpmOrgRole;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class WfOrgTree {
|
||||
public class BpmOrgTree {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
@@ -63,6 +63,6 @@ public class WfOrgTree {
|
||||
/**
|
||||
* 包含角色
|
||||
*/
|
||||
private List<WfOrgRole> roles=new ArrayList<>();
|
||||
private List<BpmOrgRole> roles=new ArrayList<>();
|
||||
|
||||
}
|
||||
+9
-9
@@ -1,4 +1,4 @@
|
||||
package vben.wf.org.tree;
|
||||
package vben.bpm.org.tree;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -7,13 +7,13 @@ import vben.common.jdbc.sqler.JdbcHelper;
|
||||
import vben.common.jdbc.sqler.Sqler;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("wf/org/tree")
|
||||
@RequestMapping("bpm/org/tree")
|
||||
@RequiredArgsConstructor
|
||||
public class WfOrgTreeApi {
|
||||
public class BpmOrgTreeApi {
|
||||
|
||||
@GetMapping
|
||||
public R get(String name,String catid) {
|
||||
Sqler sqler = new Sqler("wf_org_tree");
|
||||
Sqler sqler = new Sqler("bpm_org_tree");
|
||||
sqler.addLike("t.name", name);
|
||||
sqler.addEqual("t.catid", catid);
|
||||
sqler.addSelect("t.notes,t.ornum,t.crtim,t.uptim");
|
||||
@@ -23,17 +23,17 @@ public class WfOrgTreeApi {
|
||||
|
||||
@GetMapping("info/{id}")
|
||||
public R info(@PathVariable String id) {
|
||||
WfOrgTree main = service.findById(id);
|
||||
BpmOrgTree main = service.findById(id);
|
||||
return R.ok(main);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public R post(@RequestBody WfOrgTree main) {
|
||||
public R post(@RequestBody BpmOrgTree main) {
|
||||
return R.ok(service.insert(main));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R put(@RequestBody WfOrgTree main) {
|
||||
public R put(@RequestBody BpmOrgTree main) {
|
||||
return R.ok(service.update(main));
|
||||
}
|
||||
|
||||
@@ -49,11 +49,11 @@ public class WfOrgTreeApi {
|
||||
|
||||
@GetMapping("rlist")
|
||||
public R rlist(String treid) {
|
||||
String sql = "select id,name from wf_org_role where treid=?";
|
||||
String sql = "select id,name from bpm_org_role where treid=?";
|
||||
return R.ok(jdbcHelper.getTp().queryForList(sql, treid));
|
||||
}
|
||||
|
||||
private final WfOrgTreeService service;
|
||||
private final BpmOrgTreeService service;
|
||||
|
||||
private final JdbcHelper jdbcHelper;
|
||||
|
||||
+13
-13
@@ -1,9 +1,9 @@
|
||||
package vben.wf.org.tree;
|
||||
package vben.bpm.org.tree;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
import org.springframework.stereotype.Component;
|
||||
import vben.wf.org.role.WfOrgRole;
|
||||
import vben.bpm.org.role.BpmOrgRole;
|
||||
import vben.common.jdbc.sqler.Isqler;
|
||||
import vben.common.jdbc.sqler.JdbcHelper;
|
||||
import vben.common.jdbc.sqler.Usqler;
|
||||
@@ -12,19 +12,19 @@ import java.util.List;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class WfOrgTreeDao {
|
||||
public class BpmOrgTreeDao {
|
||||
|
||||
public WfOrgTree findById(String id) {
|
||||
String sql = "select * from wf_org_tree where id = ?";
|
||||
WfOrgTree tree = jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(WfOrgTree.class), id);
|
||||
String roleSql="select * from wf_org_role where treid = ? order by ornum";
|
||||
List<WfOrgRole> list = jdbcHelper.getTp().query(roleSql, new BeanPropertyRowMapper<>(WfOrgRole.class),id);
|
||||
public BpmOrgTree findById(String id) {
|
||||
String sql = "select * from bpm_org_tree where id = ?";
|
||||
BpmOrgTree tree = jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(BpmOrgTree.class), id);
|
||||
String roleSql="select * from bpm_org_role where treid = ? order by ornum";
|
||||
List<BpmOrgRole> list = jdbcHelper.getTp().query(roleSql, new BeanPropertyRowMapper<>(BpmOrgRole.class),id);
|
||||
tree.setRoles(list);
|
||||
return tree;
|
||||
}
|
||||
|
||||
public void insert(WfOrgTree tree) {
|
||||
Isqler isqler = new Isqler("wf_org_tree");
|
||||
public void insert(BpmOrgTree tree) {
|
||||
Isqler isqler = new Isqler("bpm_org_tree");
|
||||
isqler.add("id", tree.getId());
|
||||
isqler.add("name", tree.getName());
|
||||
isqler.add("notes", tree.getNotes());
|
||||
@@ -39,8 +39,8 @@ public class WfOrgTreeDao {
|
||||
|
||||
}
|
||||
|
||||
public void update(WfOrgTree tree) {
|
||||
Usqler usqler = new Usqler("wf_org_tree");
|
||||
public void update(BpmOrgTree tree) {
|
||||
Usqler usqler = new Usqler("bpm_org_tree");
|
||||
usqler.addWhere("id=?", tree.getId());
|
||||
usqler.add("name", tree.getName());
|
||||
usqler.add("notes", tree.getNotes());
|
||||
@@ -54,7 +54,7 @@ public class WfOrgTreeDao {
|
||||
}
|
||||
|
||||
public void deleteById(String id) {
|
||||
String sql = "delete from wf_org_tree where id=?";
|
||||
String sql = "delete from bpm_org_tree where id=?";
|
||||
jdbcHelper.getTp().update(sql, id);
|
||||
}
|
||||
|
||||
+18
-18
@@ -1,4 +1,4 @@
|
||||
package vben.wf.org.tree;
|
||||
package vben.bpm.org.tree;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
@@ -7,30 +7,30 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import vben.base.sys.org.root.Org;
|
||||
import vben.common.core.utils.IdUtils;
|
||||
import vben.common.jdbc.sqler.JdbcHelper;
|
||||
import vben.wf.org.role.WfOrgRole;
|
||||
import vben.wf.org.role.WfOrgRoleDao;
|
||||
import vben.bpm.org.role.BpmOrgRole;
|
||||
import vben.bpm.org.role.BpmOrgRoleDao;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@RequiredArgsConstructor
|
||||
public class WfOrgTreeService {
|
||||
public class BpmOrgTreeService {
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
public WfOrgTree findById(String id) {
|
||||
public BpmOrgTree findById(String id) {
|
||||
return treedao.findById(id);
|
||||
}
|
||||
|
||||
public String insert(WfOrgTree main) {
|
||||
public String insert(BpmOrgTree main) {
|
||||
main.setId(IdUtils.getSnowflakeNextIdStr());
|
||||
treedao.insert(main);
|
||||
for (WfOrgRole role : main.getRoles()) {
|
||||
for (BpmOrgRole role : main.getRoles()) {
|
||||
role.setTreid(main.getId());
|
||||
roleDao.insert(role);
|
||||
}
|
||||
// List<SysOrg> list = new ArrayList<>();
|
||||
// for (WfOrgRoleEntity role : main.getRoles()) {
|
||||
// for (BpmOrgRoleEntity role : main.getRoles()) {
|
||||
// SysOrg sysOrg = new SysOrg(role.getId(), role.getName(), 32);
|
||||
// list.add(sysOrg);
|
||||
// }
|
||||
@@ -38,16 +38,16 @@ public class WfOrgTreeService {
|
||||
return main.getId();
|
||||
}
|
||||
|
||||
public String update(WfOrgTree main) {
|
||||
public String update(BpmOrgTree main) {
|
||||
treedao.update(main);
|
||||
roleDao.deleteByTreid(main.getId());
|
||||
for (WfOrgRole role : main.getRoles()) {
|
||||
for (BpmOrgRole role : main.getRoles()) {
|
||||
role.setTreid(main.getId());
|
||||
roleDao.insert(role);
|
||||
}
|
||||
|
||||
// List<SysOrg> list = new ArrayList<>();
|
||||
// for (WfOrgRoleEntity role : main.getRoles()) {
|
||||
// for (BpmOrgRoleEntity role : main.getRoles()) {
|
||||
// SysOrg sysOrg = new SysOrg(role.getId(), role.getName(), 32);
|
||||
// list.add(sysOrg);
|
||||
// }
|
||||
@@ -65,12 +65,12 @@ public class WfOrgTreeService {
|
||||
|
||||
|
||||
public Org calc(String useid, String rolid) {
|
||||
String sql = "select t.tier \"tier\",m.ornum \"ornum\" from wf_org_tree_node t " +
|
||||
"inner join wf_org_role m on m.treid=t.treid where t.memid=? and m.id=?";
|
||||
String sql = "select t.tier \"tier\",m.ornum \"ornum\" from bpm_org_tree_node t " +
|
||||
"inner join bpm_org_role m on m.treid=t.treid where t.memid=? and m.id=?";
|
||||
Map<String, Object> map = jdbcHelper.findMap(sql, useid, rolid);
|
||||
if (map == null) {
|
||||
sql = "select t.tier \"tier\",m.ornum \"ornum\" from wf_org_tree_node t " +
|
||||
"inner join wf_org_role m on m.treid=t.treid " +
|
||||
sql = "select t.tier \"tier\",m.ornum \"ornum\" from bpm_org_tree_node t " +
|
||||
"inner join bpm_org_role m on m.treid=t.treid " +
|
||||
"inner join sys_org_user u on u.depid=t.memid where u.id=? and m.id=?";
|
||||
map = jdbcHelper.findMap(sql, useid, rolid);
|
||||
if (map == null) {
|
||||
@@ -80,15 +80,15 @@ public class WfOrgTreeService {
|
||||
String tier = (String) map.get("tier");
|
||||
Integer ornum =(Integer) map.get("ornum");
|
||||
String[] idArr = tier.split("_");
|
||||
String sql3 = "select o.id,o.name,o.type from wf_org_tree_node t inner join sys_org o on o.id=t.memid where t.id=?";
|
||||
String sql3 = "select o.id,o.name,o.type from bpm_org_tree_node t inner join sys_org o on o.id=t.memid where t.id=?";
|
||||
Org org = jdbcHelper.getTp().queryForObject(sql3,
|
||||
new Object[]{idArr[ornum]}, new BeanPropertyRowMapper<>(Org.class));
|
||||
return org;
|
||||
}
|
||||
|
||||
private final WfOrgRoleDao roleDao;
|
||||
private final BpmOrgRoleDao roleDao;
|
||||
|
||||
private final WfOrgTreeDao treedao;
|
||||
private final BpmOrgTreeDao treedao;
|
||||
|
||||
private final JdbcHelper jdbcHelper;
|
||||
|
||||
+6
-6
@@ -1,4 +1,4 @@
|
||||
package vben.wf.org.tree;
|
||||
package vben.bpm.org.tree;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
@@ -16,11 +16,11 @@ import java.util.List;
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class WfUserService {
|
||||
public class BpmUserService {
|
||||
|
||||
private final JdbcHelper jdbcHelper;
|
||||
|
||||
private final WfOrgTreeService sysOrgRoleTreeService;
|
||||
private final BpmOrgTreeService sysOrgRoleTreeService;
|
||||
|
||||
/**
|
||||
* 计算目标节点处理人
|
||||
@@ -33,7 +33,7 @@ public class WfUserService {
|
||||
String tamen = "";
|
||||
if (StrUtils.isNotBlank(exuids) && exuids.contains("$")) {
|
||||
if ("$creator".equals(exuids)) {
|
||||
String sql = "select cruid from wf_proc_inst where id=?";
|
||||
String sql = "select cruid from bpm_proc_inst where id=?";
|
||||
exuids = jdbcHelper.findString(sql, proid);
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,7 @@ public class WfUserService {
|
||||
if (sysOrg.getType() == 32) {
|
||||
String cruid = LoginHelper.getUserId()+"";
|
||||
if (proid != null) {
|
||||
String sql = "select cruid from wf_proc_inst where id=?";
|
||||
String sql = "select cruid from bpm_proc_inst where id=?";
|
||||
cruid = jdbcHelper.findString(sql, proid);
|
||||
}
|
||||
Org org = sysOrgRoleTreeService.calc(cruid, sysOrg.getId());
|
||||
@@ -73,7 +73,7 @@ public class WfUserService {
|
||||
if (sysOrg.getType() == 32) {
|
||||
String cruid = LoginHelper.getUserId()+"";
|
||||
if (proid != null) {
|
||||
String sql = "select cruid from wf_proc_inst where id=?";
|
||||
String sql = "select cruid from bpm_proc_inst where id=?";
|
||||
cruid = jdbcHelper.findString(sql, proid);
|
||||
}
|
||||
Org org = sysOrgRoleTreeService.calc(cruid, sysOrg.getId());
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package vben.wf.org.treec;
|
||||
package vben.bpm.org.treec;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -7,7 +7,7 @@ import lombok.Data;
|
||||
* 群组分类
|
||||
*/
|
||||
@Data
|
||||
public class WfOrgTreeCate {
|
||||
public class BpmOrgTreeCate {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
+8
-8
@@ -1,4 +1,4 @@
|
||||
package vben.wf.org.treec;
|
||||
package vben.bpm.org.treec;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -9,9 +9,9 @@ import vben.common.jdbc.dto.Stree;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("wf/org/treec")
|
||||
@RequestMapping("bpm/org/treec")
|
||||
@RequiredArgsConstructor
|
||||
public class WfOrgTreeCateApi {
|
||||
public class BpmOrgTreeCateApi {
|
||||
|
||||
//查询分类树
|
||||
@GetMapping("tree")
|
||||
@@ -21,21 +21,21 @@ public class WfOrgTreeCateApi {
|
||||
|
||||
//查询分类详情
|
||||
@GetMapping("info/{id}")
|
||||
public R<WfOrgTreeCate> info(@PathVariable String id) {
|
||||
WfOrgTreeCate cate = service.findById(id);
|
||||
public R<BpmOrgTreeCate> info(@PathVariable String id) {
|
||||
BpmOrgTreeCate cate = service.findById(id);
|
||||
return R.ok(cate);
|
||||
}
|
||||
|
||||
//新增分类
|
||||
@PostMapping
|
||||
public R<String> post(@RequestBody WfOrgTreeCate cate) {
|
||||
public R<String> post(@RequestBody BpmOrgTreeCate cate) {
|
||||
service.insert(cate);
|
||||
return R.ok(null,cate.getId());
|
||||
}
|
||||
|
||||
//更新分类
|
||||
@PutMapping
|
||||
public R<String> put(@RequestBody WfOrgTreeCate cate) {
|
||||
public R<String> put(@RequestBody BpmOrgTreeCate cate) {
|
||||
service.update(cate);
|
||||
return R.ok(null,cate.getId());
|
||||
}
|
||||
@@ -53,5 +53,5 @@ public class WfOrgTreeCateApi {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
private final WfOrgTreeCateService service;
|
||||
private final BpmOrgTreeCateService service;
|
||||
}
|
||||
+13
-13
@@ -1,4 +1,4 @@
|
||||
package vben.wf.org.treec;
|
||||
package vben.bpm.org.treec;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
@@ -13,23 +13,23 @@ import java.util.List;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class WfOrgTreeCateDao {
|
||||
public class BpmOrgTreeCateDao {
|
||||
|
||||
public List<Stree> findTreeList(String id) {
|
||||
if(StrUtils.isBlank(id)) {
|
||||
return jdbcHelper.findStreeList("select id,name,pid from wf_org_tree_cate order by ornum");
|
||||
return jdbcHelper.findStreeList("select id,name,pid from bpm_org_tree_cate order by ornum");
|
||||
}else{
|
||||
return jdbcHelper.findStreeList("select id,name,pid from wf_org_tree_cate where id <> ? order by ornum",id);
|
||||
return jdbcHelper.findStreeList("select id,name,pid from bpm_org_tree_cate where id <> ? order by ornum",id);
|
||||
}
|
||||
}
|
||||
|
||||
public WfOrgTreeCate findById(String id) {
|
||||
String sql = "select * from wf_org_tree_cate where id = ?";
|
||||
return jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(WfOrgTreeCate.class), id);
|
||||
public BpmOrgTreeCate findById(String id) {
|
||||
String sql = "select * from bpm_org_tree_cate where id = ?";
|
||||
return jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(BpmOrgTreeCate.class), id);
|
||||
}
|
||||
|
||||
public void insert(WfOrgTreeCate cate) {
|
||||
Isqler isqler = new Isqler("wf_org_tree_cate");
|
||||
public void insert(BpmOrgTreeCate cate) {
|
||||
Isqler isqler = new Isqler("bpm_org_tree_cate");
|
||||
isqler.add("id", cate.getId());
|
||||
isqler.add("name", cate.getName());
|
||||
isqler.add("pid", cate.getPid());
|
||||
@@ -37,8 +37,8 @@ public class WfOrgTreeCateDao {
|
||||
jdbcHelper.getTp().update(isqler.getSql(), isqler.getParams());
|
||||
}
|
||||
|
||||
public void update(WfOrgTreeCate cate) {
|
||||
Usqler usqler = new Usqler("wf_org_tree_cate");
|
||||
public void update(BpmOrgTreeCate cate) {
|
||||
Usqler usqler = new Usqler("bpm_org_tree_cate");
|
||||
usqler.addWhere("id=?", cate.getId());
|
||||
usqler.add("name", cate.getName());
|
||||
usqler.add("ornum", cate.getOrnum());
|
||||
@@ -47,12 +47,12 @@ public class WfOrgTreeCateDao {
|
||||
}
|
||||
|
||||
public void deleteById(String id) {
|
||||
String sql = "delete from wf_org_tree_cate where id=?";
|
||||
String sql = "delete from bpm_org_tree_cate where id=?";
|
||||
jdbcHelper.getTp().update(sql, id);
|
||||
}
|
||||
|
||||
public Integer getCount(String pid){
|
||||
String countSql="select count(1) from wf_org_tree_cate where pid=?";
|
||||
String countSql="select count(1) from bpm_org_tree_cate where pid=?";
|
||||
Integer count = jdbcHelper.getTp().queryForObject(countSql,Integer.class,pid);
|
||||
if(count==null){
|
||||
count=0;
|
||||
+17
-17
@@ -1,4 +1,4 @@
|
||||
package vben.wf.org.treec;
|
||||
package vben.bpm.org.treec;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
@@ -16,30 +16,30 @@ import java.util.List;
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@RequiredArgsConstructor
|
||||
public class WfOrgTreeCateService {
|
||||
public class BpmOrgTreeCateService {
|
||||
|
||||
public List<Stree> findTreeList(String id) {
|
||||
return cateDao.findTreeList(id);
|
||||
}
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
public WfOrgTreeCate findById(String id) {
|
||||
public BpmOrgTreeCate findById(String id) {
|
||||
return cateDao.findById(id);
|
||||
}
|
||||
|
||||
public void insert(WfOrgTreeCate cate) {
|
||||
public void insert(BpmOrgTreeCate cate) {
|
||||
cate.setId(IdUtils.getSnowflakeNextIdStr());
|
||||
cate.setOrnum(cateDao.getCount(cate.getPid()) + 1);
|
||||
cateDao.insert(cate);
|
||||
}
|
||||
|
||||
public void update(WfOrgTreeCate cate) {
|
||||
public void update(BpmOrgTreeCate cate) {
|
||||
cateDao.update(cate);
|
||||
}
|
||||
|
||||
public Integer delete(String id) {
|
||||
Integer size=1;
|
||||
String sql = "select id from wf_org_tree_cate where pid=?";
|
||||
String sql = "select id from bpm_org_tree_cate where pid=?";
|
||||
List<String> list = jdbcHelper.getTp().queryForList(sql, String.class, id);
|
||||
for (String l : list) {
|
||||
cateDao.deleteById(l);
|
||||
@@ -50,10 +50,10 @@ public class WfOrgTreeCateService {
|
||||
}
|
||||
|
||||
public void move(TreeMoveBo bo) {
|
||||
WfOrgTreeCate dragCate = cateDao.findById(bo.getDraid());
|
||||
String sql = "select id,ornum from wf_org_tree_cate where ornum>? and pid=?";
|
||||
BpmOrgTreeCate dragCate = cateDao.findById(bo.getDraid());
|
||||
String sql = "select id,ornum from bpm_org_tree_cate where ornum>? and pid=?";
|
||||
List<SidOrnum> list2 = jdbcHelper.getTp().query(sql,new BeanPropertyRowMapper<>(SidOrnum.class),dragCate.getOrnum(), dragCate.getPid());
|
||||
String updateSql = "update wf_org_tree_cate set ornum=? where id=?";
|
||||
String updateSql = "update bpm_org_tree_cate set ornum=? where id=?";
|
||||
List<Object[]> updateList = new ArrayList<>();
|
||||
for (SidOrnum sidOrnum : list2) {
|
||||
Object[] arr = new Object[2];
|
||||
@@ -67,12 +67,12 @@ public class WfOrgTreeCateService {
|
||||
Integer count = cateDao.getCount(bo.getDroid());
|
||||
dragCate.setOrnum(count + 1);
|
||||
} else if ("before".equals(bo.getType())) {
|
||||
WfOrgTreeCate dropCate = cateDao.findById(bo.getDroid());
|
||||
BpmOrgTreeCate dropCate = cateDao.findById(bo.getDroid());
|
||||
dragCate.setPid(dropCate.getPid());
|
||||
dragCate.setOrnum(dropCate.getOrnum());
|
||||
String sql3 = "select id,ornum from wf_org_tree_cate where ornum>? and pid=?";
|
||||
String sql3 = "select id,ornum from bpm_org_tree_cate where ornum>? and pid=?";
|
||||
List<SidOrnum> list3 = jdbcHelper.getTp().query(sql3, new BeanPropertyRowMapper<>(SidOrnum.class),dropCate.getOrnum(), dropCate.getPid());
|
||||
String updateSql3 = "update wf_org_tree_cate set ornum=? where id=?";
|
||||
String updateSql3 = "update bpm_org_tree_cate set ornum=? where id=?";
|
||||
List<Object[]> updateList3 = new ArrayList<>();
|
||||
for (SidOrnum sidOrnum : list3) {
|
||||
Object[] arr = new Object[2];
|
||||
@@ -82,15 +82,15 @@ public class WfOrgTreeCateService {
|
||||
}
|
||||
jdbcHelper.batch(updateSql3, updateList3);
|
||||
dropCate.setOrnum(dropCate.getOrnum() + 1);
|
||||
String updateSql4 = "update wf_org_tree_cate set ornum=? where id=?";
|
||||
String updateSql4 = "update bpm_org_tree_cate set ornum=? where id=?";
|
||||
jdbcHelper.update(updateSql4, dropCate.getOrnum(), dropCate.getId());
|
||||
} else if ("after".equals(bo.getType())) {
|
||||
WfOrgTreeCate dropCate = cateDao.findById(bo.getDroid());
|
||||
BpmOrgTreeCate dropCate = cateDao.findById(bo.getDroid());
|
||||
dragCate.setPid(dropCate.getPid());
|
||||
dragCate.setOrnum(dropCate.getOrnum() + 1);
|
||||
String sql3 = "select id,ornum from wf_org_tree_cate where ornum>? and pid=?";
|
||||
String sql3 = "select id,ornum from bpm_org_tree_cate where ornum>? and pid=?";
|
||||
List<SidOrnum> list3 = jdbcHelper.getTp().query(sql3,new BeanPropertyRowMapper<>(SidOrnum.class),dropCate.getOrnum(), dropCate.getPid());
|
||||
String updateSql3 = "update wf_org_tree_cate set ornum=? where id=?";
|
||||
String updateSql3 = "update bpm_org_tree_cate set ornum=? where id=?";
|
||||
List<Object[]> updateList3 = new ArrayList<>();
|
||||
for (SidOrnum sidOrnum : list3) {
|
||||
Object[] arr = new Object[2];
|
||||
@@ -105,5 +105,5 @@ public class WfOrgTreeCateService {
|
||||
|
||||
private final JdbcHelper jdbcHelper;
|
||||
|
||||
private final WfOrgTreeCateDao cateDao;
|
||||
private final BpmOrgTreeCateDao cateDao;
|
||||
}
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package vben.wf.proc.audit;
|
||||
package vben.bpm.proc.audit;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.util.Date;
|
||||
|
||||
|
||||
@Data
|
||||
public class WfProcAudit implements Serializable {
|
||||
public class BpmProcAudit implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
+18
-18
@@ -1,4 +1,4 @@
|
||||
package vben.wf.proc.audit;
|
||||
package vben.bpm.proc.audit;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
@@ -7,38 +7,38 @@ import vben.common.core.utils.IdUtils;
|
||||
import vben.common.jdbc.sqler.Isqler;
|
||||
import vben.common.jdbc.sqler.JdbcHelper;
|
||||
import vben.common.jdbc.sqler.Usqler;
|
||||
import vben.wf.root.domain.vo.WfAuditVo;
|
||||
import vben.wf.root.domain.vo.WfRefuseInfoVo;
|
||||
import vben.bpm.root.domain.vo.BpmAuditVo;
|
||||
import vben.bpm.root.domain.vo.BpmRefuseInfoVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class WfProcAuditDao {
|
||||
public class BpmProcAuditDao {
|
||||
|
||||
public List<WfAuditVo> findListByProid(Long proid){
|
||||
String sql="select t.id,t.crtim,t.facna,t.facno,t.opnot,t.opinf,o.name hauna,t.atids from wf_proc_audit t" +
|
||||
public List<BpmAuditVo> findListByProid(Long proid){
|
||||
String sql="select t.id,t.crtim,t.facna,t.facno,t.opnot,t.opinf,o.name hauna,t.atids from bpm_proc_audit t" +
|
||||
" left join sys_org o on o.id=t.hauid where t.proid=? order by t.crtim";
|
||||
return jdbcHelper.getTp().query(sql,new BeanPropertyRowMapper<>(WfAuditVo.class),proid);
|
||||
return jdbcHelper.getTp().query(sql,new BeanPropertyRowMapper<>(BpmAuditVo.class),proid);
|
||||
}
|
||||
|
||||
public List<WfRefuseInfoVo> findCanRefuseNodeList(Long proid){
|
||||
public List<BpmRefuseInfoVo> findCanRefuseNodeList(Long proid){
|
||||
String sql="""
|
||||
select distinct t.facno refno,t.facna refna,t.hauid exuid,t.crtim
|
||||
from wf_proc_audit t
|
||||
from bpm_proc_audit t
|
||||
where proid=? and opkey in('dsubmit','pass')
|
||||
order by t.crtim
|
||||
""";
|
||||
return jdbcHelper.getTp().query(sql,new BeanPropertyRowMapper<>(WfRefuseInfoVo.class),proid);
|
||||
return jdbcHelper.getTp().query(sql,new BeanPropertyRowMapper<>(BpmRefuseInfoVo.class),proid);
|
||||
}
|
||||
|
||||
public WfProcAudit findById(Long id) {
|
||||
String sql = "select * from wf_proc_audit where id = ?";
|
||||
return jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(WfProcAudit.class), id);
|
||||
public BpmProcAudit findById(Long id) {
|
||||
String sql = "select * from bpm_proc_audit where id = ?";
|
||||
return jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(BpmProcAudit.class), id);
|
||||
}
|
||||
|
||||
public void insert(WfProcAudit main) {
|
||||
Isqler isqler = new Isqler("wf_proc_audit");
|
||||
public void insert(BpmProcAudit main) {
|
||||
Isqler isqler = new Isqler("bpm_proc_audit");
|
||||
if(main.getId()==null){
|
||||
main.setId(IdUtils.getSnowflakeNextId());
|
||||
}
|
||||
@@ -57,8 +57,8 @@ public class WfProcAuditDao {
|
||||
jdbcHelper.getTp().update(isqler.getSql(), isqler.getParams());
|
||||
}
|
||||
|
||||
public void update(WfProcAudit main) {
|
||||
Usqler usqler = new Usqler("wf_proc_audit");
|
||||
public void update(BpmProcAudit main) {
|
||||
Usqler usqler = new Usqler("bpm_proc_audit");
|
||||
usqler.addWhere("id=?", main.getId());
|
||||
usqler.add("facno", main.getFacno());
|
||||
usqler.add("facna", main.getFacna());
|
||||
@@ -74,7 +74,7 @@ public class WfProcAuditDao {
|
||||
}
|
||||
|
||||
public void deleteById(Long id) {
|
||||
jdbcHelper.update("delete from wf_proc_audit where id=?", id);
|
||||
jdbcHelper.update("delete from bpm_proc_audit where id=?", id);
|
||||
}
|
||||
|
||||
private final JdbcHelper jdbcHelper;
|
||||
+15
-15
@@ -1,11 +1,11 @@
|
||||
package vben.wf.proc.audit;
|
||||
package vben.bpm.proc.audit;
|
||||
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import vben.wf.root.domain.Zproc;
|
||||
import vben.wf.root.domain.Znode;
|
||||
import vben.wf.root.domain.vo.WfRefuseInfoVo;
|
||||
import vben.wf.root.domain.vo.WfAuditVo;
|
||||
import vben.bpm.root.domain.Zproc;
|
||||
import vben.bpm.root.domain.Znode;
|
||||
import vben.bpm.root.domain.vo.BpmRefuseInfoVo;
|
||||
import vben.bpm.root.domain.vo.BpmAuditVo;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -14,12 +14,12 @@ import java.util.List;
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class WfProcAuditService {
|
||||
public class BpmProcAuditService {
|
||||
|
||||
private final WfProcAuditDao dao;
|
||||
private final BpmProcAuditDao dao;
|
||||
|
||||
public WfProcAudit saveDraftAudit(Zproc zproc, Znode znode) {
|
||||
WfProcAudit audit = new WfProcAudit();
|
||||
public BpmProcAudit saveDraftAudit(Zproc zproc, Znode znode) {
|
||||
BpmProcAudit audit = new BpmProcAudit();
|
||||
audit.setFacno(znode.getFacno());
|
||||
audit.setFacna(znode.getFacna());
|
||||
audit.setNodid(znode.getNodid());
|
||||
@@ -33,8 +33,8 @@ public class WfProcAuditService {
|
||||
return audit;
|
||||
}
|
||||
|
||||
public WfProcAudit saveAudit(Zproc zproc) {
|
||||
WfProcAudit audit = new WfProcAudit();
|
||||
public BpmProcAudit saveAudit(Zproc zproc) {
|
||||
BpmProcAudit audit = new BpmProcAudit();
|
||||
audit.setFacno(zproc.getFacno());
|
||||
audit.setFacna(zproc.getFacna());
|
||||
audit.setNodid(zproc.getNodid());
|
||||
@@ -49,8 +49,8 @@ public class WfProcAuditService {
|
||||
return audit;
|
||||
}
|
||||
|
||||
public WfProcAudit saveEndAudit(Zproc zproc, Long nodid) {
|
||||
WfProcAudit audit = new WfProcAudit();
|
||||
public BpmProcAudit saveEndAudit(Zproc zproc, Long nodid) {
|
||||
BpmProcAudit audit = new BpmProcAudit();
|
||||
audit.setFacno("NE");
|
||||
audit.setFacna("结束节点");
|
||||
audit.setNodid(nodid);
|
||||
@@ -61,11 +61,11 @@ public class WfProcAuditService {
|
||||
return audit;
|
||||
}
|
||||
|
||||
public List<WfAuditVo> findListByProid(Long proid) {
|
||||
public List<BpmAuditVo> findListByProid(Long proid) {
|
||||
return dao.findListByProid(proid);
|
||||
}
|
||||
|
||||
public List<WfRefuseInfoVo> findCanRefuseNodeList(Long proid) {
|
||||
public List<BpmRefuseInfoVo> findCanRefuseNodeList(Long proid) {
|
||||
return dao.findCanRefuseNodeList(proid);
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package vben.wf.proc.cond;
|
||||
package vben.bpm.proc.cond;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -7,7 +7,7 @@ import java.io.Serializable;
|
||||
|
||||
|
||||
@Data
|
||||
public class WfProcCond implements Serializable {
|
||||
public class BpmProcCond implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
+10
-10
@@ -1,4 +1,4 @@
|
||||
package vben.wf.proc.cond;
|
||||
package vben.bpm.proc.cond;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
@@ -10,15 +10,15 @@ import vben.common.jdbc.sqler.Usqler;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class WfProcCondDao {
|
||||
public class BpmProcCondDao {
|
||||
|
||||
public WfProcCond findById(Long id) {
|
||||
String sql = "select * from wf_proc_cond where id = ?";
|
||||
return jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(WfProcCond.class), id);
|
||||
public BpmProcCond findById(Long id) {
|
||||
String sql = "select * from bpm_proc_cond where id = ?";
|
||||
return jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(BpmProcCond.class), id);
|
||||
}
|
||||
|
||||
public void insert(WfProcCond main) {
|
||||
Isqler isqler = new Isqler("wf_proc_cond");
|
||||
public void insert(BpmProcCond main) {
|
||||
Isqler isqler = new Isqler("bpm_proc_cond");
|
||||
if(main.getId()==null){
|
||||
main.setId(IdUtils.getSnowflakeNextIdStr());
|
||||
}
|
||||
@@ -27,15 +27,15 @@ public class WfProcCondDao {
|
||||
jdbcHelper.getTp().update(isqler.getSql(), isqler.getParams());
|
||||
}
|
||||
|
||||
public void update(WfProcCond main) {
|
||||
Usqler usqler = new Usqler("wf_proc_cond");
|
||||
public void update(BpmProcCond main) {
|
||||
Usqler usqler = new Usqler("bpm_proc_cond");
|
||||
usqler.addWhere("id=?", main.getId());
|
||||
usqler.add("name", main.getCond());
|
||||
jdbcHelper.getTp().update(usqler.getSql(), usqler.getParams());
|
||||
}
|
||||
|
||||
public void deleteById(Long id) {
|
||||
jdbcHelper.update("delete from wf_proc_cond where id=?", id);
|
||||
jdbcHelper.update("delete from bpm_proc_cond where id=?", id);
|
||||
}
|
||||
|
||||
private final JdbcHelper jdbcHelper;
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package vben.wf.proc.def;
|
||||
package vben.bpm.proc.def;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.util.Date;
|
||||
|
||||
|
||||
@Data
|
||||
public class WfProcDef implements Serializable {
|
||||
public class BpmProcDef implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -65,7 +65,7 @@ public class WfProcDef implements Serializable {
|
||||
private String exxml;
|
||||
|
||||
|
||||
// private String wfXml;
|
||||
// private String bpmXml;
|
||||
//
|
||||
/**
|
||||
*
|
||||
+18
-18
@@ -1,50 +1,50 @@
|
||||
package vben.wf.proc.def;
|
||||
package vben.bpm.proc.def;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
import org.springframework.stereotype.Component;
|
||||
import vben.bpm.root.domain.vo.BpmProcDefVo;
|
||||
import vben.common.core.utils.IdUtils;
|
||||
import vben.common.jdbc.sqler.Isqler;
|
||||
import vben.common.jdbc.sqler.JdbcHelper;
|
||||
import vben.common.jdbc.sqler.Usqler;
|
||||
import vben.wf.root.domain.vo.WfProcDefVo;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class WfProcDefDao {
|
||||
public class BpmProcDefDao {
|
||||
|
||||
public String selectExxmlById(Long id){
|
||||
String sql="SELECT exxml FROM wf_proc_def WHERE id = ?";
|
||||
String sql="SELECT exxml FROM bpm_proc_def WHERE id = ?";
|
||||
return jdbcHelper.findString(sql,id);
|
||||
}
|
||||
|
||||
public String selectExxmlByProid(Long proid){
|
||||
String sql="SELECT f.exxml FROM wf_proc_def f inner join wf_proc_inst p on p.prdid=f.id WHERE p.id = ?";
|
||||
String sql="SELECT f.exxml FROM bpm_proc_def f inner join bpm_proc_inst p on p.prdid=f.id WHERE p.id = ?";
|
||||
return jdbcHelper.findString(sql,proid);
|
||||
}
|
||||
|
||||
public String selectDixmlById(Long id){
|
||||
String sql="SELECT dixml FROM wf_proc_def WHERE id = ?";
|
||||
String sql="SELECT dixml FROM bpm_proc_def WHERE id = ?";
|
||||
return jdbcHelper.findString(sql,id);
|
||||
}
|
||||
|
||||
public String selectDixmlByProid(Long proid){
|
||||
String sql="SELECT f.dixml FROM wf_proc_def f inner join wf_proc_inst p on p.prdid=f.id WHERE p.id = ?";
|
||||
String sql="SELECT f.dixml FROM bpm_proc_def f inner join bpm_proc_inst p on p.prdid=f.id WHERE p.id = ?";
|
||||
return jdbcHelper.findString(sql,proid);
|
||||
}
|
||||
|
||||
public WfProcDef findById(Long id) {
|
||||
String sql = "select * from wf_proc_def where id = ?";
|
||||
return jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(WfProcDef.class), id);
|
||||
public BpmProcDef findById(Long id) {
|
||||
String sql = "select * from bpm_proc_def where id = ?";
|
||||
return jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(BpmProcDef.class), id);
|
||||
}
|
||||
|
||||
public WfProcDefVo findVoById(Long id) {
|
||||
String sql = "select * from wf_proc_def where id = ?";
|
||||
return jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(WfProcDefVo.class), id);
|
||||
public BpmProcDefVo findVoById(Long id) {
|
||||
String sql = "select * from bpm_proc_def where id = ?";
|
||||
return jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(BpmProcDefVo.class), id);
|
||||
}
|
||||
|
||||
public void insert(WfProcDef main) {
|
||||
Isqler isqler = new Isqler("wf_proc_def");
|
||||
public void insert(BpmProcDef main) {
|
||||
Isqler isqler = new Isqler("bpm_proc_def");
|
||||
if(main.getId()==null){
|
||||
main.setId(IdUtils.getSnowflakeNextId());
|
||||
}
|
||||
@@ -61,8 +61,8 @@ public class WfProcDefDao {
|
||||
jdbcHelper.getTp().update(isqler.getSql(), isqler.getParams());
|
||||
}
|
||||
|
||||
public void update(WfProcDef main) {
|
||||
Usqler usqler = new Usqler("wf_proc_def");
|
||||
public void update(BpmProcDef main) {
|
||||
Usqler usqler = new Usqler("bpm_proc_def");
|
||||
usqler.addWhere("id=?", main.getId());
|
||||
usqler.add("name", main.getName());
|
||||
usqler.add("avtag", main.getAvtag());
|
||||
@@ -76,7 +76,7 @@ public class WfProcDefDao {
|
||||
}
|
||||
|
||||
public void deleteById(Long id) {
|
||||
jdbcHelper.update("delete from wf_proc_def where id=?", id);
|
||||
jdbcHelper.update("delete from bpm_proc_def where id=?", id);
|
||||
}
|
||||
|
||||
private final JdbcHelper jdbcHelper;
|
||||
+6
-6
@@ -1,22 +1,22 @@
|
||||
package vben.wf.proc.def;
|
||||
package vben.bpm.proc.def;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import vben.wf.root.domain.Zproc;
|
||||
import vben.wf.root.domain.vo.WfProcDefVo;
|
||||
import vben.bpm.root.domain.Zproc;
|
||||
import vben.bpm.root.domain.vo.BpmProcDefVo;
|
||||
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class WfProcDefService {
|
||||
public class BpmProcDefService {
|
||||
|
||||
public WfProcDefVo findVoById(Long id) {
|
||||
public BpmProcDefVo findVoById(Long id) {
|
||||
return dao.findVoById(id);
|
||||
}
|
||||
|
||||
private final WfProcDefDao dao;
|
||||
private final BpmProcDefDao dao;
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
public void setExxml(Zproc zproc) {
|
||||
+5
-5
@@ -1,7 +1,7 @@
|
||||
package vben.wf.proc.inst;
|
||||
package vben.bpm.proc.inst;
|
||||
|
||||
import lombok.Data;
|
||||
import vben.wf.root.domain.Zproc;
|
||||
import vben.bpm.root.domain.Zproc;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
@@ -9,7 +9,7 @@ import java.util.Date;
|
||||
|
||||
|
||||
@Data
|
||||
public class WfProcInst implements Serializable {
|
||||
public class BpmProcInst implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -75,11 +75,11 @@ public class WfProcInst implements Serializable {
|
||||
*/
|
||||
private String state;
|
||||
|
||||
public WfProcInst() {
|
||||
public BpmProcInst() {
|
||||
|
||||
}
|
||||
|
||||
public WfProcInst(Zproc zproc) {
|
||||
public BpmProcInst(Zproc zproc) {
|
||||
this.id= zproc.getProid();
|
||||
this.name= zproc.getProna();
|
||||
this.prdid= zproc.getPrdid();
|
||||
+9
-9
@@ -1,4 +1,4 @@
|
||||
package vben.wf.proc.inst;
|
||||
package vben.bpm.proc.inst;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
@@ -11,16 +11,16 @@ import vben.common.jdbc.sqler.Usqler;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class WfProcInstDao {
|
||||
public class BpmProcInstDao {
|
||||
|
||||
public void updateEndState(Long id){
|
||||
String sql="update wf_proc_inst set state='30' where id=?";
|
||||
String sql="update bpm_proc_inst set state='30' where id=?";
|
||||
jdbcHelper.update(sql,id);
|
||||
}
|
||||
|
||||
private static final String table = "wf_proc_inst";
|
||||
private static final String table = "bpm_proc_inst";
|
||||
|
||||
private void fieldHandle(BaseSqler sqler, WfProcInst main){
|
||||
private void fieldHandle(BaseSqler sqler, BpmProcInst main){
|
||||
sqler.add("name", main.getName());
|
||||
sqler.add("avtag", main.getAvtag());
|
||||
sqler.add("notes", main.getNotes());
|
||||
@@ -30,12 +30,12 @@ public class WfProcInstDao {
|
||||
sqler.add("state", main.getState());
|
||||
}
|
||||
|
||||
public WfProcInst findById(Long id) {
|
||||
public BpmProcInst findById(Long id) {
|
||||
String sql = "select * from "+table+" where id = ?";
|
||||
return jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(WfProcInst.class), id);
|
||||
return jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(BpmProcInst.class), id);
|
||||
}
|
||||
|
||||
public void insert(WfProcInst main) {
|
||||
public void insert(BpmProcInst main) {
|
||||
Isqler sqler = new Isqler(table);
|
||||
if(main.getId()==null){
|
||||
main.setId(IdUtils.getSnowflakeNextId());
|
||||
@@ -49,7 +49,7 @@ public class WfProcInstDao {
|
||||
jdbcHelper.getTp().update(sqler.getSql(), sqler.getParams());
|
||||
}
|
||||
|
||||
public void update(WfProcInst main) {
|
||||
public void update(BpmProcInst main) {
|
||||
Usqler usqler = new Usqler(table);
|
||||
usqler.addWhere("id=?", main.getId());
|
||||
usqler.add("uptim", main.getUptim());
|
||||
+5
-5
@@ -1,7 +1,7 @@
|
||||
package vben.wf.proc.inst;
|
||||
package vben.bpm.proc.inst;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import vben.wf.root.domain.Zproc;
|
||||
import vben.bpm.root.domain.Zproc;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -9,11 +9,11 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class WfProcInstService {
|
||||
public class BpmProcInstService {
|
||||
|
||||
private final WfProcInstDao dao;
|
||||
private final BpmProcInstDao dao;
|
||||
|
||||
public void insert(WfProcInst process) {
|
||||
public void insert(BpmProcInst process) {
|
||||
dao.insert(process);
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package vben.wf.proc.node;
|
||||
package vben.bpm.proc.node;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.util.Date;
|
||||
|
||||
|
||||
@Data
|
||||
public class WfProcNode implements Serializable {
|
||||
public class BpmProcNode implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
+10
-10
@@ -1,4 +1,4 @@
|
||||
package vben.wf.proc.node;
|
||||
package vben.bpm.proc.node;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
@@ -10,15 +10,15 @@ import vben.common.jdbc.sqler.Usqler;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class WfProcNodeDao {
|
||||
public class BpmProcNodeDao {
|
||||
|
||||
public WfProcNode findById(Long id) {
|
||||
String sql = "select * from wf_proc_node where id = ?";
|
||||
return jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(WfProcNode.class), id);
|
||||
public BpmProcNode findById(Long id) {
|
||||
String sql = "select * from bpm_proc_node where id = ?";
|
||||
return jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(BpmProcNode.class), id);
|
||||
}
|
||||
|
||||
public void insert(WfProcNode main) {
|
||||
Isqler isqler = new Isqler("wf_proc_node");
|
||||
public void insert(BpmProcNode main) {
|
||||
Isqler isqler = new Isqler("bpm_proc_node");
|
||||
if(main.getId()==null){
|
||||
main.setId(IdUtils.getSnowflakeNextId());
|
||||
}
|
||||
@@ -33,8 +33,8 @@ public class WfProcNodeDao {
|
||||
jdbcHelper.getTp().update(isqler.getSql(), isqler.getParams());
|
||||
}
|
||||
|
||||
public void update(WfProcNode main) {
|
||||
Usqler usqler = new Usqler("wf_proc_node");
|
||||
public void update(BpmProcNode main) {
|
||||
Usqler usqler = new Usqler("bpm_proc_node");
|
||||
usqler.addWhere("id=?", main.getId());
|
||||
usqler.add("facno", main.getFacno());
|
||||
usqler.add("facna", main.getFacna());
|
||||
@@ -47,7 +47,7 @@ public class WfProcNodeDao {
|
||||
}
|
||||
|
||||
public void deleteById(Long id) {
|
||||
jdbcHelper.update("delete from wf_proc_node where id=?", id);
|
||||
jdbcHelper.update("delete from bpm_proc_node where id=?", id);
|
||||
}
|
||||
|
||||
private final JdbcHelper jdbcHelper;
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package vben.wf.proc.node;
|
||||
package vben.bpm.proc.node;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.util.Date;
|
||||
|
||||
|
||||
@Data
|
||||
public class WfProcNodeHi implements Serializable {
|
||||
public class BpmProcNodeHi implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
+9
-9
@@ -1,4 +1,4 @@
|
||||
package vben.wf.proc.node;
|
||||
package vben.bpm.proc.node;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
@@ -13,16 +13,16 @@ import java.util.List;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class WfProcNodeHiDao {
|
||||
public class BpmProcNodeHiDao {
|
||||
|
||||
public List<String> findFacnoListByProid(Long proid){
|
||||
String sql="select distinct t.facno id from wf_proc_node_hi t where proid= ?";
|
||||
String sql="select distinct t.facno id from bpm_proc_node_hi t where proid= ?";
|
||||
return jdbcHelper.findSlist(sql, proid);
|
||||
}
|
||||
|
||||
private static final String table = "wf_proc_node_hi";
|
||||
private static final String table = "bpm_proc_node_hi";
|
||||
|
||||
private void fieldHandle(BaseSqler sqler, WfProcNodeHi main){
|
||||
private void fieldHandle(BaseSqler sqler, BpmProcNodeHi main){
|
||||
sqler.add("facno", main.getFacno());
|
||||
sqler.add("facna", main.getFacna());
|
||||
sqler.add("flway", main.getFlway());
|
||||
@@ -34,12 +34,12 @@ public class WfProcNodeHiDao {
|
||||
sqler.add("entim", main.getEntim());
|
||||
}
|
||||
|
||||
public WfProcNodeHi findById(Long id) {
|
||||
public BpmProcNodeHi findById(Long id) {
|
||||
String sql = "select * from "+table+" where id = ?";
|
||||
return jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(WfProcNodeHi.class), id);
|
||||
return jdbcHelper.getTp().queryForObject(sql, new BeanPropertyRowMapper<>(BpmProcNodeHi.class), id);
|
||||
}
|
||||
|
||||
public void insert(WfProcNodeHi main) {
|
||||
public void insert(BpmProcNodeHi main) {
|
||||
Isqler isqler = new Isqler(table);
|
||||
if(main.getId()==null){
|
||||
main.setId(IdUtils.getSnowflakeNextId());
|
||||
@@ -49,7 +49,7 @@ public class WfProcNodeHiDao {
|
||||
jdbcHelper.getTp().update(isqler.getSql(), isqler.getParams());
|
||||
}
|
||||
|
||||
public void update(WfProcNodeHi main) {
|
||||
public void update(BpmProcNodeHi main) {
|
||||
Usqler usqler = new Usqler(table);
|
||||
usqler.addWhere("id=?", main.getId());
|
||||
fieldHandle(usqler,main);
|
||||
+13
-13
@@ -1,9 +1,9 @@
|
||||
package vben.wf.proc.node;
|
||||
package vben.bpm.proc.node;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import vben.wf.root.domain.Zproc;
|
||||
import vben.wf.root.domain.Znode;
|
||||
import vben.bpm.root.domain.Zproc;
|
||||
import vben.bpm.root.domain.Znode;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -13,12 +13,12 @@ import java.util.List;
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class WfProcNodeHiService {
|
||||
public class BpmProcNodeHiService {
|
||||
|
||||
private final WfProcNodeHiDao dao;
|
||||
private final BpmProcNodeHiDao dao;
|
||||
|
||||
public void saveStartNode(Zproc zproc) {
|
||||
WfProcNodeHi startNode = new WfProcNodeHi();
|
||||
BpmProcNodeHi startNode = new BpmProcNodeHi();
|
||||
startNode.setFacno("NS");
|
||||
startNode.setFacna("开始节点");
|
||||
startNode.setFacty("start");
|
||||
@@ -31,7 +31,7 @@ public class WfProcNodeHiService {
|
||||
}
|
||||
|
||||
public void saveDraftNode(Zproc zproc, Znode znode) {
|
||||
WfProcNodeHi draftNode = new WfProcNodeHi();
|
||||
BpmProcNodeHi draftNode = new BpmProcNodeHi();
|
||||
draftNode.setFacno("N1");
|
||||
draftNode.setFacna("起草节点");
|
||||
draftNode.setFacty("draft");
|
||||
@@ -45,7 +45,7 @@ public class WfProcNodeHiService {
|
||||
}
|
||||
|
||||
public Long saveEndNode(Zproc zproc) {
|
||||
WfProcNodeHi endNode = new WfProcNodeHi();
|
||||
BpmProcNodeHi endNode = new BpmProcNodeHi();
|
||||
endNode.setFacno("NE");
|
||||
endNode.setFacna("结束节点");
|
||||
endNode.setFacty("end");
|
||||
@@ -58,7 +58,7 @@ public class WfProcNodeHiService {
|
||||
|
||||
public void saveNodeList(Zproc zproc, List<Znode> list) {
|
||||
for (Znode znode : list) {
|
||||
WfProcNodeHi node = new WfProcNodeHi();
|
||||
BpmProcNodeHi node = new BpmProcNodeHi();
|
||||
node.setFacno(znode.getFacno());
|
||||
node.setFacna(znode.getFacna());
|
||||
node.setFacty(znode.getFacty());
|
||||
@@ -71,8 +71,8 @@ public class WfProcNodeHiService {
|
||||
}
|
||||
}
|
||||
|
||||
public WfProcNodeHi saveNode(WfProcNode main) {
|
||||
WfProcNodeHi node = new WfProcNodeHi();
|
||||
public BpmProcNodeHi saveNode(BpmProcNode main) {
|
||||
BpmProcNodeHi node = new BpmProcNodeHi();
|
||||
node.setId(main.getId());
|
||||
node.setFacno(main.getFacno());
|
||||
node.setFacna(main.getFacna());
|
||||
@@ -85,7 +85,7 @@ public class WfProcNodeHiService {
|
||||
}
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
public WfProcNodeHi findOne(Long id) {
|
||||
public BpmProcNodeHi findOne(Long id) {
|
||||
return dao.findById(id);
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ public class WfProcNodeHiService {
|
||||
return dao.findFacnoListByProid(proid);
|
||||
}
|
||||
|
||||
public void update(WfProcNodeHi nodeHi) {
|
||||
public void update(BpmProcNodeHi nodeHi) {
|
||||
dao.update(nodeHi);
|
||||
}
|
||||
}
|
||||
+8
-8
@@ -1,20 +1,20 @@
|
||||
package vben.wf.proc.node;
|
||||
package vben.bpm.proc.node;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import vben.wf.root.domain.Zproc;
|
||||
import vben.wf.root.domain.Znode;
|
||||
import vben.bpm.root.domain.Zproc;
|
||||
import vben.bpm.root.domain.Znode;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class WfProcNodeService {
|
||||
public class BpmProcNodeService {
|
||||
|
||||
private final WfProcNodeDao dao;
|
||||
private final BpmProcNodeDao dao;
|
||||
|
||||
public WfProcNode saveNode(Zproc zproc, Znode znode) {
|
||||
WfProcNode node = new WfProcNode();
|
||||
public BpmProcNode saveNode(Zproc zproc, Znode znode) {
|
||||
BpmProcNode node = new BpmProcNode();
|
||||
node.setFacno(znode.getFacno());
|
||||
node.setFacna(znode.getFacna());
|
||||
node.setFacty(znode.getFacty());
|
||||
@@ -26,7 +26,7 @@ public class WfProcNodeService {
|
||||
}
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
public WfProcNode findOne(Long id) {
|
||||
public BpmProcNode findOne(Long id) {
|
||||
return dao.findById(id);
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package vben.wf.proc.param;
|
||||
package vben.bpm.proc.param;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -6,7 +6,7 @@ import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class WfProcParam implements Serializable {
|
||||
public class BpmProcParam implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user