Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-api-boot-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lanbaoming
jiedao-api-boot-master
Commits
31cd04db
Commit
31cd04db
authored
Jul 23, 2024
by
zhaobiyan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增会员编码字段,刷新历史数据
parent
868a5bf7
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
9 deletions
+33
-9
MemberCodeFlushTask.java
...dule/member/controller/admin/job/MemberCodeFlushTask.java
+26
-0
MemberUserController.java
...le/member/controller/admin/user/MemberUserController.java
+0
-9
MemberUserMapper.java
.../yudao/module/member/dal/mysql/user/MemberUserMapper.java
+2
-0
MemberUserServiceImpl.java
...dao/module/member/service/user/MemberUserServiceImpl.java
+2
-0
MemberUserMapper.xml
...-impl/src/main/resources/mapper/user/MemberUserMapper.xml
+3
-0
No files found.
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/admin/job/MemberCodeFlushTask.java
0 → 100644
View file @
31cd04db
package
cn
.
iocoder
.
yudao
.
module
.
member
.
controller
.
admin
.
job
;
import
cn.iocoder.yudao.framework.quartz.core.handler.JobHandler
;
import
cn.iocoder.yudao.module.member.service.user.MemberUserService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
/**
* 会员编号刷新任务
* @author zhaobiyan
*/
@Component
@Slf4j
public
class
MemberCodeFlushTask
implements
JobHandler
{
@Resource
private
MemberUserService
userService
;
@Override
public
String
execute
(
String
param
)
throws
Exception
{
userService
.
historyCodeFlush
();
return
""
;
}
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/admin/user/MemberUserController.java
View file @
31cd04db
...
...
@@ -459,13 +459,4 @@ public class MemberUserController {
}
return
success
(
null
);
}
@PutMapping
(
"/history/code/flush"
)
@ApiOperation
(
"历史会员编码刷新"
)
@PreAuthorize
(
"@ss.hasPermission('member:user:info')"
)
public
CommonResult
<
Boolean
>
historyCodeFlush
()
{
userService
.
historyCodeFlush
();
return
success
(
true
);
}
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/user/MemberUserMapper.java
View file @
31cd04db
...
...
@@ -177,4 +177,6 @@ public interface MemberUserMapper extends BaseMapperX<MemberUserDO> {
String
getCurrentMaxMemberCode
();
void
updateMemberCodeById
(
@Param
(
"code"
)
String
memberCode
,
@Param
(
"id"
)
Long
id
);
void
clearMemberCode
();
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java
View file @
31cd04db
...
...
@@ -548,6 +548,8 @@ public class MemberUserServiceImpl implements MemberUserService {
public
void
historyCodeFlush
()
{
Long
startUserId
=
0L
;
long
limit
=
500
;
memberUserMapper
.
clearMemberCode
();
redisHelper
.
delete
(
"memberCode:max:number"
);
while
(
true
)
{
List
<
MemberUserDO
>
result
=
this
.
getByCursor
(
startUserId
,
limit
);
if
(
CollectionUtils
.
isEmpty
(
result
))
{
...
...
yudao-module-member/yudao-module-member-impl/src/main/resources/mapper/user/MemberUserMapper.xml
View file @
31cd04db
...
...
@@ -91,4 +91,7 @@
<update
id=
"updateMemberCodeById"
>
update member_user set code = #{code} where id = #{id}
</update>
<update
id=
"clearMemberCode"
>
update member_user set code = ''
</update>
</mapper>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment