Compare commits
No commits in common. 'main' and 'master' have entirely different histories.
@ -1,38 +0,0 @@
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea/modules.xml
|
||||
.idea/jarRepositories.xml
|
||||
.idea/compiler.xml
|
||||
.idea/libraries/
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### Eclipse ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
### Mac OS ###
|
||||
.DS_Store
|
||||
@ -1,10 +0,0 @@
|
||||
# 默认忽略的文件
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# 基于编辑器的 HTTP 客户端请求
|
||||
/httpRequests/
|
||||
# 依赖于环境的 Maven 主目录路径
|
||||
/mavenHomeManager.xml
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
@ -1,6 +0,0 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
</profile>
|
||||
</component>
|
||||
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="17" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/huacai-homestay.iml" filepath="$PROJECT_DIR$/.idea/huacai-homestay.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/MinSu" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
File diff suppressed because one or more lines are too long
@ -1,12 +0,0 @@
|
||||
@echo off
|
||||
echo.
|
||||
echo [信息] 清理工程target生成路径。
|
||||
echo.
|
||||
|
||||
%~d0
|
||||
cd %~dp0
|
||||
|
||||
cd ..
|
||||
call mvn clean
|
||||
|
||||
pause
|
||||
@ -1,14 +0,0 @@
|
||||
@echo off
|
||||
echo.
|
||||
echo [信息] 使用Jar命令运行Web工程。
|
||||
echo.
|
||||
|
||||
cd %~dp0
|
||||
cd ../ruoyi-admin/target
|
||||
|
||||
set JAVA_OPTS=-Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
|
||||
|
||||
java -jar %JAVA_OPTS% ruoyi-admin.jar
|
||||
|
||||
cd bin
|
||||
pause
|
||||
@ -1,70 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>huacai</artifactId>
|
||||
<groupId>com.huacai</groupId>
|
||||
<version>3.8.7</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>huacai-activiti</artifactId>
|
||||
|
||||
<description>
|
||||
流程模块
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- 通用工具-->
|
||||
<dependency>
|
||||
<groupId>com.huacai</groupId>
|
||||
<artifactId>huacai-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.activiti</groupId>
|
||||
<artifactId>activiti-spring-boot-starter</artifactId>
|
||||
<version>7.1.0.M6</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- activiti图片生成 -->
|
||||
<dependency>
|
||||
<groupId>org.activiti</groupId>
|
||||
<artifactId>activiti-image-generator</artifactId>
|
||||
<version>7.1.0.M6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.huacai</groupId>
|
||||
<artifactId>huacai-framework</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.5.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-params</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@ -1,175 +0,0 @@
|
||||
package com.huacai.activiti.controller;
|
||||
|
||||
import cn.hutool.json.JSONArray;
|
||||
import com.huacai.activiti.service.MyTaskService;
|
||||
import com.huacai.activiti.util.ActivitiUtil;
|
||||
import com.huacai.activiti.vo.ApplyVo;
|
||||
import com.huacai.activiti.vo.HistoryVo;
|
||||
import com.huacai.activiti.vo.MyTaskVo;
|
||||
import com.huacai.common.core.controller.BaseController;
|
||||
import com.huacai.common.core.domain.AjaxResult;
|
||||
import com.huacai.common.core.page.TableDataInfo;
|
||||
import org.activiti.api.task.runtime.TaskRuntime;
|
||||
import org.activiti.engine.TaskService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/task")
|
||||
public class TaskController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private MyTaskService myTaskService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private TaskService taskService;
|
||||
|
||||
@Autowired
|
||||
private TaskRuntime taskRuntime;
|
||||
@Autowired
|
||||
private ActivitiUtil activitiUtil;
|
||||
|
||||
/**
|
||||
* 发起流程
|
||||
*
|
||||
* @param businessKey 业务主键
|
||||
* @param businessType 业务类型
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/startTask", method = RequestMethod.GET)
|
||||
public AjaxResult startTask(@RequestParam("businessKey") String businessKey, @RequestParam("businessType") Integer businessType) {
|
||||
int i = myTaskService.startTask(businessKey, businessType);
|
||||
return toAjax(i);
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤销流程
|
||||
*
|
||||
* @param processInstanceId 流程示例id
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/revokeProcess", method = RequestMethod.GET)
|
||||
public AjaxResult revokeProcess(@RequestParam("processInstanceId") String processInstanceId, @RequestParam("businessKey") String businessKey, @RequestParam("businessType") Integer businessType) {
|
||||
int i = myTaskService.revokeProcess(processInstanceId, businessKey, businessType);
|
||||
return toAjax(i);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询我的代办任务
|
||||
*
|
||||
* @param myTaskVo
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/selectMyTask", method = RequestMethod.GET)
|
||||
public TableDataInfo selectMyTask(MyTaskVo myTaskVo) {
|
||||
myTaskVo.setAssignee(String.valueOf(getUserId()));
|
||||
startPage();
|
||||
List<MyTaskVo> myTaskVos = myTaskService.selectMyTask(myTaskVo);
|
||||
return getDataTable(myTaskVos);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询任务组数据
|
||||
*
|
||||
* @param myTaskVo
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/selectGroupTask", method = RequestMethod.GET)
|
||||
public TableDataInfo selectGroupTask(MyTaskVo myTaskVo) {
|
||||
myTaskVo.setAssignee(String.valueOf(getUserId()));
|
||||
startPage();
|
||||
List<MyTaskVo> myTaskVos = myTaskService.selectGroupTask(myTaskVo);
|
||||
return getDataTable(myTaskVos);
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核通过任务
|
||||
*
|
||||
* @param applyVo
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/passTask", method = RequestMethod.POST)
|
||||
public AjaxResult passTask(@RequestBody ApplyVo applyVo) {
|
||||
int i = myTaskService.passTask(applyVo);
|
||||
return AjaxResult.success(i);
|
||||
}
|
||||
|
||||
/**
|
||||
* 任务回退
|
||||
*
|
||||
* @param applyVo
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/fallBackTask", method = RequestMethod.POST)
|
||||
public AjaxResult fallBackTask(@RequestBody ApplyVo applyVo) {
|
||||
int i = myTaskService.fallBackTask(applyVo);
|
||||
return toAjax(i);
|
||||
}
|
||||
|
||||
/**
|
||||
* 任务拾取
|
||||
*
|
||||
* @param taskId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/claimTask", method = RequestMethod.GET)
|
||||
public AjaxResult claimTask(@RequestParam("taskId") String taskId) {
|
||||
taskService.claim(taskId, getUserId() + "");
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 归还任务
|
||||
*
|
||||
* @param taskId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/unClaimTask", method = RequestMethod.GET)
|
||||
public AjaxResult unClaimTask(@RequestParam("taskId") String taskId) {
|
||||
taskService.unclaim(taskId);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询审批历史记录
|
||||
*
|
||||
* @param processInstanceId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/selectHistory", method = RequestMethod.GET)
|
||||
public AjaxResult selectHistory(@RequestParam("processInstanceId") String processInstanceId) {
|
||||
List<HistoryVo> historyVos = myTaskService.selectHistory(processInstanceId);
|
||||
return AjaxResult.success(historyVos);
|
||||
}
|
||||
/**
|
||||
* 查询可回退的任务节点
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/selectBefore", method = RequestMethod.GET)
|
||||
public AjaxResult selectBefore(ApplyVo applyVo) {
|
||||
JSONArray result = myTaskService.selectBefore(applyVo);
|
||||
return AjaxResult.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询可回退的任务节点
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/fallBackTaskByTaskDefinitionKey", method = RequestMethod.GET)
|
||||
public AjaxResult fallBackTaskByTaskDefinitionKey(ApplyVo applyVo, String taskDefinitionKey) {
|
||||
String result = myTaskService.fallBackTaskByTaskDefinitionKey(applyVo,taskDefinitionKey);
|
||||
return AjaxResult.success(result);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,48 +0,0 @@
|
||||
package com.huacai.activiti.controller;
|
||||
|
||||
|
||||
import com.huacai.activiti.domain.RoleVo;
|
||||
import com.huacai.activiti.domain.UserVo;
|
||||
import com.huacai.activiti.mapper.UserMapper;
|
||||
import com.huacai.common.core.domain.AjaxResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户相关接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/user")
|
||||
public class UserController {
|
||||
@Autowired
|
||||
private UserMapper userMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询用户数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/listUsersToWorkflow", method = RequestMethod.GET)
|
||||
public AjaxResult listUsersToWorkflow() {
|
||||
List<UserVo> userVos = userMapper.listUsersToWorkflow();
|
||||
return AjaxResult.success(userVos);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询角色数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/queryAllSysRole", method = RequestMethod.GET)
|
||||
public AjaxResult queryAllSysRole() {
|
||||
List<RoleVo> roleVos = userMapper.queryAllSysRole();
|
||||
return AjaxResult.success(roleVos);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,15 +0,0 @@
|
||||
package com.huacai.activiti.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 部署流程定义时的vo
|
||||
*/
|
||||
@Data
|
||||
public class DefineProcessVo implements Serializable {
|
||||
private String type;
|
||||
private String stringBPMN;
|
||||
|
||||
}
|
||||
@ -1,22 +0,0 @@
|
||||
package com.huacai.activiti.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class DefineVo implements Serializable {
|
||||
private String deploymentId;
|
||||
private String processDefinitionId;
|
||||
private String processDefinitionName;
|
||||
private String processDefinitionKey;
|
||||
private String processDefinitionVersion;
|
||||
private String processDefinitionType;
|
||||
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date deployTime;
|
||||
private String resourceName;
|
||||
}
|
||||
@ -1,14 +0,0 @@
|
||||
package com.huacai.activiti.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 角色
|
||||
*/
|
||||
@Data
|
||||
public class RoleVo implements Serializable {
|
||||
private String roleName;
|
||||
private String roleKey;
|
||||
}
|
||||
@ -1,15 +0,0 @@
|
||||
package com.huacai.activiti.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 用户实体对象
|
||||
*/
|
||||
@Data
|
||||
public class UserVo implements Serializable {
|
||||
private String userId;
|
||||
private String nickName;
|
||||
private String deptName;
|
||||
}
|
||||
@ -1,24 +0,0 @@
|
||||
package com.huacai.activiti.exception;
|
||||
|
||||
import lombok.Data;
|
||||
import org.activiti.bpmn.model.BpmnModel;
|
||||
|
||||
/**
|
||||
* @projectName: haucai-activiti-kjglxt
|
||||
* @package: com.huacai.activiti.exception
|
||||
* @className: CustomException
|
||||
* @author: 陈达勇
|
||||
* @description: TODO
|
||||
* @date: 2024/6/23 20:49
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
public class CustomException extends Throwable {
|
||||
|
||||
String errMsg;
|
||||
BpmnModel model;
|
||||
|
||||
public CustomException(String errMsg) {
|
||||
this.errMsg = errMsg;
|
||||
}
|
||||
}
|
||||
@ -1,39 +0,0 @@
|
||||
package com.huacai.activiti.mapper;
|
||||
|
||||
import com.huacai.activiti.domain.DefineVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface MyProcessMapper {
|
||||
/**
|
||||
* 查询部署列表集合
|
||||
* @param defineVo
|
||||
* @return
|
||||
*/
|
||||
List<DefineVo> listData(DefineVo defineVo);
|
||||
|
||||
/**
|
||||
* 查询指定类型的流程定义key
|
||||
* @param processType
|
||||
* @return
|
||||
*/
|
||||
String selectLastVersionProcessDefineKey(Integer processType);
|
||||
|
||||
/**
|
||||
* 删除历史任务
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
void deleteHisTaskById(@Param("id") String id);
|
||||
|
||||
/**
|
||||
* 删除历史任务
|
||||
*
|
||||
* @param processInstanceId
|
||||
* @param taskDefKey
|
||||
*/
|
||||
void deleteHisTask(@Param("processInstanceId") String processInstanceId,
|
||||
@Param("taskDefKey") String taskDefKey);
|
||||
|
||||
}
|
||||
@ -1,30 +0,0 @@
|
||||
package com.huacai.activiti.mapper;
|
||||
|
||||
import com.huacai.activiti.vo.HistoryVo;
|
||||
import com.huacai.activiti.vo.MyTaskVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface MyTaskMapper {
|
||||
/**
|
||||
* 查询我的代办任务
|
||||
* @param myTaskVo
|
||||
* @return
|
||||
*/
|
||||
List<MyTaskVo> selectMyTask(MyTaskVo myTaskVo);
|
||||
|
||||
/**
|
||||
* 查询任务组数据
|
||||
* @param myTaskVo
|
||||
* @return
|
||||
*/
|
||||
List<MyTaskVo> selectGroupTask(MyTaskVo myTaskVo);
|
||||
|
||||
|
||||
/**
|
||||
* 查询历史记录
|
||||
* @param processInstanceId
|
||||
* @return
|
||||
*/
|
||||
List<HistoryVo> selectHistory(String processInstanceId);
|
||||
}
|
||||
@ -1,21 +0,0 @@
|
||||
package com.huacai.activiti.mapper;
|
||||
|
||||
import com.huacai.activiti.domain.RoleVo;
|
||||
import com.huacai.activiti.domain.UserVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface UserMapper {
|
||||
|
||||
/**
|
||||
* 查询用户列表数据
|
||||
* @return
|
||||
*/
|
||||
List<UserVo> listUsersToWorkflow();
|
||||
|
||||
/**
|
||||
* 查询角色列表
|
||||
* @return
|
||||
*/
|
||||
List<RoleVo> queryAllSysRole();
|
||||
}
|
||||
@ -1,69 +0,0 @@
|
||||
package com.huacai.activiti.service;
|
||||
|
||||
import cn.hutool.json.JSONArray;
|
||||
import com.huacai.activiti.vo.ApplyVo;
|
||||
import com.huacai.activiti.vo.HistoryVo;
|
||||
import com.huacai.activiti.vo.MyTaskVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface MyTaskService {
|
||||
|
||||
|
||||
/**
|
||||
* 发起流程
|
||||
*
|
||||
* @param businessKey 业务主键
|
||||
* @param businessType 业务类型
|
||||
* @return
|
||||
*/
|
||||
int startTask(String businessKey, Integer businessType);
|
||||
|
||||
/**
|
||||
* 撤销流程
|
||||
*
|
||||
* @param processInstanceId
|
||||
* @return
|
||||
*/
|
||||
int revokeProcess(String processInstanceId, String businessKey, Integer businessType);
|
||||
|
||||
/**
|
||||
* 查询我的代办任务
|
||||
*
|
||||
* @param myTaskVo
|
||||
* @return
|
||||
*/
|
||||
List<MyTaskVo> selectMyTask(MyTaskVo myTaskVo);
|
||||
|
||||
/**
|
||||
* 任务审核通过
|
||||
*
|
||||
* @param applyVo
|
||||
* @return
|
||||
*/
|
||||
int passTask(ApplyVo applyVo);
|
||||
|
||||
/**
|
||||
* 任务回退
|
||||
*/
|
||||
int fallBackTask(ApplyVo applyVo);
|
||||
|
||||
/**
|
||||
* 查询任务组数据
|
||||
* @param myTaskVo
|
||||
* @return
|
||||
*/
|
||||
List<MyTaskVo> selectGroupTask(MyTaskVo myTaskVo);
|
||||
|
||||
/**
|
||||
* 查询历史审批记录
|
||||
* @param processInstanceId
|
||||
* @return
|
||||
*/
|
||||
List<HistoryVo> selectHistory(String processInstanceId);
|
||||
|
||||
|
||||
JSONArray selectBefore(ApplyVo applyVo);
|
||||
|
||||
String fallBackTaskByTaskDefinitionKey(ApplyVo applyVo, String taskDefinitionKey);
|
||||
}
|
||||
@ -1,306 +0,0 @@
|
||||
package com.huacai.activiti.service.impl;
|
||||
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.huacai.activiti.mapper.MyProcessMapper;
|
||||
import com.huacai.activiti.mapper.MyTaskMapper;
|
||||
import com.huacai.activiti.service.MyTaskService;
|
||||
import com.huacai.activiti.util.ActivitiUtil;
|
||||
import com.huacai.activiti.vo.ApplyVo;
|
||||
import com.huacai.activiti.vo.HistoryVo;
|
||||
import com.huacai.activiti.vo.MyTaskVo;
|
||||
import com.huacai.common.core.domain.model.LoginUser;
|
||||
import com.huacai.common.utils.SecurityUtils;
|
||||
import com.huacai.common.utils.StringUtils;
|
||||
import com.huacai.common.utils.spring.SpringUtils;
|
||||
import com.huacai.infoHiComment.domain.InfoHiComment;
|
||||
import com.huacai.infoHiComment.mapper.InfoHiCommentMapper;
|
||||
import com.huacai.infoRunTaskData.mapper.InfoRunTaskDataMapper;
|
||||
import com.huacai.infoRunTaskData.service.IInfoRunTaskDataService;
|
||||
import org.activiti.bpmn.model.*;
|
||||
import org.activiti.bpmn.model.Process;
|
||||
import org.activiti.engine.*;
|
||||
import org.activiti.engine.history.HistoricTaskInstance;
|
||||
import org.activiti.engine.runtime.ProcessInstance;
|
||||
import org.activiti.engine.task.Task;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class MyTaskServiceImpl implements MyTaskService {
|
||||
|
||||
@Resource
|
||||
private RuntimeService runtimeService;
|
||||
|
||||
|
||||
@Resource
|
||||
private MyProcessMapper myProcessMapper;
|
||||
|
||||
@Resource
|
||||
private IInfoRunTaskDataService infoRunTaskDataService;
|
||||
|
||||
@Resource
|
||||
private MyTaskMapper myTaskMapper;
|
||||
|
||||
@Resource
|
||||
private TaskService taskService;
|
||||
@Resource
|
||||
private ActivitiUtil activitiUtil;
|
||||
|
||||
@Resource
|
||||
private RepositoryService repositoryService;
|
||||
|
||||
@Resource
|
||||
private InfoHiCommentMapper infoHiCommentMapper;
|
||||
|
||||
@Resource
|
||||
private InfoRunTaskDataMapper infoRunTaskDataMapper;
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public int startTask(String businessKey, Integer businessType) {
|
||||
//1.查询最新部署的一条流程
|
||||
String processDefineKey = myProcessMapper.selectLastVersionProcessDefineKey(businessType);
|
||||
if (StringUtils.isEmpty(processDefineKey)) {
|
||||
throw new RuntimeException("未找到相应流程,请联系管理员");
|
||||
}
|
||||
|
||||
|
||||
|
||||
// //获取runtimeService
|
||||
// ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
|
||||
// RuntimeService runtimeService = processEngine.getRuntimeService();
|
||||
//启动流程
|
||||
|
||||
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processDefineKey,processDefineKey);
|
||||
Task currentTask = taskService.createTaskQuery().processInstanceId(processInstance.getProcessInstanceId()).singleResult();
|
||||
//taskService.setAssignee(currentTask.getId(), "1,2,100");
|
||||
|
||||
//获取候选人
|
||||
String targetUserTaskId= currentTask.getId();
|
||||
BpmnModel bpmnModel = repositoryService.getBpmnModel(currentTask.getProcessDefinitionId());
|
||||
List<Process> processes = bpmnModel.getProcesses();
|
||||
for (Process process : processes) {
|
||||
List<UserTask> userTaskList = process.findFlowElementsOfType(UserTask.class);
|
||||
for (UserTask userTask : userTaskList) {
|
||||
//if(userTask.getId().equals(targetUserTaskId)){
|
||||
userTask.getCandidateGroups();
|
||||
|
||||
List<String> candidateUsers = userTask.getCandidateUsers();
|
||||
if (!CollectionUtils.isEmpty(candidateUsers)) {
|
||||
// userTask.setAssignee("1");
|
||||
}
|
||||
/*String[] assingneeArray=complateDto.getUserIds().split(",");
|
||||
variables.put("assigneeList", Arrays.asList(assingneeArray));*/
|
||||
System.out.println("candidateUsers:"+candidateUsers+"; group:"+userTask.getCandidateGroups().toString());
|
||||
//}
|
||||
}
|
||||
}
|
||||
//修改业务数据 //修改成审核中
|
||||
infoRunTaskDataService.updateStatus(businessKey, businessType, 2, processInstance.getProcessInstanceId());
|
||||
//新增历史记录
|
||||
InfoHiComment infoHiComment = new InfoHiComment();
|
||||
infoHiComment.setCreateTime(new Date());
|
||||
// 获取当前的用户
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
infoHiComment.setTaskName(loginUser.getUser().getNickName() + "-提交审批");
|
||||
infoHiComment.setCreateName(SecurityUtils.getLoginUser().getUser().getNickName());
|
||||
infoHiComment.setMessage("发起申请");
|
||||
infoHiComment.setProcessInstanceId(processInstance.getProcessInstanceId());
|
||||
infoHiCommentMapper.insertInfoHiComment(infoHiComment);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public int revokeProcess(String processInstanceId, String businessKey, Integer businessType) {
|
||||
runtimeService.deleteProcessInstance(processInstanceId, "主动撤销流程");
|
||||
//修改业务状态 为未提交
|
||||
infoRunTaskDataService.updateStatus(businessKey, businessType, 1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MyTaskVo> selectMyTask(MyTaskVo myTaskVo) {
|
||||
List<MyTaskVo> myTaskVos = myTaskMapper.selectMyTask(myTaskVo);
|
||||
return myTaskVos;
|
||||
}
|
||||
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public int passTask(ApplyVo applyVo) {
|
||||
Map<String, Object> variables = new HashMap<>();
|
||||
if (!Objects.isNull(applyVo.getParams())) {
|
||||
variables.putAll(applyVo.getParams());
|
||||
}
|
||||
|
||||
|
||||
Task currentTask = taskService.createTaskQuery().taskId(applyVo.getTaskId()).singleResult();
|
||||
|
||||
taskService.addComment(applyVo.getTaskId(), applyVo.getProcessInstanceId(), applyVo.getComment());
|
||||
taskService.complete(applyVo.getTaskId(), variables);
|
||||
//查询这个任务是否还存在
|
||||
List<Task> list = taskService.createTaskQuery().processInstanceId(applyVo.getProcessInstanceId()).list();
|
||||
|
||||
//新增历史记录
|
||||
if (!list.isEmpty()) {
|
||||
//新增历史记录
|
||||
InfoHiComment infoHiComment = new InfoHiComment();
|
||||
infoHiComment.setCreateTime(new Date());
|
||||
infoHiComment.setCreateName(SecurityUtils.getLoginUser().getUser().getNickName());
|
||||
infoHiComment.setMessage(applyVo.getComment());
|
||||
infoHiComment.setTaskName(currentTask.getName());
|
||||
infoHiComment.setProcessInstanceId(applyVo.getProcessInstanceId());
|
||||
infoHiCommentMapper.insertInfoHiComment(infoHiComment);
|
||||
} else {
|
||||
//说明所有的任务已经完成 修改业务数据状态为完成 3审核通过
|
||||
infoRunTaskDataService.updateStatus(applyVo.getBusinessKey(), applyVo.getBusinessType(), 3);
|
||||
InfoHiComment infoHiComment = new InfoHiComment();
|
||||
infoHiComment.setCreateTime(new Date());
|
||||
infoHiComment.setCreateName(SecurityUtils.getLoginUser().getUser().getNickName());
|
||||
infoHiComment.setMessage(applyVo.getComment());
|
||||
infoHiComment.setTaskName("审批流程通过");
|
||||
infoHiComment.setProcessInstanceId(applyVo.getProcessInstanceId());
|
||||
infoHiCommentMapper.insertInfoHiComment(infoHiComment);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public int fallBackTask(ApplyVo applyVo) {
|
||||
taskService.addComment(applyVo.getTaskId(), applyVo.getProcessInstanceId(), applyVo.getComment());
|
||||
// 获取当前任务信息
|
||||
Task currentTask = taskService.createTaskQuery().taskId(applyVo.getTaskId()).singleResult();
|
||||
|
||||
if (Objects.isNull(currentTask)) {
|
||||
throw new RuntimeException("当前任务不存在");
|
||||
}
|
||||
|
||||
//判断是不是开始节点
|
||||
boolean startEvent = activitiUtil.isStartEvent(currentTask);
|
||||
if (startEvent) {
|
||||
//说明已经退回到开始节点 修改业务数据状态为完成 4审核不通过
|
||||
infoRunTaskDataService.updateStatus(applyVo.getBusinessKey(), applyVo.getBusinessType(), 4);
|
||||
//删除流程
|
||||
runtimeService.deleteProcessInstance(currentTask.getProcessInstanceId(), "退回到开始节点");
|
||||
} else {
|
||||
//退回任务
|
||||
activitiUtil.backProcess(currentTask);
|
||||
}
|
||||
|
||||
//新增历史记录
|
||||
InfoHiComment infoHiComment = new InfoHiComment();
|
||||
infoHiComment.setCreateTime(new Date());
|
||||
infoHiComment.setCreateName(SecurityUtils.getLoginUser().getUser().getNickName());
|
||||
infoHiComment.setMessage(applyVo.getComment());
|
||||
infoHiComment.setProcessInstanceId(applyVo.getProcessInstanceId());
|
||||
infoHiComment.setTaskName(currentTask.getName() + "-退回");
|
||||
infoHiCommentMapper.insertInfoHiComment(infoHiComment);
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MyTaskVo> selectGroupTask(MyTaskVo myTaskVo) {
|
||||
return myTaskMapper.selectGroupTask(myTaskVo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HistoryVo> selectHistory(String processInstanceId) {
|
||||
return myTaskMapper.selectHistory(processInstanceId);
|
||||
}
|
||||
@Override
|
||||
public JSONArray selectBefore(ApplyVo applyVo) {
|
||||
JSONArray beforeList = new JSONArray();
|
||||
// 获取当前任务信息
|
||||
Task currentTask = taskService.createTaskQuery().taskId(applyVo.getTaskId()).singleResult();
|
||||
|
||||
boolean startEvent = activitiUtil.isStartEvent(currentTask);
|
||||
JSONObject startObj = new JSONObject();
|
||||
startObj.putOnce("dkey", "0");
|
||||
startObj.putOnce("taskName", "不予通过");
|
||||
if (startEvent) {
|
||||
beforeList.add(startObj);
|
||||
return beforeList;
|
||||
}
|
||||
String processInstanceId = currentTask.getProcessInstanceId();
|
||||
// 取得所有历史任务按时间降序排序
|
||||
HistoryService historyService = SpringUtils.getBean(HistoryService.class);
|
||||
List<HistoricTaskInstance> htiList = historyService.createHistoricTaskInstanceQuery()
|
||||
.processInstanceId(processInstanceId)
|
||||
.orderByTaskCreateTime()
|
||||
.asc()
|
||||
.list();
|
||||
if (ObjectUtils.isEmpty(htiList) || htiList.size() < 2) {
|
||||
beforeList.add(startObj);
|
||||
return beforeList;
|
||||
}
|
||||
|
||||
// list里的第二条代表上一个任务
|
||||
// HistoricTaskInstance lastTask = htiList.get(1);
|
||||
// // list里第二条代表当前任务
|
||||
// HistoricTaskInstance curTask = htiList.get(0);
|
||||
// // 当前节点的executionId
|
||||
// String curExecutionId = curTask.getExecutionId();
|
||||
// // 上个节点的taskId
|
||||
// String lastTaskId = lastTask.getId();
|
||||
// // 上个节点的executionId
|
||||
// String lastExecutionId = lastTask.getExecutionId();
|
||||
// if (null == lastTaskId) {
|
||||
// throw new RuntimeException("上一任务不存在");
|
||||
// }
|
||||
for (int i = 0; i < htiList.size() - 1; i++) {
|
||||
HistoricTaskInstance historicTaskInstance = htiList.get(i);
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.putOnce("dkey", historicTaskInstance.getTaskDefinitionKey());
|
||||
jo.putOnce("taskName", historicTaskInstance.getName());
|
||||
beforeList.add(jo);
|
||||
}
|
||||
// for(HistoricTaskInstance historicTaskInstance : htiList){
|
||||
// JSONObject jo = new JSONObject();
|
||||
// jo.append("taskId", historicTaskInstance.getId());
|
||||
// jo.append("taskName", historicTaskInstance.getName());
|
||||
// beforeList.add(jo);
|
||||
// }
|
||||
beforeList.add(startObj);
|
||||
System.out.println(beforeList.toString());
|
||||
return beforeList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String fallBackTaskByTaskDefinitionKey(ApplyVo applyVo, String taskDefinitionKey) {
|
||||
// 获取当前任务信息
|
||||
Task currentTask = taskService.createTaskQuery().taskId(applyVo.getTaskId()).singleResult();
|
||||
if(taskDefinitionKey.equals("0")){
|
||||
//说明选择退回到开始节点 修改业务数据状态为完成 4审核不通过
|
||||
infoRunTaskDataService.updateStatus(applyVo.getBusinessKey(), applyVo.getBusinessType(), 4);
|
||||
//删除流程
|
||||
runtimeService.deleteProcessInstance(currentTask.getProcessInstanceId(), "退回到开始节点");
|
||||
}else if (StringUtils.isNotEmpty(applyVo.getTaskId())) {
|
||||
Task task = taskService.createTaskQuery().taskId(applyVo.getTaskId()).singleResult();
|
||||
activitiUtil.jumpToTask(task, taskDefinitionKey);
|
||||
}
|
||||
//新增历史记录
|
||||
InfoHiComment infoHiComment = new InfoHiComment();
|
||||
infoHiComment.setCreateTime(new Date());
|
||||
infoHiComment.setCreateName(SecurityUtils.getLoginUser().getUser().getNickName());
|
||||
infoHiComment.setMessage(applyVo.getComment());
|
||||
infoHiComment.setProcessInstanceId(applyVo.getProcessInstanceId());
|
||||
infoHiComment.setTaskName(currentTask.getName() + "-退回");
|
||||
infoHiCommentMapper.insertInfoHiComment(infoHiComment);
|
||||
return "success";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,61 +0,0 @@
|
||||
package com.huacai.activiti.util;
|
||||
|
||||
import org.activiti.bpmn.model.BpmnModel;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* bpmnModel bpmn模型
|
||||
* activityFontName 活动字体
|
||||
* labelFontName 标签字体
|
||||
* annotationFontName 标注字体
|
||||
* highLightedActivities 高亮活动节点(绿色)
|
||||
* runningActivityIdList 正在运行的活动节点(红色)
|
||||
* highLightedFlows 高亮顺序流(绿色)
|
||||
* lastFlowIdList 最后一条执行的顺序流(红色) ——————未实现
|
||||
*/
|
||||
public interface ICustomProcessDiagramGenerator {
|
||||
|
||||
//指定字体
|
||||
InputStream generateDiagramCustom(BpmnModel bpmnModel,
|
||||
List<String> highLightedActivities,
|
||||
List<String> runningActivityIdList,
|
||||
List<String> highLightedFlows,
|
||||
List<String> runningActivityFlowsIds,
|
||||
String activityFontName,
|
||||
String labelFontName,
|
||||
String annotationFontName);
|
||||
|
||||
InputStream generateDiagramCustom(BpmnModel bpmnModel,
|
||||
List<String> highLightedActivities,
|
||||
List<String> runningActivityIdList,
|
||||
List<String> highLightedFlows,
|
||||
String activityFontName,
|
||||
String labelFontName,
|
||||
String annotationFontName);
|
||||
|
||||
InputStream generateDiagramCustom(BpmnModel bpmnModel,
|
||||
List<String> highLightedActivities,
|
||||
List<String> highLightedFlows,
|
||||
String activityFontName,
|
||||
String labelFontName,
|
||||
String annotationFontName);
|
||||
|
||||
//无指定字体,使用默认字体
|
||||
InputStream generateDiagramCustom(BpmnModel bpmnModel,
|
||||
List<String> highLightedActivities,
|
||||
List<String> runningActivityIdList,
|
||||
List<String> highLightedFlows,
|
||||
List<String> runningActivityFlowsIds);
|
||||
|
||||
InputStream generateDiagramCustom(BpmnModel bpmnModel,
|
||||
List<String> highLightedActivities,
|
||||
List<String> runningActivityIdList,
|
||||
List<String> highLightedFlows);
|
||||
|
||||
InputStream generateDiagramCustom(BpmnModel bpmnModel,
|
||||
List<String> highLightedActivities,
|
||||
List<String> highLightedFlows);
|
||||
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
package com.huacai.activiti.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @projectName: haucai-activiti-kjglxt
|
||||
* @package: com.huacai.activiti.vo
|
||||
* @className: ActivitiVo
|
||||
* @author: 陈达勇
|
||||
* @description: TODO
|
||||
* @date: 2024/6/24 14:44
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
public class ActivitiVo {
|
||||
private String endTime;
|
||||
private String activityName;
|
||||
private String approver;
|
||||
}
|
||||
@ -1,21 +0,0 @@
|
||||
package com.huacai.activiti.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 审核vo
|
||||
*/
|
||||
@Data
|
||||
public class ApplyVo implements Serializable {
|
||||
private String processInstanceId;//流程实例ID
|
||||
private String comment;//审批意见
|
||||
private String taskId;//任务ID
|
||||
|
||||
private String businessKey;//业务ID
|
||||
private Integer businessType;//业务类型
|
||||
|
||||
private Map<String,Object> params;
|
||||
}
|
||||
@ -1,15 +0,0 @@
|
||||
package com.huacai.activiti.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class HistoryVo implements Serializable {
|
||||
private String taskName;
|
||||
private String COMMENT;
|
||||
private Date startTime;
|
||||
private Date endTime;
|
||||
private String nickName;
|
||||
}
|
||||
@ -1,35 +0,0 @@
|
||||
package com.huacai.activiti.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 我的任务
|
||||
*/
|
||||
@Data
|
||||
public class MyTaskVo implements Serializable {
|
||||
|
||||
private String taskId;
|
||||
private String taskName;
|
||||
private String processInstanceId;
|
||||
private String businessTitle;
|
||||
private String businessType;
|
||||
private String businessKey;
|
||||
private String applyUser;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date applyTime;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTaskTime;
|
||||
/** 流程状态 默认1 */
|
||||
private Integer processStatus;
|
||||
|
||||
//当前审批人
|
||||
private String assignee;
|
||||
|
||||
//拾取时间
|
||||
private Date claimTime;
|
||||
|
||||
}
|
||||
@ -1,94 +0,0 @@
|
||||
package com.huacai.infoHiComment.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.huacai.common.annotation.Excel;
|
||||
import com.huacai.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 审批记录对象 info_hi_comment
|
||||
*
|
||||
* @author huacai
|
||||
* @date 2024-03-11
|
||||
*/
|
||||
public class InfoHiComment extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 任务名称 */
|
||||
@Excel(name = "任务名称")
|
||||
private String taskName;
|
||||
|
||||
/** 操作日志 */
|
||||
@Excel(name = "操作日志")
|
||||
private String message;
|
||||
|
||||
/** 操作人 */
|
||||
@Excel(name = "操作人")
|
||||
private String createName;
|
||||
|
||||
/** 流程实例id */
|
||||
@Excel(name = "流程实例id")
|
||||
private String processInstanceId;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setTaskName(String taskName)
|
||||
{
|
||||
this.taskName = taskName;
|
||||
}
|
||||
|
||||
public String getTaskName()
|
||||
{
|
||||
return taskName;
|
||||
}
|
||||
public void setMessage(String message)
|
||||
{
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getMessage()
|
||||
{
|
||||
return message;
|
||||
}
|
||||
public void setCreateName(String createName)
|
||||
{
|
||||
this.createName = createName;
|
||||
}
|
||||
|
||||
public String getCreateName()
|
||||
{
|
||||
return createName;
|
||||
}
|
||||
public void setProcessInstanceId(String processInstanceId)
|
||||
{
|
||||
this.processInstanceId = processInstanceId;
|
||||
}
|
||||
|
||||
public String getProcessInstanceId()
|
||||
{
|
||||
return processInstanceId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("taskName", getTaskName())
|
||||
.append("message", getMessage())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("createName", getCreateName())
|
||||
.append("processInstanceId", getProcessInstanceId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -1,61 +0,0 @@
|
||||
package com.huacai.infoHiComment.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.huacai.infoHiComment.domain.InfoHiComment;
|
||||
|
||||
/**
|
||||
* 审批记录Mapper接口
|
||||
*
|
||||
* @author huacai
|
||||
* @date 2024-03-11
|
||||
*/
|
||||
public interface InfoHiCommentMapper {
|
||||
/**
|
||||
* 查询审批记录
|
||||
*
|
||||
* @param id 审批记录主键
|
||||
* @return 审批记录
|
||||
*/
|
||||
public InfoHiComment selectInfoHiCommentById(Long id);
|
||||
|
||||
/**
|
||||
* 查询审批记录列表
|
||||
*
|
||||
* @param infoHiComment 审批记录
|
||||
* @return 审批记录集合
|
||||
*/
|
||||
public List<InfoHiComment> selectInfoHiCommentList(InfoHiComment infoHiComment);
|
||||
|
||||
/**
|
||||
* 新增审批记录
|
||||
*
|
||||
* @param infoHiComment 审批记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertInfoHiComment(InfoHiComment infoHiComment);
|
||||
|
||||
/**
|
||||
* 修改审批记录
|
||||
*
|
||||
* @param infoHiComment 审批记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateInfoHiComment(InfoHiComment infoHiComment);
|
||||
|
||||
/**
|
||||
* 删除审批记录
|
||||
*
|
||||
* @param id 审批记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteInfoHiCommentById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除审批记录
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteInfoHiCommentByIds(Long[] ids);
|
||||
}
|
||||
@ -1,61 +0,0 @@
|
||||
package com.huacai.infoHiComment.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.huacai.infoHiComment.domain.InfoHiComment;
|
||||
|
||||
/**
|
||||
* 审批记录Service接口
|
||||
*
|
||||
* @author huacai
|
||||
* @date 2024-03-11
|
||||
*/
|
||||
public interface IInfoHiCommentService
|
||||
{
|
||||
/**
|
||||
* 查询审批记录
|
||||
*
|
||||
* @param id 审批记录主键
|
||||
* @return 审批记录
|
||||
*/
|
||||
public InfoHiComment selectInfoHiCommentById(Long id);
|
||||
|
||||
/**
|
||||
* 查询审批记录列表
|
||||
*
|
||||
* @param infoHiComment 审批记录
|
||||
* @return 审批记录集合
|
||||
*/
|
||||
public List<InfoHiComment> selectInfoHiCommentList(InfoHiComment infoHiComment);
|
||||
|
||||
/**
|
||||
* 新增审批记录
|
||||
*
|
||||
* @param infoHiComment 审批记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertInfoHiComment(InfoHiComment infoHiComment);
|
||||
|
||||
/**
|
||||
* 修改审批记录
|
||||
*
|
||||
* @param infoHiComment 审批记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateInfoHiComment(InfoHiComment infoHiComment);
|
||||
|
||||
/**
|
||||
* 批量删除审批记录
|
||||
*
|
||||
* @param ids 需要删除的审批记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteInfoHiCommentByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除审批记录信息
|
||||
*
|
||||
* @param id 审批记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteInfoHiCommentById(Long id);
|
||||
}
|
||||
@ -1,96 +0,0 @@
|
||||
package com.huacai.infoHiComment.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.huacai.common.utils.DateUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.huacai.infoHiComment.mapper.InfoHiCommentMapper;
|
||||
import com.huacai.infoHiComment.domain.InfoHiComment;
|
||||
import com.huacai.infoHiComment.service.IInfoHiCommentService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 审批记录Service业务层处理
|
||||
*
|
||||
* @author huacai
|
||||
* @date 2024-03-11
|
||||
*/
|
||||
@Service
|
||||
public class InfoHiCommentServiceImpl implements IInfoHiCommentService
|
||||
{
|
||||
@Resource
|
||||
private InfoHiCommentMapper infoHiCommentMapper;
|
||||
|
||||
/**
|
||||
* 查询审批记录
|
||||
*
|
||||
* @param id 审批记录主键
|
||||
* @return 审批记录
|
||||
*/
|
||||
@Override
|
||||
public InfoHiComment selectInfoHiCommentById(Long id)
|
||||
{
|
||||
return infoHiCommentMapper.selectInfoHiCommentById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询审批记录列表
|
||||
*
|
||||
* @param infoHiComment 审批记录
|
||||
* @return 审批记录
|
||||
*/
|
||||
@Override
|
||||
public List<InfoHiComment> selectInfoHiCommentList(InfoHiComment infoHiComment)
|
||||
{
|
||||
return infoHiCommentMapper.selectInfoHiCommentList(infoHiComment);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增审批记录
|
||||
*
|
||||
* @param infoHiComment 审批记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertInfoHiComment(InfoHiComment infoHiComment)
|
||||
{
|
||||
infoHiComment.setCreateTime(DateUtils.getNowDate());
|
||||
return infoHiCommentMapper.insertInfoHiComment(infoHiComment);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改审批记录
|
||||
*
|
||||
* @param infoHiComment 审批记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateInfoHiComment(InfoHiComment infoHiComment)
|
||||
{
|
||||
return infoHiCommentMapper.updateInfoHiComment(infoHiComment);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除审批记录
|
||||
*
|
||||
* @param ids 需要删除的审批记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteInfoHiCommentByIds(Long[] ids)
|
||||
{
|
||||
return infoHiCommentMapper.deleteInfoHiCommentByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除审批记录信息
|
||||
*
|
||||
* @param id 审批记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteInfoHiCommentById(Long id)
|
||||
{
|
||||
return infoHiCommentMapper.deleteInfoHiCommentById(id);
|
||||
}
|
||||
}
|
||||
@ -1,127 +0,0 @@
|
||||
package com.huacai.infoQingJia.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.huacai.common.utils.SecurityUtils;
|
||||
import com.huacai.infoRunTaskData.domain.InfoRunTaskData;
|
||||
import com.huacai.infoRunTaskData.service.IInfoRunTaskDataService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.huacai.common.annotation.Log;
|
||||
import com.huacai.common.core.controller.BaseController;
|
||||
import com.huacai.common.core.domain.AjaxResult;
|
||||
import com.huacai.common.enums.BusinessType;
|
||||
import com.huacai.infoQingJia.domain.InfoQingJia;
|
||||
import com.huacai.infoQingJia.service.IInfoQingJiaService;
|
||||
import com.huacai.common.utils.poi.ExcelUtil;
|
||||
import com.huacai.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 请假Controller
|
||||
*
|
||||
* @author huacai
|
||||
* @date 2024-02-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/infoQingJia/infoQingJia")
|
||||
public class InfoQingJiaController extends BaseController {
|
||||
@Resource
|
||||
private IInfoQingJiaService infoQingJiaService;
|
||||
|
||||
@Resource
|
||||
private IInfoRunTaskDataService iInfoRunTaskDataService;
|
||||
|
||||
/**
|
||||
* 查询请假列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('infoQingJia:infoQingJia:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(InfoQingJia infoQingJia) {
|
||||
startPage();
|
||||
List<InfoQingJia> list = infoQingJiaService.selectInfoQingJiaList(infoQingJia);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出请假列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('infoQingJia:infoQingJia:export')")
|
||||
@Log(title = "请假", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, InfoQingJia infoQingJia) {
|
||||
List<InfoQingJia> list = infoQingJiaService.selectInfoQingJiaList(infoQingJia);
|
||||
ExcelUtil<InfoQingJia> util = new ExcelUtil<InfoQingJia>(InfoQingJia.class);
|
||||
util.exportExcel(response, list, "请假数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取请假详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(infoQingJiaService.selectInfoQingJiaById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增请假
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('infoQingJia:infoQingJia:add')")
|
||||
@Log(title = "请假", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody InfoQingJia infoQingJia) {
|
||||
infoQingJia.setUserId(getUserId());
|
||||
int i = infoQingJiaService.insertInfoQingJia(infoQingJia);
|
||||
//向流程业务表中加入数据
|
||||
InfoRunTaskData infoRunTaskData = new InfoRunTaskData();
|
||||
infoRunTaskData.setBusinessKey(String.valueOf(infoQingJia.getId()));
|
||||
infoRunTaskData.setBusinessType(1);
|
||||
infoRunTaskData.setBusinessTitle(infoQingJia.getQingJiaTitle());
|
||||
infoRunTaskData.setApplyUser(SecurityUtils.getLoginUser().getUser().getNickName());//申请人
|
||||
|
||||
iInfoRunTaskDataService.insertInfoRunTaskData(infoRunTaskData);
|
||||
|
||||
return toAjax(i);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改请假
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('infoQingJia:infoQingJia:edit')")
|
||||
@Log(title = "请假", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody InfoQingJia infoQingJia) {
|
||||
|
||||
//修改业务中间表关系数据
|
||||
InfoRunTaskData infoRunTaskData = new InfoRunTaskData();
|
||||
infoRunTaskData.setBusinessTitle(infoQingJia.getQingJiaTitle());
|
||||
infoRunTaskData.setBusinessKey(String.valueOf(infoQingJia.getId()));
|
||||
infoRunTaskData.setBusinessType(1);
|
||||
iInfoRunTaskDataService.updateInfoRunTaskData(infoRunTaskData);
|
||||
|
||||
return toAjax(infoQingJiaService.updateInfoQingJia(infoQingJia));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除请假
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('infoQingJia:infoQingJia:remove')")
|
||||
@Log(title = "请假", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
//同时删除业务关系数据
|
||||
for (Long id : ids) {
|
||||
InfoQingJia infoQingJia = infoQingJiaService.selectInfoQingJiaById(id);
|
||||
iInfoRunTaskDataService.deleteData(String.valueOf(infoQingJia.getId()), 1);
|
||||
}
|
||||
return toAjax(infoQingJiaService.deleteInfoQingJiaByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -1,135 +0,0 @@
|
||||
package com.huacai.infoQingJia.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.huacai.common.annotation.Excel;
|
||||
import com.huacai.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 请假对象 info_qing_jia
|
||||
*
|
||||
* @author huacai
|
||||
* @date 2024-02-22
|
||||
*/
|
||||
public class InfoQingJia extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* $column.columnComment
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 请假标题
|
||||
*/
|
||||
@Excel(name = "请假标题")
|
||||
private String qingJiaTitle;
|
||||
|
||||
/**
|
||||
* 请假原因
|
||||
*/
|
||||
@Excel(name = "请假原因")
|
||||
private String qingJiaReason;
|
||||
|
||||
/**
|
||||
* 请假天数
|
||||
*/
|
||||
@Excel(name = "请假天数")
|
||||
private Long qingJiaDay;
|
||||
|
||||
/**
|
||||
* 请假人
|
||||
*/
|
||||
@Excel(name = "请假人")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer processStatus;
|
||||
|
||||
/**
|
||||
* 流程示例id
|
||||
*/
|
||||
private String processInstanceId;
|
||||
|
||||
public String getNickName() {
|
||||
return nickName;
|
||||
}
|
||||
|
||||
public void setNickName(String nickName) {
|
||||
this.nickName = nickName;
|
||||
}
|
||||
|
||||
public String getProcessInstanceId() {
|
||||
return processInstanceId;
|
||||
}
|
||||
|
||||
public void setProcessInstanceId(String processInstanceId) {
|
||||
this.processInstanceId = processInstanceId;
|
||||
}
|
||||
|
||||
public Integer getProcessStatus() {
|
||||
return processStatus;
|
||||
}
|
||||
|
||||
public void setProcessStatus(Integer processStatus) {
|
||||
this.processStatus = processStatus;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setQingJiaTitle(String qingJiaTitle) {
|
||||
this.qingJiaTitle = qingJiaTitle;
|
||||
}
|
||||
|
||||
public String getQingJiaTitle() {
|
||||
return qingJiaTitle;
|
||||
}
|
||||
|
||||
public void setQingJiaReason(String qingJiaReason) {
|
||||
this.qingJiaReason = qingJiaReason;
|
||||
}
|
||||
|
||||
public String getQingJiaReason() {
|
||||
return qingJiaReason;
|
||||
}
|
||||
|
||||
public void setQingJiaDay(Long qingJiaDay) {
|
||||
this.qingJiaDay = qingJiaDay;
|
||||
}
|
||||
|
||||
public Long getQingJiaDay() {
|
||||
return qingJiaDay;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("qingJiaTitle", getQingJiaTitle())
|
||||
.append("qingJiaReason", getQingJiaReason())
|
||||
.append("qingJiaDay", getQingJiaDay())
|
||||
.append("userId", getUserId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -1,61 +0,0 @@
|
||||
package com.huacai.infoQingJia.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.huacai.infoQingJia.domain.InfoQingJia;
|
||||
|
||||
/**
|
||||
* 请假Mapper接口
|
||||
*
|
||||
* @author huacai
|
||||
* @date 2024-02-22
|
||||
*/
|
||||
public interface InfoQingJiaMapper
|
||||
{
|
||||
/**
|
||||
* 查询请假
|
||||
*
|
||||
* @param id 请假主键
|
||||
* @return 请假
|
||||
*/
|
||||
public InfoQingJia selectInfoQingJiaById(Long id);
|
||||
|
||||
/**
|
||||
* 查询请假列表
|
||||
*
|
||||
* @param infoQingJia 请假
|
||||
* @return 请假集合
|
||||
*/
|
||||
public List<InfoQingJia> selectInfoQingJiaList(InfoQingJia infoQingJia);
|
||||
|
||||
/**
|
||||
* 新增请假
|
||||
*
|
||||
* @param infoQingJia 请假
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertInfoQingJia(InfoQingJia infoQingJia);
|
||||
|
||||
/**
|
||||
* 修改请假
|
||||
*
|
||||
* @param infoQingJia 请假
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateInfoQingJia(InfoQingJia infoQingJia);
|
||||
|
||||
/**
|
||||
* 删除请假
|
||||
*
|
||||
* @param id 请假主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteInfoQingJiaById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除请假
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteInfoQingJiaByIds(Long[] ids);
|
||||
}
|
||||
@ -1,61 +0,0 @@
|
||||
package com.huacai.infoQingJia.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.huacai.infoQingJia.domain.InfoQingJia;
|
||||
|
||||
/**
|
||||
* 请假Service接口
|
||||
*
|
||||
* @author huacai
|
||||
* @date 2024-02-22
|
||||
*/
|
||||
public interface IInfoQingJiaService
|
||||
{
|
||||
/**
|
||||
* 查询请假
|
||||
*
|
||||
* @param id 请假主键
|
||||
* @return 请假
|
||||
*/
|
||||
public InfoQingJia selectInfoQingJiaById(Long id);
|
||||
|
||||
/**
|
||||
* 查询请假列表
|
||||
*
|
||||
* @param infoQingJia 请假
|
||||
* @return 请假集合
|
||||
*/
|
||||
public List<InfoQingJia> selectInfoQingJiaList(InfoQingJia infoQingJia);
|
||||
|
||||
/**
|
||||
* 新增请假
|
||||
*
|
||||
* @param infoQingJia 请假
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertInfoQingJia(InfoQingJia infoQingJia);
|
||||
|
||||
/**
|
||||
* 修改请假
|
||||
*
|
||||
* @param infoQingJia 请假
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateInfoQingJia(InfoQingJia infoQingJia);
|
||||
|
||||
/**
|
||||
* 批量删除请假
|
||||
*
|
||||
* @param ids 需要删除的请假主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteInfoQingJiaByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除请假信息
|
||||
*
|
||||
* @param id 请假主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteInfoQingJiaById(Long id);
|
||||
}
|
||||
@ -1,87 +0,0 @@
|
||||
package com.huacai.infoQingJia.service.impl;
|
||||
|
||||
import com.huacai.infoQingJia.domain.InfoQingJia;
|
||||
import com.huacai.infoQingJia.mapper.InfoQingJiaMapper;
|
||||
import com.huacai.infoQingJia.service.IInfoQingJiaService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 请假Service业务层处理
|
||||
*
|
||||
* @author huacai
|
||||
* @date 2024-02-22
|
||||
*/
|
||||
@Service
|
||||
public class InfoQingJiaServiceImpl implements IInfoQingJiaService {
|
||||
@Resource
|
||||
private InfoQingJiaMapper infoQingJiaMapper;
|
||||
|
||||
/**
|
||||
* 查询请假
|
||||
*
|
||||
* @param id 请假主键
|
||||
* @return 请假
|
||||
*/
|
||||
@Override
|
||||
public InfoQingJia selectInfoQingJiaById(Long id) {
|
||||
return infoQingJiaMapper.selectInfoQingJiaById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询请假列表
|
||||
*
|
||||
* @param infoQingJia 请假
|
||||
* @return 请假
|
||||
*/
|
||||
@Override
|
||||
public List<InfoQingJia> selectInfoQingJiaList(InfoQingJia infoQingJia) {
|
||||
return infoQingJiaMapper.selectInfoQingJiaList(infoQingJia);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增请假
|
||||
*
|
||||
* @param infoQingJia 请假
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertInfoQingJia(InfoQingJia infoQingJia) {
|
||||
return infoQingJiaMapper.insertInfoQingJia(infoQingJia);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改请假
|
||||
*
|
||||
* @param infoQingJia 请假
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateInfoQingJia(InfoQingJia infoQingJia) {
|
||||
return infoQingJiaMapper.updateInfoQingJia(infoQingJia);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除请假
|
||||
*
|
||||
* @param ids 需要删除的请假主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteInfoQingJiaByIds(Long[] ids) {
|
||||
return infoQingJiaMapper.deleteInfoQingJiaByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除请假信息
|
||||
*
|
||||
* @param id 请假主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteInfoQingJiaById(Long id) {
|
||||
return infoQingJiaMapper.deleteInfoQingJiaById(id);
|
||||
}
|
||||
}
|
||||
@ -1,140 +0,0 @@
|
||||
package com.huacai.infoRunTaskData.domain;
|
||||
|
||||
import com.huacai.common.annotation.Excel;
|
||||
import com.huacai.common.core.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 正在运行任务的业务数据对象 info_run_task_data
|
||||
*
|
||||
* @author huacai
|
||||
* @date 2024-02-22
|
||||
*/
|
||||
public class InfoRunTaskData extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 业务businessId */
|
||||
@Excel(name = "业务businessId")
|
||||
private String businessKey;
|
||||
|
||||
/** 业务类型 */
|
||||
@Excel(name = "业务类型")
|
||||
private Integer businessType;
|
||||
|
||||
/** 业务标题 */
|
||||
@Excel(name = "业务标题")
|
||||
private String businessTitle;
|
||||
|
||||
/** 流程实例id */
|
||||
@Excel(name = "流程实例id")
|
||||
private String processInstanceId;
|
||||
|
||||
public Integer getProcessStatus() {
|
||||
return processStatus;
|
||||
}
|
||||
|
||||
public void setProcessStatus(Integer processStatus) {
|
||||
this.processStatus = processStatus;
|
||||
}
|
||||
|
||||
/** 流程状态 默认1 */
|
||||
@Excel(name = "流程状态 默认1")
|
||||
private Integer processStatus;
|
||||
|
||||
private String applyUser;//申请人
|
||||
|
||||
private Date applyTime;//发起申请时间
|
||||
|
||||
private String userIds;
|
||||
|
||||
public String getUserIds() {
|
||||
return userIds;
|
||||
}
|
||||
|
||||
public void setUserIds(String userIds) {
|
||||
this.userIds = userIds;
|
||||
}
|
||||
|
||||
public String getApplyUser() {
|
||||
return applyUser;
|
||||
}
|
||||
|
||||
public void setApplyUser(String applyUser) {
|
||||
this.applyUser = applyUser;
|
||||
}
|
||||
|
||||
public Date getApplyTime() {
|
||||
return applyTime;
|
||||
}
|
||||
|
||||
public void setApplyTime(Date applyTime) {
|
||||
this.applyTime = applyTime;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setBusinessKey(String businessKey)
|
||||
{
|
||||
this.businessKey = businessKey;
|
||||
}
|
||||
|
||||
public String getBusinessKey()
|
||||
{
|
||||
return businessKey;
|
||||
}
|
||||
|
||||
public Integer getBusinessType() {
|
||||
return businessType;
|
||||
}
|
||||
|
||||
public void setBusinessType(Integer businessType) {
|
||||
this.businessType = businessType;
|
||||
}
|
||||
|
||||
public void setBusinessTitle(String businessTitle)
|
||||
{
|
||||
this.businessTitle = businessTitle;
|
||||
}
|
||||
|
||||
public String getBusinessTitle()
|
||||
{
|
||||
return businessTitle;
|
||||
}
|
||||
public void setProcessInstanceId(String processInstanceId)
|
||||
{
|
||||
this.processInstanceId = processInstanceId;
|
||||
}
|
||||
|
||||
public String getProcessInstanceId()
|
||||
{
|
||||
return processInstanceId;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "InfoRunTaskData{" +
|
||||
"id=" + id +
|
||||
", businessKey=" + businessKey +
|
||||
", businessType=" + businessType +
|
||||
", businessTitle='" + businessTitle + '\'' +
|
||||
", processInstanceId='" + processInstanceId + '\'' +
|
||||
", processStatus=" + processStatus +
|
||||
", applyUser='" + applyUser + '\'' +
|
||||
", applyTime=" + applyTime +
|
||||
", userIds=" + userIds +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@ -1,88 +0,0 @@
|
||||
package com.huacai.infoRunTaskData.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.huacai.infoRunTaskData.domain.InfoRunTaskData;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 正在运行任务的业务数据Mapper接口
|
||||
*
|
||||
* @author huacai
|
||||
* @date 2024-02-22
|
||||
*/
|
||||
public interface InfoRunTaskDataMapper
|
||||
{
|
||||
/**
|
||||
* 查询正在运行任务的业务数据
|
||||
*
|
||||
* @param id 正在运行任务的业务数据主键
|
||||
* @return 正在运行任务的业务数据
|
||||
*/
|
||||
public InfoRunTaskData selectInfoRunTaskDataById(Long id);
|
||||
|
||||
/**
|
||||
* 查询正在运行任务的业务数据列表
|
||||
*
|
||||
* @param infoRunTaskData 正在运行任务的业务数据
|
||||
* @return 正在运行任务的业务数据集合
|
||||
*/
|
||||
public List<InfoRunTaskData> selectInfoRunTaskDataList(InfoRunTaskData infoRunTaskData);
|
||||
|
||||
/**
|
||||
* 新增正在运行任务的业务数据
|
||||
*
|
||||
* @param infoRunTaskData 正在运行任务的业务数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertInfoRunTaskData(InfoRunTaskData infoRunTaskData);
|
||||
|
||||
/**
|
||||
* 修改正在运行任务的业务数据
|
||||
*
|
||||
* @param infoRunTaskData 正在运行任务的业务数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateInfoRunTaskData(InfoRunTaskData infoRunTaskData);
|
||||
|
||||
/**
|
||||
* 修改正在运行任务的业务数据(用于修改业务)
|
||||
* @param infoRunTaskData
|
||||
* @return
|
||||
*/
|
||||
public int updateInfoRunTaskDatas(InfoRunTaskData infoRunTaskData);
|
||||
|
||||
/**
|
||||
* 删除正在运行任务的业务数据
|
||||
*
|
||||
* @param id 正在运行任务的业务数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteInfoRunTaskDataById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除正在运行任务的业务数据
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteInfoRunTaskDataByIds(Long[] ids);
|
||||
|
||||
|
||||
/**
|
||||
* 根据业务主键 和 类型查询详情
|
||||
* @param businessKey
|
||||
* @param businessType
|
||||
* @return
|
||||
*/
|
||||
public InfoRunTaskData selectDetailInfo(@Param("businessKey") String businessKey,
|
||||
@Param("businessType") Integer businessType);
|
||||
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param businessKey 业务主键
|
||||
* @param businessType 业务类型
|
||||
*/
|
||||
void deleteData(@Param("businessKey") String businessKey,
|
||||
@Param("businessType") Integer businessType);
|
||||
}
|
||||
@ -1,102 +0,0 @@
|
||||
package com.huacai.infoRunTaskData.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.huacai.infoRunTaskData.domain.InfoRunTaskData;
|
||||
|
||||
/**
|
||||
* 正在运行任务的业务数据Service接口
|
||||
*
|
||||
* @author huacai
|
||||
* @date 2024-02-22
|
||||
*/
|
||||
public interface IInfoRunTaskDataService
|
||||
{
|
||||
/**
|
||||
* 查询正在运行任务的业务数据
|
||||
*
|
||||
* @param id 正在运行任务的业务数据主键
|
||||
* @return 正在运行任务的业务数据
|
||||
*/
|
||||
public InfoRunTaskData selectInfoRunTaskDataById(Long id);
|
||||
|
||||
/**
|
||||
* 查询正在运行任务的业务数据列表
|
||||
*
|
||||
* @param infoRunTaskData 正在运行任务的业务数据
|
||||
* @return 正在运行任务的业务数据集合
|
||||
*/
|
||||
public List<InfoRunTaskData> selectInfoRunTaskDataList(InfoRunTaskData infoRunTaskData);
|
||||
|
||||
/**
|
||||
* 新增正在运行任务的业务数据
|
||||
*
|
||||
* @param infoRunTaskData 正在运行任务的业务数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertInfoRunTaskData(InfoRunTaskData infoRunTaskData);
|
||||
|
||||
/**
|
||||
* 修改正在运行任务的业务数据
|
||||
*
|
||||
* @param infoRunTaskData 正在运行任务的业务数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateInfoRunTaskData(InfoRunTaskData infoRunTaskData);
|
||||
|
||||
/**
|
||||
* 修改正在运行任务的业务数据(用于修改业务)
|
||||
*
|
||||
* @param infoRunTaskData 正在运行任务的业务数据
|
||||
* @return 结果
|
||||
*/
|
||||
int updateInfoRunTaskDatas(InfoRunTaskData infoRunTaskData);
|
||||
|
||||
/**
|
||||
* 批量删除正在运行任务的业务数据
|
||||
*
|
||||
* @param ids 需要删除的正在运行任务的业务数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteInfoRunTaskDataByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除正在运行任务的业务数据信息
|
||||
*
|
||||
* @param id 正在运行任务的业务数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteInfoRunTaskDataById(Long id);
|
||||
|
||||
/**
|
||||
* 根据业务主键 和 类型查询详情
|
||||
* @param businessKey
|
||||
* @param businessType
|
||||
* @return
|
||||
*/
|
||||
public InfoRunTaskData selectDetailInfo(String businessKey,Integer businessType);
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
* @param businessKey 业务主键
|
||||
* @param businessType 业务类型
|
||||
* @param status 状态
|
||||
*/
|
||||
public void updateStatus(String businessKey,Integer businessType,Integer status);
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
* @param businessKey 业务主键
|
||||
* @param businessType 业务类型
|
||||
* @param processInstanceId 流程示例id
|
||||
* @param status 状态
|
||||
*/
|
||||
public void updateStatus(String businessKey,Integer businessType,Integer status,String processInstanceId);
|
||||
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param businessKey 业务主键
|
||||
* @param businessType 业务类型
|
||||
*/
|
||||
void deleteData(String businessKey,Integer businessType);
|
||||
}
|
||||
@ -1,141 +0,0 @@
|
||||
package com.huacai.infoRunTaskData.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.huacai.infoRunTaskData.mapper.InfoRunTaskDataMapper;
|
||||
import com.huacai.infoRunTaskData.domain.InfoRunTaskData;
|
||||
import com.huacai.infoRunTaskData.service.IInfoRunTaskDataService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 正在运行任务的业务数据Service业务层处理
|
||||
*
|
||||
* @author huacai
|
||||
* @date 2024-02-22
|
||||
*/
|
||||
@Service
|
||||
public class InfoRunTaskDataServiceImpl implements IInfoRunTaskDataService {
|
||||
@Autowired
|
||||
private InfoRunTaskDataMapper infoRunTaskDataMapper;
|
||||
|
||||
/**
|
||||
* 查询正在运行任务的业务数据
|
||||
*
|
||||
* @param id 正在运行任务的业务数据主键
|
||||
* @return 正在运行任务的业务数据
|
||||
*/
|
||||
@Override
|
||||
public InfoRunTaskData selectInfoRunTaskDataById(Long id) {
|
||||
return infoRunTaskDataMapper.selectInfoRunTaskDataById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询正在运行任务的业务数据列表
|
||||
*
|
||||
* @param infoRunTaskData 正在运行任务的业务数据
|
||||
* @return 正在运行任务的业务数据
|
||||
*/
|
||||
@Override
|
||||
public List<InfoRunTaskData> selectInfoRunTaskDataList(InfoRunTaskData infoRunTaskData) {
|
||||
return infoRunTaskDataMapper.selectInfoRunTaskDataList(infoRunTaskData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增正在运行任务的业务数据
|
||||
*
|
||||
* @param infoRunTaskData 正在运行任务的业务数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertInfoRunTaskData(InfoRunTaskData infoRunTaskData) {
|
||||
return infoRunTaskDataMapper.insertInfoRunTaskData(infoRunTaskData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改正在运行任务的业务数据
|
||||
*
|
||||
* @param infoRunTaskData 正在运行任务的业务数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int updateInfoRunTaskData(InfoRunTaskData infoRunTaskData) {
|
||||
if (Objects.isNull(infoRunTaskData.getBusinessKey()) || Objects.isNull(infoRunTaskData.getBusinessType())) {
|
||||
throw new RuntimeException("缺少必要参数");
|
||||
}
|
||||
InfoRunTaskData infoRunTaskData1 = infoRunTaskDataMapper.selectDetailInfo(infoRunTaskData.getBusinessKey(), infoRunTaskData.getBusinessType());
|
||||
BeanUtils.copyProperties(infoRunTaskData, infoRunTaskData1);
|
||||
return infoRunTaskDataMapper.updateInfoRunTaskData(infoRunTaskData1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改正在运行任务的业务数据(用于修改业务)
|
||||
* @param infoRunTaskData 正在运行任务的业务数据
|
||||
* @return
|
||||
*/
|
||||
public int updateInfoRunTaskDatas(InfoRunTaskData infoRunTaskData) {
|
||||
if (Objects.isNull(infoRunTaskData.getBusinessKey()) || Objects.isNull(infoRunTaskData.getBusinessType())) {
|
||||
throw new RuntimeException("缺少必要参数");
|
||||
}
|
||||
InfoRunTaskData infoRunTaskData1 = infoRunTaskDataMapper.selectDetailInfo(infoRunTaskData.getBusinessKey(), infoRunTaskData.getBusinessType());
|
||||
BeanUtils.copyProperties(infoRunTaskData, infoRunTaskData1);
|
||||
return infoRunTaskDataMapper.updateInfoRunTaskDatas(infoRunTaskData1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除正在运行任务的业务数据
|
||||
*
|
||||
* @param ids 需要删除的正在运行任务的业务数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteInfoRunTaskDataByIds(Long[] ids) {
|
||||
return infoRunTaskDataMapper.deleteInfoRunTaskDataByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除正在运行任务的业务数据信息
|
||||
*
|
||||
* @param id 正在运行任务的业务数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteInfoRunTaskDataById(Long id) {
|
||||
return infoRunTaskDataMapper.deleteInfoRunTaskDataById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public InfoRunTaskData selectDetailInfo(String businessKey, Integer businessType) {
|
||||
return infoRunTaskDataMapper.selectDetailInfo(businessKey, businessType);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateStatus(String businessKey, Integer businessType, Integer status) {
|
||||
InfoRunTaskData infoRunTaskData = infoRunTaskDataMapper.selectDetailInfo(businessKey, businessType);
|
||||
infoRunTaskData.setProcessStatus(status);
|
||||
infoRunTaskDataMapper.updateInfoRunTaskData(infoRunTaskData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStatus(String businessKey, Integer businessType, Integer status, String processInstanceId) {
|
||||
InfoRunTaskData infoRunTaskData = infoRunTaskDataMapper.selectDetailInfo(businessKey, businessType);
|
||||
infoRunTaskData.setProcessStatus(status);
|
||||
infoRunTaskData.setProcessInstanceId(processInstanceId);
|
||||
if (status.compareTo(2) == 0) {
|
||||
//审核中的时候 修改申请时间
|
||||
infoRunTaskData.setApplyTime(new Date());
|
||||
}
|
||||
infoRunTaskDataMapper.updateInfoRunTaskData(infoRunTaskData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteData(String businessKey, Integer businessType) {
|
||||
infoRunTaskDataMapper.deleteData(businessKey, businessType);
|
||||
}
|
||||
}
|
||||
@ -1,81 +0,0 @@
|
||||
<?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.huacai.infoHiComment.mapper.InfoHiCommentMapper">
|
||||
|
||||
<resultMap type="InfoHiComment" id="InfoHiCommentResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="taskName" column="task_name"/>
|
||||
<result property="message" column="message"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="createName" column="create_name"/>
|
||||
<result property="processInstanceId" column="process_instance_id"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectInfoHiCommentVo">
|
||||
select id, task_name, message, create_time, create_name, process_instance_id
|
||||
from info_hi_comment
|
||||
</sql>
|
||||
|
||||
<select id="selectInfoHiCommentList" parameterType="InfoHiComment" resultMap="InfoHiCommentResult">
|
||||
<include refid="selectInfoHiCommentVo"/>
|
||||
<where>
|
||||
<if test="taskName != null and taskName != ''">and task_name like concat('%', #{taskName}, '%')</if>
|
||||
<if test="message != null and message != ''">and message = #{message}</if>
|
||||
<if test="createName != null and createName != ''">and create_name like concat('%', #{createName}, '%')
|
||||
</if>
|
||||
<if test="processInstanceId != null and processInstanceId != ''">and process_instance_id =
|
||||
#{processInstanceId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectInfoHiCommentById" parameterType="Long" resultMap="InfoHiCommentResult">
|
||||
<include refid="selectInfoHiCommentVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertInfoHiComment" parameterType="InfoHiComment" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into info_hi_comment
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="taskName != null">task_name,</if>
|
||||
<if test="message != null">message,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createName != null">create_name,</if>
|
||||
<if test="processInstanceId != null">process_instance_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="taskName != null">#{taskName},</if>
|
||||
<if test="message != null">#{message},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createName != null">#{createName},</if>
|
||||
<if test="processInstanceId != null">#{processInstanceId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateInfoHiComment" parameterType="InfoHiComment">
|
||||
update info_hi_comment
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="taskName != null">task_name = #{taskName},</if>
|
||||
<if test="message != null">message = #{message},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createName != null">create_name = #{createName},</if>
|
||||
<if test="processInstanceId != null">process_instance_id = #{processInstanceId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteInfoHiCommentById" parameterType="Long">
|
||||
delete
|
||||
from info_hi_comment
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteInfoHiCommentByIds" parameterType="String">
|
||||
delete from info_hi_comment where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -1,98 +0,0 @@
|
||||
<?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.huacai.infoQingJia.mapper.InfoQingJiaMapper">
|
||||
|
||||
<resultMap type="InfoQingJia" id="InfoQingJiaResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="qingJiaTitle" column="qing_jia_title"/>
|
||||
<result property="qingJiaReason" column="qing_jia_reason"/>
|
||||
<result property="qingJiaDay" column="qing_jia_day"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="processStatus" column="process_status"/>
|
||||
<result property="processInstanceId" column="process_instance_id"/>
|
||||
<result property="nickName" column="nick_name"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectInfoQingJiaVo">
|
||||
select id, qing_jia_title, qing_jia_reason, qing_jia_day, user_id
|
||||
from info_qing_jia
|
||||
</sql>
|
||||
|
||||
<select id="selectInfoQingJiaList" parameterType="InfoQingJia" resultMap="InfoQingJiaResult">
|
||||
SELECT
|
||||
t1.id,
|
||||
t1.qing_jia_title,
|
||||
t1.qing_jia_reason,
|
||||
t1.qing_jia_day,
|
||||
t1.user_id,
|
||||
t2.process_status,
|
||||
t2.process_instance_id
|
||||
FROM
|
||||
info_qing_jia t1
|
||||
LEFT JOIN ( SELECT * FROM info_run_task_data WHERE business_type = 1 ) t2 ON t1.id = t2.business_key
|
||||
<where>
|
||||
<if test="qingJiaTitle != null and qingJiaTitle != ''">and qing_jia_title like concat('%', #{qingJiaTitle},
|
||||
'%')
|
||||
</if>
|
||||
<if test="qingJiaReason != null and qingJiaReason != ''">and qing_jia_reason = #{qingJiaReason}</if>
|
||||
<if test="qingJiaDay != null ">and qing_jia_day = #{qingJiaDay}</if>
|
||||
<if test="userId != null ">and user_id = #{userId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectInfoQingJiaById" parameterType="Long" resultMap="InfoQingJiaResult">
|
||||
SELECT
|
||||
t1.id,
|
||||
t1.qing_jia_title,
|
||||
t1.qing_jia_reason,
|
||||
t1.qing_jia_day,
|
||||
t1.user_id ,
|
||||
t2.nick_name
|
||||
FROM
|
||||
info_qing_jia t1
|
||||
LEFT JOIN sys_user t2 ON t1.user_id = t2.user_id
|
||||
where t1.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertInfoQingJia" parameterType="InfoQingJia" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into info_qing_jia
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="qingJiaTitle != null and qingJiaTitle != ''">qing_jia_title,</if>
|
||||
<if test="qingJiaReason != null and qingJiaReason != ''">qing_jia_reason,</if>
|
||||
<if test="qingJiaDay != null">qing_jia_day,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="qingJiaTitle != null and qingJiaTitle != ''">#{qingJiaTitle},</if>
|
||||
<if test="qingJiaReason != null and qingJiaReason != ''">#{qingJiaReason},</if>
|
||||
<if test="qingJiaDay != null">#{qingJiaDay},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateInfoQingJia" parameterType="InfoQingJia">
|
||||
update info_qing_jia
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="qingJiaTitle != null and qingJiaTitle != ''">qing_jia_title = #{qingJiaTitle},</if>
|
||||
<if test="qingJiaReason != null and qingJiaReason != ''">qing_jia_reason = #{qingJiaReason},</if>
|
||||
<if test="qingJiaDay != null">qing_jia_day = #{qingJiaDay},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteInfoQingJiaById" parameterType="Long">
|
||||
delete
|
||||
from info_qing_jia
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteInfoQingJiaByIds" parameterType="String">
|
||||
delete from info_qing_jia where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -1,113 +0,0 @@
|
||||
<?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.huacai.infoRunTaskData.mapper.InfoRunTaskDataMapper">
|
||||
|
||||
<resultMap type="InfoRunTaskData" id="InfoRunTaskDataResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="businessKey" column="business_key" />
|
||||
<result property="businessType" column="business_type" />
|
||||
<result property="businessTitle" column="business_title" />
|
||||
<result property="processInstanceId" column="process_instance_id" />
|
||||
<result property="processStatus" column="process_status" />
|
||||
<result property="applyUser" column="apply_user" />
|
||||
<result property="applyTime" column="apply_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectInfoRunTaskDataVo">
|
||||
select id, business_key, business_type, business_title, process_instance_id, process_status, apply_user, apply_time from info_run_task_data
|
||||
</sql>
|
||||
|
||||
<select id="selectInfoRunTaskDataList" parameterType="InfoRunTaskData" resultMap="InfoRunTaskDataResult">
|
||||
<include refid="selectInfoRunTaskDataVo"/>
|
||||
<where>
|
||||
<if test="businessKey != null "> and business_key = #{businessKey}</if>
|
||||
<if test="businessType != null "> and business_type = #{businessType}</if>
|
||||
<if test="businessTitle != null and businessTitle != ''"> and business_title = #{businessTitle}</if>
|
||||
<if test="processInstanceId != null and processInstanceId != ''"> and process_instance_id = #{processInstanceId}</if>
|
||||
<if test="processStatus != null "> and process_status = #{processStatus}</if>
|
||||
<if test="applyUser != null and applyUser != ''"> and apply_user = #{applyUser}</if>
|
||||
<if test="applyTime != null "> and apply_time = #{applyTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectInfoRunTaskDataById" parameterType="Long" resultMap="InfoRunTaskDataResult">
|
||||
<include refid="selectInfoRunTaskDataVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="selectDetailInfo" resultType="com.huacai.infoRunTaskData.domain.InfoRunTaskData">
|
||||
<include refid="selectInfoRunTaskDataVo"/>
|
||||
where business_key = #{businessKey} and business_type=#{businessType}
|
||||
</select>
|
||||
|
||||
<insert id="insertInfoRunTaskData" parameterType="InfoRunTaskData" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into info_run_task_data
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="businessKey != null">business_key,</if>
|
||||
<if test="businessType != null">business_type,</if>
|
||||
<if test="businessTitle != null">business_title,</if>
|
||||
<if test="processInstanceId != null">process_instance_id,</if>
|
||||
<if test="processStatus != null">process_status,</if>
|
||||
<if test="applyUser != null">apply_user,</if>
|
||||
<if test="applyTime != null">apply_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="businessKey != null">#{businessKey},</if>
|
||||
<if test="businessType != null">#{businessType},</if>
|
||||
<if test="businessTitle != null">#{businessTitle},</if>
|
||||
<if test="processInstanceId != null">#{processInstanceId},</if>
|
||||
<if test="processStatus != null">#{processStatus},</if>
|
||||
<if test="applyUser != null">#{applyUser},</if>
|
||||
<if test="applyTime != null">#{applyTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!--修改正在运行任务的业务数据-->
|
||||
<update id="updateInfoRunTaskData" parameterType="InfoRunTaskData">
|
||||
update info_run_task_data
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="businessKey != null">business_key = #{businessKey},</if>
|
||||
<if test="businessType != null">business_type = #{businessType},</if>
|
||||
<if test="businessTitle != null">business_title = #{businessTitle},</if>
|
||||
<if test="processInstanceId != null">process_instance_id = #{processInstanceId},</if>
|
||||
<if test="processStatus != null">process_status = #{processStatus},</if>
|
||||
<if test="applyUser != null">apply_user = #{applyUser},</if>
|
||||
<if test="applyTime != null">apply_time = #{applyTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!--修改正在运行任务的业务数据(用于修改业务)-->
|
||||
<update id="updateInfoRunTaskDatas" parameterType="InfoRunTaskData">
|
||||
update info_run_task_data
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="businessKey != null">business_key = #{businessKey},</if>
|
||||
<if test="businessType != null">business_type = #{businessType},</if>
|
||||
<if test="businessTitle != null">business_title = #{businessTitle},</if>
|
||||
<if test="processInstanceId != null">process_instance_id = #{processInstanceId},</if>
|
||||
<if test="processStatus != null">process_status = #{processStatus},</if>
|
||||
<if test="applyUser != null">apply_user = #{applyUser},</if>
|
||||
<if test="applyTime != null">apply_time = #{applyTime},</if>
|
||||
<if test="userIds != null">user_ids = #{userIds},</if>
|
||||
</trim>
|
||||
where business_key = #{businessKey}
|
||||
</update>
|
||||
|
||||
<delete id="deleteInfoRunTaskDataById" parameterType="Long">
|
||||
delete from info_run_task_data where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteInfoRunTaskDataByIds" parameterType="String">
|
||||
delete from info_run_task_data where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="deleteData">
|
||||
delete
|
||||
from info_run_task_data
|
||||
where business_key = #{businessKey}
|
||||
and business_type = #{businessType}
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -1,76 +0,0 @@
|
||||
<?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.huacai.activiti.mapper.MyTaskMapper">
|
||||
|
||||
<select id="selectMyTask" resultType="com.huacai.activiti.vo.MyTaskVo">
|
||||
SELECT DISTINCT t1.ID_ as taskId,
|
||||
t1.NAME_ as taskName,
|
||||
t1.PROC_INST_ID_ as processInstanceId,
|
||||
t2.business_key as businessKey,
|
||||
t2.business_type as businessType,
|
||||
t2.business_title as businessTitle,
|
||||
t2.process_status as processStatus,
|
||||
t2.apply_user as applyUser,
|
||||
t2.user_ids as userIds,
|
||||
t2.apply_time as applyTime,
|
||||
t1.CREATE_TIME_ as createTaskTime,
|
||||
t1.CLAIM_TIME_ AS claimTime
|
||||
FROM act_ru_task t1
|
||||
INNER JOIN ACT_RU_IDENTITYLINK I ON I.TASK_ID_ = t1.ID_
|
||||
LEFT JOIN info_run_task_data t2 ON t1.PROC_INST_ID_ = t2.process_instance_id
|
||||
WHERE (t1.ASSIGNEE_ = #{assignee} OR (t1.ASSIGNEE_ IS NULL
|
||||
# AND I.TYPE_ = 'candidate' AND I.GROUP_ID_ = (SELECT
|
||||
AND I.TYPE_ = 'candidate' AND I.GROUP_ID_ in (SELECT
|
||||
sys_role.role_key
|
||||
FROM
|
||||
sys_user_role
|
||||
INNER JOIN
|
||||
sys_user
|
||||
ON
|
||||
sys_user_role.user_id = sys_user.user_id
|
||||
INNER JOIN
|
||||
sys_role
|
||||
ON
|
||||
sys_user_role.role_id = sys_role.role_id
|
||||
WHERE
|
||||
sys_user.user_id = #{assignee})
|
||||
OR (I.USER_ID_ = #{assignee}
|
||||
AND t1.CLAIM_TIME_ IS NULL AND I.TYPE_ = 'candidate'))
|
||||
|
||||
)
|
||||
<if test="processStatus != null "> and process_status = #{processStatus}</if>
|
||||
<if test="businessType != null "> and business_type = #{businessType}</if>
|
||||
<if test="businessTitle != null and businessTitle != ''"> and business_title like concat('%', #{businessTitle}, '%')</if>
|
||||
<if test="applyUser != null and applyUser != ''"> and apply_user like concat('%', #{applyUser}, '%')</if>
|
||||
</select>
|
||||
<select id="selectGroupTask" resultType="com.huacai.activiti.vo.MyTaskVo">
|
||||
SELECT DISTINCT RES.ID_ AS taskId,
|
||||
RES.NAME_ AS taskName,
|
||||
RES.PROC_INST_ID_ AS processInstanceId,
|
||||
t2.business_key AS businessKey,
|
||||
t2.business_type AS businessType,
|
||||
t2.business_title AS businessTitle,
|
||||
t2.apply_user AS applyUser,
|
||||
t2.apply_time AS applyTime,
|
||||
RES.CREATE_TIME_ AS createTaskTime
|
||||
FROM ACT_RU_TASK RES
|
||||
INNER JOIN ACT_RU_IDENTITYLINK I ON I.TASK_ID_ = RES.ID_
|
||||
INNER JOIN ACT_RE_PROCDEF D ON RES.PROC_DEF_ID_ = D.ID_
|
||||
LEFT JOIN info_run_task_data t2 ON RES.PROC_INST_ID_ = t2.process_instance_id
|
||||
WHERE RES.ASSIGNEE_ IS NULL
|
||||
AND I.TYPE_ = 'candidate'
|
||||
OR I.USER_ID_ = #{assignee}
|
||||
AND RES.CLAIM_TIME_ IS NULL
|
||||
ORDER BY RES.CREATE_TIME_ DESC
|
||||
</select>
|
||||
<select id="selectHistory" resultType="com.huacai.activiti.vo.HistoryVo">
|
||||
SELECT task_name AS taskName,
|
||||
create_time AS endTime,
|
||||
create_name AS nickName,
|
||||
message AS COMMENT
|
||||
FROM `info_hi_comment`
|
||||
WHERE process_instance_id = #{processInstanceId}
|
||||
</select>
|
||||
</mapper>
|
||||
@ -1,48 +0,0 @@
|
||||
<?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.huacai.activiti.mapper.MyProcessMapper">
|
||||
|
||||
|
||||
<select id="listData" resultType="com.huacai.activiti.domain.DefineVo">
|
||||
SELECT D.ID_ AS deploymentId,
|
||||
D.NAME_ AS deploymentName,
|
||||
P.ID_ AS processDefinitionId,
|
||||
P.NAME_ AS processDefinitionName,
|
||||
P.KEY_ AS processDefinitionKey,
|
||||
P.VERSION_ AS processDefinitionVersion,
|
||||
P.DEPLOYMENT_ID_ AS processDeploymentId,
|
||||
D.CATEGORY_ AS processDefinitionType,
|
||||
D.DEPLOY_TIME_ AS deployTime,
|
||||
p.RESOURCE_NAME_ AS resourceName
|
||||
FROM ACT_RE_DEPLOYMENT D
|
||||
JOIN ACT_RE_PROCDEF P ON D.ID_ = P.DEPLOYMENT_ID_
|
||||
<where>
|
||||
<if test="processDefinitionType != null and processDefinitionType != ''"> and D.CATEGORY_ like concat('%', #{processDefinitionType}, '%')</if>
|
||||
</where>
|
||||
ORDER BY D.DEPLOY_TIME_ DESC
|
||||
</select>
|
||||
|
||||
<select id="selectLastVersionProcessDefineKey" resultType="java.lang.String">
|
||||
SELECT P.KEY_ AS processDefinitionKey
|
||||
FROM ACT_RE_DEPLOYMENT D
|
||||
JOIN ACT_RE_PROCDEF P ON D.ID_ = P.DEPLOYMENT_ID_
|
||||
WHERE D.CATEGORY_ = #{processType}
|
||||
ORDER BY D.DEPLOY_TIME_ DESC LIMIT 1
|
||||
</select>
|
||||
|
||||
|
||||
<delete id="deleteHisTaskById">
|
||||
DELETE
|
||||
FROM `act_hi_taskinst`
|
||||
WHERE ID_ = #{id}
|
||||
</delete>
|
||||
<delete id="deleteHisTask">
|
||||
DELETE
|
||||
FROM `act_hi_taskinst`
|
||||
WHERE PROC_INST_ID_ = #{processInstanceId}
|
||||
AND TASK_DEF_KEY_ = #{taskDefKey}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@ -1,19 +0,0 @@
|
||||
<?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.huacai.activiti.mapper.UserMapper">
|
||||
<select id="listUsersToWorkflow" resultType="com.huacai.activiti.domain.UserVo">
|
||||
SELECT t1.user_id as userId,
|
||||
t1.nick_name as nickName,
|
||||
t2.dept_name as deptName
|
||||
FROM `sys_user` t1
|
||||
LEFT JOIN sys_dept t2 ON t1.dept_id = t2.dept_id
|
||||
WHERE t1.del_flag = 0
|
||||
</select>
|
||||
<select id="queryAllSysRole" resultType="com.huacai.activiti.domain.RoleVo">
|
||||
SELECT role_name as roleName,
|
||||
role_key as roleKey
|
||||
FROM `sys_role`
|
||||
</select>
|
||||
</mapper>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue