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
af415ead
Commit
af415ead
authored
Sep 05, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改累计消费进行积分
parent
e22fd60d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
ConsumerWalletServiceImpl.java
.../share/system/service/impl/ConsumerWalletServiceImpl.java
+10
-5
No files found.
share-system/src/main/java/share/system/service/impl/ConsumerWalletServiceImpl.java
View file @
af415ead
...
...
@@ -160,7 +160,6 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
durationLogService
.
save
(
durationLog
);
}
if
(
consumerWallet
.
getRemainingIntegral
().
compareTo
(
new
BigDecimal
(
0
))
>
0
)
{
accumulatedConsumptionStatistics
(
consumerWallet
,
one
,
memberConfig
);
IntegralLog
integralLog
=
new
IntegralLog
();
integralLog
.
setConsumerId
(
consumerWallet
.
getConsumerId
());
integralLog
.
setCurrentIntegral
(
new
BigDecimal
(
0
));
...
...
@@ -186,6 +185,8 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
one
.
setMemberConfigId
(
newOne
.
getId
());
consumerMemberService
.
updateConsumerMember
(
one
);
}
logger
.
debug
(
"统计累计积分"
);
accumulatedConsumptionStatistics
(
consumerWallet
,
one
,
memberConfig
);
}
return
i
==
1
;
}
...
...
@@ -278,6 +279,7 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
private
void
accumulatedConsumptionStatistics
(
ConsumerWallet
consumerWallet
,
ConsumerMember
one
,
MemberConfig
memberConfig
)
{
logger
.
debug
(
"统计累计积分开始"
);
final
BigDecimal
[]
consumption
=
{
BigDecimal
.
ZERO
};
//查询含当天23:59:59以及往前90天的00:00:00整天的订单
Calendar
calendar
=
Calendar
.
getInstance
();
...
...
@@ -303,6 +305,7 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
.
in
(
SOrder:
:
getStatus
,
OrderStatusEnum
.
getValidOrderStatus
())
.
eq
(
SOrder:
:
getIsDelete
,
YesNoEnum
.
no
.
getIndex
()));
if
(
CollectionUtil
.
isEmpty
(
orderList
))
{
logger
.
debug
(
"订单为为空"
);
return
;
}
Map
<
Long
,
SCoupon
>
sCouponMap
=
sCouponService
.
list
().
stream
().
collect
(
Collectors
.
toMap
(
SCoupon:
:
getId
,
Function
.
identity
()));
...
...
@@ -317,23 +320,25 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
consumption
[
0
]
=
consumption
[
0
].
add
(
sCouponMap
.
get
(
item
.
getCouponId
()).
getCouponPayPrice
());
}
});
logger
.
debug
(
"优惠券购买金额:"
+
consumption
[
0
]);
if
(
one
.
getMemberType
().
equals
(
MemberTypeEnum
.
RIGHTS
.
getIndex
()))
{
//orderList累加payPrice
consumption
[
0
]
=
consumption
[
0
].
add
(
orderList
.
stream
().
map
(
SOrder:
:
getPayPrice
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
));
logger
.
debug
(
"订单实付金额:"
+
consumption
[
0
]);
}
if
(
consumption
[
0
].
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
IntegralLog
integralLog
=
new
IntegralLog
();
integralLog
.
setConsumerId
(
consumerWallet
.
getConsumerId
());
integralLog
.
setCurrentIntegral
(
new
BigDecimal
(
0
));
integralLog
.
setVariableIntegral
(
consum
erWallet
.
getRemainingIntegral
()
);
integralLog
.
setCurrentIntegral
(
consumerWallet
.
getRemainingIntegral
(
));
integralLog
.
setVariableIntegral
(
consum
ption
[
0
]
);
integralLog
.
setOperationTime
(
new
Date
());
integralLog
.
setCreateTime
(
new
Date
());
integralLog
.
setOperationType
(
YesNoEnum
.
yes
.
getIndex
());
integralLogService
.
save
(
integralLog
);
MemberProgressLog
memberProgressLog
=
new
MemberProgressLog
();
memberProgressLog
.
setConsumerId
(
consumerWallet
.
getConsumerId
());
memberProgressLog
.
setCurrentProgress
(
new
BigDecimal
(
0
));
memberProgressLog
.
setVariableProgress
(
consum
erWallet
.
getRemainingIntegral
()
);
memberProgressLog
.
setCurrentProgress
(
one
.
getMembershipProgress
(
));
memberProgressLog
.
setVariableProgress
(
consum
ption
[
0
]
);
memberProgressLog
.
setOperationTime
(
new
Date
());
memberProgressLog
.
setOperationType
(
YesNoEnum
.
yes
.
getIndex
());
memberProgressLog
.
setCreateTime
(
new
Date
());
...
...
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