1、工作流历史任务实现
This commit is contained in:
parent
978d67737c
commit
f232a8d609
|
|
@ -9,6 +9,15 @@ export function listTask(query) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查询历史task列表
|
||||||
|
export function listHistoryTask(query) {
|
||||||
|
return request({
|
||||||
|
url: '/workflow/task/historyList',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 查询表单
|
// 查询表单
|
||||||
export function formDataShow(taskID) {
|
export function formDataShow(taskID) {
|
||||||
return request({
|
return request({
|
||||||
|
|
|
||||||
|
|
@ -8,14 +8,6 @@ export function listLeave(query) {
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 查询请假列表
|
|
||||||
export function listLeaveAll(query) {
|
|
||||||
return request({
|
|
||||||
url: '/workflow/workflow/leave/listAll',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询请假详细
|
// 查询请假详细
|
||||||
export function getLeave(id) {
|
export function getLeave(id) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,121 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="tastList">
|
||||||
|
<el-table-column label="流程名称" align="center" prop="instanceName"/>
|
||||||
|
<el-table-column label="任务节点名称" align="center" prop="name"/>
|
||||||
|
<el-table-column label="创建时间" align="center" prop="createdDate"/>
|
||||||
|
<el-table-column label="结束时间" align="center" prop="endDate"/>
|
||||||
|
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="details(scope.row)"
|
||||||
|
>详情
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<!-- 审批对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" v-if="open" width="500px" append-to-body>
|
||||||
|
<leaveHistoryForm :businessKey="businessKey" v-if="'leave'===definitionKey"/>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {listHistoryTask} from "@/api/business/workflow/activiti/task";
|
||||||
|
import leaveHistoryForm from "@/views/business/workflow/workflow/leave/leaveHistoryForm";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "HistoryTask",
|
||||||
|
components: {leaveHistoryForm},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
id: '',
|
||||||
|
definitionKey: '',
|
||||||
|
businessKey: '',
|
||||||
|
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
},
|
||||||
|
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 请假表格数据
|
||||||
|
tastList: [],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listHistoryTask(this.queryParams).then(response => {
|
||||||
|
this.tastList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
/** 详情按钮操作 */
|
||||||
|
details(row) {
|
||||||
|
this.reset();
|
||||||
|
this.definitionKey = row.definitionKey;
|
||||||
|
this.businessKey = row.businessKey;
|
||||||
|
this.id = row.id;
|
||||||
|
|
||||||
|
this.open = true;
|
||||||
|
this.title = "详情";
|
||||||
|
},
|
||||||
|
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.definitionKey = '',
|
||||||
|
this.businessKey = '',
|
||||||
|
this.form = {
|
||||||
|
formData: [],
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
@ -1,228 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
||||||
<el-form-item label="请假类型" prop="type">
|
|
||||||
<el-select v-model="queryParams.type" placeholder="请选择请假类型" clearable size="small">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in typeOptions"
|
|
||||||
:key="dict.dictValue"
|
|
||||||
:label="dict.dictLabel"
|
|
||||||
:value="dict.dictValue"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="标题" prop="title">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.title"
|
|
||||||
placeholder="请输入标题"
|
|
||||||
clearable
|
|
||||||
size="small"
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="状态" prop="state">
|
|
||||||
<el-select v-model="queryParams.state" placeholder="请选择状态" clearable size="small">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in stateOptions"
|
|
||||||
:key="dict.dictValue"
|
|
||||||
:label="dict.dictLabel"
|
|
||||||
:value="dict.dictValue"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<!-- <el-form-item label="创建者" prop="createBy">-->
|
|
||||||
<!-- <el-select v-model="queryParams.createBy" placeholder="请选择创建者" clearable size="small">-->
|
|
||||||
<!-- <el-option label="请选择字典生成" value="" />-->
|
|
||||||
<!-- </el-select>-->
|
|
||||||
<!-- </el-form-item>-->
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
icon="el-icon-download"
|
|
||||||
size="mini"
|
|
||||||
@click="handleExport"
|
|
||||||
v-hasPermi="['workflow:leave:export']"
|
|
||||||
>导出
|
|
||||||
</el-button>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="leaveList">
|
|
||||||
<el-table-column type="selection" width="55" align="center"/>
|
|
||||||
<!-- <el-table-column label="主键ID" align="center" prop="id" />-->
|
|
||||||
<el-table-column label="请假类型" align="center" prop="type" :formatter="typeFormat"/>
|
|
||||||
<el-table-column label="标题" align="center" prop="title"/>
|
|
||||||
<el-table-column label="原因" align="center" prop="reason"/>
|
|
||||||
<el-table-column label="开始时间" align="center" prop="leaveStartTime" width="180">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ parseTime(scope.row.leaveStartTime, '{y}-{m}-{d}') }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="结束时间" align="center" prop="leaveEndTime" width="180">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ parseTime(scope.row.leaveEndTime, '{y}-{m}-{d}') }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="创建人" align="center" prop="createName"/>
|
|
||||||
<el-table-column label="状态" align="center" prop="state" :formatter="stateFormat"/>
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
@click="historyFory(scope.row)"
|
|
||||||
v-hasPermi="['workflow:leave:edit']"
|
|
||||||
>审批详情
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<pagination
|
|
||||||
v-show="total>0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNum"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 查看详细信息话框 -->
|
|
||||||
<el-dialog :title="title" :visible.sync="open2" width="500px" append-to-body>
|
|
||||||
<leaveHistoryForm :businessKey="businessKey" v-if="open2"/>
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button @click="open2=!open2">关闭</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
import leaveHistoryForm from "./leaveHistoryForm";
|
|
||||||
import {exportLeave, listLeaveAll} from "@/api/business/workflow/workflow/leave";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'LeaveAll',
|
|
||||||
components: {leaveHistoryForm},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
businessKey: '',
|
|
||||||
//用户信息
|
|
||||||
user: {},
|
|
||||||
// 遮罩层
|
|
||||||
loading: true,
|
|
||||||
// 选中数组
|
|
||||||
ids: [],
|
|
||||||
// 非单个禁用
|
|
||||||
single: true,
|
|
||||||
// 非多个禁用
|
|
||||||
multiple: true,
|
|
||||||
// 显示搜索条件
|
|
||||||
showSearch: true,
|
|
||||||
// 总条数
|
|
||||||
total: 0,
|
|
||||||
// 请假表格数据
|
|
||||||
leaveList: [],
|
|
||||||
// 弹出层标题
|
|
||||||
title: '',
|
|
||||||
// 是否显示弹出层
|
|
||||||
open: false,
|
|
||||||
open2: false,
|
|
||||||
// 请假类型字典
|
|
||||||
typeOptions: [],
|
|
||||||
// 状态字典
|
|
||||||
stateOptions: [],
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
type: null,
|
|
||||||
title: null,
|
|
||||||
reason: null,
|
|
||||||
leaveStartTime: null,
|
|
||||||
leaveEndTime: null,
|
|
||||||
instanceId: null,
|
|
||||||
state: null,
|
|
||||||
createBy: null
|
|
||||||
},
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getList()
|
|
||||||
this.getDicts('activiti_leave_type').then(response => {
|
|
||||||
this.typeOptions = response.data
|
|
||||||
})
|
|
||||||
this.getDicts('activiti_flow_type').then(response => {
|
|
||||||
this.stateOptions = response.data
|
|
||||||
})
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
|
|
||||||
/** 查询请假列表 */
|
|
||||||
getList() {
|
|
||||||
this.loading = true
|
|
||||||
listLeaveAll(this.queryParams).then(response => {
|
|
||||||
this.leaveList = response.rows
|
|
||||||
this.total = response.total
|
|
||||||
this.loading = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 请假类型字典翻译
|
|
||||||
typeFormat(row, column) {
|
|
||||||
return this.selectDictLabel(this.typeOptions, row.type)
|
|
||||||
},
|
|
||||||
// 状态字典翻译
|
|
||||||
stateFormat(row, column) {
|
|
||||||
return this.selectDictLabel(this.stateOptions, row.state)
|
|
||||||
},
|
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
handleQuery() {
|
|
||||||
this.queryParams.pageNum = 1
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
resetQuery() {
|
|
||||||
this.resetForm('queryForm')
|
|
||||||
this.handleQuery()
|
|
||||||
},
|
|
||||||
|
|
||||||
/** 审批详情 */
|
|
||||||
historyFory(row) {
|
|
||||||
|
|
||||||
this.businessKey = row.id
|
|
||||||
this.open2 = true
|
|
||||||
this.title = '审批详情'
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
|
||||||
handleExport() {
|
|
||||||
const queryParams = this.queryParams
|
|
||||||
this.$confirm('是否确认导出所有请假数据项?', '警告', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning'
|
|
||||||
}).then(function () {
|
|
||||||
return exportLeave(queryParams)
|
|
||||||
}).then(response => {
|
|
||||||
this.download(response.msg)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
@ -60,7 +60,8 @@ public class MailServer {
|
||||||
* @param mailBean 邮箱实体
|
* @param mailBean 邮箱实体
|
||||||
*/
|
*/
|
||||||
@MailLog
|
@MailLog
|
||||||
@Retryable(maxAttempts = 2, value = MailException.class) //当抛出MailException异常时,该方法重试两次
|
//当抛出MailException异常时,该方法重试两次
|
||||||
|
@Retryable(maxAttempts = 2, value = MailException.class)
|
||||||
public Boolean sendMail(MailBean mailBean) {
|
public Boolean sendMail(MailBean mailBean) {
|
||||||
|
|
||||||
if (redisService.hasKey(MAIL_STATUS)) {
|
if (redisService.hasKey(MAIL_STATUS)) {
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ public class ZolNotebookServiceImpl extends ServiceImpl<ZolNotebookMapper, ZolNo
|
||||||
.like(ZolNotebook::getDescription, condition);
|
.like(ZolNotebook::getDescription, condition);
|
||||||
});
|
});
|
||||||
//排序规则
|
//排序规则
|
||||||
wr.orderByAsc(ZolNotebook::getSort).orderByDesc(ZolNotebook::getId);
|
wr.orderByDesc(ZolNotebook::getId);
|
||||||
return this.page(startPageMP, wr);
|
return this.page(startPageMP, wr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ public class ZolPhoneServiceImpl extends ServiceImpl<ZolPhoneMapper, ZolPhone> i
|
||||||
});
|
});
|
||||||
|
|
||||||
//排序规则
|
//排序规则
|
||||||
wr.orderByAsc(ZolPhone::getSort).orderByDesc(ZolPhone::getId);
|
wr.orderByDesc(ZolPhone::getId);
|
||||||
|
|
||||||
return this.page(startPageMP,wr);
|
return this.page(startPageMP,wr);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,11 +35,22 @@ public class TaskController extends BaseController {
|
||||||
@RequiresPermissions("activiti:task:list")
|
@RequiresPermissions("activiti:task:list")
|
||||||
public TableDataInfo getTasks() {
|
public TableDataInfo getTasks() {
|
||||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||||
Page<ActTaskDTO> hashMaps = actTaskService.selectProcessDefinitionList(pageDomain);
|
Page<ActTaskDTO> hashMaps = actTaskService.selectTaskList(pageDomain);
|
||||||
return getDataTable(hashMaps);
|
return getDataTable(hashMaps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//获取我的历史任务
|
||||||
|
@GetMapping("historyList")
|
||||||
|
@RequiresPermissions("activiti:task:historyList")
|
||||||
|
public TableDataInfo getHistoryTasks() {
|
||||||
|
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||||
|
Page<ActTaskDTO> hashMaps = actTaskService.selectHistoryTaskList(pageDomain);
|
||||||
|
return getDataTable(hashMaps);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//渲染表单
|
//渲染表单
|
||||||
@GetMapping(value = "/formDataShow/{taskID}")
|
@GetMapping(value = "/formDataShow/{taskID}")
|
||||||
@RequiresPermissions("activiti:task:query")
|
@RequiresPermissions("activiti:task:query")
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
package com.xjs.activiti.domain.dto;
|
package com.xjs.activiti.domain.dto;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||||
import org.activiti.api.task.model.Task;
|
import org.activiti.api.task.model.Task;
|
||||||
|
import org.activiti.engine.history.HistoricProcessInstance;
|
||||||
|
import org.activiti.engine.history.HistoricTaskInstance;
|
||||||
import org.activiti.engine.runtime.ProcessInstance;
|
import org.activiti.engine.runtime.ProcessInstance;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
@ -24,8 +25,10 @@ public class ActTaskDTO extends BaseEntity {
|
||||||
|
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date createdDate;
|
private Date createdDate;
|
||||||
|
|
||||||
|
private Date endDate;
|
||||||
|
|
||||||
private String instanceName;
|
private String instanceName;
|
||||||
private String definitionKey;
|
private String definitionKey;
|
||||||
private String businessKey;
|
private String businessKey;
|
||||||
|
|
@ -49,6 +52,25 @@ public class ActTaskDTO extends BaseEntity {
|
||||||
this.businessKey = processInstance.getBusinessKey();
|
this.businessKey = processInstance.getBusinessKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ActTaskDTO(HistoricTaskInstance historicTaskInstance, HistoricProcessInstance processInstance) {
|
||||||
|
this.id = historicTaskInstance.getId();
|
||||||
|
this.processInstanceId = historicTaskInstance.getProcessInstanceId();
|
||||||
|
this.name = historicTaskInstance.getName();
|
||||||
|
this.createdDate = historicTaskInstance.getCreateTime();
|
||||||
|
this.endDate = historicTaskInstance.getEndTime();
|
||||||
|
this.instanceName = processInstance.getName();
|
||||||
|
this.definitionKey = processInstance.getProcessDefinitionKey();
|
||||||
|
this.businessKey = processInstance.getBusinessKey();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getEndDate() {
|
||||||
|
return endDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndDate(Date endDate) {
|
||||||
|
this.endDate = endDate;
|
||||||
|
}
|
||||||
|
|
||||||
public String getProcessInstanceId() {
|
public String getProcessInstanceId() {
|
||||||
return processInstanceId;
|
return processInstanceId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,11 @@ import java.util.List;
|
||||||
public interface IActTaskService {
|
public interface IActTaskService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询流程定义列表
|
* 查询待办任务列表
|
||||||
* @param pageDomain 分页参数
|
* @param pageDomain 分页参数
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Page<ActTaskDTO> selectProcessDefinitionList(PageDomain pageDomain);
|
Page<ActTaskDTO> selectTaskList(PageDomain pageDomain);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据任务id查询表格数据
|
* 根据任务id查询表格数据
|
||||||
|
|
@ -40,4 +40,11 @@ public interface IActTaskService {
|
||||||
* @throws ParseException
|
* @throws ParseException
|
||||||
*/
|
*/
|
||||||
int formDataSave(String taskID, List<ActWorkflowFormDataDTO> awfs) throws ParseException;
|
int formDataSave(String taskID, List<ActWorkflowFormDataDTO> awfs) throws ParseException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询已办任务
|
||||||
|
* @param pageDomain -分页参数
|
||||||
|
* @return page
|
||||||
|
*/
|
||||||
|
Page<ActTaskDTO> selectHistoryTaskList(PageDomain pageDomain);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,10 @@ import org.activiti.engine.HistoryService;
|
||||||
import org.activiti.engine.RepositoryService;
|
import org.activiti.engine.RepositoryService;
|
||||||
import org.activiti.engine.RuntimeService;
|
import org.activiti.engine.RuntimeService;
|
||||||
import org.activiti.engine.TaskService;
|
import org.activiti.engine.TaskService;
|
||||||
|
import org.activiti.engine.history.HistoricProcessInstance;
|
||||||
import org.activiti.engine.history.HistoricTaskInstance;
|
import org.activiti.engine.history.HistoricTaskInstance;
|
||||||
|
import org.activiti.engine.history.HistoricTaskInstanceQuery;
|
||||||
|
import org.activiti.engine.impl.persistence.entity.HistoricProcessInstanceEntityImpl;
|
||||||
import org.activiti.engine.runtime.ProcessInstance;
|
import org.activiti.engine.runtime.ProcessInstance;
|
||||||
import org.activiti.engine.task.TaskQuery;
|
import org.activiti.engine.task.TaskQuery;
|
||||||
import org.activiti.runtime.api.model.impl.APITaskConverter;
|
import org.activiti.runtime.api.model.impl.APITaskConverter;
|
||||||
|
|
@ -64,7 +67,7 @@ public class ActTaskServiceImpl implements IActTaskService {
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<ActTaskDTO> selectProcessDefinitionList(PageDomain pageDomain) {
|
public Page<ActTaskDTO> selectTaskList(PageDomain pageDomain) {
|
||||||
Page<ActTaskDTO> list = new Page<ActTaskDTO>();
|
Page<ActTaskDTO> list = new Page<ActTaskDTO>();
|
||||||
|
|
||||||
//org.activiti.api.runtime.shared.query.Page<Task> pageTasks = taskRuntime
|
//org.activiti.api.runtime.shared.query.Page<Task> pageTasks = taskRuntime
|
||||||
|
|
@ -109,6 +112,15 @@ public class ActTaskServiceImpl implements IActTaskService {
|
||||||
|
|
||||||
org.activiti.engine.task.Task task = taskService.createTaskQuery().taskId(taskID).singleResult();
|
org.activiti.engine.task.Task task = taskService.createTaskQuery().taskId(taskID).singleResult();
|
||||||
|
|
||||||
|
UserTask userTask;
|
||||||
|
if (task == null) {
|
||||||
|
HistoricTaskInstance historicTask = historyService.createHistoricTaskInstanceQuery().taskId(taskID).singleResult();
|
||||||
|
userTask = (UserTask) repositoryService.getBpmnModel(historicTask.getProcessDefinitionId()).getFlowElement(historicTask.getFormKey());
|
||||||
|
|
||||||
|
} else {
|
||||||
|
userTask = (UserTask) repositoryService.getBpmnModel(task.getProcessDefinitionId()).getFlowElement(task.getFormKey());
|
||||||
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------
|
/* ------------------------------------------------------------------------------
|
||||||
FormProperty_0ueitp2--__!!类型--__!!名称--__!!是否参数--__!!默认值
|
FormProperty_0ueitp2--__!!类型--__!!名称--__!!是否参数--__!!默认值
|
||||||
例子:
|
例子:
|
||||||
|
|
@ -121,7 +133,6 @@ public class ActTaskServiceImpl implements IActTaskService {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//注意!!!!!!!!:表单Key必须要任务编号一模一样,因为参数需要任务key,但是无法获取,只能获取表单key“task.getFormKey()”当做任务key
|
//注意!!!!!!!!:表单Key必须要任务编号一模一样,因为参数需要任务key,但是无法获取,只能获取表单key“task.getFormKey()”当做任务key
|
||||||
UserTask userTask = (UserTask) repositoryService.getBpmnModel(task.getProcessDefinitionId()).getFlowElement(task.getFormKey());
|
|
||||||
|
|
||||||
if (userTask == null) {
|
if (userTask == null) {
|
||||||
return null;
|
return null;
|
||||||
|
|
@ -171,6 +182,46 @@ public class ActTaskServiceImpl implements IActTaskService {
|
||||||
return actWorkflowFormDataService.insertActWorkflowFormDatas(acwfds);
|
return actWorkflowFormDataService.insertActWorkflowFormDatas(acwfds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<ActTaskDTO> selectHistoryTaskList(PageDomain pageDomain) {
|
||||||
|
Page<ActTaskDTO> list = new Page<ActTaskDTO>();
|
||||||
|
|
||||||
|
Pageable pageable = Pageable.of((pageDomain.getPageNum() - 1) * pageDomain.getPageSize(), pageDomain.getPageSize());
|
||||||
|
String username = SecurityUtils.getUsername();
|
||||||
|
List<String> postCode = SecurityUtils.getLoginUser().getSysUser().getPostCode();
|
||||||
|
HistoricTaskInstanceQuery taskInstanceQuery = historyService.createHistoricTaskInstanceQuery()
|
||||||
|
.or()
|
||||||
|
.taskAssignee(username)
|
||||||
|
.taskOwner(username)
|
||||||
|
.taskCandidateUser(username, postCode)
|
||||||
|
.endOr();
|
||||||
|
|
||||||
|
List<HistoricTaskInstance> taskInstanceList = taskInstanceQuery.orderByHistoricTaskInstanceStartTime().desc().listPage(pageable.getStartIndex(), pageable.getMaxItems());
|
||||||
|
|
||||||
|
Set<String> processInstanceIdIds = taskInstanceList.parallelStream().map(HistoricTaskInstance::getProcessInstanceId).collect(Collectors.toSet());
|
||||||
|
List<HistoricProcessInstance> processInstanceList = new ArrayList<>();
|
||||||
|
if (CollUtil.isNotEmpty(processInstanceIdIds)) {
|
||||||
|
processInstanceList = historyService.createHistoricProcessInstanceQuery().processInstanceIds(processInstanceIdIds).list();
|
||||||
|
}
|
||||||
|
|
||||||
|
List<HistoricProcessInstance> finalProcessInstanceList = processInstanceList;
|
||||||
|
List<ActTaskDTO> actTaskDTOS = taskInstanceList.stream()
|
||||||
|
.map(t ->
|
||||||
|
|
||||||
|
new ActTaskDTO(t, finalProcessInstanceList.parallelStream()
|
||||||
|
.filter(pi ->
|
||||||
|
t.getProcessInstanceId().equals(pi.getId())).findAny().orElse(new HistoricProcessInstanceEntityImpl())
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
list.addAll(actTaskDTOS);
|
||||||
|
|
||||||
|
long count = taskInstanceQuery.count();
|
||||||
|
list.setTotal(count);
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task创建查询
|
* task创建查询
|
||||||
|
|
@ -188,7 +239,9 @@ public class ActTaskServiceImpl implements IActTaskService {
|
||||||
.taskCandidateOrAssigned(username, postCode)
|
.taskCandidateOrAssigned(username, postCode)
|
||||||
.taskOwner(username)
|
.taskOwner(username)
|
||||||
.endOr();
|
.endOr();
|
||||||
List<Task> tasks = taskConverter.from(taskQuery.listPage(pageable.getStartIndex(), pageable.getMaxItems()));
|
|
||||||
|
List<org.activiti.engine.task.Task> list = taskQuery.listPage(pageable.getStartIndex(), pageable.getMaxItems());
|
||||||
|
List<Task> tasks = taskConverter.from(list);
|
||||||
return new PageImpl<>(tasks, Math.toIntExact(taskQuery.count()));
|
return new PageImpl<>(tasks, Math.toIntExact(taskQuery.count()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,18 +49,6 @@ public class WorkflowLeaveController extends BaseController {
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询请假列表
|
|
||||||
*/
|
|
||||||
@GetMapping("/listAll")
|
|
||||||
@RequiresPermissions("workflow:leave:list")
|
|
||||||
@ApiOperation("查询请假列表")
|
|
||||||
public TableDataInfo listAll(WorkflowLeave workflowLeave) {
|
|
||||||
startPage();
|
|
||||||
List<WorkflowLeave> list = workflowLeaveService.selectWorkflowLeaveList(workflowLeave);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出请假列表
|
* 导出请假列表
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue