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

Merge remote-tracking branch 'origin/master'

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