提交代码
parent
4dc7cf73a8
commit
f980ce555c
|
@ -186,7 +186,7 @@ END AS commentResult,
|
|||
FROM
|
||||
act_hi_taskinst ht
|
||||
LEFT JOIN act_hi_comment hc ON hc.TASK_ID_ = ht.ID_ or (hc.TASK_ID_ is null and hc.PROC_INST_ID_ = ht.PROC_INST_ID_)
|
||||
LEFT JOIN act_hi_identitylink hi on hi.TYPE_ = 'candidate' and hi.TASK_ID_ = ht.ID_ and hi.USER_ID_ IS NULL
|
||||
LEFT JOIN act_hi_identitylink hi on hi.TASK_ID_ = ht.ID_ and hi.group_Id_ IS NOT NULL
|
||||
left JOIN sys_role r on r.role_id = hi.group_Id_
|
||||
LEFT JOIN sys_user ru ON ru.user_id = ht.ASSIGNEE_
|
||||
LEFT JOIN sys_dept rd ON rd.dept_id = ru.dept_id
|
||||
|
|
|
@ -55,8 +55,8 @@ public class SysUserController extends BaseController
|
|||
|
||||
/**
|
||||
* 获取用户列表
|
||||
* @PreAuthorize("@ss.hasPermi('system:user:list')")
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysUser user)
|
||||
{
|
||||
|
@ -96,8 +96,8 @@ public class SysUserController extends BaseController
|
|||
|
||||
/**
|
||||
* 根据用户编号获取详细信息
|
||||
* @PreAuthorize("@ss.hasPermi('system:user:query')")
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:query')")
|
||||
@GetMapping(value = { "/", "/{userId}" })
|
||||
public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
|
||||
{
|
||||
|
@ -241,8 +241,8 @@ public class SysUserController extends BaseController
|
|||
|
||||
/**
|
||||
* 获取部门树列表
|
||||
* @PreAuthorize("@ss.hasPermi('system:user:list')")
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:list')")
|
||||
@GetMapping("/deptTree")
|
||||
public AjaxResult deptTree(SysDept dept)
|
||||
{
|
||||
|
|
|
@ -100,7 +100,8 @@ public class FlowBusinessKeyController extends BaseController {
|
|||
//超管查询所有数据
|
||||
if(!SysUser.isAdmin(super.getUserId())){
|
||||
SysUser sysUser = super.getLoginUser().getUser();
|
||||
flowTaskEntity.setDeptAncestors(sysUser.getDept().getAncestors());
|
||||
flowTaskEntity.setAssigneeId(sysUser.getUserId());
|
||||
flowTaskEntity.setDeptAncestors(sysUser.getDept().getAncestors()+","+sysUser.getDeptId());
|
||||
flowTaskEntity.setRoleIds(sysUser.getRoles().stream().map(role -> role.getRoleId()).collect(Collectors.toList()));
|
||||
}
|
||||
return getDataTable(flowBusinessKeyService.selectMyAwaitFlowTask(flowTaskEntity));
|
||||
|
@ -128,11 +129,11 @@ public class FlowBusinessKeyController extends BaseController {
|
|||
//超管查询所有数据
|
||||
if(!SysUser.isAdmin(super.getUserId())){
|
||||
SysUser sysUser = super.getLoginUser().getUser();
|
||||
flowTaskEntity.setDeptAncestors(sysUser.getDept().getAncestors());
|
||||
flowTaskEntity.setAssigneeId(sysUser.getUserId());
|
||||
flowTaskEntity.setDeptAncestors(sysUser.getDept().getAncestors()+","+sysUser.getDeptId());
|
||||
flowTaskEntity.setRoleIds(sysUser.getRoles().stream().map(role -> role.getRoleId()).collect(Collectors.toList()));
|
||||
}
|
||||
flowTaskEntity.setActiveName("await");
|
||||
List<Map<String, Object>> list = flowBusinessKeyService.selectMyFinishedFlowTask(flowTaskEntity);
|
||||
List<Map<String, Object>> list = flowBusinessKeyService.selectMyAwaitFlowTask(flowTaskEntity);
|
||||
Map<String,Object> data = new HashMap<>();
|
||||
if(CollectionUtils.isNotEmpty(list)){
|
||||
data.put("todo",list.size());
|
||||
|
|
|
@ -454,6 +454,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delegateTask(FlowTaskVo flowTaskVo) {
|
||||
taskService.addComment(flowTaskVo.getTaskId(), flowTaskVo.getInstanceId(), FlowComment.DELEGATE.getType(), flowTaskVo.getComment());
|
||||
taskService.delegateTask(flowTaskVo.getTaskId(), flowTaskVo.getAssignee());
|
||||
}
|
||||
|
||||
|
@ -479,6 +480,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void assignTask(FlowTaskVo flowTaskVo) {
|
||||
taskService.addComment(flowTaskVo.getTaskId(), flowTaskVo.getInstanceId(), FlowComment.ASSIGN.getType(), flowTaskVo.getComment());
|
||||
// 直接转派就可以覆盖掉之前的
|
||||
taskService.setAssignee(flowTaskVo.getTaskId(), flowTaskVo.getAssignee());
|
||||
// // 删除指派人重新指派
|
||||
|
|
|
@ -125,7 +125,7 @@ public class DataScopeAspect
|
|||
{
|
||||
sqlString.append(StringUtils.format(
|
||||
" OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )",
|
||||
deptAlias, user.getDeptId(), user.getDeptId()));
|
||||
deptAlias, user.getParDeptId(), user.getParDeptId()));
|
||||
}
|
||||
else if (DATA_SCOPE_SELF.equals(dataScope))
|
||||
{
|
||||
|
|
|
@ -65,8 +65,8 @@ public class ProProjectApplyController extends BaseController
|
|||
|
||||
/**
|
||||
* 获取项目申请详细信息
|
||||
* @PreAuthorize("@ss.hasPermi('project:projectApply:query')")
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('project:projectApply:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
|
|
|
@ -51,11 +51,11 @@
|
|||
<!-- 查询条件-项目部门 -->
|
||||
<if test="deptAncestors != null and deptAncestors != ''"> and find_in_set(fa.businessDeptId, #{deptAncestors}) </if>
|
||||
<if test="roleIds !=null and roleIds.size()>0">
|
||||
AND (fa.ASSIGNEE_ = #{nowUser}
|
||||
AND (fa.ASSIGNEE_ = #{assigneeId}
|
||||
OR (
|
||||
fa.ASSIGNEE_ IS NULL
|
||||
AND (
|
||||
fa.USER_ID_ = #{nowUser}
|
||||
fa.USER_ID_ = #{assigneeId}
|
||||
OR (
|
||||
fa.GROUP_ID_ IN
|
||||
<foreach collection="roleIds" item="roleId" open="(" separator="," close=")">
|
||||
|
|
|
@ -20,9 +20,18 @@ export function complete(data) {
|
|||
}
|
||||
|
||||
// 委派任务
|
||||
export function delegate(data) {
|
||||
export function delegateTask(data) {
|
||||
return request({
|
||||
url: '/flowable/task/delegate',
|
||||
url: '/flowable/task/delegateTask',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
//转办任务
|
||||
export function assignTask(data) {
|
||||
return request({
|
||||
url: '/flowable/task/assignTask',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="流程名称" prop="name">
|
||||
<el-form-item label="流程名称" prop="name" v-if="false">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入流程名称"
|
||||
|
@ -87,20 +87,17 @@
|
|||
v-loading="loading"
|
||||
:data="finishedList"
|
||||
border
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column
|
||||
label="项目单位"
|
||||
align="center"
|
||||
prop="businessKeyParName"
|
||||
width="150"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="项目名称"
|
||||
align="center"
|
||||
prop="businessKeyName"
|
||||
width="150"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
|
@ -116,7 +113,7 @@
|
|||
prop="procDefName"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column label="流程类别" align="center" prop="category" width="130">
|
||||
<el-table-column label="流程类别" align="center" prop="category" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag
|
||||
:options="dict.type.sys_process_category"
|
||||
|
@ -124,7 +121,7 @@
|
|||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="流程节点" align="center" prop="taskName" width="110">
|
||||
<el-table-column label="流程节点" align="center" prop="taskName" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.finishTime == null">{{ scope.row.taskName }}</div>
|
||||
<div v-if="scope.row.finishTime != null">流程结束</div>
|
||||
|
@ -133,7 +130,7 @@
|
|||
<el-table-column label="发起人" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<label
|
||||
>{{ scope.row.startUserName }}<br /><el-tag type="info" size="mini">{{
|
||||
>{{ scope.row.startUserName }}<el-tag type="info" size="mini">{{
|
||||
scope.row.startDeptName
|
||||
}}</el-tag></label
|
||||
>
|
||||
|
@ -143,7 +140,7 @@
|
|||
<el-table-column label="审批时间" align="center" prop="endTime" width="160" />
|
||||
<el-table-column label="审批耗时" align="center" prop="duration" width="140">
|
||||
<template slot-scope="scope">
|
||||
{{ getDurationDate(scope.row) }}
|
||||
{{ getDurationDate(scope.row.duration) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="流程状态" align="center" width="80">
|
||||
|
@ -195,6 +192,8 @@
|
|||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<detailDrawer ref="detailDrawer"></detailDrawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -278,8 +277,8 @@ export default {
|
|||
this.queryParams.params["endDate"] = this.daterangeCheckTime[1];
|
||||
}
|
||||
myFinishedFlowTaskList(this.queryParams).then((response) => {
|
||||
this.finishedList = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.finishedList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
|
@ -344,14 +343,7 @@ export default {
|
|||
},
|
||||
/** 流程流转记录 */
|
||||
handleFlowRecord(row) {
|
||||
this.$router.push({
|
||||
path: "/flowable/task/finished/detail/index",
|
||||
query: {
|
||||
procInsId: row.procInsId,
|
||||
deployId: row.deployId,
|
||||
taskId: row.taskId,
|
||||
},
|
||||
});
|
||||
this.$refs.detailDrawer.show(row);
|
||||
},
|
||||
/** 撤回任务 */
|
||||
handleRevoke(row) {
|
||||
|
@ -359,8 +351,8 @@ export default {
|
|||
procInsId: row.procInsId,
|
||||
instanceId: row.procInsId,
|
||||
taskId:row.taskId,
|
||||
userId:row.startUserId,
|
||||
assignee:row.startUserName
|
||||
userId:this.$store.getters.userId,
|
||||
assignee:this.$store.getters.nickname
|
||||
}
|
||||
let _this = this;
|
||||
_this.$confirm('是否确认撤回当前任务流程?', '提示', {
|
||||
|
|
|
@ -278,7 +278,6 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import store from "@/store";
|
||||
import { definitionStart, flowXmlAndNode } from "@/api/flowable/definition";
|
||||
import { CustomViewer as BpmnViewer } from "@/components/customBpmn";
|
||||
import { getProjectApply } from "@/api/project/projectApply";
|
||||
|
@ -491,7 +490,7 @@ export default {
|
|||
taskId:this.options.taskId,
|
||||
instanceId:this.options.procInsId,
|
||||
instanceId:this.options.procInsId,
|
||||
comment:store.getters.name+" 重新修改并重新提交申请。",
|
||||
comment:this.$store.getters.name+" 重新修改并重新提交申请。",
|
||||
proProjectApply:this.form
|
||||
}
|
||||
this.loading = true;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="流程名称" prop="name">
|
||||
<el-form-item label="流程名称" prop="name" v-if="false">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入流程名称"
|
||||
|
@ -247,7 +247,7 @@
|
|||
v-show="showSearch"
|
||||
label-width="80px"
|
||||
>
|
||||
<el-form-item label="流程名称" prop="name">
|
||||
<el-form-item label="流程名称" prop="name" v-if="false">
|
||||
<el-input
|
||||
v-model="queryProcessParams.name"
|
||||
placeholder="请输入流程名称"
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
direction="rtl"
|
||||
@close="closeCallBack"
|
||||
size="70%"
|
||||
z-index="10002"
|
||||
>
|
||||
<template slot="title">
|
||||
<div>
|
||||
|
@ -203,10 +204,7 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
<div style="text-align: center">
|
||||
<el-button
|
||||
icon="el-icon-s-custom"
|
||||
plain
|
||||
size="mini"
|
||||
<el-button icon="el-icon-s-custom" plain size="mini" @click="handleDelegate"
|
||||
>任务委派</el-button
|
||||
>
|
||||
<el-button
|
||||
|
@ -214,6 +212,7 @@
|
|||
type="primary"
|
||||
plain
|
||||
size="mini"
|
||||
@click="handleAssign"
|
||||
>任务转办</el-button
|
||||
>
|
||||
<el-button
|
||||
|
@ -262,10 +261,26 @@
|
|||
</p>
|
||||
</div>
|
||||
<!--占位使用...-->
|
||||
<div style="width:100%;height:2px;"></div>
|
||||
<div style="width: 100%; height: 2px"></div>
|
||||
</div>
|
||||
</div>
|
||||
</el-drawer>
|
||||
<!--选择人员-->
|
||||
<el-dialog
|
||||
title="选择人员"
|
||||
:visible.sync="userVisible"
|
||||
width="60%"
|
||||
:close-on-press-escape="false"
|
||||
:show-close="false"
|
||||
z-index="999999"
|
||||
v-loading="delegateLoading"
|
||||
>
|
||||
<flow-user :checkType="checkType" @handleUserSelect="handleUserSelect"></flow-user>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="userVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="checkUserComplete">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -273,12 +288,20 @@
|
|||
import store from "@/store";
|
||||
import { flowXmlAndNode } from "@/api/flowable/definition";
|
||||
import { CustomViewer as BpmnViewer } from "@/components/customBpmn";
|
||||
import { complete, rejectTask, returnTask, returnList } from "@/api/flowable/todo";
|
||||
import {
|
||||
complete,
|
||||
rejectTask,
|
||||
returnTask,
|
||||
assignTask,
|
||||
delegateTask,
|
||||
returnList,
|
||||
} from "@/api/flowable/todo";
|
||||
import FlowUser from "@/components/flow/User";
|
||||
import { findCommentByProcInsId } from "@/api/flowable/businessKey";
|
||||
import { getProjectApply } from "@/api/project/projectApply";
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
components: { FlowUser },
|
||||
props: {
|
||||
closeCallBack: {
|
||||
type: Function,
|
||||
|
@ -290,6 +313,7 @@ export default {
|
|||
onOpen: false,
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
delegateLoading: false,
|
||||
// 标题
|
||||
title: "",
|
||||
jdtitle: "",
|
||||
|
@ -317,6 +341,12 @@ export default {
|
|||
returnTask: false,
|
||||
returnTaskBtn: false,
|
||||
showAssetsVersion: false,
|
||||
userVisible: false,
|
||||
// 选类型
|
||||
checkType: "single",
|
||||
// 选中的值
|
||||
selectValue: null,
|
||||
delegateType: null,
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
|
@ -691,6 +721,71 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
// 任务委派
|
||||
handleDelegate() {
|
||||
this.delegateType = "Delegate";
|
||||
this.userVisible = true;
|
||||
},
|
||||
//任务转办
|
||||
handleAssign() {
|
||||
this.delegateType = "Assign";
|
||||
this.userVisible = true;
|
||||
},
|
||||
// 用户选中数据
|
||||
handleUserSelect(selection) {
|
||||
this.selectValue = null;
|
||||
if (selection) {
|
||||
this.selectValue = selection;
|
||||
}
|
||||
},
|
||||
checkUserComplete() {
|
||||
if (this.selectValue) {
|
||||
let param = {
|
||||
taskId: this.options.taskId,
|
||||
procInsId: this.options.procInsId,
|
||||
instanceId: this.options.procInsId,
|
||||
assignee: this.selectValue.userId
|
||||
};
|
||||
const that = this;
|
||||
if (this.delegateType == "Delegate") {
|
||||
param.comment=this.$store.getters.nickname+" 将申请流程委派到 "+ this.selectValue.nickName;
|
||||
this.$modal
|
||||
.confirm(
|
||||
"是否确认“委派”当前申请流程给 " + this.selectValue.nickName + "处理?"
|
||||
)
|
||||
.then(function () {
|
||||
that.delegateLoading = true;
|
||||
return delegateTask(param);
|
||||
})
|
||||
.then(() => {
|
||||
this.delegateLoading = false;
|
||||
this.userVisible = false;
|
||||
//关闭并刷新列表
|
||||
this.$refs.drawer.closeDrawer();
|
||||
})
|
||||
.catch(() => {});
|
||||
} else {
|
||||
param.comment=this.$store.getters.nickname+" 将申请流程转办到 "+ this.selectValue.nickName;
|
||||
this.$modal
|
||||
.confirm(
|
||||
"是否确认“转办”当前申请流程给 " + this.selectValue.nickName + "处理?"
|
||||
)
|
||||
.then(function () {
|
||||
that.delegateLoading = true;
|
||||
return assignTask(param);
|
||||
})
|
||||
.then(() => {
|
||||
this.delegateLoading = false;
|
||||
this.userVisible = false;
|
||||
//关闭并刷新列表
|
||||
this.$refs.drawer.closeDrawer();
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
} else {
|
||||
this.$modal.msgWarning("请选择人员信息");
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="流程名称" prop="name">
|
||||
<el-form-item label="流程名称" prop="name" v-if="false">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入流程名称"
|
||||
|
|
Loading…
Reference in New Issue