提交 4f037ffa authored 作者: liuluyu's avatar liuluyu

Merge branch 'master' of http://47.97.51.208/root/zrch-risk-39

......@@ -315,6 +315,11 @@
"isAttr": true,
"type": "String"
},
{
"name": "isRead",
"isAttr": true,
"type": "Boolean"
},
{
"name": "followUpDate",
"isAttr": true,
......
......@@ -26,6 +26,10 @@
expId?: string
async?: boolean
userName?: string
isRead?: boolean
isTransmit?: boolean
isReject?: boolean
isSend?: boolean
[key: string]: any
}
......@@ -43,7 +47,11 @@
const bpmnFormData = reactive<BpmnFormData>({
async: false,
userType: 'user'
userType: 'user',
isTransmit: true,
isReject: true,
isSend: true,
isRead: true,
});
const selectData = reactive<SelectData>({})
......@@ -109,20 +117,6 @@
}
}
// 获取用户列表
// const getUserList = async (params) => {
// try {
// loading.value = true;
// const userList = await defHttp.get({ url: "/sys/user/list", params });
// return userList;
// } catch (error) {
// console.error('获取用户列表失败:', error);
// return [];
// } finally {
// loading.value = false;
// }
// }
const formSchema: FormSchema[] = [
{
label: '异步',
......@@ -211,7 +205,7 @@
updateCustomElement("userType", "role")
emit('update', { candidateGroups, userType: 'role' })
if (bpmnFormData.userType !== 'role') {
if(bpmnFormData.userType !== 'role') {
bpmnFormData.userType = 'role'
isUser.value = false
updateCustomElement("userType", "role")
......@@ -253,7 +247,79 @@
emit('update', { priority })
}
}
}
},
{
label: '是否转阅',
field: 'isRead',
component: 'RadioGroup',
defaultValue: true,
componentProps: {
options: [
{ label: '是', value: true },
{ label: '否', value: false },
],
disabled: props.readonly,
onChange: (isRead: boolean) => {
bpmnFormData.isRead = isRead
updateCustomElement("isRead", isRead)
emit('update', { isRead })
}
}
},
{
label: '是否转办',
field: 'isTransmit',
component: 'RadioGroup',
defaultValue: true,
componentProps: {
options: [
{ label: '是', value: true },
{ label: '否', value: false },
],
disabled: props.readonly,
onChange: (isTransmit: boolean) => {
bpmnFormData.isTransmit = isTransmit
updateCustomElement("isTransmit", isTransmit)
emit('update', { isTransmit })
}
}
},
{
label: '是否可退',
field: 'isReject',
component: 'RadioGroup',
defaultValue: true,
componentProps: {
options: [
{ label: '是', value: true },
{ label: '否', value: false },
],
disabled: props.readonly,
onChange: (isReject: boolean) => {
bpmnFormData.isReject = isReject
updateCustomElement("isReject", isReject)
emit('update', { isReject })
}
}
},
{
label: '是否发送',
field: 'isSend',
component: 'RadioGroup',
defaultValue: true,
componentProps: {
options: [
{ label: '是', value: true },
{ label: '否', value: false },
],
disabled: props.readonly,
onChange: (isSend: boolean) => {
bpmnFormData.isSend = isSend
updateCustomElement("isSend", isSend)
emit('update', { isSend })
}
}
},
];
const [registerForm, { updateSchema, setFieldsValue, getFieldsValue, setProps }] = useForm({
......@@ -283,6 +349,58 @@
});
};
// 保存所有自定义属性(打包成 JSON)
const saveCustomProperties = (element: any, customData: Record<string, any>) => {
if (!modelerStore.modeler || !element) {
return false
}
try {
const modeling = modelerStore.modeler.get('modeling')
let targetElement = element
if (isProxy(element)) {
targetElement = toRaw(element)
}
// 将所有自定义属性转为 JSON 字符串存储
const customDataStr = JSON.stringify(customData)
modeling.updateProperties(targetElement, {
'customData': customDataStr
})
return true
} catch (error) {
console.error('保存自定义属性失败:', error)
return false
}
}
// 读取所有自定义属性
const getCustomProperties = (element: any): Record<string, any> => {
if (!element || !element.businessObject) {
return {}
}
try {
const customDataStr = element.businessObject.customData
if (customDataStr) {
return JSON.parse(customDataStr)
}
return {}
} catch (error) {
console.error('读取自定义属性失败:', error)
return {}
}
}
// 获取单个自定义属性
const getCustomProperty = (element: any, key: string, defaultValue: any = null) => {
const customProps = getCustomProperties(element)
return customProps[key] !== undefined ? customProps[key] : defaultValue
}
// 更新自定义流程节点/参数信息
const updateCustomElement = (key: string, value: any) => {
if (!modelerStore.modeler || !modelerStore.element) {
......@@ -291,13 +409,19 @@
}
try {
const taskAttr: Record<string, any> = {}
taskAttr[key] = value
const success = safeUpdateProperties(modelerStore.element, taskAttr)
// BPMN 标准属性列表(这些可以直接更新)
const standardProps = ['async', 'dueDate', 'priority', 'assignee', 'candidateGroups', 'userType']
if (!success) {
console.error('更新自定义属性失败')
if (standardProps.includes(key)) {
// 标准属性直接更新
const taskAttr: Record<string, any> = {}
taskAttr[key] = value
safeUpdateProperties(modelerStore.element, taskAttr)
} else {
// 自定义属性:先获取现有自定义属性,更新后统一保存
const currentCustomProps = getCustomProperties(modelerStore.element)
currentCustomProps[key] = value
saveCustomProperties(modelerStore.element, currentCustomProps)
}
} catch (error) {
console.error('更新自定义属性失败:', error)
......@@ -339,7 +463,11 @@
if (!modelerStore.element?.businessObject || modelerStore.element.type === 'bpmn:Process') {
return
}
const businessObject = modelerStore.element.businessObject
const element = modelerStore.element
const businessObject = element.businessObject
// 获取所有自定义属性
const customProps = getCustomProperties(element)
// 重置表单数据
const formData: BpmnFormData = {
......@@ -348,7 +476,12 @@
assignee: businessObject.assignee || '',
candidateGroups: businessObject.candidateGroups || '',
dueDate: businessObject.dueDate || '',
priority: businessObject.priority || 'medium'
priority: businessObject.priority || 'medium',
// 从自定义属性中读取
isRead: customProps.isRead !== undefined ? customProps.isRead : true,
isTransmit: customProps.isTransmit !== undefined ? customProps.isTransmit : true,
isReject: customProps.isReject !== undefined ? customProps.isReject : true,
isSend: customProps.isSend !== undefined ? customProps.isSend : true
}
isUser.value = formData.userType === "user"
......
......@@ -5,8 +5,9 @@
<div class="form-header">
<span class="form-title">当前待办<font color="red">[{{ editableNode?.name || '无' }}]</font></span>
<a-space>
<a-button v-if="props.showApprovalPanel" type="primary" ghost @click="handleApproval">审批</a-button>
<a-button v-else type="primary" ghost @click="handleSend">发送</a-button>
<a-button v-show="props.showApprovalPanel" type="primary" ghost @click="handleApproval">审批</a-button>
<a-button v-show="!props.showApprovalPanel" type="primary" ghost @click="handleSend">保存</a-button>
<a-button v-show="!props.showApprovalPanel" type="primary" ghost @click="handleSend">保存并发送</a-button>
<a-button v-show="!props.showApprovalPanel" type="primary" ghost @click="handleReject">驳回</a-button>
<a-button type="primary" ghost @click="handleTransmit">转办</a-button>
<a-button type="primary" ghost @click="handleRead">转阅</a-button>
......@@ -118,8 +119,16 @@ function handleTransmit() {
function handleRead() {
taskOpenModal(true, {
taskTitle: '转阅', isUpdate: false, showFooter: true, taskType: 'read',
deployId: props.deployId, taskId: props.taskId, procInsId: props.procInsId, dataId: props.dataId, assignee: props.assignee, userType: props.userType,
taskTitle: '转阅',
isUpdate: false,
showFooter: true,
taskType: 'read',
deployId: props.deployId,
taskId: props.taskId,
procInsId: props.procInsId,
dataId: props.dataId,
assignee: props.assignee,
userType: props.userType,
});
}
......
<template>
<BasicDrawer
title="任务指派"
title="发送任务"
width="30%"
:closable="true"
:mask-closable="false"
......@@ -10,7 +10,7 @@
:header-style="{ backgroundColor: '#018ffb', borderBottom: '1px solid #e8eef2' }"
>
<div class="drawer-content" style="height: 80vh">
<a-card title="选择任务指派人" :bordered="false" class="assignee-card">
<a-card title="选择任务接收人" :bordered="false" class="assignee-card">
<a-form layout="vertical">
<a-form-item label="用户类型" required>
<a-radio-group v-model:value="localUserType" disabled>
......@@ -47,8 +47,12 @@
</a-form>
<div class="assignee-actions">
<a-space>
<a-button @click="handleClose">取消</a-button>
<a-button type="primary" :loading="confirmLoading" @click="handleConfirm">确认</a-button>
<a-button @click="handleClose" block style="width: 150px;">取消</a-button>
<a-button type="primary" style="width: 150px;"
:loading="confirmLoading"
@click="handleConfirm" block>
确认
</a-button>
</a-space>
</div>
</a-card>
......@@ -68,6 +72,11 @@ import { UserOutlined, TeamOutlined } from '@ant-design/icons-vue'
import UserSelectModal from '/@/components/Form/src/jeecg/components/modal/UserSelectModal.vue'
import RoleSelectModal from '/@/components/Form/src/jeecg/components/modal/RoleSelectModal.vue'
import { complete, getMyTaskFlow } from '/@/components/Process/api/todo'
import { queryUserById } from '/@/views/system/user/user.api'
import { queryRoleById } from '/@/views/system/role/role.api'
import { useMessage } from '/@/hooks/web/useMessage'
const { createConfirm } = useMessage()
const emit = defineEmits(['success', 'error', 'close'])
......@@ -81,7 +90,7 @@ const confirmLoading = ref(false)
const dataId = ref('')
const deployId = ref('')
const [registerBasicDrawer, { closeDrawer }] = useDrawerInner((data) => {
const [registerBasicDrawer, { closeDrawer }] = useDrawerInner(async (data) => {
if (data) {
dataId.value = data.dataId || ''
deployId.value = data.deployId || ''
......@@ -89,6 +98,11 @@ const [registerBasicDrawer, { closeDrawer }] = useDrawerInner((data) => {
localUserType.value = data.userType === 'role' ? 'role' : 'user'
assigneeId.value = data.assignee
assigneeDisplayName.value = data.assigneeName || ''
if(localUserType.value === 'user') {
await setUserInfo( assigneeId.value, data.assigneeName || '')
} else {
await setRoleInfo( assigneeId.value, data.assigneeName || '')
}
} else {
localUserType.value = data.userType === 'role' ? 'role' : 'user'
}
......@@ -124,29 +138,41 @@ const handleClose = () => {
}
const handleConfirm = async () => {
confirmLoading.value = true
try {
if (dataId.value && deployId.value) {
const myTaskFlow = await getMyTaskFlow({ deploymentId: deployId.value, dataId: dataId.value })
if (myTaskFlow?.taskId) {
await complete({
instanceId: myTaskFlow.procInsId || '',
deployId: myTaskFlow.deployId || '',
taskId: myTaskFlow.taskId,
dataId: dataId.value,
comment: '',
values: { approval: assigneeId.value, approvalType: localUserType.value },
})
createConfirm({
title: '确认发送任务吗?',
okText: '确认',
okType: 'danger',
iconType: 'warning',
onOk: async () => {
if (!assigneeId.value) {
message.warning('请选择任务接收人')
return
}
confirmLoading.value = true
try {
if (dataId.value && deployId.value) {
const myTaskFlow = await getMyTaskFlow({ deploymentId: deployId.value, dataId: dataId.value })
if (myTaskFlow?.taskId) {
await complete({
instanceId: myTaskFlow.procInsId || '',
deployId: myTaskFlow.deployId || '',
taskId: myTaskFlow.taskId,
dataId: dataId.value,
comment: '',
values: { approval: assigneeId.value, approvalType: localUserType.value },
})
}
}
emit('success', dataId.value)
message.success('任务发送成功')
handleClose()
} catch (error) {
emit('error', error)
} finally {
confirmLoading.value = false
}
}
}
emit('success', dataId.value)
message.success('任务发送成功')
handleClose()
} catch (error) {
emit('error', error)
} finally {
confirmLoading.value = false
}
})
}
const getAssigneeData = () => ({
......@@ -160,15 +186,32 @@ const setUserInfo = (userId: string, userNameValue: string) => {
assigneeId.value = userId
assigneeDisplayName.value = userNameValue
localUserType.value = 'user'
if(userNameValue) return
queryUserById({ id:userId }).then(res => {
if (res?.realname) {
assigneeDisplayName.value = res.realname || ''
}
})
}
const setRoleInfo = (roleId: string, roleNameValue: string) => {
assigneeId.value = roleId
assigneeDisplayName.value = roleNameValue
localUserType.value = 'role'
if(roleNameValue) return
queryRoleById({ id: roleId }).then(res => {
if (res) {
assigneeDisplayName.value = res.roleName || ''
}
})
}
defineExpose({ getAssigneeData, submit: handleConfirm, setUserInfo, setRoleInfo })
defineExpose({
getAssigneeData,
submit: handleConfirm,
setUserInfo,
setRoleInfo
})
</script>
<style scoped lang="scss">
......
import {defHttp} from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
starlist = '/my/myTaskFlowHis/starlist',
list = '/my/myTaskFlowHis/list',
save='/my/myTaskFlowHis/add',
edit='/my/myTaskFlowHis/edit',
deleteOne = '/my/myTaskFlowHis/delete',
deleteBatch = '/my/myTaskFlowHis/deleteBatch',
importExcel = '/my/myTaskFlowHis/importExcel',
exportXls = '/my/myTaskFlowHis/exportXls',
}
/**
* 导出api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* 导入api
*/
export const getImportUrl = Api.importExcel;
/**
* 列表接口
* @param params
*/
export const list = (params) =>
defHttp.get({url: Api.list, params});
/**
* 删除单个
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
* 批量删除
* @param params
*/
export const batchDelete = (params, handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
* 保存或者更新
* @param params
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({url: url, params});
}
/**
* 列表接口
* @param params
*/
export const starlist = (params) =>
defHttp.get({url: Api.starlist, params});
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '流程名称',
align:"center",
dataIndex: 'flowName'
},
{
title: '标题',
align:"center",
dataIndex: 'taskTitle'
},
{
title: '节点名称',
align:"center",
dataIndex: 'taskName'
},
{
title: '节点类型',
align:"center",
dataIndex: 'taskType'
},
{
title: '操作时间',
align:"center",
dataIndex: 'optionTime'
},
{
title: '操作人',
align:"center",
dataIndex: 'optionId'
},
/**
* {
title: '操作类型',
align:"center",
dataIndex: 'optionType'
},
{
title: '表单的表名ID',
align:"center",
dataIndex: 'formTableName'
},
{
title: '业务主表ID',
align:"center",
dataIndex: 'targetId'
},
{
title: '部署ID',
align:"center",
dataIndex: 'deployId'
},
{
title: '任务ID',
align:"center",
dataIndex: 'taskId'
},
{
title: '实例ID',
align:"center",
dataIndex: 'procInsId'
},
{
title: '执行ID',
align:"center",
dataIndex: 'executionId'
},
{
title: '流程定义ID',
align:"center",
dataIndex: 'procDefId'
},
{
title: '代办人',
align:"center",
dataIndex: 'uid'
},
{
title: '代办角色',
align:"center",
dataIndex: 'roleid'
},
{
title: '节点ID',
align:"center",
dataIndex: 'taskDefinitionKey'
},
*/
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '表单的表名ID',
field: 'formTableName',
component: 'Input',
},
{
label: '业务主表ID',
field: 'targetId',
component: 'Input',
},
{
label: '部署ID',
field: 'deployId',
component: 'Input',
},
{
label: '任务ID',
field: 'taskId',
component: 'Input',
},
{
label: '实例ID',
field: 'procInsId',
component: 'Input',
},
{
label: '执行ID',
field: 'executionId',
component: 'Input',
},
{
label: '流程定义ID',
field: 'procDefId',
component: 'Input',
},
{
label: '代办人',
field: 'uid',
component: 'Input',
},
{
label: '代办角色',
field: 'roleid',
component: 'Input',
},
{
label: '节点ID',
field: 'taskDefinitionKey',
component: 'Input',
},
{
label: '操作时间',
field: 'optionTime',
component: 'DatePicker',
componentProps: {
showTime: true,
valueFormat: 'YYYY-MM-DD HH:mm:ss'
},
},
{
label: '操作人',
field: 'optionId',
component: 'Input',
},
{
label: '操作类型',
field: 'optionType',
component: 'Input',
},
{
label: '节点类型',
field: 'taskType',
component: 'Input',
},
// TODO 主键隐藏字段,目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
},
];
// 高级查询数据
export const superQuerySchema = {
formTableName: {title: '表单的表名ID',order: 0,view: 'text', type: 'string',},
targetId: {title: '业务主表ID',order: 1,view: 'text', type: 'string',},
deployId: {title: '部署ID',order: 2,view: 'text', type: 'string',},
taskId: {title: '任务ID',order: 3,view: 'text', type: 'string',},
procInsId: {title: '实例ID',order: 4,view: 'text', type: 'string',},
executionId: {title: '执行ID',order: 5,view: 'text', type: 'string',},
procDefId: {title: '流程定义ID',order: 6,view: 'text', type: 'string',},
uid: {title: '代办人',order: 7,view: 'text', type: 'string',},
roleid: {title: '代办角色',order: 8,view: 'text', type: 'string',},
taskDefinitionKey: {title: '节点ID',order: 9,view: 'text', type: 'string',},
optionTime: {title: '操作时间',order: 10,view: 'datetime', type: 'string',},
optionId: {title: '操作人',order: 11,view: 'text', type: 'string',},
optionType: {title: '操作类型',order: 12,view: 'text', type: 'string',},
taskType: {title: '节点类型',order: 13,view: 'text', type: 'string',},
};
/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
return formSchema;
}
\ No newline at end of file
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<!--
<a-button type="primary" v-auth="'my:my_task_flow_his:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" v-auth="'my:my_task_flow_his:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" v-auth="'my:my_task_flow_his:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"></Icon>
删除
</a-menu-item>
</a-menu>
</template>
<a-button v-auth="'my:my_task_flow_his:deleteBatch'">批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown>
-->
<!-- 高级查询 -->
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
</template>
<!--操作栏
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
-->
<!--字段回显插槽-->
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<!-- 表单区域 -->
<MyTaskFlowHisModal @register="registerModal" @success="handleSuccess"></MyTaskFlowHisModal>
</div>
</template>
<script lang="ts" name="my-myTaskFlowHis" setup>
import {ref, reactive, computed, unref} from 'vue';
import {BasicTable, useTable, TableAction} from '/@/components/Table';
import {useModal} from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage'
import MyTaskFlowHisModal from './components/MyTaskFlowHisModal.vue'
import {columns, searchFormSchema, superQuerySchema} from './MyTaskFlowHis.data';
import {starlist,list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './MyTaskFlowHis.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import { useUserStore } from '/@/store/modules/user';
import { useMessage } from '/@/hooks/web/useMessage';
import { getDateByPicker } from '/@/utils';
//日期个性化选择
const fieldPickers = reactive({
});
const queryParam = reactive<any>({});
const checkedKeys = ref<Array<string | number>>([]);
const userStore = useUserStore();
const { createMessage } = useMessage();
//注册model
const [registerModal, {openModal}] = useModal();
//注册table数据
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
title: 'my_task_flow_his',
api: starlist,
columns,
canResize:true,
formConfig: {
//labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter:true,
showAdvancedButton:true,
fieldMapToNumber: [
],
fieldMapToTime: [
],
},
actionColumn: {
width: 120,
fixed:'right'
},
beforeFetch: (params) => {
if (params && fieldPickers) {
for (let key in fieldPickers) {
if (params[key]) {
params[key] = getDateByPicker(params[key], fieldPickers[key]);
}
}
}
return Object.assign(params, queryParam);
},
},
exportConfig: {
name:"my_task_flow_his",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
})
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
// 高级查询配置
const superQueryConfig = reactive(superQuerySchema);
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
reload();
}
/**
* 新增事件
*/
function handleAdd() {
openModal(true, {
isUpdate: false,
showFooter: true,
});
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record){
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
auth: 'my:my_task_flow_his:edit'
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
},
auth: 'my:my_task_flow_his:delete'
}
]
}
</script>
<style lang="less" scoped>
:deep(.ant-picker),:deep(.ant-input-number){
width: 100%;
}
</style>
\ No newline at end of file
<template>
<div style="min-height: 400px">
<BasicForm @register="registerForm"></BasicForm>
<div style="width: 100%;text-align: center" v-if="!formDisabled">
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary">提 交</a-button>
</div>
</div>
</template>
<script lang="ts">
import {BasicForm, useForm} from '/@/components/Form/index';
import {computed, defineComponent} from 'vue';
import {defHttp} from '/@/utils/http/axios';
import { propTypes } from '/@/utils/propTypes';
import {getBpmFormSchema} from '../MyTaskFlowHis.data';
import {saveOrUpdate} from '../MyTaskFlowHis.api';
export default defineComponent({
name: "MyTaskFlowHisForm",
components:{
BasicForm
},
props:{
formData: propTypes.object.def({}),
formBpm: propTypes.bool.def(true),
},
setup(props){
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
labelWidth: 150,
schemas: getBpmFormSchema(props.formData),
showActionButtonGroup: false,
baseColProps: {span: 24}
});
const formDisabled = computed(()=>{
if(props.formData.disabled === false){
return false;
}
return true;
});
let formData = {};
const queryByIdUrl = '/my/myTaskFlowHis/queryById';
async function initFormData(){
let params = {id: props.formData.dataId};
const data = await defHttp.get({url: queryByIdUrl, params});
formData = {...data}
//设置表单的值
await setFieldsValue(formData);
//默认是禁用
await setProps({disabled: formDisabled.value})
}
async function submitForm() {
let data = getFieldsValue();
let params = Object.assign({}, formData, data);
console.log('表单数据', params)
await saveOrUpdate(params, true)
}
initFormData();
return {
registerForm,
formDisabled,
submitForm,
}
}
});
</script>
\ No newline at end of file
<template>
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :maxHeight="500" :width="800" @ok="handleSubmit">
<BasicForm @register="registerForm" name="MyTaskFlowHisForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import {ref, computed, unref, reactive} from 'vue';
import {BasicModal, useModalInner} from '/@/components/Modal';
import {BasicForm, useForm} from '/@/components/Form/index';
import {formSchema} from '../MyTaskFlowHis.data';
import {saveOrUpdate} from '../MyTaskFlowHis.api';
import { useMessage } from '/@/hooks/web/useMessage';
import { getDateByPicker } from '/@/utils';
const { createMessage } = useMessage();
// Emits声明
const emit = defineEmits(['register','success']);
const isUpdate = ref(true);
const isDetail = ref(false);
//表单配置
const [registerForm, { setProps,resetFields, setFieldsValue, validate, scrollToField }] = useForm({
labelWidth: 150,
schemas: formSchema,
showActionButtonGroup: false,
baseColProps: {span: 24},
baseRowStyle: { padding: "0 20px" }
});
//表单赋值
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
//重置表单
await resetFields();
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
isUpdate.value = !!data?.isUpdate;
isDetail.value = !!data?.showFooter;
if (unref(isUpdate)) {
//表单赋值
await setFieldsValue({
...data.record,
});
}
// 隐藏底部时禁用整个表单
setProps({ disabled: !data?.showFooter })
});
//日期个性化选择
const fieldPickers = reactive({
});
//设置标题
const title = computed(() => (!unref(isUpdate) ? '新增' : !unref(isDetail) ? '详情' : '编辑'));
//表单提交事件
async function handleSubmit(v) {
try {
let values = await validate();
// 预处理日期数据
changeDateValue(values);
setModalProps({confirmLoading: true});
//提交表单
await saveOrUpdate(values, isUpdate.value);
//关闭弹窗
closeModal();
//刷新列表
emit('success');
} catch ({ errorFields }) {
if (errorFields) {
const firstField = errorFields[0];
if (firstField) {
scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
}
}
return Promise.reject(errorFields);
} finally {
setModalProps({confirmLoading: false});
}
}
/**
* 处理日期值
* @param formData 表单数据
*/
const changeDateValue = (formData) => {
if (formData && fieldPickers) {
for (let key in fieldPickers) {
if (formData[key]) {
formData[key] = getDateByPicker(formData[key], fieldPickers[key]);
}
}
}
};
</script>
<style lang="less" scoped>
/** 时间和数字输入框样式 */
:deep(.ant-input-number) {
width: 100%;
}
:deep(.ant-calendar-picker) {
width: 100%;
}
</style>
\ No newline at end of file
......@@ -15,6 +15,8 @@
import { columns } from './StProblemCheck.data';
import { list, problemArchive } from './StProblemCheck.api';
const { createConfirm } = useMessage();
const props = defineProps({
currentFlowNode: { type: Object, default: () => ({}) },
});
......@@ -37,7 +39,14 @@
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
function handleArchive(record: Recordable) {
problemArchive({ id: record.id }).then(handleSuccess);
createConfirm({
title: '确认归档问题吗?',
okText: '确认',
okType: 'danger',
onOk: () => {
problemArchive({ id: record.id }).then(handleSuccess);
},
});
}
function handleSuccess() {
......@@ -46,7 +55,11 @@
}
function getTableAction(record) {
return [{ label: '问题归档', onClick: handleArchive.bind(null, record) }];
return [
{
label: '问题归档',
onClick: handleArchive.bind(null, record)
}];
}
</script>
......
......@@ -69,6 +69,7 @@ export const columns: BasicColumn[] = [
return render.renderDict(text, 'bpm_status');
},
sorter: true,
ifShow: false,
},
];
//查询数据
......
......@@ -22,7 +22,7 @@
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
</template>
</BasicTable>
<StProblemCheckModal @register="registerModal" @success="handleSuccess" :center="true" />
<StProblemCheckModal @register="registerModal" @success="handleSuccess" :centered="true" />
</div>
</template>
......@@ -35,6 +35,8 @@
import StProblemCheckModal from './components/StProblemCheckModal.vue';
import { columns, searchFormSchema } from './StProblemCheck.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, saveOrUpdate } from './StProblemCheck.api';
import { useMessage } from '/@/hooks/web/useMessage';
const { createConfirm } = useMessage();
const props = defineProps({
beforeFlowNode: { type: Object, default: () => ({}) },
......@@ -113,6 +115,7 @@
}
async function handleFlow(record: Recordable) {
emit('sendWorkFlow', record);
}
......
......@@ -66,10 +66,8 @@
// 保存按钮
async function saveForm(formData) {
try {
try {
const result = await saveOrUpdate(formData, true);
alert(JSON.stringify(result))
// 保存成功后更新表单
if (result && result.id) {
await initFormData(result.id);
......
......@@ -25,6 +25,7 @@ enum Api {
saveRoleIndex = '/sys/sysRoleIndex/add',
editRoleIndex = '/sys/sysRoleIndex/edit',
queryIndexByCode = '/sys/sysRoleIndex/queryByCode',
queryById = '/sys/role/queryById',
}
/**
* 导出api
......@@ -186,3 +187,10 @@ export const saveOrUpdateRoleIndex = (params, isUpdate) => {
* @param params
*/
export const queryIndexByCode = (params) => defHttp.get({ url: Api.queryIndexByCode, params }, { isTransformResponse: false });
/**
*
* @param params
* @returns
*/
export const queryRoleById = (params) => defHttp.get({ url: Api.queryById, params });
......@@ -23,6 +23,8 @@ enum Api {
changePassword = '/sys/user/changePassword',
frozenBatch = '/sys/user/frozenBatch',
queryById = '/sys/user/queryById',
getQuitList = '/sys/user/getQuitList',
putCancelQuit = '/sys/user/putCancelQuit',
resetPassword = '/sys/user/resetPassword',
......@@ -265,4 +267,11 @@ export const saveOrUpdateAgent = (params) => {
export const userQuitAgent = (params) => {
return defHttp.put({ url: Api.userQuitAgent, params });
};
\ No newline at end of file
};
/**
*
* @param params
* @returns
*/
export const queryUserById = (params) => defHttp.get({ url: Api.queryById, params });
\ No newline at end of file
......@@ -7,6 +7,7 @@ import org.jeecg.modules.flowable.domain.dto.FlowViewerDto;
import org.jeecg.modules.flowable.domain.vo.FlowTaskVo;
import java.io.InputStream;
import java.util.Date;
import java.util.List;
/**
......@@ -180,6 +181,7 @@ public interface IFlowTaskService {
public Result<List<String>> todoListAll();
public void saveMyTaskFlow(String thistaskId,Task nextTask,String userType,String approvalId,String messageTaskName);
public void saveMyTaskFlowHis(Task task,String userType,String approvalId,Date cdate,String loginUserid,String taskType,String OptionType);
}
}
......@@ -471,7 +471,11 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
}
String userType="user";
String approvalId=sysUser.getId();
flowTaskService.saveMyTaskFlowHis(task,userType,approvalId,cdate,sysUser.getId(),ProcessConstants.TASK_TYPE_START,OptionType);
/**
MyTaskFlowHis taskFlowHis=new MyTaskFlowHis();
taskFlowHis.setTaskId(task.getId());
taskFlowHis.setProcDefId(task.getProcessDefinitionId());
......@@ -488,8 +492,7 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
taskFlowHis.setFormTableName(flowForm.getFormTableName());
}
String userType="user";
String approvalId=sysUser.getId();
if(userType.equals("user")) {
taskFlowHis.setUid(approvalId);
......@@ -509,6 +512,7 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
taskFlowHis.setFlowName(flowname);
myTaskFlowHisService.save(taskFlowHis);
*/
......
......@@ -200,6 +200,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
}
this.saveMyTaskFlowHis(task,userType,approvalId,cdate,loginUser.getId(),ProcessConstants.TASK_TYPE_HAND,OptionType);
/**
MyTaskFlowHis taskFlowHis=new MyTaskFlowHis();
taskFlowHis.setTaskId(task.getId());
taskFlowHis.setProcDefId(task.getProcessDefinitionId());
......@@ -235,6 +239,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
taskFlowHis.setFlowName(flowname);
myTaskFlowHisService.save(taskFlowHis);
*/
Task nextTask = taskService.createTaskQuery()
......@@ -249,8 +254,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
taskService.addCandidateGroup(nextTask.getId(),approvalId);
}
this.saveMyTaskFlow(task.getId(),nextTask,userType,approvalId,"待"+OptionType);
/**
// 处理表单数据
// Map<String, Object> formData = processFormData(task);
......@@ -327,6 +334,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
sysDeployFormService.updateBisTabUid(flowFormben);
}
*/
......@@ -379,6 +387,12 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
@Override
public void taskReject(FlowTaskVo flowTaskVo) {
Date cdate = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String curdate = sdf.format(cdate);
//Long userId = SecurityUtils.getLoginUser().getUser().getUserId();
SysUser loginUser = iFlowThirdService.getLoginUser();
if (taskService.createTaskQuery().taskId(flowTaskVo.getTaskId()).singleResult().isSuspended()) {
throw new CustomException("任务处于挂起状态!");
......@@ -546,9 +560,15 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
approvalId=formValues.get("approval").toString();
}
String OptionType=ProcessConstants.OPTION_TYPE_REJECT;
//写入待办
this.saveMyTaskFlow(task.getId(),newTask,userType,approvalId,OptionType+"待处理");
this.saveMyTaskFlowHis(task,userType,approvalId,cdate,loginUser.getId(),ProcessConstants.TASK_TYPE_HAND,OptionType);
//有了以上信息,可以向相关表写入 相关信息了
/**
MyTaskFlow taskFlow=new MyTaskFlow();
taskFlow.setTaskId(newTask.getId());
taskFlow.setProcDefId(newTask.getProcessDefinitionId());
......@@ -569,6 +589,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
taskFlow.setTaskDefinitionKey(newTask.getTaskDefinitionKey());
myTaskFlowService.save(taskFlow);
*/
} catch (FlowableObjectNotFoundException e) {
throw new CustomException("未找到流程实例,流程可能已发生变化");
......@@ -872,10 +893,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
// 2. 核心操作:直接将任务的指派人改为目标用户
// 此时,任务的所有权彻底转移
taskService.setAssignee(flowTaskVo.getTaskId(), targetUserId);
flowTaskVo.getInstanceId();
Date date = new Date();
Date cdate = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String curdate = sdf.format(date);
String curdate = sdf.format(cdate);
// 3. (可选) 添加一条评论或日志,记录这次转办动作
//taskService.addComment(flowTaskVo.getTaskId(), null, originalUserId + " 将任务转办给 " + targetUserId);
......@@ -901,6 +922,16 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
FlowForm sysForm = flowFormService.getById(formId); // 假设有这个方法
// 写入 待办
String userType="user";
String OptionType=ProcessConstants.OPTION_TYPE_ASSIGN;
//写入待办
this.saveMyTaskFlow(flowTaskVo.getTaskId(),task,userType,targetUserId,OptionType+"待处理");
this.saveMyTaskFlowHis(task,userType,loginUser.getId(),cdate,loginUser.getId(),ProcessConstants.TASK_TYPE_HAND,OptionType);
/**
MyTask myTask = new MyTask();
myTask.setUid(targetUserId);
myTask.setTp(5);
......@@ -961,6 +992,8 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
sysDeployFormService.updateBisTabUid(flowFormben);
}
*/
......@@ -2601,19 +2634,19 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
//flowTaskVo.getDeploymentId()
//flowTaskVo.getDataId()
MyTaskFlow myTaskFlow= myTaskFlowService.selectMyTaskFlowByDeployId(flowTaskVo.getDeploymentId(),flowTaskVo.getDataId());
if(myTaskFlow==null) {
return null;
}
MyTaskFlowVo vo=new MyTaskFlowVo();
vo.setTaskId(myTaskFlow.getTaskId());
vo.setDeployId(myTaskFlow.getDeployId());
vo.setProcDefId(myTaskFlow.getProcDefId());
vo.setProcInsId(myTaskFlow.getProcInsId());
vo.setExecutionId(myTaskFlow.getExecutionId());
FlowNextDto flowtDto=getFlowNodeType(myTaskFlow.getTaskId());
if(flowtDto!=null){
vo.setNodeisApprove(flowtDto.isNodeisApprove());
}
return Result.OK(vo);
}
......@@ -2654,13 +2687,25 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
// 为任务添加一个“阅读者”身份链接
taskService.addUserIdentityLink(flowTaskVo.getTaskId(), targetUserId, "reader");
Date date = new Date();
Date cdate = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String curdate = sdf.format(date);
String curdate = sdf.format(cdate);
// 3. (可选) 添加一条评论或日志,记录这次转办动作
//taskService.addComment(flowTaskVo.getTaskId(), null, originalUserId + " 将任务转办给 " + targetUserId);
taskService.addComment(flowTaskVo.getTaskId(), flowTaskVo.getInstanceId(), curdate+loginUser.getRealname() + " 将任务转阅给 " + targetuser.getRealname());
//写入待办
Task task = taskService.createTaskQuery().taskId(flowTaskVo.getTaskId()).singleResult();
String userType="user";
String OptionType=ProcessConstants.OPTION_TYPE_READ;
this.saveMyTaskFlow(flowTaskVo.getTaskId(),task,userType,targetUserId,OptionType+"待查看");
this.saveMyTaskFlowHis(task,userType,loginUser.getId(),cdate,loginUser.getId(),ProcessConstants.TASK_TYPE_HAND,OptionType);
}
......@@ -2795,5 +2840,200 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
@Override
public void saveMyTaskFlow(String thistaskId,Task nextTask,String userType,String approvalId,String messageTaskName){
//此方法为写入待办
// 根据流程定义ID查询流程定义对象
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
.processDefinitionId(nextTask.getProcessDefinitionId())
.singleResult();
String deploymentId ="";
String flowname ="";
if (processDefinition != null) {
// 获取部署ID - 这就是你想要的deployId
deploymentId = processDefinition.getDeploymentId();
flowname=processDefinition.getName();
}
// 获取流程变量
Map<String, Object> formValues = getProcessVariables(thistaskId);
String zdmc="";
String zdval="";
String tasktitle="";
if(formValues.get("dataName")==null){
if(formValues.get("_value")!=null) {
Map zdv = (Map) formValues.get("_value");
zdmc = (String) zdv.get("dataName");
zdval = zdv.get("dataId").toString();
tasktitle = (String) zdv.get("tasktitle");
}
}else{
zdmc=(String)formValues.get("dataName");
zdval=formValues.get("dataId").toString();
tasktitle=(String)formValues.get("tasktitle");
}
Long formId = Long.parseLong(nextTask.getFormKey());
FlowForm sysForm = flowFormService.getById(formId); // 假设有这个方法
MyTask myTask = new MyTask();
if(userType.equals("user")) {
myTask.setUid(approvalId);
} else {
myTask.setRoleid(approvalId);
}
myTask.setTp(5);
myTask.setTarget(nextTask.getName());
if(zdval!=null&&!zdval.equals("")){
myTask.setTargetId(zdval); //zdval
}
myTask.setStTime(new Date());
myTask.setTaskName(messageTaskName);
myTask.setName(nextTask.getName());
myTask.setSta(0);
myTask.setPriority("M");
myTask.setDes("");
//myTask.setLinkAddr("/project/plan/StPlanManList?"+zdmc+"="+zdval);
if(sysForm!=null){
if(sysForm.getFormTp().equals("2")){
myTask.setLinkAddr(sysForm.getFormListurl());
}else{
myTask.setLinkAddr("/flowable/task/todo/index");
}
}
myTaskService.save(myTask);
//有了以上信息,可以向相关表写入 相关信息了
MyTaskFlow taskFlow=new MyTaskFlow();
taskFlow.setTaskId(nextTask.getId());
taskFlow.setProcDefId(nextTask.getProcessDefinitionId());
taskFlow.setProcInsId(nextTask.getProcessInstanceId());
taskFlow.setExecutionId(nextTask.getExecutionId());
if(zdval!=null&&!zdval.equals("")){
taskFlow.setTargetId(zdval);
}
taskFlow.setDeployId(deploymentId);
taskFlow.setFormTableName(sysForm.getFormTableName());
if(userType.equals("user")) {
taskFlow.setUid(approvalId);
} else {
taskFlow.setRoleid(approvalId);
}
taskFlow.setTaskDefinitionKey(nextTask.getTaskDefinitionKey());
myTaskFlowService.save(taskFlow);
String tabname= sysForm.getFormTableName();
if(tabname!=null&&!tabname.equals("")&&zdmc!=null&&!zdmc.equals("")&&zdval!=null&&!zdval.equals("")){
String formContent=zdmc+"="+zdval;
FlowForm flowFormben=new FlowForm();
flowFormben.setFormTableName(tabname);
flowFormben.setFormContent(formContent);
flowFormben.setFormTp(approvalId);
sysDeployFormService.updateBisTabUid(flowFormben);
}
}
@Override
public void saveMyTaskFlowHis(Task task,String userType,String approvalId,Date cdate,String loginUserid,String taskType,String OptionType){
//此方法为写入履历
// 根据流程定义ID查询流程定义对象
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
.processDefinitionId(task.getProcessDefinitionId())
.singleResult();
String DeployId ="";
String flowname ="";
if (processDefinition != null) {
// 获取部署ID - 这就是你想要的deployId
DeployId = processDefinition.getDeploymentId();
flowname=processDefinition.getName();
}
// 获取流程变量
Map<String, Object> formValues = getProcessVariables(task.getId());
String zdmc="";
String zdval="";
String tasktitle="";
if(formValues.get("dataName")==null){
if(formValues.get("_value")!=null) {
Map zdv = (Map) formValues.get("_value");
zdmc = (String) zdv.get("dataName");
zdval = zdv.get("dataId").toString();
tasktitle = (String) zdv.get("tasktitle");
}
}else{
zdmc=(String)formValues.get("dataName");
zdval=formValues.get("dataId").toString();
tasktitle=(String)formValues.get("tasktitle");
}
MyTaskFlowHis taskFlowHis=new MyTaskFlowHis();
taskFlowHis.setTaskId(task.getId());
taskFlowHis.setProcDefId(task.getProcessDefinitionId());
taskFlowHis.setProcInsId(task.getProcessInstanceId());
taskFlowHis.setExecutionId(task.getExecutionId());
if(zdval!=null&&!zdval.equals("")){
taskFlowHis.setTargetId(zdval);
}
taskFlowHis.setDeployId(DeployId);
Long tformId = Long.parseLong(task.getFormKey());
FlowForm tsysForm = flowFormService.getById(tformId); // 假设有这个方法
if(tsysForm!=null&&tsysForm.getFormTableName()!=null){
taskFlowHis.setFormTableName(tsysForm.getFormTableName());
}
if(userType.equals("user")) {
taskFlowHis.setUid(approvalId);
} else {
taskFlowHis.setRoleid(approvalId);
}
taskFlowHis.setTaskDefinitionKey(task.getTaskDefinitionKey());
taskFlowHis.setOptionTime(cdate);
taskFlowHis.setOptionId(loginUserid);
taskFlowHis.setOptionType(OptionType);//审核 转办 转阅
taskFlowHis.setTaskType(taskType);//发起 参与
taskFlowHis.setTaskName(task.getName());
taskFlowHis.setTaskTitle(tasktitle);
taskFlowHis.setFlowName(flowname);
myTaskFlowHisService.save(taskFlowHis);
}
}
......@@ -22,6 +22,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.stm.utils.UserUtil;
import org.jeecg.modules.system.entity.SysUserRole;
import org.jeecg.modules.system.service.ISysUserRoleService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
......@@ -51,6 +54,8 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
public class MyTaskFlowHisController extends JeecgController<MyTaskFlowHis, IMyTaskFlowHisService> {
@Autowired
private IMyTaskFlowHisService myTaskFlowHisService;
@Autowired
private ISysUserRoleService sysUserRoleService;
/**
* 分页列表查询
......@@ -75,6 +80,34 @@ public class MyTaskFlowHisController extends JeecgController<MyTaskFlowHis, IMyT
IPage<MyTaskFlowHis> pageList = myTaskFlowHisService.page(page, queryWrapper);
return Result.OK(pageList);
}
@GetMapping(value = "/starlist")
public Result<IPage<MyTaskFlowHis>> starlistqueryPageList(MyTaskFlowHis myTaskFlowHis,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
String userId = UserUtil.getUserId();
String roleids="";
List<SysUserRole> userRole = sysUserRoleService.list(new QueryWrapper<SysUserRole>().lambda().eq(SysUserRole::getUserId, userId));
for(int u=0;u<userRole.size();u++){
SysUserRole sysUserRole=userRole.get(u);
roleids=roleids+sysUserRole.getRoleId()+",";
}
if(!roleids.equals("")){
roleids=roleids.substring(0,roleids.length()-1);
}
// 创建一个最终变量或实际上的最终变量用于 lambda
final String finalRoleids = roleids;
QueryWrapper<MyTaskFlowHis> queryWrapper = QueryGenerator.initQueryWrapper(myTaskFlowHis, req.getParameterMap());
queryWrapper.eq("option_id", userId)
.eq("task_type","发起")
.orderByDesc("option_time");
Page<MyTaskFlowHis> page = new Page<MyTaskFlowHis>(pageNo, pageSize);
IPage<MyTaskFlowHis> pageList = myTaskFlowHisService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
......
......@@ -41,21 +41,18 @@ public class MyTaskFlowServiceImpl extends ServiceImpl<MyTaskFlowMapper, MyTaskF
@Override
public List<String> queryTodoList(MyTaskFlow myTaskFlow) {
LambdaQueryWrapper<MyTaskFlow> query = new LambdaQueryWrapper<>();
String roleCodes = UserUtil.getRoleCode();
final List<String> roleCodeList;
final List<String> roleIdList;// 使用 final 关键字
if (StringUtils.hasText(roleCodes)) {
roleCodeList = Arrays.asList(roleCodes.split(","));
roleIdList = queryRoleIdsByRoleCodes(roleCodeList);
} else {
roleCodeList = Collections.emptyList(); // 明确赋值为空列表
roleCodeList = Collections.emptyList();
roleIdList = Collections.emptyList();
}
// 基础条件
query.eq(Objects.nonNull(myTaskFlow.getDeployId()),
MyTaskFlow::getDeployId, myTaskFlow.getDeployId())
......
......@@ -114,8 +114,8 @@ public class PageTitleconfigController extends JeecgController<PageTitleconfig,
wrapper.or().in("roleid", Arrays.asList(finalRoleids.split(",")));
}
})
.orderByDesc("priority")
.orderByDesc("st_time");
.orderByDesc("st_time")
.orderByDesc("priority");
queryWrapper.last("limit 5");
List<MyTask> list = myTaskService.list(queryWrapper);
return Result.OK(list);
......
......@@ -72,7 +72,7 @@ public class StProblemCheckController extends JeecgController<StProblemCheck, IS
QueryWrapper<StProblemCheck> queryWrapper = QueryGenerator.initQueryWrapper(stProblemCheck, req.getParameterMap());
MyTaskFlow myTaskFlow = new MyTaskFlow();
myTaskFlow.setFormTableName("st_problem_check");
myTaskFlow.setTaskDefinitionKey(stProblemCheck.getBmpNodeId());
myTaskFlow.setTaskDefinitionKey(stProblemCheck.getBpmNodeId());
List<String> todoList = myTaskFlowService.queryTodoList(myTaskFlow);
if(Utils.isNullOrEmpty(todoList)) {
......
......@@ -152,24 +152,23 @@ public class StProblemCheck implements Serializable {
/**整改落实情况*/
private java.lang.String execRemark;
/**发现人*/
private java.lang.String findUser;
/**流程状态*/
private java.lang.String bpmStatus;
/**部署ID*/
private java.lang.String deployId;
/**流程实例ID*/
private java.lang.String procInsId;
/**风险等级*/
private java.lang.Integer riskLevel;
/**流程节点ID*/
private java.lang.String bmpNodeId;
// 当前用户需要处理的工作流 实例ID
@TableField(exist = false)
private java.util.List todolist;
/**流程状态*/
private java.lang.String bpmStatus;
/**部署ID*/
private java.lang.String deployId;
/**流程节点ID*/
private java.lang.String bpmNodeId;
}
......@@ -173,6 +173,7 @@ spring:
url: jdbc:mysql://localhost:3306/zrch_stm_db_3.9_new?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
username: root
password: 123456
driver-class-name: com.mysql.cj.jdbc.Driver
# # shardingjdbc数据源
# sharding-db:
......
......@@ -18,7 +18,18 @@ management:
web:
exposure:
include: metrics,httpexchanges,jeecghttptrace
flowable:
database-schema-update: false
cmmn:
enabled: false
app:
enabled: false
content:
enabled: false
dmn:
enabled: false
form:
enabled: false
spring:
# main:
# # 启动加速 (建议开发环境,开启后flyway自动升级失效)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论