提交 2bf38c9f 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> <!--指明源码用的Jdk版本-->
<target>1.8</target> <!--指明打包后的Jdk版本-->
</configuration>
</plugin> </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> </plugins>
</build> </build>
......
...@@ -2,7 +2,6 @@ package com.tykj.workflowcore; ...@@ -2,7 +2,6 @@ package com.tykj.workflowcore;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
/** /**
* 测试时的启动类 * 测试时的启动类
......
package com.tykj.workflowcore; package com.tykj.workflowcore;
import com.tykj.workflowcore.api.service.ApiService;
import com.tykj.workflowcore.model_layer.service.ModelService; import com.tykj.workflowcore.model_layer.service.ModelService;
import liquibase.pro.packaged.A;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner; import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Bean; 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.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
......
...@@ -51,11 +51,18 @@ public class FlowsInfoController { ...@@ -51,11 +51,18 @@ public class FlowsInfoController {
@PostMapping("/searchFlowInfo") @PostMapping("/searchFlowInfo")
@ApiOperation(value = "查询流程信息") @ApiOperation(value = "查询流程信息")
public ResponseEntity searchFlowInfo(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,"查询成功");
} }
@GetMapping("editFlow")
@ApiOperation(value = "编辑流程")
public String editFlow(Long id){
return flowInfoService.editFlow(id).getFilePath();
}
@GetMapping("/deploy") @GetMapping("/deploy")
@ApiOperation(value = "部署流程",notes = "部署成功") @ApiOperation(value = "部署流程",notes = "部署成功")
public ResponseEntity deploy(Long id) throws FileNotFoundException { public ResponseEntity deploy(Long id) throws FileNotFoundException {
...@@ -104,7 +111,7 @@ public class FlowsInfoController { ...@@ -104,7 +111,7 @@ public class FlowsInfoController {
} }
@PostMapping("/createFlow") @PostMapping("/createFlow")
@ApiModelProperty("创建成功") @ApiModelProperty("创建流程")
public ResponseEntity createFlow(@RequestBody FlowsInfoVo flowsInfovo){ public ResponseEntity createFlow(@RequestBody FlowsInfoVo flowsInfovo){
return ResultUtil.success(workFlowService.createFlow(flowsInfovo.toEntity()),"流程创建成功"); return ResultUtil.success(workFlowService.createFlow(flowsInfovo.toEntity()),"流程创建成功");
} }
......
...@@ -9,9 +9,11 @@ import com.tykj.workflowcore.workflow_editer.service.FormPageService; ...@@ -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.service.PageEntityService;
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;
import com.tykj.workflowcore.workflow_editer.vo.PageFormPageVo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -57,8 +59,9 @@ public class FormPageController { ...@@ -57,8 +59,9 @@ public class FormPageController {
@ApiOperation("查看页面") @ApiOperation("查看页面")
@GetMapping("/findPages") @GetMapping("/findPages")
public List<OutFormPageVo> findPages(){ public ResponseEntity findPages(@RequestBody PageFormPageVo pageFormPageVo){
return formPageService.getAllPages();
return ResultUtil.success(formPageService.getAllPages(pageFormPageVo),"查询成功");
} }
@ApiOperation("删除页面") @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 { ...@@ -37,6 +37,7 @@ public class WorkFlowController {
@Autowired @Autowired
private WorkFlowService workFlowService; private WorkFlowService workFlowService;
@PostMapping("/deploy") @PostMapping("/deploy")
@ApiOperation(value = "部署流程",notes = "0 部署成功") @ApiOperation(value = "部署流程",notes = "0 部署成功")
public Integer deploy(Long id) throws FileNotFoundException { public Integer deploy(Long id) throws FileNotFoundException {
...@@ -65,7 +66,7 @@ public class WorkFlowController { ...@@ -65,7 +66,7 @@ public class WorkFlowController {
} }
@PostMapping("/findTaskDetail") @PostMapping("/findTaskDetail")
@ApiOperation("任务个人待办详情") @ApiOperation("任务个人待办任务详情")
public Map<String, Object> findTaskDetail(String taskId){ public Map<String, Object> findTaskDetail(String taskId){
return workFlowService.findTaskDetail(taskId); return workFlowService.findTaskDetail(taskId);
} }
...@@ -74,7 +75,7 @@ public class WorkFlowController { ...@@ -74,7 +75,7 @@ public class WorkFlowController {
@ApiOperation("完成任务") @ApiOperation("完成任务")
public ResponseEntity completeTask(@RequestBody TaskVo taskVo){ public ResponseEntity completeTask(@RequestBody TaskVo taskVo){
workFlowService.completeTask(taskVo); workFlowService.completeTask(taskVo);
return ResultUtil.success("该任务已完成"); return ResultUtil.success("该任务已完成");
} }
@PostMapping("/isTransferTask") @PostMapping("/isTransferTask")
......
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 io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -27,7 +28,7 @@ import java.util.Date; ...@@ -27,7 +28,7 @@ import java.util.Date;
@Entity @Entity
@WorkFlowCoreNoScan @WorkFlowCoreNoScan
@Api("流程表") @Api("流程表")
public class FlowsInfo { public class FlowsInfo extends BaseEntity {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty("流程id") @ApiModelProperty("流程id")
...@@ -54,12 +55,6 @@ public class FlowsInfo { ...@@ -54,12 +55,6 @@ public class FlowsInfo {
@ApiModelProperty("文件路径") @ApiModelProperty("文件路径")
private String filePath; private String filePath;
@ApiModelProperty("流程创建时间")
private Date createTime;
@ApiModelProperty("流程修改时间")
private Date updateTime;
@ApiModelProperty("流程描述") @ApiModelProperty("流程描述")
private String flowDescribe; private String flowDescribe;
......
...@@ -68,11 +68,18 @@ public interface FlowInfoService { ...@@ -68,11 +68,18 @@ public interface FlowInfoService {
FlowsInfo disableFlow(Long flowInfoId); FlowsInfo disableFlow(Long flowInfoId);
/** /**
* 有条件的查询flowinfo * 有条件的查询flowInfo
* @param searchFlowInfoVo * @param searchFlowInfoVo
* @return * @return
*/ */
Page<FlowsInfo> searchFlowInfo(SearchFlowInfoVo searchFlowInfoVo); 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; ...@@ -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.entity.FormPage;
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;
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.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -47,9 +49,10 @@ public interface FormPageService { ...@@ -47,9 +49,10 @@ public interface FormPageService {
/** /**
* 查询全部页面 * 查询全部页面
* @param pageFormPageVo 分页
* @return 全部集合 * @return 全部集合
*/ */
List<OutFormPageVo> getAllPages(); Page<FormPage> getAllPages(PageFormPageVo pageFormPageVo);
/** /**
* 根据页面id查询tableInfo * 根据页面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 { ...@@ -81,6 +81,11 @@ public interface WorkFlowService {
*/ */
// Map<String,Object> findTaskDetail(DetailTaskVo detailTaskVo); // Map<String,Object> findTaskDetail(DetailTaskVo detailTaskVo);
/**
* 查看具体的任务详情
* @param taskId 任务id
* @return 任务列表
*/
Map<String,Object> findTaskDetail(String taskId); 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 { ...@@ -93,8 +93,14 @@ public class FlowInfoServiceImpl implements FlowInfoService {
public Page<FlowsInfo> searchFlowInfo(SearchFlowInfoVo searchFlowInfoVo) { public Page<FlowsInfo> searchFlowInfo(SearchFlowInfoVo searchFlowInfoVo) {
PredicateBuilder<FlowsInfo> and = Specifications.and(); PredicateBuilder<FlowsInfo> and = Specifications.and();
and.eq(searchFlowInfoVo.getState()!=null,"state",searchFlowInfoVo.getState()); and.eq(searchFlowInfoVo.getState()!=null,"state",searchFlowInfoVo.getState());
and.eq(searchFlowInfoVo.getFlowKey()!=null,"flowKey",searchFlowInfoVo.getState()); and.eq(searchFlowInfoVo.getFlowKey()!=null,"flowKey",searchFlowInfoVo.getFlowKey());
and.eq(searchFlowInfoVo.getFlowName()!=null,"flowName",searchFlowInfoVo.getState()); and.like(searchFlowInfoVo.getFlowName()!=null,"flowName","%"+searchFlowInfoVo.getFlowName()+"%");
return flowsInfoMapper.findAll(and.build(), searchFlowInfoVo.getPageable()); 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; ...@@ -5,12 +5,15 @@ import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications; import com.github.wenhao.jpa.Specifications;
import com.tykj.workflowcore.model_layer.dao.TableInfoDao; import com.tykj.workflowcore.model_layer.dao.TableInfoDao;
import com.tykj.workflowcore.model_layer.model.TableInfo; 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.entity.FormPage;
import com.tykj.workflowcore.workflow_editer.mapper.FormPageMapper; import com.tykj.workflowcore.workflow_editer.mapper.FormPageMapper;
import com.tykj.workflowcore.workflow_editer.service.FormPageService; import com.tykj.workflowcore.workflow_editer.service.FormPageService;
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;
import com.tykj.workflowcore.workflow_editer.vo.PageFormPageVo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -62,18 +65,17 @@ public class FormPageServiceImpl implements FormPageService { ...@@ -62,18 +65,17 @@ public class FormPageServiceImpl implements FormPageService {
} }
@Override @Override
public List<OutFormPageVo> getAllPages() { public Page<FormPage> getAllPages(PageFormPageVo pageFormPageVo) {
ArrayList<OutFormPageVo> formPageVos = new ArrayList<>(); ArrayList<OutFormPageVo> formPageVos = new ArrayList<>();
List<FormPage> formPages = formPageMapper.findAll(); PredicateBuilder<FormPage> and = Specifications.and();
for (FormPage formPage : formPages) { and.eq(pageFormPageVo.getPageName()!=null,"pageName",pageFormPageVo.getPageName());
// FormPageVo formPageVo = new FormPageVo(); and.eq(pageFormPageVo.getPageDesc()!=null,"pageDesc",pageFormPageVo.getPageDesc());
// BeanUtils.copyProperties(formPage,formPageVo); and.eq(pageFormPageVo.getCreateTime()!=null,"createTime",pageFormPageVo.getCreateTime());
// formPageVos.add(formPageVo);
OutFormPageVo outFormPageVo = formPage.toEntityVo(); Page<FormPage> formPagePage = formPageMapper.findAll(and.build(), pageFormPageVo.getPageable());
formPageVos.add(outFormPageVo);
} return formPagePage;
return formPageVos;
} }
@Override @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; ...@@ -3,12 +3,14 @@ package com.tykj.workflowcore.workflow_editer.service.impl;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.tykj.workflowcore.api.entity.InvokeRequest; import com.tykj.workflowcore.api.entity.InvokeRequest;
import com.tykj.workflowcore.api.entity.Parameter; 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.entity.*;
import com.tykj.workflowcore.workflow_editer.mapper.FlowsInfoMapper; import com.tykj.workflowcore.workflow_editer.mapper.FlowsInfoMapper;
import com.tykj.workflowcore.workflow_editer.service.NodeInfoService; import com.tykj.workflowcore.workflow_editer.service.NodeInfoService;
import com.tykj.workflowcore.workflow_editer.service.UserService; import com.tykj.workflowcore.workflow_editer.service.UserService;
import com.tykj.workflowcore.workflow_editer.service.VariableStorageService; import com.tykj.workflowcore.workflow_editer.service.VariableStorageService;
import com.tykj.workflowcore.workflow_editer.service.WorkFlowService; import com.tykj.workflowcore.workflow_editer.service.WorkFlowService;
import com.tykj.workflowcore.workflow_editer.util.UserServiceBeanUtil;
import com.tykj.workflowcore.workflow_editer.vo.*; import com.tykj.workflowcore.workflow_editer.vo.*;
import org.dom4j.Attribute; import org.dom4j.Attribute;
import org.dom4j.Document; import org.dom4j.Document;
...@@ -30,6 +32,7 @@ import org.flowable.task.api.TaskQuery; ...@@ -30,6 +32,7 @@ import org.flowable.task.api.TaskQuery;
import org.flowable.task.api.history.HistoricTaskInstance; import org.flowable.task.api.history.HistoricTaskInstance;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -51,30 +54,35 @@ import java.util.*; ...@@ -51,30 +54,35 @@ import java.util.*;
@Service @Service
public class WorkFlowServiceImpl implements WorkFlowService { public class WorkFlowServiceImpl implements WorkFlowService {
@Autowired private final RepositoryService repositoryService;
private RepositoryService repositoryService; private final RuntimeService runtimeService;
@Autowired private final TaskService taskService;
private RuntimeService runtimeService; private final FlowsInfoMapper flowsInfoMapper;
@Autowired
private TaskService taskService; private final UserService userService;
@Autowired private final HistoryService historyService;
private FlowsInfoMapper flowsInfoMapper; private final ProcessEngineConfigurationImpl processEngineConfiguration;
@Autowired private final ProcessEngine processEngine;
private UserService userService;
@Autowired private final VariableStorageService variableStorageService;
private HistoryService historyService;
@Autowired final
private NodeInfoService nodeInfoService;
@Autowired
ProcessEngineConfigurationImpl processEngineConfiguration;
@Autowired
private ProcessEngine processEngine;
@Autowired
private VariableStorageService variableStorageService;
@Autowired
ClassLoader classLoader; 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 @Override
public String saveXml(@RequestParam("file") MultipartFile file) { public String saveXml(@RequestParam("file") MultipartFile file) {
...@@ -249,7 +257,7 @@ public class WorkFlowServiceImpl implements WorkFlowService { ...@@ -249,7 +257,7 @@ public class WorkFlowServiceImpl implements WorkFlowService {
if (nextTaskVo.getRoleId()!=null&&nextTaskVo.getRoleId().size()>0){ if (nextTaskVo.getRoleId()!=null&&nextTaskVo.getRoleId().size()>0){
taskQuery.taskCandidateGroupIn(nextTaskVo.getRoleId()).orderByTaskCreateTime().desc(); taskQuery.taskCandidateGroupIn(nextTaskVo.getRoleId()).orderByTaskCreateTime().desc();
} }
List<Task> listTask = taskQuery.endOr().list(); List<Task> listTask = taskQuery.endOr().listPage(1,5);
for (Task task : listTask) { for (Task task : listTask) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
ProcessInstance processInstance = 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; 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.FlowsInfo;
import com.tykj.workflowcore.workflow_editer.entity.NodeInfo; import com.tykj.workflowcore.workflow_editer.entity.NodeInfo;
import com.tykj.workflowcore.workflow_editer.entity.vo.NodeInfoVo; import com.tykj.workflowcore.workflow_editer.entity.vo.NodeInfoVo;
......
package com.tykj.workflowcore.workflow_editer.vo; package com.tykj.workflowcore.workflow_editer.vo;
import com.tykj.workflowcore.base.page.JpaCustomOrder;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
......
package com.tykj.workflowcore.workflow_editer.vo; 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 com.tykj.workflowcore.workflow_editer.entity.FormPage;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; 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: spring:
datasource: datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
druid:
username: root username: root
password: 123456 password: Huang123+
url: jdbc:mysql://localhost:3306/model_layer?serverTimezone=UTC&characterEncoding=UTF-8&useUnicode=true 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
jpa: jpa:
show-sql: true
hibernate: hibernate:
ddl-auto: update ddl-auto: update
naming:
implicit-strategy: org.hibernate.boot.model.naming.ImplicitNamingStrategyComponentPathImpl
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
show-sql: true
server: server:
port: 8900 port: 8900
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论