Merge branch 'pro' into okr
# Conflicts: # resources/assets/js/pages/manage/application.vue # resources/assets/js/pages/manage/dashboard.vue
This commit is contained in:
@@ -19,6 +19,7 @@ use App\Models\UserDepartment;
|
||||
use App\Models\WebSocketDialogMsg;
|
||||
use App\Module\BillMultipleExport;
|
||||
use Hhxsv5\LaravelS\Swoole\Task\Task;
|
||||
|
||||
/**
|
||||
* @apiDefine approve
|
||||
*
|
||||
@@ -403,7 +404,7 @@ class ApproveController extends AbstractController
|
||||
{
|
||||
$user = User::auth();
|
||||
$data['userid'] = (string)$user->userid;
|
||||
$data['username'] = Request::input('username');
|
||||
$data['username'] = Request::input('username');
|
||||
$data['procName'] = Request::input('proc_def_name'); //分类
|
||||
$data['state'] = intval(Request::input('state')); //状态
|
||||
$data['pageIndex'] = intval(Request::input('page'));
|
||||
@@ -1110,20 +1111,22 @@ class ApproveController extends AbstractController
|
||||
* @apiGroup system
|
||||
* @apiName user__status
|
||||
*
|
||||
* @apiParam {String} userid
|
||||
* @apiParam {String} userid
|
||||
*
|
||||
* @apiSuccess {String}
|
||||
* @apiSuccess {Number} ret 返回状态码(1正确、0错误)
|
||||
* @apiSuccess {String} msg 返回信息(错误描述)
|
||||
* @apiSuccess {Object} data 返回数据
|
||||
*/
|
||||
public function user__status()
|
||||
{
|
||||
$data['userid'] = intval(Request::input('userid'));
|
||||
$ret = Ihttp::ihttp_get($this->flow_url.'/api/v1/workflow/process/getUserApprovalStatus?'.http_build_query($data));
|
||||
$procdef = json_decode($ret['ret'] == 1 ? $ret['data'] : '{}', true);
|
||||
$ret = Ihttp::ihttp_get($this->flow_url.'/api/v1/workflow/process/getUserApprovalStatus?'.http_build_query($data));
|
||||
$procdef = json_decode($ret['ret'] == 1 ? $ret['data'] : '{}', true);
|
||||
if (isset($procdef['status']) && $procdef['status'] == 200) {
|
||||
return Base::retSuccess('success', isset($procdef['data']["proc_def_name"]) ? $procdef['data']["proc_def_name"] : '');
|
||||
}
|
||||
}
|
||||
return Base::retSuccess('success', '');
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -622,7 +622,7 @@ class DialogController extends AbstractController
|
||||
'unread' => $dialogUser->webSocketDialog->unread,
|
||||
'mention' => $dialogUser->webSocketDialog->mention,
|
||||
'user_at' => Carbon::parse($dialogUser->updated_at)->toDateTimeString('millisecond'),
|
||||
'user_ms' => Carbon::parse($dialogUser->updated_at)->valueOf(),
|
||||
'user_ms' => Carbon::parse($dialogUser->updated_at)->valueOf()
|
||||
];
|
||||
}
|
||||
return Base::retSuccess('success', $data);
|
||||
@@ -899,7 +899,7 @@ class DialogController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {post} api/dialog/msg/sendfiles 19. 群发文件上传
|
||||
* @api {post} api/dialog/msg/sendfiles 18. 群发文件上传
|
||||
*
|
||||
* @apiDescription 需要token身份
|
||||
* @apiVersion 1.0.0
|
||||
@@ -954,7 +954,7 @@ class DialogController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {get} api/dialog/msg/sendfileid 20. 通过文件ID发送文件
|
||||
* @api {get} api/dialog/msg/sendfileid 19. 通过文件ID发送文件
|
||||
*
|
||||
* @apiDescription 需要token身份
|
||||
* @apiVersion 1.0.0
|
||||
@@ -1024,7 +1024,7 @@ class DialogController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {post} api/dialog/msg/sendanon 21. 发送匿名消息
|
||||
* @api {post} api/dialog/msg/sendanon 20. 发送匿名消息
|
||||
*
|
||||
* @apiDescription 需要token身份
|
||||
* @apiVersion 1.0.0
|
||||
@@ -1077,7 +1077,7 @@ class DialogController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {get} api/dialog/msg/readlist 22. 获取消息阅读情况
|
||||
* @api {get} api/dialog/msg/readlist 21. 获取消息阅读情况
|
||||
*
|
||||
* @apiDescription 需要token身份
|
||||
* @apiVersion 1.0.0
|
||||
@@ -1106,7 +1106,7 @@ class DialogController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {get} api/dialog/msg/detail 23. 消息详情
|
||||
* @api {get} api/dialog/msg/detail 22. 消息详情
|
||||
*
|
||||
* @apiDescription 需要token身份
|
||||
* @apiVersion 1.0.0
|
||||
@@ -1154,7 +1154,7 @@ class DialogController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {get} api/dialog/msg/download 24. 文件下载
|
||||
* @api {get} api/dialog/msg/download 23. 文件下载
|
||||
*
|
||||
* @apiDescription 需要token身份
|
||||
* @apiVersion 1.0.0
|
||||
@@ -1195,7 +1195,7 @@ class DialogController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {get} api/dialog/msg/withdraw 25. 聊天消息撤回
|
||||
* @api {get} api/dialog/msg/withdraw 24. 聊天消息撤回
|
||||
*
|
||||
* @apiDescription 消息撤回限制24小时内,需要token身份
|
||||
* @apiVersion 1.0.0
|
||||
@@ -1221,7 +1221,7 @@ class DialogController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {get} api/dialog/msg/mark 26. 消息标记操作
|
||||
* @api {get} api/dialog/msg/mark 25. 消息标记操作
|
||||
*
|
||||
* @apiDescription 需要token身份
|
||||
* @apiVersion 1.0.0
|
||||
@@ -1288,7 +1288,7 @@ class DialogController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {get} api/dialog/msg/silence 27. 消息免打扰
|
||||
* @api {get} api/dialog/msg/silence 26. 消息免打扰
|
||||
*
|
||||
* @apiDescription 需要token身份
|
||||
* @apiVersion 1.0.0
|
||||
@@ -1351,7 +1351,7 @@ class DialogController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {get} api/dialog/msg/forward 28. 转发消息给
|
||||
* @api {get} api/dialog/msg/forward 27. 转发消息给
|
||||
*
|
||||
* @apiDescription 需要token身份
|
||||
* @apiVersion 1.0.0
|
||||
@@ -1392,7 +1392,7 @@ class DialogController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {get} api/dialog/msg/emoji 29. emoji回复
|
||||
* @api {get} api/dialog/msg/emoji 28. emoji回复
|
||||
*
|
||||
* @apiDescription 需要token身份
|
||||
* @apiVersion 1.0.0
|
||||
@@ -1427,7 +1427,7 @@ class DialogController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {get} api/dialog/msg/tag 30. 标注/取消标注
|
||||
* @api {get} api/dialog/msg/tag 29. 标注/取消标注
|
||||
*
|
||||
* @apiDescription 需要token身份
|
||||
* @apiVersion 1.0.0
|
||||
@@ -1456,7 +1456,7 @@ class DialogController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {get} api/dialog/msg/todo 31. 设待办/取消待办
|
||||
* @api {get} api/dialog/msg/todo 30. 设待办/取消待办
|
||||
*
|
||||
* @apiDescription 需要token身份
|
||||
* @apiVersion 1.0.0
|
||||
@@ -1499,7 +1499,7 @@ class DialogController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {get} api/dialog/msg/todolist 32. 获取消息待办情况
|
||||
* @api {get} api/dialog/msg/todolist 31. 获取消息待办情况
|
||||
*
|
||||
* @apiDescription 需要token身份
|
||||
* @apiVersion 1.0.0
|
||||
@@ -1529,7 +1529,7 @@ class DialogController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {get} api/dialog/msg/done 33. 完成待办
|
||||
* @api {get} api/dialog/msg/done 32. 完成待办
|
||||
*
|
||||
* @apiDescription 需要token身份
|
||||
* @apiVersion 1.0.0
|
||||
@@ -1576,7 +1576,7 @@ class DialogController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {get} api/dialog/msg/color 34. 设置颜色
|
||||
* @api {get} api/dialog/msg/color 33. 设置颜色
|
||||
*
|
||||
* @apiDescription 需要token身份
|
||||
* @apiVersion 1.0.0
|
||||
@@ -1617,7 +1617,7 @@ class DialogController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {get} api/dialog/group/add 35. 新增群组
|
||||
* @api {get} api/dialog/group/add 34. 新增群组
|
||||
*
|
||||
* @apiDescription 需要token身份
|
||||
* @apiVersion 1.0.0
|
||||
@@ -1679,7 +1679,7 @@ class DialogController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {get} api/dialog/group/edit 36. 修改群组
|
||||
* @api {get} api/dialog/group/edit 35. 修改群组
|
||||
*
|
||||
* @apiDescription 需要token身份
|
||||
* @apiVersion 1.0.0
|
||||
@@ -1740,7 +1740,7 @@ class DialogController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {get} api/dialog/group/adduser 37. 添加群成员
|
||||
* @api {get} api/dialog/group/adduser 36. 添加群成员
|
||||
*
|
||||
* @apiDescription 需要token身份
|
||||
* - 有群主时:只有群主可以邀请
|
||||
@@ -1776,7 +1776,7 @@ class DialogController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {get} api/dialog/group/deluser 38. 移出(退出)群成员
|
||||
* @api {get} api/dialog/group/deluser 37. 移出(退出)群成员
|
||||
*
|
||||
* @apiDescription 需要token身份
|
||||
* - 只有群主、邀请人可以踢人
|
||||
@@ -1820,7 +1820,7 @@ class DialogController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {get} api/dialog/group/transfer 39. 转让群组
|
||||
* @api {get} api/dialog/group/transfer 38. 转让群组
|
||||
*
|
||||
* @apiDescription 需要token身份
|
||||
* - 只有群主且是个人类型群可以解散
|
||||
@@ -1864,7 +1864,7 @@ class DialogController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {get} api/dialog/group/disband 40. 解散群组
|
||||
* @api {get} api/dialog/group/disband 39. 解散群组
|
||||
*
|
||||
* @apiDescription 需要token身份
|
||||
* - 只有群主且是个人类型群可以解散
|
||||
@@ -1892,7 +1892,7 @@ class DialogController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {get} api/dialog/group/searchuser 41. 搜索个人群(仅限管理员)
|
||||
* @api {get} api/dialog/group/searchuser 40. 搜索个人群(仅限管理员)
|
||||
*
|
||||
* @apiDescription 需要token身份,用于创建部门搜索个人群组
|
||||
* @apiVersion 1.0.0
|
||||
@@ -1921,7 +1921,7 @@ class DialogController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {post} api/dialog/okr/add 42. 创建OKR评论会话
|
||||
* @api {post} api/dialog/okr/add 41. 创建OKR评论会话
|
||||
*
|
||||
* @apiDescription 需要token身份
|
||||
* @apiVersion 1.0.0
|
||||
@@ -1960,7 +1960,7 @@ class DialogController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {post} api/dialog/okr/push 43. 推送OKR相关信息
|
||||
* @api {post} api/dialog/okr/push 42. 推送OKR相关信息
|
||||
*
|
||||
* @apiDescription 需要token身份
|
||||
* @apiVersion 1.0.0
|
||||
@@ -2032,16 +2032,16 @@ class DialogController extends AbstractController
|
||||
}
|
||||
//
|
||||
$userid = $user->userid;
|
||||
if($uuid){
|
||||
if ($uuid) {
|
||||
$dialogMsg = WebSocketDialogMsg::whereDialogId($dialog_id)
|
||||
->whereType('word-chain')
|
||||
->orderByDesc('created_at')
|
||||
->where('msg','like',"%$uuid%")
|
||||
->where('msg', 'like', "%$uuid%")
|
||||
->value('msg');
|
||||
$list = array_reverse(array_merge($dialogMsg['list'] ?? [], $list));
|
||||
$list = array_reduce($list, function ($result, $item) {
|
||||
$fieldValue = $item['id']; // 指定字段名
|
||||
if(!isset($result[$fieldValue])) {
|
||||
if (!isset($result[$fieldValue])) {
|
||||
$result[$fieldValue] = $item;
|
||||
}
|
||||
return $result;
|
||||
@@ -2086,7 +2086,7 @@ class DialogController extends AbstractController
|
||||
$dialog_id = intval(Request::input('dialog_id'));
|
||||
$uuid = trim(Request::input('uuid'));
|
||||
$text = trim(Request::input('text'));
|
||||
$type = trim(Request::input('type','create'));
|
||||
$type = trim(Request::input('type', 'create'));
|
||||
$multiple = intval(Request::input('multiple')) ?: 0;
|
||||
$anonymous = intval(Request::input('anonymous')) ?: 0;
|
||||
$list = Request::input('list');
|
||||
@@ -2098,8 +2098,8 @@ class DialogController extends AbstractController
|
||||
$action = null;
|
||||
$userid = $user->userid;
|
||||
$result = [];
|
||||
if($type != 'create'){
|
||||
if($type == 'vote' && empty($votes)){
|
||||
if ($type != 'create') {
|
||||
if ($type == 'vote' && empty($votes)) {
|
||||
return Base::retError('参数错误');
|
||||
}
|
||||
if (empty($uuid)) {
|
||||
@@ -2108,24 +2108,24 @@ class DialogController extends AbstractController
|
||||
$dialogMsgs = WebSocketDialogMsg::whereDialogId($dialog_id)
|
||||
->whereType('vote')
|
||||
->orderByDesc('created_at')
|
||||
->where('msg','like',"%$uuid%")
|
||||
->where('msg', 'like', "%$uuid%")
|
||||
->get();
|
||||
//
|
||||
if($type == 'again'){
|
||||
if ($type == 'again') {
|
||||
$res = WebSocketDialogMsg::sendMsg(null, $dialog_id, 'vote', $dialogMsgs[0]->msg, $user->userid);
|
||||
if(Base::isError($res)){
|
||||
if (Base::isError($res)) {
|
||||
return $res;
|
||||
}
|
||||
$result[] = $res['data'];
|
||||
}else{
|
||||
foreach($dialogMsgs as $dialogMsg){
|
||||
} else {
|
||||
foreach ($dialogMsgs as $dialogMsg) {
|
||||
$action = "change-{$dialogMsg->id}";
|
||||
$msgData = $dialogMsg->msg;
|
||||
if($type == 'finish'){
|
||||
if ($type == 'finish') {
|
||||
$msgData['state'] = 0;
|
||||
}else{
|
||||
} else {
|
||||
$msgDataVotes = $msgData['votes'] ?? [];
|
||||
if(in_array($userid,array_column($msgDataVotes,'userid'))){
|
||||
if (in_array($userid, array_column($msgDataVotes, 'userid'))) {
|
||||
return Base::retError('不能重复投票');
|
||||
}
|
||||
$msgDataVotes[] = [
|
||||
@@ -2135,13 +2135,13 @@ class DialogController extends AbstractController
|
||||
$msgData['votes'] = $msgDataVotes;
|
||||
}
|
||||
$res = WebSocketDialogMsg::sendMsg($action, $dialog_id, 'vote', $msgData, $user->userid);
|
||||
if(Base::isError($res)){
|
||||
if (Base::isError($res)) {
|
||||
return $res;
|
||||
}
|
||||
$result[] = $res['data'];
|
||||
}
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
$strlen = mb_strlen($text);
|
||||
$noimglen = mb_strlen(preg_replace("/<img[^>]*?>/i", "", $text));
|
||||
if ($strlen < 1) {
|
||||
@@ -2161,7 +2161,7 @@ class DialogController extends AbstractController
|
||||
'state' => 1
|
||||
];
|
||||
$res = WebSocketDialogMsg::sendMsg($action, $dialog_id, 'vote', $msgData, $user->userid);
|
||||
if(Base::isError($res)){
|
||||
if (Base::isError($res)) {
|
||||
return $res;
|
||||
}
|
||||
$result[] = $res['data'];
|
||||
|
||||
@@ -2181,13 +2181,13 @@ class ProjectController extends AbstractController
|
||||
//
|
||||
$projectTask = ProjectTask::select(['id', 'project_id', 'complete_at', 'flow_item_id', 'flow_item_name'])->withTrashed()->find($task_id);
|
||||
if (empty($projectTask)) {
|
||||
return Base::retError('任务不存在', [ 'task_id' => $task_id ], -4002);
|
||||
return Base::retError('任务不存在', ['task_id' => $task_id], -4002);
|
||||
}
|
||||
//
|
||||
$projectFlowItem = null;
|
||||
if($project_id){
|
||||
if ($project_id) {
|
||||
$projectFlow = ProjectFlow::whereProjectId($project_id)->orderByDesc('id')->first();
|
||||
}else{
|
||||
} else {
|
||||
$projectFlowItem = $projectTask->flow_item_id ? ProjectFlowItem::with(['projectFlow'])->find($projectTask->flow_item_id) : null;
|
||||
if ($projectFlowItem?->projectFlow) {
|
||||
$projectFlow = $projectFlowItem->projectFlow;
|
||||
@@ -2247,7 +2247,7 @@ class ProjectController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {get} api/project/task/move 35. 任务移动
|
||||
* @api {get} api/project/task/move 38. 任务移动
|
||||
*
|
||||
* @apiDescription 需要token身份(限:项目、任务负责人)
|
||||
* @apiVersion 1.0.0
|
||||
@@ -2305,7 +2305,7 @@ class ProjectController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {get} api/project/flow/list 38. 工作流列表
|
||||
* @api {get} api/project/flow/list 39. 工作流列表
|
||||
*
|
||||
* @apiDescription 需要token身份
|
||||
* @apiVersion 1.0.0
|
||||
@@ -2331,7 +2331,7 @@ class ProjectController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {post} api/project/flow/save 39. 保存工作流
|
||||
* @api {post} api/project/flow/save 40. 保存工作流
|
||||
*
|
||||
* @apiDescription 需要token身份(限:项目负责人)
|
||||
* @apiVersion 1.0.0
|
||||
@@ -2365,7 +2365,7 @@ class ProjectController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {get} api/project/flow/delete 40. 删除工作流
|
||||
* @api {get} api/project/flow/delete 41. 删除工作流
|
||||
*
|
||||
* @apiDescription 需要token身份(限:项目负责人)
|
||||
* @apiVersion 1.0.0
|
||||
@@ -2397,7 +2397,7 @@ class ProjectController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {get} api/project/log/lists 41. 获取项目、任务日志
|
||||
* @api {get} api/project/log/lists 42. 获取项目、任务日志
|
||||
*
|
||||
* @apiDescription 需要token身份
|
||||
* @apiVersion 1.0.0
|
||||
@@ -2450,7 +2450,7 @@ class ProjectController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {get} api/project/top 42. 项目置顶
|
||||
* @api {get} api/project/top 43. 项目置顶
|
||||
*
|
||||
* @apiDescription 需要token身份
|
||||
* @apiVersion 1.0.0
|
||||
|
||||
Reference in New Issue
Block a user