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
6e26c088
Commit
6e26c088
authored
Sep 12, 2024
by
YG8429
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改权益会员绑定逻辑。权益会员返佣逻辑
parent
a81e99d0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
80 deletions
+79
-80
RedisTask.java
share-quartz/src/main/java/share/quartz/task/RedisTask.java
+2
-2
CallbackServiceImpl.java
...n/java/share/system/service/impl/CallbackServiceImpl.java
+77
-78
No files found.
share-quartz/src/main/java/share/quartz/task/RedisTask.java
View file @
6e26c088
...
...
@@ -401,8 +401,8 @@ public class RedisTask {
newConsumerMemberQueryWrapper
.
eq
(
ConsumerMember:
:
getConsumerId
,
sharingActivities
.
getUid
());
ConsumerMember
newConsumerMember
=
consumerMemberService
.
getOne
(
newConsumerMemberQueryWrapper
);
//判断是否为权益会员和会员是否有效
if
(
"2"
.
equals
(
consumerMember
.
getMemberTyp
e
())
&&
new
Date
().
getTime
()
<
consumerMember
.
getExpirationDate
().
getTime
()
&&
"2"
.
equals
(
newConsumerMember
.
getMemberTyp
e
())
&&
new
Date
().
getTime
()
<
newConsumerMember
.
getExpirationDate
().
getTime
())
{
if
(
YesNoEnum
.
yes
.
getIndex
().
equals
(
consumerMember
.
getIsRecharg
e
())
&&
new
Date
().
getTime
()
<
consumerMember
.
getExpirationDate
().
getTime
()
&&
YesNoEnum
.
yes
.
getIndex
().
equals
(
newConsumerMember
.
getIsRecharg
e
())
&&
new
Date
().
getTime
()
<
newConsumerMember
.
getExpirationDate
().
getTime
())
{
Boolean
aBoolean
=
redisTemplate
.
hasKey
(
ReceiptRdeisEnum
.
EQUITY_MEMBERS_TIME
+
sharingActivities
.
getUid
().
toString
());
Boolean
newAboolean
=
redisTemplate
.
hasKey
(
ReceiptRdeisEnum
.
EQUITY_MEMBERS_TIME
+
sharingActivities
.
getNewUid
().
toString
());
if
(
aBoolean
&&
newAboolean
)
{
...
...
share-system/src/main/java/share/system/service/impl/CallbackServiceImpl.java
View file @
6e26c088
...
...
@@ -470,7 +470,7 @@ public class CallbackServiceImpl implements CallbackService {
wechatInfo
.
setTradeStateDesc
(
"支付成功"
);
wechatPayInfoService
.
updateById
(
wechatInfo
);
//新增权益金日志
addEquityFundLog
Recharge
(
recharge
.
getConsumerId
(),
addEquityFundLog
(
recharge
.
getConsumerId
(),
recharge
.
getRechargeAmount
(),
recharge
.
getOutTradeNo
(),
recharge
.
getTerminalTrace
(),
"0"
);
aFalse
=
Boolean
.
TRUE
;
}
catch
(
Exception
e
)
{
...
...
@@ -552,7 +552,7 @@ public class CallbackServiceImpl implements CallbackService {
equityPayInfo
.
setTradeStateDesc
(
"支付成功"
);
wechatPayInfoService
.
updateById
(
equityPayInfo
);
//新增权益金日志
addEquityFundLog
Rights
(
equityMembersOrder
.
getConsumerId
(),
addEquityFundLog
(
equityMembersOrder
.
getConsumerId
(),
equityMembersOrder
.
getPayPrice
(),
equityMembersOrder
.
getEquityOrderNo
(),
equityMembersOrder
.
getTerminalTrace
(),
"1"
);
aBoolean
=
Boolean
.
TRUE
;
}
catch
(
Exception
e
)
{
...
...
@@ -765,11 +765,10 @@ public class CallbackServiceImpl implements CallbackService {
* @param terminalTrace 终端流水号
* @param type 权益类型
*/
private
void
addEquityFundLog
Recharge
(
Long
consumerId
,
BigDecimal
payPrice
,
String
equityOrderNo
,
String
terminalTrace
,
String
type
)
{
private
void
addEquityFundLog
(
Long
consumerId
,
BigDecimal
payPrice
,
String
equityOrderNo
,
String
terminalTrace
,
String
type
)
{
//查询是否有上级
SharingActivities
sharingActivities
=
sharingActivitiesService
.
getOne
(
new
LambdaQueryWrapper
<
SharingActivities
>()
.
eq
(
SharingActivities:
:
getNewUid
,
consumerId
)
.
eq
(
SharingActivities:
:
getActivityType
,
"1"
)
.
eq
(
SharingActivities:
:
getIsDelete
,
YesNoEnum
.
no
.
getIndex
()));
if
(
ObjectUtil
.
isNotEmpty
(
sharingActivities
))
{
//查询会员用户类型
...
...
@@ -777,7 +776,7 @@ public class CallbackServiceImpl implements CallbackService {
consumerMemberLambdaQueryWrapper
.
eq
(
ConsumerMember:
:
getConsumerId
,
sharingActivities
.
getUid
());
ConsumerMember
consumerMember
=
consumerMemberService
.
getOne
(
consumerMemberLambdaQueryWrapper
);
//判断是否为权益会员和会员是否有效
if
(
"2"
.
equals
(
consumerMember
.
getMemberTyp
e
())
&&
new
Date
().
getTime
()
<
consumerMember
.
getExpirationDate
().
getTime
())
{
if
(
YesNoEnum
.
yes
.
getIndex
().
equals
(
consumerMember
.
getIsRecharg
e
())
&&
new
Date
().
getTime
()
<
consumerMember
.
getExpirationDate
().
getTime
())
{
Boolean
aBoolean
=
redisTemplate
.
hasKey
(
ReceiptRdeisEnum
.
EQUITY_MEMBERS_TIME
+
sharingActivities
.
getUid
().
toString
());
if
(
aBoolean
)
{
String
equityFund
=
sysConfigService
.
selectConfigByKey
(
"sys.equityFundLog.equityFund"
);
...
...
@@ -826,79 +825,79 @@ public class CallbackServiceImpl implements CallbackService {
}
}
}
/**
* 新增权益金日志
* @param consumerId 用户ID
* @param payPrice 消费金额
* @param equityOrderNo 订单编号
* @param terminalTrace 终端流水号
* @param type 权益类型
*/
private
void
addEquityFundLogRights
(
Long
consumerId
,
BigDecimal
payPrice
,
String
equityOrderNo
,
String
terminalTrace
,
String
type
)
{
//查询是否有上级
SharingActivities
sharingActivities
=
sharingActivitiesService
.
getOne
(
new
LambdaQueryWrapper
<
SharingActivities
>()
.
eq
(
SharingActivities:
:
getNewUid
,
consumerId
)
.
eq
(
SharingActivities:
:
getIsDelete
,
YesNoEnum
.
no
.
getIndex
()));
if
(
ObjectUtil
.
isNotEmpty
(
sharingActivities
))
{
//查询会员用户类型
LambdaQueryWrapper
<
ConsumerMember
>
consumerMemberWrapper
=
new
LambdaQueryWrapper
<>();
consumerMemberWrapper
.
eq
(
ConsumerMember:
:
getConsumerId
,
sharingActivities
.
getUid
());
ConsumerMember
consumerMember
=
consumerMemberService
.
getOne
(
consumerMemberWrapper
);
LambdaQueryWrapper
<
ConsumerMember
>
newConsumerMemberWrapper
=
new
LambdaQueryWrapper
<>();
newConsumerMemberWrapper
.
eq
(
ConsumerMember:
:
getConsumerId
,
sharingActivities
.
getUid
());
ConsumerMember
newConsumerMember
=
consumerMemberService
.
getOne
(
newConsumerMemberWrapper
);
//判断是否为权益会员和会员是否有效
if
(
"2"
.
equals
(
consumerMember
.
getMemberType
())
&&
new
Date
().
getTime
()
<
consumerMember
.
getExpirationDate
().
getTime
()
&&
"2"
.
equals
(
newConsumerMember
.
getMemberType
())
&&
new
Date
().
getTime
()
<
newConsumerMember
.
getExpirationDate
().
getTime
())
{
Boolean
aBoolean
=
redisTemplate
.
hasKey
(
ReceiptRdeisEnum
.
EQUITY_MEMBERS_TIME
+
sharingActivities
.
getUid
().
toString
());
Boolean
newAboolean
=
redisTemplate
.
hasKey
(
ReceiptRdeisEnum
.
EQUITY_MEMBERS_TIME
+
sharingActivities
.
getNewUid
().
toString
());
if
(
aBoolean
&&
newAboolean
)
{
String
equityFund
=
sysConfigService
.
selectConfigByKey
(
"sys.equityFundLog.equityFund"
);
//查询上级用户是否有钱包
ConsumerWallet
consumerWallet
=
consumerWalletService
.
getOne
(
new
LambdaQueryWrapper
<
ConsumerWallet
>()
.
eq
(
ConsumerWallet:
:
getConsumerId
,
sharingActivities
.
getUid
()));
if
(
ObjectUtil
.
isNotEmpty
(
consumerWallet
))
{
consumerWallet
.
setEquityFund
(
consumerWallet
.
getEquityFund
().
add
(
payPrice
.
multiply
(
new
BigDecimal
(
equityFund
))));
consumerWallet
.
setAccumulateEquityFund
(
consumerWallet
.
getAccumulateEquityFund
().
add
(
payPrice
.
multiply
(
new
BigDecimal
(
equityFund
))));
consumerWallet
.
setUpdateTime
(
DateUtils
.
getNowDate
());
consumerWalletService
.
updateConsumerWallet
(
consumerWallet
);
}
else
{
//新增钱包
ConsumerWallet
newConsumerWallet
=
new
ConsumerWallet
();
BigDecimal
defaultVlue
=
new
BigDecimal
(
0.0
);
newConsumerWallet
.
setConsumerId
(
sharingActivities
.
getUid
());
newConsumerWallet
.
setBalance
(
defaultVlue
);
newConsumerWallet
.
setRemainingIntegral
(
defaultVlue
);
newConsumerWallet
.
setRemainingDuration
(
defaultVlue
);
newConsumerWallet
.
setEquityFund
(
consumerWallet
.
getEquityFund
().
add
(
payPrice
.
multiply
(
new
BigDecimal
(
equityFund
).
setScale
(
2
,
RoundingMode
.
HALF_UP
))));
newConsumerWallet
.
setAccumulateEquityFund
(
consumerWallet
.
getAccumulateEquityFund
()
.
add
(
payPrice
.
multiply
(
new
BigDecimal
(
equityFund
).
setScale
(
2
,
RoundingMode
.
HALF_UP
))));
consumerWalletService
.
insertConsumerWallet
(
newConsumerWallet
);
}
//添加权益金日志记录
//下级用户
SConsumer
newConsumer
=
consumerService
.
getById
(
consumerId
);
//上级用户
SConsumer
consumer
=
consumerService
.
getById
(
sharingActivities
.
getUid
());
EquityFundLog
equityFundLog
=
new
EquityFundLog
();
equityFundLog
.
setEquityFund
(
payPrice
.
multiply
(
new
BigDecimal
(
equityFund
).
setScale
(
2
,
RoundingMode
.
HALF_UP
)));
equityFundLog
.
setEquityFundType
(
type
);
equityFundLog
.
setOutTradeNo
(
equityOrderNo
);
equityFundLog
.
setTerminalTrace
(
terminalTrace
);
equityFundLog
.
setUid
(
sharingActivities
.
getUid
());
equityFundLog
.
setNewUid
(
sharingActivities
.
getNewUid
());
equityFundLog
.
setPhone
(
consumer
.
getPhone
());
equityFundLog
.
setAccount
(
consumer
.
getAccount
());
equityFundLog
.
setNickName
(
consumer
.
getNickName
());
equityFundLog
.
setNewPhone
(
newConsumer
.
getPhone
());
equityFundLog
.
setNewAccount
(
newConsumer
.
getAccount
());
equityFundLog
.
setNewNickName
(
newConsumer
.
getNickName
());
equityFundLogService
.
insertEquityFundLog
(
equityFundLog
);
}
}
}
}
//
/**
//
* 新增权益金日志
//
* @param consumerId 用户ID
//
* @param payPrice 消费金额
//
* @param equityOrderNo 订单编号
//
* @param terminalTrace 终端流水号
//
* @param type 权益类型
//
*/
//
private void addEquityFundLogRights(Long consumerId, BigDecimal payPrice, String equityOrderNo, String terminalTrace, String type) {
//
//查询是否有上级
//
SharingActivities sharingActivities = sharingActivitiesService.getOne(new LambdaQueryWrapper<SharingActivities>()
//
.eq(SharingActivities::getNewUid, consumerId)
//
.eq(SharingActivities::getIsDelete, YesNoEnum.no.getIndex()));
//
if (ObjectUtil.isNotEmpty(sharingActivities)) {
//
//查询会员用户类型
//
LambdaQueryWrapper<ConsumerMember> consumerMemberWrapper = new LambdaQueryWrapper<>();
//
consumerMemberWrapper.eq(ConsumerMember::getConsumerId, sharingActivities.getUid());
//
ConsumerMember consumerMember = consumerMemberService.getOne(consumerMemberWrapper);
//
LambdaQueryWrapper<ConsumerMember> newConsumerMemberWrapper = new LambdaQueryWrapper<>();
//
newConsumerMemberWrapper.eq(ConsumerMember::getConsumerId, sharingActivities.getUid());
//
ConsumerMember newConsumerMember = consumerMemberService.getOne(newConsumerMemberWrapper);
//
//判断是否为权益会员和会员是否有效
//
if ("2".equals(consumerMember.getMemberType()) && new Date().getTime() < consumerMember.getExpirationDate().getTime()
//
&& "2".equals(newConsumerMember.getMemberType()) && new Date().getTime() < newConsumerMember.getExpirationDate().getTime()) {
//
Boolean aBoolean = redisTemplate.hasKey(ReceiptRdeisEnum.EQUITY_MEMBERS_TIME + sharingActivities.getUid().toString());
//
Boolean newAboolean = redisTemplate.hasKey(ReceiptRdeisEnum.EQUITY_MEMBERS_TIME + sharingActivities.getNewUid().toString());
//
if (aBoolean && newAboolean) {
//
String equityFund = sysConfigService.selectConfigByKey("sys.equityFundLog.equityFund");
//
//查询上级用户是否有钱包
//
ConsumerWallet consumerWallet = consumerWalletService.getOne(new LambdaQueryWrapper<ConsumerWallet>()
//
.eq(ConsumerWallet::getConsumerId, sharingActivities.getUid()));
//
if (ObjectUtil.isNotEmpty(consumerWallet)) {
//
consumerWallet.setEquityFund(consumerWallet.getEquityFund().add(payPrice.multiply(new BigDecimal(equityFund))));
//
consumerWallet.setAccumulateEquityFund(consumerWallet.getAccumulateEquityFund().
//
add(payPrice.multiply(new BigDecimal(equityFund))));
//
consumerWallet.setUpdateTime(DateUtils.getNowDate());
//
consumerWalletService.updateConsumerWallet(consumerWallet);
//
} else {
//
//新增钱包
//
ConsumerWallet newConsumerWallet = new ConsumerWallet();
//
BigDecimal defaultVlue = new BigDecimal(0.0);
//
newConsumerWallet.setConsumerId(sharingActivities.getUid());
//
newConsumerWallet.setBalance(defaultVlue);
//
newConsumerWallet.setRemainingIntegral(defaultVlue);
//
newConsumerWallet.setRemainingDuration(defaultVlue);
//
newConsumerWallet.setEquityFund(consumerWallet.getEquityFund().add(payPrice.multiply(new BigDecimal(equityFund).setScale(2, RoundingMode.HALF_UP))));
//
newConsumerWallet.setAccumulateEquityFund(consumerWallet.getAccumulateEquityFund()
//
.add(payPrice.multiply(new BigDecimal(equityFund).setScale(2, RoundingMode.HALF_UP))));
//
consumerWalletService.insertConsumerWallet(newConsumerWallet);
//
}
//
//添加权益金日志记录
//
//下级用户
//
SConsumer newConsumer = consumerService.getById(consumerId);
//
//上级用户
//
SConsumer consumer = consumerService.getById(sharingActivities.getUid());
//
EquityFundLog equityFundLog = new EquityFundLog();
//
equityFundLog.setEquityFund(payPrice.multiply(new BigDecimal(equityFund).setScale(2, RoundingMode.HALF_UP)));
//
equityFundLog.setEquityFundType(type);
//
equityFundLog.setOutTradeNo(equityOrderNo);
//
equityFundLog.setTerminalTrace(terminalTrace);
//
equityFundLog.setUid(sharingActivities.getUid());
//
equityFundLog.setNewUid(sharingActivities.getNewUid());
//
equityFundLog.setPhone(consumer.getPhone());
//
equityFundLog.setAccount(consumer.getAccount());
//
equityFundLog.setNickName(consumer.getNickName());
//
equityFundLog.setNewPhone(newConsumer.getPhone());
//
equityFundLog.setNewAccount(newConsumer.getAccount());
//
equityFundLog.setNewNickName(newConsumer.getNickName());
//
equityFundLogService.insertEquityFundLog(equityFundLog);
//
}
//
}
//
}
//
}
...
...
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