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
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
86 additions
and
47 deletions
+86
-47
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
+46
-27
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
;
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.vo.EquityMembersOrderVo
;
import
share.system.request.CreateEquityMembersRequest
;
import
share.system.response.EquityMembersResultResponse
;
import
java.math.BigDecimal
;
import
java.util.List
;
/**
...
...
@@ -74,4 +77,6 @@ public interface EquityMembersOrderService extends IService<EquityMembersOrder>
EquityMembersOrder
getByEquityOrderNo
(
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
consumerMember
.
setExpirationDate
(
DateUtils
.
addYears
(
DateUtils
.
parseDate
(
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD_HH_MM
,
consumerMember
.
getExpirationDate
())),
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
);
logger
.
debug
(
"权益会员原来的基础上增加有效期"
);
}
else
{
extracted
(
equityMembersOrder
,
equityMembersOrderConfig
,
consumerMember
,
consumerWallet
,
memberConfigServiceOne
);
addConsumerMember
(
equityMembersOrder
.
getConsumerId
(),
equityMembersOrderConfig
.
getGiftPoints
(),
consumerMember
,
consumerWallet
);
ConsumerMember
newConsumerMember
=
new
ConsumerMember
();
newConsumerMember
.
setConsumerId
(
equityMembersOrder
.
getConsumerId
());
newConsumerMember
.
setIsRights
(
YesNoEnum
.
yes
.
getIndex
());
...
...
@@ -266,28 +267,30 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
updateEquityMembersOrder
(
equityMembersOrder
);
}
private
void
extracted
(
EquityMembersOrder
equityMembersOrder
,
EquityMembersOrderConfig
equityMembersOrderConfig
,
ConsumerMember
consumerMember
,
ConsumerWallet
consumerWallet
,
MemberConfig
memberConfigServiceOne
)
{
@Override
public
void
addConsumerMember
(
Long
consumerId
,
BigDecimal
giftPoints
,
ConsumerMember
consumerMember
,
ConsumerWallet
consumerWallet
)
{
String
expirationDateEquityMembership
=
sysConfigService
.
selectConfigByKey
(
"expirationDateEquityMembership"
);
if
(
equityMembersOrderConfig
.
getGiftPoints
()
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
if
(
giftPoints
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
MemberProgressLog
memberProgressLog
=
new
MemberProgressLog
();
memberProgressLog
.
setConsumerId
(
equityMembersOrder
.
getConsumerId
()
);
memberProgressLog
.
setConsumerId
(
consumerId
);
memberProgressLog
.
setCurrentProgress
(
consumerMember
.
getMembershipProgress
());
memberProgressLog
.
setVariableProgress
(
equityMembersOrderConfig
.
getGiftPoints
()
);
memberProgressLog
.
setVariableProgress
(
giftPoints
);
memberProgressLog
.
setOperationType
(
YesNoEnum
.
yes
.
getIndex
());
memberProgressLog
.
setOperationTime
(
new
Date
());
memberProgressLog
.
setCreateTime
(
new
Date
());
memberProgressLog
.
setExpirationTime
(
DateUtils
.
addYears
(
new
Date
(),
Integer
.
parseInt
(
expirationDateEquityMembership
)));
consumerMember
.
setMembershipProgress
(
giftPoints
.
add
(
consumerMember
.
getMembershipProgress
()));
IntegralLog
integralLog
=
new
IntegralLog
();
integralLog
.
setConsumerId
(
equityMembersOrder
.
getConsumerId
());
integralLog
.
setCurrentIntegral
(
consumerMember
.
getMembershipProgress
());
consumerWallet
.
setRemainingIntegral
(
consumerWallet
.
getRemainingIntegral
().
add
(
equityMembersOrderConfig
.
getGiftPoints
()));
integralLog
.
setVariableIntegral
(
equityMembersOrderConfig
.
getGiftPoints
());
integralLog
.
setConsumerId
(
consumerId
);
integralLog
.
setCurrentIntegral
(
consumerWallet
.
getRemainingIntegral
());
integralLog
.
setVariableIntegral
(
giftPoints
);
integralLog
.
setOperationType
(
YesNoEnum
.
yes
.
getIndex
());
integralLog
.
setOperationTime
(
new
Date
());
integralLog
.
setCreateTime
(
new
Date
());
consumerMember
.
setMembershipProgress
(
equityMembersOrderConfig
.
getGiftPoints
().
add
(
consumerMember
.
getMembershipProgress
()));
consumerWallet
.
setRemainingIntegral
(
consumerWallet
.
getRemainingIntegral
().
add
(
giftPoints
));
integralLogService
.
save
(
integralLog
);
memberProgressLogService
.
save
(
memberProgressLog
);
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;
import
share.common.utils.BaseUtil
;
import
share.common.utils.DateUtils
;
import
share.common.utils.bean.BeanUtils
;
import
share.system.domain.ConsumerMonthlyCard
;
import
share.system.domain.MonthlyCardConf
;
import
share.system.domain.MonthlyCardOrder
;
import
share.system.domain.SConsumer
;
import
share.system.domain.*
;
import
share.system.domain.vo.FrontTokenComponent
;
import
share.system.domain.vo.MonthlyCardOrderVo
;
import
share.system.mapper.MonthlyCardOrderMapper
;
...
...
@@ -51,6 +48,12 @@ public class MonthlyCardOrderServiceImpl extends ServiceImpl<MonthlyCardOrderMap
private
ConsumerMonthlyCardService
consumerMonthlyCardService
;
@Autowired
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
public
void
paymentSuccessful
(
MonthlyCardOrder
monthlyCardOrder
)
{
updateById
(
monthlyCardOrder
);
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
());
consumerMonthlyCard
.
setMonthlyCardConfId
(
byId
.
getId
());
consumerMonthlyCard
.
setConsumerId
(
monthlyCardOrder
.
getConsumerId
());
...
...
@@ -177,6 +182,7 @@ public class MonthlyCardOrderServiceImpl extends ServiceImpl<MonthlyCardOrderMap
consumerMonthlyCard
.
setMonthlyCardDays
(
byId
.
getMonthlyCardDays
());
consumerMonthlyCard
.
setCreateTime
(
new
Date
());
consumerMonthlyCardService
.
save
(
consumerMonthlyCard
);
equityMembersOrderService
.
addConsumerMember
(
monthlyCardOrder
.
getConsumerId
(),
monthlyCardOrder
.
getMonthlyCardAmount
(),
consumerMember
,
consumerWallet
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"consumerMonthlyCardId"
,
String
.
valueOf
(
consumerMonthlyCard
.
getId
()));
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
monthlyCardLogService
.
save
(
monthlyCardLog
);
}
// if (!ObjectUtils.isEmpty(sOrder.getSecondaryCardId()) && !ObjectUtils.isEmpty(sOrder.getPackId())) {
// if (sOrder.getPackId().equals(consumerSecondaryCard.getPackId())) {
// consumerSecondaryCard.setNumber(consumerSecondaryCard.getNumber() + 1);
// SecondaryCardLog secondaryCardLog = new SecondaryCardLog();
// secondaryCardLog.setConsumerSecondaryCardId(sOrder.getSecondaryCardId());
// secondaryCardLog.setConsumerId(consumerSecondaryCard.getConsumerId());
// secondaryCardLog.setPhone(sOrder.getConsumerPhone());
// secondaryCardLog.setPackId(sOrder.getPackId());
// secondaryCardLog.setUsageCount(1L);
// secondaryCardLog.setResidueCount(Long.valueOf(consumerSecondaryCard.getNumber()));
// secondaryCardLog.setOperationType(YesNoEnum.yes.getIndex());
// secondaryCardLog.setOperationTime(new Date());
// secondaryCardLog.setCreateTime(new Date());
// consumerSecondaryCardService.updateById(consumerSecondaryCard);
// secondaryCardLogService.save(secondaryCardLog);
// }
// }
if
(!
ObjectUtils
.
isEmpty
(
sOrder
.
getSecondaryCardId
()))
{
consumerSecondaryCard
.
setNumber
(
consumerSecondaryCard
.
getNumber
()
+
1
);
SecondaryCardLog
secondaryCardLog
=
new
SecondaryCardLog
();
secondaryCardLog
.
setConsumerSecondaryCardId
(
sOrder
.
getSecondaryCardId
());
secondaryCardLog
.
setConsumerId
(
consumerSecondaryCard
.
getConsumerId
());
secondaryCardLog
.
setPhone
(
sOrder
.
getConsumerPhone
());
secondaryCardLog
.
setUsageCount
(
1L
);
secondaryCardLog
.
setResidueCount
(
Long
.
valueOf
(
consumerSecondaryCard
.
getNumber
()));
secondaryCardLog
.
setOperationType
(
YesNoEnum
.
yes
.
getIndex
());
secondaryCardLog
.
setOperationTime
(
new
Date
());
secondaryCardLog
.
setCreateTime
(
new
Date
());
consumerSecondaryCardService
.
updateById
(
consumerSecondaryCard
);
secondaryCardLogService
.
save
(
secondaryCardLog
);
}
}
private
String
lockOrder
(
CreateOrderRequest
request
)
throws
BaseException
{
try
{
...
...
@@ -2669,8 +2666,12 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
if
(
ObjectUtil
.
isNotEmpty
(
user
))
{
consumerWallet
=
consumerWalletService
.
getOne
(
new
LambdaQueryWrapper
<
ConsumerWallet
>().
eq
(
ConsumerWallet:
:
getConsumerId
,
user
.
getId
()));
consumerMember
=
consumerMemberService
.
getOne
(
new
LambdaQueryWrapper
<
ConsumerMember
>().
eq
(
ConsumerMember:
:
getConsumerId
,
user
.
getId
()));
consumerMonthlyCard
=
consumerMonthlyCardService
.
getOne
(
new
LambdaQueryWrapper
<
ConsumerMonthlyCard
>().
eq
(
ConsumerMonthlyCard:
:
getId
,
request
.
getMonthlyCardId
()));
consumerSecondaryCard
=
consumerSecondaryCardService
.
getOne
(
new
LambdaQueryWrapper
<
ConsumerSecondaryCard
>().
eq
(
ConsumerSecondaryCard:
:
getId
,
request
.
getSecondaryCardId
()));
if
(
ObjectUtil
.
isNotEmpty
(
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
()));
}
if
(
ObjectUtil
.
isNotEmpty
(
consumerMember
))
{
queryWrapper
.
eq
(
Activity:
:
getIsOpen
,
YesNoEnum
.
yes
.
getIndex
());
// if (consumerMember.getIsRights().equals(YesNoEnum.yes.getIndex())) {
...
...
@@ -2711,6 +2712,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
if
(
ObjectUtil
.
isNotEmpty
(
consumerMember
))
{
if
(
ObjectUtil
.
isNotEmpty
(
consumerMonthlyCard
))
{
totalFee
=
getBigDecimal
(
consumerMonthlyCard
,
timeLong
,
priceResponse
,
totalPrice
,
room
,
consumerMember
);
}
else
if
(
ObjectUtil
.
isNotEmpty
(
consumerSecondaryCard
))
{
totalFee
=
getBigDecimal
(
consumerSecondaryCard
,
priceResponse
,
payPrice
,
timeLong
,
room
);
}
else
{
queryWrapper
.
eq
(
Activity:
:
getLabelId
,
roomLabel
.
getLabelId
());
activity
=
activityService
.
getOne
(
queryWrapper
);
...
...
@@ -2759,6 +2762,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
if
(
ObjectUtil
.
isNotEmpty
(
consumerMember
))
{
if
(
ObjectUtil
.
isNotEmpty
(
consumerMonthlyCard
))
{
totalFee
=
getBigDecimal
(
consumerMonthlyCard
,
timeLong
,
priceResponse
,
totalPrice
,
room
,
consumerMember
);
}
else
if
(
ObjectUtil
.
isNotEmpty
(
consumerSecondaryCard
))
{
totalFee
=
getBigDecimal
(
consumerSecondaryCard
,
priceResponse
,
payPrice
,
timeLong
,
room
);
}
else
{
queryWrapper
.
eq
(
Activity:
:
getLabelId
,
roomLabel
.
getLabelId
());
activity
=
activityService
.
getOne
(
queryWrapper
);
...
...
@@ -3156,14 +3161,28 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
private
BigDecimal
getBigDecimal
(
ConsumerSecondaryCard
consumerSecondaryCard
,
ComputedOrderPriceResponse
priceResponse
,
SPack
byId
,
BigDecimal
payPrice
)
{
// if (consumerSecondaryCard.getPackId().equals(byId.getId())) {
// priceResponse.setDiscount(BigDecimal.ZERO);
// priceResponse.setMemberDiscount(BigDecimal.ZERO);
// priceResponse.setTotalFeeNow(BigDecimal.ZERO);
// priceResponse.setPayFee(BigDecimal.ZERO);
// priceResponse.setSecondaryCardId(consumerSecondaryCard.getId());
// payPrice = BigDecimal.ZERO;
// }
if
(
Integer
.
getInteger
(
byId
.
getDuration
())
>
(
consumerSecondaryCard
.
getSingleDuration
())
&&
consumerSecondaryCard
.
getSingleAmount
().
compareTo
(
byId
.
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
;
}
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
;
}
...
...
share-system/src/main/java/share/system/service/impl/SecondaryCardOrderServiceImpl.java
View file @
3d16661c
...
...
@@ -14,10 +14,7 @@ import share.common.exception.base.BaseException;
import
share.common.utils.BaseUtil
;
import
share.common.utils.DateUtils
;
import
share.common.utils.bean.BeanUtils
;
import
share.system.domain.ConsumerSecondaryCard
;
import
share.system.domain.SConsumer
;
import
share.system.domain.SecondaryCardConf
;
import
share.system.domain.SecondaryCardOrder
;
import
share.system.domain.*
;
import
share.system.domain.vo.FrontTokenComponent
;
import
share.system.domain.vo.SecondaryCardOrderVo
;
import
share.system.mapper.SecondaryCardOrderMapper
;
...
...
@@ -50,6 +47,12 @@ public class SecondaryCardOrderServiceImpl extends ServiceImpl<SecondaryCardOrde
private
ConsumerSecondaryCardService
consumerSecondaryCardService
;
@Autowired
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
@Override
public
void
paymentSuccessful
(
SecondaryCardOrder
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
();
SecondaryCardConf
secondaryCardConf
=
secondaryCardConfService
.
getById
(
secondaryCardOrder
.
getSecondaryCardConfId
());
consumerSecondaryCard
.
setSecondaryCardConfId
(
secondaryCardOrder
.
getSecondaryCardConfId
());
...
...
@@ -168,6 +173,7 @@ public class SecondaryCardOrderServiceImpl extends ServiceImpl<SecondaryCardOrde
consumerSecondaryCard
.
setNumber
(
secondaryCardConf
.
getNumber
());
consumerSecondaryCard
.
setCreateTime
(
new
Date
());
consumerSecondaryCardService
.
save
(
consumerSecondaryCard
);
equityMembersOrderService
.
addConsumerMember
(
secondaryCardOrder
.
getConsumerId
(),
secondaryCardOrder
.
getSecondaryCardAmount
(),
consumerMember
,
consumerWallet
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"consumerSecondaryCardId"
,
String
.
valueOf
(
consumerSecondaryCard
.
getId
()));
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