Initial commit
This commit is contained in:
parent
8824072ee6
commit
5c31488341
@ -17,7 +17,7 @@ import org.springframework.context.annotation.Configuration;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@MapperScan("com.atguigu.auth.mapper")
|
@MapperScan(basePackages = {"com.atguigu.auth.mapper","com.atguigu.process.mapper"})
|
||||||
public class MybatisPlusConfig {
|
public class MybatisPlusConfig {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package com.atguigu.vo.system;
|
package com.atguigu.vo.system;
|
||||||
|
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package com.atguigu.auth;
|
package com.atguigu;
|
||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
@ -12,7 +12,6 @@ import org.springframework.context.annotation.ComponentScan;
|
|||||||
* @Create 2023/6/1 23:03
|
* @Create 2023/6/1 23:03
|
||||||
*/
|
*/
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
@ComponentScan("com.atguigu")
|
|
||||||
public class ServiceAuthApplication {
|
public class ServiceAuthApplication {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(ServiceAuthApplication.class, args);
|
SpringApplication.run(ServiceAuthApplication.class, args);
|
@ -0,0 +1,165 @@
|
|||||||
|
package com.atguigu.process.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.atguigu.common.result.Result;
|
||||||
|
import com.atguigu.model.process.ProcessTemplate;
|
||||||
|
import com.atguigu.process.service.OaProcessTemplateService;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.util.ResourceUtils;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 审批模板 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author yovinchen
|
||||||
|
* @since 2023-06-15
|
||||||
|
*/
|
||||||
|
@Api(value = "审批模板管理", tags = "审批模板管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "/admin/process/processTemplate")
|
||||||
|
public class OaProcessTemplateController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private OaProcessTemplateService processTemplateService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试文件上传
|
||||||
|
*
|
||||||
|
* @param args
|
||||||
|
*/
|
||||||
|
public static void main(String[] args) {
|
||||||
|
try {
|
||||||
|
String path = new File(ResourceUtils.getURL("classpath:").getPath()).getAbsolutePath();
|
||||||
|
System.out.println("path = " + path); //E:\CodeLife\IdeaProject\guigu-oa\guigu-oa-parent\service-oa\target\classes
|
||||||
|
} catch (FileNotFoundException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传文件流程
|
||||||
|
*
|
||||||
|
* @param file
|
||||||
|
* @return
|
||||||
|
* @throws FileNotFoundException
|
||||||
|
*/
|
||||||
|
@PreAuthorize("hasAuthority('bnt.processTemplate.templateSet')")
|
||||||
|
@ApiOperation(value = "上传流程定义")
|
||||||
|
@PostMapping("/uploadProcessDefinition")
|
||||||
|
public Result uploadProcessDefinition(MultipartFile file) throws FileNotFoundException {
|
||||||
|
|
||||||
|
// 获取classes目录位置
|
||||||
|
String path = new File(ResourceUtils.getURL("classpath:").getPath()).getAbsolutePath();
|
||||||
|
// 设置上传文件夹
|
||||||
|
File tempFile = new File(path + "/processes/");
|
||||||
|
if (!tempFile.exists()) {
|
||||||
|
tempFile.mkdirs();
|
||||||
|
}
|
||||||
|
// 创建空文件,实现文件写入
|
||||||
|
String filename = file.getOriginalFilename();
|
||||||
|
File zipFile = new File(path + "/processes/" + filename);
|
||||||
|
|
||||||
|
// 保存文件
|
||||||
|
try {
|
||||||
|
file.transferTo(zipFile);
|
||||||
|
} catch (IOException e) {
|
||||||
|
return Result.fail();
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
//根据上传地址后续部署流程定义,文件名称为流程定义的默认key
|
||||||
|
map.put("processDefinitionPath", "processes/" + filename);
|
||||||
|
map.put("processDefinitionKey", filename.substring(0, filename.lastIndexOf(".")));
|
||||||
|
return Result.ok(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询审批模板
|
||||||
|
*
|
||||||
|
* @param page
|
||||||
|
* @param pageSize
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation("获取分页查询审批模板数据")
|
||||||
|
@GetMapping("{page}/{pageSize}")
|
||||||
|
public Result index(@PathVariable Long page, @PathVariable Long pageSize) {
|
||||||
|
Page<ProcessTemplate> pageInfo = new Page<>(page, pageSize);
|
||||||
|
//分页查询审批模板,把审批类型对应名称查询
|
||||||
|
IPage<ProcessTemplate> pageModel =
|
||||||
|
processTemplateService.selectPageProcessTemplate(pageInfo);
|
||||||
|
return Result.ok(pageModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id获取审批模板
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PreAuthorize("hasAuthority('bnt.processTemplate.list')")
|
||||||
|
@ApiOperation(value = "获取")
|
||||||
|
@GetMapping("get/{id}")
|
||||||
|
public Result get(@PathVariable Long id) {
|
||||||
|
ProcessTemplate processTemplate = processTemplateService.getById(id);
|
||||||
|
return Result.ok(processTemplate);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增审批模板
|
||||||
|
*
|
||||||
|
* @param processTemplate
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PreAuthorize("hasAuthority('bnt.processTemplate.templateSet')")
|
||||||
|
@ApiOperation(value = "新增")
|
||||||
|
@PostMapping("save")
|
||||||
|
public Result save(@RequestBody ProcessTemplate processTemplate) {
|
||||||
|
processTemplateService.save(processTemplate);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改审批模板
|
||||||
|
*
|
||||||
|
* @param processTemplate
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PreAuthorize("hasAuthority('bnt.processTemplate.templateSet')")
|
||||||
|
@ApiOperation(value = "修改")
|
||||||
|
@PutMapping("update")
|
||||||
|
public Result updateById(@RequestBody ProcessTemplate processTemplate) {
|
||||||
|
processTemplateService.updateById(processTemplate);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除审批模板
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PreAuthorize("hasAuthority('bnt.processTemplate.remove')")
|
||||||
|
@ApiOperation(value = "删除")
|
||||||
|
@DeleteMapping("remove/{id}")
|
||||||
|
public Result remove(@PathVariable Long id) {
|
||||||
|
processTemplateService.removeById(id);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,113 @@
|
|||||||
|
package com.atguigu.process.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.atguigu.common.result.Result;
|
||||||
|
import com.atguigu.model.process.ProcessType;
|
||||||
|
import com.atguigu.process.service.OaProcessTypeService;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批类型 前端控制器
|
||||||
|
*
|
||||||
|
* @author yovinchen
|
||||||
|
* @since 2023-06-15
|
||||||
|
*/
|
||||||
|
@Api(value = "审批类型", tags = "审批类型")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "/admin/process/processType")
|
||||||
|
//@SuppressWarnings({"unchecked", "rawtypes"})
|
||||||
|
public class OaProcessTypeController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private OaProcessTypeService processTypeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有的审批类型
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取全部审批分类")
|
||||||
|
@GetMapping("findAll")
|
||||||
|
public Result findAll() {
|
||||||
|
return Result.ok(processTypeService.list());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询 审批类型
|
||||||
|
*
|
||||||
|
* @param page
|
||||||
|
* @param pageSize
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取分页列表")
|
||||||
|
@GetMapping("{page}/{pageSize}")
|
||||||
|
public Result index(@PathVariable Long page, @PathVariable Long pageSize) {
|
||||||
|
|
||||||
|
Page<ProcessType> pageInfo = new Page<>(page, pageSize);
|
||||||
|
Page<ProcessType> pageModel = processTypeService.page(pageInfo);
|
||||||
|
|
||||||
|
return Result.ok(pageModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取审批类型
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PreAuthorize("hasAuthority('bnt.processType.list')")
|
||||||
|
@ApiOperation(value = "获取")
|
||||||
|
@GetMapping("get/{id}")
|
||||||
|
public Result get(@PathVariable Long id) {
|
||||||
|
ProcessType processType = processTypeService.getById(id);
|
||||||
|
return Result.ok(processType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增审批类型
|
||||||
|
*
|
||||||
|
* @param processType
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PreAuthorize("hasAuthority('bnt.processType.add')")
|
||||||
|
@ApiOperation(value = "新增")
|
||||||
|
@PostMapping("save")
|
||||||
|
public Result save(@RequestBody ProcessType processType) {
|
||||||
|
processTypeService.save(processType);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改审批类型
|
||||||
|
*
|
||||||
|
* @param processType
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PreAuthorize("hasAuthority('bnt.processType.update')")
|
||||||
|
@ApiOperation(value = "修改")
|
||||||
|
@PutMapping("update")
|
||||||
|
public Result updateById(@RequestBody ProcessType processType) {
|
||||||
|
processTypeService.updateById(processType);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除审批类型
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "删除")
|
||||||
|
@DeleteMapping("remove/{id}")
|
||||||
|
public Result remove(@PathVariable Long id) {
|
||||||
|
processTypeService.removeById(id);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.atguigu.process.mapper;
|
||||||
|
|
||||||
|
import com.atguigu.model.process.ProcessTemplate;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 审批模板 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author yovinchen
|
||||||
|
* @since 2023-06-15
|
||||||
|
*/
|
||||||
|
public interface OaProcessTemplateMapper extends BaseMapper<ProcessTemplate> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.atguigu.process.mapper;
|
||||||
|
|
||||||
|
import com.atguigu.model.process.ProcessType;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 审批类型 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author yovinchen
|
||||||
|
* @since 2023-06-15
|
||||||
|
*/
|
||||||
|
public interface OaProcessTypeMapper extends BaseMapper<ProcessType> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.atguigu.process.mapper.OaProcessTemplateMapper">
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.atguigu.process.mapper.OaProcessTypeMapper">
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,25 @@
|
|||||||
|
package com.atguigu.process.service;
|
||||||
|
|
||||||
|
import com.atguigu.model.process.ProcessTemplate;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 审批模板 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author yovinchen
|
||||||
|
* @since 2023-06-15
|
||||||
|
*/
|
||||||
|
public interface OaProcessTemplateService extends IService<ProcessTemplate> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询审批模板,把审批类型对应名称查询
|
||||||
|
*
|
||||||
|
* @param pageInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
IPage<ProcessTemplate> selectPageProcessTemplate(Page<ProcessTemplate> pageInfo);
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.atguigu.process.service;
|
||||||
|
|
||||||
|
import com.atguigu.model.process.ProcessType;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 审批类型 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author yovinchen
|
||||||
|
* @since 2023-06-15
|
||||||
|
*/
|
||||||
|
public interface OaProcessTypeService extends IService<ProcessType> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.atguigu.process.service.impl;
|
||||||
|
|
||||||
|
import com.atguigu.model.process.ProcessTemplate;
|
||||||
|
import com.atguigu.model.process.ProcessType;
|
||||||
|
import com.atguigu.process.mapper.OaProcessTemplateMapper;
|
||||||
|
import com.atguigu.process.service.OaProcessTemplateService;
|
||||||
|
import com.atguigu.process.service.OaProcessTypeService;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 审批模板 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author yovinchen
|
||||||
|
* @since 2023-06-15
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class OaProcessTemplateServiceImpl extends ServiceImpl<OaProcessTemplateMapper, ProcessTemplate> implements OaProcessTemplateService {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private OaProcessTypeService oaprocessTypeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询审批模板,把审批类型对应名称查询
|
||||||
|
*
|
||||||
|
* @param pageInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public IPage<ProcessTemplate> selectPageProcessTemplate(Page<ProcessTemplate> pageInfo) {
|
||||||
|
// 调用mapper的方法实现分页查询
|
||||||
|
Page<ProcessTemplate> processTemplatePage = baseMapper.selectPage(pageInfo, null);
|
||||||
|
// 第一步分页查询返回分页数据,从分页数据获取列表List集合
|
||||||
|
List<ProcessTemplate> processTemplateList = processTemplatePage.getRecords();
|
||||||
|
// 遍历list集合
|
||||||
|
// for (ProcessTemplate processTemplate : processTemplateList) {
|
||||||
|
// //得到每个对象的审批类型id
|
||||||
|
// Long processTypeId = processTemplate.getProcessTypeId();
|
||||||
|
// // 根据审批类型d,查询获取对应名称
|
||||||
|
// ProcessType processType = oaprocessTypeService.getOne(new LambdaQueryWrapper<ProcessType>().eq(ProcessType::getId, processTypeId));
|
||||||
|
// if (processType == null) {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
// // 完成最终封装
|
||||||
|
// processTemplate.setProcessTypeName(processType.getName());
|
||||||
|
// }
|
||||||
|
processTemplateList.forEach(processTemplate -> Optional.ofNullable(oaprocessTypeService.getOne(new LambdaQueryWrapper<ProcessType>().eq(ProcessType::getId, processTemplate.getProcessTypeId()))).ifPresent(processType -> processTemplate.setProcessTypeName(processType.getName())));
|
||||||
|
|
||||||
|
return processTemplatePage;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.atguigu.process.service.impl;
|
||||||
|
|
||||||
|
import com.atguigu.model.process.ProcessType;
|
||||||
|
import com.atguigu.process.mapper.OaProcessTypeMapper;
|
||||||
|
import com.atguigu.process.service.OaProcessTypeService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 审批类型 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author yovinchen
|
||||||
|
* @since 2023-06-15
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class OaProcessTypeServiceImpl extends ServiceImpl<OaProcessTypeMapper, ProcessType> implements OaProcessTypeService {
|
||||||
|
|
||||||
|
}
|
@ -10,9 +10,12 @@ spring:
|
|||||||
datasource:
|
datasource:
|
||||||
type: com.zaxxer.hikari.HikariDataSource
|
type: com.zaxxer.hikari.HikariDataSource
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://43.143.164.194:3306/guigu-oa?useSSL=false&useUnicode=true&characterEncoding=utf8&allowPublicKeyRetrieval=true
|
# url: jdbc:mysql://43.143.164.194:3306/guigu-oa?useSSL=false&useUnicode=true&characterEncoding=utf8&allowPublicKeyRetrieval=true
|
||||||
username: admin
|
# username: admin
|
||||||
password: admin
|
# password: admin
|
||||||
|
url: jdbc:mysql://localhost:3306/guigu-oa?useSSL=false&useUnicode=true&characterEncoding=utf8&allowPublicKeyRetrieval=true
|
||||||
|
username: root
|
||||||
|
password: root
|
||||||
jackson:
|
jackson:
|
||||||
date-format: yyyy-MM-dd HH:mm:ss
|
date-format: yyyy-MM-dd HH:mm:ss
|
||||||
time-zone: GMT+8
|
time-zone: GMT+8
|
||||||
|
40
service-oa/src/main/resources/process/leave.bpmn20.xml
Normal file
40
service-oa/src/main/resources/process/leave.bpmn20.xml
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef">
|
||||||
|
<process id="leave" isExecutable="true">
|
||||||
|
<startEvent id="sid-2C002908-F0BD-4C63-BDF6-15480E9AAE59"></startEvent>
|
||||||
|
<userTask id="sid-D51DF33C-EEAC-4EF2-B3DE-F71B20956BF7" name="zhangsan Audit" activiti:assignee="zhangsan"></userTask>
|
||||||
|
<userTask id="sid-F9B3F8AB-8ADA-436C-B496-1E8742808529" name="lisi Audit" activiti:assignee="lisi"></userTask>
|
||||||
|
<endEvent id="sid-5F1FDFF1-0716-4413-9F4C-A9F884E0CFE5"></endEvent>
|
||||||
|
<sequenceFlow id="sid-40DF2D05-C2CB-4831-ABED-373689B25C30" sourceRef="sid-D51DF33C-EEAC-4EF2-B3DE-F71B20956BF7" targetRef="sid-F9B3F8AB-8ADA-436C-B496-1E8742808529"></sequenceFlow>
|
||||||
|
<sequenceFlow id="sid-E3C50B03-6FD5-4EE0-A356-0E89505C03E5" sourceRef="sid-F9B3F8AB-8ADA-436C-B496-1E8742808529" targetRef="sid-5F1FDFF1-0716-4413-9F4C-A9F884E0CFE5"></sequenceFlow>
|
||||||
|
<sequenceFlow id="sid-54CB193B-361A-4212-8C45-50F1CE6A466A" sourceRef="sid-2C002908-F0BD-4C63-BDF6-15480E9AAE59" targetRef="sid-D51DF33C-EEAC-4EF2-B3DE-F71B20956BF7"></sequenceFlow>
|
||||||
|
</process>
|
||||||
|
<bpmndi:BPMNDiagram id="BPMNDiagram_leave">
|
||||||
|
<bpmndi:BPMNPlane bpmnElement="leave" id="BPMNPlane_leave">
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-2C002908-F0BD-4C63-BDF6-15480E9AAE59" id="BPMNShape_sid-2C002908-F0BD-4C63-BDF6-15480E9AAE59">
|
||||||
|
<omgdc:Bounds height="30.0" width="30.0" x="201.125" y="115.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-D51DF33C-EEAC-4EF2-B3DE-F71B20956BF7" id="BPMNShape_sid-D51DF33C-EEAC-4EF2-B3DE-F71B20956BF7">
|
||||||
|
<omgdc:Bounds height="80.0" width="100.0" x="330.0" y="90.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-F9B3F8AB-8ADA-436C-B496-1E8742808529" id="BPMNShape_sid-F9B3F8AB-8ADA-436C-B496-1E8742808529">
|
||||||
|
<omgdc:Bounds height="80.0" width="100.0" x="540.0" y="90.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-5F1FDFF1-0716-4413-9F4C-A9F884E0CFE5" id="BPMNShape_sid-5F1FDFF1-0716-4413-9F4C-A9F884E0CFE5">
|
||||||
|
<omgdc:Bounds height="28.0" width="28.0" x="735.0" y="116.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-E3C50B03-6FD5-4EE0-A356-0E89505C03E5" id="BPMNEdge_sid-E3C50B03-6FD5-4EE0-A356-0E89505C03E5">
|
||||||
|
<omgdi:waypoint x="640.0" y="130.0"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="735.0" y="130.0"></omgdi:waypoint>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-54CB193B-361A-4212-8C45-50F1CE6A466A" id="BPMNEdge_sid-54CB193B-361A-4212-8C45-50F1CE6A466A">
|
||||||
|
<omgdi:waypoint x="231.125" y="130.0"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="330.0" y="130.0"></omgdi:waypoint>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-40DF2D05-C2CB-4831-ABED-373689B25C30" id="BPMNEdge_sid-40DF2D05-C2CB-4831-ABED-373689B25C30">
|
||||||
|
<omgdi:waypoint x="430.0" y="130.0"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="540.0" y="130.0"></omgdi:waypoint>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
</bpmndi:BPMNPlane>
|
||||||
|
</bpmndi:BPMNDiagram>
|
||||||
|
</definitions>
|
BIN
service-oa/src/main/resources/process/leave.png
Normal file
BIN
service-oa/src/main/resources/process/leave.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.3 KiB |
72
service-oa/src/main/resources/process/leave001.bpmn20.xml
Normal file
72
service-oa/src/main/resources/process/leave001.bpmn20.xml
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef">
|
||||||
|
<process id="leave001" isExecutable="true">
|
||||||
|
<startEvent id="sid-D0D4CEC8-0B78-4219-A957-19C6BD2644C7"></startEvent>
|
||||||
|
<endEvent id="sid-DC3B2EA8-6B64-42CE-8A75-6519D8D4D431"></endEvent>
|
||||||
|
<userTask id="sid-F153FA85-DD93-459E-BC43-2167BA72E3EC" name="General manager approval" activiti:assignee="gouwa"></userTask>
|
||||||
|
<userTask id="sid-152234AD-7DE1-4523-8479-C12DE83A6835" name="Department manager approval" activiti:assignee="wang5"></userTask>
|
||||||
|
<userTask id="sid-C861B545-9FF0-442C-B8FD-6A09C52FD9E0" name="Personnel record" activiti:assignee="xiaoli"></userTask>
|
||||||
|
<parallelGateway id="sid-560584A5-B2E9-44EC-BFA6-4BC71B739250"></parallelGateway>
|
||||||
|
<parallelGateway id="sid-84A963FA-AB03-43C0-9B2C-940F4AE04BE3"></parallelGateway>
|
||||||
|
<sequenceFlow id="sid-CD3FD992-80AA-4B15-B537-A28CBCB2E981" sourceRef="sid-D0D4CEC8-0B78-4219-A957-19C6BD2644C7" targetRef="sid-560584A5-B2E9-44EC-BFA6-4BC71B739250"></sequenceFlow>
|
||||||
|
<sequenceFlow id="sid-42A3192C-B41F-4079-9774-8BF2E9DFC499" sourceRef="sid-560584A5-B2E9-44EC-BFA6-4BC71B739250" targetRef="sid-152234AD-7DE1-4523-8479-C12DE83A6835"></sequenceFlow>
|
||||||
|
<sequenceFlow id="sid-5D5249DE-A990-43B4-9A93-BD5A5E381129" sourceRef="sid-560584A5-B2E9-44EC-BFA6-4BC71B739250" targetRef="sid-F153FA85-DD93-459E-BC43-2167BA72E3EC"></sequenceFlow>
|
||||||
|
<sequenceFlow id="sid-BDC03DEF-48B4-42E5-9A45-78DE520D16B7" sourceRef="sid-F153FA85-DD93-459E-BC43-2167BA72E3EC" targetRef="sid-84A963FA-AB03-43C0-9B2C-940F4AE04BE3"></sequenceFlow>
|
||||||
|
<sequenceFlow id="sid-39857094-5772-49A5-90D5-C34203578BD2" sourceRef="sid-152234AD-7DE1-4523-8479-C12DE83A6835" targetRef="sid-84A963FA-AB03-43C0-9B2C-940F4AE04BE3"></sequenceFlow>
|
||||||
|
<sequenceFlow id="sid-ECA3CD08-5A12-4DAB-A32C-CCECFD43809D" sourceRef="sid-84A963FA-AB03-43C0-9B2C-940F4AE04BE3" targetRef="sid-C861B545-9FF0-442C-B8FD-6A09C52FD9E0"></sequenceFlow>
|
||||||
|
<sequenceFlow id="sid-C5B5BECB-F65E-428C-A712-7C796B59CE9E" sourceRef="sid-C861B545-9FF0-442C-B8FD-6A09C52FD9E0" targetRef="sid-DC3B2EA8-6B64-42CE-8A75-6519D8D4D431"></sequenceFlow>
|
||||||
|
</process>
|
||||||
|
<bpmndi:BPMNDiagram id="BPMNDiagram_leave001">
|
||||||
|
<bpmndi:BPMNPlane bpmnElement="leave001" id="BPMNPlane_leave001">
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-D0D4CEC8-0B78-4219-A957-19C6BD2644C7" id="BPMNShape_sid-D0D4CEC8-0B78-4219-A957-19C6BD2644C7">
|
||||||
|
<omgdc:Bounds height="30.0" width="30.0" x="150.0" y="143.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-DC3B2EA8-6B64-42CE-8A75-6519D8D4D431" id="BPMNShape_sid-DC3B2EA8-6B64-42CE-8A75-6519D8D4D431">
|
||||||
|
<omgdc:Bounds height="28.0" width="28.0" x="780.0" y="144.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-F153FA85-DD93-459E-BC43-2167BA72E3EC" id="BPMNShape_sid-F153FA85-DD93-459E-BC43-2167BA72E3EC">
|
||||||
|
<omgdc:Bounds height="80.0" width="100.0" x="345.0" y="180.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-152234AD-7DE1-4523-8479-C12DE83A6835" id="BPMNShape_sid-152234AD-7DE1-4523-8479-C12DE83A6835">
|
||||||
|
<omgdc:Bounds height="80.0" width="100.0" x="345.0" y="52.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-C861B545-9FF0-442C-B8FD-6A09C52FD9E0" id="BPMNShape_sid-C861B545-9FF0-442C-B8FD-6A09C52FD9E0">
|
||||||
|
<omgdc:Bounds height="80.0" width="100.0" x="615.0" y="118.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-560584A5-B2E9-44EC-BFA6-4BC71B739250" id="BPMNShape_sid-560584A5-B2E9-44EC-BFA6-4BC71B739250">
|
||||||
|
<omgdc:Bounds height="40.0" width="40.0" x="240.0" y="138.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-84A963FA-AB03-43C0-9B2C-940F4AE04BE3" id="BPMNShape_sid-84A963FA-AB03-43C0-9B2C-940F4AE04BE3">
|
||||||
|
<omgdc:Bounds height="40.0" width="40.0" x="510.0" y="138.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-5D5249DE-A990-43B4-9A93-BD5A5E381129" id="BPMNEdge_sid-5D5249DE-A990-43B4-9A93-BD5A5E381129">
|
||||||
|
<omgdi:waypoint x="273.53826530612247" y="164.46173469387756"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="345.0" y="197.13754646840147"></omgdi:waypoint>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-ECA3CD08-5A12-4DAB-A32C-CCECFD43809D" id="BPMNEdge_sid-ECA3CD08-5A12-4DAB-A32C-CCECFD43809D">
|
||||||
|
<omgdi:waypoint x="549.570895522388" y="158.42910447761193"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="615.0" y="158.18587360594796"></omgdi:waypoint>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-39857094-5772-49A5-90D5-C34203578BD2" id="BPMNEdge_sid-39857094-5772-49A5-90D5-C34203578BD2">
|
||||||
|
<omgdi:waypoint x="445.0" y="116.44444444444444"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="516.5671641791045" y="151.43283582089552"></omgdi:waypoint>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-C5B5BECB-F65E-428C-A712-7C796B59CE9E" id="BPMNEdge_sid-C5B5BECB-F65E-428C-A712-7C796B59CE9E">
|
||||||
|
<omgdi:waypoint x="715.0" y="158.0"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="780.0" y="158.0"></omgdi:waypoint>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-BDC03DEF-48B4-42E5-9A45-78DE520D16B7" id="BPMNEdge_sid-BDC03DEF-48B4-42E5-9A45-78DE520D16B7">
|
||||||
|
<omgdi:waypoint x="445.0" y="197.03703703703704"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="516.2944162436548" y="164.29441624365484"></omgdi:waypoint>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-CD3FD992-80AA-4B15-B537-A28CBCB2E981" id="BPMNEdge_sid-CD3FD992-80AA-4B15-B537-A28CBCB2E981">
|
||||||
|
<omgdi:waypoint x="180.0" y="158.0"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="240.0" y="158.0"></omgdi:waypoint>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-42A3192C-B41F-4079-9774-8BF2E9DFC499" id="BPMNEdge_sid-42A3192C-B41F-4079-9774-8BF2E9DFC499">
|
||||||
|
<omgdi:waypoint x="273.8830845771144" y="151.88308457711443"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="345.0" y="116.72118959107807"></omgdi:waypoint>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
</bpmndi:BPMNPlane>
|
||||||
|
</bpmndi:BPMNDiagram>
|
||||||
|
</definitions>
|
BIN
service-oa/src/main/resources/process/leave001.png
Normal file
BIN
service-oa/src/main/resources/process/leave001.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 19 KiB |
40
service-oa/src/main/resources/process/overtime.bpmn20.xml
Normal file
40
service-oa/src/main/resources/process/overtime.bpmn20.xml
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef">
|
||||||
|
<process id="overtime" isExecutable="true">
|
||||||
|
<startEvent id="sid-5DC3A64E-3EB8-489E-A1CD-9DDF08B41EE5"></startEvent>
|
||||||
|
<endEvent id="sid-E4749034-D90A-402F-A2DC-C46323D28217"></endEvent>
|
||||||
|
<userTask id="sid-1C03C51F-BD11-49E3-B373-E7BC48B61D6A" name="Manager approval" activiti:assignee="${assignee1}"></userTask>
|
||||||
|
<userTask id="sid-3146B952-82F3-49E8-8C98-3DB7BBD86166" name="Personnel approval" activiti:assignee="${assignee2}"></userTask>
|
||||||
|
<sequenceFlow id="sid-BFC58373-53AD-4081-82DD-3DA665D73E6F" sourceRef="sid-5DC3A64E-3EB8-489E-A1CD-9DDF08B41EE5" targetRef="sid-1C03C51F-BD11-49E3-B373-E7BC48B61D6A"></sequenceFlow>
|
||||||
|
<sequenceFlow id="sid-0A020AB6-E6EA-406C-B49A-BB9614DD3BCF" sourceRef="sid-1C03C51F-BD11-49E3-B373-E7BC48B61D6A" targetRef="sid-3146B952-82F3-49E8-8C98-3DB7BBD86166"></sequenceFlow>
|
||||||
|
<sequenceFlow id="sid-6906F245-3A47-4508-9807-FC7FC8C6CCA0" sourceRef="sid-3146B952-82F3-49E8-8C98-3DB7BBD86166" targetRef="sid-E4749034-D90A-402F-A2DC-C46323D28217"></sequenceFlow>
|
||||||
|
</process>
|
||||||
|
<bpmndi:BPMNDiagram id="BPMNDiagram_overtime">
|
||||||
|
<bpmndi:BPMNPlane bpmnElement="overtime" id="BPMNPlane_overtime">
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-5DC3A64E-3EB8-489E-A1CD-9DDF08B41EE5" id="BPMNShape_sid-5DC3A64E-3EB8-489E-A1CD-9DDF08B41EE5">
|
||||||
|
<omgdc:Bounds height="30.0" width="30.0" x="150.0" y="195.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-E4749034-D90A-402F-A2DC-C46323D28217" id="BPMNShape_sid-E4749034-D90A-402F-A2DC-C46323D28217">
|
||||||
|
<omgdc:Bounds height="28.0" width="28.0" x="705.0" y="196.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-1C03C51F-BD11-49E3-B373-E7BC48B61D6A" id="BPMNShape_sid-1C03C51F-BD11-49E3-B373-E7BC48B61D6A">
|
||||||
|
<omgdc:Bounds height="80.0" width="100.0" x="300.5" y="170.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-3146B952-82F3-49E8-8C98-3DB7BBD86166" id="BPMNShape_sid-3146B952-82F3-49E8-8C98-3DB7BBD86166">
|
||||||
|
<omgdc:Bounds height="80.0" width="100.0" x="495.0" y="170.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-6906F245-3A47-4508-9807-FC7FC8C6CCA0" id="BPMNEdge_sid-6906F245-3A47-4508-9807-FC7FC8C6CCA0">
|
||||||
|
<omgdi:waypoint x="595.0" y="210.0"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="705.0" y="210.0"></omgdi:waypoint>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-0A020AB6-E6EA-406C-B49A-BB9614DD3BCF" id="BPMNEdge_sid-0A020AB6-E6EA-406C-B49A-BB9614DD3BCF">
|
||||||
|
<omgdi:waypoint x="400.5" y="210.0"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="495.0" y="210.0"></omgdi:waypoint>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-BFC58373-53AD-4081-82DD-3DA665D73E6F" id="BPMNEdge_sid-BFC58373-53AD-4081-82DD-3DA665D73E6F">
|
||||||
|
<omgdi:waypoint x="180.0" y="210.0"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="300.5" y="210.0"></omgdi:waypoint>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
</bpmndi:BPMNPlane>
|
||||||
|
</bpmndi:BPMNDiagram>
|
||||||
|
</definitions>
|
BIN
service-oa/src/main/resources/process/overtime.png
Normal file
BIN
service-oa/src/main/resources/process/overtime.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.9 KiB |
65
service-oa/src/main/resources/process/overtime001.bpmn20.xml
Normal file
65
service-oa/src/main/resources/process/overtime001.bpmn20.xml
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef">
|
||||||
|
<process id="overtime001" isExecutable="true">
|
||||||
|
<startEvent id="sid-AEC3692B-6EDD-484B-B11F-A182226F32D0"></startEvent>
|
||||||
|
<endEvent id="sid-84B1CBA4-4EB4-49B0-A325-7FE98AA30ADE"></endEvent>
|
||||||
|
<userTask id="sid-F35D0733-EE93-47A8-839D-B7D184A9C110" name="General manager approval" activiti:assignee="gousheng"></userTask>
|
||||||
|
<userTask id="sid-F4B79508-8A4F-4AF5-82DE-1B13712A7378" name="Department manager approval" activiti:assignee="zhaoliu"></userTask>
|
||||||
|
<userTask id="sid-6049D869-CB64-4FA6-834E-EACACA346F2B" name="Personnel record" activiti:assignee="xiaocui"></userTask>
|
||||||
|
<exclusiveGateway id="sid-D98DB70A-1374-4CCB-9E52-DF2E6AD00574"></exclusiveGateway>
|
||||||
|
<sequenceFlow id="sid-4E8F6437-39AF-4F6F-BB09-34D38C82F91F" sourceRef="sid-AEC3692B-6EDD-484B-B11F-A182226F32D0" targetRef="sid-D98DB70A-1374-4CCB-9E52-DF2E6AD00574"></sequenceFlow>
|
||||||
|
<sequenceFlow id="sid-896063D8-3E30-4174-BBB2-9093113491DF" sourceRef="sid-F35D0733-EE93-47A8-839D-B7D184A9C110" targetRef="sid-6049D869-CB64-4FA6-834E-EACACA346F2B"></sequenceFlow>
|
||||||
|
<sequenceFlow id="sid-61D0DFCA-16B1-49C1-AB72-84CB957F9C97" sourceRef="sid-F4B79508-8A4F-4AF5-82DE-1B13712A7378" targetRef="sid-6049D869-CB64-4FA6-834E-EACACA346F2B"></sequenceFlow>
|
||||||
|
<sequenceFlow id="sid-2E80AF18-FED2-44E0-A153-CBE4F2F95CAC" sourceRef="sid-6049D869-CB64-4FA6-834E-EACACA346F2B" targetRef="sid-84B1CBA4-4EB4-49B0-A325-7FE98AA30ADE"></sequenceFlow>
|
||||||
|
<sequenceFlow id="sid-CA7480E4-D1AF-4CFB-8D67-92060BD3951C" name="More than two days" sourceRef="sid-D98DB70A-1374-4CCB-9E52-DF2E6AD00574" targetRef="sid-F35D0733-EE93-47A8-839D-B7D184A9C110"></sequenceFlow>
|
||||||
|
<sequenceFlow id="sid-8E38E47E-6B18-462B-9667-0A09799F4F78" name="Less than two days" sourceRef="sid-D98DB70A-1374-4CCB-9E52-DF2E6AD00574" targetRef="sid-F4B79508-8A4F-4AF5-82DE-1B13712A7378">
|
||||||
|
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${day<=2}]]></conditionExpression>
|
||||||
|
</sequenceFlow>
|
||||||
|
</process>
|
||||||
|
<bpmndi:BPMNDiagram id="BPMNDiagram_overtime001">
|
||||||
|
<bpmndi:BPMNPlane bpmnElement="overtime001" id="BPMNPlane_overtime001">
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-AEC3692B-6EDD-484B-B11F-A182226F32D0" id="BPMNShape_sid-AEC3692B-6EDD-484B-B11F-A182226F32D0">
|
||||||
|
<omgdc:Bounds height="30.0" width="30.0" x="105.0" y="155.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-84B1CBA4-4EB4-49B0-A325-7FE98AA30ADE" id="BPMNShape_sid-84B1CBA4-4EB4-49B0-A325-7FE98AA30ADE">
|
||||||
|
<omgdc:Bounds height="28.0" width="28.0" x="645.0" y="356.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-F35D0733-EE93-47A8-839D-B7D184A9C110" id="BPMNShape_sid-F35D0733-EE93-47A8-839D-B7D184A9C110">
|
||||||
|
<omgdc:Bounds height="80.0" width="100.0" x="210.0" y="330.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-F4B79508-8A4F-4AF5-82DE-1B13712A7378" id="BPMNShape_sid-F4B79508-8A4F-4AF5-82DE-1B13712A7378">
|
||||||
|
<omgdc:Bounds height="80.0" width="100.0" x="450.0" y="130.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-6049D869-CB64-4FA6-834E-EACACA346F2B" id="BPMNShape_sid-6049D869-CB64-4FA6-834E-EACACA346F2B">
|
||||||
|
<omgdc:Bounds height="80.0" width="100.0" x="450.0" y="330.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-D98DB70A-1374-4CCB-9E52-DF2E6AD00574" id="BPMNShape_sid-D98DB70A-1374-4CCB-9E52-DF2E6AD00574">
|
||||||
|
<omgdc:Bounds height="40.0" width="40.0" x="240.0" y="150.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-4E8F6437-39AF-4F6F-BB09-34D38C82F91F" id="BPMNEdge_sid-4E8F6437-39AF-4F6F-BB09-34D38C82F91F">
|
||||||
|
<omgdi:waypoint x="135.0" y="170.0"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="240.0" y="170.0"></omgdi:waypoint>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-CA7480E4-D1AF-4CFB-8D67-92060BD3951C" id="BPMNEdge_sid-CA7480E4-D1AF-4CFB-8D67-92060BD3951C">
|
||||||
|
<omgdi:waypoint x="260.45226130653265" y="189.54773869346735"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="260.10025062656644" y="330.0"></omgdi:waypoint>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-896063D8-3E30-4174-BBB2-9093113491DF" id="BPMNEdge_sid-896063D8-3E30-4174-BBB2-9093113491DF">
|
||||||
|
<omgdi:waypoint x="310.0" y="370.0"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="450.0" y="370.0"></omgdi:waypoint>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-61D0DFCA-16B1-49C1-AB72-84CB957F9C97" id="BPMNEdge_sid-61D0DFCA-16B1-49C1-AB72-84CB957F9C97">
|
||||||
|
<omgdi:waypoint x="500.0" y="210.0"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="500.0" y="330.0"></omgdi:waypoint>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-8E38E47E-6B18-462B-9667-0A09799F4F78" id="BPMNEdge_sid-8E38E47E-6B18-462B-9667-0A09799F4F78">
|
||||||
|
<omgdi:waypoint x="279.5397489539749" y="170.4602510460251"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="450.0" y="170.1043841336117"></omgdi:waypoint>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-2E80AF18-FED2-44E0-A153-CBE4F2F95CAC" id="BPMNEdge_sid-2E80AF18-FED2-44E0-A153-CBE4F2F95CAC">
|
||||||
|
<omgdi:waypoint x="550.0" y="370.0"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="645.0" y="370.0"></omgdi:waypoint>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
</bpmndi:BPMNPlane>
|
||||||
|
</bpmndi:BPMNDiagram>
|
||||||
|
</definitions>
|
BIN
service-oa/src/main/resources/process/overtime001.png
Normal file
BIN
service-oa/src/main/resources/process/overtime001.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
40
service-oa/src/main/resources/process/overtime01.bpmn20.xml
Normal file
40
service-oa/src/main/resources/process/overtime01.bpmn20.xml
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef">
|
||||||
|
<process id="overtime01" isExecutable="true">
|
||||||
|
<startEvent id="sid-5DC3A64E-3EB8-489E-A1CD-9DDF08B41EE5"></startEvent>
|
||||||
|
<endEvent id="sid-E4749034-D90A-402F-A2DC-C46323D28217"></endEvent>
|
||||||
|
<userTask id="sid-1C03C51F-BD11-49E3-B373-E7BC48B61D6A" name="Manager approval" activiti:assignee="${userBean.getUsername(1)}"></userTask>
|
||||||
|
<userTask id="sid-3146B952-82F3-49E8-8C98-3DB7BBD86166" name="Personnel approval" activiti:assignee="${userBean.getUsername(2)}"></userTask>
|
||||||
|
<sequenceFlow id="sid-BFC58373-53AD-4081-82DD-3DA665D73E6F" sourceRef="sid-5DC3A64E-3EB8-489E-A1CD-9DDF08B41EE5" targetRef="sid-1C03C51F-BD11-49E3-B373-E7BC48B61D6A"></sequenceFlow>
|
||||||
|
<sequenceFlow id="sid-0A020AB6-E6EA-406C-B49A-BB9614DD3BCF" sourceRef="sid-1C03C51F-BD11-49E3-B373-E7BC48B61D6A" targetRef="sid-3146B952-82F3-49E8-8C98-3DB7BBD86166"></sequenceFlow>
|
||||||
|
<sequenceFlow id="sid-6906F245-3A47-4508-9807-FC7FC8C6CCA0" sourceRef="sid-3146B952-82F3-49E8-8C98-3DB7BBD86166" targetRef="sid-E4749034-D90A-402F-A2DC-C46323D28217"></sequenceFlow>
|
||||||
|
</process>
|
||||||
|
<bpmndi:BPMNDiagram id="BPMNDiagram_overtime">
|
||||||
|
<bpmndi:BPMNPlane bpmnElement="overtime" id="BPMNPlane_overtime">
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-5DC3A64E-3EB8-489E-A1CD-9DDF08B41EE5" id="BPMNShape_sid-5DC3A64E-3EB8-489E-A1CD-9DDF08B41EE5">
|
||||||
|
<omgdc:Bounds height="30.0" width="30.0" x="150.0" y="195.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-E4749034-D90A-402F-A2DC-C46323D28217" id="BPMNShape_sid-E4749034-D90A-402F-A2DC-C46323D28217">
|
||||||
|
<omgdc:Bounds height="28.0" width="28.0" x="705.0" y="196.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-1C03C51F-BD11-49E3-B373-E7BC48B61D6A" id="BPMNShape_sid-1C03C51F-BD11-49E3-B373-E7BC48B61D6A">
|
||||||
|
<omgdc:Bounds height="80.0" width="100.0" x="300.5" y="170.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-3146B952-82F3-49E8-8C98-3DB7BBD86166" id="BPMNShape_sid-3146B952-82F3-49E8-8C98-3DB7BBD86166">
|
||||||
|
<omgdc:Bounds height="80.0" width="100.0" x="495.0" y="170.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-6906F245-3A47-4508-9807-FC7FC8C6CCA0" id="BPMNEdge_sid-6906F245-3A47-4508-9807-FC7FC8C6CCA0">
|
||||||
|
<omgdi:waypoint x="595.0" y="210.0"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="705.0" y="210.0"></omgdi:waypoint>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-0A020AB6-E6EA-406C-B49A-BB9614DD3BCF" id="BPMNEdge_sid-0A020AB6-E6EA-406C-B49A-BB9614DD3BCF">
|
||||||
|
<omgdi:waypoint x="400.5" y="210.0"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="495.0" y="210.0"></omgdi:waypoint>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-BFC58373-53AD-4081-82DD-3DA665D73E6F" id="BPMNEdge_sid-BFC58373-53AD-4081-82DD-3DA665D73E6F">
|
||||||
|
<omgdi:waypoint x="180.0" y="210.0"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="300.5" y="210.0"></omgdi:waypoint>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
</bpmndi:BPMNPlane>
|
||||||
|
</bpmndi:BPMNDiagram>
|
||||||
|
</definitions>
|
52
service-oa/src/main/resources/process/overtime02.bpmn20.xml
Normal file
52
service-oa/src/main/resources/process/overtime02.bpmn20.xml
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef">
|
||||||
|
<process id="overtime02" isExecutable="true">
|
||||||
|
<startEvent id="sid-5DC3A64E-3EB8-489E-A1CD-9DDF08B41EE5"></startEvent>
|
||||||
|
<endEvent id="sid-E4749034-D90A-402F-A2DC-C46323D28217"></endEvent>
|
||||||
|
<userTask id="sid-1C03C51F-BD11-49E3-B373-E7BC48B61D6A" name="Manager approval">
|
||||||
|
<extensionElements>
|
||||||
|
<activiti:taskListener event="create" class="com.atguigu.auth.activti.MyTaskListener"></activiti:taskListener>
|
||||||
|
</extensionElements>
|
||||||
|
</userTask>
|
||||||
|
<userTask id="sid-3146B952-82F3-49E8-8C98-3DB7BBD86166" name="Personnel approval">
|
||||||
|
<extensionElements>
|
||||||
|
<activiti:taskListener event="create" class="com.atguigu.auth.activti.MyTaskListener"></activiti:taskListener>
|
||||||
|
</extensionElements>
|
||||||
|
</userTask>
|
||||||
|
<sequenceFlow id="sid-BFC58373-53AD-4081-82DD-3DA665D73E6F" sourceRef="sid-5DC3A64E-3EB8-489E-A1CD-9DDF08B41EE5" targetRef="sid-1C03C51F-BD11-49E3-B373-E7BC48B61D6A"></sequenceFlow>
|
||||||
|
<sequenceFlow id="sid-0A020AB6-E6EA-406C-B49A-BB9614DD3BCF" sourceRef="sid-1C03C51F-BD11-49E3-B373-E7BC48B61D6A" targetRef="sid-3146B952-82F3-49E8-8C98-3DB7BBD86166"></sequenceFlow>
|
||||||
|
<sequenceFlow id="sid-6906F245-3A47-4508-9807-FC7FC8C6CCA0" sourceRef="sid-3146B952-82F3-49E8-8C98-3DB7BBD86166" targetRef="sid-E4749034-D90A-402F-A2DC-C46323D28217"></sequenceFlow>
|
||||||
|
</process>
|
||||||
|
<bpmndi:BPMNDiagram id="BPMNDiagram_overtime02">
|
||||||
|
<bpmndi:BPMNPlane bpmnElement="overtime02" id="BPMNPlane_overtime02">
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-5DC3A64E-3EB8-489E-A1CD-9DDF08B41EE5" id="BPMNShape_sid-5DC3A64E-3EB8-489E-A1CD-9DDF08B41EE5">
|
||||||
|
<omgdc:Bounds height="30.0" width="30.0" x="150.0" y="195.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-E4749034-D90A-402F-A2DC-C46323D28217" id="BPMNShape_sid-E4749034-D90A-402F-A2DC-C46323D28217">
|
||||||
|
<omgdc:Bounds height="28.0" width="28.0" x="705.0" y="196.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-1C03C51F-BD11-49E3-B373-E7BC48B61D6A" id="BPMNShape_sid-1C03C51F-BD11-49E3-B373-E7BC48B61D6A">
|
||||||
|
<omgdc:Bounds height="80.0" width="100.0" x="300.5" y="170.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-3146B952-82F3-49E8-8C98-3DB7BBD86166" id="BPMNShape_sid-3146B952-82F3-49E8-8C98-3DB7BBD86166">
|
||||||
|
<omgdc:Bounds height="80.0" width="100.0" x="495.0" y="165.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-6906F245-3A47-4508-9807-FC7FC8C6CCA0" id="BPMNEdge_sid-6906F245-3A47-4508-9807-FC7FC8C6CCA0">
|
||||||
|
<omgdi:waypoint x="595.0" y="205.0"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="650.0" y="205.0"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="650.0" y="210.0"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="705.0" y="210.0"></omgdi:waypoint>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-0A020AB6-E6EA-406C-B49A-BB9614DD3BCF" id="BPMNEdge_sid-0A020AB6-E6EA-406C-B49A-BB9614DD3BCF">
|
||||||
|
<omgdi:waypoint x="400.5" y="210.0"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="447.75" y="210.0"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="447.75" y="205.0"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="495.0" y="205.0"></omgdi:waypoint>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-BFC58373-53AD-4081-82DD-3DA665D73E6F" id="BPMNEdge_sid-BFC58373-53AD-4081-82DD-3DA665D73E6F">
|
||||||
|
<omgdi:waypoint x="180.0" y="210.0"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="300.5" y="210.0"></omgdi:waypoint>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
</bpmndi:BPMNPlane>
|
||||||
|
</bpmndi:BPMNDiagram>
|
||||||
|
</definitions>
|
40
service-oa/src/main/resources/process/overtime04.bpmn20.xml
Normal file
40
service-oa/src/main/resources/process/overtime04.bpmn20.xml
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef">
|
||||||
|
<process id="overtime04" isExecutable="true">
|
||||||
|
<startEvent id="sid-9A8C9BFE-10CB-40EF-A7AB-6128553D9AF8"></startEvent>
|
||||||
|
<userTask id="sid-2052A07F-FF13-4BD7-A966-A865E7030947" name="Manager approval" activiti:candidateUsers="tom01,tom02"></userTask>
|
||||||
|
<userTask id="sid-2FC30B49-C0BF-44E1-BAE0-BDDE29FC22F3" name="Personnel approval" activiti:candidateUsers="rose01,rose02"></userTask>
|
||||||
|
<endEvent id="sid-80F0DB82-BEEF-4CC8-9F89-F2EA796EC97B"></endEvent>
|
||||||
|
<sequenceFlow id="sid-3F42AA2D-71DF-419D-9027-EC622EA518E0" sourceRef="sid-9A8C9BFE-10CB-40EF-A7AB-6128553D9AF8" targetRef="sid-2052A07F-FF13-4BD7-A966-A865E7030947"></sequenceFlow>
|
||||||
|
<sequenceFlow id="sid-6CA01BA9-D3A1-4EC7-BEC5-1779604553A7" sourceRef="sid-2052A07F-FF13-4BD7-A966-A865E7030947" targetRef="sid-2FC30B49-C0BF-44E1-BAE0-BDDE29FC22F3"></sequenceFlow>
|
||||||
|
<sequenceFlow id="sid-8B6CE08C-111A-4F22-923A-92C669231683" sourceRef="sid-2FC30B49-C0BF-44E1-BAE0-BDDE29FC22F3" targetRef="sid-80F0DB82-BEEF-4CC8-9F89-F2EA796EC97B"></sequenceFlow>
|
||||||
|
</process>
|
||||||
|
<bpmndi:BPMNDiagram id="BPMNDiagram_overtime04">
|
||||||
|
<bpmndi:BPMNPlane bpmnElement="overtime04" id="BPMNPlane_overtime04">
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-9A8C9BFE-10CB-40EF-A7AB-6128553D9AF8" id="BPMNShape_sid-9A8C9BFE-10CB-40EF-A7AB-6128553D9AF8">
|
||||||
|
<omgdc:Bounds height="30.0" width="30.0" x="214.0" y="153.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-2052A07F-FF13-4BD7-A966-A865E7030947" id="BPMNShape_sid-2052A07F-FF13-4BD7-A966-A865E7030947">
|
||||||
|
<omgdc:Bounds height="80.0" width="100.0" x="375.0" y="128.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-2FC30B49-C0BF-44E1-BAE0-BDDE29FC22F3" id="BPMNShape_sid-2FC30B49-C0BF-44E1-BAE0-BDDE29FC22F3">
|
||||||
|
<omgdc:Bounds height="80.0" width="100.0" x="615.0" y="128.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sid-80F0DB82-BEEF-4CC8-9F89-F2EA796EC97B" id="BPMNShape_sid-80F0DB82-BEEF-4CC8-9F89-F2EA796EC97B">
|
||||||
|
<omgdc:Bounds height="28.0" width="28.0" x="855.0" y="154.0"></omgdc:Bounds>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-6CA01BA9-D3A1-4EC7-BEC5-1779604553A7" id="BPMNEdge_sid-6CA01BA9-D3A1-4EC7-BEC5-1779604553A7">
|
||||||
|
<omgdi:waypoint x="475.0" y="168.0"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="615.0" y="168.0"></omgdi:waypoint>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-3F42AA2D-71DF-419D-9027-EC622EA518E0" id="BPMNEdge_sid-3F42AA2D-71DF-419D-9027-EC622EA518E0">
|
||||||
|
<omgdi:waypoint x="244.0" y="168.0"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="375.0" y="168.0"></omgdi:waypoint>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="sid-8B6CE08C-111A-4F22-923A-92C669231683" id="BPMNEdge_sid-8B6CE08C-111A-4F22-923A-92C669231683">
|
||||||
|
<omgdi:waypoint x="715.0" y="168.0"></omgdi:waypoint>
|
||||||
|
<omgdi:waypoint x="855.0" y="168.0"></omgdi:waypoint>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
</bpmndi:BPMNPlane>
|
||||||
|
</bpmndi:BPMNDiagram>
|
||||||
|
</definitions>
|
@ -1,40 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef">
|
|
||||||
<process id="qingjia" isExecutable="true">
|
|
||||||
<startEvent id="sid-AE120E1B-25EC-43C0-B703-8EE13CB13835"></startEvent>
|
|
||||||
<userTask id="sid-30AE99C3-6055-4472-B3A3-9C4B0BB3975A" name="张三审批" activiti:assignee="zhangsan"></userTask>
|
|
||||||
<userTask id="sid-A8361321-1F0D-429F-8E5D-5F0D3FE7B764" name="李四审批" activiti:assignee="lisi"></userTask>
|
|
||||||
<endEvent id="sid-18403A14-DABE-48F8-B43F-16BCAFC66CE7"></endEvent>
|
|
||||||
<sequenceFlow id="sid-E88CBC13-6950-4428-8A88-721850823A32" sourceRef="sid-AE120E1B-25EC-43C0-B703-8EE13CB13835" targetRef="sid-30AE99C3-6055-4472-B3A3-9C4B0BB3975A"></sequenceFlow>
|
|
||||||
<sequenceFlow id="sid-8D62AC0F-C742-4738-A61A-5FC81916ACC1" sourceRef="sid-30AE99C3-6055-4472-B3A3-9C4B0BB3975A" targetRef="sid-A8361321-1F0D-429F-8E5D-5F0D3FE7B764"></sequenceFlow>
|
|
||||||
<sequenceFlow id="sid-4546D057-D5C4-467E-8BCC-AED3DF110B13" sourceRef="sid-A8361321-1F0D-429F-8E5D-5F0D3FE7B764" targetRef="sid-18403A14-DABE-48F8-B43F-16BCAFC66CE7"></sequenceFlow>
|
|
||||||
</process>
|
|
||||||
<bpmndi:BPMNDiagram id="BPMNDiagram_qingjia">
|
|
||||||
<bpmndi:BPMNPlane bpmnElement="qingjia" id="BPMNPlane_qingjia">
|
|
||||||
<bpmndi:BPMNShape bpmnElement="sid-AE120E1B-25EC-43C0-B703-8EE13CB13835" id="BPMNShape_sid-AE120E1B-25EC-43C0-B703-8EE13CB13835">
|
|
||||||
<omgdc:Bounds height="30.0" width="30.0" x="214.43284560541542" y="142.0231410855287"></omgdc:Bounds>
|
|
||||||
</bpmndi:BPMNShape>
|
|
||||||
<bpmndi:BPMNShape bpmnElement="sid-30AE99C3-6055-4472-B3A3-9C4B0BB3975A" id="BPMNShape_sid-30AE99C3-6055-4472-B3A3-9C4B0BB3975A">
|
|
||||||
<omgdc:Bounds height="80.0" width="100.0" x="330.0" y="120.0"></omgdc:Bounds>
|
|
||||||
</bpmndi:BPMNShape>
|
|
||||||
<bpmndi:BPMNShape bpmnElement="sid-A8361321-1F0D-429F-8E5D-5F0D3FE7B764" id="BPMNShape_sid-A8361321-1F0D-429F-8E5D-5F0D3FE7B764">
|
|
||||||
<omgdc:Bounds height="80.0" width="100.0" x="525.0" y="117.02314108552869"></omgdc:Bounds>
|
|
||||||
</bpmndi:BPMNShape>
|
|
||||||
<bpmndi:BPMNShape bpmnElement="sid-18403A14-DABE-48F8-B43F-16BCAFC66CE7" id="BPMNShape_sid-18403A14-DABE-48F8-B43F-16BCAFC66CE7">
|
|
||||||
<omgdc:Bounds height="28.0" width="28.0" x="735.0" y="143.0231410855287"></omgdc:Bounds>
|
|
||||||
</bpmndi:BPMNShape>
|
|
||||||
<bpmndi:BPMNEdge bpmnElement="sid-8D62AC0F-C742-4738-A61A-5FC81916ACC1" id="BPMNEdge_sid-8D62AC0F-C742-4738-A61A-5FC81916ACC1">
|
|
||||||
<omgdi:waypoint x="430.0" y="159.23670284244326"></omgdi:waypoint>
|
|
||||||
<omgdi:waypoint x="525.0" y="157.78643824308546"></omgdi:waypoint>
|
|
||||||
</bpmndi:BPMNEdge>
|
|
||||||
<bpmndi:BPMNEdge bpmnElement="sid-E88CBC13-6950-4428-8A88-721850823A32" id="BPMNEdge_sid-E88CBC13-6950-4428-8A88-721850823A32">
|
|
||||||
<omgdi:waypoint x="244.42991477976543" y="157.31964771236983"></omgdi:waypoint>
|
|
||||||
<omgdi:waypoint x="330.0" y="159.01145142629514"></omgdi:waypoint>
|
|
||||||
</bpmndi:BPMNEdge>
|
|
||||||
<bpmndi:BPMNEdge bpmnElement="sid-4546D057-D5C4-467E-8BCC-AED3DF110B13" id="BPMNEdge_sid-4546D057-D5C4-467E-8BCC-AED3DF110B13">
|
|
||||||
<omgdi:waypoint x="625.0" y="157.0231410855287"></omgdi:waypoint>
|
|
||||||
<omgdi:waypoint x="735.0" y="157.0231410855287"></omgdi:waypoint>
|
|
||||||
</bpmndi:BPMNEdge>
|
|
||||||
</bpmndi:BPMNPlane>
|
|
||||||
</bpmndi:BPMNDiagram>
|
|
||||||
</definitions>
|
|
Binary file not shown.
Before Width: | Height: | Size: 7.5 KiB |
@ -0,0 +1,25 @@
|
|||||||
|
package com.atguigu.auth.activti;
|
||||||
|
|
||||||
|
import org.activiti.engine.delegate.DelegateTask;
|
||||||
|
import org.activiti.engine.delegate.TaskListener;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClassName: MyTaskListener
|
||||||
|
* Package: com.atguigu.auth.activti
|
||||||
|
*
|
||||||
|
* @author yovinchen
|
||||||
|
* @Create 2023/6/12 15:12
|
||||||
|
*/
|
||||||
|
public class MyTaskListener implements TaskListener {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void notify(DelegateTask delegateTask) {
|
||||||
|
if (delegateTask.getName().equals("经理审批")) {
|
||||||
|
//这里指定任务负责人
|
||||||
|
delegateTask.setAssignee("Jack1");
|
||||||
|
} else if (delegateTask.getName().equals("人事审批")) {
|
||||||
|
//这里指定任务负责人
|
||||||
|
delegateTask.setAssignee("Jack2");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -29,18 +29,27 @@ import java.util.List;
|
|||||||
@SpringBootTest
|
@SpringBootTest
|
||||||
public class ProcessTest {
|
public class ProcessTest {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程定义
|
||||||
|
*/
|
||||||
@Autowired
|
@Autowired
|
||||||
private RepositoryService repositoryService;
|
private RepositoryService repositoryService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例
|
||||||
|
*/
|
||||||
@Autowired
|
@Autowired
|
||||||
private RuntimeService runtimeService;
|
private RuntimeService runtimeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程任务
|
||||||
|
*/
|
||||||
@Autowired
|
@Autowired
|
||||||
private TaskService taskService;
|
private TaskService taskService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相关操作历史
|
||||||
|
*/
|
||||||
@Autowired
|
@Autowired
|
||||||
private HistoryService historyService;
|
private HistoryService historyService;
|
||||||
|
|
||||||
@ -49,7 +58,7 @@ public class ProcessTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void SingleSuspendProcessInstance() {
|
public void SingleSuspendProcessInstance() {
|
||||||
String processInstanceId = "8bdff984-ab53-11ed-9b17-f8e43b734677";
|
String processInstanceId = "ce1f3cc0-08cf-11ee-b8cb-e645a9a03302";
|
||||||
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
|
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
|
||||||
//获取到当前流程定义是否为暂停状态 suspended方法为true代表为暂停 false就是运行的
|
//获取到当前流程定义是否为暂停状态 suspended方法为true代表为暂停 false就是运行的
|
||||||
boolean suspended = processInstance.isSuspended();
|
boolean suspended = processInstance.isSuspended();
|
||||||
@ -67,17 +76,17 @@ public class ProcessTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void suspendProcessInstance() {
|
public void suspendProcessInstance() {
|
||||||
ProcessDefinition qingjia = repositoryService.createProcessDefinitionQuery().processDefinitionKey("qingjia").singleResult();
|
ProcessDefinition leave = repositoryService.createProcessDefinitionQuery().processDefinitionKey("leave").singleResult();
|
||||||
// 获取到当前流程定义是否为暂停状态 suspended方法为true是暂停的,suspended方法为false是运行的
|
// 获取到当前流程定义是否为暂停状态 suspended方法为true是暂停的,suspended方法为false是运行的
|
||||||
boolean suspended = qingjia.isSuspended();
|
boolean suspended = leave.isSuspended();
|
||||||
if (suspended) {
|
if (suspended) {
|
||||||
// 暂定,那就可以激活
|
// 暂定,那就可以激活
|
||||||
// 参数1:流程定义的id 参数2:是否激活 参数3:时间点
|
// 参数1:流程定义的id 参数2:是否激活 参数3:时间点
|
||||||
repositoryService.activateProcessDefinitionById(qingjia.getId(), true, null);
|
repositoryService.activateProcessDefinitionById(leave.getId(), true, null);
|
||||||
System.out.println("流程定义:" + qingjia.getId() + "激活");
|
System.out.println("流程定义:" + leave.getId() + "激活");
|
||||||
} else {
|
} else {
|
||||||
repositoryService.suspendProcessDefinitionById(qingjia.getId(), true, null);
|
repositoryService.suspendProcessDefinitionById(leave.getId(), true, null);
|
||||||
System.out.println("流程定义:" + qingjia.getId() + "挂起");
|
System.out.println("流程定义:" + leave.getId() + "挂起");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,7 +98,7 @@ public class ProcessTest {
|
|||||||
String businessKey = "1";
|
String businessKey = "1";
|
||||||
// 启动流程实例,指定业务标识businessKey,也就是请假申请单id
|
// 启动流程实例,指定业务标识businessKey,也就是请假申请单id
|
||||||
ProcessInstance processInstance = runtimeService.
|
ProcessInstance processInstance = runtimeService.
|
||||||
startProcessInstanceByKey("qingjia", businessKey);
|
startProcessInstanceByKey("leave", businessKey);
|
||||||
// 输出
|
// 输出
|
||||||
System.out.println("业务id:" + processInstance.getBusinessKey());
|
System.out.println("业务id:" + processInstance.getBusinessKey());
|
||||||
}
|
}
|
||||||
@ -99,7 +108,7 @@ public class ProcessTest {
|
|||||||
*/
|
*/
|
||||||
public void deleteDeployment() {
|
public void deleteDeployment() {
|
||||||
//部署id
|
//部署id
|
||||||
String deploymentId = "5b997a98-0868-11ee-9ba7-6294623ad4e1";
|
String deploymentId = "ce1f3cc0-08cf-11ee-b8cb-e645a9a03302";
|
||||||
//删除流程定义,如果该流程定义已有流程实例启动则删除时出错
|
//删除流程定义,如果该流程定义已有流程实例启动则删除时出错
|
||||||
repositoryService.deleteDeployment(deploymentId);
|
repositoryService.deleteDeployment(deploymentId);
|
||||||
//设置true 级联删除流程定义,即使该流程有流程实例启动也可以删除,设置为false非级别删除方式
|
//设置true 级联删除流程定义,即使该流程有流程实例启动也可以删除,设置为false非级别删除方式
|
||||||
@ -117,11 +126,11 @@ public class ProcessTest {
|
|||||||
.list();
|
.list();
|
||||||
//输出流程定义信息
|
//输出流程定义信息
|
||||||
for (ProcessDefinition processDefinition : definitionList) {
|
for (ProcessDefinition processDefinition : definitionList) {
|
||||||
System.out.println("流程定义 id=" + processDefinition.getId());
|
System.out.println("流程定义 id= " + processDefinition.getId());
|
||||||
System.out.println("流程定义 name=" + processDefinition.getName());
|
System.out.println("流程定义 name= " + processDefinition.getName());
|
||||||
System.out.println("流程定义 key=" + processDefinition.getKey());
|
System.out.println("流程定义 key= " + processDefinition.getKey());
|
||||||
System.out.println("流程定义 Version=" + processDefinition.getVersion());
|
System.out.println("流程定义 Version= " + processDefinition.getVersion());
|
||||||
System.out.println("流程部署ID =" + processDefinition.getDeploymentId());
|
System.out.println("流程部署ID = " + processDefinition.getDeploymentId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,8 +154,8 @@ public class ProcessTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void completTask() {
|
public void completTask() {
|
||||||
Task task = taskService.createTaskQuery().taskAssignee("zhangsan") //要查询的负责人
|
//要查询的负责人
|
||||||
.singleResult();//返回一条
|
Task task = taskService.createTaskQuery().taskAssignee("zhangsan").singleResult();//返回一条
|
||||||
|
|
||||||
//完成任务,参数:任务id
|
//完成任务,参数:任务id
|
||||||
taskService.complete(task.getId());
|
taskService.complete(task.getId());
|
||||||
@ -175,7 +184,7 @@ public class ProcessTest {
|
|||||||
@Test
|
@Test
|
||||||
public void startUpProcess() {
|
public void startUpProcess() {
|
||||||
//创建流程实例,我们需要知道流程定义的key
|
//创建流程实例,我们需要知道流程定义的key
|
||||||
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("qingjia");
|
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("leave");
|
||||||
//输出实例的相关信息
|
//输出实例的相关信息
|
||||||
System.out.println("流程定义id:" + processInstance.getProcessDefinitionId());
|
System.out.println("流程定义id:" + processInstance.getProcessDefinitionId());
|
||||||
System.out.println("流程实例id:" + processInstance.getId());
|
System.out.println("流程实例id:" + processInstance.getId());
|
||||||
@ -188,7 +197,7 @@ public class ProcessTest {
|
|||||||
@Test
|
@Test
|
||||||
public void deployProcess() {
|
public void deployProcess() {
|
||||||
// 流程部署
|
// 流程部署
|
||||||
Deployment deploy = repositoryService.createDeployment().addClasspathResource("process/qingjia.bpmn20.xml").addClasspathResource("process/qingjia.png").name("请假申请流程").deploy();
|
Deployment deploy = repositoryService.createDeployment().addClasspathResource("process/leave.bpmn20.xml").addClasspathResource("process/leave.png").name("请假申请流程").deploy();
|
||||||
System.out.println(deploy.getId());
|
System.out.println(deploy.getId());
|
||||||
System.out.println(deploy.getName());
|
System.out.println(deploy.getName());
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,137 @@
|
|||||||
|
package com.atguigu.auth.activti;
|
||||||
|
|
||||||
|
import org.activiti.engine.HistoryService;
|
||||||
|
import org.activiti.engine.RepositoryService;
|
||||||
|
import org.activiti.engine.RuntimeService;
|
||||||
|
import org.activiti.engine.TaskService;
|
||||||
|
import org.activiti.engine.repository.Deployment;
|
||||||
|
import org.activiti.engine.runtime.ProcessInstance;
|
||||||
|
import org.activiti.engine.task.Task;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClassName: ProcessTestDome001
|
||||||
|
* Package: com.atguigu.auth.activti
|
||||||
|
*
|
||||||
|
* @author yovinchen
|
||||||
|
* @Create 2023/6/13 16:38
|
||||||
|
*/
|
||||||
|
@RunWith(SpringRunner.class)
|
||||||
|
@SpringBootTest
|
||||||
|
public class ProcessTestDome001 {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程定义
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private RepositoryService repositoryService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private RuntimeService runtimeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程任务
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private TaskService taskService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相关操作历史
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private HistoryService historyService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1.部署流程定义
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void deployProcess() {
|
||||||
|
Deployment deployment = repositoryService.createDeployment()
|
||||||
|
.addClasspathResource("process/overtime001.bpmn20.xml").name("请假申请流程001").deploy();
|
||||||
|
System.out.println(deployment.getId());
|
||||||
|
System.out.println(deployment.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2.启动流程实例
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void startProcessInstance() {
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
//设置请假天数
|
||||||
|
map.put("day", "3");
|
||||||
|
|
||||||
|
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("overtime001", map);
|
||||||
|
System.out.println(processInstance.getProcessDefinitionId());
|
||||||
|
System.out.println(processInstance.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
//3 查询个人的代办任务--zhaoliu
|
||||||
|
@Test
|
||||||
|
public void findTaskList() {
|
||||||
|
|
||||||
|
// String assign = "zhaoliu";
|
||||||
|
String assign = "gousheng";
|
||||||
|
List<Task> list = taskService.createTaskQuery().taskAssignee(assign).list();
|
||||||
|
for (Task task : list) {
|
||||||
|
System.out.println("流程实例id:" + task.getProcessInstanceId());
|
||||||
|
System.out.println("任务id:" + task.getId());
|
||||||
|
System.out.println("任务负责人:" + task.getAssignee());
|
||||||
|
System.out.println("任务名称:" + task.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 流程实例id:0b64992c-09ca-11ee-89e6-2aee215b35b7
|
||||||
|
// 任务id:0b675853-09ca-11ee-89e6-2aee215b35b7
|
||||||
|
// 任务负责人:gousheng
|
||||||
|
// 任务名称:General manager approval
|
||||||
|
// 流程实例id:99e01586-09c9-11ee-b45a-2aee215b35b7
|
||||||
|
// 任务id:99e2ad9b-09c9-11ee-b45a-2aee215b35b7
|
||||||
|
// 任务负责人:gousheng
|
||||||
|
// 任务名称:General manager approval
|
||||||
|
// 流程实例id:a1ef91c6-09ca-11ee-a1d9-2aee215b35b7
|
||||||
|
// 任务id:a1f202cd-09ca-11ee-a1d9-2aee215b35b7
|
||||||
|
// 任务负责人:gousheng
|
||||||
|
// 任务名称:General manager approval
|
||||||
|
// 流程实例id:ffa761de-09c9-11ee-a564-2aee215b35b7
|
||||||
|
// 任务id:ffaa4815-09c9-11ee-a564-2aee215b35b7
|
||||||
|
// 任务负责人:gousheng
|
||||||
|
// 任务名称:General manager approval
|
||||||
|
/**
|
||||||
|
* 删除流程定义
|
||||||
|
*/
|
||||||
|
public void deleteDeployment() {
|
||||||
|
//部署id
|
||||||
|
String deploymentId = "ffa761de-09c9-11ee-a564-2aee215b35b7";
|
||||||
|
//删除流程定义,如果该流程定义已有流程实例启动则删除时出错
|
||||||
|
repositoryService.deleteDeployment(deploymentId);
|
||||||
|
//设置true 级联删除流程定义,即使该流程有流程实例启动也可以删除,设置为false非级别删除方式
|
||||||
|
repositoryService.deleteDeployment(deploymentId, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成任务
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void completeTask() {
|
||||||
|
Task task = taskService.createTaskQuery()
|
||||||
|
// .taskAssignee("zhaoliu")
|
||||||
|
.taskAssignee("gousheng")
|
||||||
|
.singleResult();//返回一条
|
||||||
|
|
||||||
|
//完成任务,参数:任务id
|
||||||
|
taskService.complete(task.getId());
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,126 @@
|
|||||||
|
package com.atguigu.auth.activti;
|
||||||
|
|
||||||
|
import org.activiti.engine.HistoryService;
|
||||||
|
import org.activiti.engine.RepositoryService;
|
||||||
|
import org.activiti.engine.RuntimeService;
|
||||||
|
import org.activiti.engine.TaskService;
|
||||||
|
import org.activiti.engine.repository.Deployment;
|
||||||
|
import org.activiti.engine.runtime.ProcessInstance;
|
||||||
|
import org.activiti.engine.task.Task;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClassName: ProcessTestDome002
|
||||||
|
* Package: com.atguigu.auth.activti
|
||||||
|
*
|
||||||
|
* @author yovinchen
|
||||||
|
* @Create 2023/6/13 16:50
|
||||||
|
*/
|
||||||
|
@RunWith(SpringRunner.class)
|
||||||
|
@SpringBootTest
|
||||||
|
public class ProcessTestDome002 {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程定义
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private RepositoryService repositoryService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private RuntimeService runtimeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程任务
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private TaskService taskService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相关操作历史
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private HistoryService historyService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1.部署流程定义
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void deployProcess() {
|
||||||
|
Deployment deployment = repositoryService.createDeployment()
|
||||||
|
.addClasspathResource("process/leave001.bpmn20.xml").name("请假申请流程002").deploy();
|
||||||
|
System.out.println(deployment.getId());
|
||||||
|
System.out.println(deployment.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2.启动流程实例
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void startProcessInstance() {
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
//设置请假天数
|
||||||
|
map.put("day", "3");
|
||||||
|
|
||||||
|
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("leave001", map);
|
||||||
|
System.out.println(processInstance.getProcessDefinitionId());
|
||||||
|
System.out.println(processInstance.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
//3 查询个人的代办任务--zhaoliu
|
||||||
|
@Test
|
||||||
|
public void findTaskList() {
|
||||||
|
|
||||||
|
// String assign = "wang5";
|
||||||
|
|
||||||
|
// 流程实例id:851c5a11-09cc-11ee-a8fc-2aee215b35b7
|
||||||
|
// 任务id:85200399-09cc-11ee-a8fc-2aee215b35b7
|
||||||
|
// 任务负责人:wang5
|
||||||
|
// 任务名称:Department manager approval
|
||||||
|
|
||||||
|
// String assign = "gouwa";
|
||||||
|
|
||||||
|
// 流程实例id:851c5a11-09cc-11ee-a8fc-2aee215b35b7
|
||||||
|
// 任务id:8520039b-09cc-11ee-a8fc-2aee215b35b7
|
||||||
|
|
||||||
|
String assign = "xiaoli";
|
||||||
|
|
||||||
|
// 流程实例id:851c5a11-09cc-11ee-a8fc-2aee215b35b7
|
||||||
|
// 任务id:d3756b55-09cc-11ee-9240-2aee215b35b7
|
||||||
|
// 任务负责人:xiaoli
|
||||||
|
// 任务名称:Personnel record
|
||||||
|
|
||||||
|
List<Task> list = taskService.createTaskQuery().taskAssignee(assign).list();
|
||||||
|
for (Task task : list) {
|
||||||
|
System.out.println("流程实例id:" + task.getProcessInstanceId());
|
||||||
|
System.out.println("任务id:" + task.getId());
|
||||||
|
System.out.println("任务负责人:" + task.getAssignee());
|
||||||
|
System.out.println("任务名称:" + task.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成任务
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void completeTask() {
|
||||||
|
Task task = taskService.createTaskQuery()
|
||||||
|
.taskAssignee("wang5")
|
||||||
|
.taskAssignee("gouwa")
|
||||||
|
.singleResult();//返回一条
|
||||||
|
|
||||||
|
//完成任务,参数:任务id
|
||||||
|
taskService.complete(task.getId());
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,188 @@
|
|||||||
|
package com.atguigu.auth.activti;
|
||||||
|
|
||||||
|
import org.activiti.engine.HistoryService;
|
||||||
|
import org.activiti.engine.RepositoryService;
|
||||||
|
import org.activiti.engine.RuntimeService;
|
||||||
|
import org.activiti.engine.TaskService;
|
||||||
|
import org.activiti.engine.repository.Deployment;
|
||||||
|
import org.activiti.engine.runtime.ProcessInstance;
|
||||||
|
import org.activiti.engine.task.Task;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClassName: ProcessTestDome1
|
||||||
|
* Package: com.atguigu.auth.activti
|
||||||
|
*
|
||||||
|
* @author yovinchen
|
||||||
|
* @Create 2023/6/12 11:38
|
||||||
|
*/
|
||||||
|
@RunWith(SpringRunner.class)
|
||||||
|
@SpringBootTest
|
||||||
|
public class ProcessTestDome1 {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程定义
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private RepositoryService repositoryService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private RuntimeService runtimeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程任务
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private TaskService taskService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相关操作历史
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private HistoryService historyService;
|
||||||
|
|
||||||
|
//----------------------------------------- 监听器分配任务-----------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部署流程定义
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void deployProcess02() {
|
||||||
|
Deployment deploy = repositoryService.createDeployment().addClasspathResource("process/overtime02.bpmn20.xml").name("加班申请流程02").deploy();
|
||||||
|
System.out.println("deploy.getId() = " + deploy.getId());
|
||||||
|
System.out.println("deploy.getName() = " + deploy.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启动流程实例
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void startProcessInstance02() {
|
||||||
|
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("overtime02");
|
||||||
|
System.out.println("processInstance.getProcessDefinitionId() = " + processInstance.getProcessDefinitionId());
|
||||||
|
System.out.println("processInstance.getId() = " + processInstance.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询个人的代办任务--Jack1
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void findTaskList02() {
|
||||||
|
String assign = "Jack1";
|
||||||
|
List<Task> list = taskService.createTaskQuery().taskAssignee(assign).list();
|
||||||
|
for (Task task : list) {
|
||||||
|
System.out.println("task.getProcessInstanceId() = " + task.getProcessInstanceId());
|
||||||
|
System.out.println("任务id:" + task.getId());
|
||||||
|
System.out.println("任务负责人:" + task.getAssignee());
|
||||||
|
System.out.println("任务名称:" + task.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------uel-method---------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部署流程定义
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void deployProcess01() {
|
||||||
|
// 流程部署
|
||||||
|
Deployment deploy = repositoryService.createDeployment()
|
||||||
|
.addClasspathResource("process/overtime01.bpmn20.xml")
|
||||||
|
.name("加班申请流程01")
|
||||||
|
.deploy();
|
||||||
|
System.out.println(deploy.getId());
|
||||||
|
System.out.println(deploy.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启动流程实例
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void startUpProcess02() {
|
||||||
|
//创建流程实例,我们需要知道流程定义的key
|
||||||
|
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("overtime01");
|
||||||
|
//输出实例的相关信息
|
||||||
|
System.out.println("流程定义id:" + processInstance.getProcessDefinitionId());
|
||||||
|
System.out.println("流程实例id:" + processInstance.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询个人的代办任务--Mac
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void findTaskList01() {
|
||||||
|
String assign = "Mac";
|
||||||
|
List<Task> list = taskService.createTaskQuery()
|
||||||
|
.taskAssignee(assign).list();
|
||||||
|
for (Task task : list) {
|
||||||
|
System.out.println("task.getProcessInstanceId() = " + task.getProcessInstanceId()); // abb9c7c4-bb20-11ed-b608-005056c00001
|
||||||
|
System.out.println("任务id:" + task.getId()); // abbd4a38-bb20-11ed-b608-005056c00001
|
||||||
|
System.out.println("任务负责人:" + task.getAssignee()); // LiLei
|
||||||
|
System.out.println("任务名称:" + task.getName()); // 经理审批
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------uel-value---------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部署流程定义
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void deployProcess() {
|
||||||
|
// 流程部署
|
||||||
|
Deployment deploy = repositoryService.createDeployment()
|
||||||
|
.addClasspathResource("process/overtime.bpmn20.xml")
|
||||||
|
.name("加班申请流程")
|
||||||
|
.deploy();
|
||||||
|
System.out.println(deploy.getId());
|
||||||
|
System.out.println(deploy.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启动流程实例
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void startUpProcess() {
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
map.put("assignee1", "Lucy");
|
||||||
|
map.put("assignee2", "Mack");
|
||||||
|
//创建流程实例,我们需要知道流程定义的key
|
||||||
|
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("overtime", map);
|
||||||
|
//输出实例的相关信息
|
||||||
|
System.out.println("流程定义id:" + processInstance.getProcessDefinitionId());
|
||||||
|
System.out.println("流程实例id:" + processInstance.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询当前个人待执行的任务
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void findPendingTaskList() {
|
||||||
|
//任务负责人
|
||||||
|
String assignee = "zhangsan";
|
||||||
|
List<Task> list = taskService.createTaskQuery().taskAssignee(assignee)//只查询该任务负责人的任务
|
||||||
|
.list();
|
||||||
|
for (Task task : list) {
|
||||||
|
System.out.println("流程实例id:" + task.getProcessInstanceId());
|
||||||
|
System.out.println("任务id:" + task.getId());
|
||||||
|
System.out.println("任务负责人:" + task.getAssignee());
|
||||||
|
System.out.println("任务名称:" + task.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,251 @@
|
|||||||
|
package com.atguigu.auth.activti;
|
||||||
|
|
||||||
|
import org.activiti.engine.HistoryService;
|
||||||
|
import org.activiti.engine.RepositoryService;
|
||||||
|
import org.activiti.engine.RuntimeService;
|
||||||
|
import org.activiti.engine.TaskService;
|
||||||
|
import org.activiti.engine.repository.Deployment;
|
||||||
|
import org.activiti.engine.runtime.ProcessInstance;
|
||||||
|
import org.activiti.engine.task.Task;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClassName: ProcessTestDome2
|
||||||
|
* Package: com.atguigu.auth.activti
|
||||||
|
*
|
||||||
|
* @author yovinchen
|
||||||
|
* @Create 2023/6/12 20:38
|
||||||
|
*/
|
||||||
|
@RunWith(SpringRunner.class)
|
||||||
|
@SpringBootTest
|
||||||
|
public class ProcessTestDome2 {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程定义
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private RepositoryService repositoryService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private RuntimeService runtimeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程任务
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private TaskService taskService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相关操作历史
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private HistoryService historyService;
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 部署流程定义
|
||||||
|
// */
|
||||||
|
// @Test
|
||||||
|
// public void deployProcess02() {
|
||||||
|
// Deployment deploy = repositoryService.createDeployment().addClasspathResource("process/overtime.bpmn20.xml").name("加班申请流程02").deploy();
|
||||||
|
// System.out.println("deploy.getId() = " + deploy.getId());
|
||||||
|
// System.out.println("deploy.getName() = " + deploy.getName());
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 启动流程实例
|
||||||
|
// */
|
||||||
|
// @Test
|
||||||
|
// public void startProcessInstance02() {
|
||||||
|
// ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("overtime02");
|
||||||
|
// System.out.println("processInstance.getProcessDefinitionId() = " + processInstance.getProcessDefinitionId());
|
||||||
|
// System.out.println("processInstance.getId() = " + processInstance.getId());
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 查询个人的代办任务--Jack1
|
||||||
|
// */
|
||||||
|
// @Test
|
||||||
|
// public void findTaskList02() {
|
||||||
|
// String assign = "Jack1";
|
||||||
|
// List<Task> list = taskService.createTaskQuery().taskAssignee(assign).list();
|
||||||
|
// for (Task task : list) {
|
||||||
|
// System.out.println("task.getProcessInstanceId() = " + task.getProcessInstanceId());
|
||||||
|
// System.out.println("任务id:" + task.getId());
|
||||||
|
// System.out.println("任务负责人:" + task.getAssignee());
|
||||||
|
// System.out.println("任务名称:" + task.getName());
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
////-----------------------uel-method---------------------------------
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 部署流程定义
|
||||||
|
// */
|
||||||
|
// @Test
|
||||||
|
// public void deployProcess01() {
|
||||||
|
// // 流程部署
|
||||||
|
// Deployment deploy = repositoryService.createDeployment()
|
||||||
|
// .addClasspathResource("process/overtime01.bpmn20.xml")
|
||||||
|
// .name("加班申请流程01")
|
||||||
|
// .deploy();
|
||||||
|
// System.out.println(deploy.getId());
|
||||||
|
// System.out.println(deploy.getName());
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 启动流程实例
|
||||||
|
// */
|
||||||
|
// @Test
|
||||||
|
// public void startUpProcess02() {
|
||||||
|
// //创建流程实例,我们需要知道流程定义的key
|
||||||
|
// ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("overtime01");
|
||||||
|
// //输出实例的相关信息
|
||||||
|
// System.out.println("流程定义id:" + processInstance.getProcessDefinitionId());
|
||||||
|
// System.out.println("流程实例id:" + processInstance.getId());
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 查询个人的代办任务--Mac
|
||||||
|
// */
|
||||||
|
// @Test
|
||||||
|
// public void findTaskList01() {
|
||||||
|
// String assign = "Mac";
|
||||||
|
// List<Task> list = taskService.createTaskQuery()
|
||||||
|
// .taskAssignee(assign).list();
|
||||||
|
// for (Task task : list) {
|
||||||
|
// System.out.println("task.getProcessInstanceId() = " + task.getProcessInstanceId()); // abb9c7c4-bb20-11ed-b608-005056c00001
|
||||||
|
// System.out.println("任务id:" + task.getId()); // abbd4a38-bb20-11ed-b608-005056c00001
|
||||||
|
// System.out.println("任务负责人:" + task.getAssignee()); // LiLei
|
||||||
|
// System.out.println("任务名称:" + task.getName()); // 经理审批
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
////---------------------------------uel-value---------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部署流程定义
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void deployProcess() {
|
||||||
|
// 流程部署
|
||||||
|
Deployment deploy = repositoryService.createDeployment()
|
||||||
|
.addClasspathResource("process/overtime.bpmn20.xml")
|
||||||
|
.name("加班申请流程")
|
||||||
|
.deploy();
|
||||||
|
System.out.println(deploy.getId());
|
||||||
|
System.out.println(deploy.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启动流程实例
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void startUpProcess() {
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
map.put("assignee1", "Lucy01");
|
||||||
|
map.put("assignee2", "Mack01");
|
||||||
|
//创建流程实例,我们需要知道流程定义的key
|
||||||
|
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("overtime", map);
|
||||||
|
//输出实例的相关信息
|
||||||
|
System.out.println("流程定义id:" + processInstance.getProcessDefinitionId());
|
||||||
|
System.out.println("流程实例id:" + processInstance.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询当前个人待执行的任务
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void findPendingTaskList() {
|
||||||
|
//任务负责人
|
||||||
|
String assignee = "Lucy01";
|
||||||
|
List<Task> list = taskService.createTaskQuery().taskAssignee(assignee)//只查询该任务负责人的任务
|
||||||
|
.list();
|
||||||
|
for (Task task : list) {
|
||||||
|
System.out.println("流程实例id:" + task.getProcessInstanceId());
|
||||||
|
System.out.println("任务id:" + task.getId());
|
||||||
|
System.out.println("任务负责人:" + task.getAssignee());
|
||||||
|
System.out.println("任务名称:" + task.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//---------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部署流程定义
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void deployProcess03() {
|
||||||
|
// 流程部署
|
||||||
|
Deployment deploy = repositoryService.createDeployment()
|
||||||
|
.addClasspathResource("process/overtime.bpmn20.xml")
|
||||||
|
.name("加班申请流程")
|
||||||
|
.deploy();
|
||||||
|
System.out.println(deploy.getId());
|
||||||
|
System.out.println(deploy.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启动流程实例
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void startUpProcess03() {
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
map.put("assignee1", "Lucy03");
|
||||||
|
// map.put("assignee2", "Mack01");
|
||||||
|
//创建流程实例,我们需要知道流程定义的key
|
||||||
|
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("overtime", map);
|
||||||
|
//输出实例的相关信息
|
||||||
|
System.out.println("流程定义id:" + processInstance.getProcessDefinitionId());
|
||||||
|
System.out.println("流程实例id:" + processInstance.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void completTask() {
|
||||||
|
Task task = taskService.createTaskQuery()
|
||||||
|
.taskAssignee("Lucy03") //要查询的负责人
|
||||||
|
.singleResult();//返回一条
|
||||||
|
|
||||||
|
Map<String, Object> variables = new HashMap<>();
|
||||||
|
variables.put("assignee2", "zhao");
|
||||||
|
//完成任务,参数:任务id
|
||||||
|
taskService.complete(task.getId(), variables);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询当前个人待执行的任务
|
||||||
|
* <p>
|
||||||
|
* 流程实例id:245a58e7-0923-11ee-8637-b60fbe4e0138
|
||||||
|
* 任务id:29c9f30a-0923-11ee-abdf-b60fbe4e0138
|
||||||
|
* 任务负责人:zhao
|
||||||
|
* 任务名称:Personnel approval
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void findPendingTaskList03() {
|
||||||
|
//任务负责人
|
||||||
|
String assignee = "zhao";
|
||||||
|
List<Task> list = taskService.createTaskQuery().taskAssignee(assignee)//只查询该任务负责人的任务
|
||||||
|
.list();
|
||||||
|
for (Task task : list) {
|
||||||
|
System.out.println("流程实例id:" + task.getProcessInstanceId());
|
||||||
|
System.out.println("任务id:" + task.getId());
|
||||||
|
System.out.println("任务负责人:" + task.getAssignee());
|
||||||
|
System.out.println("任务名称:" + task.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,138 @@
|
|||||||
|
package com.atguigu.auth.activti;
|
||||||
|
|
||||||
|
import org.activiti.engine.HistoryService;
|
||||||
|
import org.activiti.engine.RepositoryService;
|
||||||
|
import org.activiti.engine.RuntimeService;
|
||||||
|
import org.activiti.engine.TaskService;
|
||||||
|
import org.activiti.engine.repository.Deployment;
|
||||||
|
import org.activiti.engine.runtime.ProcessInstance;
|
||||||
|
import org.activiti.engine.task.Task;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClassName: ProcessTestDome3
|
||||||
|
* Package: com.atguigu.auth.activti
|
||||||
|
*
|
||||||
|
* @author yovinchen
|
||||||
|
* @Create 2023/6/12 20:38
|
||||||
|
*/
|
||||||
|
@RunWith(SpringRunner.class)
|
||||||
|
@SpringBootTest
|
||||||
|
public class ProcessTestDome3 {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程定义
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private RepositoryService repositoryService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private RuntimeService runtimeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程任务
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private TaskService taskService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相关操作历史
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private HistoryService historyService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1.部署流程定义和启动流程实例
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void deployProcess03() {
|
||||||
|
// 流程部署
|
||||||
|
Deployment deploy = repositoryService.createDeployment().addClasspathResource("process/overtime04.bpmn20.xml").name("加班申请流程04").deploy();
|
||||||
|
System.out.println(deploy.getId());
|
||||||
|
System.out.println(deploy.getName());
|
||||||
|
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
// map.put("assignee1", "Lucy03");
|
||||||
|
// map.put("assignee2", "Mack01");
|
||||||
|
//创建流程实例,我们需要知道流程定义的key
|
||||||
|
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("overtime04", map);
|
||||||
|
//输出实例的相关信息
|
||||||
|
System.out.println("流程定义id:" + processInstance.getProcessDefinitionId());
|
||||||
|
System.out.println("流程实例id:" + processInstance.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2.查询组任务
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void findGroupTaskList() {
|
||||||
|
List<Task> list = taskService.createTaskQuery()
|
||||||
|
.taskCandidateUser("tom01")
|
||||||
|
.list();
|
||||||
|
for (Task task : list) {
|
||||||
|
System.out.println("----------------------------");
|
||||||
|
System.out.println("流程实例id:" + task.getProcessInstanceId());
|
||||||
|
System.out.println("任务id:" + task.getId());
|
||||||
|
System.out.println("任务负责人:" + task.getAssignee());
|
||||||
|
System.out.println("任务名称:" + task.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 3.拾取组任务
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void claimTask() {
|
||||||
|
//拾取任务,即使该用户不是候选人也能拾取(建议拾取时校验是否有资格)
|
||||||
|
//校验该用户有没有拾取任务的资格
|
||||||
|
Task task = taskService.createTaskQuery()
|
||||||
|
.taskCandidateUser("tom01")//根据候选人查询
|
||||||
|
.singleResult();
|
||||||
|
if (task != null) {
|
||||||
|
//拾取任务
|
||||||
|
taskService.claim(task.getId(), "tom01");
|
||||||
|
System.out.println("任务拾取成功");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 4.查询个人代办任务
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void findGroupPendingTaskList() {
|
||||||
|
//任务负责人
|
||||||
|
String assignee = "tom01";
|
||||||
|
List<Task> list = taskService.createTaskQuery()
|
||||||
|
.taskAssignee(assignee)//只查询该任务负责人的任务
|
||||||
|
.list();
|
||||||
|
for (Task task : list) {
|
||||||
|
System.out.println("流程实例id:" + task.getProcessInstanceId());
|
||||||
|
System.out.println("任务id:" + task.getId());
|
||||||
|
System.out.println("任务负责人:" + task.getAssignee());
|
||||||
|
System.out.println("任务名称:" + task.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5.办理个人任务
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void completGroupTask() {
|
||||||
|
Task task = taskService.createTaskQuery()
|
||||||
|
.taskAssignee("tom01") //要查询的负责人
|
||||||
|
.singleResult();//返回一条
|
||||||
|
taskService.complete(task.getId());
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package com.atguigu.auth.activti;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClassName: UserBean
|
||||||
|
* Package: com.atguigu.auth.activti
|
||||||
|
*
|
||||||
|
* @author yovinchen
|
||||||
|
* @Create 2023/6/12 14:52
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class UserBean {
|
||||||
|
|
||||||
|
public String getUsername(int id) {
|
||||||
|
if (id == 1) {
|
||||||
|
return "Mac";
|
||||||
|
}
|
||||||
|
if (id == 2) {
|
||||||
|
return "Lila";
|
||||||
|
}
|
||||||
|
return "admin";
|
||||||
|
}
|
||||||
|
}
|
@ -38,7 +38,7 @@ public class CodeGet {
|
|||||||
// 4、包配置
|
// 4、包配置
|
||||||
PackageConfig pc = new PackageConfig();
|
PackageConfig pc = new PackageConfig();
|
||||||
pc.setParent("com.atguigu");
|
pc.setParent("com.atguigu");
|
||||||
pc.setModuleName("auth"); //模块名
|
pc.setModuleName("process"); //模块名
|
||||||
pc.setController("controller");
|
pc.setController("controller");
|
||||||
pc.setService("service");
|
pc.setService("service");
|
||||||
pc.setMapper("mapper");
|
pc.setMapper("mapper");
|
||||||
@ -47,7 +47,7 @@ public class CodeGet {
|
|||||||
// 5、策略配置
|
// 5、策略配置
|
||||||
StrategyConfig strategy = new StrategyConfig();
|
StrategyConfig strategy = new StrategyConfig();
|
||||||
|
|
||||||
strategy.setInclude("sys_menu","sys_role_menu");
|
strategy.setInclude("oa_process_type","oa_process_template");
|
||||||
//数据库表映射到实体的命名策略
|
//数据库表映射到实体的命名策略
|
||||||
strategy.setNaming(NamingStrategy.underline_to_camel);
|
strategy.setNaming(NamingStrategy.underline_to_camel);
|
||||||
//数据库表字段映射到实体的命名策略
|
//数据库表字段映射到实体的命名策略
|
||||||
|
37
service-oa/src/test/java/com/atguigu/process/Test.java
Normal file
37
service-oa/src/test/java/com/atguigu/process/Test.java
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
package com.atguigu.process;
|
||||||
|
|
||||||
|
import com.atguigu.common.result.Result;
|
||||||
|
import com.atguigu.model.process.ProcessTemplate;
|
||||||
|
import com.atguigu.model.system.SysRole;
|
||||||
|
import com.atguigu.process.service.OaProcessTemplateService;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClassName: Test
|
||||||
|
* Package: com.atguigu.process
|
||||||
|
*
|
||||||
|
* @author yovinchen
|
||||||
|
* @Create 2023/6/15 18:32
|
||||||
|
*/
|
||||||
|
@SpringBootTest
|
||||||
|
public class Test {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private OaProcessTemplateService processTemplateService;
|
||||||
|
@org.junit.jupiter.api.Test
|
||||||
|
public void getPage() {
|
||||||
|
Page<ProcessTemplate> pageInfo = new Page<>(1, 10);
|
||||||
|
//分页查询审批模板,把审批类型对应名称查询
|
||||||
|
IPage<ProcessTemplate> pageModel =
|
||||||
|
processTemplateService.selectPageProcessTemplate(pageInfo);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user