Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
jy_jfb
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Administrator
jy_jfb
Commits
19916d19
提交
19916d19
authored
8月 24, 2026
作者:
wangmenglong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加岗位交接
上级
9355e869
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
487 行增加
和
1 行删除
+487
-1
HandoverLog.java
jfb-lib/src/main/java/data/recruit/HandoverLog.java
+50
-0
Recruit.java
jfb-lib/src/main/java/data/recruit/Recruit.java
+1
-1
HandoverController.java
...n/java/com/jfb/recruit/controller/HandoverController.java
+119
-0
HandoverLogMapper.java
...c/main/java/com/jfb/recruit/mapper/HandoverLogMapper.java
+15
-0
HandoverService.java
...rc/main/java/com/jfb/recruit/service/HandoverService.java
+55
-0
HandoverServiceImpl.java
...ava/com/jfb/recruit/service/impl/HandoverServiceImpl.java
+247
-0
没有找到文件。
jfb-lib/src/main/java/data/recruit/HandoverLog.java
0 → 100644
浏览文件 @
19916d19
package
data
.
recruit
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
data.parent.IdentityObj
;
import
lombok.Data
;
/**
* @author wangmenglong
* @description: 岗位交接记录
* user_id / user_name 记录操作人(执行交接的人)
* old_user_id / old_user_name 记录原账号(被交接走的发布人)
* new_user_id / new_user_name 记录新账号(接手岗位的发布人)
* @date 2026/08/24
*/
@Data
@TableName
(
value
=
"tb_handover_log"
)
public
class
HandoverLog
extends
IdentityObj
{
/**
* 原用户id(被交接走的发布人)
**/
@TableField
(
"old_user_id"
)
private
String
oldUserId
;
/**
* 原用户名称
**/
@TableField
(
"old_user_name"
)
private
String
oldUserName
;
/**
* 新用户id(接手岗位的发布人)
**/
@TableField
(
"new_user_id"
)
private
String
newUserId
;
/**
* 新用户名称(随机交接时为多个接收人名称,逗号隔开)
**/
@TableField
(
"new_user_name"
)
private
String
newUserName
;
/**
* 交接类型:user 指定交接给一人,random 随机分配给多人
**/
@TableField
(
"type"
)
private
String
type
;
}
jfb-lib/src/main/java/data/recruit/Recruit.java
浏览文件 @
19916d19
...
@@ -7,7 +7,7 @@ import lombok.Data;
...
@@ -7,7 +7,7 @@ import lombok.Data;
/**
/**
* @author wangmenglong
* @author wangmenglong
* @description:
报名记录
* @description:
岗位发布
* @date 2023/12/11 10:50
* @date 2023/12/11 10:50
*/
*/
@Data
@Data
...
...
jfb-recruit/src/main/java/com/jfb/recruit/controller/HandoverController.java
0 → 100644
浏览文件 @
19916d19
package
com
.
jfb
.
recruit
.
controller
;
import
base.controller.BaseController
;
import
base.result.BaseResult
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.pagehelper.PageInfo
;
import
com.jfb.recruit.bean.auth.UserContext
;
import
com.jfb.recruit.service.HandoverService
;
import
com.jfb.recruit.util.auth.UserUtils
;
import
data.recruit.HandoverLog
;
import
data.user.User
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
/**
* @author wangmenglong
* @description: 岗位交接(发布人岗位转移 / 交接记录查询)
* @date 2026/08/24
*/
@RestController
@RequestMapping
(
"/handover"
)
public
class
HandoverController
extends
BaseController
{
@Resource
HandoverService
handoverService
;
@Autowired
ThreadPoolTaskExecutor
taskExecutor
;
/**
* @description: 获取状态正常的用户列表(用于选择交接目标)
* @author: wangmenglong
* @date; 2026/08/24
* @param: [req, user] user 可带 name/account 模糊查询
* @return: base.result.BaseResult
**/
@GetMapping
(
"/user/normalList"
)
public
BaseResult
normalUserList
(
HttpServletRequest
req
,
User
user
)
{
PageInit
(
req
);
if
(
user
==
null
)
{
user
=
new
User
();
}
PageInfo
<
User
>
pageInfo
=
handoverService
.
normalUserList
(
pageNum
,
pageSize
,
user
);
return
BaseResult
.
success
(
pageInfo
);
}
/**
* @description: 将原发布人的全部岗位交接给指定新发布人
* @author: wangmenglong
* @date; 2026/08/24
* @param: [jsonObject] 需包含 originalUserId/originalUserName/newUserId/newUserName
* @return: base.result.BaseResult
**/
@PostMapping
(
"/all"
)
public
BaseResult
handoverAll
(
@RequestBody
JSONObject
jsonObject
)
{
String
originalUserId
=
jsonObject
.
getString
(
"originalUserId"
);
String
originalUserName
=
jsonObject
.
getString
(
"originalUserName"
);
String
newUserId
=
jsonObject
.
getString
(
"newUserId"
);
String
newUserName
=
jsonObject
.
getString
(
"newUserName"
);
if
(
StringUtils
.
isBlank
(
originalUserId
)
||
StringUtils
.
isBlank
(
newUserId
))
{
return
BaseResult
.
error
(
"error_002"
);
}
boolean
result
=
handoverService
.
handoverAll
(
originalUserId
,
originalUserName
,
newUserId
,
newUserName
);
// 原账号没有岗位时返回 error_009
return
result
?
BaseResult
.
success
(
"normal_002"
)
:
BaseResult
.
error
(
"error_009"
);
}
/**
* @description: 将原发布人的岗位均分给库里所有正常用户(排除原账号本人),后台异步执行,接口立即返回
* @author: wangmenglong
* @date; 2026/08/24
* @param: [jsonObject] 需包含 originalUserId/originalUserName,接收人由系统从库里正常用户中均分选取
* @return: base.result.BaseResult 仅表示任务已提交,实际分配进度请看交接记录
**/
@PostMapping
(
"/random"
)
public
BaseResult
handoverRandom
(
@RequestBody
JSONObject
jsonObject
)
{
String
originalUserId
=
jsonObject
.
getString
(
"originalUserId"
);
String
originalUserName
=
jsonObject
.
getString
(
"originalUserName"
);
if
(
StringUtils
.
isBlank
(
originalUserId
))
{
return
BaseResult
.
error
(
"error_002"
);
}
// 在同步线程取出登录上下文,传给异步任务(异步线程池拿不到 ThreadLocal 里的 UserContext,会 NPE)
UserContext
operator
=
UserUtils
.
getUserContext
();
if
(
operator
==
null
)
{
return
BaseResult
.
error
(
"error_002"
);
}
// 同步预校验:原账号没有岗位、或库里没有其它正常用户,直接返回 error_009,不提交后台任务
if
(!
handoverService
.
canRandomHandover
(
originalUserId
,
operator
))
{
return
BaseResult
.
error
(
"error_009"
);
}
final
String
oName
=
originalUserName
;
// 提交异步任务到线程池(后台慢慢分,前端不阻塞)
taskExecutor
.
execute
(()
->
handoverService
.
handoverRandom
(
originalUserId
,
oName
,
operator
));
return
BaseResult
.
success
(
"normal_003"
);
}
/**
* @description: 查询岗位交接记录列表,支持按操作人/原账号/新账号名称模糊查询
* @author: wangmenglong
* @date; 2026/08/24
* @param: [req, handoverLog] 可带 userName(操作人)/oldUserName(原账号)/newUserName(新账号)/type(交接类型:user 指定交接/random 随机分配)
* @return: base.result.BaseResult
**/
@GetMapping
(
"/log/list"
)
public
BaseResult
logList
(
HttpServletRequest
req
,
HandoverLog
handoverLog
)
{
PageInit
(
req
);
if
(
handoverLog
==
null
)
{
handoverLog
=
new
HandoverLog
();
}
PageInfo
<
HandoverLog
>
pageInfo
=
handoverService
.
logList
(
pageNum
,
pageSize
,
handoverLog
);
return
BaseResult
.
success
(
pageInfo
);
}
}
jfb-recruit/src/main/java/com/jfb/recruit/mapper/HandoverLogMapper.java
0 → 100644
浏览文件 @
19916d19
package
com
.
jfb
.
recruit
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
data.recruit.HandoverLog
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* @author wangmenglong
* @description: 岗位交接记录 Mapper
* @date 2026/08/24
*/
@Mapper
public
interface
HandoverLogMapper
extends
BaseMapper
<
HandoverLog
>
{
}
jfb-recruit/src/main/java/com/jfb/recruit/service/HandoverService.java
0 → 100644
浏览文件 @
19916d19
package
com
.
jfb
.
recruit
.
service
;
import
com.github.pagehelper.PageInfo
;
import
com.jfb.recruit.bean.auth.UserContext
;
import
data.recruit.HandoverLog
;
import
data.user.User
;
/**
* @author wangmenglong
* @description: 岗位交接服务
* @date 2026/08/24
*/
public
interface
HandoverService
{
/**
* @description: 获取状态正常的用户列表(不含被交接目标时排除原账号,由调用方控制)
* @param: [pageNum, pageSize, user] user 可带 name/account 模糊查询条件,state 固定为 normal
* @return: com.github.pagehelper.PageInfo<data.user.User>
**/
PageInfo
<
User
>
normalUserList
(
int
pageNum
,
int
pageSize
,
User
user
);
/**
* @description: 将某发布人的全部岗位交接给指定新发布人
* 把所有 user_id = originalUserId 的岗位(del=false)的 user_id/user_name 改为新用户,
* 整笔交接只写 1 条记录(type=user 指定交接,新账号=指定人)
* @param: [originalUserId, originalUserName, newUserId, newUserName]
* @return: boolean 是否交接成功(存在可交接岗位且更新成功)
**/
boolean
handoverAll
(
String
originalUserId
,
String
originalUserName
,
String
newUserId
,
String
newUserName
);
/**
* @description: 将某发布人的岗位均分给库里所有正常用户(排除原账号本人),按轮询均分使每人数量尽量相等(相差不超过 1)。
* 整笔随机交接只写 1 条记录(type=random,新账号=实际分到的多个接收人逗号隔开)。
* 注意:该方法是纯数据操作,由 Controller 层用线程池异步调用,方法本身不负责异步。
* @param: [originalUserId, originalUserName] 原账号(被交接走的发布人);接收人由方法内部从库里正常用户中排除本人后均分选取
* @return: boolean 是否交接成功(存在可交接岗位且库里除本人外有正常用户)
**/
boolean
handoverRandom
(
String
originalUserId
,
String
originalUserName
,
UserContext
operator
);
/**
* @description: 随机交接前的同步校验:原账号是否存在未删除岗位,且库里除本人外是否存在其它正常用户。
* 任一不满足则返回 false(用于异步提交前在同步线程拦截,避免无意义地提交后台任务)。
* @param: [originalUserId, operator] operator 为操作人上下文,含 baseCode,用于限定数据范围
* @return: boolean 是否可以发起随机交接
**/
boolean
canRandomHandover
(
String
originalUserId
,
UserContext
operator
);
/**
* @description: 查询岗位交接记录列表,支持按操作人/原账号/新账号名称模糊查询
* @param: [pageNum, pageSize, handoverLog] 可带 userName(操作人)/oldUserName(原账号)/newUserName(新账号) 查询条件
* @return: com.github.pagehelper.PageInfo<data.recruit.HandoverLog>
**/
PageInfo
<
HandoverLog
>
logList
(
int
pageNum
,
int
pageSize
,
HandoverLog
handoverLog
);
}
jfb-recruit/src/main/java/com/jfb/recruit/service/impl/HandoverServiceImpl.java
0 → 100644
浏览文件 @
19916d19
package
com
.
jfb
.
recruit
.
service
.
impl
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.alibaba.cloud.commons.lang.StringUtils
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.jfb.recruit.bean.auth.UserContext
;
import
com.jfb.recruit.mapper.HandoverLogMapper
;
import
com.jfb.recruit.mapper.RecruitMapper
;
import
com.jfb.recruit.mapper.UserMapper
;
import
com.jfb.recruit.service.HandoverService
;
import
com.jfb.recruit.util.auth.UserUtils
;
import
com.jfb.recruit.xsnowflake.SnowFlakeFactory
;
import
data.recruit.HandoverLog
;
import
data.recruit.Recruit
;
import
data.user.User
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
* @author wangmenglong
* @description: 岗位交接服务实现
* @date 2026/08/24
*/
@Service
@Transactional
public
class
HandoverServiceImpl
extends
ServiceImpl
<
HandoverLogMapper
,
HandoverLog
>
implements
HandoverService
{
@Autowired
SnowFlakeFactory
snowFlakeFactory
;
@Resource
UserMapper
userMapper
;
@Resource
RecruitMapper
recruitMapper
;
/**
* @description: 获取状态正常的用户列表(同 base_code 下、state=normal、未删除)
* @author: wangmenglong
* @date; 2026/08/24
* @param: [pageNum, pageSize, user]
* @return: com.github.pagehelper.PageInfo<data.user.User>
**/
@Override
public
PageInfo
<
User
>
normalUserList
(
int
pageNum
,
int
pageSize
,
User
user
)
{
UserContext
userContext
=
UserUtils
.
getUserContext
();
String
baseCode
=
userContext
.
getBaseCode
();
PageHelper
.
startPage
(
pageNum
,
pageSize
);
LambdaQueryWrapper
<
User
>
qw
=
new
LambdaQueryWrapper
<>();
qw
.
like
(
StringUtils
.
isNotBlank
(
user
.
getName
()),
User:
:
getName
,
user
.
getName
())
.
like
(
StringUtils
.
isNotBlank
(
user
.
getAccount
()),
User:
:
getAccount
,
user
.
getAccount
())
.
eq
(
User:
:
getState
,
"normal"
)
.
eq
(
User:
:
getDel
,
false
)
.
eq
(
User:
:
getBaseCode
,
baseCode
)
.
orderByDesc
(
User:
:
getCreateTime
);
List
<
User
>
list
=
userMapper
.
selectList
(
qw
);
return
new
PageInfo
<>(
list
);
}
/**
* @description: 将原发布人的全部岗位交接给指定新发布人,并写一条交接记录
* @author: wangmenglong
* @date; 2026/08/24
* @param: [originalUserId, originalUserName, newUserId, newUserName]
* @return: boolean
**/
@Override
public
boolean
handoverAll
(
String
originalUserId
,
String
originalUserName
,
String
newUserId
,
String
newUserName
)
{
if
(
StringUtils
.
isBlank
(
originalUserId
)
||
StringUtils
.
isBlank
(
newUserId
))
{
return
false
;
}
// 查询原发布人的全部未删除岗位
LambdaQueryWrapper
<
Recruit
>
qw
=
new
LambdaQueryWrapper
<>();
qw
.
eq
(
Recruit:
:
getUserId
,
originalUserId
)
.
eq
(
Recruit:
:
getDel
,
false
);
Long
count
=
recruitMapper
.
selectCount
(
qw
);
if
(
count
==
null
||
count
==
0
)
{
return
false
;
}
// 批量将原岗位改到新发布人名下
LambdaUpdateWrapper
<
Recruit
>
uw
=
new
LambdaUpdateWrapper
<>();
uw
.
eq
(
Recruit:
:
getUserId
,
originalUserId
)
.
eq
(
Recruit:
:
getDel
,
false
)
.
set
(
Recruit:
:
getUserId
,
newUserId
)
.
set
(
Recruit:
:
getUserName
,
newUserName
)
.
set
(
Recruit:
:
getUpdateTime
,
DateUtil
.
now
());
int
rows
=
recruitMapper
.
update
(
null
,
uw
);
if
(
rows
<=
0
)
{
return
false
;
}
// 写一条交接记录(操作人=当前登录人,类型=user 指定交接)
saveLog
(
originalUserId
,
originalUserName
,
newUserId
,
newUserName
,
"user"
,
UserUtils
.
getUserContext
());
return
true
;
}
/**
* @description: 将原发布人的岗位均分给库里所有正常用户(排除原账号本人),按轮询均分使每人数量尽量相等(相差不超过 1)。
* 整笔随机交接只写 1 条记录(type=random,新账号=实际分到的多个接收人逗号隔开)。
* 注意:该方法是纯数据操作,由 Controller 层用线程池异步调用,operator 由调用方(同步线程)传入,
* 方法内部不再从 UserUtils.getUserContext() 取,避免异步线程拿不到登录上下文而 NPE。
* @author: wangmenglong
* @date; 2026/08/24
* @param: [originalUserId, originalUserName, operator] operator 为操作人上下文(含 baseCode/操作人信息),由同步线程传入
* @return: boolean
**/
@Override
public
boolean
handoverRandom
(
String
originalUserId
,
String
originalUserName
,
UserContext
operator
)
{
if
(
StringUtils
.
isBlank
(
originalUserId
)
||
operator
==
null
)
{
return
false
;
}
String
baseCode
=
operator
.
getBaseCode
();
// 查询原发布人的全部未删除岗位
LambdaQueryWrapper
<
Recruit
>
qw
=
new
LambdaQueryWrapper
<>();
qw
.
eq
(
Recruit:
:
getUserId
,
originalUserId
)
.
eq
(
Recruit:
:
getDel
,
false
);
List
<
Recruit
>
recruits
=
recruitMapper
.
selectList
(
qw
);
if
(
ObjectUtil
.
isEmpty
(
recruits
))
{
return
false
;
}
// 取库里所有正常用户(同 base_code),并排除原账号本人作为接收人
List
<
User
>
candidates
=
queryNormalUsers
(
baseCode
).
stream
()
.
filter
(
u
->
!
u
.
getId
().
equals
(
originalUserId
))
.
collect
(
java
.
util
.
stream
.
Collectors
.
toList
());
if
(
ObjectUtil
.
isEmpty
(
candidates
))
{
return
false
;
}
// 均分:按轮询方式把岗位尽量平均分成 candidates.size() 份,每人数量相差不超过 1
for
(
int
i
=
0
;
i
<
recruits
.
size
();
i
++)
{
User
target
=
candidates
.
get
(
i
%
candidates
.
size
());
Recruit
recruit
=
recruits
.
get
(
i
);
LambdaUpdateWrapper
<
Recruit
>
uw
=
new
LambdaUpdateWrapper
<>();
uw
.
eq
(
Recruit:
:
getId
,
recruit
.
getId
())
.
set
(
Recruit:
:
getUserId
,
target
.
getId
())
.
set
(
Recruit:
:
getUserName
,
target
.
getName
())
.
set
(
Recruit:
:
getUpdateTime
,
DateUtil
.
now
());
recruitMapper
.
update
(
null
,
uw
);
}
// 整笔随机交接只写 1 条记录;岗位已分给库里多个正常用户,无单一新账号,故 new_user_id/new_user_name 不写
saveLog
(
originalUserId
,
originalUserName
,
null
,
null
,
"random"
,
operator
);
return
true
;
}
/**
* @description: 查询指定 base_code 下所有正常用户(state=normal、未删除),供随机均分选接收人用,不依赖登录上下文
* @author: wangmenglong
* @date; 2026/08/24
* @param: [baseCode]
* @return: java.util.List<data.user.User>
**/
private
List
<
User
>
queryNormalUsers
(
String
baseCode
)
{
LambdaQueryWrapper
<
User
>
qw
=
new
LambdaQueryWrapper
<>();
qw
.
eq
(
User:
:
getState
,
"normal"
)
.
eq
(
User:
:
getDel
,
false
)
.
eq
(
User:
:
getBaseCode
,
baseCode
)
.
orderByDesc
(
User:
:
getCreateTime
);
return
userMapper
.
selectList
(
qw
);
}
/**
* @description: 随机交接前的同步校验:原账号有未删除岗位,且库里除本人外有其它正常用户
* @author: wangmenglong
* @date; 2026/08/24
* @param: [originalUserId, operator]
* @return: boolean
**/
@Override
public
boolean
canRandomHandover
(
String
originalUserId
,
UserContext
operator
)
{
if
(
StringUtils
.
isBlank
(
originalUserId
)
||
operator
==
null
)
{
return
false
;
}
// 原账号是否存在未删除岗位
LambdaQueryWrapper
<
Recruit
>
qw
=
new
LambdaQueryWrapper
<>();
qw
.
eq
(
Recruit:
:
getUserId
,
originalUserId
).
eq
(
Recruit:
:
getDel
,
false
);
if
(
recruitMapper
.
selectCount
(
qw
)
==
null
||
recruitMapper
.
selectCount
(
qw
)
==
0
)
{
return
false
;
}
// 库里除本人外是否还有其它正常用户
List
<
User
>
candidates
=
queryNormalUsers
(
operator
.
getBaseCode
()).
stream
()
.
filter
(
u
->
!
u
.
getId
().
equals
(
originalUserId
))
.
collect
(
java
.
util
.
stream
.
Collectors
.
toList
());
return
!
ObjectUtil
.
isEmpty
(
candidates
);
}
/**
* @description: 查询岗位交接记录列表,支持按操作人/原账号/新账号名称模糊查询
* @author: wangmenglong
* @date; 2026/08/24
* @param: [pageNum, pageSize, handoverLog]
* @return: com.github.pagehelper.PageInfo<data.recruit.HandoverLog>
**/
@Override
public
PageInfo
<
HandoverLog
>
logList
(
int
pageNum
,
int
pageSize
,
HandoverLog
handoverLog
)
{
UserContext
userContext
=
UserUtils
.
getUserContext
();
String
baseCode
=
userContext
.
getBaseCode
();
PageHelper
.
startPage
(
pageNum
,
pageSize
);
LambdaQueryWrapper
<
HandoverLog
>
qw
=
new
LambdaQueryWrapper
<>();
qw
.
like
(
StringUtils
.
isNotBlank
(
handoverLog
.
getUserName
()),
HandoverLog:
:
getUserName
,
handoverLog
.
getUserName
())
.
like
(
StringUtils
.
isNotBlank
(
handoverLog
.
getOldUserName
()),
HandoverLog:
:
getOldUserName
,
handoverLog
.
getOldUserName
())
.
like
(
StringUtils
.
isNotBlank
(
handoverLog
.
getNewUserName
()),
HandoverLog:
:
getNewUserName
,
handoverLog
.
getNewUserName
())
.
eq
(
StringUtils
.
isNotBlank
(
handoverLog
.
getType
()),
HandoverLog:
:
getType
,
handoverLog
.
getType
())
.
eq
(
HandoverLog:
:
getDel
,
false
)
.
eq
(
HandoverLog:
:
getBaseCode
,
baseCode
)
.
orderByDesc
(
HandoverLog:
:
getCreateTime
);
List
<
HandoverLog
>
list
=
super
.
list
(
qw
);
return
new
PageInfo
<>(
list
);
}
/**
* @description: 保存一条岗位交接记录(只记大致:操作人、原账号、新账号、交接类型)
* @author: wangmenglong
* @date; 2026/08/24
* @param: [oldUserId, oldUserName, newUserId, newUserName, type, operator] operator 为操作人上下文,由同步线程传入,避免异步线程取不到
* @return: void
**/
private
void
saveLog
(
String
oldUserId
,
String
oldUserName
,
String
newUserId
,
String
newUserName
,
String
type
,
UserContext
operator
)
{
HandoverLog
log
=
new
HandoverLog
();
log
.
setId
(
snowFlakeFactory
.
nextId
());
log
.
setBaseCode
(
operator
.
getBaseCode
());
log
.
setUserId
(
operator
.
getUserId
());
log
.
setUserName
(
operator
.
getUsername
());
log
.
setOldUserId
(
oldUserId
);
log
.
setOldUserName
(
oldUserName
);
log
.
setNewUserId
(
newUserId
);
log
.
setNewUserName
(
newUserName
);
log
.
setType
(
type
);
log
.
setDel
(
false
);
log
.
setCreateTime
(
DateUtil
.
now
());
super
.
save
(
log
);
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论