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
3d16661c
Commit
3d16661c
authored
Oct 18, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改订单价格计算中洗卡计算
parent
9aa4e690
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
84 additions
and
45 deletions
+84
-45
EquityMembersOrderService.java
.../java/share/system/service/EquityMembersOrderService.java
+5
-0
EquityMembersOrderServiceImpl.java
...re/system/service/impl/EquityMembersOrderServiceImpl.java
+15
-12
MonthlyCardOrderServiceImpl.java
...hare/system/service/impl/MonthlyCardOrderServiceImpl.java
+10
-4
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+44
-25
SecondaryCardOrderServiceImpl.java
...re/system/service/impl/SecondaryCardOrderServiceImpl.java
+10
-4
No files found.
share-system/src/main/java/share/system/service/EquityMembersOrderService.java
View file @
3d16661c
package
share
.
system
.
service
;
package
share
.
system
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
share.system.domain.ConsumerMember
;
import
share.system.domain.ConsumerWallet
;
import
share.system.domain.EquityMembersOrder
;
import
share.system.domain.EquityMembersOrder
;
import
share.system.domain.vo.EquityMembersOrderVo
;
import
share.system.domain.vo.EquityMembersOrderVo
;
import
share.system.request.CreateEquityMembersRequest
;
import
share.system.request.CreateEquityMembersRequest
;
import
share.system.response.EquityMembersResultResponse
;
import
share.system.response.EquityMembersResultResponse
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -74,4 +77,6 @@ public interface EquityMembersOrderService extends IService<EquityMembersOrder>
...
@@ -74,4 +77,6 @@ public interface EquityMembersOrderService extends IService<EquityMembersOrder>
EquityMembersOrder
getByEquityOrderNo
(
String
equityOrderNo
);
EquityMembersOrder
getByEquityOrderNo
(
String
equityOrderNo
);
EquityMembersOrderVo
queryEquityMembersOrderInfoByNo
(
String
equityOrderNo
);
EquityMembersOrderVo
queryEquityMembersOrderInfoByNo
(
String
equityOrderNo
);
void
addConsumerMember
(
Long
consumerId
,
BigDecimal
giftPoints
,
ConsumerMember
consumerMember
,
ConsumerWallet
consumerWallet
);
}
}
share-system/src/main/java/share/system/service/impl/EquityMembersOrderServiceImpl.java
View file @
3d16661c
...
@@ -216,11 +216,12 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
...
@@ -216,11 +216,12 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
consumerMember
.
setExpirationDate
(
DateUtils
.
addYears
(
DateUtils
.
parseDate
(
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD_HH_MM
,
consumerMember
.
getExpirationDate
())),
consumerMember
.
setExpirationDate
(
DateUtils
.
addYears
(
DateUtils
.
parseDate
(
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD_HH_MM
,
consumerMember
.
getExpirationDate
())),
Integer
.
parseInt
(
expirationDateEquityMembership
)));
Integer
.
parseInt
(
expirationDateEquityMembership
)));
extracted
(
equityMembersOrder
,
equityMembersOrderConfig
,
consumerMember
,
consumerWallet
,
memberConfigServiceOne
);
// extracted(equityMembersOrder, equityMembersOrderConfig, consumerMember, consumerWallet, memberConfigServiceOne);
addConsumerMember
(
equityMembersOrder
.
getConsumerId
(),
equityMembersOrderConfig
.
getGiftPoints
(),
consumerMember
,
consumerWallet
);
consumerMemberService
.
updateById
(
consumerMember
);
consumerMemberService
.
updateById
(
consumerMember
);
logger
.
debug
(
"权益会员原来的基础上增加有效期"
);
logger
.
debug
(
"权益会员原来的基础上增加有效期"
);
}
else
{
}
else
{
extracted
(
equityMembersOrder
,
equityMembersOrderConfig
,
consumerMember
,
consumerWallet
,
memberConfigServiceOne
);
addConsumerMember
(
equityMembersOrder
.
getConsumerId
(),
equityMembersOrderConfig
.
getGiftPoints
(),
consumerMember
,
consumerWallet
);
ConsumerMember
newConsumerMember
=
new
ConsumerMember
();
ConsumerMember
newConsumerMember
=
new
ConsumerMember
();
newConsumerMember
.
setConsumerId
(
equityMembersOrder
.
getConsumerId
());
newConsumerMember
.
setConsumerId
(
equityMembersOrder
.
getConsumerId
());
newConsumerMember
.
setIsRights
(
YesNoEnum
.
yes
.
getIndex
());
newConsumerMember
.
setIsRights
(
YesNoEnum
.
yes
.
getIndex
());
...
@@ -266,28 +267,30 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
...
@@ -266,28 +267,30 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
updateEquityMembersOrder
(
equityMembersOrder
);
updateEquityMembersOrder
(
equityMembersOrder
);
}
}
private
void
extracted
(
EquityMembersOrder
equityMembersOrder
,
EquityMembersOrderConfig
equityMembersOrderConfig
,
@Override
ConsumerMember
consumerMember
,
ConsumerWallet
consumerWallet
,
MemberConfig
memberConfigServiceOne
)
{
public
void
addConsumerMember
(
Long
consumerId
,
BigDecimal
giftPoints
,
ConsumerMember
consumerMember
,
ConsumerWallet
consumerWallet
)
{
String
expirationDateEquityMembership
=
sysConfigService
.
selectConfigByKey
(
"expirationDateEquityMembership"
);
String
expirationDateEquityMembership
=
sysConfigService
.
selectConfigByKey
(
"expirationDateEquityMembership"
);
if
(
equityMembersOrderConfig
.
getGiftPoints
()
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
if
(
giftPoints
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
MemberProgressLog
memberProgressLog
=
new
MemberProgressLog
();
MemberProgressLog
memberProgressLog
=
new
MemberProgressLog
();
memberProgressLog
.
setConsumerId
(
equityMembersOrder
.
getConsumerId
()
);
memberProgressLog
.
setConsumerId
(
consumerId
);
memberProgressLog
.
setCurrentProgress
(
consumerMember
.
getMembershipProgress
());
memberProgressLog
.
setCurrentProgress
(
consumerMember
.
getMembershipProgress
());
memberProgressLog
.
setVariableProgress
(
equityMembersOrderConfig
.
getGiftPoints
()
);
memberProgressLog
.
setVariableProgress
(
giftPoints
);
memberProgressLog
.
setOperationType
(
YesNoEnum
.
yes
.
getIndex
());
memberProgressLog
.
setOperationType
(
YesNoEnum
.
yes
.
getIndex
());
memberProgressLog
.
setOperationTime
(
new
Date
());
memberProgressLog
.
setOperationTime
(
new
Date
());
memberProgressLog
.
setCreateTime
(
new
Date
());
memberProgressLog
.
setCreateTime
(
new
Date
());
memberProgressLog
.
setExpirationTime
(
DateUtils
.
addYears
(
new
Date
(),
Integer
.
parseInt
(
expirationDateEquityMembership
)));
memberProgressLog
.
setExpirationTime
(
DateUtils
.
addYears
(
new
Date
(),
Integer
.
parseInt
(
expirationDateEquityMembership
)));
consumerMember
.
setMembershipProgress
(
giftPoints
.
add
(
consumerMember
.
getMembershipProgress
()));
IntegralLog
integralLog
=
new
IntegralLog
();
IntegralLog
integralLog
=
new
IntegralLog
();
integralLog
.
setConsumerId
(
equityMembersOrder
.
getConsumerId
());
integralLog
.
setConsumerId
(
consumerId
);
integralLog
.
setCurrentIntegral
(
consumerMember
.
getMembershipProgress
());
integralLog
.
setCurrentIntegral
(
consumerWallet
.
getRemainingIntegral
());
consumerWallet
.
setRemainingIntegral
(
consumerWallet
.
getRemainingIntegral
().
add
(
equityMembersOrderConfig
.
getGiftPoints
()));
integralLog
.
setVariableIntegral
(
giftPoints
);
integralLog
.
setVariableIntegral
(
equityMembersOrderConfig
.
getGiftPoints
());
integralLog
.
setOperationType
(
YesNoEnum
.
yes
.
getIndex
());
integralLog
.
setOperationType
(
YesNoEnum
.
yes
.
getIndex
());
integralLog
.
setOperationTime
(
new
Date
());
integralLog
.
setOperationTime
(
new
Date
());
integralLog
.
setCreateTime
(
new
Date
());
integralLog
.
setCreateTime
(
new
Date
());
consumerMember
.
setMembershipProgress
(
equityMembersOrderConfig
.
getGiftPoints
().
add
(
consumerMember
.
getMembershipProgress
()));
consumerWallet
.
setRemainingIntegral
(
consumerWallet
.
getRemainingIntegral
().
add
(
giftPoints
));
integralLogService
.
save
(
integralLog
);
integralLogService
.
save
(
integralLog
);
memberProgressLogService
.
save
(
memberProgressLog
);
memberProgressLogService
.
save
(
memberProgressLog
);
consumerWalletService
.
updateById
(
consumerWallet
);
consumerWalletService
.
updateById
(
consumerWallet
);
...
...
share-system/src/main/java/share/system/service/impl/MonthlyCardOrderServiceImpl.java
View file @
3d16661c
...
@@ -15,10 +15,7 @@ import share.common.exception.base.BaseException;
...
@@ -15,10 +15,7 @@ import share.common.exception.base.BaseException;
import
share.common.utils.BaseUtil
;
import
share.common.utils.BaseUtil
;
import
share.common.utils.DateUtils
;
import
share.common.utils.DateUtils
;
import
share.common.utils.bean.BeanUtils
;
import
share.common.utils.bean.BeanUtils
;
import
share.system.domain.ConsumerMonthlyCard
;
import
share.system.domain.*
;
import
share.system.domain.MonthlyCardConf
;
import
share.system.domain.MonthlyCardOrder
;
import
share.system.domain.SConsumer
;
import
share.system.domain.vo.FrontTokenComponent
;
import
share.system.domain.vo.FrontTokenComponent
;
import
share.system.domain.vo.MonthlyCardOrderVo
;
import
share.system.domain.vo.MonthlyCardOrderVo
;
import
share.system.mapper.MonthlyCardOrderMapper
;
import
share.system.mapper.MonthlyCardOrderMapper
;
...
@@ -51,6 +48,12 @@ public class MonthlyCardOrderServiceImpl extends ServiceImpl<MonthlyCardOrderMap
...
@@ -51,6 +48,12 @@ public class MonthlyCardOrderServiceImpl extends ServiceImpl<MonthlyCardOrderMap
private
ConsumerMonthlyCardService
consumerMonthlyCardService
;
private
ConsumerMonthlyCardService
consumerMonthlyCardService
;
@Autowired
@Autowired
private
RedisUtil
redisUtil
;
private
RedisUtil
redisUtil
;
@Autowired
private
ConsumerWalletService
consumerWalletService
;
@Autowired
private
ConsumerMemberService
consumerMemberService
;
@Autowired
private
EquityMembersOrderService
equityMembersOrderService
;
/**
/**
* 查询月卡订单
* 查询月卡订单
...
@@ -168,6 +171,8 @@ public class MonthlyCardOrderServiceImpl extends ServiceImpl<MonthlyCardOrderMap
...
@@ -168,6 +171,8 @@ public class MonthlyCardOrderServiceImpl extends ServiceImpl<MonthlyCardOrderMap
public
void
paymentSuccessful
(
MonthlyCardOrder
monthlyCardOrder
)
{
public
void
paymentSuccessful
(
MonthlyCardOrder
monthlyCardOrder
)
{
updateById
(
monthlyCardOrder
);
updateById
(
monthlyCardOrder
);
ConsumerMonthlyCard
consumerMonthlyCard
=
new
ConsumerMonthlyCard
();
ConsumerMonthlyCard
consumerMonthlyCard
=
new
ConsumerMonthlyCard
();
ConsumerWallet
consumerWallet
=
consumerWalletService
.
getOne
(
new
LambdaQueryWrapper
<
ConsumerWallet
>().
eq
(
ConsumerWallet:
:
getConsumerId
,
monthlyCardOrder
.
getConsumerId
()));
ConsumerMember
consumerMember
=
consumerMemberService
.
getOne
(
new
LambdaQueryWrapper
<
ConsumerMember
>().
eq
(
ConsumerMember:
:
getConsumerId
,
monthlyCardOrder
.
getConsumerId
()));
MonthlyCardConf
byId
=
monthlyCardConfService
.
getById
(
monthlyCardOrder
.
getMonthlyCardConfId
());
MonthlyCardConf
byId
=
monthlyCardConfService
.
getById
(
monthlyCardOrder
.
getMonthlyCardConfId
());
consumerMonthlyCard
.
setMonthlyCardConfId
(
byId
.
getId
());
consumerMonthlyCard
.
setMonthlyCardConfId
(
byId
.
getId
());
consumerMonthlyCard
.
setConsumerId
(
monthlyCardOrder
.
getConsumerId
());
consumerMonthlyCard
.
setConsumerId
(
monthlyCardOrder
.
getConsumerId
());
...
@@ -177,6 +182,7 @@ public class MonthlyCardOrderServiceImpl extends ServiceImpl<MonthlyCardOrderMap
...
@@ -177,6 +182,7 @@ public class MonthlyCardOrderServiceImpl extends ServiceImpl<MonthlyCardOrderMap
consumerMonthlyCard
.
setMonthlyCardDays
(
byId
.
getMonthlyCardDays
());
consumerMonthlyCard
.
setMonthlyCardDays
(
byId
.
getMonthlyCardDays
());
consumerMonthlyCard
.
setCreateTime
(
new
Date
());
consumerMonthlyCard
.
setCreateTime
(
new
Date
());
consumerMonthlyCardService
.
save
(
consumerMonthlyCard
);
consumerMonthlyCardService
.
save
(
consumerMonthlyCard
);
equityMembersOrderService
.
addConsumerMember
(
monthlyCardOrder
.
getConsumerId
(),
monthlyCardOrder
.
getMonthlyCardAmount
(),
consumerMember
,
consumerWallet
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"consumerMonthlyCardId"
,
String
.
valueOf
(
consumerMonthlyCard
.
getId
()));
map
.
put
(
"consumerMonthlyCardId"
,
String
.
valueOf
(
consumerMonthlyCard
.
getId
()));
map
.
put
(
"expirationTime"
,
consumerMonthlyCard
.
getExpirationDate
().
toString
());
map
.
put
(
"expirationTime"
,
consumerMonthlyCard
.
getExpirationDate
().
toString
());
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
3d16661c
...
@@ -1579,23 +1579,20 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -1579,23 +1579,20 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
monthlyCardLogService
.
save
(
monthlyCardLog
);
monthlyCardLogService
.
save
(
monthlyCardLog
);
}
}
// if (!ObjectUtils.isEmpty(sOrder.getSecondaryCardId()) && !ObjectUtils.isEmpty(sOrder.getPackId())) {
if
(!
ObjectUtils
.
isEmpty
(
sOrder
.
getSecondaryCardId
()))
{
// if (sOrder.getPackId().equals(consumerSecondaryCard.getPackId())) {
consumerSecondaryCard
.
setNumber
(
consumerSecondaryCard
.
getNumber
()
+
1
);
// consumerSecondaryCard.setNumber(consumerSecondaryCard.getNumber() + 1);
SecondaryCardLog
secondaryCardLog
=
new
SecondaryCardLog
();
// SecondaryCardLog secondaryCardLog = new SecondaryCardLog();
secondaryCardLog
.
setConsumerSecondaryCardId
(
sOrder
.
getSecondaryCardId
());
// secondaryCardLog.setConsumerSecondaryCardId(sOrder.getSecondaryCardId());
secondaryCardLog
.
setConsumerId
(
consumerSecondaryCard
.
getConsumerId
());
// secondaryCardLog.setConsumerId(consumerSecondaryCard.getConsumerId());
secondaryCardLog
.
setPhone
(
sOrder
.
getConsumerPhone
());
// secondaryCardLog.setPhone(sOrder.getConsumerPhone());
secondaryCardLog
.
setUsageCount
(
1L
);
// secondaryCardLog.setPackId(sOrder.getPackId());
secondaryCardLog
.
setResidueCount
(
Long
.
valueOf
(
consumerSecondaryCard
.
getNumber
()));
// secondaryCardLog.setUsageCount(1L);
secondaryCardLog
.
setOperationType
(
YesNoEnum
.
yes
.
getIndex
());
// secondaryCardLog.setResidueCount(Long.valueOf(consumerSecondaryCard.getNumber()));
secondaryCardLog
.
setOperationTime
(
new
Date
());
// secondaryCardLog.setOperationType(YesNoEnum.yes.getIndex());
secondaryCardLog
.
setCreateTime
(
new
Date
());
// secondaryCardLog.setOperationTime(new Date());
consumerSecondaryCardService
.
updateById
(
consumerSecondaryCard
);
// secondaryCardLog.setCreateTime(new Date());
secondaryCardLogService
.
save
(
secondaryCardLog
);
// consumerSecondaryCardService.updateById(consumerSecondaryCard);
}
// secondaryCardLogService.save(secondaryCardLog);
// }
// }
}
}
private
String
lockOrder
(
CreateOrderRequest
request
)
throws
BaseException
{
private
String
lockOrder
(
CreateOrderRequest
request
)
throws
BaseException
{
try
{
try
{
...
@@ -2669,8 +2666,12 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -2669,8 +2666,12 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
if
(
ObjectUtil
.
isNotEmpty
(
user
))
{
if
(
ObjectUtil
.
isNotEmpty
(
user
))
{
consumerWallet
=
consumerWalletService
.
getOne
(
new
LambdaQueryWrapper
<
ConsumerWallet
>().
eq
(
ConsumerWallet:
:
getConsumerId
,
user
.
getId
()));
consumerWallet
=
consumerWalletService
.
getOne
(
new
LambdaQueryWrapper
<
ConsumerWallet
>().
eq
(
ConsumerWallet:
:
getConsumerId
,
user
.
getId
()));
consumerMember
=
consumerMemberService
.
getOne
(
new
LambdaQueryWrapper
<
ConsumerMember
>().
eq
(
ConsumerMember:
:
getConsumerId
,
user
.
getId
()));
consumerMember
=
consumerMemberService
.
getOne
(
new
LambdaQueryWrapper
<
ConsumerMember
>().
eq
(
ConsumerMember:
:
getConsumerId
,
user
.
getId
()));
if
(
ObjectUtil
.
isNotEmpty
(
request
.
getMonthlyCardId
()))
{
consumerMonthlyCard
=
consumerMonthlyCardService
.
getOne
(
new
LambdaQueryWrapper
<
ConsumerMonthlyCard
>().
eq
(
ConsumerMonthlyCard:
:
getId
,
request
.
getMonthlyCardId
()));
consumerMonthlyCard
=
consumerMonthlyCardService
.
getOne
(
new
LambdaQueryWrapper
<
ConsumerMonthlyCard
>().
eq
(
ConsumerMonthlyCard:
:
getId
,
request
.
getMonthlyCardId
()));
}
if
(
ObjectUtil
.
isNotEmpty
(
request
.
getSecondaryCardId
()))
{
consumerSecondaryCard
=
consumerSecondaryCardService
.
getOne
(
new
LambdaQueryWrapper
<
ConsumerSecondaryCard
>().
eq
(
ConsumerSecondaryCard:
:
getId
,
request
.
getSecondaryCardId
()));
consumerSecondaryCard
=
consumerSecondaryCardService
.
getOne
(
new
LambdaQueryWrapper
<
ConsumerSecondaryCard
>().
eq
(
ConsumerSecondaryCard:
:
getId
,
request
.
getSecondaryCardId
()));
}
if
(
ObjectUtil
.
isNotEmpty
(
consumerMember
))
{
if
(
ObjectUtil
.
isNotEmpty
(
consumerMember
))
{
queryWrapper
.
eq
(
Activity:
:
getIsOpen
,
YesNoEnum
.
yes
.
getIndex
());
queryWrapper
.
eq
(
Activity:
:
getIsOpen
,
YesNoEnum
.
yes
.
getIndex
());
// if (consumerMember.getIsRights().equals(YesNoEnum.yes.getIndex())) {
// if (consumerMember.getIsRights().equals(YesNoEnum.yes.getIndex())) {
...
@@ -2711,6 +2712,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -2711,6 +2712,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
if
(
ObjectUtil
.
isNotEmpty
(
consumerMember
))
{
if
(
ObjectUtil
.
isNotEmpty
(
consumerMember
))
{
if
(
ObjectUtil
.
isNotEmpty
(
consumerMonthlyCard
))
{
if
(
ObjectUtil
.
isNotEmpty
(
consumerMonthlyCard
))
{
totalFee
=
getBigDecimal
(
consumerMonthlyCard
,
timeLong
,
priceResponse
,
totalPrice
,
room
,
consumerMember
);
totalFee
=
getBigDecimal
(
consumerMonthlyCard
,
timeLong
,
priceResponse
,
totalPrice
,
room
,
consumerMember
);
}
else
if
(
ObjectUtil
.
isNotEmpty
(
consumerSecondaryCard
))
{
totalFee
=
getBigDecimal
(
consumerSecondaryCard
,
priceResponse
,
payPrice
,
timeLong
,
room
);
}
else
{
}
else
{
queryWrapper
.
eq
(
Activity:
:
getLabelId
,
roomLabel
.
getLabelId
());
queryWrapper
.
eq
(
Activity:
:
getLabelId
,
roomLabel
.
getLabelId
());
activity
=
activityService
.
getOne
(
queryWrapper
);
activity
=
activityService
.
getOne
(
queryWrapper
);
...
@@ -2759,6 +2762,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -2759,6 +2762,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
if
(
ObjectUtil
.
isNotEmpty
(
consumerMember
))
{
if
(
ObjectUtil
.
isNotEmpty
(
consumerMember
))
{
if
(
ObjectUtil
.
isNotEmpty
(
consumerMonthlyCard
))
{
if
(
ObjectUtil
.
isNotEmpty
(
consumerMonthlyCard
))
{
totalFee
=
getBigDecimal
(
consumerMonthlyCard
,
timeLong
,
priceResponse
,
totalPrice
,
room
,
consumerMember
);
totalFee
=
getBigDecimal
(
consumerMonthlyCard
,
timeLong
,
priceResponse
,
totalPrice
,
room
,
consumerMember
);
}
else
if
(
ObjectUtil
.
isNotEmpty
(
consumerSecondaryCard
))
{
totalFee
=
getBigDecimal
(
consumerSecondaryCard
,
priceResponse
,
payPrice
,
timeLong
,
room
);
}
else
{
}
else
{
queryWrapper
.
eq
(
Activity:
:
getLabelId
,
roomLabel
.
getLabelId
());
queryWrapper
.
eq
(
Activity:
:
getLabelId
,
roomLabel
.
getLabelId
());
activity
=
activityService
.
getOne
(
queryWrapper
);
activity
=
activityService
.
getOne
(
queryWrapper
);
...
@@ -3156,14 +3161,28 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -3156,14 +3161,28 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
private
BigDecimal
getBigDecimal
(
ConsumerSecondaryCard
consumerSecondaryCard
,
private
BigDecimal
getBigDecimal
(
ConsumerSecondaryCard
consumerSecondaryCard
,
ComputedOrderPriceResponse
priceResponse
,
SPack
byId
,
BigDecimal
payPrice
)
{
ComputedOrderPriceResponse
priceResponse
,
SPack
byId
,
BigDecimal
payPrice
)
{
// if (consumerSecondaryCard.getPackId().equals(byId.getId())) {
if
(
Integer
.
getInteger
(
byId
.
getDuration
())
>
(
consumerSecondaryCard
.
getSingleDuration
())
&&
consumerSecondaryCard
.
getSingleAmount
().
compareTo
(
byId
.
getPrice
())
>
0
)
{
// priceResponse.setDiscount(BigDecimal.ZERO);
priceResponse
.
setDiscount
(
BigDecimal
.
ZERO
);
// priceResponse.setMemberDiscount(BigDecimal.ZERO);
priceResponse
.
setMemberDiscount
(
BigDecimal
.
ZERO
);
// priceResponse.setTotalFeeNow(BigDecimal.ZERO);
priceResponse
.
setTotalFeeNow
(
BigDecimal
.
ZERO
);
// priceResponse.setPayFee(BigDecimal.ZERO);
priceResponse
.
setPayFee
(
BigDecimal
.
ZERO
);
// priceResponse.setSecondaryCardId(consumerSecondaryCard.getId());
priceResponse
.
setSecondaryCardId
(
consumerSecondaryCard
.
getId
());
// payPrice = BigDecimal.ZERO;
payPrice
=
BigDecimal
.
ZERO
;
// }
}
return
payPrice
;
}
private
BigDecimal
getBigDecimal
(
ConsumerSecondaryCard
consumerSecondaryCard
,
ComputedOrderPriceResponse
priceResponse
,
BigDecimal
payPrice
,
BigDecimal
timeLong
,
SRoom
room
)
{
BigDecimal
bigDecimal
=
new
BigDecimal
(
consumerSecondaryCard
.
getSingleDuration
());
if
(
bigDecimal
.
compareTo
(
timeLong
)
==
0
&&
consumerSecondaryCard
.
getSingleAmount
().
compareTo
(
timeLong
.
multiply
(
room
.
getPrice
()))
>=
0
)
{
priceResponse
.
setDiscount
(
BigDecimal
.
ZERO
);
priceResponse
.
setMemberDiscount
(
BigDecimal
.
ZERO
);
priceResponse
.
setTotalFeeNow
(
BigDecimal
.
ZERO
);
priceResponse
.
setPayFee
(
BigDecimal
.
ZERO
);
priceResponse
.
setSecondaryCardId
(
consumerSecondaryCard
.
getId
());
payPrice
=
BigDecimal
.
ZERO
;
}
return
payPrice
;
return
payPrice
;
}
}
...
...
share-system/src/main/java/share/system/service/impl/SecondaryCardOrderServiceImpl.java
View file @
3d16661c
...
@@ -14,10 +14,7 @@ import share.common.exception.base.BaseException;
...
@@ -14,10 +14,7 @@ import share.common.exception.base.BaseException;
import
share.common.utils.BaseUtil
;
import
share.common.utils.BaseUtil
;
import
share.common.utils.DateUtils
;
import
share.common.utils.DateUtils
;
import
share.common.utils.bean.BeanUtils
;
import
share.common.utils.bean.BeanUtils
;
import
share.system.domain.ConsumerSecondaryCard
;
import
share.system.domain.*
;
import
share.system.domain.SConsumer
;
import
share.system.domain.SecondaryCardConf
;
import
share.system.domain.SecondaryCardOrder
;
import
share.system.domain.vo.FrontTokenComponent
;
import
share.system.domain.vo.FrontTokenComponent
;
import
share.system.domain.vo.SecondaryCardOrderVo
;
import
share.system.domain.vo.SecondaryCardOrderVo
;
import
share.system.mapper.SecondaryCardOrderMapper
;
import
share.system.mapper.SecondaryCardOrderMapper
;
...
@@ -50,6 +47,12 @@ public class SecondaryCardOrderServiceImpl extends ServiceImpl<SecondaryCardOrde
...
@@ -50,6 +47,12 @@ public class SecondaryCardOrderServiceImpl extends ServiceImpl<SecondaryCardOrde
private
ConsumerSecondaryCardService
consumerSecondaryCardService
;
private
ConsumerSecondaryCardService
consumerSecondaryCardService
;
@Autowired
@Autowired
private
RedisUtil
redisUtil
;
private
RedisUtil
redisUtil
;
@Autowired
private
ConsumerWalletService
consumerWalletService
;
@Autowired
private
ConsumerMemberService
consumerMemberService
;
@Autowired
private
EquityMembersOrderService
equityMembersOrderService
;
/**
/**
* 查询次卡购买记录
* 查询次卡购买记录
...
@@ -157,6 +160,8 @@ public class SecondaryCardOrderServiceImpl extends ServiceImpl<SecondaryCardOrde
...
@@ -157,6 +160,8 @@ public class SecondaryCardOrderServiceImpl extends ServiceImpl<SecondaryCardOrde
@Override
@Override
public
void
paymentSuccessful
(
SecondaryCardOrder
secondaryCardOrder
)
{
public
void
paymentSuccessful
(
SecondaryCardOrder
secondaryCardOrder
)
{
updateById
(
secondaryCardOrder
);
updateById
(
secondaryCardOrder
);
ConsumerWallet
consumerWallet
=
consumerWalletService
.
getOne
(
new
LambdaQueryWrapper
<
ConsumerWallet
>().
eq
(
ConsumerWallet:
:
getConsumerId
,
secondaryCardOrder
.
getConsumerId
()));
ConsumerMember
consumerMember
=
consumerMemberService
.
getOne
(
new
LambdaQueryWrapper
<
ConsumerMember
>().
eq
(
ConsumerMember:
:
getConsumerId
,
secondaryCardOrder
.
getConsumerId
()));
ConsumerSecondaryCard
consumerSecondaryCard
=
new
ConsumerSecondaryCard
();
ConsumerSecondaryCard
consumerSecondaryCard
=
new
ConsumerSecondaryCard
();
SecondaryCardConf
secondaryCardConf
=
secondaryCardConfService
.
getById
(
secondaryCardOrder
.
getSecondaryCardConfId
());
SecondaryCardConf
secondaryCardConf
=
secondaryCardConfService
.
getById
(
secondaryCardOrder
.
getSecondaryCardConfId
());
consumerSecondaryCard
.
setSecondaryCardConfId
(
secondaryCardOrder
.
getSecondaryCardConfId
());
consumerSecondaryCard
.
setSecondaryCardConfId
(
secondaryCardOrder
.
getSecondaryCardConfId
());
...
@@ -168,6 +173,7 @@ public class SecondaryCardOrderServiceImpl extends ServiceImpl<SecondaryCardOrde
...
@@ -168,6 +173,7 @@ public class SecondaryCardOrderServiceImpl extends ServiceImpl<SecondaryCardOrde
consumerSecondaryCard
.
setNumber
(
secondaryCardConf
.
getNumber
());
consumerSecondaryCard
.
setNumber
(
secondaryCardConf
.
getNumber
());
consumerSecondaryCard
.
setCreateTime
(
new
Date
());
consumerSecondaryCard
.
setCreateTime
(
new
Date
());
consumerSecondaryCardService
.
save
(
consumerSecondaryCard
);
consumerSecondaryCardService
.
save
(
consumerSecondaryCard
);
equityMembersOrderService
.
addConsumerMember
(
secondaryCardOrder
.
getConsumerId
(),
secondaryCardOrder
.
getSecondaryCardAmount
(),
consumerMember
,
consumerWallet
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"consumerSecondaryCardId"
,
String
.
valueOf
(
consumerSecondaryCard
.
getId
()));
map
.
put
(
"consumerSecondaryCardId"
,
String
.
valueOf
(
consumerSecondaryCard
.
getId
()));
map
.
put
(
"expirationTime"
,
consumerSecondaryCard
.
getExpirationDate
().
toString
());
map
.
put
(
"expirationTime"
,
consumerSecondaryCard
.
getExpirationDate
().
toString
());
...
...
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