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
80eaf171
Commit
80eaf171
authored
Aug 01, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改计算订单金额
parent
ea136a42
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
1 deletions
+36
-1
MemberConfigVo.java
.../src/main/java/share/system/domain/vo/MemberConfigVo.java
+4
-0
SConsumerServiceImpl.java
.../java/share/system/service/impl/SConsumerServiceImpl.java
+23
-0
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+9
-1
No files found.
share-system/src/main/java/share/system/domain/vo/MemberConfigVo.java
View file @
80eaf171
...
...
@@ -3,6 +3,8 @@ package share.system.domain.vo;
import
lombok.Data
;
import
share.system.domain.MemberConfig
;
import
java.math.BigDecimal
;
@Data
public
class
MemberConfigVo
extends
MemberConfig
{
//下一级的额度要求
...
...
@@ -11,4 +13,6 @@ public class MemberConfigVo extends MemberConfig {
private
Long
nextMembershipLevel
;
//下一级的会员名称
private
String
nextMembershipName
;
//下一周多少积分清零
private
BigDecimal
nextWeekClearIntegral
;
}
share-system/src/main/java/share/system/service/impl/SConsumerServiceImpl.java
View file @
80eaf171
package
share
.
system
.
service
.
impl
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.ListUtil
;
import
cn.hutool.core.util.ArrayUtil
;
import
cn.hutool.core.util.ObjectUtil
;
...
...
@@ -15,9 +16,11 @@ import share.common.constant.SmsConstants;
import
share.common.enums.ConsumerCouponUseStatusEnum
;
import
share.common.enums.PositionEnum
;
import
share.common.enums.RoleTypeEnum
;
import
share.common.enums.YesNoEnum
;
import
share.common.exception.base.BaseException
;
import
share.common.utils.BaseUtil
;
import
share.common.utils.DateUtil
;
import
share.common.utils.DateUtils
;
import
share.system.domain.*
;
import
share.system.domain.vo.FrontTokenComponent
;
import
share.system.domain.vo.MemberConfigVo
;
...
...
@@ -27,6 +30,8 @@ import share.system.mapper.SStoreConsumerMapper;
import
share.system.request.RegisterThirdSConsumerRequest
;
import
share.system.service.*
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -53,6 +58,8 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
private
ConsumerMemberService
consumerMemberService
;
@Autowired
private
MemberConfigService
memberConfigService
;
@Autowired
private
MemberProgressLogService
memberProgressLogService
;
/**
* 查询会员用户
...
...
@@ -206,6 +213,22 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
memberConfigVo
.
setNextMembershipLevel
(
nexMemberConfig
.
getMembershipLevel
());
memberConfigVo
.
setNextMembershipName
(
nexMemberConfig
.
getLevelName
());
}
List
<
MemberProgressLog
>
memberProgressLogs
=
memberProgressLogService
.
list
(
new
LambdaQueryWrapper
<
MemberProgressLog
>()
.
lt
(
MemberProgressLog:
:
getExpirationTime
,
DateUtils
.
addDays
(
new
Date
(),
7
))
.
eq
(
MemberProgressLog:
:
getConsumerId
,
currentUser
.
getId
())
);
final
BigDecimal
[]
sum
=
{
BigDecimal
.
ZERO
};
if
(
CollectionUtil
.
isNotEmpty
(
memberProgressLogs
))
{
//计算扣除进度
memberProgressLogs
.
stream
().
forEach
(
log
->
{
if
(
log
.
getOperationType
().
equals
(
YesNoEnum
.
yes
.
getIndex
()))
{
sum
[
0
]
=
sum
[
0
].
add
(
log
.
getVariableProgress
());
}
else
if
(
log
.
getOperationType
().
equals
(
YesNoEnum
.
no
.
getIndex
()))
{
sum
[
0
]
=
sum
[
0
].
subtract
(
log
.
getVariableProgress
());
}
});
}
memberConfigVo
.
setNextWeekClearIntegral
(
sum
[
0
]);
vo
.
setMemberConfig
(
memberConfigVo
);
}
if
(
ObjectUtil
.
isNotEmpty
(
consumerWallet
))
{
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
80eaf171
...
...
@@ -2594,7 +2594,15 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
}
});
if
(
i
.
get
()
==
0
)
{
payPrice
=
payPrice
.
multiply
(
activity
.
getDiscountRatio
()).
divide
(
new
BigDecimal
(
100
));
boolean
match
=
executionTime
.
isMatch
(
ZonedDateTime
.
ofInstant
(
request
.
getPreStartDate
().
toInstant
(),
ZoneId
.
systemDefault
()));
boolean
match1
=
executionTime
.
isMatch
(
ZonedDateTime
.
ofInstant
(
request
.
getPreEndDate
().
toInstant
(),
ZoneId
.
systemDefault
()));
if
(
match
&&
match1
)
{
payPrice
=
payPrice
.
multiply
(
activity
.
getDiscountRatio
()).
divide
(
new
BigDecimal
(
100
));
}
else
{
MemberConfig
memberConfig
=
memberConfigService
.
getById
(
consumerMember
.
getMemberConfigId
());
payPrice
=
payPrice
.
multiply
(
memberConfig
.
getDiscountRatio
()).
divide
(
new
BigDecimal
(
100
));
}
// payPrice = payPrice.multiply(activity.getDiscountRatio()).divide(new BigDecimal(100));
}
else
{
MemberConfig
memberConfig
=
memberConfigService
.
getById
(
consumerMember
.
getMemberConfigId
());
payPrice
=
payPrice
.
multiply
(
memberConfig
.
getDiscountRatio
()).
divide
(
new
BigDecimal
(
100
));
...
...
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