Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
计算机应用开发
后
后端
J
Java
后台管理
Ruoyi Vue Pro
提交
91c0c423
R
Ruoyi Vue Pro
项目概览
计算机应用开发
/
后端
/
Java
/
后台管理
/
Ruoyi Vue Pro
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Ruoyi Vue Pro
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
91c0c423
编写于
11月 12, 2021
作者:
J
jason
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改 code review
上级
e969dbe8
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
49 addition
and
70 deletion
+49
-70
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/workflow/TaskController.java
...erver/modules/bpm/controller/workflow/TaskController.java
+9
-10
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/workflow/TaskConvert.java
...adminserver/modules/bpm/convert/workflow/TaskConvert.java
+4
-0
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/enums/BpmErrorCodeConstants.java
.../adminserver/modules/bpm/enums/BpmErrorCodeConstants.java
+12
-10
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/oa/impl/OALeaveServiceImpl.java
...erver/modules/bpm/service/oa/impl/OALeaveServiceImpl.java
+5
-21
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/workflow/BpmTaskService.java
...inserver/modules/bpm/service/workflow/BpmTaskService.java
+6
-6
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/workflow/impl/BpmTaskServiceImpl.java
...modules/bpm/service/workflow/impl/BpmTaskServiceImpl.java
+6
-17
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/dal/mysql/user/SysUserMapper.java
...inserver/modules/system/dal/mysql/user/SysUserMapper.java
+6
-6
yudao-admin-server/src/main/resources/application.yaml
yudao-admin-server/src/main/resources/application.yaml
+1
-0
未找到文件。
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/workflow/TaskController.java
浏览文件 @
91c0c423
package
cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow
;
package
cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow
;
import
cn.hutool.core.io.IoUtil
;
import
cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow.vo.*
;
import
cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow.vo.*
;
import
cn.iocoder.yudao.adminserver.modules.bpm.service.workflow.TaskService
;
import
cn.iocoder.yudao.adminserver.modules.bpm.service.workflow.
Bpm
TaskService
;
import
cn.iocoder.yudao.framework.common.pojo.CommonResult
;
import
cn.iocoder.yudao.framework.common.pojo.CommonResult
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.framework.common.util.servlet.ServletUtils
;
import
cn.iocoder.yudao.framework.common.util.servlet.ServletUtils
;
...
@@ -25,40 +24,40 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
...
@@ -25,40 +24,40 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
public
class
TaskController
{
public
class
TaskController
{
@Resource
@Resource
private
TaskService
t
askService
;
private
BpmTaskService
bpmT
askService
;
@GetMapping
(
"/todo/page"
)
@GetMapping
(
"/todo/page"
)
@ApiOperation
(
"获取待办任务分页"
)
@ApiOperation
(
"获取待办任务分页"
)
public
CommonResult
<
PageResult
<
TodoTaskRespVO
>>
getTodoTaskPage
(
@Valid
TodoTaskPageReqVO
pageVO
)
{
public
CommonResult
<
PageResult
<
TodoTaskRespVO
>>
getTodoTaskPage
(
@Valid
TodoTaskPageReqVO
pageVO
)
{
return
success
(
t
askService
.
getTodoTaskPage
(
pageVO
));
return
success
(
bpmT
askService
.
getTodoTaskPage
(
pageVO
));
}
}
@GetMapping
(
"/claim"
)
@GetMapping
(
"/claim"
)
@ApiOperation
(
"签收任务"
)
@ApiOperation
(
"签收任务"
)
public
CommonResult
<
Boolean
>
claimTask
(
@RequestParam
(
"id"
)
String
taskId
)
{
public
CommonResult
<
Boolean
>
claimTask
(
@RequestParam
(
"id"
)
String
taskId
)
{
t
askService
.
claimTask
(
taskId
);
bpmT
askService
.
claimTask
(
taskId
);
return
success
(
true
);
return
success
(
true
);
}
}
@PostMapping
(
"/task-steps"
)
@PostMapping
(
"/task-steps"
)
public
CommonResult
<
TaskHandleVO
>
getTaskSteps
(
@RequestBody
TaskQueryReqVO
taskQuery
)
{
public
CommonResult
<
TaskHandleVO
>
getTaskSteps
(
@RequestBody
TaskQueryReqVO
taskQuery
)
{
return
success
(
t
askService
.
getTaskSteps
(
taskQuery
));
return
success
(
bpmT
askService
.
getTaskSteps
(
taskQuery
));
}
}
@PostMapping
(
"/formKey"
)
@PostMapping
(
"/formKey"
)
public
CommonResult
<
TodoTaskRespVO
>
getTaskFormKey
(
@RequestBody
TaskQueryReqVO
taskQuery
)
{
public
CommonResult
<
TodoTaskRespVO
>
getTaskFormKey
(
@RequestBody
TaskQueryReqVO
taskQuery
)
{
return
success
(
t
askService
.
getTaskFormKey
(
taskQuery
));
return
success
(
bpmT
askService
.
getTaskFormKey
(
taskQuery
));
}
}
@PostMapping
(
"/complete"
)
@PostMapping
(
"/complete"
)
public
CommonResult
<
Boolean
>
complete
(
@RequestBody
TaskReqVO
taskReq
)
{
public
CommonResult
<
Boolean
>
complete
(
@RequestBody
TaskReqVO
taskReq
)
{
t
askService
.
completeTask
(
taskReq
);
bpmT
askService
.
completeTask
(
taskReq
);
return
success
(
true
);
return
success
(
true
);
}
}
@GetMapping
(
"/process/history-steps"
)
@GetMapping
(
"/process/history-steps"
)
public
CommonResult
<
List
<
TaskStepVO
>>
getHistorySteps
(
@RequestParam
(
"id"
)
String
processInstanceId
)
{
public
CommonResult
<
List
<
TaskStepVO
>>
getHistorySteps
(
@RequestParam
(
"id"
)
String
processInstanceId
)
{
return
success
(
t
askService
.
getHistorySteps
(
processInstanceId
));
return
success
(
bpmT
askService
.
getHistorySteps
(
processInstanceId
));
}
}
// TODO @Li: 项目里,暂时不使用 path 路径参数,监控等麻烦
// TODO @Li: 项目里,暂时不使用 path 路径参数,监控等麻烦
...
@@ -68,7 +67,7 @@ public class TaskController {
...
@@ -68,7 +67,7 @@ public class TaskController {
*/
*/
@GetMapping
(
"/process/highlight-img/{id}"
)
@GetMapping
(
"/process/highlight-img/{id}"
)
public
void
getHighlightImg
(
@PathVariable
(
"id"
)
String
processInstanceId
,
HttpServletResponse
response
)
throws
IOException
{
public
void
getHighlightImg
(
@PathVariable
(
"id"
)
String
processInstanceId
,
HttpServletResponse
response
)
throws
IOException
{
FileResp
fileResp
=
t
askService
.
getHighlightImg
(
processInstanceId
);
FileResp
fileResp
=
bpmT
askService
.
getHighlightImg
(
processInstanceId
);
ServletUtils
.
writeAttachment
(
response
,
fileResp
.
getFileName
(),
fileResp
.
getFileByte
());
ServletUtils
.
writeAttachment
(
response
,
fileResp
.
getFileName
(),
fileResp
.
getFileByte
());
}
}
...
...
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/workflow/TaskConvert.java
浏览文件 @
91c0c423
...
@@ -25,6 +25,10 @@ public interface TaskConvert {
...
@@ -25,6 +25,10 @@ public interface TaskConvert {
})
})
TodoTaskRespVO
convert
(
Task
task
,
ProcessDefinition
definition
);
TodoTaskRespVO
convert
(
Task
task
,
ProcessDefinition
definition
);
@Mappings
(
value
=
{
@Mapping
(
source
=
"assignee"
,
target
=
"status"
,
qualifiedByName
=
"convertAssigneeToStatus"
)
})
TodoTaskRespVO
convert
(
Task
task
);
@Named
(
"convertAssigneeToStatus"
)
@Named
(
"convertAssigneeToStatus"
)
default
Integer
convertAssigneeToStatus
(
String
assignee
)
{
default
Integer
convertAssigneeToStatus
(
String
assignee
)
{
...
...
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/enums/
oa/OA
ErrorCodeConstants.java
→
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/enums/
Bpm
ErrorCodeConstants.java
浏览文件 @
91c0c423
package
cn.iocoder.yudao.adminserver.modules.bpm.enums
.oa
;
package
cn.iocoder.yudao.adminserver.modules.bpm.enums
;
import
cn.iocoder.yudao.framework.common.exception.ErrorCode
;
import
cn.iocoder.yudao.framework.common.exception.ErrorCode
;
// TODO @jason:错误码整理下,和其它模块保持一致。包括前缀
/**
/**
*
activiti 系统
错误码枚举类
*
工作流
错误码枚举类
*
*
* 003 activiti
* 工作流系统,使用 1-003-000-000 段
* 001 oa
* activiti 系统,使用 1-003-000-000 段
*/
*/
public
interface
OA
ErrorCodeConstants
{
public
interface
Bpm
ErrorCodeConstants
{
// ========== 通用流程处理 模块 1-003-000-000 ==========
ErrorCode
PROCESS_INSTANCE_NOT_EXISTS
=
new
ErrorCode
(
1003000001
,
"流程实例不存在"
);
ErrorCode
HIGHLIGHT_IMG_ERROR
=
new
ErrorCode
(
1003000002
,
"获取高亮流程图异常"
);
// ========== OA 流程模块 1-003-001-000 ==========
ErrorCode
LEAVE_NOT_EXISTS
=
new
ErrorCode
(
1003001001
,
"请假申请不存在"
);
ErrorCode
LEAVE_NOT_EXISTS
=
new
ErrorCode
(
1003001001
,
"请假申请不存在"
);
ErrorCode
PM_POST_NOT_EXISTS
=
new
ErrorCode
(
1003001002
,
"项目经理岗位未设置"
);
ErrorCode
PM_POST_NOT_EXISTS
=
new
ErrorCode
(
1003001002
,
"项目经理岗位未设置"
);
ErrorCode
DEPART_PM_POST_NOT_EXISTS
=
new
ErrorCode
(
1003001003
,
"部门的项目经理不存在"
);
ErrorCode
DEPART_PM_POST_NOT_EXISTS
=
new
ErrorCode
(
1003001003
,
"部门的项目经理不存在"
);
ErrorCode
BM_POST_NOT_EXISTS
=
new
ErrorCode
(
1003001004
,
"部门经理岗位未设置"
);
ErrorCode
BM_POST_NOT_EXISTS
=
new
ErrorCode
(
1003001004
,
"部门经理岗位未设置"
);
ErrorCode
DEPART_BM_POST_NOT_EXISTS
=
new
ErrorCode
(
1003001005
,
"部门的部门经理不存在"
);
ErrorCode
DEPART_BM_POST_NOT_EXISTS
=
new
ErrorCode
(
1003001005
,
"部门的部门经理不存在"
);
ErrorCode
HR_POST_NOT_EXISTS
=
new
ErrorCode
(
1003001006
,
"HR岗位未设置"
);
ErrorCode
HR_POST_NOT_EXISTS
=
new
ErrorCode
(
1003001006
,
"HR岗位未设置"
);
ErrorCode
DAY_LEAVE_ERROR
=
new
ErrorCode
(
1003001007
,
"请假天数必须大于0"
);
ErrorCode
DAY_LEAVE_ERROR
=
new
ErrorCode
(
1003001007
,
"请假天数必须>=1"
);
ErrorCode
PROCESS_INSTANCE_NOT_EXISTS
=
new
ErrorCode
(
1003001008
,
"流程实例不存在"
);
ErrorCode
HIGHLIGHT_IMG_ERROR
=
new
ErrorCode
(
1003001009
,
"获取高亮流程图异常"
);
}
}
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/oa/impl/OALeaveServiceImpl.java
浏览文件 @
91c0c423
...
@@ -28,7 +28,7 @@ import org.springframework.validation.annotation.Validated;
...
@@ -28,7 +28,7 @@ import org.springframework.validation.annotation.Validated;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.*
;
import
java.util.*
;
import
static
cn
.
iocoder
.
yudao
.
adminserver
.
modules
.
bpm
.
enums
.
oa
.
OA
ErrorCodeConstants
.*;
import
static
cn
.
iocoder
.
yudao
.
adminserver
.
modules
.
bpm
.
enums
.
Bpm
ErrorCodeConstants
.*;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
exception
.
util
.
ServiceExceptionUtil
.
exception
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
exception
.
util
.
ServiceExceptionUtil
.
exception
;
/**
/**
...
@@ -164,12 +164,7 @@ public class OALeaveServiceImpl implements OALeaveService {
...
@@ -164,12 +164,7 @@ public class OALeaveServiceImpl implements OALeaveService {
throw
ServiceExceptionUtil
.
exception
(
PM_POST_NOT_EXISTS
);
throw
ServiceExceptionUtil
.
exception
(
PM_POST_NOT_EXISTS
);
}
}
SysUserDO
userDO
=
sysUserMapper
.
selectById
(
id
);
SysUserDO
userDO
=
sysUserMapper
.
selectById
(
id
);
Set
<
Long
>
postIds
=
new
HashSet
<>(
8
);
final
List
<
SysUserDO
>
pmUsers
=
sysUserMapper
.
selectListByDepartIdAndPostId
(
userDO
.
getDeptId
(),
pmPostDO
.
getId
());
postIds
.
add
(
pmPostDO
.
getId
());
SysUserBaseVO
baseVO
=
new
SysUserBaseVO
();
baseVO
.
setDeptId
(
userDO
.
getDeptId
())
.
setPostIds
(
postIds
);
final
List
<
SysUserDO
>
pmUsers
=
sysUserMapper
.
selectListByBaseVO
(
baseVO
);
if
(
CollUtil
.
isEmpty
(
pmUsers
))
{
if
(
CollUtil
.
isEmpty
(
pmUsers
))
{
throw
ServiceExceptionUtil
.
exception
(
DEPART_PM_POST_NOT_EXISTS
);
throw
ServiceExceptionUtil
.
exception
(
DEPART_PM_POST_NOT_EXISTS
);
}
}
...
@@ -179,13 +174,8 @@ public class OALeaveServiceImpl implements OALeaveService {
...
@@ -179,13 +174,8 @@ public class OALeaveServiceImpl implements OALeaveService {
if
(
Objects
.
isNull
(
bmPostDO
))
{
if
(
Objects
.
isNull
(
bmPostDO
))
{
throw
ServiceExceptionUtil
.
exception
(
BM_POST_NOT_EXISTS
);
throw
ServiceExceptionUtil
.
exception
(
BM_POST_NOT_EXISTS
);
}
}
userDO
=
sysUserMapper
.
selectById
(
id
);
postIds
=
new
HashSet
<>(
8
);
final
List
<
SysUserDO
>
bmUsers
=
sysUserMapper
.
selectListByDepartIdAndPostId
(
userDO
.
getDeptId
(),
bmPostDO
.
getId
());
postIds
.
add
(
bmPostDO
.
getId
());
baseVO
=
new
SysUserBaseVO
();
baseVO
.
setDeptId
(
userDO
.
getDeptId
())
.
setPostIds
(
postIds
);
final
List
<
SysUserDO
>
bmUsers
=
sysUserMapper
.
selectListByBaseVO
(
baseVO
);
if
(
CollUtil
.
isEmpty
(
bmUsers
))
{
if
(
CollUtil
.
isEmpty
(
bmUsers
))
{
throw
ServiceExceptionUtil
.
exception
(
DEPART_BM_POST_NOT_EXISTS
);
throw
ServiceExceptionUtil
.
exception
(
DEPART_BM_POST_NOT_EXISTS
);
}
}
...
@@ -194,13 +184,7 @@ public class OALeaveServiceImpl implements OALeaveService {
...
@@ -194,13 +184,7 @@ public class OALeaveServiceImpl implements OALeaveService {
if
(
Objects
.
isNull
(
hrPostDO
))
{
if
(
Objects
.
isNull
(
hrPostDO
))
{
throw
ServiceExceptionUtil
.
exception
(
HR_POST_NOT_EXISTS
);
throw
ServiceExceptionUtil
.
exception
(
HR_POST_NOT_EXISTS
);
}
}
userDO
=
sysUserMapper
.
selectById
(
id
);
final
List
<
SysUserDO
>
hrUsers
=
sysUserMapper
.
selectListByDepartIdAndPostId
(
userDO
.
getDeptId
(),
hrPostDO
.
getId
());
postIds
=
new
HashSet
<>(
8
);
postIds
.
add
(
hrPostDO
.
getId
());
baseVO
=
new
SysUserBaseVO
();
baseVO
.
setDeptId
(
userDO
.
getDeptId
())
.
setPostIds
(
postIds
);
final
List
<
SysUserDO
>
hrUsers
=
sysUserMapper
.
selectListByBaseVO
(
baseVO
);
if
(
CollUtil
.
isEmpty
(
hrUsers
))
{
if
(
CollUtil
.
isEmpty
(
hrUsers
))
{
throw
ServiceExceptionUtil
.
exception
(
DEPART_BM_POST_NOT_EXISTS
);
throw
ServiceExceptionUtil
.
exception
(
DEPART_BM_POST_NOT_EXISTS
);
}
}
...
...
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/workflow/TaskService.java
→
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/workflow/
Bpm
TaskService.java
浏览文件 @
91c0c423
...
@@ -6,11 +6,10 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
...
@@ -6,11 +6,10 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
import
java.util.List
;
// TODO @jason:前缀
/**
/**
* 用户任务服务接口
*
工作流
用户任务服务接口
*/
*/
public
interface
TaskService
{
public
interface
Bpm
TaskService
{
/**
/**
...
@@ -25,10 +24,11 @@ public interface TaskService {
...
@@ -25,10 +24,11 @@ public interface TaskService {
*/
*/
void
claimTask
(
String
taskId
);
void
claimTask
(
String
taskId
);
// TODO @jason:可以把实现方法的注释,统一写到接口里
/**
/**
* 办理完成用户任务
* 工作流,完成 userTask, 完成用户任务 一般传入参数 1。是否同意(variables). 2. 评论(comment)
* @param taskReq 任务参数, 包含任务的参数,和 评论
* variables 变量名 和 评论 由前台传入
* @param taskReq 任务参数
*/
*/
void
completeTask
(
TaskReqVO
taskReq
);
void
completeTask
(
TaskReqVO
taskReq
);
...
...
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/workflow/impl/TaskServiceImpl.java
→
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/workflow/impl/
Bpm
TaskServiceImpl.java
浏览文件 @
91c0c423
...
@@ -4,7 +4,7 @@ import cn.hutool.core.collection.CollUtil;
...
@@ -4,7 +4,7 @@ import cn.hutool.core.collection.CollUtil;
import
cn.hutool.core.io.IoUtil
;
import
cn.hutool.core.io.IoUtil
;
import
cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow.vo.*
;
import
cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow.vo.*
;
import
cn.iocoder.yudao.adminserver.modules.bpm.convert.workflow.TaskConvert
;
import
cn.iocoder.yudao.adminserver.modules.bpm.convert.workflow.TaskConvert
;
import
cn.iocoder.yudao.adminserver.modules.bpm.service.workflow.TaskService
;
import
cn.iocoder.yudao.adminserver.modules.bpm.service.workflow.
Bpm
TaskService
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.framework.common.util.collection.CollectionUtils
;
import
cn.iocoder.yudao.framework.common.util.collection.CollectionUtils
;
import
cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils
;
import
cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils
;
...
@@ -41,13 +41,13 @@ import java.util.Map;
...
@@ -41,13 +41,13 @@ import java.util.Map;
import
java.util.Optional
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
cn
.
iocoder
.
yudao
.
adminserver
.
modules
.
bpm
.
enums
.
oa
.
OA
ErrorCodeConstants
.
HIGHLIGHT_IMG_ERROR
;
import
static
cn
.
iocoder
.
yudao
.
adminserver
.
modules
.
bpm
.
enums
.
Bpm
ErrorCodeConstants
.
HIGHLIGHT_IMG_ERROR
;
import
static
cn
.
iocoder
.
yudao
.
adminserver
.
modules
.
bpm
.
enums
.
oa
.
OA
ErrorCodeConstants
.
PROCESS_INSTANCE_NOT_EXISTS
;
import
static
cn
.
iocoder
.
yudao
.
adminserver
.
modules
.
bpm
.
enums
.
Bpm
ErrorCodeConstants
.
PROCESS_INSTANCE_NOT_EXISTS
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
exception
.
util
.
ServiceExceptionUtil
.
exception
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
exception
.
util
.
ServiceExceptionUtil
.
exception
;
@Slf4j
@Slf4j
@Service
@Service
public
class
TaskServiceImpl
implements
TaskService
{
public
class
BpmTaskServiceImpl
implements
Bpm
TaskService
{
@Resource
@Resource
private
TaskRuntime
taskRuntime
;
private
TaskRuntime
taskRuntime
;
...
@@ -76,7 +76,6 @@ public class TaskServiceImpl implements TaskService {
...
@@ -76,7 +76,6 @@ public class TaskServiceImpl implements TaskService {
List
<
Task
>
tasks
=
pageTasks
.
getContent
();
List
<
Task
>
tasks
=
pageTasks
.
getContent
();
final
List
<
TodoTaskRespVO
>
respVOList
=
tasks
.
stream
().
map
(
task
->
{
final
List
<
TodoTaskRespVO
>
respVOList
=
tasks
.
stream
().
map
(
task
->
{
ProcessDefinition
definition
=
repositoryService
.
getProcessDefinition
(
task
.
getProcessDefinitionId
());
ProcessDefinition
definition
=
repositoryService
.
getProcessDefinition
(
task
.
getProcessDefinitionId
());
definition
.
getId
();
return
TaskConvert
.
INSTANCE
.
convert
(
task
,
definition
);
return
TaskConvert
.
INSTANCE
.
convert
(
task
,
definition
);
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
return
new
PageResult
<>(
respVOList
,
(
long
)
totalItems
);
return
new
PageResult
<>(
respVOList
,
(
long
)
totalItems
);
...
@@ -92,11 +91,7 @@ public class TaskServiceImpl implements TaskService {
...
@@ -92,11 +91,7 @@ public class TaskServiceImpl implements TaskService {
}
}
/**
* 工作流,完成 userTask, 完成用户任务 一般传入参数 1。是否同意(variables). 2. 评论(comment)
* variables 变量名 和 评论 由前台传入
* @param taskReq 任务参数
*/
@Override
@Override
@Transactional
@Transactional
public
void
completeTask
(
TaskReqVO
taskReq
)
{
public
void
completeTask
(
TaskReqVO
taskReq
)
{
...
@@ -166,13 +161,7 @@ public class TaskServiceImpl implements TaskService {
...
@@ -166,13 +161,7 @@ public class TaskServiceImpl implements TaskService {
@Override
@Override
public
TodoTaskRespVO
getTaskFormKey
(
TaskQueryReqVO
taskQuery
)
{
public
TodoTaskRespVO
getTaskFormKey
(
TaskQueryReqVO
taskQuery
)
{
final
Task
task
=
taskRuntime
.
task
(
taskQuery
.
getTaskId
());
final
Task
task
=
taskRuntime
.
task
(
taskQuery
.
getTaskId
());
// 转换结果 TODO @jason:放到 convert 类里
return
TaskConvert
.
INSTANCE
.
convert
(
task
);
TodoTaskRespVO
respVO
=
new
TodoTaskRespVO
();
respVO
.
setFormKey
(
task
.
getFormKey
());
respVO
.
setBusinessKey
(
task
.
getBusinessKey
());
respVO
.
setId
(
task
.
getId
());
respVO
.
setProcessInstanceId
(
task
.
getProcessInstanceId
());
return
respVO
;
}
}
@Override
@Override
...
...
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/dal/mysql/user/SysUserMapper.java
浏览文件 @
91c0c423
...
@@ -15,6 +15,7 @@ import org.apache.logging.log4j.util.Strings;
...
@@ -15,6 +15,7 @@ import org.apache.logging.log4j.util.Strings;
import
java.util.Collection
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.Optional
;
import
java.util.Set
;
@Mapper
@Mapper
public
interface
SysUserMapper
extends
BaseMapperX
<
SysUserDO
>
{
public
interface
SysUserMapper
extends
BaseMapperX
<
SysUserDO
>
{
...
@@ -56,13 +57,12 @@ public interface SysUserMapper extends BaseMapperX<SysUserDO> {
...
@@ -56,13 +57,12 @@ public interface SysUserMapper extends BaseMapperX<SysUserDO> {
return
selectList
(
new
QueryWrapperX
<
SysUserDO
>().
like
(
"username"
,
username
));
return
selectList
(
new
QueryWrapperX
<
SysUserDO
>().
like
(
"username"
,
username
));
}
}
// TODO jason:变量平铺比较好
default
List
<
SysUserDO
>
selectListByBaseVO
(
SysUserBaseVO
reqVO
)
{
default
List
<
SysUserDO
>
selectListByDepartIdAndPostId
(
Long
departId
,
Long
postId
)
{
return
selectList
(
new
QueryWrapperX
<
SysUserDO
>().
likeIfPresent
(
"username"
,
reqVO
.
getUsername
())
return
selectList
(
new
QueryWrapperX
<
SysUserDO
>()
.
likeIfPresent
(
"nickname"
,
reqVO
.
getNickname
())
.
eq
(
"status"
,
CommonStatusEnum
.
ENABLE
.
getStatus
())
.
eq
(
"status"
,
CommonStatusEnum
.
ENABLE
.
getStatus
())
.
eq
(
"dept_id"
,
reqVO
.
getDeptId
()
)
.
eq
(
"dept_id"
,
departId
)
.
likeIfPresent
(
"post_ids"
,
Optional
.
ofNullable
(
reqVO
.
getPostIds
()).
map
(
t
->
Strings
.
join
(
t
,
','
)).
orElse
(
""
)));
.
likeIfPresent
(
"post_ids"
,
Optional
.
ofNullable
(
postId
).
map
(
t
->
String
.
valueOf
(
postId
)).
orElse
(
""
)));
}
}
}
}
...
...
yudao-admin-server/src/main/resources/application.yaml
浏览文件 @
91c0c423
...
@@ -73,5 +73,6 @@ yudao:
...
@@ -73,5 +73,6 @@ yudao:
constants-class-list
:
constants-class-list
:
-
cn.iocoder.yudao.adminserver.modules.infra.enums.InfErrorCodeConstants
-
cn.iocoder.yudao.adminserver.modules.infra.enums.InfErrorCodeConstants
-
cn.iocoder.yudao.adminserver.modules.system.enums.SysErrorCodeConstants
-
cn.iocoder.yudao.adminserver.modules.system.enums.SysErrorCodeConstants
-
cn.iocoder.yudao.adminserver.modules.bpm.enums.BpmErrorCodeConstants
debug
:
false
debug
:
false
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录