From 6f4a94c8d1c0d3ec4396ba079e86d0465a782dc5 Mon Sep 17 00:00:00 2001 From: ganzizi Date: Tue, 23 May 2023 19:07:37 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E6=96=B0=E5=A2=9E=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E8=AF=84=E8=AE=BAinit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Api/WorkflowController.php | 35 +++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Api/WorkflowController.php b/app/Http/Controllers/Api/WorkflowController.php index f1e861545..c2514be48 100755 --- a/app/Http/Controllers/Api/WorkflowController.php +++ b/app/Http/Controllers/Api/WorkflowController.php @@ -80,7 +80,7 @@ class WorkflowController extends AbstractController } /** - * @api {get} api/workflow/procdef/del 04. 删除流程定义 + * @api {get} api/workflow/procdef/del 03. 删除流程定义 * * @apiDescription 需要token身份 * @apiVersion 1.0.0 @@ -106,7 +106,7 @@ class WorkflowController extends AbstractController } /** - * @api {post} api/workflow/process/start 05. 启动流程(审批中) + * @api {post} api/workflow/process/start 04. 启动流程(审批中) * * @apiDescription 需要token身份 * @apiVersion 1.0.0 @@ -168,6 +168,35 @@ class WorkflowController extends AbstractController return Base::retSuccess('创建成功', $process); } + /** + * @api {post} api/workflow/process/addGlobalComment 05. 添加全局评论 + * + * @apiDescription 需要token身份 + * @apiVersion 1.0.0 + * @apiGroup workflow + * @apiName process__addGlobalComment + * @apiSuccess {Number} ret 返回状态码(1正确、0错误) + * @apiSuccess {String} msg 返回信息(错误描述) + * @apiSuccess {Object} data 返回数据 + */ + public function process__addGlobalComment() + { + $user = User::auth(); + $data['proc_inst_id'] = intval(Request::input('proc_inst_id')); + $data['userid'] = (string)$user->userid; + $data['content'] = Request::input('content'); + $data['images'] = Request::input('images'); + + $ret = Ihttp::ihttp_post($this->flow_url.'/api/v1/workflow/process/addGlobalComment', json_encode(Base::arrayKeyToCamel($data))); + $process = json_decode($ret['ret'] == 1 ? $ret['data'] : '{}', true); + if (!$process || $process['status'] != 200) { + return Base::retError($process['message'] ?? '添加失败'); + } + // + $res = Base::arrayKeyToUnderline($process['data']); + return Base::retSuccess('success', $res); + } + /** * @api {post} api/workflow/task/complete 06. 审批 * @@ -938,7 +967,7 @@ class WorkflowController extends AbstractController // 查找最后一条消息msg_id $msg_action = 'update-'.$toUser['msg_id']; } - // + // try { $msg = WebSocketDialogMsg::sendMsg($msg_action, $dialog->id, 'text', ['text' => $text], $botUser->userid, false, false, true); // 关联信息