Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
pseer
gxpt_ht
Commits
2a2b97e0
Commit
2a2b97e0
authored
Aug 30, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
权益会员配置增加赠送积分
parent
117891fc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
1 deletions
+40
-1
EquityMembersOrderServiceImpl.java
...re/system/service/impl/EquityMembersOrderServiceImpl.java
+40
-1
No files found.
share-system/src/main/java/share/system/service/impl/EquityMembersOrderServiceImpl.java
View file @
2a2b97e0
...
...
@@ -54,6 +54,8 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
private
RedisUtil
redisUtil
;
@Autowired
private
ConsumerWalletService
consumerWalletService
;
@Autowired
private
IntegralLogService
integralLogService
;
/**
* 查询权益会员订单
...
...
@@ -176,10 +178,21 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
newConsumerMember
.
setMemberConfigId
(
memberConfig
.
getId
());
newConsumerMember
.
setExpirationDate
(
DateUtils
.
addYears
(
DateUtils
.
parseDate
(
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD_HH_MM
,
new
Date
())),
equityMembersOrderConfig
.
getValidityPeriod
().
intValue
()));
newConsumerMember
.
setMembershipProgress
(
BigDecimal
.
ZERO
);
newConsumerMember
.
setMembershipProgress
(
equityMembersOrderConfig
.
getGiftPoints
()
);
newConsumerMember
.
setCreateTime
(
new
Date
());
newConsumerMember
.
setIsRights
(
YesNoEnum
.
yes
.
getIndex
());
consumerMemberService
.
save
(
newConsumerMember
);
//增加积分日志
if
(
equityMembersOrderConfig
.
getGiftPoints
().
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
IntegralLog
integralLog
=
new
IntegralLog
();
integralLog
.
setConsumerId
(
equityMembersOrder
.
getConsumerId
());
integralLog
.
setCurrentIntegral
(
BigDecimal
.
ZERO
);
integralLog
.
setVariableIntegral
(
equityMembersOrderConfig
.
getGiftPoints
());
integralLog
.
setOperationType
(
YesNoEnum
.
yes
.
getIndex
());
integralLog
.
setOperationTime
(
new
Date
());
integralLog
.
setCreateTime
(
new
Date
());
integralLogService
.
save
(
integralLog
);
}
logger
.
debug
(
"新增权益会员"
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"consumerId"
,
String
.
valueOf
(
newConsumerMember
.
getConsumerId
()));
...
...
@@ -193,6 +206,7 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
//在原来的基础上增加有效期
consumerMember
.
setExpirationDate
(
DateUtils
.
addYears
(
DateUtils
.
parseDate
(
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD_HH_MM
,
consumerMember
.
getExpirationDate
())),
equityMembersOrderConfig
.
getValidityPeriod
().
intValue
()));
extracted
(
equityMembersOrder
,
equityMembersOrderConfig
,
consumerMember
);
consumerMemberService
.
updateConsumerMember
(
consumerMember
);
logger
.
debug
(
"权益会员原来的基础上增加有效期"
);
}
else
{
...
...
@@ -204,6 +218,7 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
.
eq
(
MemberConfig:
:
getMemberType
,
MemberTypeEnum
.
RIGHTS
.
getIndex
())).
getId
());
consumerMember
.
setExpirationDate
(
DateUtils
.
addYears
(
DateUtils
.
parseDate
(
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD_HH_MM
,
new
Date
())),
equityMembersOrderConfig
.
getValidityPeriod
().
intValue
()));
extracted
(
equityMembersOrder
,
equityMembersOrderConfig
,
consumerMember
);
consumerMemberService
.
updateConsumerMember
(
consumerMember
);
logger
.
debug
(
"修改会员类型为权益会员"
);
}
...
...
@@ -226,6 +241,30 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
updateEquityMembersOrder
(
equityMembersOrder
);
}
private
void
extracted
(
EquityMembersOrder
equityMembersOrder
,
EquityMembersOrderConfig
equityMembersOrderConfig
,
ConsumerMember
consumerMember
)
{
if
(
equityMembersOrderConfig
.
getGiftPoints
().
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
IntegralLog
integralLog
=
new
IntegralLog
();
integralLog
.
setConsumerId
(
equityMembersOrder
.
getConsumerId
());
integralLog
.
setCurrentIntegral
(
consumerMember
.
getMembershipProgress
());
integralLog
.
setVariableIntegral
(
equityMembersOrderConfig
.
getGiftPoints
().
add
(
consumerMember
.
getMembershipProgress
()));
consumerMember
.
setMembershipProgress
(
equityMembersOrderConfig
.
getGiftPoints
().
add
(
consumerMember
.
getMembershipProgress
()));
integralLog
.
setOperationType
(
YesNoEnum
.
yes
.
getIndex
());
integralLog
.
setOperationTime
(
new
Date
());
integralLog
.
setCreateTime
(
new
Date
());
integralLogService
.
save
(
integralLog
);
}
//查询当前会员类型和下一级的会员配置
MemberConfig
one
=
memberConfigService
.
getOne
(
new
LambdaQueryWrapper
<
MemberConfig
>()
.
eq
(
MemberConfig:
:
getMemberType
,
consumerMember
.
getMemberType
())
.
eq
(
MemberConfig:
:
getMembershipLevel
,
consumerMember
.
getMembershipLevel
()
+
1L
));
if
(
ObjectUtil
.
isNotEmpty
(
one
))
{
//判断是否升级
if
(
ObjectUtil
.
isNotEmpty
(
one
)
&&
consumerMember
.
getMembershipProgress
().
compareTo
(
BigDecimal
.
valueOf
(
one
.
getLimitRequirements
()))
>=
0
)
{
consumerMember
.
setMembershipLevel
(
consumerMember
.
getMembershipLevel
()
+
1L
);
consumerMember
.
setMemberConfigId
(
one
.
getId
());
}
}
}
@Override
public
Boolean
cancelPay
(
String
equityOrderNo
)
{
EquityMembersOrder
equityMembersOrder
=
getByEquityOrderNo
(
equityOrderNo
);
...
...
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