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
d091fad4
Commit
d091fad4
authored
Aug 13, 2024
by
wuwenlong
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
49963cde
0af5093a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
14 deletions
+45
-14
EquityMembersOrderServiceImpl.java
...re/system/service/impl/EquityMembersOrderServiceImpl.java
+12
-0
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+33
-14
No files found.
share-system/src/main/java/share/system/service/impl/EquityMembersOrderServiceImpl.java
View file @
d091fad4
...
...
@@ -52,6 +52,8 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
private
MemberConfigService
memberConfigService
;
@Autowired
private
RedisUtil
redisUtil
;
@Autowired
private
ConsumerWalletService
consumerWalletService
;
/**
* 查询权益会员订单
...
...
@@ -160,6 +162,7 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
@Override
public
void
paymentSuccessful
(
EquityMembersOrder
equityMembersOrder
)
{
ConsumerMember
consumerMember
=
consumerMemberService
.
getOne
(
new
LambdaQueryWrapper
<
ConsumerMember
>().
eq
(
ConsumerMember:
:
getConsumerId
,
equityMembersOrder
.
getConsumerId
()));
ConsumerWallet
consumerWallet
=
consumerWalletService
.
getOne
(
new
LambdaQueryWrapper
<
ConsumerWallet
>().
eq
(
ConsumerWallet:
:
getConsumerId
,
equityMembersOrder
.
getConsumerId
()));
EquityMembersOrderConfig
equityMembersOrderConfig
=
equityMembersOrderConfigService
.
selectEquityMembersOrderConfigById
(
equityMembersOrder
.
getEquityMembersConfigId
());
if
(
ObjectUtil
.
isEmpty
(
consumerMember
))
{
ConsumerMember
newConsumerMember
=
new
ConsumerMember
();
...
...
@@ -210,6 +213,15 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
JSONObject
json
=
new
JSONObject
(
map
);
redisUtil
.
set
(
ReceiptRdeisEnum
.
EQUITY_MEMBERS_TIME
.
getValue
()
+
equityMembersOrder
.
getConsumerId
(),
json
.
toString
());
}
if
(
ObjectUtil
.
isEmpty
(
consumerWallet
))
{
ConsumerWallet
consumerWalletOne
=
new
ConsumerWallet
();
consumerWalletOne
.
setConsumerId
(
equityMembersOrder
.
getConsumerId
());
consumerWalletOne
.
setBalance
(
BigDecimal
.
ZERO
);
consumerWalletOne
.
setRemainingDuration
(
BigDecimal
.
ZERO
);
consumerWalletOne
.
setRemainingIntegral
(
BigDecimal
.
ZERO
);
consumerWalletOne
.
setCreateTime
(
new
Date
());
consumerWalletService
.
save
(
consumerWalletOne
);
}
updateEquityMembersOrder
(
equityMembersOrder
);
}
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
d091fad4
...
...
@@ -1122,14 +1122,12 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
if
(
ObjectUtil
.
isNotEmpty
(
sOrder
.
getCouponId
()))
{
coupon
=
consumerCouponService
.
getById
(
sOrder
.
getCouponId
());
}
IntegralLog
integralLog
=
new
IntegralLog
();
integralLog
.
setConsumerId
(
sOrder
.
getConsumerId
());
integralLog
.
setCurrentIntegral
(
consumerWallet
.
getRemainingIntegral
());
BigDecimal
integral
;
BigDecimal
membershipProgress
;
BigDecimal
integral
=
BigDecimal
.
ZERO
;
BigDecimal
membershipProgress
=
BigDecimal
.
ZERO
;
if
(
ObjectUtil
.
isNotEmpty
(
coupon
)
&&
!
coupon
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
SELF
.
getCode
())
&&
coupon
.
getCouponType
().
equals
(
CouponTypeEnum
.
CASH
.
getCode
()))
{
if
(
ObjectUtil
.
isNotEmpty
(
consumerWallet
))
{
integral
=
consumerWallet
.
getRemainingIntegral
().
add
(
coupon
.
getCouponPayPrice
()).
add
(
sOrder
.
getBalance
());
}
membershipProgress
=
consumerMember
.
getMembershipProgress
().
add
(
sOrder
.
getBalance
())
.
add
(
coupon
.
getCouponPayPrice
());
if
(
consumerMember
.
getMemberType
().
equals
(
MemberTypeEnum
.
RIGHTS
.
getIndex
()))
{
...
...
@@ -1137,13 +1135,19 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
membershipProgress
=
membershipProgress
.
add
(
sOrder
.
getPayPrice
());
}
}
else
{
if
(
ObjectUtil
.
isNotEmpty
(
consumerWallet
))
{
integral
=
consumerWallet
.
getRemainingIntegral
().
add
(
sOrder
.
getBalance
());
}
membershipProgress
=
consumerMember
.
getMembershipProgress
().
add
(
sOrder
.
getBalance
());
if
(
consumerMember
.
getMemberType
().
equals
(
MemberTypeEnum
.
RIGHTS
.
getIndex
()))
{
integral
=
integral
.
add
(
sOrder
.
getPayPrice
());
membershipProgress
=
membershipProgress
.
add
(
sOrder
.
getPayPrice
());
}
}
if
(
ObjectUtil
.
isNotEmpty
(
consumerWallet
))
{
IntegralLog
integralLog
=
new
IntegralLog
();
integralLog
.
setConsumerId
(
sOrder
.
getConsumerId
());
integralLog
.
setCurrentIntegral
(
consumerWallet
.
getRemainingIntegral
());
integralLog
.
setVariableIntegral
(
integral
.
subtract
(
consumerWallet
.
getRemainingIntegral
()));
consumerWallet
.
setRemainingIntegral
(
integral
);
integralLog
.
setOperationType
(
YesNoEnum
.
yes
.
getIndex
());
...
...
@@ -1151,6 +1155,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
integralLog
.
setCreateTime
(
new
Date
());
integralLogService
.
save
(
integralLog
);
consumerWalletService
.
updateById
(
consumerWallet
);
}
MemberProgressLog
memberProgressLog
=
new
MemberProgressLog
();
memberProgressLog
.
setConsumerId
(
sOrder
.
getConsumerId
());
memberProgressLog
.
setCurrentProgress
(
consumerMember
.
getMembershipProgress
());
...
...
@@ -1271,14 +1276,16 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
if
(
ObjectUtil
.
isNotEmpty
(
sOrder
.
getCouponId
()))
{
coupon
=
consumerCouponService
.
getById
(
sOrder
.
getCouponId
());
}
IntegralLog
integralLog
=
new
IntegralLog
()
;
integralLog
.
setConsumerId
(
sOrder
.
getConsumerId
())
;
integralLog
.
setCurrentIntegral
(
consumerWallet
.
getRemainingIntegral
());
BigDecimal
integral
;
BigDecimal
membershipProgress
;
BigDecimal
integral
=
BigDecimal
.
ZERO
;
BigDecimal
membershipProgress
=
BigDecimal
.
ZERO
;
if
(
ObjectUtil
.
isNotEmpty
(
coupon
)
&&
!
coupon
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
SELF
.
getCode
())
&&
coupon
.
getCouponType
().
equals
(
CouponTypeEnum
.
CASH
.
getCode
()))
{
if
(
ObjectUtil
.
isNotEmpty
(
consumerWallet
))
{
integral
=
consumerWallet
.
getRemainingIntegral
()
.
subtract
(
sOrder
.
getBalance
()).
subtract
(
coupon
.
getCouponPayPrice
());
}
membershipProgress
=
consumerMember
.
getMembershipProgress
()
.
subtract
(
sOrder
.
getBalance
()).
subtract
(
coupon
.
getCouponPayPrice
());
if
(
consumerMember
.
getMemberType
().
equals
(
MemberTypeEnum
.
RIGHTS
.
getIndex
()))
{
...
...
@@ -1286,7 +1293,9 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
membershipProgress
=
membershipProgress
.
subtract
(
sOrder
.
getPayPrice
());
}
}
else
{
if
(
ObjectUtil
.
isNotEmpty
(
consumerWallet
))
{
integral
=
consumerWallet
.
getRemainingIntegral
().
subtract
(
sOrder
.
getBalance
());
}
membershipProgress
=
consumerMember
.
getMembershipProgress
().
subtract
(
sOrder
.
getBalance
());
if
(
consumerMember
.
getMemberType
().
equals
(
MemberTypeEnum
.
RIGHTS
.
getIndex
()))
{
integral
=
integral
.
subtract
(
sOrder
.
getPayPrice
());
...
...
@@ -1294,13 +1303,18 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
}
}
if
(
ObjectUtil
.
isNotEmpty
(
consumerWallet
))
{
IntegralLog
integralLog
=
new
IntegralLog
();
integralLog
.
setConsumerId
(
sOrder
.
getConsumerId
());
integralLog
.
setCurrentIntegral
(
consumerWallet
.
getRemainingIntegral
());
integralLog
.
setVariableIntegral
(
consumerWallet
.
getRemainingIntegral
().
subtract
(
integral
));
consumerWallet
.
setRemainingIntegral
(
integral
);
integralLog
.
setOperationType
(
YesNoEnum
.
no
.
getIndex
());
integralLog
.
setOperationTime
(
new
Date
());
integralLog
.
setCreateTime
(
new
Date
());
integralLogService
.
save
(
integralLog
);
consumerWallet
.
setRemainingIntegral
(
integral
);
consumerWalletService
.
updateById
(
consumerWallet
);
}
MemberProgressLog
memberProgressLog
=
new
MemberProgressLog
();
memberProgressLog
.
setConsumerId
(
sOrder
.
getConsumerId
());
memberProgressLog
.
setCurrentProgress
(
consumerMember
.
getMembershipProgress
());
...
...
@@ -2463,6 +2477,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
priceResponse
.
setMemberDiscount
(
BigDecimal
.
ZERO
);
priceResponse
.
setTotalFee
(
payPrice
);
priceResponse
.
setTotalFeeNow
(
payPrice
);
// priceResponse.setDiscount(BigDecimal.ZERO);
SConsumerCoupon
consumerCoupon
=
consumerCouponService
.
getById
(
request
.
getCouponId
());
computedCouponPrice
(
request
,
priceResponse
,
user
,
consumerCoupon
);
priceResponse
.
setDuration
(
new
BigDecimal
(
0
));
...
...
@@ -2475,6 +2490,9 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
BigDecimal
payFee
=
priceResponse
.
getPayFee
();
BigDecimal
divide
=
priceResponse
.
getPayFee
().
multiply
(
memberConfig
.
getDiscountRatio
()).
divide
(
new
BigDecimal
(
100
),
2
,
RoundingMode
.
HALF_UP
);
if
(
payFee
.
compareTo
(
divide
)
==
0
)
{
priceResponse
.
setDiscount
(
BigDecimal
.
ZERO
);
}
//总金额乘以折扣比例除以100
priceResponse
.
setPayFee
(
divide
);
priceResponse
.
setDiscountFee
(
priceResponse
.
getTotalFee
().
subtract
(
priceResponse
.
getPayFee
()));
...
...
@@ -2498,7 +2516,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
}
priceResponse
.
setPayFee
(
totalFee
);
}
if
(
ObjectUtil
.
isEmpty
(
consumerWallet
)
&&
ObjectUtil
.
is
Not
Empty
(
consumerMember
))
{
if
(
ObjectUtil
.
isEmpty
(
consumerWallet
)
&&
ObjectUtil
.
isEmpty
(
consumerMember
))
{
priceResponse
.
setTotalFeeNow
(
priceResponse
.
getPayFee
());
priceResponse
.
setMemberDiscount
(
priceResponse
.
getTotalFee
().
subtract
(
priceResponse
.
getPayFee
()));
}
...
...
@@ -2706,7 +2724,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
boolean
match1
=
executionTime
.
isMatch
(
ZonedDateTime
.
ofInstant
(
item
.
getPreEndDate
().
toInstant
(),
ZoneId
.
systemDefault
()));
if
(
match
&&
match1
&&
item
.
getDuration
().
compareTo
(
BigDecimal
.
ZERO
)
==
0
&&
(
item
.
getPayPrice
().
add
(
item
.
getBalance
())).
divide
(
item
.
getTotalPrice
(),
2
,
RoundingMode
.
HALF_UP
).
multiply
(
new
BigDecimal
(
100
)).
compareTo
(
activity
.
getDiscountRatio
())
==
0
&&
(
item
.
getPayPrice
().
add
(
item
.
getBalance
())).
divide
(
item
.
getTotalPrice
(),
2
,
RoundingMode
.
HALF_UP
)
.
multiply
(
new
BigDecimal
(
100
)).
compareTo
(
activity
.
getDiscountRatio
())
==
0
)
{
i
.
getAndIncrement
();
}
...
...
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