parent
71f0c8d575
commit
0f6ad79c8c
@ -1,196 +1,196 @@
|
||||
package com.ruoyi.file.utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.ruoyi.common.core.exception.file.FileNameLengthLimitExceededException;
|
||||
import com.ruoyi.common.core.exception.file.FileSizeLimitExceededException;
|
||||
import com.ruoyi.common.core.exception.file.InvalidExtensionException;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import com.ruoyi.common.core.utils.IdUtils;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.common.core.utils.file.MimeTypeUtils;
|
||||
|
||||
/**
|
||||
* 文件上传工具类
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class FileUploadUtils
|
||||
{
|
||||
/**
|
||||
* 默认大小 50M
|
||||
*/
|
||||
public static final long DEFAULT_MAX_SIZE = 50 * 1024 * 1024;
|
||||
|
||||
/**
|
||||
* 默认的文件名最大长度 100
|
||||
*/
|
||||
public static final int DEFAULT_FILE_NAME_LENGTH = 100;
|
||||
|
||||
/**
|
||||
* 根据文件路径上传
|
||||
*
|
||||
* @param baseDir 相对应用的基目录
|
||||
* @param file 上传的文件
|
||||
* @return 文件名称
|
||||
* @throws IOException
|
||||
*/
|
||||
public static final String upload(String baseDir, MultipartFile file) throws IOException
|
||||
{
|
||||
try
|
||||
{
|
||||
return upload(baseDir, file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new IOException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件上传
|
||||
*
|
||||
* @param baseDir 相对应用的基目录
|
||||
* @param file 上传的文件
|
||||
* @param allowedExtension 上传文件类型
|
||||
* @return 返回上传成功的文件名
|
||||
* @throws FileSizeLimitExceededException 如果超出最大大小
|
||||
* @throws FileNameLengthLimitExceededException 文件名太长
|
||||
* @throws IOException 比如读写文件出错时
|
||||
* @throws InvalidExtensionException 文件校验异常
|
||||
*/
|
||||
public static final String upload(String baseDir, MultipartFile file, String[] allowedExtension)
|
||||
throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException,
|
||||
InvalidExtensionException
|
||||
{
|
||||
int fileNamelength = file.getOriginalFilename().length();
|
||||
if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH)
|
||||
{
|
||||
throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH);
|
||||
}
|
||||
|
||||
assertAllowed(file, allowedExtension);
|
||||
|
||||
String fileName = extractFilename(file);
|
||||
|
||||
File desc = getAbsoluteFile(baseDir, fileName);
|
||||
file.transferTo(desc);
|
||||
String pathFileName = getPathFileName(fileName);
|
||||
return pathFileName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编码文件名
|
||||
*/
|
||||
public static final String extractFilename(MultipartFile file)
|
||||
{
|
||||
String fileName = file.getOriginalFilename();
|
||||
String extension = getExtension(file);
|
||||
fileName = DateUtils.datePath() + "/" + IdUtils.fastUUID() + "." + extension;
|
||||
return fileName;
|
||||
}
|
||||
|
||||
private static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException
|
||||
{
|
||||
File desc = new File(uploadDir + File.separator + fileName);
|
||||
|
||||
if (!desc.exists())
|
||||
{
|
||||
if (!desc.getParentFile().exists())
|
||||
{
|
||||
desc.getParentFile().mkdirs();
|
||||
}
|
||||
}
|
||||
return desc.isAbsolute() ? desc : desc.getAbsoluteFile();
|
||||
}
|
||||
|
||||
private static final String getPathFileName(String fileName) throws IOException
|
||||
{
|
||||
String pathFileName = "/" + fileName;
|
||||
return pathFileName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件大小校验
|
||||
*
|
||||
* @param file 上传的文件
|
||||
* @throws FileSizeLimitExceededException 如果超出最大大小
|
||||
* @throws InvalidExtensionException 文件校验异常
|
||||
*/
|
||||
public static final void assertAllowed(MultipartFile file, String[] allowedExtension)
|
||||
throws FileSizeLimitExceededException, InvalidExtensionException
|
||||
{
|
||||
long size = file.getSize();
|
||||
if (DEFAULT_MAX_SIZE != -1 && size > DEFAULT_MAX_SIZE)
|
||||
{
|
||||
throw new FileSizeLimitExceededException(DEFAULT_MAX_SIZE / 1024 / 1024);
|
||||
}
|
||||
|
||||
String fileName = file.getOriginalFilename();
|
||||
String extension = getExtension(file);
|
||||
if (allowedExtension != null && !isAllowedExtension(extension, allowedExtension))
|
||||
{
|
||||
if (allowedExtension == MimeTypeUtils.IMAGE_EXTENSION)
|
||||
{
|
||||
throw new InvalidExtensionException.InvalidImageExtensionException(allowedExtension, extension,
|
||||
fileName);
|
||||
}
|
||||
else if (allowedExtension == MimeTypeUtils.FLASH_EXTENSION)
|
||||
{
|
||||
throw new InvalidExtensionException.InvalidFlashExtensionException(allowedExtension, extension,
|
||||
fileName);
|
||||
}
|
||||
else if (allowedExtension == MimeTypeUtils.MEDIA_EXTENSION)
|
||||
{
|
||||
throw new InvalidExtensionException.InvalidMediaExtensionException(allowedExtension, extension,
|
||||
fileName);
|
||||
}
|
||||
else if (allowedExtension == MimeTypeUtils.VIDEO_EXTENSION)
|
||||
{
|
||||
throw new InvalidExtensionException.InvalidVideoExtensionException(allowedExtension, extension,
|
||||
fileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidExtensionException(allowedExtension, extension, fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断MIME类型是否是允许的MIME类型
|
||||
*
|
||||
* @param extension 上传文件类型
|
||||
* @param allowedExtension 允许上传文件类型
|
||||
* @return true/false
|
||||
*/
|
||||
public static final boolean isAllowedExtension(String extension, String[] allowedExtension)
|
||||
{
|
||||
for (String str : allowedExtension)
|
||||
{
|
||||
if (str.equalsIgnoreCase(extension))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件名的后缀
|
||||
*
|
||||
* @param file 表单文件
|
||||
* @return 后缀名
|
||||
*/
|
||||
public static final String getExtension(MultipartFile file)
|
||||
{
|
||||
String extension = FilenameUtils.getExtension(file.getOriginalFilename());
|
||||
if (StringUtils.isEmpty(extension))
|
||||
{
|
||||
extension = MimeTypeUtils.getExtension(file.getContentType());
|
||||
}
|
||||
return extension;
|
||||
}
|
||||
}
|
||||
package com.ruoyi.common.core.utils.file;
|
||||
|
||||
import com.ruoyi.common.core.exception.file.FileNameLengthLimitExceededException;
|
||||
import com.ruoyi.common.core.exception.file.FileSizeLimitExceededException;
|
||||
import com.ruoyi.common.core.exception.file.InvalidExtensionException;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import com.ruoyi.common.core.utils.IdUtils;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 文件上传工具类
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class FileUploadUtils
|
||||
{
|
||||
/**
|
||||
* 默认大小 50M
|
||||
*/
|
||||
public static final long DEFAULT_MAX_SIZE = 50 * 1024 * 1024;
|
||||
|
||||
/**
|
||||
* 默认的文件名最大长度 100
|
||||
*/
|
||||
public static final int DEFAULT_FILE_NAME_LENGTH = 100;
|
||||
|
||||
/**
|
||||
* 根据文件路径上传
|
||||
*
|
||||
* @param baseDir 相对应用的基目录
|
||||
* @param file 上传的文件
|
||||
* @return 文件名称
|
||||
* @throws IOException
|
||||
*/
|
||||
public static final String upload(String baseDir, MultipartFile file) throws IOException
|
||||
{
|
||||
try
|
||||
{
|
||||
return upload(baseDir, file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new IOException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件上传
|
||||
*
|
||||
* @param baseDir 相对应用的基目录
|
||||
* @param file 上传的文件
|
||||
* @param allowedExtension 上传文件类型
|
||||
* @return 返回上传成功的文件名
|
||||
* @throws FileSizeLimitExceededException 如果超出最大大小
|
||||
* @throws FileNameLengthLimitExceededException 文件名太长
|
||||
* @throws IOException 比如读写文件出错时
|
||||
* @throws InvalidExtensionException 文件校验异常
|
||||
*/
|
||||
public static final String upload(String baseDir, MultipartFile file, String[] allowedExtension)
|
||||
throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException,
|
||||
InvalidExtensionException
|
||||
{
|
||||
int fileNamelength = file.getOriginalFilename().length();
|
||||
if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH)
|
||||
{
|
||||
throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH);
|
||||
}
|
||||
|
||||
assertAllowed(file, allowedExtension);
|
||||
|
||||
String fileName = extractFilename(file);
|
||||
|
||||
File desc = getAbsoluteFile(baseDir, fileName);
|
||||
file.transferTo(desc);
|
||||
String pathFileName = getPathFileName(fileName);
|
||||
return pathFileName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编码文件名
|
||||
*/
|
||||
public static final String extractFilename(MultipartFile file)
|
||||
{
|
||||
String fileName = file.getOriginalFilename();
|
||||
String extension = getExtension(file);
|
||||
fileName = DateUtils.datePath() + "/" + IdUtils.fastUUID() + "." + extension;
|
||||
return fileName;
|
||||
}
|
||||
|
||||
private static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException
|
||||
{
|
||||
File desc = new File(uploadDir + File.separator + fileName);
|
||||
|
||||
if (!desc.exists())
|
||||
{
|
||||
if (!desc.getParentFile().exists())
|
||||
{
|
||||
desc.getParentFile().mkdirs();
|
||||
}
|
||||
}
|
||||
return desc.isAbsolute() ? desc : desc.getAbsoluteFile();
|
||||
}
|
||||
|
||||
private static final String getPathFileName(String fileName) throws IOException
|
||||
{
|
||||
String pathFileName = "/" + fileName;
|
||||
return pathFileName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件大小校验
|
||||
*
|
||||
* @param file 上传的文件
|
||||
* @throws FileSizeLimitExceededException 如果超出最大大小
|
||||
* @throws InvalidExtensionException 文件校验异常
|
||||
*/
|
||||
public static final void assertAllowed(MultipartFile file, String[] allowedExtension)
|
||||
throws FileSizeLimitExceededException, InvalidExtensionException
|
||||
{
|
||||
long size = file.getSize();
|
||||
if (DEFAULT_MAX_SIZE != -1 && size > DEFAULT_MAX_SIZE)
|
||||
{
|
||||
throw new FileSizeLimitExceededException(DEFAULT_MAX_SIZE / 1024 / 1024);
|
||||
}
|
||||
|
||||
String fileName = file.getOriginalFilename();
|
||||
String extension = getExtension(file);
|
||||
if (allowedExtension != null && !isAllowedExtension(extension, allowedExtension))
|
||||
{
|
||||
if (allowedExtension == MimeTypeUtils.IMAGE_EXTENSION)
|
||||
{
|
||||
throw new InvalidExtensionException.InvalidImageExtensionException(allowedExtension, extension,
|
||||
fileName);
|
||||
}
|
||||
else if (allowedExtension == MimeTypeUtils.FLASH_EXTENSION)
|
||||
{
|
||||
throw new InvalidExtensionException.InvalidFlashExtensionException(allowedExtension, extension,
|
||||
fileName);
|
||||
}
|
||||
else if (allowedExtension == MimeTypeUtils.MEDIA_EXTENSION)
|
||||
{
|
||||
throw new InvalidExtensionException.InvalidMediaExtensionException(allowedExtension, extension,
|
||||
fileName);
|
||||
}
|
||||
else if (allowedExtension == MimeTypeUtils.VIDEO_EXTENSION)
|
||||
{
|
||||
throw new InvalidExtensionException.InvalidVideoExtensionException(allowedExtension, extension,
|
||||
fileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidExtensionException(allowedExtension, extension, fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断MIME类型是否是允许的MIME类型
|
||||
*
|
||||
* @param extension 上传文件类型
|
||||
* @param allowedExtension 允许上传文件类型
|
||||
* @return true/false
|
||||
*/
|
||||
public static final boolean isAllowedExtension(String extension, String[] allowedExtension)
|
||||
{
|
||||
for (String str : allowedExtension)
|
||||
{
|
||||
if (str.equalsIgnoreCase(extension))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件名的后缀
|
||||
*
|
||||
* @param file 表单文件
|
||||
* @return 后缀名
|
||||
*/
|
||||
public static final String getExtension(MultipartFile file)
|
||||
{
|
||||
String extension = FilenameUtils.getExtension(file.getOriginalFilename());
|
||||
if (StringUtils.isEmpty(extension))
|
||||
{
|
||||
extension = MimeTypeUtils.getExtension(file.getContentType());
|
||||
}
|
||||
return extension;
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.xjs.activiti.controller;
|
||||
|
||||
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.xjs.activiti.domain.dto.ActivitiHighLineDTO;
|
||||
import com.xjs.activiti.service.IActivitiHistoryService;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/activitiHistory")
|
||||
@Api(tags = "工作流-历史流程")
|
||||
public class ActivitiHistoryController {
|
||||
|
||||
@Autowired
|
||||
private IActivitiHistoryService activitiHistoryService;
|
||||
|
||||
//流程图高亮
|
||||
@GetMapping("/gethighLine")
|
||||
public AjaxResult gethighLine(@RequestParam("instanceId") String instanceId) {
|
||||
|
||||
ActivitiHighLineDTO activitiHighLineDTO = activitiHistoryService.gethighLine(instanceId);
|
||||
return AjaxResult.success(activitiHighLineDTO);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.xjs.activiti.controller;
|
||||
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.xjs.activiti.service.IFormHistoryDataService;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@Api(tags = "工作流-历史表格数据")
|
||||
@RequestMapping("/historyFromData")
|
||||
public class HistoryFormDataCoroller {
|
||||
@Autowired
|
||||
private IFormHistoryDataService formHistoryDataService;
|
||||
|
||||
@GetMapping(value = "/ByInstanceId/{instanceId}")
|
||||
public AjaxResult historyFromData(@PathVariable("instanceId") String instanceId) {
|
||||
return AjaxResult.success(formHistoryDataService.historyDataShow(instanceId));
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,143 @@
|
||||
package com.xjs.activiti.controller;
|
||||
|
||||
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.PageDomain;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.web.page.TableSupport;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.xjs.activiti.domain.dto.ProcessDefinitionDTO;
|
||||
import com.xjs.activiti.service.IProcessDefinitionService;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/processDefinition")
|
||||
@Api(tags = "工作流-流程定义")
|
||||
public class ProcessDefinitionController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IProcessDefinitionService processDefinitionService;
|
||||
|
||||
|
||||
/**
|
||||
* 获取流程定义集合
|
||||
*
|
||||
* @param processDefinition
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/list")
|
||||
public TableDataInfo list(ProcessDefinitionDTO processDefinition) {
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
return getDataTable(processDefinitionService.selectProcessDefinitionList(processDefinition, pageDomain));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/getDefinitions/{instanceId}")
|
||||
public AjaxResult getDefinitionsByInstanceId(@PathVariable("instanceId") String instanceId) {
|
||||
return AjaxResult.success(processDefinitionService.getDefinitionsByInstanceId(instanceId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除流程定义
|
||||
*
|
||||
* @param deploymentId
|
||||
* @return
|
||||
*/
|
||||
@Log(title = "流程定义管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping(value = "/remove/{deploymentId}")
|
||||
public AjaxResult delDefinition(@PathVariable("deploymentId") String deploymentId) {
|
||||
return toAjax(processDefinitionService.deleteProcessDefinitionById(deploymentId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传并部署流程定义
|
||||
*
|
||||
* @param file
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
@Log(title = "流程定义管理", businessType = BusinessType.IMPORT)
|
||||
@PostMapping(value = "/uploadStreamAndDeployment")
|
||||
public AjaxResult uploadStreamAndDeployment(@RequestParam("file") MultipartFile file) throws IOException {
|
||||
processDefinitionService.uploadStreamAndDeployment(file);
|
||||
return AjaxResult.success();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 启动挂起流程流程定义
|
||||
*
|
||||
* @param processDefinition
|
||||
* @return
|
||||
*/
|
||||
@Log(title = "流程定义管理", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/suspendOrActiveApply")
|
||||
@ResponseBody
|
||||
public AjaxResult suspendOrActiveApply(@RequestBody ProcessDefinitionDTO processDefinition) {
|
||||
processDefinitionService.suspendOrActiveApply(processDefinition.getId(), processDefinition.getSuspendState());
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传流程流程定义
|
||||
*
|
||||
* @param multipartFile
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
@Log(title = "流程定义管理", businessType = BusinessType.IMPORT)
|
||||
@PostMapping(value = "/upload")
|
||||
public AjaxResult upload(@RequestParam("processFile") MultipartFile multipartFile) throws IOException {
|
||||
|
||||
if (!multipartFile.isEmpty()) {
|
||||
String fileName = processDefinitionService.upload(multipartFile);
|
||||
return AjaxResult.success("操作成功", fileName);
|
||||
|
||||
}
|
||||
return AjaxResult.error("不允许上传空文件!");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过stringBPMN添加流程定义
|
||||
*
|
||||
* @param stringBPMN
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/addDeploymentByString")
|
||||
public AjaxResult addDeploymentByString(@RequestParam("stringBPMN") String stringBPMN) {
|
||||
processDefinitionService.addDeploymentByString(stringBPMN);
|
||||
return AjaxResult.success();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取流程定义XML
|
||||
*
|
||||
* @param response
|
||||
* @param deploymentId
|
||||
* @param resourceName
|
||||
*/
|
||||
@GetMapping(value = "/getDefinitionXML")
|
||||
public void getProcessDefineXML(HttpServletResponse response,
|
||||
@RequestParam("deploymentId") String deploymentId,
|
||||
@RequestParam("resourceName") String resourceName) throws IOException {
|
||||
|
||||
processDefinitionService.getProcessDefineXML(response, deploymentId, resourceName);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package com.xjs.activiti.controller;
|
||||
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.PageDomain;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.web.page.TableSupport;
|
||||
import com.xjs.activiti.domain.dto.ActTaskDTO;
|
||||
import com.xjs.activiti.domain.dto.ActWorkflowFormDataDTO;
|
||||
import com.xjs.activiti.service.IActTaskService;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/task")
|
||||
@Api(tags = "工作流-任务流程")
|
||||
public class TaskController extends BaseController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private IActTaskService actTaskService;
|
||||
|
||||
|
||||
//获取我的代办任务
|
||||
@GetMapping(value = "/list")
|
||||
public TableDataInfo getTasks() {
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
Page<ActTaskDTO> hashMaps = actTaskService.selectProcessDefinitionList(pageDomain);
|
||||
return getDataTable(hashMaps);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//渲染表单
|
||||
@GetMapping(value = "/formDataShow/{taskID}")
|
||||
public AjaxResult formDataShow(@PathVariable("taskID") String taskID) {
|
||||
|
||||
return AjaxResult.success(actTaskService.formDataShow(taskID));
|
||||
}
|
||||
|
||||
//保存表单
|
||||
@PostMapping(value = "/formDataSave/{taskID}")
|
||||
public AjaxResult formDataSave(@PathVariable("taskID") String taskID,
|
||||
@RequestBody List<ActWorkflowFormDataDTO> formData) throws ParseException {
|
||||
return toAjax(actTaskService.formDataSave(taskID, formData));
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,149 @@
|
||||
package com.xjs.activiti.domain;
|
||||
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
import com.xjs.activiti.domain.dto.ActWorkflowFormDataDTO;
|
||||
import org.activiti.api.task.model.Task;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 动态单对象 act_workflow_formdata
|
||||
*
|
||||
* @author xiejs
|
||||
* @since 2022-04-17 02:07:29
|
||||
*/
|
||||
public class ActWorkflowFormData extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 唯一标识符
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 事务Id
|
||||
*/
|
||||
private String businessKey;
|
||||
|
||||
/**
|
||||
* 表单Key
|
||||
*/
|
||||
private String formKey;
|
||||
|
||||
|
||||
/**
|
||||
* 表单id
|
||||
*/
|
||||
private String controlId;
|
||||
/**
|
||||
* 表单名称
|
||||
*/
|
||||
private String controlName;
|
||||
|
||||
/**
|
||||
* 表单值
|
||||
*/
|
||||
private String controlValue;
|
||||
|
||||
/**
|
||||
* 任务节点名称
|
||||
*/
|
||||
private String taskNodeName;
|
||||
|
||||
private String createName;
|
||||
|
||||
public ActWorkflowFormData() {
|
||||
}
|
||||
|
||||
public ActWorkflowFormData(String businessKey, ActWorkflowFormDataDTO actWorkflowFormDataDTO, Task task) {
|
||||
this.businessKey = businessKey;
|
||||
this.formKey = task.getFormKey();
|
||||
this.controlId = actWorkflowFormDataDTO.getControlId();
|
||||
this.controlName = actWorkflowFormDataDTO.getControlLable();
|
||||
if ("radio".equals(actWorkflowFormDataDTO.getControlType())) {
|
||||
int i = Integer.parseInt(actWorkflowFormDataDTO.getControlValue());
|
||||
this.controlValue = actWorkflowFormDataDTO.getControlDefault().split("--__--")[i];
|
||||
} else {
|
||||
this.controlValue = actWorkflowFormDataDTO.getControlValue();
|
||||
}
|
||||
this.taskNodeName = task.getName();
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getBusinessKey() {
|
||||
return businessKey;
|
||||
}
|
||||
|
||||
public void setBusinessKey(String businessKey) {
|
||||
this.businessKey = businessKey;
|
||||
}
|
||||
|
||||
public void setFormKey(String formKey) {
|
||||
this.formKey = formKey;
|
||||
}
|
||||
|
||||
public String getFormKey() {
|
||||
return formKey;
|
||||
}
|
||||
|
||||
public void setControlId(String controlId) {
|
||||
this.controlId = controlId;
|
||||
}
|
||||
|
||||
public String getControlId() {
|
||||
return controlId;
|
||||
}
|
||||
|
||||
public String getControlName() {
|
||||
return controlName;
|
||||
}
|
||||
|
||||
public void setControlName(String controlName) {
|
||||
this.controlName = controlName;
|
||||
}
|
||||
|
||||
public void setControlValue(String controlValue) {
|
||||
this.controlValue = controlValue;
|
||||
}
|
||||
|
||||
public String getControlValue() {
|
||||
return controlValue;
|
||||
}
|
||||
|
||||
public void setTaskNodeName(String taskNodeName) {
|
||||
this.taskNodeName = taskNodeName;
|
||||
}
|
||||
|
||||
public String getTaskNodeName() {
|
||||
return taskNodeName;
|
||||
}
|
||||
|
||||
public String getCreateName() {
|
||||
return createName;
|
||||
}
|
||||
|
||||
public void setCreateName(String createName) {
|
||||
this.createName = createName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("procInstId", getBusinessKey())
|
||||
.append("formKey", getFormKey())
|
||||
.append("controlId", getControlId())
|
||||
.append("controlValue", getControlValue())
|
||||
.append("taskNodeName", getTaskNodeName())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
package com.xjs.activiti.domain.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
import org.activiti.api.task.model.Task;
|
||||
import org.activiti.engine.runtime.ProcessInstance;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* act任务dto
|
||||
* @author xiejs
|
||||
* @since 2022-04-17 02:08:24
|
||||
*/
|
||||
public class ActTaskDTO extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String id;
|
||||
|
||||
private String name;
|
||||
|
||||
private String status;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdDate;
|
||||
private String instanceName;
|
||||
private String definitionKey;
|
||||
private String businessKey;
|
||||
|
||||
public ActTaskDTO() {
|
||||
}
|
||||
|
||||
public ActTaskDTO(Task task, ProcessInstance processInstance) {
|
||||
this.id = task.getId();
|
||||
this.name = task.getName();
|
||||
this.status = task.getStatus().toString();
|
||||
this.createdDate = task.getCreatedDate();
|
||||
this.instanceName = processInstance.getName();
|
||||
this.definitionKey = processInstance.getProcessDefinitionKey();
|
||||
this.businessKey = processInstance.getBusinessKey();
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Date getCreatedDate() {
|
||||
return createdDate;
|
||||
}
|
||||
|
||||
public void setCreatedDate(Date createdDate) {
|
||||
this.createdDate = createdDate;
|
||||
}
|
||||
|
||||
public String getInstanceName() {
|
||||
return instanceName;
|
||||
}
|
||||
|
||||
public void setInstanceName(String instanceName) {
|
||||
this.instanceName = instanceName;
|
||||
}
|
||||
|
||||
public String getDefinitionKey() {
|
||||
return definitionKey;
|
||||
}
|
||||
|
||||
public void setDefinitionKey(String definitionKey) {
|
||||
this.definitionKey = definitionKey;
|
||||
}
|
||||
|
||||
public String getBusinessKey() {
|
||||
return businessKey;
|
||||
}
|
||||
|
||||
public void setBusinessKey(String businessKey) {
|
||||
this.businessKey = businessKey;
|
||||
}
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
package com.xjs.activiti.domain.dto;
|
||||
|
||||
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 动态单对象 act_workflow_formdata
|
||||
*
|
||||
* @author xiejs
|
||||
* @since 2022-04-17 02:08:45
|
||||
*/
|
||||
public class ActWorkflowFormDataDTO extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**
|
||||
* 表单id
|
||||
*/
|
||||
private String controlId;
|
||||
private String controlType;
|
||||
|
||||
|
||||
/**
|
||||
* 表单名称
|
||||
*/
|
||||
private String controlLable;
|
||||
|
||||
private String controlIsParam;
|
||||
|
||||
/**
|
||||
* 表单值
|
||||
*/
|
||||
private String controlValue;
|
||||
private String controlDefault;
|
||||
|
||||
|
||||
public void setControlId(String controlId) {
|
||||
this.controlId = controlId;
|
||||
}
|
||||
|
||||
public String getControlId() {
|
||||
return controlId;
|
||||
}
|
||||
|
||||
public void setControlValue(String controlValue) {
|
||||
this.controlValue = controlValue;
|
||||
}
|
||||
|
||||
public String getControlValue() {
|
||||
return controlValue;
|
||||
}
|
||||
|
||||
|
||||
public String getControlIsParam() {
|
||||
return controlIsParam;
|
||||
}
|
||||
|
||||
public void setControlIsParam(String controlIsParam) {
|
||||
this.controlIsParam = controlIsParam;
|
||||
}
|
||||
|
||||
public String getControlLable() {
|
||||
return controlLable;
|
||||
}
|
||||
|
||||
public void setControlLable(String controlLable) {
|
||||
this.controlLable = controlLable;
|
||||
}
|
||||
|
||||
public String getControlDefault() {
|
||||
return controlDefault;
|
||||
}
|
||||
|
||||
public void setControlDefault(String controlDefault) {
|
||||
this.controlDefault = controlDefault;
|
||||
}
|
||||
|
||||
public String getControlType() {
|
||||
return controlType;
|
||||
}
|
||||
|
||||
public void setControlType(String controlType) {
|
||||
this.controlType = controlType;
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package com.xjs.activiti.domain.dto;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* act 高亮dto
|
||||
*
|
||||
* @author xiejs
|
||||
* @since 2022-04-17 02:07:58
|
||||
*/
|
||||
public class ActivitiHighLineDTO {
|
||||
private Set<String> highPoint;
|
||||
private Set<String> highLine;
|
||||
private Set<String> waitingToDo;
|
||||
private Set<String> iDo;
|
||||
|
||||
public Set<String> getHighPoint() {
|
||||
return highPoint;
|
||||
}
|
||||
|
||||
public void setHighPoint(Set<String> highPoint) {
|
||||
this.highPoint = highPoint;
|
||||
}
|
||||
|
||||
public Set<String> getHighLine() {
|
||||
return highLine;
|
||||
}
|
||||
|
||||
public void setHighLine(Set<String> highLine) {
|
||||
this.highLine = highLine;
|
||||
}
|
||||
|
||||
public Set<String> getWaitingToDo() {
|
||||
return waitingToDo;
|
||||
}
|
||||
|
||||
public void setWaitingToDo(Set<String> waitingToDo) {
|
||||
this.waitingToDo = waitingToDo;
|
||||
}
|
||||
|
||||
public Set<String> getiDo() {
|
||||
return iDo;
|
||||
}
|
||||
|
||||
public void setiDo(Set<String> iDo) {
|
||||
this.iDo = iDo;
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.xjs.activiti.domain.dto;
|
||||
|
||||
import org.activiti.engine.repository.ProcessDefinition;
|
||||
|
||||
/**
|
||||
* act定义对象id dto
|
||||
* @author xiejs
|
||||
* @since 2022-04-17 02:09:10
|
||||
*/
|
||||
public class DefinitionIdDTO {
|
||||
private String deploymentID;
|
||||
private String resourceName;
|
||||
|
||||
public String getDeploymentID() {
|
||||
return deploymentID;
|
||||
}
|
||||
|
||||
public void setDeploymentID(String deploymentID) {
|
||||
this.deploymentID = deploymentID;
|
||||
}
|
||||
|
||||
public String getResourceName() {
|
||||
return resourceName;
|
||||
}
|
||||
|
||||
public void setResourceName(String resourceName) {
|
||||
this.resourceName = resourceName;
|
||||
}
|
||||
|
||||
public DefinitionIdDTO() {
|
||||
}
|
||||
|
||||
public DefinitionIdDTO(ProcessDefinition processDefinition) {
|
||||
this.deploymentID = processDefinition.getDeploymentId();
|
||||
this.resourceName = processDefinition.getResourceName();
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package com.xjs.activiti.domain.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* act历史数据dto
|
||||
*
|
||||
* @author xiejs
|
||||
* @since 2022-04-17 02:09:28
|
||||
*/
|
||||
public class HistoryDataDTO {
|
||||
private String taskNodeName;
|
||||
private String createName;
|
||||
private String createdDate;
|
||||
private List<HistoryFormDataDTO> formHistoryDataDTO;
|
||||
|
||||
|
||||
public String getTaskNodeName() {
|
||||
return taskNodeName;
|
||||
}
|
||||
|
||||
public void setTaskNodeName(String taskNodeName) {
|
||||
this.taskNodeName = taskNodeName;
|
||||
}
|
||||
|
||||
public String getCreateName() {
|
||||
return createName;
|
||||
}
|
||||
|
||||
public void setCreateName(String createName) {
|
||||
this.createName = createName;
|
||||
}
|
||||
|
||||
public String getCreatedDate() {
|
||||
return createdDate;
|
||||
}
|
||||
|
||||
public void setCreatedDate(String createdDate) {
|
||||
this.createdDate = createdDate;
|
||||
}
|
||||
|
||||
public List<HistoryFormDataDTO> getFormHistoryDataDTO() {
|
||||
return formHistoryDataDTO;
|
||||
}
|
||||
|
||||
public void setFormHistoryDataDTO(List<HistoryFormDataDTO> formHistoryDataDTO) {
|
||||
this.formHistoryDataDTO = formHistoryDataDTO;
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.xjs.activiti.domain.dto;
|
||||
|
||||
/**
|
||||
* 历史表格数据 DTO
|
||||
*
|
||||
* @author xiejs
|
||||
* @since 2022-04-17 02:09:41
|
||||
*/
|
||||
public class HistoryFormDataDTO {
|
||||
private String title;
|
||||
private String value;
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public HistoryFormDataDTO() {
|
||||
}
|
||||
|
||||
public HistoryFormDataDTO(String title, String value) {
|
||||
this.title = title;
|
||||
this.value = value;
|
||||
}
|
||||
}
|
@ -0,0 +1,118 @@
|
||||
package com.xjs.activiti.domain.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
import com.xjs.activiti.domain.vo.ActReDeploymentVO;
|
||||
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntityImpl;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* act流程定义dto
|
||||
*
|
||||
* @author xiejs
|
||||
* @since 2022-04-17 02:10:06
|
||||
*/
|
||||
public class ProcessDefinitionDTO extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String id;
|
||||
|
||||
private String name;
|
||||
|
||||
private String key;
|
||||
|
||||
private int version;
|
||||
|
||||
private String deploymentId;
|
||||
private String resourceName;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date deploymentTime;
|
||||
|
||||
|
||||
/**
|
||||
* 流程实例状态 1 激活 2 挂起
|
||||
*/
|
||||
private Integer suspendState;
|
||||
|
||||
public ProcessDefinitionDTO() {
|
||||
}
|
||||
|
||||
public ProcessDefinitionDTO(ProcessDefinitionEntityImpl processDefinition, ActReDeploymentVO actReDeploymentVO) {
|
||||
this.id = processDefinition.getId();
|
||||
this.name = processDefinition.getName();
|
||||
this.key = processDefinition.getKey();
|
||||
this.version = processDefinition.getVersion();
|
||||
this.deploymentId = processDefinition.getDeploymentId();
|
||||
this.resourceName = processDefinition.getResourceName();
|
||||
this.deploymentTime = actReDeploymentVO.getDeployTime();
|
||||
this.suspendState = processDefinition.getSuspensionState();
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getResourceName() {
|
||||
return resourceName;
|
||||
}
|
||||
|
||||
public void setResourceName(String resourceName) {
|
||||
this.resourceName = resourceName;
|
||||
}
|
||||
|
||||
public int getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(int version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
|
||||
public String getDeploymentId() {
|
||||
return deploymentId;
|
||||
}
|
||||
|
||||
public void setDeploymentId(String deploymentId) {
|
||||
this.deploymentId = deploymentId;
|
||||
}
|
||||
|
||||
public Date getDeploymentTime() {
|
||||
return deploymentTime;
|
||||
}
|
||||
|
||||
public void setDeploymentTime(Date deploymentTime) {
|
||||
this.deploymentTime = deploymentTime;
|
||||
}
|
||||
|
||||
|
||||
public Integer getSuspendState() {
|
||||
return suspendState;
|
||||
}
|
||||
|
||||
public void setSuspendState(Integer suspendState) {
|
||||
this.suspendState = suspendState;
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.xjs.activiti.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* Act部署vo
|
||||
* @author xiejs
|
||||
* @since 2022-04-17 02:07:39
|
||||
*/
|
||||
public class ActReDeploymentVO {
|
||||
private String id;
|
||||
private Date deployTime;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Date getDeployTime() {
|
||||
return deployTime;
|
||||
}
|
||||
|
||||
public void setDeployTime(Date deployTime) {
|
||||
this.deployTime = deployTime;
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.xjs.activiti.mapper;
|
||||
|
||||
import com.xjs.activiti.domain.vo.ActReDeploymentVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* act部署Mapper
|
||||
*
|
||||
* @author xiejs
|
||||
* @since 2022-04-17 01:47:24
|
||||
*/
|
||||
public interface ActReDeploymentMapper {
|
||||
|
||||
/**
|
||||
* 根据id s批量查询部署信息
|
||||
* @param ids 部署ids
|
||||
* @return list
|
||||
*/
|
||||
List<ActReDeploymentVO> selectActReDeploymentByIds(@Param("ids") Set<String> ids);
|
||||
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
package com.xjs.activiti.mapper;
|
||||
|
||||
import com.xjs.activiti.domain.ActWorkflowFormData;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 动态单Mapper接口
|
||||
*
|
||||
* @author xiejs
|
||||
* @date 2022-04-17 01:48:08
|
||||
*/
|
||||
public interface ActWorkflowFormDataMapper
|
||||
{
|
||||
/**
|
||||
* 查询动态单
|
||||
*
|
||||
* @param id 动态单ID
|
||||
* @return 动态单
|
||||
*/
|
||||
public ActWorkflowFormData selectActWorkflowFormDataById(Long id);
|
||||
/**
|
||||
* 查询动态单
|
||||
*
|
||||
* @param businessKey 动态单ID
|
||||
* @return 动态单
|
||||
*/
|
||||
public List<ActWorkflowFormData> selectActWorkflowFormDataByBusinessKey(String businessKey);
|
||||
|
||||
/**
|
||||
* 查询动态单列表
|
||||
*
|
||||
* @param ActWorkflowFormData 动态单
|
||||
* @return 动态单集合
|
||||
*/
|
||||
public List<ActWorkflowFormData> selectActWorkflowFormDataList(ActWorkflowFormData ActWorkflowFormData);
|
||||
|
||||
/**
|
||||
* 新增动态单
|
||||
*
|
||||
* @param ActWorkflowFormData 动态单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertActWorkflowFormData(ActWorkflowFormData ActWorkflowFormData);
|
||||
|
||||
|
||||
/**
|
||||
* 新增动态单
|
||||
*
|
||||
* @param
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertActWorkflowFormDatas(@Param("createBy") String createBy, @Param("ActWorkflowFormData")List<ActWorkflowFormData> ActWorkflowFormData, Date date ,String createName);
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 修改动态单
|
||||
*
|
||||
* @param ActWorkflowFormData 动态单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateActWorkflowFormData(ActWorkflowFormData ActWorkflowFormData);
|
||||
|
||||
/**
|
||||
* 删除动态单
|
||||
*
|
||||
* @param id 动态单ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteActWorkflowFormDataById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除动态单
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteActWorkflowFormDataByIds(Long[] ids);
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.xjs.activiti.service;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import com.ruoyi.common.core.web.page.PageDomain;
|
||||
import com.xjs.activiti.domain.dto.ActTaskDTO;
|
||||
import com.xjs.activiti.domain.dto.ActWorkflowFormDataDTO;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Activiti任务服务接口
|
||||
*
|
||||
* @author xiejs
|
||||
* @since 2022-04-17 01:54:51
|
||||
*/
|
||||
public interface IActTaskService {
|
||||
|
||||
/**
|
||||
* 查询流程定义列表
|
||||
* @param pageDomain 分页参数
|
||||
* @return
|
||||
*/
|
||||
Page<ActTaskDTO> selectProcessDefinitionList(PageDomain pageDomain);
|
||||
|
||||
/**
|
||||
* 根据任务id查询表格数据
|
||||
*
|
||||
* @param taskID 任务id
|
||||
* @return list
|
||||
*/
|
||||
List<String> formDataShow(String taskID);
|
||||
|
||||
|
||||
/**
|
||||
* 表格数据保存
|
||||
* @param taskID 任务id
|
||||
* @param awfs
|
||||
* @return
|
||||
* @throws ParseException
|
||||
*/
|
||||
int formDataSave(String taskID, List<ActWorkflowFormDataDTO> awfs) throws ParseException;
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package com.xjs.activiti.service;
|
||||
|
||||
|
||||
import com.xjs.activiti.domain.ActWorkflowFormData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 动态单Service接口
|
||||
*
|
||||
* @author xiejs
|
||||
* @since 2022-04-17 01:49:39
|
||||
*/
|
||||
public interface IActWorkflowFormDataService {
|
||||
/**
|
||||
* 查询动态单
|
||||
*
|
||||
* @param id 动态单ID
|
||||
* @return 动态单
|
||||
*/
|
||||
ActWorkflowFormData selectActWorkflowFormDataById(Long id);
|
||||
|
||||
List<ActWorkflowFormData> selectActWorkflowFormDataByBusinessKey(String businessKey);
|
||||
|
||||
/**
|
||||
* 查询动态单列表
|
||||
*
|
||||
* @param ActWorkflowFormData 动态单
|
||||
* @return 动态单集合
|
||||
*/
|
||||
List<ActWorkflowFormData> selectActWorkflowFormDataList(ActWorkflowFormData ActWorkflowFormData);
|
||||
|
||||
/**
|
||||
* 新增动态单
|
||||
*
|
||||
* @param ActWorkflowFormData 动态单
|
||||
* @return 结果
|
||||
*/
|
||||
int insertActWorkflowFormData(ActWorkflowFormData ActWorkflowFormData);
|
||||
|
||||
/**
|
||||
* 新增动态单集合
|
||||
*
|
||||
* @param ActWorkflowFormDatas 动态表单集合
|
||||
* @return
|
||||
*/
|
||||
int insertActWorkflowFormDatas(List<ActWorkflowFormData> ActWorkflowFormDatas);
|
||||
|
||||
/**
|
||||
* 修改动态单
|
||||
*
|
||||
* @param ActWorkflowFormData 动态单
|
||||
* @return 结果
|
||||
*/
|
||||
int updateActWorkflowFormData(ActWorkflowFormData ActWorkflowFormData);
|
||||
|
||||
/**
|
||||
* 批量删除动态单
|
||||
*
|
||||
* @param ids 需要删除的动态单ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteActWorkflowFormDataByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除动态单信息
|
||||
*
|
||||
* @param id 动态单ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteActWorkflowFormDataById(Long id);
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.xjs.activiti.service;
|
||||
|
||||
|
||||
import com.xjs.activiti.domain.dto.ActivitiHighLineDTO;
|
||||
|
||||
/**
|
||||
* Activiti历史任务服务接口
|
||||
*
|
||||
* @author xiejs
|
||||
* @since 2022-04-17 01:48:55
|
||||
*/
|
||||
public interface IActivitiHistoryService {
|
||||
/**
|
||||
* 获取高亮
|
||||
* @param instanceId 流程实例id
|
||||
* @return ActivitiHighLineDTO
|
||||
*/
|
||||
ActivitiHighLineDTO gethighLine(String instanceId);
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.xjs.activiti.service;
|
||||
|
||||
|
||||
import com.xjs.activiti.domain.dto.HistoryDataDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 历史数据表单服务接口
|
||||
*
|
||||
* @author xiejs
|
||||
* @since 2022-04-17 01:50:13
|
||||
*/
|
||||
public interface IFormHistoryDataService {
|
||||
|
||||
/**
|
||||
* 查询历史数据展示
|
||||
* @param instanceId 流程实例id
|
||||
* @return list
|
||||
*/
|
||||
List<HistoryDataDTO> historyDataShow(String instanceId);
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
package com.xjs.activiti.service;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import com.ruoyi.common.core.web.page.PageDomain;
|
||||
import com.xjs.activiti.domain.dto.DefinitionIdDTO;
|
||||
import com.xjs.activiti.domain.dto.ProcessDefinitionDTO;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 流程定义服务接口
|
||||
*
|
||||
* @author xiejs
|
||||
* @since 2022-04-17 01:50:42
|
||||
*/
|
||||
public interface IProcessDefinitionService {
|
||||
/**
|
||||
* 获取流程定义集合
|
||||
*
|
||||
* @param processDefinition
|
||||
* @return Page 分页信息
|
||||
*/
|
||||
Page<ProcessDefinitionDTO> selectProcessDefinitionList(ProcessDefinitionDTO processDefinition, PageDomain pageDomain);
|
||||
|
||||
/**
|
||||
* 按实例 ID 获取定义
|
||||
*
|
||||
* @param instanceId 实例id
|
||||
* @return 定义实体
|
||||
*/
|
||||
DefinitionIdDTO getDefinitionsByInstanceId(String instanceId);
|
||||
|
||||
/**
|
||||
* 删除流程定义
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int deleteProcessDefinitionById(String id);
|
||||
|
||||
/**
|
||||
* 上传并部署流程定义
|
||||
*
|
||||
* @param file
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
void uploadStreamAndDeployment(MultipartFile file) throws IOException;
|
||||
|
||||
/**
|
||||
* 启动挂起流程流程定义
|
||||
*
|
||||
* @param id 流程定义id
|
||||
* @param suspendState 流程状态
|
||||
* @return
|
||||
*/
|
||||
void suspendOrActiveApply(String id, Integer suspendState);
|
||||
|
||||
/**
|
||||
* 上传流程流程定义
|
||||
*
|
||||
* @param multipartFile
|
||||
* @return
|
||||
*/
|
||||
String upload(MultipartFile multipartFile) throws IOException;
|
||||
|
||||
/**
|
||||
* 通过stringBPMN添加流程定义
|
||||
*
|
||||
* @param stringBPMN
|
||||
* @return
|
||||
*/
|
||||
void addDeploymentByString(String stringBPMN);
|
||||
|
||||
/**
|
||||
* 获取流程定义XML
|
||||
*
|
||||
* @param response
|
||||
* @param deploymentId
|
||||
* @param resourceName
|
||||
*/
|
||||
void getProcessDefineXML(HttpServletResponse response, String deploymentId, String resourceName) throws IOException;
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
package com.xjs.activiti.service.impl;
|
||||
|
||||
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||
import com.xjs.activiti.domain.ActWorkflowFormData;
|
||||
import com.xjs.activiti.mapper.ActWorkflowFormDataMapper;
|
||||
import com.xjs.activiti.service.IActWorkflowFormDataService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 动态单Service业务层处理
|
||||
*
|
||||
* @author xiejs
|
||||
* @since 2022-04-17 01:51:27
|
||||
*/
|
||||
@Service
|
||||
public class ActWorkflowFormDataServiceImpl implements IActWorkflowFormDataService {
|
||||
@Resource
|
||||
private ActWorkflowFormDataMapper actWorkflowFormDataMapper;
|
||||
|
||||
/**
|
||||
* 查询动态单
|
||||
*
|
||||
* @param id 动态单ID
|
||||
* @return 动态单
|
||||
*/
|
||||
@Override
|
||||
public ActWorkflowFormData selectActWorkflowFormDataById(Long id) {
|
||||
return actWorkflowFormDataMapper.selectActWorkflowFormDataById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ActWorkflowFormData> selectActWorkflowFormDataByBusinessKey(String businessKey) {
|
||||
return actWorkflowFormDataMapper.selectActWorkflowFormDataByBusinessKey(businessKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询动态单列表
|
||||
*
|
||||
* @param ActWorkflowFormData 动态单
|
||||
* @return 动态单
|
||||
*/
|
||||
@Override
|
||||
public List<ActWorkflowFormData> selectActWorkflowFormDataList(ActWorkflowFormData ActWorkflowFormData) {
|
||||
return actWorkflowFormDataMapper.selectActWorkflowFormDataList(ActWorkflowFormData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增动态单
|
||||
*
|
||||
* @param ActWorkflowFormData 动态单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertActWorkflowFormData(ActWorkflowFormData ActWorkflowFormData) {
|
||||
ActWorkflowFormData.setCreateTime(DateUtils.getNowDate());
|
||||
return actWorkflowFormDataMapper.insertActWorkflowFormData(ActWorkflowFormData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertActWorkflowFormDatas(List<ActWorkflowFormData> ActWorkflowFormDatas) {
|
||||
return actWorkflowFormDataMapper.insertActWorkflowFormDatas(SecurityUtils.getUsername(), ActWorkflowFormDatas, new Date(),
|
||||
SecurityUtils.getLoginUser().getSysUser().getNickName());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改动态单
|
||||
*
|
||||
* @param ActWorkflowFormData 动态单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateActWorkflowFormData(ActWorkflowFormData ActWorkflowFormData) {
|
||||
return actWorkflowFormDataMapper.updateActWorkflowFormData(ActWorkflowFormData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除动态单
|
||||
*
|
||||
* @param ids 需要删除的动态单ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteActWorkflowFormDataByIds(Long[] ids) {
|
||||
return actWorkflowFormDataMapper.deleteActWorkflowFormDataByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除动态单信息
|
||||
*
|
||||
* @param id 动态单ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteActWorkflowFormDataById(Long id) {
|
||||
return actWorkflowFormDataMapper.deleteActWorkflowFormDataById(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,132 @@
|
||||
package com.xjs.activiti.service.impl;
|
||||
|
||||
import com.xjs.activiti.domain.dto.ActivitiHighLineDTO;
|
||||
import com.xjs.activiti.service.IActivitiHistoryService;
|
||||
import org.activiti.bpmn.model.Process;
|
||||
import org.activiti.bpmn.model.*;
|
||||
import org.activiti.engine.HistoryService;
|
||||
import org.activiti.engine.RepositoryService;
|
||||
import org.activiti.engine.history.HistoricActivityInstance;
|
||||
import org.activiti.engine.history.HistoricProcessInstance;
|
||||
import org.activiti.engine.history.HistoricTaskInstance;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Activiti历史任务服务接口实现
|
||||
*
|
||||
* @author xiejs
|
||||
* @since 2022-04-17 01:48:55
|
||||
*/
|
||||
@Service
|
||||
public class ActivitiHistoryServiceImpl implements IActivitiHistoryService {
|
||||
|
||||
@Autowired
|
||||
private HistoryService historyService;
|
||||
@Autowired
|
||||
private RepositoryService repositoryService;
|
||||
|
||||
|
||||
@Override
|
||||
public ActivitiHighLineDTO gethighLine(String instanceId) {
|
||||
HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery()
|
||||
.processInstanceId(instanceId).singleResult();
|
||||
//获取bpmnModel对象
|
||||
BpmnModel bpmnModel = repositoryService.getBpmnModel(historicProcessInstance.getProcessDefinitionId());
|
||||
//因为我们这里只定义了一个Process 所以获取集合中的第一个即可
|
||||
Process process = bpmnModel.getProcesses().get(0);
|
||||
//获取所有的FlowElement信息
|
||||
Collection<FlowElement> flowElements = process.getFlowElements();
|
||||
|
||||
Map<String, String> map = new HashMap<>();
|
||||
for (FlowElement flowElement : flowElements) {
|
||||
//判断是否是连线
|
||||
if (flowElement instanceof SequenceFlow) {
|
||||
SequenceFlow sequenceFlow = (SequenceFlow) flowElement;
|
||||
String ref = sequenceFlow.getSourceRef();
|
||||
String targetRef = sequenceFlow.getTargetRef();
|
||||
map.put(ref + targetRef, sequenceFlow.getId());
|
||||
}
|
||||
}
|
||||
|
||||
//获取流程实例 历史节点(全部)
|
||||
List<HistoricActivityInstance> list = historyService.createHistoricActivityInstanceQuery()
|
||||
.processInstanceId(instanceId)
|
||||
.list();
|
||||
//各个历史节点 两两组合 key
|
||||
Set<String> keyList = new HashSet<>();
|
||||
for (HistoricActivityInstance i : list) {
|
||||
for (HistoricActivityInstance j : list) {
|
||||
if (i != j) {
|
||||
keyList.add(i.getActivityId() + j.getActivityId());
|
||||
}
|
||||
}
|
||||
}
|
||||
//高亮连线ID
|
||||
Set<String> highLine = new HashSet<>();
|
||||
keyList.forEach(s -> highLine.add(map.get(s)));
|
||||
|
||||
|
||||
//获取流程实例 历史节点(已完成)
|
||||
List<HistoricActivityInstance> listFinished = historyService.createHistoricActivityInstanceQuery()
|
||||
.processInstanceId(instanceId)
|
||||
.finished()
|
||||
.list();
|
||||
//高亮节点ID
|
||||
Set<String> highPoint = new HashSet<>();
|
||||
listFinished.forEach(s -> highPoint.add(s.getActivityId()));
|
||||
|
||||
//获取流程实例 历史节点(待办节点)
|
||||
List<HistoricActivityInstance> listUnFinished = historyService.createHistoricActivityInstanceQuery()
|
||||
.processInstanceId(instanceId)
|
||||
.unfinished()
|
||||
.list();
|
||||
|
||||
//需要移除的高亮连线
|
||||
Set<String> set = new HashSet<>();
|
||||
//待办高亮节点
|
||||
Set<String> waitingToDo = new HashSet<>();
|
||||
listUnFinished.forEach(s -> {
|
||||
waitingToDo.add(s.getActivityId());
|
||||
|
||||
for (FlowElement flowElement : flowElements) {
|
||||
//判断是否是 用户节点
|
||||
if (flowElement instanceof UserTask) {
|
||||
UserTask userTask = (UserTask) flowElement;
|
||||
|
||||
if (userTask.getId().equals(s.getActivityId())) {
|
||||
List<SequenceFlow> outgoingFlows = userTask.getOutgoingFlows();
|
||||
//因为 高亮连线查询的是所有节点 两两组合 把待办 之后 往外发出的连线 也包含进去了 所以要把高亮待办节点 之后 即出的连线去掉
|
||||
if (outgoingFlows != null && outgoingFlows.size() > 0) {
|
||||
outgoingFlows.forEach(a -> {
|
||||
if (a.getSourceRef().equals(s.getActivityId())) {
|
||||
set.add(a.getId());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
highLine.removeAll(set);
|
||||
Set<String> iDo = new HashSet<>(); //存放 高亮 我的办理节点
|
||||
//当前用户已完成的任务
|
||||
List<HistoricTaskInstance> taskInstanceList = historyService.createHistoricTaskInstanceQuery()
|
||||
// .taskAssignee(SecurityUtils.getUsername())
|
||||
.finished()
|
||||
.processInstanceId(instanceId).list();
|
||||
|
||||
taskInstanceList.forEach(a -> iDo.add(a.getTaskDefinitionKey()));
|
||||
|
||||
ActivitiHighLineDTO activitiHighLineDTO = new ActivitiHighLineDTO();
|
||||
activitiHighLineDTO.setHighPoint(highPoint);
|
||||
activitiHighLineDTO.setHighLine(highLine);
|
||||
activitiHighLineDTO.setWaitingToDo(waitingToDo);
|
||||
activitiHighLineDTO.setiDo(iDo);
|
||||
|
||||
return activitiHighLineDTO;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
package com.xjs.activiti.service.impl;
|
||||
|
||||
|
||||
import com.xjs.activiti.domain.ActWorkflowFormData;
|
||||
import com.xjs.activiti.domain.dto.HistoryDataDTO;
|
||||
import com.xjs.activiti.domain.dto.HistoryFormDataDTO;
|
||||
import com.xjs.activiti.service.IActWorkflowFormDataService;
|
||||
import com.xjs.activiti.service.IFormHistoryDataService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 历史数据表单服务接口实现
|
||||
*
|
||||
* @author xiejs
|
||||
* @since 2022-04-17 01:50:13
|
||||
*/
|
||||
@Service
|
||||
public class FormHistoryDataServiceImpl implements IFormHistoryDataService {
|
||||
@Autowired
|
||||
private IActWorkflowFormDataService actWorkflowFormDataService;
|
||||
|
||||
|
||||
private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
@Override
|
||||
public List<HistoryDataDTO> historyDataShow(String businessKey) {
|
||||
List<HistoryDataDTO> returnHistoryFromDataDTOS = new ArrayList<>();
|
||||
List<ActWorkflowFormData> actWorkflowFormData = actWorkflowFormDataService.selectActWorkflowFormDataByBusinessKey(businessKey);
|
||||
Map<String, List<ActWorkflowFormData>> collect = actWorkflowFormData.stream().collect(Collectors.groupingBy(ActWorkflowFormData::getTaskNodeName));
|
||||
collect.entrySet().forEach(
|
||||
entry -> {
|
||||
HistoryDataDTO returnHistoryFromDataDTO = new HistoryDataDTO();
|
||||
returnHistoryFromDataDTO.setTaskNodeName(entry.getValue().get(0).getTaskNodeName());
|
||||
returnHistoryFromDataDTO.setCreateName(entry.getValue().get(0).getCreateName());
|
||||
returnHistoryFromDataDTO.setCreatedDate(sdf.format(entry.getValue().get(0).getCreateTime()));
|
||||
returnHistoryFromDataDTO.setFormHistoryDataDTO(entry.getValue().stream().map(awfd -> new HistoryFormDataDTO(awfd.getControlName(), awfd.getControlValue())).collect(Collectors.toList()));
|
||||
returnHistoryFromDataDTOS.add(returnHistoryFromDataDTO);
|
||||
}
|
||||
);
|
||||
List<HistoryDataDTO> collect1 = returnHistoryFromDataDTOS.stream().sorted((x, y) -> x.getCreatedDate().compareTo(y.getCreatedDate())).collect(Collectors.toList());
|
||||
|
||||
return collect1;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
<?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.xjs.activiti.mapper.ActReDeploymentMapper">
|
||||
|
||||
<resultMap type="com.xjs.activiti.domain.vo.ActReDeploymentVO" id="ActReDeploymentResult">
|
||||
<id property="id" column="id"/>
|
||||
<result property="deployTime" column="deploy_time"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="selectDeploymentVo">
|
||||
select ID_ id, DEPLOY_TIME_ deploy_time
|
||||
from `act_re_deployment`
|
||||
</sql>
|
||||
|
||||
|
||||
<select id="selectActReDeploymentByIds" parameterType="String" resultMap="ActReDeploymentResult">
|
||||
<include refid="selectDeploymentVo"/>
|
||||
where ID_ in
|
||||
<foreach collection="ids" item="id" index="index" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
@ -0,0 +1,118 @@
|
||||
<?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.xjs.activiti.mapper.ActWorkflowFormDataMapper">
|
||||
<resultMap type="com.xjs.activiti.domain.ActWorkflowFormData" id="ActWorkflowFormDataResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="businessKey" column="business_key"/>
|
||||
<result property="formKey" column="form_key"/>
|
||||
<result property="controlId" column="control_id"/>
|
||||
<result property="controlName" column="control_name"/>
|
||||
<result property="controlValue" column="control_value"/>
|
||||
<result property="taskNodeName" column="task_node_name"/>
|
||||
<result property="createName" column="create_name"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectActWorkflowFormDataVo">
|
||||
select id,
|
||||
business_key,
|
||||
form_key,
|
||||
control_id,
|
||||
control_name,
|
||||
control_value,
|
||||
task_node_name,
|
||||
create_name,
|
||||
create_by,
|
||||
create_time
|
||||
from act_workflow_FormData
|
||||
</sql>
|
||||
|
||||
<select id="selectActWorkflowFormDataList" parameterType="com.xjs.activiti.domain.ActWorkflowFormData"
|
||||
resultMap="ActWorkflowFormDataResult">
|
||||
<include refid="selectActWorkflowFormDataVo"/>
|
||||
<where>
|
||||
<if test="businessKey != null and businessKey != ''">and business_key = #{businessKey}</if>
|
||||
<if test="formKey != null and formKey != ''">and form_key = #{formKey}</if>
|
||||
<if test="controlId != null and controlId != ''">and control_id = #{controlId}</if>
|
||||
<if test="controlValue != null and controlValue != ''">and control_value = #{controlValue}</if>
|
||||
<if test="taskNodeName != null and taskNodeName != ''">and task_node_name = #{taskNodeName}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectActWorkflowFormDataById" parameterType="Long" resultMap="ActWorkflowFormDataResult">
|
||||
<include refid="selectActWorkflowFormDataVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="selectActWorkflowFormDataByBusinessKey" parameterType="string" resultMap="ActWorkflowFormDataResult">
|
||||
<include refid="selectActWorkflowFormDataVo"/>
|
||||
where business_key = #{businessKey}
|
||||
</select>
|
||||
|
||||
<insert id="insertActWorkflowFormData" parameterType="com.xjs.activiti.domain.ActWorkflowFormData"
|
||||
useGeneratedKeys="true" keyProperty="id">
|
||||
insert into act_workflow_FormData
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="businessKey != null">business_key,</if>
|
||||
<if test="formKey != null">form_key,</if>
|
||||
<if test="controlId != null">control_id,</if>
|
||||
<if test="controlName != null">control_name,</if>
|
||||
<if test="controlValue != null">control_value,</if>
|
||||
<if test="taskNodeName != null">task_node_name,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="businessKey != null">#{businessKey},</if>
|
||||
<if test="formKey != null">#{formKey},</if>
|
||||
<if test="controlId != null">#{controlId},</if>
|
||||
<if test="controlName != null">#{controlName},</if>
|
||||
<if test="controlValue != null">#{controlValue},</if>
|
||||
<if test="taskNodeName != null">#{taskNodeName},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertActWorkflowFormDatas" useGeneratedKeys="true">
|
||||
insert into act_workflow_FormData
|
||||
(business_key,form_key,control_id,control_name,control_value,task_node_name,create_by,create_time,create_name)
|
||||
values
|
||||
<foreach collection="param2" item="awfd" index="index" separator=",">
|
||||
(#{awfd.businessKey},#{awfd.formKey},#{awfd.controlId},#{awfd.controlName},
|
||||
#{awfd.controlValue},#{awfd.taskNodeName},#{param1},#{param3},#{param4})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateActWorkflowFormData" parameterType="com.xjs.activiti.domain.ActWorkflowFormData">
|
||||
update act_workflow_FormData
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="businessKey != null">business_key = #{businessKey},</if>
|
||||
<if test="formKey != null">form_key = #{formKey},</if>
|
||||
<if test="controlId != null">control_id = #{controlId},</if>
|
||||
<if test="controlName != null">control_name = #{controlName},</if>
|
||||
<if test="controlValue != null">control_value = #{controlValue},</if>
|
||||
<if test="taskNodeName != null">task_node_name = #{taskNodeName},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteActWorkflowFormDataById" parameterType="Long">
|
||||
delete
|
||||
from act_workflow_FormData
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteActWorkflowFormDataByIds" parameterType="String">
|
||||
delete from act_workflow_FormData where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE configuration
|
||||
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-config.dtd">
|
||||
<configuration>
|
||||
|
||||
<settings>
|
||||
<setting name="cacheEnabled" value="true" /> <!-- 全局映射器启用缓存 -->
|
||||
<setting name="useGeneratedKeys" value="true" /> <!-- 允许 JDBC 支持自动生成主键 -->
|
||||
<setting name="defaultExecutorType" value="REUSE" /> <!-- 配置默认的执行器 -->
|
||||
<setting name="logImpl" value="SLF4J" /> <!-- 指定 MyBatis 所用日志的具体实现 -->
|
||||
<!-- <setting name="mapUnderscoreToCamelCase" value="true"/> 驼峰式命名 -->
|
||||
</settings>
|
||||
|
||||
</configuration>
|
Loading…
Reference in new issue