feat 初步融合工作流

This commit is contained in:
ganzizi 2023-04-12 18:22:25 +08:00
parent 9163cee90e
commit 76e8870738
2 changed files with 56 additions and 197 deletions

View File

@ -47,7 +47,7 @@ class WorkflowController extends AbstractController
} }
/** /**
* @api {post} api/workflow/procdef/all 01. 查询流程定义 * @api {post} api/workflow/procdef/all 02. 查询流程定义
* *
* @apiDescription 需要token身份 * @apiDescription 需要token身份
* @apiVersion 1.0.0 * @apiVersion 1.0.0
@ -62,7 +62,6 @@ class WorkflowController extends AbstractController
*/ */
public function procdef__all() public function procdef__all()
{ {
//{"name": "请假"}
$data['name'] = Request::input('name'); $data['name'] = Request::input('name');
$procdef = Ihttp::ihttp_post($this->flow_url.'/api/v1/workflow/procdef/findAll', json_encode($data)); $procdef = Ihttp::ihttp_post($this->flow_url.'/api/v1/workflow/procdef/findAll', json_encode($data));
$procdef = json_decode($procdef['data'] ?? '', true); $procdef = json_decode($procdef['data'] ?? '', true);
@ -73,7 +72,7 @@ class WorkflowController extends AbstractController
} }
/** /**
* @api {get} api/workflow/procdef/del 02. 删除流程定义 * @api {get} api/workflow/procdef/del 03. 删除流程定义
* *
* @apiDescription 需要token身份 * @apiDescription 需要token身份
* @apiVersion 1.0.0 * @apiVersion 1.0.0
@ -98,7 +97,7 @@ class WorkflowController extends AbstractController
} }
/** /**
* @api {post} api/workflow/process/start 03. 启动流程 * @api {post} api/workflow/process/start 04. 启动流程
* *
* @apiDescription 需要token身份 * @apiDescription 需要token身份
* @apiVersion 1.0.0 * @apiVersion 1.0.0
@ -116,7 +115,6 @@ class WorkflowController extends AbstractController
*/ */
public function process__start() public function process__start()
{ {
//{"procName":"请假222","userID":"2", "departmentId":1, "var":{"type":"事假","startTime":"12", "endTime":"1", "description":"请假描述"}}
$data['userid'] = Request::input('userid'); $data['userid'] = Request::input('userid');
$data['department_id'] = intval(Request::input('department_id')); $data['department_id'] = intval(Request::input('department_id'));
$data['proc_name'] = Request::input('proc_name'); $data['proc_name'] = Request::input('proc_name');
@ -162,7 +160,7 @@ class WorkflowController extends AbstractController
} }
/** /**
* @api {post} api/workflow/task/complete 04. 审批 * @api {post} api/workflow/task/complete 05. 审批
* *
* @apiDescription 需要token身份 * @apiDescription 需要token身份
* @apiVersion 1.0.0 * @apiVersion 1.0.0
@ -180,14 +178,11 @@ class WorkflowController extends AbstractController
*/ */
public function task__complete() public function task__complete()
{ {
//{"taskID":51,"pass":"true","userID":"2","comment": "评论备注51"}
$data['task_id'] = intval(Request::input('task_id')); $data['task_id'] = intval(Request::input('task_id'));
$data['pass'] = Request::input('pass'); $data['pass'] = Request::input('pass');
$data['userid'] = Request::input('userid'); $data['userid'] = Request::input('userid');
$data['comment'] = Request::input('comment'); $data['comment'] = Request::input('comment');
info(Base::arrayKeyToCamel($data));
$task = Ihttp::ihttp_post($this->flow_url.'/api/v1/workflow/task/complete', json_encode(Base::arrayKeyToCamel($data))); $task = Ihttp::ihttp_post($this->flow_url.'/api/v1/workflow/task/complete', json_encode(Base::arrayKeyToCamel($data)));
info($task);
$task = json_decode($task['data'] ?? '', true); $task = json_decode($task['data'] ?? '', true);
if (!$task || $task['status'] != 200) { if (!$task || $task['status'] != 200) {
return Base::retError($task['message'] ?? '审批失败'); return Base::retError($task['message'] ?? '审批失败');
@ -196,20 +191,17 @@ class WorkflowController extends AbstractController
$task = Base::arrayKeyToUnderline($task['data']); $task = Base::arrayKeyToUnderline($task['data']);
$pass = $data['pass'] == 'true' ? 'pass' : 'refuse'; $pass = $data['pass'] == 'true' ? 'pass' : 'refuse';
$process = $this->getProcessById($task['proc_inst_id']); $process = $this->getProcessById($task['proc_inst_id']);
info($process);
$botUser = User::botGetOrCreate('approval-alert'); $botUser = User::botGetOrCreate('approval-alert');
if (empty($botUser)) { if (empty($botUser)) {
return Base::retError('审批机器人不存在'); return Base::retError('审批机器人不存在');
} }
// 在流程信息关联的用户中查找 // 在流程信息关联的用户中查找
$toUser = WorkflowProcMsg::where('proc_inst_id', $process['id'])->get()->toArray(); $toUser = WorkflowProcMsg::where('proc_inst_id', $process['id'])->get()->toArray();
info($toUser);
foreach ($toUser as $val) { foreach ($toUser as $val) {
$dialog = WebSocketDialog::checkUserDialog($botUser, $val['userid']); $dialog = WebSocketDialog::checkUserDialog($botUser, $val['userid']);
if (empty($dialog)) { if (empty($dialog)) {
continue; continue;
} }
info('11111111');
$this->workflowMsg('workflow_reviewer', $dialog, $botUser, $val, $process, $pass); $this->workflowMsg('workflow_reviewer', $dialog, $botUser, $val, $process, $pass);
} }
// 发起人 // 发起人
@ -229,7 +221,7 @@ class WorkflowController extends AbstractController
} }
/** /**
* @api {post} api/workflow/task/withdraw 05. 撤回 * @api {post} api/workflow/task/withdraw 06. 撤回
* *
* @apiDescription 需要token身份 * @apiDescription 需要token身份
* @apiVersion 1.0.0 * @apiVersion 1.0.0
@ -246,13 +238,10 @@ class WorkflowController extends AbstractController
*/ */
public function task__withdraw() public function task__withdraw()
{ {
//{"taskID":2,"userID":"2","procInstID":1}
$data['task_id'] = intval(Request::input('task_id')); $data['task_id'] = intval(Request::input('task_id'));
$data['userid'] = Request::input('userid'); $data['userid'] = Request::input('userid');
$data['proc_inst_id'] = intval(Request::input('proc_inst_id')); $data['proc_inst_id'] = intval(Request::input('proc_inst_id'));
info(Base::arrayKeyToCamel($data));
$task = Ihttp::ihttp_post($this->flow_url.'/api/v1/workflow/task/withdraw', json_encode(Base::arrayKeyToCamel($data))); $task = Ihttp::ihttp_post($this->flow_url.'/api/v1/workflow/task/withdraw', json_encode(Base::arrayKeyToCamel($data)));
info($task);
$task = json_decode($task['data'] ?? '', true); $task = json_decode($task['data'] ?? '', true);
if (!$task || $task['status'] != 200) { if (!$task || $task['status'] != 200) {
return Base::retError($task['message'] ?? '撤回失败'); return Base::retError($task['message'] ?? '撤回失败');
@ -265,13 +254,11 @@ class WorkflowController extends AbstractController
} }
// 在流程信息关联的用户中查找 // 在流程信息关联的用户中查找
$toUser = WorkflowProcMsg::where('proc_inst_id', $process['id'])->get()->toArray(); $toUser = WorkflowProcMsg::where('proc_inst_id', $process['id'])->get()->toArray();
info($toUser);
foreach ($toUser as $val) { foreach ($toUser as $val) {
$dialog = WebSocketDialog::checkUserDialog($botUser, $val['userid']); $dialog = WebSocketDialog::checkUserDialog($botUser, $val['userid']);
if (empty($dialog)) { if (empty($dialog)) {
continue; continue;
} }
info('11111111');
//发送撤回提醒 //发送撤回提醒
$this->workflowMsg('workflow_reviewer', $dialog, $botUser, $val, $process, 'withdraw'); $this->workflowMsg('workflow_reviewer', $dialog, $botUser, $val, $process, 'withdraw');
} }
@ -279,20 +266,16 @@ class WorkflowController extends AbstractController
} }
/** /**
* @api {post} api/workflow/process/findTask 06. 查询需要我审批的流程 * @api {post} api/workflow/process/findTask 07. 查询我审批的流程
* *
* @apiDescription 需要token身份 * @apiDescription 需要token身份
* @apiVersion 1.0.0 * @apiVersion 1.0.0
* @apiGroup workflow * @apiGroup workflow
* @apiName process__findTask * @apiName process__findTask
* *
* @apiQuery {Number} userID 用户ID * @apiQuery {Number} userid 用户ID
* @apiQuery {String} groups 用户组 * @apiQuery {Number} page 页码
* @apiQuery {String} departments 部门 * @apiQuery {Number} page_size 每页条数
* @apiQuery {String} company 公司
* @apiQuery {String} procName 流程名称
* @apiQuery {Number} pageIndex 页码
* @apiQuery {Number} pageSize 每页条数
* *
* @apiSuccess {Number} ret 返回状态码1正确、0错误 * @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述) * @apiSuccess {String} msg 返回信息(错误描述)
@ -300,33 +283,26 @@ class WorkflowController extends AbstractController
*/ */
public function process__findTask() public function process__findTask()
{ {
//{"userID":"2","groups":["人事"],"departments":["技术中心"],"company":"A公司","procName": "请假","pageIndex":1,"pageSize":10} $data['userid'] = Request::input('userid');
$data['userID'] = Request::input('userID'); $data['pageIndex'] = intval(Request::input('page'));
// $data['groups'] = Request::input('groups'); $data['pageSize'] = intval(Request::input('page_size'));
// $data['departments'] = Request::input('departments'); $process = Ihttp::ihttp_post($this->flow_url.'/api/v1/workflow/process/findTask', json_encode(Base::arrayKeyToCamel($data)));
// $data['company'] = Request::input('company'); $process = json_decode($process['data'] ?? '', true);
// $data['procName'] = Request::input('procName'); if (!$process || $process['status'] != 200) {
$data['pageIndex'] = Request::input('pageIndex'); return Base::retError($process['message'] ?? '查询失败');
$data['pageSize'] = Request::input('pageSize');
info($data);
$workflow = Ihttp::ihttp_post($this->flow_url.'/api/v1/workflow/process/findTask', json_encode($data));
info($workflow);
$workflow = json_decode($workflow['data'] ?? '', true);
if (!$workflow || $workflow['status'] != 200) {
return Base::retError($workflow['message'] ?? '查询失败');
} }
return Base::retSuccess('success', Base::arrayKeyToUnderline($workflow['data'])); return Base::retSuccess('success', Base::arrayKeyToUnderline($process['data']));
} }
/** /**
* @api {post} api/workflow/identitylink/findParticipant 07. 查询流程审批人与评论 * @api {post} api/workflow/identitylink/findParticipant 08. 查询流程审批人与评论
* *
* @apiDescription 需要token身份 * @apiDescription 需要token身份
* @apiVersion 1.0.0 * @apiVersion 1.0.0
* @apiGroup workflow * @apiGroup workflow
* @apiName identitylink__findParticipant * @apiName identitylink__findParticipant
* *
* @apiQuery {Number} procInstID 流程ID * @apiQuery {Number} proc_inst_id 流程实例ID
* *
* @apiSuccess {Number} ret 返回状态码1正确、0错误 * @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述) * @apiSuccess {String} msg 返回信息(错误描述)
@ -334,97 +310,26 @@ class WorkflowController extends AbstractController
*/ */
public function identitylink__findParticipant() public function identitylink__findParticipant()
{ {
$data['procInstID'] = Request::input('procInstID'); $proc_inst_id = Request::input('proc_inst_id');
$identitylink = Ihttp::ihttp_get($this->flow_url.'/api/v1/workflow/identitylink/findParticipant?procInstId=' . $proc_inst_id);
$get = Ihttp::ihttp_get($this->flow_url.'/api/v1/workflow/identitylink/findParticipant?procInstID=' . $data['procInstID']); $identitylink = json_decode($identitylink['data'] ?? '', true);
info($get); if (!$identitylink || $identitylink['status'] != 200) {
$workflow = json_decode($get['data'] ?? '', true); return Base::retError($identitylink['message'] ?? 'fail');
if (!$workflow || $get['msg'] != 200) {
return Base::retError($workflow['message'] ?? 'fail');
} }
return Base::retSuccess('success', Base::arrayKeyToUnderline($workflow)); return Base::retSuccess('success', Base::arrayKeyToUnderline($identitylink['data']));
} }
/** /**
* @api {post} api/workflow/procHistory/findTask 08. 查询我审批的流程(已结束) * @api {post} api/workflow/process/startByMyself 09. 查询我发起的流程
*
* @apiDescription 需要token身份
* @apiVersion 1.0.0
* @apiGroup workflow
* @apiName procHistory__findTask
*
* @apiQuery {Number} user_id 用户ID
* @apiQuery {String} company 公司
* @apiQuery {Number} pageIndex 页码
* @apiQuery {Number} pageSize 每页条数
*
* @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
*/
public function procHistory__findTask()
{
//{"userID":"2","company":"A公司","pageIndex":1,"pageSize":2}
$data['userID'] = Request::input('userID');
$data['company'] = Request::input('company');
$data['pageIndex'] = Request::input('pageIndex');
$data['pageSize'] = Request::input('pageSize');
$workflow = Ihttp::ihttp_post($this->flow_url.'/api/v1/workflow/procHistory/findTask', json_encode($data));
info($workflow);
$workflow = json_decode($workflow['data'] ?? '', true);
if (!$workflow || $workflow['status'] != 200) {
return Base::retError($workflow['message'] ?? 'fail');
}
return Base::retSuccess('success', Base::arrayKeyToUnderline($workflow['data']));
}
/**
* @api {post} api/workflow/procHistory/startByMyself 09. 查询我发起的流程(已结束)
*
* @apiDescription 需要token身份
* @apiVersion 1.0.0
* @apiGroup workflow
* @apiName procHistory__startByMyself
*
* @apiQuery {Number} user_id 用户ID
* @apiQuery {String} company 公司
* @apiQuery {Number} pageIndex 页码
* @apiQuery {Number} pageSize 每页条数
*
* @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
*/
public function procHistory__startByMyself()
{
//{"userID":"2","company":"A公司","pageIndex":1,"pageSize":1}
$data['userID'] = Request::input('userID');
$data['company'] = Request::input('company');
$data['pageIndex'] = Request::input('pageIndex');
$data['pageSize'] = Request::input('pageSize');
$workflow = Ihttp::ihttp_post($this->flow_url.'/api/v1/workflow/procHistory/startByMyself', json_encode($data));
info($workflow);
$workflow = json_decode($workflow['data'] ?? '', true);
if (!$workflow || $workflow['status'] != 200) {
return Base::retError($workflow['message'] ?? 'fail');
}
return Base::retSuccess('success', Base::arrayKeyToUnderline($workflow['data']));
}
/**
* @api {post} api/workflow/process/startByMyself 10. 查询我发起的流程(审批中)
* *
* @apiDescription 需要token身份 * @apiDescription 需要token身份
* @apiVersion 1.0.0 * @apiVersion 1.0.0
* @apiGroup workflow * @apiGroup workflow
* @apiName process__startByMyself * @apiName process__startByMyself
* *
* @apiQuery {Number} user_id 用户ID * @apiQuery {Number} userid 用户ID
* @apiQuery {String} company 公司 * @apiQuery {Number} page 页码
* @apiQuery {Number} pageIndex 页码 * @apiQuery {Number} page_size 每页条数
* @apiQuery {Number} pageSize 每页条数
* *
* @apiSuccess {Number} ret 返回状态码1正确、0错误 * @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述) * @apiSuccess {String} msg 返回信息(错误描述)
@ -432,32 +337,29 @@ class WorkflowController extends AbstractController
*/ */
public function process__startByMyself() public function process__startByMyself()
{ {
//{"userID":"2","company":"A公司","pageIndex":1,"pageSize":1} $data['userid'] = Request::input('userid');
$data['userID'] = Request::input('userID'); $data['pageIndex'] = intval(Request::input('page'));
$data['company'] = Request::input('company'); $data['pageSize'] = intval(Request::input('page_size'));
$data['pageIndex'] = Request::input('pageIndex'); $process = Ihttp::ihttp_post($this->flow_url.'/api/v1/workflow/process/startByMyself', json_encode($data));
$data['pageSize'] = Request::input('pageSize'); info($process);
$process = json_decode($process['data'] ?? '', true);
$workflow = Ihttp::ihttp_post($this->flow_url.'/api/v1/workflow/process/startByMyself', json_encode($data)); if (!$process || $process['status'] != 200) {
info($workflow); return Base::retError($process['message'] ?? 'fail');
$workflow = json_decode($workflow['data'] ?? '', true);
if (!$workflow || $workflow['status'] != 200) {
return Base::retError($workflow['message'] ?? 'fail');
} }
return Base::retSuccess('success', Base::arrayKeyToUnderline($workflow['data'])); return Base::retSuccess('success', Base::arrayKeyToUnderline($process['data']));
} }
/** /**
* @api {post} api/workflow/process/FindProcNotify 11. 查询抄送我的流程(审批中) * @api {post} api/workflow/process/FindProcNotify 10. 查询抄送我的流程
* *
* @apiDescription 需要token身份 * @apiDescription 需要token身份
* @apiVersion 1.0.0 * @apiVersion 1.0.0
* @apiGroup workflow * @apiGroup workflow
* @apiName process__FindProcNotify * @apiName process__FindProcNotify
* *
* @apiQuery {Number} user_id 用户ID * @apiQuery {Number} userid 用户ID
* @apiQuery {String} company 公司 * @apiQuery {Number} page 页码
* @apiQuery {Array} groups 抄送组 * @apiQuery {Number} page_size 每页条数
* *
* @apiSuccess {Number} ret 返回状态码1正确、0错误 * @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述) * @apiSuccess {String} msg 返回信息(错误描述)
@ -465,59 +367,26 @@ class WorkflowController extends AbstractController
*/ */
public function process__FindProcNotify() public function process__FindProcNotify()
{ {
//{"userID":"2","company":"A公司","groups":["人事","产品经理"]} $data['userid'] = Request::input('userid');
$data['userID'] = Request::input('userID'); $data['pageIndex'] = intval(Request::input('page'));
$data['company'] = Request::input('company'); $data['pageSize'] = intval(Request::input('page_size'));
$data['groups'] = Request::input('groups');
$workflow = Ihttp::ihttp_post($this->flow_url.'/api/v1/workflow/process/FindProcNotify', json_encode($data)); $process = Ihttp::ihttp_post($this->flow_url.'/api/v1/workflow/process/findProcNotify', json_encode($data));
info($workflow); info($process);
$workflow = json_decode($workflow['data'] ?? '', true); $process = json_decode($process['data'] ?? '', true);
if (!$workflow || $workflow['status'] != 200) { if (!$process || $process['status'] != 200) {
return Base::retError($workflow['message'] ?? 'fail'); return Base::retError($process['message'] ?? 'fail');
} }
return Base::retSuccess('success', Base::arrayKeyToUnderline($workflow['data'])); return Base::retSuccess('success', Base::arrayKeyToUnderline($process['data']));
} }
/** /**
* @api {post} api/workflow/procHistory/FindProcNotify 12. 查询抄送我的流程(已结束) * @api {get} api/workflow/process/detail 11. 根据流程ID查询流程详情
* *
* @apiDescription 需要token身份 * @apiDescription 需要token身份
* @apiVersion 1.0.0 * @apiVersion 1.0.0
* @apiGroup workflow * @apiGroup workflow
* @apiName procHistory__FindProcNotify * @apiName process__detail
*
* @apiQuery {Number} user_id 用户ID
* @apiQuery {String} company 公司
* @apiQuery {Array} groups 抄送组
*
* @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
*/
public function procHistory__FindProcNotify()
{
//{"userID":"2","company":"A公司","groups":["人事","产品经理"]}
$data['userID'] = Request::input('userID');
$data['company'] = Request::input('company');
$data['groups'] = Request::input('groups');
$workflow = Ihttp::ihttp_post($this->flow_url.'/api/v1/workflow/procHistory/FindProcNotify', json_encode($data));
info($workflow);
$workflow = json_decode($workflow['data'] ?? '', true);
if (!$workflow || $workflow['status'] != 200) {
return Base::retError($workflow['message'] ?? 'fail');
}
return Base::retSuccess('success', Base::arrayKeyToUnderline($workflow['data']));
}
/**
* @api {get} api/workflow/process/findById 13. 根据流程ID查询流程所有
*
* @apiDescription 需要token身份
* @apiVersion 1.0.0
* @apiGroup workflow
* @apiName process__findById
* *
* @apiQuery {Number} id 流程ID * @apiQuery {Number} id 流程ID
* *
@ -525,7 +394,7 @@ class WorkflowController extends AbstractController
* @apiSuccess {String} msg 返回信息(错误描述) * @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据 * @apiSuccess {Object} data 返回数据
*/ */
public function process__findById() public function process__detail()
{ {
//{"id":"2"} //{"id":"2"}
$data['id'] = intval(Request::input('id')); $data['id'] = intval(Request::input('id'));
@ -544,34 +413,25 @@ class WorkflowController extends AbstractController
'start_time' => $process['var']['start_time'], 'start_time' => $process['var']['start_time'],
'end_time' => $process['var']['end_time'], 'end_time' => $process['var']['end_time'],
]; ];
info($action);
$text = view('push.bot', ['type' => $type, 'action' => $action, 'data' => (object)$data])->render(); $text = view('push.bot', ['type' => $type, 'action' => $action, 'data' => (object)$data])->render();
$text = preg_replace("/^\x20+/", "", $text); $text = preg_replace("/^\x20+/", "", $text);
$text = preg_replace("/\n\x20+/", "\n", $text); $text = preg_replace("/\n\x20+/", "\n", $text);
$msg_action = null; $msg_action = null;
if ($action == 'withdraw' || $action == 'pass' || $action == 'refuse') { if ($action == 'withdraw' || $action == 'pass' || $action == 'refuse') {
info(222222222222);
// 如果任务没有完成,则不需要更新消息 // 如果任务没有完成,则不需要更新消息
info($process['is_finished'] == true);
if ($process['is_finished'] != true) { if ($process['is_finished'] != true) {
return true; return true;
} }
info('===========22222222========');
// 任务完成,给发起人发送消息 // 任务完成,给发起人发送消息
if($type == 'workflow_submitter' && $action != 'withdraw'){ if($type == 'workflow_submitter' && $action != 'withdraw'){
info('==================任务完成,给发起人发送消息========');
return WebSocketDialogMsg::sendMsg($msg_action, $dialog->id, 'text', ['text' => $text], $botUser->userid, false, false, true); return WebSocketDialogMsg::sendMsg($msg_action, $dialog->id, 'text', ['text' => $text], $botUser->userid, false, false, true);
} }
// 查找最后一条消息msg_id // 查找最后一条消息msg_id
$msg_action = 'update-'.$toUser['msg_id']; $msg_action = 'update-'.$toUser['msg_id'];
info($msg_action);
} }
info(33333333333333);
$msg = WebSocketDialogMsg::sendMsg($msg_action, $dialog->id, 'text', ['text' => $text], $botUser->userid, false, false, true); $msg = WebSocketDialogMsg::sendMsg($msg_action, $dialog->id, 'text', ['text' => $text], $botUser->userid, false, false, true);
// 保存关联信息 // 关联信息
if ($action == 'start') { if ($action == 'start') {
info(666666666666);
// 创建关联信息
$proc_msg = new WorkflowProcMsg(); $proc_msg = new WorkflowProcMsg();
$proc_msg->proc_inst_id = $process['id']; $proc_msg->proc_inst_id = $process['id'];
$proc_msg->msg_id = $msg['data']->id; $proc_msg->msg_id = $msg['data']->id;
@ -601,7 +461,6 @@ class WorkflowController extends AbstractController
//判断下一步是否有抄送人 //判断下一步是否有抄送人
$step = $step + 1; $step = $step + 1;
$next_node = $process_node[$step] ?? []; $next_node = $process_node[$step] ?? [];
info($next_node);
if ($next_node) { if ($next_node) {
if ($next_node['type'] == 'notifier'){ if ($next_node['type'] == 'notifier'){
return $next_node['node_user_list'] ?? []; return $next_node['node_user_list'] ?? [];

View File

@ -48,7 +48,7 @@ Route::prefix('api')->middleware(['webapi'])->group(function () {
// 公开接口 // 公开接口
Route::any('public/{method}', PublicController::class); Route::any('public/{method}', PublicController::class);
Route::any('public/{method}/{action}', PublicController::class); Route::any('public/{method}/{action}', PublicController::class);
// 审批 // 工作流
Route::any('workflow/{method}', WorkflowController::class); Route::any('workflow/{method}', WorkflowController::class);
Route::any('workflow/{method}/{action}', WorkflowController::class); Route::any('workflow/{method}/{action}', WorkflowController::class);
}); });