提交 dbd3c71c authored 作者: ww1xhqc's avatar ww1xhqc

Merge remote-tracking branch 'origin/master'

......@@ -50,10 +50,10 @@
<artifactId>springfox-swagger-ui</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<!--flowable整合springboot-->
......@@ -106,32 +106,32 @@
</dependencies>
<build>
<!-- <resources>-->
<!-- <resource>-->
<!-- <directory>src/main/java</directory>-->
<!-- <includes>-->
<!-- <include>**/*</include>-->
<!-- </includes>-->
<!-- <excludes>-->
<!-- <exclude>**/.svn/*</exclude>-->
<!-- </excludes>-->
<!-- <filtering>false</filtering>-->
<!-- </resource>-->
<!-- </resources>-->
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*</include>
</includes>
<excludes>
<exclude>**/.svn/*</exclude>
</excludes>
<filtering>false</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!-- <plugin>-->
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<!-- <artifactId>maven-compiler-plugin</artifactId>-->
<!-- <configuration>-->
<!-- <source>1.8</source> &lt;!&ndash;指明源码用的Jdk版本&ndash;&gt;-->
<!-- <target>1.8</target> &lt;!&ndash;指明打包后的Jdk版本&ndash;&gt;-->
<!-- </configuration>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
<!-- </plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source> <!--指明源码用的Jdk版本-->
<target>1.8</target> <!--指明打包后的Jdk版本-->
</configuration>
</plugin>
</plugins>
</build>
......
package com.tykj.workflowcore.base.entity;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import java.util.Date;
/**
* ClassName: BaseEntity
* Package: com.tykj.workflowcore.base.entity
* Description:
* Datetime: 2021/3/11 19:36
*
* @Author: zsp
*/
@AllArgsConstructor
@NoArgsConstructor
* @author HuangXiahao
* @version V1.0
* @class BaseEntity
* @packageName com.example.demo.entity
**/
@Data
@MappedSuperclass
public abstract class BaseEntity {
private Date createTime;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty("主键")
protected Integer id;
@ApiModelProperty("创建时间")
@Temporal(TemporalType.TIMESTAMP)
protected Date createdTime;
@ApiModelProperty("修改时间")
@Temporal(TemporalType.TIMESTAMP)
protected Date updatedTime;
@ApiModelProperty("逻辑删除 0为 false 1为 true")
protected Integer deleted = 0;
private Date updateTime;
}
......@@ -53,7 +53,6 @@ public class FlowsInfoController {
@ApiOperation(value = "查询流程信息")
public ResponseEntity searchFlowInfo(@RequestBody SearchFlowInfoVo searchFlowInfoVo){
Page<FlowsInfo> flowsInfoList = flowInfoService.searchFlowInfo(searchFlowInfoVo);
return ResultUtil.success(flowsInfoList,"查询成功");
}
......@@ -61,7 +60,6 @@ public class FlowsInfoController {
@ApiOperation(value = "编辑流程")
public String editFlow(Long id){
return flowInfoService.editFlow(id).getFilePath();
}
@GetMapping("/deploy")
@ApiOperation(value = "部署流程",notes = "部署成功")
......@@ -75,12 +73,6 @@ public class FlowsInfoController {
return ResultUtil.success(flowsInfo.getState(),"流程部署成功");
}
@PostMapping("/disableFlow")
@ApiOperation(value = "禁用流程",notes = "分页查询")
public ResponseEntity disableFlow(@RequestBody Long flowId){
flowInfoService.disableFlow(flowId);
return ResultUtil.success("禁用成功");
}
@PostMapping("/saveXml")
@ApiOperation(value = "保存xml以及其他流程信息")
......@@ -92,9 +84,6 @@ public class FlowsInfoController {
return ResultUtil.success("文件保存成功");
}
//保存流程中的 节点信息和节点内容
@PostMapping("/updateByProcessName")
@ApiOperation(value = "通过流程名称修改")
public ResponseEntity updateByProcessName(@RequestBody FlowsInfoVo flowsInfoVo) {
......
......@@ -87,19 +87,16 @@ public class WorkFlowController {
@PostMapping("/isSuspension")
@ApiOperation("是否挂起")
public ResponseEntity isSuspension(@RequestBody SuspendVo suspendVo){
workFlowService.suspendOrActivateProcessDefinitionByKey(suspendVo);
return ResultUtil.success("该流程已被挂起");
public void isSuspension(Long id){
workFlowService.suspendOrActivateProcessDefinitionByKey(id);
// return ResultUtil.success("该流程已被暂停");
}
@DeleteMapping("/deleteFlow")
@ApiOperation("是否删除")
public ResponseEntity deleteFlow(String deployId){
//根据流程id查询出flowsInfo
FlowsInfo flowsInfo = flowInfoService.findByDeployId(deployId);
//删除flowsInfo
flowInfoService.deleteById(flowsInfo.getId());
workFlowService.deleteFlow(deployId);
public ResponseEntity deleteFlow(Long id){
workFlowService.deleteFlow(id);
return ResultUtil.success("该流程已被删除");
}
......
......@@ -7,6 +7,8 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
......@@ -27,6 +29,8 @@ import java.util.Date;
@NoArgsConstructor
@Entity
@WorkFlowCoreNoScan
@SQLDelete(sql = "update flows_info set deleted = 1 where id = ?")
@Where(clause = "deleted = 0")
@Api("流程表")
public class FlowsInfo extends BaseEntity {
@Id
......@@ -71,4 +75,5 @@ public class FlowsInfo extends BaseEntity {
* @params: 部署id
*/
private String deployId;
}
package com.tykj.workflowcore.workflow_editer.entity;
import com.tykj.workflowcore.base.entity.BaseEntity;
import com.tykj.workflowcore.model_layer.annotatiion.WorkFlowCoreNoScan;
import com.tykj.workflowcore.workflow_editer.vo.InFormPageVo;
import com.tykj.workflowcore.workflow_editer.vo.OutFormPageVo;
......@@ -8,6 +9,8 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import org.springframework.beans.BeanUtils;
import javax.persistence.*;
......@@ -26,8 +29,10 @@ import java.util.Date;
@NoArgsConstructor
@Entity
@WorkFlowCoreNoScan
@SQLDelete(sql = "update flows_info set deleted = 1 where id = ?")
@Where(clause = "deleted = 0")
@Api("表单页面")
public class FormPage {
public class FormPage extends BaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
......
......@@ -17,7 +17,7 @@ import lombok.NoArgsConstructor;
@Data
public class SearchFlowInfoVo extends JpaCustomPage {
@ApiModelProperty(value = "部署状态",notes = "0 已部署,1 未部署")
@ApiModelProperty(value = "状态",notes = "0 可用,1 暂停")
private Integer state;
@ApiModelProperty("流程名称")
......
......@@ -47,12 +47,6 @@ public interface FlowInfoService {
*/
FlowsInfo findByDeployId(String deployId);
/**
* 根据id删除
* @param id id
*/
void deleteById(Long id);
/**
* 根据流程主键查询
* @param flowKey 流程主键
......
......@@ -45,7 +45,7 @@ public interface FormPageService {
* 根据页面id删除页面
* @param id 页面id
*/
void deletePage(@PathVariable("id") Long id);
void deletePage(Long id);
/**
* 查询全部页面
......
package com.tykj.workflowcore.workflow_editer.service;
import com.tykj.workflowcore.api.entity.InvokeRequest;
import com.tykj.workflowcore.workflow_editer.entity.FlowsInfo;
import com.tykj.workflowcore.workflow_editer.vo.*;
import org.flowable.task.api.Task;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
......@@ -88,8 +86,6 @@ public interface WorkFlowService {
*/
Map<String,Object> findTaskDetail(String taskId);
/**
* 任务完成
* @param taskVo taskVo
......@@ -114,15 +110,15 @@ public interface WorkFlowService {
/**
* 是否挂起
* @param suspendVo
* @param id 流程id
*/
void suspendOrActivateProcessDefinitionByKey(SuspendVo suspendVo);
void suspendOrActivateProcessDefinitionByKey(Long id);
/**
* 删除流程
* @param deployId 部署id
* @param id 流程id
*/
void deleteFlow(String deployId);
void deleteFlow(Long id);
/**
......@@ -138,5 +134,7 @@ public interface WorkFlowService {
* @return 任务已办列表
*/
List<Object> findHistoryTask(String userId);
}
......@@ -66,10 +66,6 @@ public class FlowInfoServiceImpl implements FlowInfoService {
return flowsInfoMapper.findByDeployId(deployId);
}
@Override
public void deleteById(Long id) {
flowsInfoMapper.deleteById(id);
}
@Override
public FlowsInfo findByFlowKey(String flowKey) {
......
......@@ -60,8 +60,10 @@ public class FormPageServiceImpl implements FormPageService {
}
@Override
public void deletePage(@PathVariable("id") Long id) {
formPageMapper.deleteById(id);
public void deletePage(Long id) {
FormPage formPage = formPageMapper.findById(id).get();
formPage.setDeleted(1);
formPageMapper.save(formPage);
}
@Override
......
package com.tykj.workflowcore.workflow_editer.service.impl;
import com.tykj.workflowcore.workflow_editer.entity.WorkFlowRole;
import com.tykj.workflowcore.workflow_editer.entity.WorkFlowRoleType;
import com.tykj.workflowcore.workflow_editer.entity.WorkFlowUser;
import com.tykj.workflowcore.workflow_editer.service.UserService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* ClassName: UserService
* Package: com.tykj.service
* Description:
* Datetime: 2021/2/25 13:53
*
* @Author: zsp
*/
@Service
public class UserServiceImpl implements UserService {
@Override
public WorkFlowUser getCurrentUser() {
return null;
}
@Override
public List<WorkFlowUser> getAllUser() {
return null;
}
@Override
public List<WorkFlowRole> getAllRole(String roleType) {
return null;
}
@Override
public List<WorkFlowRoleType> getRoleType() {
return null;
}
}
......@@ -58,7 +58,6 @@ public class WorkFlowServiceImpl implements WorkFlowService {
private final RuntimeService runtimeService;
private final TaskService taskService;
private final FlowsInfoMapper flowsInfoMapper;
private final UserService userService;
private final HistoryService historyService;
private final ProcessEngineConfigurationImpl processEngineConfiguration;
......@@ -138,7 +137,6 @@ public class WorkFlowServiceImpl implements WorkFlowService {
flowsInfo.setFlowKey(processId);
flowsInfo.setFlowName(processName);
flowsInfo.setResourceName(file.getOriginalFilename());
flowsInfo.setCreateTime(new Date());
//状态为未部署
flowsInfo.setState(1);
flowsInfo.setFilePath(realPath);
......@@ -195,7 +193,6 @@ public class WorkFlowServiceImpl implements WorkFlowService {
FlowsInfo flowsInfo = new FlowsInfo();
BeanUtils.copyProperties(flowsInfoVo,flowsInfo);
flowsInfo.setResourceName(flowKey+"bpmn20.xml");
flowsInfo.setCreateTime(new Date());
//状态为未部署
flowsInfo.setState(1);
flowsInfo.setFilePath(classLoader.getResource("").getPath()+"/xml/"+flowKey+"bpmn20.xml");
......@@ -338,17 +335,30 @@ public class WorkFlowServiceImpl implements WorkFlowService {
@Override
public void suspendOrActivateProcessDefinitionByKey(SuspendVo suspendVo) {
if (suspendVo.getSuspensionState() == 1){
repositoryService.suspendProcessDefinitionByKey(suspendVo.getProcessDefinitionKey(), true, new Date());
public void suspendOrActivateProcessDefinitionByKey(Long id) {
//通过流程ID 查询出flowsInfo
FlowsInfo flowsInfo = flowsInfoMapper.findById(id).get();
String flowKey = flowsInfo.getFlowKey();
if (flowsInfo.getState() == 0){
//挂起
repositoryService.suspendProcessDefinitionByKey(flowKey, true, new Date());
flowsInfo.setState(1);
}else {
repositoryService.activateProcessDefinitionById(suspendVo.getProcessDefinitionKey(),true, new Date());
//激活
repositoryService.activateProcessDefinitionByKey(flowKey,true, new Date());
flowsInfo.setState(0);
}
flowsInfoMapper.save(flowsInfo);
}
@Override
public void deleteFlow(String deployId) {
repositoryService.deleteDeployment(deployId);
public void deleteFlow(Long id) {
//通过流程id查询出flowsInfo
FlowsInfo flowsInfo = flowsInfoMapper.findById(id).get();
flowsInfo.setState(1);
flowsInfoMapper.save(flowsInfo);
}
@Override
......
......@@ -18,13 +18,13 @@ import lombok.NoArgsConstructor;
public class SuspendVo {
/**
* 流程主键
* 流程id
*/
private String processDefinitionKey;
private Long id;
/**
* 是否挂起 1 挂起 0 激活
* 是否可用 0 挂起 1 激活
*/
private int suspensionState;
private int state;
}
......@@ -2,7 +2,7 @@ spring:
datasource:
username: root
password: Huang123+
url: jdbc:mysql://47.106.142.73:3306/www?useSSL=false&serverTimezone=UTC&characterEncoding=utf-8&nullCatalogMeansCurrent=true
url: jdbc:mysql://47.106.142.73:3306/www2?useSSL=false&serverTimezone=UTC&characterEncoding=utf-8&nullCatalogMeansCurrent=true
driver-class-name: com.mysql.cj.jdbc.Driver
jpa:
show-sql: true
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论