Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
向汉
/
uc-engine
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
f1e0e3b6
...
f1e0e3b6938e32713131845654c32c31a1dd3ada
authored
2022-08-18 09:31:15 +0800
by
xianghan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
1.修改首次兑换积分的任务类型
1 parent
4fb34343
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
31 deletions
member-service-impl/src/main/java/com/topdraw/business/module/task/template/constant/TaskEventType.java
member-service-impl/src/main/java/com/topdraw/business/process/service/impl/ExpOperationServiceImpl.java
member-service-impl/src/main/java/com/topdraw/business/process/service/impl/TaskOperationServiceImpl.java
member-service-impl/src/main/java/com/topdraw/business/process/service/impl/UserOperationServiceImpl.java
member-service-impl/src/main/java/com/topdraw/business/module/task/template/constant/TaskEventType.java
View file @
f1e0e3b
...
...
@@ -22,7 +22,7 @@ public interface TaskEventType {
int
PLAY
=
8
;
int
BINDING
=
10
;
int
POINTS_TRANS
=
11
;
int
POINTS_EXCHANGE_GOODS
=
30
;
int
POINTS_EXCHANGE_GOODS
=
14
;
int
SYSTEM_OPERATE
=
98
;
int
OHHER
=
99
;
...
...
member-service-impl/src/main/java/com/topdraw/business/process/service/impl/ExpOperationServiceImpl.java
View file @
f1e0e3b
...
...
@@ -111,19 +111,19 @@ public class ExpOperationServiceImpl implements ExpOperationService {
MemberLevelDTO
memberLevelDTO
=
this
.
memberLevelService
.
findByLevel
(
memberLevel
+
1
);
// 4.成长值比较,判断是否升级
Integer
level
=
this
.
compareExp
(
totalExp
,
memberLevelDTO
,
memberLevel
);
// 5.更新用户信息
Member
member
=
new
Member
();
member
.
setId
(
memberId
);
member
.
setCode
(
memberCode
);
member
.
setExp
(
totalExp
);
member
.
setLevel
(
level
);
member
.
setUpdateTime
(
TimestampUtil
.
now
());
this
.
memberOperationService
.
doUpdateMemberExpAndLevel
(
member
);
((
ExpOperationServiceImpl
)
AopContext
.
currentProxy
()).
asyncMemberExpAndLevel
(
member
);
if
(
level
>
memberLevel
)
{
log
.
info
(
"会员等级提升,更新会员等级 refreshMemberExpAndLevel#"
);
// 5.更新用户信息
Member
member
=
new
Member
();
member
.
setId
(
memberId
);
member
.
setCode
(
memberCode
);
member
.
setExp
(
totalExp
);
member
.
setLevel
(
level
);
member
.
setUpdateTime
(
TimestampUtil
.
now
());
this
.
memberOperationService
.
doUpdateMemberExpAndLevel
(
member
);
((
ExpOperationServiceImpl
)
AopContext
.
currentProxy
()).
asyncMemberExpAndLevel
(
member
);
MemberSimpleDTO
memberSimpleDTO
=
this
.
memberService
.
findSimpleById
(
memberId
);
if
(
Objects
.
nonNull
(
memberLevelDTO
.
getId
()))
{
memberSimpleDTO
.
setLevel
(
level
);
...
...
@@ -132,16 +132,15 @@ public class ExpOperationServiceImpl implements ExpOperationService {
}
}
}
private
Integer
compareExp
(
long
new
Exp
,
MemberLevelDTO
memberLevelDTO
,
Integer
oldMemberLevel
)
{
if
(
Objects
.
nonNull
(
memberLevelDTO
.
getId
()))
{
Long
nextLevelExp
=
memberLevelDTO
.
getExpValue
(
);
if
(
Objects
.
nonNull
(
nextLevelExp
)
&&
nextLevelExp
>
0
)
if
(
newExp
-
nextLevelExp
>=
0
)
{
return
memberLevelDTO
.
getLevel
();
}
private
Integer
compareExp
(
long
total
Exp
,
MemberLevelDTO
memberLevelDTO
,
Integer
oldMemberLevel
)
{
Long
nextLevelExp
=
memberLevelDTO
.
getExpValue
();
log
.
info
(
"当前会员经验值 ==>> {} || 下一级会员经验值 ==>> {}"
,
totalExp
,
nextLevelExp
);
if
(
Objects
.
nonNull
(
nextLevelExp
)
&&
nextLevelExp
>
0
)
{
if
(
totalExp
-
nextLevelExp
>=
0
)
{
return
memberLevelDTO
.
getLevel
();
}
}
return
oldMemberLevel
;
}
...
...
member-service-impl/src/main/java/com/topdraw/business/process/service/impl/TaskOperationServiceImpl.java
View file @
f1e0e3b
...
...
@@ -32,11 +32,11 @@ import com.topdraw.business.module.task.service.TaskService;
import
com.topdraw.business.module.task.template.service.TaskTemplateService
;
import
com.topdraw.business.process.domian.*
;
import
com.topdraw.business.process.service.UserOperationService
;
import
com.topdraw.common.ResultInfo
;
import
com.topdraw.business.LocalConstants
;
import
com.topdraw.business.module.rights.constant.RightTypeConstants
;
import
com.topdraw.business.module.task.template.constant.TaskEventType
;
import
com.topdraw.business.RedisKeyConstants
;
import
com.topdraw.common.ResultInfo
;
import
com.topdraw.mq.module.mq.DataSyncMsg
;
import
com.topdraw.util.*
;
import
com.topdraw.utils.RedisUtils
;
...
...
@@ -100,7 +100,6 @@ public class TaskOperationServiceImpl implements TaskOperationService {
private
static
final
Integer
POINTS_MIN
=
1
;
@Override
// @CacheEvict(cacheNames = RedisKeyConstants.cacheTaskByEvent, key = "#task.event")
public
TaskDTO
createTask
(
Task
task
)
{
Long
taskTemplateId
=
task
.
getTaskTemplateId
();
TaskTemplateDTO
taskTemplateDTO
=
this
.
taskTemplateService
.
findById
(
taskTemplateId
);
...
...
@@ -115,7 +114,6 @@ public class TaskOperationServiceImpl implements TaskOperationService {
}
@Override
// @CacheEvict(cacheNames = RedisKeyConstants.cacheTaskByEventAndMemberLevelAndVip, key = "#task.event")
public
TaskDTO
updateTask
(
Task
task
)
{
Long
taskTemplateId
=
task
.
getTaskTemplateId
();
TaskTemplateDTO
taskTemplateDTO
=
this
.
taskTemplateService
.
findById
(
taskTemplateId
);
...
...
member-service-impl/src/main/java/com/topdraw/business/process/service/impl/UserOperationServiceImpl.java
View file @
f1e0e3b
...
...
@@ -937,6 +937,13 @@ public class UserOperationServiceImpl implements UserOperationService {
// 同步至iptv
((
UserOperationServiceImpl
)
AopContext
.
currentProxy
()).
asyncUserTvChangeMainAccount
(
userTvDTO
);
UserTvSimpleDTO
userTvSimpleDTO
=
this
.
userTvService
.
findSimpleByPlatformAccount
(
platformAccount
);
if
(
Objects
.
nonNull
(
userTvSimpleDTO
.
getPlatformAccount
()))
{
userTvSimpleDTO
.
setPriorityMemberCode
(
memberCode
);
JSONObject
hashMap
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
userTvSimpleDTO
),
JSONObject
.
class
);
this
.
redisUtils
.
set
(
RedisKeyConstants
.
cacheVisUserByPlatformAccount
+
"::"
+
platformAccount
,
hashMap
);
}
return
true
;
}
...
...
@@ -991,7 +998,12 @@ public class UserOperationServiceImpl implements UserOperationService {
log
.
info
(
"大屏账号置空主会员的结果,userTvDTO ==>> {}"
,
_userTvDTO
);
((
UserOperationServiceImpl
)
AopContext
.
currentProxy
()).
asyncUnbind
(
new
MemberAndUserTvDTO
(
memberDTO
,
_userTvDTO
));
this
.
updateUserTvSimplePriorityMemberCodeRedis
(
platformAccount
,
""
);
UserTvSimpleDTO
userTvSimpleDTO
=
this
.
userTvService
.
findSimpleByPlatformAccount
(
platformAccount
);
if
(
Objects
.
nonNull
(
userTvSimpleDTO
.
getPlatformAccount
()))
{
userTvSimpleDTO
.
setPriorityMemberCode
(
""
);
JSONObject
hashMap
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
userTvSimpleDTO
),
JSONObject
.
class
);
this
.
redisUtils
.
set
(
RedisKeyConstants
.
cacheVisUserByPlatformAccount
+
"::"
+
platformAccount
,
hashMap
);
}
}
else
{
...
...
@@ -1006,7 +1018,13 @@ public class UserOperationServiceImpl implements UserOperationService {
_userTvDTO
.
setPriorityMemberCode
(
bindMemberCode
);
log
.
info
(
"大屏账号置空主会员的结果,userTvDTO ==>> {}"
,
userTvDTO
);
((
UserOperationServiceImpl
)
AopContext
.
currentProxy
()).
asyncUnbind
(
new
MemberAndUserTvDTO
(
memberDTO
,
_userTvDTO
));
this
.
updateUserTvSimplePriorityMemberCodeRedis
(
platformAccount
,
bindMemberCode
);
UserTvSimpleDTO
userTvSimpleDTO
=
this
.
userTvService
.
findSimpleByPlatformAccount
(
platformAccount
);
if
(
Objects
.
nonNull
(
userTvSimpleDTO
.
getPlatformAccount
()))
{
userTvSimpleDTO
.
setPriorityMemberCode
(
bindMemberCode
);
JSONObject
hashMap
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
userTvSimpleDTO
),
JSONObject
.
class
);
this
.
redisUtils
.
set
(
RedisKeyConstants
.
cacheVisUserByPlatformAccount
+
"::"
+
platformAccount
,
hashMap
);
}
}
return
true
;
...
...
@@ -1289,7 +1307,12 @@ public class UserOperationServiceImpl implements UserOperationService {
((
UserOperationServiceImpl
)
AopContext
.
currentProxy
())
.
asyncMinaBind
(
new
MemberAndUserTvDTO
(
memberDTO
,
userTvDTO
));
this
.
updateUserTvSimplePriorityMemberCodeRedis
(
platformAccount
,
memberDTO
.
getCode
());
UserTvSimpleDTO
userTvSimpleDTO
=
this
.
userTvService
.
findSimpleByPlatformAccount
(
platformAccount
);
if
(
Objects
.
nonNull
(
userTvSimpleDTO
.
getPlatformAccount
())
&&
StringUtils
.
isBlank
(
userTvSimpleDTO
.
getPriorityMemberCode
()))
{
userTvSimpleDTO
.
setPriorityMemberCode
(
priorityMemberCode
);
JSONObject
hashMap
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
userTvSimpleDTO
),
JSONObject
.
class
);
this
.
redisUtils
.
set
(
RedisKeyConstants
.
cacheVisUserByPlatformAccount
+
"::"
+
platformAccount
,
hashMap
);
}
return
true
;
}
...
...
@@ -1364,7 +1387,12 @@ public class UserOperationServiceImpl implements UserOperationService {
// 同步至大屏侧
((
UserOperationServiceImpl
)
AopContext
.
currentProxy
()).
asyncMinaBind
(
new
MemberAndUserTvDTO
(
memberDTO
,
userTvDTO
));
this
.
updateUserTvSimplePriorityMemberCodeRedis
(
platformAccount
,
memberDTO
.
getCode
());
UserTvSimpleDTO
userTvSimpleDTO
=
this
.
userTvService
.
findSimpleByPlatformAccount
(
platformAccount
);
if
(
Objects
.
nonNull
(
userTvSimpleDTO
.
getPlatformAccount
())
&&
StringUtils
.
isBlank
(
userTvSimpleDTO
.
getPriorityMemberCode
()))
{
userTvSimpleDTO
.
setPriorityMemberCode
(
priorityMemberCode
);
JSONObject
hashMap
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
userTvSimpleDTO
),
JSONObject
.
class
);
this
.
redisUtils
.
set
(
RedisKeyConstants
.
cacheVisUserByPlatformAccount
+
"::"
+
platformAccount
,
hashMap
);
}
return
userTvDTO
;
}
...
...
@@ -1373,7 +1401,7 @@ public class UserOperationServiceImpl implements UserOperationService {
private
void
updateUserTvSimplePriorityMemberCodeRedis
(
String
platformAccount
,
String
priorityMemberCode
){
// 修改缓存中MemberSimple的大屏主账号信息,因为执行任务之前会去检查主会员d
UserTvSimpleDTO
userTvSimpleDTO
=
this
.
userTvService
.
findSimpleByPlatformAccount
(
platformAccount
);
if
(
Objects
.
nonNull
(
userTvSimpleDTO
))
{
if
(
Objects
.
nonNull
(
userTvSimpleDTO
.
getPlatformAccount
())
&&
StringUtils
.
isBlank
(
userTvSimpleDTO
.
getPriorityMemberCode
()
))
{
userTvSimpleDTO
.
setPriorityMemberCode
(
priorityMemberCode
);
JSONObject
hashMap
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
userTvSimpleDTO
),
JSONObject
.
class
);
this
.
redisUtils
.
set
(
RedisKeyConstants
.
cacheVisUserByPlatformAccount
+
"::"
+
platformAccount
,
hashMap
);
...
...
@@ -1593,7 +1621,12 @@ public class UserOperationServiceImpl implements UserOperationService {
log
.
info
(
"同步绑定信息至大屏侧, 参数 ==>> {}"
,
new
MemberAndUserTvDTO
(
memberDTO
,
_userTvDTO
));
((
UserOperationServiceImpl
)
AopContext
.
currentProxy
()).
asyncUnbind
(
new
MemberAndUserTvDTO
(
memberDTO
,
_userTvDTO
));
this
.
updateUserTvSimplePriorityMemberCodeRedis
(
userTvDTO
.
getPlatformAccount
(),
userTv
.
getPriorityMemberCode
());
UserTvSimpleDTO
userTvSimpleDTO
=
this
.
userTvService
.
findSimpleByPlatformAccount
(
userTvDTO
.
getPlatformAccount
());
if
(
Objects
.
nonNull
(
userTvSimpleDTO
.
getPlatformAccount
()))
{
userTvSimpleDTO
.
setPriorityMemberCode
(
userTv
.
getPriorityMemberCode
());
JSONObject
hashMap
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
userTvSimpleDTO
),
JSONObject
.
class
);
this
.
redisUtils
.
set
(
RedisKeyConstants
.
cacheVisUserByPlatformAccount
+
"::"
+
userTvDTO
.
getPlatformAccount
(),
hashMap
);
}
}
}
else
{
...
...
@@ -1609,7 +1642,13 @@ public class UserOperationServiceImpl implements UserOperationService {
_userTvDTO
.
setPriorityMemberCode
(
null
);
log
.
info
(
"同步绑定信息至大屏侧, 参数 ==>> {}"
,
new
MemberAndUserTvDTO
(
memberDTO
,
_userTvDTO
));
((
UserOperationServiceImpl
)
AopContext
.
currentProxy
()).
asyncUnbind
(
new
MemberAndUserTvDTO
(
memberDTO
,
_userTvDTO
));
this
.
updateUserTvSimplePriorityMemberCodeRedis
(
userTvDTO
.
getPlatformAccount
(),
""
);
UserTvSimpleDTO
userTvSimpleDTO
=
this
.
userTvService
.
findSimpleByPlatformAccount
(
userTvDTO
.
getPlatformAccount
());
if
(
Objects
.
nonNull
(
userTvSimpleDTO
.
getPlatformAccount
()))
{
userTvSimpleDTO
.
setPriorityMemberCode
(
""
);
JSONObject
hashMap
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
userTvSimpleDTO
),
JSONObject
.
class
);
this
.
redisUtils
.
set
(
RedisKeyConstants
.
cacheVisUserByPlatformAccount
+
"::"
+
userTvDTO
.
getPlatformAccount
(),
hashMap
);
}
}
return
ResultInfo
.
success
(
"解绑成功"
);
...
...
Please
register
or
sign in
to post a comment