提交 e2396e12 authored 作者: whydesc's avatar whydesc

--流程抄送处理

上级 d6807a14
import {defHttp} from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/my/myTaskFlowCc/list',
save='/my/myTaskFlowCc/add',
edit='/my/myTaskFlowCc/edit',
deleteOne = '/my/myTaskFlowCc/delete',
deleteBatch = '/my/myTaskFlowCc/deleteBatch',
importExcel = '/my/myTaskFlowCc/importExcel',
exportXls = '/my/myTaskFlowCc/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});
}
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: '表单的表名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: 'roleid'
},
{
title: '抄送人',
align:"center",
dataIndex: 'ccid'
},
{
title: '抄送角色',
align:"center",
dataIndex: 'ccroleid'
},
{
title: '节点ID',
align:"center",
dataIndex: 'taskDefinitionKey'
},
*/
{
title: '流程名称',
align:"center",
dataIndex: 'flowName'
},
{
title: '标题',
align:"center",
dataIndex: 'taskTitle'
},
{
title: '节点名称',
align:"center",
dataIndex: 'taskDefinitionName'
},
{
title: '待办类型',
align:"center",
dataIndex: 'uidType'
},
{
title: '状态',
align:"center",
dataIndex: 'status',
customRender: ({ text }) => {
const color = text == '0' ? 'red' : text == '1' ? 'green' : 'blue';
return render.renderTag(text == '0' ? '未查看' : text == '1' ? '已查看' : '', color);
},
},
{
title: '发送人',
align:"center",
dataIndex: 'uid_dictText'
},
{
title: '发送时间',
align:"center",
dataIndex: 'ccTime'
},
{
title: '浏览时间',
align:"center",
dataIndex: 'readTime'
},
];
//查询数据
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: '抄送人',
field: 'ccid',
component: 'Input',
},
{
label: '抄送角色',
field: 'ccroleid',
component: 'Input',
},
{
label: '节点ID',
field: 'taskDefinitionKey',
component: 'Input',
},
{
label: '节点名称',
field: 'taskDefinitionName',
component: 'Input',
},
{
label: '待办类型:2 抄送 3 转阅',
field: 'uidType',
component: 'Input',
},
{
label: '状态 0 未看 1 已看',
field: 'status',
component: 'Input',
},
{
label: '抄送操作时间',
field: 'ccTime',
component: 'DatePicker',
componentProps: {
showTime: true,
valueFormat: 'YYYY-MM-DD HH:mm:ss'
},
},
{
label: '浏览操作时间',
field: 'readTime',
component: 'DatePicker',
componentProps: {
showTime: true,
valueFormat: 'YYYY-MM-DD HH:mm:ss'
},
},
// 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',},
ccid: {title: '抄送人',order: 9,view: 'text', type: 'string',},
ccroleid: {title: '抄送角色',order: 10,view: 'text', type: 'string',},
taskDefinitionKey: {title: '节点ID',order: 11,view: 'text', type: 'string',},
*/
flowName: {title: '流程名称',order: 10,view: 'text', type: 'string',},
taskTitle: {title: '标题',order: 11,view: 'text', type: 'string',},
taskDefinitionName: {title: '节点名称',order: 12,view: 'text', type: 'string',},
uidType: {title: '待办类型',order: 13,view: 'text', type: 'string',},
status: {title: '状态',order: 14,view: 'text', type: 'string',},
ccTime: {title: '发送时间',order: 15,view: 'datetime', type: 'string',},
readTime: {title: '浏览时间',order: 16,view: 'datetime', 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_cc:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" v-auth="'my:my_task_flow_cc:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" v-auth="'my:my_task_flow_cc: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_cc: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>
<!-- 表单区域 -->
<MyTaskFlowCcModal @register="registerModal" @success="handleSuccess"></MyTaskFlowCcModal>
<!-- 待办抽屉 -->
<div v-if="isShowDrawer">
<a-drawer destroyOnClose v-model:open="isShowDrawer" class="flat-drawer" title="待办任务" placement="right" width="90%">
<template #extra>
<div class="drawer-tags">
<span class="tag">发起人: {{ startUser }}</span>
<span class="tag">任务节点: {{ taskName }}</span>
</div>
</template>
<TodoIndex v-if="isShowDrawer" ref="refTodoIndex" @callback="handleSuccess" />
</a-drawer>
</div>
<!-- 流程详情抽屉 -->
<div v-if="isShowDetailDrawer">
<a-drawer destroyOnClose v-model:open="isShowDetailDrawer" class="flat-drawer" title="流程详情" placement="right" width="90%">
<template #extra>
<a-button type="text" @click="handleDetailDrawerClose">关闭</a-button>
</template>
<Detail ref="refDetail" />
</a-drawer>
</div>
</div>
</template>
<script lang="ts" name="my-myTaskFlowCc" setup>
import {ref,nextTick, reactive, computed, toRaw,unref} from 'vue';
import {BasicTable, useTable, TableAction} from '/@/components/Table';
import {useModal} from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage'
import MyTaskFlowCcModal from './components/MyTaskFlowCcModal.vue'
import {columns, searchFormSchema, superQuerySchema} from './MyTaskFlowCc.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './MyTaskFlowCc.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import { useUserStore } from '/@/store/modules/user';
import { useMessage } from '/@/hooks/web/useMessage';
import { getDateByPicker } from '/@/utils';
import { todoList, getMyTaskFlow } from '/@/components/Process/api/todo';
// 引入待办任务组件
import TodoIndex from '../flowable/task/todo/components/TodoIndex.vue';
// 引入详情组件
import Detail from '../flowable/task/myProcess/components/Detail.vue';
const taskCache = new Map<string, any>();
//日期个性化选择
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_cc',
api: list,
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_cc",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
})
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
// 高级查询配置
const superQueryConfig = reactive(superQuerySchema);
const refTodoIndex = ref();
const isShowDrawer = ref(false);
// 流程详情抽屉相关
const refDetail = ref();
const isShowDetailDrawer = ref(false);
const startUser = ref<string>('');
const taskName = ref<string>('');
/**
* 高级查询事件
*/
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: handleTodoDb.bind(null, record),
},
{
label: '流转记录',
onClick: handleProgressDetail.bind(null, record),
}/**,
{
label: '编辑',
onClick: handleEdit.bind(null, record),
auth: 'my:my_task_flow_cc:edit'
}
*/
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
return [];
/**
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
},
auth: 'my:my_task_flow_cc:delete'
}
]
*/
}
function pickStartResult(res: any) {
const base = res?.data ?? res?.result ?? res;
return base || {};
}
async function handleTodoDb(record: Recordable) {
const dataId = record.targetId;
const deployId = record.deployId;
if (!dataId || !deployId) {
message.error('未找到业务数据标识');
return;
}
try {
const myTaskFlow = await getMyTaskFlow({ deploymentId: record.deployId, dataId: record.targetId });
const taskData = pickStartResult(myTaskFlow);
if (!taskData || !taskData.taskId) {
message.error('未获取到待办任务信息');
return;
}
if (taskData.nodeisApprove == null) {
taskData.nodeisApprove = true;
}
taskCache.set(String(dataId), taskData);
startUser.value = taskData.startUserName || taskData.startUser || '';
taskName.value = taskData.taskName || taskData.currentTaskName || '';
isShowDrawer.value = true;
await nextTick();
refTodoIndex.value?.iniData?.(taskData);
} catch (e) {
console.error('获取流程任务信息失败:', e);
message.error('获取任务信息失败,请重试');
}
}
/**
* 流转记录
*/
async function handleProgressDetail(record: Recordable) {
const dataId = record.targetId;
const deployId = record.deployId;
//alert(dataId);
if (!dataId || !deployId) {
message.error('未找到业务数据标识');
return;
}
try {
const myTaskFlow = await getMyTaskFlow({ deploymentId: record.deployId, dataId: record.targetId });
const taskData = pickStartResult(myTaskFlow);
if (!taskData || !taskData.taskId) {
message.error('未获取到待办任务信息');
return;
}
if (taskData.nodeisApprove == null) {
taskData.nodeisApprove = true;
}
taskCache.set(String(dataId), taskData);
// alert(taskData);
isShowDetailDrawer.value = true;
await nextTick();
if (refDetail.value) {
refDetail.value.iniData({
...record,
...taskData,
procInsId: taskData.procInsId,
});
} else {
isShowDetailDrawer.value = false;
}
} catch (e) {
console.error('获取流程任务信息失败:', e);
message.error('获取任务信息失败,请重试');
}
}
</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 '../MyTaskFlowCc.data';
import {saveOrUpdate} from '../MyTaskFlowCc.api';
export default defineComponent({
name: "MyTaskFlowCcForm",
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/myTaskFlowCc/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="MyTaskFlowCcForm" />
</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 '../MyTaskFlowCc.data';
import {saveOrUpdate} from '../MyTaskFlowCc.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
import { message } from 'ant-design-vue';
import { BasicColumn, FormSchema } from '/@/components/Table';
import { render } from '/@/utils/common/renderUtils';
// ==================== 执行规则选项 ====================
export const exeRuleOptions = [
{ value: 1, label: '一次性' },
{ value: 2, label: '周期执行' },
{ value: 3, label: '事件触发' },
];
// ==================== 执行周期选项 ====================
export const exePeriodOptions = [
{ value: 'daily', label: '每日' },
{ value: 'weekly', label: '每周' },
{ value: 'monthly', label: '每月' },
{ value: 'quarterly', label: '每季度' },
{ value: 'halfyear', label: '每半年' },
{ value: 'yearly', label: '每年' },
];
// ==================== 优先级选项 ====================
export const priorityOptions = [
{ value: '1', label: '高' },
{ value: '2', label: '中' },
{ value: '3', label: '低' },
];
// ==================== 计划状态选项 ====================
export const planStatusOptions = [
{ value: '0', label: '草稿' },
{ value: '1', label: '审批中' },
{ value: '2', label: '已通过' },
{ value: '3', label: '已拒绝' },
{ value: '4', label: '执行中' },
{ value: '5', label: '已完成' },
{ value: '6', label: '已作废' },
];
// 列表数据
export const columns: BasicColumn[] = [
{
title: '计划名称',
align: 'left',
dataIndex: 'projectName',
width: 180,
ellipsis: true,
},
{
title: '计划类型',
align: 'center',
dataIndex: 'projectTypeName',
width: 120,
ellipsis: true,
},
{
title: '执行部门',
align: 'center',
dataIndex: 'execDepName',
width: 140,
ellipsis: true,
},
{
title: '负责人',
align: 'center',
dataIndex: 'headName',
width: 100,
ellipsis: true,
},
{
title: '优先级',
align: 'center',
dataIndex: 'priority',
width: 80,
ellipsis: true,
customRender: ({ text }) => {
const priorityMap = {
'1': '高',
'2': '中',
'3': '低',
};
return priorityMap[text] || '-';
},
},
{
title: '执行规则',
align: 'center',
dataIndex: 'exeRule',
width: 100,
ellipsis: true,
customRender: ({ text }) => {
const ruleMap = {
1: '事件触发',
2: '周期执行',
3: '一次性执行',
};
return ruleMap[text] || '-';
},
},
{
title: '计划开始日期',
align: 'center',
dataIndex: 'planStartDate',
width: 130,
ellipsis: true,
customRender: ({ text }) => {
return !text ? '-' : text.length > 10 ? text.substr(0, 10) : text;
},
},
{
title: '计划结束日期',
align: 'center',
dataIndex: 'planEndDate',
width: 130,
ellipsis: true,
customRender: ({ text }) => {
return !text ? '-' : text.length > 10 ? text.substr(0, 10) : text;
},
},
{
title: '计划状态',
align: 'center',
dataIndex: 'statusName',
width: 100,
ellipsis: true,
},
{
title: '流程状态',
align: 'center',
dataIndex: 'bpmStatus',
width: 120,
ellipsis: true,
customRender: ({ text }) => {
return render.renderDict(text, 'bpm_status') || '-';
},
},
{
title: '当前节点',
align: 'center',
dataIndex: 'flowtaskName',
width: 100,
ellipsis: true,
},
// 隐藏列,用于内部使用
{
title: '',
dataIndex: 'projectType',
width: 0,
ellipsis: false,
},
];
// 查询表单数据
export const searchFormSchema: FormSchema[] = [
{
label: '计划名称',
field: 'projectName',
component: 'Input',
colProps: { span: 6 },
},
{
label: '计划类型',
field: 'projectType',
component: 'Select',
colProps: { span: 6 },
componentProps: {
allowClear: true,
placeholder: '请选择类型',
},
},
{
label: '执行部门',
field: 'execDepCode',
component: 'Select',
colProps: { span: 6 },
componentProps: {
allowClear: true,
placeholder: '请选择执行部门',
},
},
{
label: '计划状态',
field: 'status',
component: 'Select',
colProps: { span: 6 },
componentProps: {
allowClear: true,
placeholder: '请选择状态',
options: planStatusOptions,
},
},
{
label: '计划日期',
field: 'planDateRange',
component: 'RangePicker',
colProps: { span: 8 },
componentProps: {
placeholder: ['开始日期', '结束日期'],
},
},
{
label: '优先级',
field: 'priority',
component: 'Select',
colProps: { span: 5 },
componentProps: {
allowClear: true,
placeholder: '请选择优先级',
options: priorityOptions,
},
},
{
label: '执行规则',
field: 'exeRule',
component: 'Select',
colProps: { span: 5 },
componentProps: {
allowClear: true,
placeholder: '请选择执行规则',
options: exeRuleOptions,
},
},
];
// 表单数据
export const formSchema: FormSchema[] = [
{
label: '计划名称',
field: 'projectName',
component: 'Input',
colProps: { lg: 12 },
itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 6 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 18 } } },
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入计划名称!' }];
},
},
{
label: '计划类型',
field: 'projectType',
component: 'JCategorySelect',
componentProps: {
pcode: 'B09',
valueType: 'code',
},
colProps: { lg: 12 },
itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 6 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 18 } } },
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请选择计划类型!' }];
},
},
{
label: '执行部门',
field: 'execDepCode',
component: 'JSelectDept',
colProps: { lg: 12 },
itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 6 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 18 } } },
dynamicRules: ({ model, schema }) => {
return [{ required: false, message: '请选择执行部门!' }];
},
},
{
label: '负责人',
field: 'headId',
component: 'JSearchSelectDuty',
colProps: { lg: 12 },
itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 6 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 18 } } },
dynamicRules: ({ model, schema }) => {
return [{ required: false, message: '请选择负责人!' }];
},
},
{
label: '计划开始日期',
field: 'planStartDate',
component: 'DatePicker',
colProps: { lg: 12 },
itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 6 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 18 } } },
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请选择计划开始日期!' }];
},
},
{
label: '计划结束日期',
field: 'planEndDate',
component: 'DatePicker',
colProps: { lg: 12 },
itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 6 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 18 } } },
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请选择计划结束日期!' }];
},
},
{
label: '优先级',
field: 'priority',
component: 'Select',
colProps: { lg: 12 },
itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 6 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 18 } } },
componentProps: {
options: priorityOptions,
placeholder: '请选择优先级',
},
},
{
label: '执行规则',
field: 'exeRule',
component: 'RadioButtonGroup',
colProps: { lg: 12 },
itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 6 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 18 } } },
componentProps: {
options: exeRuleOptions,
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请选择执行规则!' }];
},
},
{
label: '触发事件名称',
field: 'triggerEventName',
component: 'Input',
colProps: { lg: 24 },
itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 3 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 21 } } },
dynamicShow: ({ model }) => {
return model.exeRule === 1;
},
dynamicRules: ({ model, schema }) => {
return model.exeRule === 1 ? [{ required: true, message: '请填写触发事件名称!' }] : [];
},
},
{
label: '执行周期',
field: 'exePeriod',
component: 'Select',
colProps: { lg: 12 },
itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 6 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 18 } } },
componentProps: {
options: exePeriodOptions,
placeholder: '请选择执行周期',
},
dynamicShow: ({ model }) => {
return model.exeRule === 2;
},
dynamicRules: ({ model, schema }) => {
return model.exeRule === 2 ? [{ required: true, message: '请选择执行周期!' }] : [];
},
},
{
label: '首次执行日期',
field: 'firstExecDate',
component: 'DatePicker',
colProps: { lg: 12 },
itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 6 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 18 } } },
dynamicShow: ({ model }) => {
return model.exeRule === 2;
},
},
{
label: '计划依据',
field: 'planBasis',
component: 'Input',
slot: 'planBasis',
itemProps: {
labelCol: { xs: { span: 24 }, sm: { span: 3 } },
wrapperCol: { xs: { span: 24 }, sm: { span: 21 } },
},
},
{
label: '交付物',
field: 'planDeliverable',
component: 'Input',
colProps: { lg: 12 },
itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 6 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 18 } } },
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入交付物!' }];
},
},
{
label: '备注说明',
field: 'projectDesc',
component: 'InputTextArea',
itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 3 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 21 } } },
dynamicRules: ({ model, schema }) => {
return [{ required: false, message: '请输入备注说明!' }];
},
},
{
label: '相关附件',
field: 'fileUploadPath',
component: 'JUpload',
itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 3 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 21 } } },
componentProps: { desText: '支持扩展名: .rar .zip .doc .docx .pdf .jpg...' },
},
{
label: '审核意见',
field: 'approveDes',
component: 'InputTextArea',
itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 3 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 21 } } },
show: false,
},
// 主键隐藏字段
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
];
/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[] {
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
return formSchema;
}
...@@ -113,6 +113,13 @@ export const columns: BasicColumn[] = [ ...@@ -113,6 +113,13 @@ export const columns: BasicColumn[] = [
return render.renderDict(text, 'bpm_status') || '-'; return render.renderDict(text, 'bpm_status') || '-';
}, },
}, },
{
title: '当前节点',
align: 'center',
dataIndex: 'flowtaskName',
width: 100,
ellipsis: true,
},
// 隐藏列,用于内部使用 // 隐藏列,用于内部使用
{ {
title: '', title: '',
......
...@@ -17,8 +17,14 @@ ...@@ -17,8 +17,14 @@
<if test="formTp != null and formTp != ''"> <if test="formTp != null and formTp != ''">
bpm_status=#{formTp}, bpm_status=#{formTp},
</if> </if>
<if test="formRules != null and formRules != ''">
flowtask_name=#{formRules},
</if>
<if test="formRules != null and formRules == ''">
flowtask_name=null,
</if>
<if test="formTp != null and formTp == ''"> <if test="formTp != null and formTp == ''">
bpm_status=NULL,deploy_id=null bpm_status=NULL,deploy_id=null,flowtask_name=null
</if> </if>
<if test="formUrl != null and formUrl != ''"> <if test="formUrl != null and formUrl != ''">
deploy_id=#{formUrl} deploy_id=#{formUrl}
......
...@@ -114,6 +114,10 @@ public class ProcessConstants { ...@@ -114,6 +114,10 @@ public class ProcessConstants {
* 操作类型-驳回 * 操作类型-驳回
*/ */
public static final String OPTION_TYPE_REJECT = "驳回"; public static final String OPTION_TYPE_REJECT = "驳回";
/**
* 操作类型-抄送
*/
public static final String OPTION_TYPE_CC = "抄送";
} }
...@@ -181,7 +181,7 @@ public interface IFlowTaskService { ...@@ -181,7 +181,7 @@ public interface IFlowTaskService {
public Result<List<String>> todoListAll(); public Result<List<String>> todoListAll();
public void saveMyTaskFlow(String thistaskId,Task nextTask,String userType,String approvalId,String messageTaskName); public void saveMyTaskFlow(String thistaskId,Task nextTask,String userType,String approvalId,String messageTaskName,String copyUser);
public void saveMyTaskFlowHis(Task task,String userType,String approvalId,Date cdate,String loginUserid,String taskType,String OptionType); public void saveMyTaskFlowHis(Task task,String userType,String approvalId,Date cdate,String loginUserid,String taskType,String OptionType,String copyUser,String copyType);
} }
...@@ -394,6 +394,7 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl ...@@ -394,6 +394,7 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
// 流程发起时 跳过发起人节点 // 流程发起时 跳过发起人节点
ProcessInstance processInstance = runtimeService.startProcessInstanceById(procDefId, variables); ProcessInstance processInstance = runtimeService.startProcessInstanceById(procDefId, variables);
Task task = taskService.createTaskQuery().processInstanceId(processInstance.getProcessInstanceId()).active().singleResult(); Task task = taskService.createTaskQuery().processInstanceId(processInstance.getProcessInstanceId()).active().singleResult();
taskService.setAssignee(task.getId(), sysUser.getId());
String OptionType=""; String OptionType="";
Boolean isnodeisApprove=false; Boolean isnodeisApprove=false;
FlowNextDto flowtDto=flowTaskService.getFlowNodeType(task.getId()); FlowNextDto flowtDto=flowTaskService.getFlowNodeType(task.getId());
...@@ -465,6 +466,8 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl ...@@ -465,6 +466,8 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
flowFormben.setFormContent(formContent); flowFormben.setFormContent(formContent);
flowFormben.setFormTp("2"); flowFormben.setFormTp("2");
flowFormben.setFormUrl(DeployId); flowFormben.setFormUrl(DeployId);
flowFormben.setFormRules(task.getName());
//formRules 传递节点名
sysDeployFormService.updateBisTabBpmStatus(flowFormben); sysDeployFormService.updateBisTabBpmStatus(flowFormben);
...@@ -473,7 +476,8 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl ...@@ -473,7 +476,8 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
String userType="user"; String userType="user";
String approvalId=sysUser.getId(); String approvalId=sysUser.getId();
flowTaskService.saveMyTaskFlowHis(task,userType,approvalId,cdate,sysUser.getId(),ProcessConstants.TASK_TYPE_START,OptionType); flowTaskService.saveMyTaskFlow(task.getId(),task,userType,approvalId,task.getName(),null);
flowTaskService.saveMyTaskFlowHis(task,userType,approvalId,cdate,sysUser.getId(),ProcessConstants.TASK_TYPE_START,OptionType,null,null);
/** /**
MyTaskFlowHis taskFlowHis=new MyTaskFlowHis(); MyTaskFlowHis taskFlowHis=new MyTaskFlowHis();
......
...@@ -64,7 +64,9 @@ import org.jeecg.modules.flowable.flow.FlowableUtils; ...@@ -64,7 +64,9 @@ import org.jeecg.modules.flowable.flow.FlowableUtils;
import org.jeecg.modules.flowable.service.IFlowTaskService; import org.jeecg.modules.flowable.service.IFlowTaskService;
import org.jeecg.modules.stm.my.entity.MyTask; import org.jeecg.modules.stm.my.entity.MyTask;
import org.jeecg.modules.stm.my.entity.MyTaskFlow; import org.jeecg.modules.stm.my.entity.MyTaskFlow;
import org.jeecg.modules.stm.my.entity.MyTaskFlowCc;
import org.jeecg.modules.stm.my.entity.MyTaskFlowHis; import org.jeecg.modules.stm.my.entity.MyTaskFlowHis;
import org.jeecg.modules.stm.my.service.IMyTaskFlowCcService;
import org.jeecg.modules.stm.my.service.IMyTaskFlowHisService; import org.jeecg.modules.stm.my.service.IMyTaskFlowHisService;
import org.jeecg.modules.stm.my.service.IMyTaskFlowService; import org.jeecg.modules.stm.my.service.IMyTaskFlowService;
import org.jeecg.modules.stm.my.service.IMyTaskService; import org.jeecg.modules.stm.my.service.IMyTaskService;
...@@ -108,6 +110,8 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask ...@@ -108,6 +110,8 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
private IMyTaskFlowService myTaskFlowService; private IMyTaskFlowService myTaskFlowService;
@Autowired @Autowired
private IMyTaskFlowHisService myTaskFlowHisService; private IMyTaskFlowHisService myTaskFlowHisService;
@Autowired
private IMyTaskFlowCcService myTaskFlowCcService;
/** /**
* 完成任务 * 完成任务
...@@ -188,59 +192,30 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask ...@@ -188,59 +192,30 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
SysUser loginUser = iFlowThirdService.getLoginUser(); SysUser loginUser = iFlowThirdService.getLoginUser();
taskService.complete(taskVo.getTaskId(), taskVo.getValues()); taskService.complete(taskVo.getTaskId(), taskVo.getValues());
//处理抄送
String copyUser=""; //抄送人
Object copyUserObject = taskVo.getValues().get("copyUser");
if(copyUserObject!=null) {
copyUser = copyUserObject.toString();
}
String userType =""; String userType ="";
String approvalId=""; String approvalId="";
Object userTypeObject = taskVo.getValues().get("approvalType"); Object userTypeObject = taskVo.getValues().get("approvalType");
if(userTypeObject!=null) { if(userTypeObject!=null) {
userType = userTypeObject.toString(); userType = userTypeObject.toString();
approvalId = taskVo.getValues().get("approval").toString();
}
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());
taskFlowHis.setProcInsId(task.getProcessInstanceId());
taskFlowHis.setExecutionId(task.getExecutionId());
if(zdval!=null&&!zdval.equals("")){
taskFlowHis.setTargetId(zdval);
}
taskFlowHis.setDeployId(deploymentId);
Long tformId = Long.parseLong(task.getFormKey());
FlowForm tsysForm = flowFormService.getById(tformId); // 假设有这个方法
if(tsysForm!=null&&tsysForm.getFormTableName()!=null){
taskFlowHis.setFormTableName(tsysForm.getFormTableName());
} }
Object approvalObject = taskVo.getValues().get("approval");
if(userType.equals("user")) { if(approvalObject!=null) {
taskFlowHis.setUid(approvalId); approvalId = approvalObject.toString();
} else {
taskFlowHis.setRoleid(approvalId);
} }
taskFlowHis.setTaskDefinitionKey(task.getTaskDefinitionKey()); this.saveMyTaskFlowHis(task,userType,approvalId,cdate,loginUser.getId(),ProcessConstants.TASK_TYPE_HAND,OptionType,copyUser,ProcessConstants.OPTION_TYPE_CC);
taskFlowHis.setOptionTime(cdate);
taskFlowHis.setOptionId(loginUser.getId());
taskFlowHis.setOptionType(OptionType);//审核 转办 转阅
taskFlowHis.setTaskType(ProcessConstants.TASK_TYPE_HAND);//发起 参与
taskFlowHis.setTaskName(task.getName());
taskFlowHis.setTaskTitle(tasktitle);
taskFlowHis.setFlowName(flowname);
myTaskFlowHisService.save(taskFlowHis);
*/
FlowForm flowForm=sysDeployFormService.selectSysDeployFormByDeployId(deploymentId);
Task nextTask = taskService.createTaskQuery() Task nextTask = taskService.createTaskQuery()
.processInstanceId(taskVo.getInstanceId()) .processInstanceId(taskVo.getInstanceId())
...@@ -254,96 +229,35 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask ...@@ -254,96 +229,35 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
taskService.addCandidateGroup(nextTask.getId(),approvalId); taskService.addCandidateGroup(nextTask.getId(),approvalId);
} }
this.saveMyTaskFlow(task.getId(),nextTask,userType,approvalId,"待"+OptionType); this.saveMyTaskFlow(task.getId(),nextTask,userType,approvalId,"待"+OptionType,null);
/**
// 处理表单数据
// Map<String, Object> formData = processFormData(task);
// 根据表单KEY查询表单定义
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("待处理");
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);
if(flowForm!=null){
String tabname= sysForm.getFormTableName(); String tabname= flowForm.getFormTableName();
if(tabname!=null&&!tabname.equals("")&&zdmc!=null&&!zdmc.equals("")&&zdval!=null&&!zdval.equals("")){ if(tabname!=null&&!tabname.equals("")&&zdmc!=null&&!zdmc.equals("")&&zdval!=null&&!zdval.equals("")){
String formContent=zdmc+"="+zdval; String formContent=zdmc+"="+zdval;
FlowForm flowFormben=new FlowForm(); FlowForm flowFormben=new FlowForm();
flowFormben.setFormTableName(tabname); flowFormben.setFormTableName(tabname);
flowFormben.setFormContent(formContent); flowFormben.setFormContent(formContent);
flowFormben.setFormTp(approvalId); flowFormben.setFormTp("2");
flowFormben.setFormUrl(deploymentId);
sysDeployFormService.updateBisTabUid(flowFormben); if(tabname!=null&&tabname.equals("st_plan_man")){
flowFormben.setFormRules(nextTask.getName());
}else{
flowFormben.setFormRules(null);
} }
*/
//formRules 传递节点名
sysDeployFormService.updateBisTabBpmStatus(flowFormben);
}
}
}else{ }else{
//是最后一个 id 判断是最后一个节点 //是最后一个 id 判断是最后一个节点
FlowForm flowForm=sysDeployFormService.selectSysDeployFormByDeployId(deploymentId);
if(flowForm!=null){ if(flowForm!=null){
String tabname= flowForm.getFormTableName(); String tabname= flowForm.getFormTableName();
...@@ -354,6 +268,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask ...@@ -354,6 +268,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
flowFormben.setFormContent(formContent); flowFormben.setFormContent(formContent);
flowFormben.setFormTp("3"); flowFormben.setFormTp("3");
flowFormben.setFormUrl(deploymentId); flowFormben.setFormUrl(deploymentId);
flowFormben.setFormRules("");
sysDeployFormService.updateBisTabBpmStatus(flowFormben); sysDeployFormService.updateBisTabBpmStatus(flowFormben);
} }
} }
...@@ -562,10 +477,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask ...@@ -562,10 +477,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
String OptionType=ProcessConstants.OPTION_TYPE_REJECT; String OptionType=ProcessConstants.OPTION_TYPE_REJECT;
//写入待办 //写入待办
this.saveMyTaskFlow(task.getId(),newTask,userType,approvalId,OptionType+"待处理"); this.saveMyTaskFlow(task.getId(),newTask,userType,approvalId,OptionType+"待处理",null);
this.saveMyTaskFlowHis(task,userType,approvalId,cdate,loginUser.getId(),ProcessConstants.TASK_TYPE_HAND,OptionType); this.saveMyTaskFlowHis(task,userType,approvalId,cdate,loginUser.getId(),ProcessConstants.TASK_TYPE_HAND,OptionType,null,null);
//有了以上信息,可以向相关表写入 相关信息了 //有了以上信息,可以向相关表写入 相关信息了
/** /**
...@@ -926,10 +841,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask ...@@ -926,10 +841,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
String OptionType=ProcessConstants.OPTION_TYPE_ASSIGN; String OptionType=ProcessConstants.OPTION_TYPE_ASSIGN;
//写入待办 //写入待办
this.saveMyTaskFlow(flowTaskVo.getTaskId(),task,userType,targetUserId,OptionType+"待处理"); this.saveMyTaskFlow(flowTaskVo.getTaskId(),task,userType,targetUserId,OptionType+"待处理",null);
this.saveMyTaskFlowHis(task,userType,loginUser.getId(),cdate,loginUser.getId(),ProcessConstants.TASK_TYPE_HAND,OptionType); this.saveMyTaskFlowHis(task,userType,loginUser.getId(),cdate,loginUser.getId(),ProcessConstants.TASK_TYPE_HAND,OptionType,null,null);
/** /**
MyTask myTask = new MyTask(); MyTask myTask = new MyTask();
...@@ -2700,10 +2615,11 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask ...@@ -2700,10 +2615,11 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
Task task = taskService.createTaskQuery().taskId(flowTaskVo.getTaskId()).singleResult(); Task task = taskService.createTaskQuery().taskId(flowTaskVo.getTaskId()).singleResult();
String userType="user"; String userType="user";
String OptionType=ProcessConstants.OPTION_TYPE_READ; String OptionType=ProcessConstants.OPTION_TYPE_READ;
this.saveMyTaskFlow(flowTaskVo.getTaskId(),task,userType,targetUserId,OptionType+"待查看"); //转阅不写入待办
//this.saveMyTaskFlow(flowTaskVo.getTaskId(),task,userType,targetUserId,OptionType+"待查看",null);
this.saveMyTaskFlowHis(task,userType,loginUser.getId(),cdate,loginUser.getId(),ProcessConstants.TASK_TYPE_HAND,OptionType); this.saveMyTaskFlowHis(task,userType,loginUser.getId(),cdate,loginUser.getId(),ProcessConstants.TASK_TYPE_HAND,OptionType,targetUserId,ProcessConstants.OPTION_TYPE_READ);
} }
...@@ -2841,7 +2757,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask ...@@ -2841,7 +2757,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
@Override @Override
public void saveMyTaskFlow(String thistaskId,Task nextTask,String userType,String approvalId,String messageTaskName){ public void saveMyTaskFlow(String thistaskId,Task nextTask,String userType,String approvalId,String messageTaskName,String copyUser){
//此方法为写入待办 //此方法为写入待办
// 根据流程定义ID查询流程定义对象 // 根据流程定义ID查询流程定义对象
...@@ -2938,6 +2854,33 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask ...@@ -2938,6 +2854,33 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
myTaskFlowService.save(taskFlow); myTaskFlowService.save(taskFlow);
//写抄送信息
if(copyUser!=null&&!copyUser.equals("")){
MyTaskFlowCc myTaskFlowCc=new MyTaskFlowCc();
myTaskFlowCc.setCcid(copyUser);
myTaskFlowCc.setTaskId(nextTask.getId());
myTaskFlowCc.setProcDefId(nextTask.getProcessDefinitionId());
myTaskFlowCc.setProcInsId(nextTask.getProcessInstanceId());
myTaskFlowCc.setExecutionId(nextTask.getExecutionId());
if(zdval!=null&&!zdval.equals("")){
myTaskFlowCc.setTargetId(zdval);
}
myTaskFlowCc.setDeployId(deploymentId);
myTaskFlowCc.setFormTableName(sysForm.getFormTableName());
if(userType.equals("user")) {
myTaskFlowCc.setUid(approvalId);
} else {
myTaskFlowCc.setRoleid(approvalId);
}
myTaskFlowCc.setTaskDefinitionKey(nextTask.getTaskDefinitionKey());
myTaskFlowCcService.save(myTaskFlowCc);
}
String tabname= sysForm.getFormTableName(); String tabname= sysForm.getFormTableName();
if(tabname!=null&&!tabname.equals("")&&zdmc!=null&&!zdmc.equals("")&&zdval!=null&&!zdval.equals("")){ if(tabname!=null&&!tabname.equals("")&&zdmc!=null&&!zdmc.equals("")&&zdval!=null&&!zdval.equals("")){
...@@ -2957,7 +2900,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask ...@@ -2957,7 +2900,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
} }
@Override @Override
public void saveMyTaskFlowHis(Task task,String userType,String approvalId,Date cdate,String loginUserid,String taskType,String OptionType){ public void saveMyTaskFlowHis(Task task,String userType,String approvalId,Date cdate,String loginUserid,String taskType,String OptionType,String copyUser,String copyType){
//此方法为写入履历 //此方法为写入履历
// 根据流程定义ID查询流程定义对象 // 根据流程定义ID查询流程定义对象
...@@ -3031,6 +2974,44 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask ...@@ -3031,6 +2974,44 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
myTaskFlowHisService.save(taskFlowHis); myTaskFlowHisService.save(taskFlowHis);
//写抄送信息
if(copyUser!=null&&!copyUser.equals("")){
MyTaskFlowCc myTaskFlowCc=new MyTaskFlowCc();
myTaskFlowCc.setCcid(copyUser);
myTaskFlowCc.setTaskId(task.getId());
myTaskFlowCc.setProcDefId(task.getProcessDefinitionId());
myTaskFlowCc.setProcInsId(task.getProcessInstanceId());
myTaskFlowCc.setExecutionId(task.getExecutionId());
if(zdval!=null&&!zdval.equals("")){
myTaskFlowCc.setTargetId(zdval);
}
myTaskFlowCc.setDeployId(DeployId);
if(tsysForm!=null&&tsysForm.getFormTableName()!=null){
myTaskFlowCc.setFormTableName(tsysForm.getFormTableName());
}
if(userType.equals("user")) {
myTaskFlowCc.setUid(approvalId);
} else {
myTaskFlowCc.setRoleid(approvalId);
}
myTaskFlowCc.setTaskDefinitionKey(task.getTaskDefinitionKey());
myTaskFlowCc.setTaskDefinitionName(task.getName());
myTaskFlowCc.setUidType(copyType);
myTaskFlowCc.setTaskTitle(tasktitle);
myTaskFlowCc.setFlowName(flowname);
myTaskFlowCc.setCcTime(cdate);
myTaskFlowCcService.save(myTaskFlowCc);
}
} }
......
package org.jeecg.modules.stm.my.controller;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.query.QueryRuleEnum;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.stm.my.entity.MyTaskFlowCc;
import org.jeecg.modules.stm.my.service.IMyTaskFlowCcService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: my_task_flow_cc
* @Author: jeecg-boot
* @Date: 2026-04-21
* @Version: V1.0
*/
@Tag(name="my_task_flow_cc")
@RestController
@RequestMapping("/my/myTaskFlowCc")
@Slf4j
public class MyTaskFlowCcController extends JeecgController<MyTaskFlowCc, IMyTaskFlowCcService> {
@Autowired
private IMyTaskFlowCcService myTaskFlowCcService;
/**
* 分页列表查询
*
* @param myTaskFlowCc
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "my_task_flow_cc-分页列表查询")
@Operation(summary="my_task_flow_cc-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<MyTaskFlowCc>> queryPageList(MyTaskFlowCc myTaskFlowCc,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<MyTaskFlowCc> queryWrapper = QueryGenerator.initQueryWrapper(myTaskFlowCc, req.getParameterMap());
Page<MyTaskFlowCc> page = new Page<MyTaskFlowCc>(pageNo, pageSize);
IPage<MyTaskFlowCc> pageList = myTaskFlowCcService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param myTaskFlowCc
* @return
*/
@AutoLog(value = "my_task_flow_cc-添加")
@Operation(summary="my_task_flow_cc-添加")
@RequiresPermissions("my:my_task_flow_cc:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody MyTaskFlowCc myTaskFlowCc) {
myTaskFlowCcService.save(myTaskFlowCc);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param myTaskFlowCc
* @return
*/
@AutoLog(value = "my_task_flow_cc-编辑")
@Operation(summary="my_task_flow_cc-编辑")
@RequiresPermissions("my:my_task_flow_cc:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody MyTaskFlowCc myTaskFlowCc) {
myTaskFlowCcService.updateById(myTaskFlowCc);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "my_task_flow_cc-通过id删除")
@Operation(summary="my_task_flow_cc-通过id删除")
@RequiresPermissions("my:my_task_flow_cc:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
myTaskFlowCcService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "my_task_flow_cc-批量删除")
@Operation(summary="my_task_flow_cc-批量删除")
@RequiresPermissions("my:my_task_flow_cc:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.myTaskFlowCcService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "my_task_flow_cc-通过id查询")
@Operation(summary="my_task_flow_cc-通过id查询")
@GetMapping(value = "/queryById")
public Result<MyTaskFlowCc> queryById(@RequestParam(name="id",required=true) String id) {
MyTaskFlowCc myTaskFlowCc = myTaskFlowCcService.getById(id);
if(myTaskFlowCc==null) {
return Result.error("未找到对应数据");
}
return Result.OK(myTaskFlowCc);
}
/**
* 导出excel
*
* @param request
* @param myTaskFlowCc
*/
@RequiresPermissions("my:my_task_flow_cc:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, MyTaskFlowCc myTaskFlowCc) {
return super.exportXls(request, myTaskFlowCc, MyTaskFlowCc.class, "my_task_flow_cc");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("my:my_task_flow_cc:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, MyTaskFlowCc.class);
}
}
package org.jeecg.modules.stm.my.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: my_task_flow_cc
* @Author: jeecg-boot
* @Date: 2026-04-21
* @Version: V1.0
*/
@Data
@TableName("my_task_flow_cc")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description="my_task_flow_cc")
public class MyTaskFlowCc implements Serializable {
private static final long serialVersionUID = 1L;
/**id*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "id")
private java.lang.Integer id;
/**表单的表名ID*/
@Excel(name = "表单的表名ID", width = 15)
@Schema(description = "表单的表名ID")
private java.lang.String formTableName;
/**业务主表ID*/
@Excel(name = "业务主表ID", width = 15)
@Schema(description = "业务主表ID")
private java.lang.String targetId;
/**部署ID*/
@Excel(name = "部署ID", width = 15)
@Schema(description = "部署ID")
private java.lang.String deployId;
/**任务ID*/
@Excel(name = "任务ID", width = 15)
@Schema(description = "任务ID")
private java.lang.String taskId;
/**实例ID*/
@Excel(name = "实例ID", width = 15)
@Schema(description = "实例ID")
private java.lang.String procInsId;
/**执行ID*/
@Excel(name = "执行ID", width = 15)
@Schema(description = "执行ID")
private java.lang.String executionId;
/**流程定义ID*/
@Excel(name = "流程定义ID", width = 15)
@Schema(description = "流程定义ID")
private java.lang.String procDefId;
/**待办人*/
@Excel(name = "待办人", width = 15)
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id")
@Schema(description = "待办人")
private java.lang.String uid;
/**代办角色*/
@Excel(name = "代办角色", width = 15)
@Schema(description = "代办角色")
private java.lang.String roleid;
/**抄送人*/
@Excel(name = "抄送人", width = 15)
@Schema(description = "抄送人")
private java.lang.String ccid;
/**抄送角色*/
@Excel(name = "抄送角色", width = 15)
@Schema(description = "抄送角色")
private java.lang.String ccroleid;
/**节点ID*/
@Excel(name = "节点ID", width = 15)
@Schema(description = "节点ID")
private java.lang.String taskDefinitionKey;
/**节点名称*/
@Excel(name = "节点名称", width = 15)
@Schema(description = "节点名称")
private java.lang.String taskDefinitionName;
/**待办类型:2 抄送 3 转阅*/
@Excel(name = "待办类型:2 抄送 3 转阅", width = 15)
@Schema(description = "待办类型:2 抄送 3 转阅")
private java.lang.String uidType;
/**状态 0 未看 1 已看*/
@Excel(name = "状态 0 未看 1 已看", width = 15)
@Schema(description = "状态 0 未看 1 已看")
private java.lang.String status;
/**抄送操作时间*/
@Excel(name = "抄送操作时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "抄送操作时间")
private java.util.Date ccTime;
/**浏览操作时间*/
@Excel(name = "浏览操作时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "浏览操作时间")
private java.util.Date readTime;
/**标题*/
@Excel(name = "标题", width = 15)
@Schema(description = "标题")
private java.lang.String taskTitle;
/**流程名称*/
@Excel(name = "流程名称", width = 15)
@Schema(description = "流程名称")
private java.lang.String flowName;
}
package org.jeecg.modules.stm.my.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.stm.my.entity.MyTaskFlowCc;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: my_task_flow_cc
* @Author: jeecg-boot
* @Date: 2026-04-21
* @Version: V1.0
*/
public interface MyTaskFlowCcMapper extends BaseMapper<MyTaskFlowCc> {
}
package org.jeecg.modules.stm.my.service;
import org.jeecg.modules.stm.my.entity.MyTaskFlowCc;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: my_task_flow_cc
* @Author: jeecg-boot
* @Date: 2026-04-21
* @Version: V1.0
*/
public interface IMyTaskFlowCcService extends IService<MyTaskFlowCc> {
}
package org.jeecg.modules.stm.my.service.impl;
import org.jeecg.modules.stm.my.entity.MyTaskFlowCc;
import org.jeecg.modules.stm.my.mapper.MyTaskFlowCcMapper;
import org.jeecg.modules.stm.my.service.IMyTaskFlowCcService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: my_task_flow_cc
* @Author: jeecg-boot
* @Date: 2026-04-21
* @Version: V1.0
*/
@Service
public class MyTaskFlowCcServiceImpl extends ServiceImpl<MyTaskFlowCcMapper, MyTaskFlowCc> implements IMyTaskFlowCcService {
}
...@@ -178,6 +178,9 @@ public class StPlanMan implements Serializable { ...@@ -178,6 +178,9 @@ public class StPlanMan implements Serializable {
@Excel(name = "执行附件", width = 15) @Excel(name = "执行附件", width = 15)
private java.lang.String attachments; private java.lang.String attachments;
/**当前节点*/
private java.lang.String flowtaskName;
......
<?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="org.jeecg.modules.stm.my.mapper.MyTaskFlowCcMapper">
</mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论