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
cc784ee5
Commit
cc784ee5
authored
Jul 05, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改计算订单价格
parent
40953b95
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
2 deletions
+21
-2
ConsumerWalletServiceImpl.java
.../share/system/service/impl/ConsumerWalletServiceImpl.java
+4
-1
EquityMembersOrderServiceImpl.java
...re/system/service/impl/EquityMembersOrderServiceImpl.java
+2
-1
RechargeServiceImpl.java
...n/java/share/system/service/impl/RechargeServiceImpl.java
+2
-0
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+13
-0
No files found.
share-system/src/main/java/share/system/service/impl/ConsumerWalletServiceImpl.java
View file @
cc784ee5
...
...
@@ -159,13 +159,14 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
consumerWallet
.
setRemainingDuration
(
duration
);
BigDecimal
Integral
=
consumerWallet
.
getRemainingIntegral
().
add
(
rechargeConf
.
getGiveRatio
().
multiply
(
recharge
.
getRechargeAmount
()));
consumerWallet
.
setRemainingIntegral
(
Integral
);
int
i
=
baseMapper
.
updateConsumerWallet
(
consumerWallet
);
int
i
=
updateConsumerWallet
(
consumerWallet
);
BalanceLog
balanceLog
=
new
BalanceLog
();
balanceLog
.
setConsumerId
(
consumerWallet
.
getConsumerId
());
balanceLog
.
setCurrentBalance
(
consumerWallet
.
getBalance
());
balanceLog
.
setVariableAmount
(
recharge
.
getRechargeAmount
().
add
(
rechargeConf
.
getGiveAmount
()));
balanceLog
.
setOperationType
(
YesNoEnum
.
yes
.
getIndex
());
balanceLog
.
setOperationTime
(
new
Date
());
balanceLog
.
setCreateTime
(
new
Date
());
balanceLogService
.
save
(
balanceLog
);
DurationLog
durationLog
=
new
DurationLog
();
durationLog
.
setConsumerId
(
consumerWallet
.
getConsumerId
());
...
...
@@ -173,6 +174,7 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
durationLog
.
setVariableDuration
(
rechargeConf
.
getGiveDuration
());
durationLog
.
setOperationTime
(
new
Date
());
durationLog
.
setOperationType
(
YesNoEnum
.
yes
.
getIndex
());
durationLog
.
setCreateTime
(
new
Date
());
durationLogService
.
save
(
durationLog
);
IntegralLog
integralLog
=
new
IntegralLog
();
integralLog
.
setConsumerId
(
consumerWallet
.
getConsumerId
());
...
...
@@ -180,6 +182,7 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
integralLog
.
setVariableIntegral
(
rechargeConf
.
getGiveRatio
().
multiply
(
recharge
.
getRechargeAmount
()));
integralLog
.
setOperationTime
(
new
Date
());
integralLog
.
setOperationType
(
YesNoEnum
.
yes
.
getIndex
());
integralLog
.
setCreateTime
(
new
Date
());
integralLogService
.
save
(
integralLog
);
return
i
==
1
;
}
...
...
share-system/src/main/java/share/system/service/impl/EquityMembersOrderServiceImpl.java
View file @
cc784ee5
...
...
@@ -158,6 +158,7 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
newConsumerMember
.
setExpirationDate
(
DateUtils
.
addYears
(
DateUtils
.
parseDate
(
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD_HH_MM
,
new
Date
())),
equityMembersOrderConfig
.
getValidityPeriod
().
intValue
()));
newConsumerMember
.
setMembershipProgress
(
0L
);
newConsumerMember
.
setCreateTime
(
new
Date
());
consumerMemberService
.
save
(
newConsumerMember
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"consumerId"
,
String
.
valueOf
(
newConsumerMember
.
getConsumerId
()));
...
...
@@ -191,7 +192,7 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
JSONObject
json
=
new
JSONObject
(
map
);
redisUtil
.
set
(
ReceiptRdeisEnum
.
EQUITY_MEMBERS_TIME
.
getValue
()
+
equityMembersOrder
.
getConsumerId
(),
json
.
toString
());
}
equityMembersOrderMapper
.
updateEquityMembersOrder
(
equityMembersOrder
);
updateEquityMembersOrder
(
equityMembersOrder
);
}
private
EquityMembersOrder
generatEquityMembersOrder
(
CreateEquityMembersRequest
request
,
SConsumer
user
)
{
...
...
share-system/src/main/java/share/system/service/impl/RechargeServiceImpl.java
View file @
cc784ee5
...
...
@@ -154,6 +154,7 @@ public class RechargeServiceImpl extends ServiceImpl<RechargeMapper, Recharge> i
consumerMember
.
setMemberConfigId
(
memberConfig
.
getId
());
consumerMember
.
setMembershipProgress
(
0L
);
consumerMember
.
setExpirationDate
(
DateUtils
.
addYears
(
new
Date
(),
memberConfig
.
getValidityPeriod
().
intValue
()));
consumerMember
.
setCreateTime
(
new
Date
());
consumerMemberService
.
save
(
consumerMember
);
extracted
(
recharge
);
}
else
{
...
...
@@ -181,6 +182,7 @@ public class RechargeServiceImpl extends ServiceImpl<RechargeMapper, Recharge> i
consumerWallet
.
setRemainingDuration
(
rechargeConf
.
getGiveDuration
());
BigDecimal
Integral
=
recharge
.
getRechargeAmount
().
multiply
(
rechargeConf
.
getGiveRatio
());
consumerWallet
.
setRemainingIntegral
(
Integral
);
consumerWallet
.
setCreateTime
(
new
Date
());
consumerWalletService
.
addConsumerWallet
(
consumerWallet
);
}
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
cc784ee5
...
...
@@ -1953,6 +1953,19 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
priceResponse
.
setDiscountRatio
(
new
BigDecimal
(
0
));
}
}
}
else
{
if
(
ObjectUtil
.
isNotEmpty
(
consumerMember
))
{
MemberConfig
memberConfig
=
memberConfigService
.
getOne
(
new
LambdaQueryWrapper
<
MemberConfig
>().
eq
(
MemberConfig:
:
getId
,
consumerMember
.
getMemberConfigId
()));
//总金额乘以折扣比例除以100
priceResponse
.
setPayFee
(
priceResponse
.
getPayFee
().
multiply
(
memberConfig
.
getDiscountRatio
()).
divide
(
new
BigDecimal
(
100
)));
priceResponse
.
setDiscountFee
(
priceResponse
.
getTotalFee
().
subtract
(
priceResponse
.
getPayFee
()));
priceResponse
.
setCouponFee
(
priceResponse
.
getDiscountFee
());
if
(
ObjectUtil
.
isNotEmpty
(
priceResponse
.
getDiscountFee
())
&&
priceResponse
.
getTotalFee
().
compareTo
(
new
BigDecimal
(
0.00
))
>
0
)
{
priceResponse
.
setDiscountRatio
(
priceResponse
.
getDiscountFee
().
divide
(
priceResponse
.
getTotalFee
(),
2
,
RoundingMode
.
HALF_UP
).
multiply
(
new
BigDecimal
(
100
)));
}
else
{
priceResponse
.
setDiscountRatio
(
new
BigDecimal
(
0
));
}
}
}
}
else
{
// 判断优惠券是否可以使用
...
...
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