Initial commit
This commit is contained in:
parent
5abe7e8e44
commit
39a3866312
@ -0,0 +1,48 @@
|
|||||||
|
package com.atguigu.process.controller.api;
|
||||||
|
|
||||||
|
import com.atguigu.common.result.Result;
|
||||||
|
import com.atguigu.model.process.ProcessType;
|
||||||
|
import com.atguigu.process.service.OaProcessTypeService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClassName: ProcessController
|
||||||
|
* Package: com.atguigu.process.controller.api
|
||||||
|
*
|
||||||
|
* @author yovinchen
|
||||||
|
* @Create 2023/6/22 18:24
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Api(tags = "审批流管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "/admin/process")
|
||||||
|
@CrossOrigin//跨域
|
||||||
|
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||||
|
public class ProcessController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private OaProcessTypeService oaProcessTypeService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有审批分类和每一个分类所有审批模版
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取全部审批分类及模板")
|
||||||
|
@GetMapping("findProcessType")
|
||||||
|
public Result findProcessType() {
|
||||||
|
List<ProcessType> list = oaProcessTypeService.findProcessType();
|
||||||
|
return Result.ok(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -25,4 +25,9 @@ public interface OaProcessService extends IService<Process> {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
IPage<ProcessVo> selectPage(Page<ProcessVo> pageParam, ProcessQueryVo processQueryVo);
|
IPage<ProcessVo> selectPage(Page<ProcessVo> pageParam, ProcessQueryVo processQueryVo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部署流程定义
|
||||||
|
*/
|
||||||
|
void deployByZip(String deployPath);
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,8 @@ package com.atguigu.process.service;
|
|||||||
import com.atguigu.model.process.ProcessType;
|
import com.atguigu.model.process.ProcessType;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 审批类型 服务类
|
* 审批类型 服务类
|
||||||
@ -13,4 +15,10 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||||||
*/
|
*/
|
||||||
public interface OaProcessTypeService extends IService<ProcessType> {
|
public interface OaProcessTypeService extends IService<ProcessType> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有审批分类和每一个分类所有审批模版
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<ProcessType> findProcessType();
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package com.atguigu.process.service.impl;
|
package com.atguigu.process.service.impl;
|
||||||
|
|
||||||
import com.atguigu.model.process.Process;
|
import com.atguigu.model.process.Process;
|
||||||
import com.atguigu.model.process.ProcessType;
|
|
||||||
import com.atguigu.process.mapper.OaProcessMapper;
|
import com.atguigu.process.mapper.OaProcessMapper;
|
||||||
import com.atguigu.process.service.OaProcessService;
|
import com.atguigu.process.service.OaProcessService;
|
||||||
import com.atguigu.vo.process.ProcessQueryVo;
|
import com.atguigu.vo.process.ProcessQueryVo;
|
||||||
@ -9,9 +8,14 @@ import com.atguigu.vo.process.ProcessVo;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.activiti.engine.RepositoryService;
|
||||||
|
import org.activiti.engine.repository.Deployment;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.util.zip.ZipInputStream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 审批类型 服务实现类
|
* 审批类型 服务实现类
|
||||||
@ -23,6 +27,10 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class OaProcessServiceImpl extends ServiceImpl<OaProcessMapper, Process> implements OaProcessService {
|
public class OaProcessServiceImpl extends ServiceImpl<OaProcessMapper, Process> implements OaProcessService {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RepositoryService repositoryService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取分页列表
|
* 获取分页列表
|
||||||
*
|
*
|
||||||
@ -36,4 +44,25 @@ public class OaProcessServiceImpl extends ServiceImpl<OaProcessMapper, Process>
|
|||||||
IPage<ProcessVo> pageModel = baseMapper.selectPage(pageParam, processQueryVo);
|
IPage<ProcessVo> pageModel = baseMapper.selectPage(pageParam, processQueryVo);
|
||||||
return pageModel;
|
return pageModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部署流程定义
|
||||||
|
*
|
||||||
|
* @param deployPath
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void deployByZip(String deployPath) {
|
||||||
|
// 定义zip输入流
|
||||||
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(deployPath);
|
||||||
|
ZipInputStream zipInputStream = null;
|
||||||
|
if (inputStream != null) {
|
||||||
|
zipInputStream = new ZipInputStream(inputStream);
|
||||||
|
}
|
||||||
|
// 流程部署
|
||||||
|
Deployment deployment = repositoryService.createDeployment().addZipInputStream(zipInputStream).deploy();
|
||||||
|
|
||||||
|
System.out.println("deployment.getId() = " + deployment.getId());
|
||||||
|
System.out.println("deployment.getName() = " + deployment.getName());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,13 +3,16 @@ package com.atguigu.process.service.impl;
|
|||||||
import com.atguigu.model.process.ProcessTemplate;
|
import com.atguigu.model.process.ProcessTemplate;
|
||||||
import com.atguigu.model.process.ProcessType;
|
import com.atguigu.model.process.ProcessType;
|
||||||
import com.atguigu.process.mapper.OaProcessTemplateMapper;
|
import com.atguigu.process.mapper.OaProcessTemplateMapper;
|
||||||
|
import com.atguigu.process.service.OaProcessService;
|
||||||
import com.atguigu.process.service.OaProcessTemplateService;
|
import com.atguigu.process.service.OaProcessTemplateService;
|
||||||
import com.atguigu.process.service.OaProcessTypeService;
|
import com.atguigu.process.service.OaProcessTypeService;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -30,6 +33,9 @@ public class OaProcessTemplateServiceImpl extends ServiceImpl<OaProcessTemplateM
|
|||||||
@Resource
|
@Resource
|
||||||
private OaProcessTypeService oaprocessTypeService;
|
private OaProcessTypeService oaprocessTypeService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private OaProcessService oaProcessService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询审批模板,把审批类型对应名称查询
|
* 分页查询审批模板,把审批类型对应名称查询
|
||||||
*
|
*
|
||||||
@ -70,6 +76,9 @@ public class OaProcessTemplateServiceImpl extends ServiceImpl<OaProcessTemplateM
|
|||||||
processTemplate.setStatus(1);
|
processTemplate.setStatus(1);
|
||||||
baseMapper.updateById(processTemplate);
|
baseMapper.updateById(processTemplate);
|
||||||
|
|
||||||
//TODO 部署流程定义,后续完善
|
//流程定义部署
|
||||||
|
if (StringUtils.isEmpty(processTemplate.getProcessDefinitionPath())) {
|
||||||
|
oaProcessService.deployByZip(processTemplate.getProcessDefinitionPath());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,8 @@ import com.atguigu.process.service.OaProcessTypeService;
|
|||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 审批类型 服务实现类
|
* 审批类型 服务实现类
|
||||||
@ -17,4 +19,16 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class OaProcessTypeServiceImpl extends ServiceImpl<OaProcessTypeMapper, ProcessType> implements OaProcessTypeService {
|
public class OaProcessTypeServiceImpl extends ServiceImpl<OaProcessTypeMapper, ProcessType> implements OaProcessTypeService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有审批分类和每一个分类所有审批模版
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<ProcessType> findProcessType() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,12 +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
|
url: jdbc:mysql://localhost:3306/guigu-oa?useSSL=false&useUnicode=true&characterEncoding=utf8&allowPublicKeyRetrieval=true
|
||||||
# username: root
|
username: root
|
||||||
# password: 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
|
||||||
|
Loading…
Reference in New Issue
Block a user