提交 2bf38c9f 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> <!--指明源码用的Jdk版本-->
<target>1.8</target> <!--指明打包后的Jdk版本-->
</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> &lt;!&ndash;指明源码用的Jdk版本&ndash;&gt;-->
<!-- <target>1.8</target> &lt;!&ndash;指明打包后的Jdk版本&ndash;&gt;-->
<!-- </configuration>-->
<!-- </plugin>-->
</plugins>
</build>
......
......@@ -2,7 +2,6 @@ package com.tykj.workflowcore;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
/**
* 测试时的启动类
......
package com.tykj.workflowcore;
import com.tykj.workflowcore.api.service.ApiService;
import com.tykj.workflowcore.model_layer.service.ModelService;
import liquibase.pro.packaged.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Bean;
......
package com.tykj.workflowcore.base.aop;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import java.util.Arrays;
/**
* ClassName: EntityAop
* Package: com.tykj.workflowcore.base.aop
* Description:
* Datetime: 2021/3/11 19:40
*
* @Author: zsp
*/
@Aspect
public class EntityAop {
@Before("execution(* save*(..))")
public void permissionCheck(JoinPoint point) {
System.out.println("@Before:模拟权限检查...");
System.out.println("@Before:目标方法为:" +
point.getSignature().getDeclaringTypeName() +
"." + point.getSignature().getName());
System.out.println("@Before:参数为:" + Arrays.toString(point.getArgs()));
System.out.println("@Before:被织入的目标对象为:" + point.getTarget());
}
}
package com.tykj.workflowcore.base.entity;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* ClassName: BaseEntity
* Package: com.tykj.workflowcore.base.entity
* Description:
* Datetime: 2021/3/11 19:36
*
* @Author: zsp
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
public abstract class BaseEntity {
private Date createTime;
private Date updateTime;
}
package com.tykj.workflowcore;
package com.tykj.workflowcore.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
......
......@@ -51,11 +51,18 @@ public class FlowsInfoController {
@PostMapping("/searchFlowInfo")
@ApiOperation(value = "查询流程信息")
public ResponseEntity searchFlowInfo(SearchFlowInfoVo searchFlowInfoVo){
public ResponseEntity searchFlowInfo(@RequestBody SearchFlowInfoVo searchFlowInfoVo){
Page<FlowsInfo> flowsInfoList = flowInfoService.searchFlowInfo(searchFlowInfoVo);
return ResultUtil.success(flowsInfoList,"查询成功");
}
@GetMapping("editFlow")
@ApiOperation(value = "编辑流程")
public String editFlow(Long id){
return flowInfoService.editFlow(id).getFilePath();
}
@GetMapping("/deploy")
@ApiOperation(value = "部署流程",notes = "部署成功")
public ResponseEntity deploy(Long id) throws FileNotFoundException {
......@@ -104,7 +111,7 @@ public class FlowsInfoController {
}
@PostMapping("/createFlow")
@ApiModelProperty("创建成功")
@ApiModelProperty("创建流程")
public ResponseEntity createFlow(@RequestBody FlowsInfoVo flowsInfovo){
return ResultUtil.success(workFlowService.createFlow(flowsInfovo.toEntity()),"流程创建成功");
}
......
......@@ -9,9 +9,11 @@ import com.tykj.workflowcore.workflow_editer.service.FormPageService;
//import com.tykj.workflowcore.workflow_editer.service.PageEntityService;
import com.tykj.workflowcore.workflow_editer.vo.InFormPageVo;
import com.tykj.workflowcore.workflow_editer.vo.OutFormPageVo;
import com.tykj.workflowcore.workflow_editer.vo.PageFormPageVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
......@@ -57,8 +59,9 @@ public class FormPageController {
@ApiOperation("查看页面")
@GetMapping("/findPages")
public List<OutFormPageVo> findPages(){
return formPageService.getAllPages();
public ResponseEntity findPages(@RequestBody PageFormPageVo pageFormPageVo){
return ResultUtil.success(formPageService.getAllPages(pageFormPageVo),"查询成功");
}
@ApiOperation("删除页面")
......
//package com.tykj.workflowcore.workflow_editer.controller;
//
//import com.tykj.workflowcore.model_layer.model.TableInfo;
//import com.tykj.workflowcore.workflow_editer.entity.PageEntity;
//import com.tykj.workflowcore.workflow_editer.service.PageEntityService;
//import io.swagger.annotations.Api;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.util.List;
//
///**
// * ClassName: PageEntityController
// * Package: com.tykj.controller
// * Description:
// * Datetime: 2021/3/4 9:50
// *
// * @Author: zsp
// */
//@RestController
//@RequestMapping("/pageEntity")
//@Api("页面跟实体的管理")
//
//public class PageEntityController {
//
// @Autowired
// private PageEntityService pageEntityService;
//
// @PostMapping("/savePageEntity")
// public void savePageEntity(@RequestBody PageEntity pageEntity){
// pageEntityService.savePageEntity(pageEntity);
// }
//
// @PostMapping("/findByPages")
// public List<TableInfo> findByPages(List<Integer> pageIds){
//
// return pageEntityService.findByPageIds(pageIds);
// }
//}
package com.tykj.workflowcore.workflow_editer.controller;
import com.tykj.workflowcore.base.result.ResultUtil;
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 io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @author HuangXiahao
* @version V1.0
* @class UserController
* @packageName com.tykj.workflowcore.workflow_editer.controller
**/
@RestController()
@RequestMapping("/workflow/user")
@Api("页面管理接口")
public class UserController {
@Autowired(required = false)
UserService userService;
@PostMapping("/getCurrentUser")
public ResponseEntity getCurrentUser(){
WorkFlowUser currentUser = userService.getCurrentUser();
return ResultUtil.success(currentUser,"查询成功");
}
@PostMapping("/getAllUser")
public ResponseEntity getAllUser(){
List<WorkFlowUser> allUser = userService.getAllUser();
return ResultUtil.success(allUser,"查询成功");
}
@PostMapping("/getAllRole")
public ResponseEntity getAllRole(String roleType){
List<WorkFlowRole> allRole = userService.getAllRole(roleType);
return ResultUtil.success(allRole,"查询成功");
}
@PostMapping("/getRoleType")
public ResponseEntity getRoleType(){
List<WorkFlowRoleType> roleType = userService.getRoleType();
return ResultUtil.success(roleType,"查询成功");
}
}
......@@ -37,6 +37,7 @@ public class WorkFlowController {
@Autowired
private WorkFlowService workFlowService;
@PostMapping("/deploy")
@ApiOperation(value = "部署流程",notes = "0 部署成功")
public Integer deploy(Long id) throws FileNotFoundException {
......@@ -65,7 +66,7 @@ public class WorkFlowController {
}
@PostMapping("/findTaskDetail")
@ApiOperation("任务个人待办详情")
@ApiOperation("任务个人待办任务详情")
public Map<String, Object> findTaskDetail(String taskId){
return workFlowService.findTaskDetail(taskId);
}
......@@ -74,7 +75,7 @@ public class WorkFlowController {
@ApiOperation("完成任务")
public ResponseEntity completeTask(@RequestBody TaskVo taskVo){
workFlowService.completeTask(taskVo);
return ResultUtil.success("该任务已完成");
return ResultUtil.success("该任务已完成");
}
@PostMapping("/isTransferTask")
......
package com.tykj.workflowcore.workflow_editer.entity;
import com.tykj.workflowcore.base.entity.BaseEntity;
import com.tykj.workflowcore.model_layer.annotatiion.WorkFlowCoreNoScan;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
......@@ -27,7 +28,7 @@ import java.util.Date;
@Entity
@WorkFlowCoreNoScan
@Api("流程表")
public class FlowsInfo {
public class FlowsInfo extends BaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty("流程id")
......@@ -54,12 +55,6 @@ public class FlowsInfo {
@ApiModelProperty("文件路径")
private String filePath;
@ApiModelProperty("流程创建时间")
private Date createTime;
@ApiModelProperty("流程修改时间")
private Date updateTime;
@ApiModelProperty("流程描述")
private String flowDescribe;
......
......@@ -68,11 +68,18 @@ public interface FlowInfoService {
FlowsInfo disableFlow(Long flowInfoId);
/**
* 有条件的查询flowinfo
* 有条件的查询flowInfo
* @param searchFlowInfoVo
* @return
*/
Page<FlowsInfo> searchFlowInfo(SearchFlowInfoVo searchFlowInfoVo);
/**
* 编辑流程
* @param id 流程id
* @return
*/
FlowsInfo editFlow(Long id);
}
......@@ -4,6 +4,8 @@ import com.tykj.workflowcore.model_layer.model.TableInfo;
import com.tykj.workflowcore.workflow_editer.entity.FormPage;
import com.tykj.workflowcore.workflow_editer.vo.InFormPageVo;
import com.tykj.workflowcore.workflow_editer.vo.OutFormPageVo;
import com.tykj.workflowcore.workflow_editer.vo.PageFormPageVo;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -47,9 +49,10 @@ public interface FormPageService {
/**
* 查询全部页面
* @param pageFormPageVo 分页
* @return 全部集合
*/
List<OutFormPageVo> getAllPages();
Page<FormPage> getAllPages(PageFormPageVo pageFormPageVo);
/**
* 根据页面id查询tableInfo
......
//package com.tykj.workflowcore.workflow_editer.service;
//
//import com.tykj.workflowcore.model_layer.model.TableInfo;
//import com.tykj.workflowcore.workflow_editer.entity.PageEntity;
//
//import java.util.List;
//
///**
// * ClassName: PageEntityService
// * Package: com.tykj.service
// * Description:
// * Datetime: 2021/3/4 9:52
// *
// * @Author: zsp
// */
//public interface PageEntityService {
//
// /**
// * 保存
// * @param pageEntity 页面实体之间关系
// */
// void savePageEntity(PageEntity pageEntity);
//
// /**
// * 根据页面id查询tableInfo
// * @param pageIds 页面id
// * @return
// */
// List<TableInfo> findByPageIds(List<Integer> pageIds);
//
//
//}
......@@ -81,6 +81,11 @@ public interface WorkFlowService {
*/
// Map<String,Object> findTaskDetail(DetailTaskVo detailTaskVo);
/**
* 查看具体的任务详情
* @param taskId 任务id
* @return 任务列表
*/
Map<String,Object> findTaskDetail(String taskId);
......
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.core.annotation.Order;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* @author HuangXiahao
* @version V1.0
* @class DefaultUserSerbiveImpl
* @packageName com.tykj.workflowcore.workflow_editer.service.impl
**/
@Service
@Order
public class DefaultUserServiceImpl implements UserService {
@Override
public WorkFlowUser getCurrentUser() {
WorkFlowUser workFlowUser = new WorkFlowUser();
workFlowUser.setId(1L);
workFlowUser.setUserName("张三");
return workFlowUser;
}
@Override
public List<WorkFlowUser> getAllUser() {
List<WorkFlowUser> workFlowUsers = new ArrayList<>();
for (int i = 0; i < 10; i++) {
WorkFlowUser workFlowUser = new WorkFlowUser();
workFlowUser.setUserName("张1");
workFlowUser.setId((long) i);
workFlowUsers.add(workFlowUser);
}
return workFlowUsers;
}
@Override
public List<WorkFlowRole> getAllRole(String roleType) {
List<WorkFlowRole> workFlowUsers = new ArrayList<>();
if (roleType.equals("department")){
workFlowUsers.add(new WorkFlowRole("开发部","department","1"));
workFlowUsers.add(new WorkFlowRole("运营部","department","2"));
workFlowUsers.add(new WorkFlowRole("测试部","department","3"));
}else {
workFlowUsers.add(new WorkFlowRole("管理员","role","1"));
workFlowUsers.add(new WorkFlowRole("普通用户","role","2"));
workFlowUsers.add(new WorkFlowRole("运维人员","role","3"));
}
return workFlowUsers;
}
@Override
public List<WorkFlowRoleType> getRoleType() {
List<WorkFlowRoleType> workFlowRoleTypes = new ArrayList<>();
workFlowRoleTypes.add(new WorkFlowRoleType("部门","department"));
workFlowRoleTypes.add(new WorkFlowRoleType("角色","role"));
return workFlowRoleTypes;
}
}
......@@ -93,8 +93,14 @@ public class FlowInfoServiceImpl implements FlowInfoService {
public Page<FlowsInfo> searchFlowInfo(SearchFlowInfoVo searchFlowInfoVo) {
PredicateBuilder<FlowsInfo> and = Specifications.and();
and.eq(searchFlowInfoVo.getState()!=null,"state",searchFlowInfoVo.getState());
and.eq(searchFlowInfoVo.getFlowKey()!=null,"flowKey",searchFlowInfoVo.getState());
and.eq(searchFlowInfoVo.getFlowName()!=null,"flowName",searchFlowInfoVo.getState());
and.eq(searchFlowInfoVo.getFlowKey()!=null,"flowKey",searchFlowInfoVo.getFlowKey());
and.like(searchFlowInfoVo.getFlowName()!=null,"flowName","%"+searchFlowInfoVo.getFlowName()+"%");
return flowsInfoMapper.findAll(and.build(), searchFlowInfoVo.getPageable());
}
@Override
public FlowsInfo editFlow(Long id) {
return flowsInfoMapper.findById(id).get();
}
}
......@@ -5,12 +5,15 @@ import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications;
import com.tykj.workflowcore.model_layer.dao.TableInfoDao;
import com.tykj.workflowcore.model_layer.model.TableInfo;
import com.tykj.workflowcore.workflow_editer.entity.FlowsInfo;
import com.tykj.workflowcore.workflow_editer.entity.FormPage;
import com.tykj.workflowcore.workflow_editer.mapper.FormPageMapper;
import com.tykj.workflowcore.workflow_editer.service.FormPageService;
import com.tykj.workflowcore.workflow_editer.vo.InFormPageVo;
import com.tykj.workflowcore.workflow_editer.vo.OutFormPageVo;
import com.tykj.workflowcore.workflow_editer.vo.PageFormPageVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -62,18 +65,17 @@ public class FormPageServiceImpl implements FormPageService {
}
@Override
public List<OutFormPageVo> getAllPages() {
public Page<FormPage> getAllPages(PageFormPageVo pageFormPageVo) {
ArrayList<OutFormPageVo> formPageVos = new ArrayList<>();
List<FormPage> formPages = formPageMapper.findAll();
for (FormPage formPage : formPages) {
// FormPageVo formPageVo = new FormPageVo();
// BeanUtils.copyProperties(formPage,formPageVo);
// formPageVos.add(formPageVo);
OutFormPageVo outFormPageVo = formPage.toEntityVo();
formPageVos.add(outFormPageVo);
}
return formPageVos;
PredicateBuilder<FormPage> and = Specifications.and();
and.eq(pageFormPageVo.getPageName()!=null,"pageName",pageFormPageVo.getPageName());
and.eq(pageFormPageVo.getPageDesc()!=null,"pageDesc",pageFormPageVo.getPageDesc());
and.eq(pageFormPageVo.getCreateTime()!=null,"createTime",pageFormPageVo.getCreateTime());
Page<FormPage> formPagePage = formPageMapper.findAll(and.build(), pageFormPageVo.getPageable());
return formPagePage;
}
@Override
......
//package com.tykj.workflowcore.workflow_editer.service.impl;
//
//import com.github.wenhao.jpa.PredicateBuilder;
//import com.github.wenhao.jpa.Specifications;
//import com.tykj.workflowcore.model_layer.dao.TableInfoDao;
//import com.tykj.workflowcore.model_layer.model.TableInfo;
//import com.tykj.workflowcore.workflow_editer.entity.PageEntity;
//import com.tykj.workflowcore.workflow_editer.mapper.PageEntityMapper;
//import com.tykj.workflowcore.workflow_editer.service.PageEntityService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//import java.util.ArrayList;
//import java.util.List;
//
///**
// * ClassName: PageEntityServiceImpl
// * Package: com.tykj.service.impl
// * Description:
// * Datetime: 2021/3/4 9:55
// *
// * @Author: zsp
// */
//@Service
//public class PageEntityServiceImpl implements PageEntityService {
//
// @Autowired
// private PageEntityMapper pageEntityMapper;
// @Autowired
// private TableInfoDao tableInfoDao;
// @Override
// public void savePageEntity(PageEntity pageEntity) {
// pageEntityMapper.save(pageEntity);
// }
//
// @Override
// public List<TableInfo> findByPageIds(List<Integer> pageIds) {
// ArrayList<TableInfo> list = new ArrayList<>();
// for (Integer pageId : pageIds) {
// String entityId = pageEntityMapper.findByPageId(pageId).getEntityId();
// //根据entityId查询出表
// PredicateBuilder<TableInfo> builder = Specifications.and();
// builder.eq("id",entityId);
// List<TableInfo> tableInfoList = tableInfoDao.findAll(builder.build());
// list.addAll(tableInfoList);
// }
// return list;
// }
//}
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;
}
}
......@@ -3,12 +3,14 @@ package com.tykj.workflowcore.workflow_editer.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.tykj.workflowcore.api.entity.InvokeRequest;
import com.tykj.workflowcore.api.entity.Parameter;
import com.tykj.workflowcore.api.service.SpringBeanService;
import com.tykj.workflowcore.workflow_editer.entity.*;
import com.tykj.workflowcore.workflow_editer.mapper.FlowsInfoMapper;
import com.tykj.workflowcore.workflow_editer.service.NodeInfoService;
import com.tykj.workflowcore.workflow_editer.service.UserService;
import com.tykj.workflowcore.workflow_editer.service.VariableStorageService;
import com.tykj.workflowcore.workflow_editer.service.WorkFlowService;
import com.tykj.workflowcore.workflow_editer.util.UserServiceBeanUtil;
import com.tykj.workflowcore.workflow_editer.vo.*;
import org.dom4j.Attribute;
import org.dom4j.Document;
......@@ -30,6 +32,7 @@ import org.flowable.task.api.TaskQuery;
import org.flowable.task.api.history.HistoricTaskInstance;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -51,30 +54,35 @@ import java.util.*;
@Service
public class WorkFlowServiceImpl implements WorkFlowService {
@Autowired
private RepositoryService repositoryService;
@Autowired
private RuntimeService runtimeService;
@Autowired
private TaskService taskService;
@Autowired
private FlowsInfoMapper flowsInfoMapper;
@Autowired
private UserService userService;
@Autowired
private HistoryService historyService;
@Autowired
private NodeInfoService nodeInfoService;
@Autowired
ProcessEngineConfigurationImpl processEngineConfiguration;
@Autowired
private ProcessEngine processEngine;
@Autowired
private VariableStorageService variableStorageService;
@Autowired
private final RepositoryService repositoryService;
private final RuntimeService runtimeService;
private final TaskService taskService;
private final FlowsInfoMapper flowsInfoMapper;
private final UserService userService;
private final HistoryService historyService;
private final ProcessEngineConfigurationImpl processEngineConfiguration;
private final ProcessEngine processEngine;
private final VariableStorageService variableStorageService;
final
ClassLoader classLoader;
public WorkFlowServiceImpl(SpringBeanService springBeanService,HistoryService historyService, RepositoryService repositoryService, RuntimeService runtimeService, TaskService taskService, FlowsInfoMapper flowsInfoMapper, ProcessEngineConfigurationImpl processEngineConfiguration, ProcessEngine processEngine, VariableStorageService variableStorageService, ClassLoader classLoader) {
this.historyService = historyService;
this.repositoryService = repositoryService;
this.runtimeService = runtimeService;
this.taskService = taskService;
this.flowsInfoMapper = flowsInfoMapper;
this.userService = UserServiceBeanUtil.getUserService(springBeanService);
this.processEngineConfiguration = processEngineConfiguration;
this.processEngine = processEngine;
this.variableStorageService = variableStorageService;
this.classLoader = classLoader;
System.out.println(userService!=null?"成功":"失败");
}
@Override
public String saveXml(@RequestParam("file") MultipartFile file) {
......@@ -244,12 +252,12 @@ public class WorkFlowServiceImpl implements WorkFlowService {
List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
TaskQuery taskQuery = taskService.createTaskQuery().or();
if (nextTaskVo.getUserId()!=null){
taskQuery.taskCandidateUser(nextTaskVo.getUserId()).orderByTaskCreateTime().desc();
taskQuery.taskCandidateUser(nextTaskVo.getUserId()).orderByTaskCreateTime().desc();
}
if (nextTaskVo.getRoleId()!=null&&nextTaskVo.getRoleId().size()>0){
taskQuery.taskCandidateGroupIn(nextTaskVo.getRoleId()).orderByTaskCreateTime().desc();
}
List<Task> listTask = taskQuery.endOr().list();
List<Task> listTask = taskQuery.endOr().listPage(1,5);
for (Task task : listTask) {
Map<String, Object> map = new HashMap<>();
ProcessInstance processInstance =
......
package com.tykj.workflowcore.workflow_editer.util;
import com.tykj.workflowcore.api.service.SpringBeanService;
import com.tykj.workflowcore.workflow_editer.service.UserService;
import java.util.Map;
import java.util.Set;
/**
* @author HuangXiahao
* @version V1.0
* @class UserServiceBeanUtil
* @packageName com.tykj.workflowcore.workflow_editer.util
**/
public class UserServiceBeanUtil {
public static UserService getUserService(SpringBeanService springBeanService) {
Map<String, UserService> beansOfType = springBeanService.getApplicationContext().getBeansOfType(UserService.class);
Set<String> strings = beansOfType.keySet();
if (strings.size()>1){
for (String key : strings) {
if (!key.equals("defaultUserServiceImpl")){
return beansOfType.get(key);
}
}
}
return beansOfType.get("defaultUserServiceImpl");
}
}
package com.tykj.workflowcore.workflow_editer.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tykj.workflowcore.workflow_editer.entity.FlowsInfo;
import com.tykj.workflowcore.workflow_editer.entity.NodeInfo;
import com.tykj.workflowcore.workflow_editer.entity.vo.NodeInfoVo;
......
package com.tykj.workflowcore.workflow_editer.vo;
import com.tykj.workflowcore.base.page.JpaCustomOrder;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -17,7 +18,7 @@ import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class NextTaskVo {
public class NextTaskVo {
private String userId;
......
package com.tykj.workflowcore.workflow_editer.vo;
import com.tykj.workflowcore.base.page.JpaCustomOrder;
import com.tykj.workflowcore.base.page.JpaCustomPage;
import com.tykj.workflowcore.workflow_editer.entity.FormPage;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......
package com.tykj.workflowcore.workflow_editer.vo;
import com.tykj.workflowcore.base.page.JpaCustomPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* ClassName: PageFormPageVo
* Package: com.tykj.workflowcore.workflow_editer.vo
* Description:
* Datetime: 2021/3/11 15:33
*
* @Author: zsp
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
@Api(tags = "分页查询页面")
public class PageFormPageVo extends JpaCustomPage {
@ApiModelProperty("页面名称")
private String pageName;
@ApiModelProperty("页面描述")
private String pageDesc;
@ApiModelProperty("页面创建时间")
private Date createTime;
}
spring:
datasource:
username: root
password: Huang123+
url: jdbc:mysql://47.106.142.73:3306/www?useSSL=false&serverTimezone=UTC&characterEncoding=utf-8&nullCatalogMeansCurrent=true
driver-class-name: com.mysql.cj.jdbc.Driver
druid:
username: root
password: 123456
url: jdbc:mysql://localhost:3306/model_layer?serverTimezone=UTC&characterEncoding=UTF-8&useUnicode=true
jpa:
show-sql: true
hibernate:
ddl-auto: update
naming:
implicit-strategy: org.hibernate.boot.model.naming.ImplicitNamingStrategyComponentPathImpl
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
show-sql: true
server:
port: 8900
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论