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
dae6d0ea
Commit
dae6d0ea
authored
Nov 19, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加抽奖接口
parent
e19e942a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
4 deletions
+64
-4
ConsumerWalletService.java
...main/java/share/system/service/ConsumerWalletService.java
+2
-0
ConsumerWalletServiceImpl.java
.../share/system/service/impl/ConsumerWalletServiceImpl.java
+54
-0
WheelGameServiceImpl.java
.../java/share/system/service/impl/WheelGameServiceImpl.java
+8
-4
No files found.
share-system/src/main/java/share/system/service/ConsumerWalletService.java
View file @
dae6d0ea
...
...
@@ -72,4 +72,6 @@ public interface ConsumerWalletService extends IService<ConsumerWallet> {
void
accumulatedConsumptionStatistics
(
Long
consumerId
);
int
giveDuration
(
ConsumerWallet
consumerWallet
);
public
int
giveIntegral
(
ConsumerWallet
consumerWallet
);
}
share-system/src/main/java/share/system/service/impl/ConsumerWalletServiceImpl.java
View file @
dae6d0ea
...
...
@@ -529,4 +529,58 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
return
1
;
}
}
@Override
public
int
giveIntegral
(
ConsumerWallet
consumerWallet
)
{
ConsumerWallet
oldConsumerWallet
=
consumerWalletService
.
getOne
(
new
LambdaQueryWrapper
<
ConsumerWallet
>().
eq
(
ConsumerWallet:
:
getConsumerId
,
consumerWallet
.
getConsumerId
()));
ConsumerMember
oldConsumerMember
=
consumerMemberService
.
getOne
(
new
LambdaQueryWrapper
<
ConsumerMember
>().
eq
(
ConsumerMember:
:
getConsumerId
,
consumerWallet
.
getConsumerId
()));
if
(
ObjectUtil
.
isNotEmpty
(
oldConsumerWallet
)
&&
ObjectUtil
.
isNotEmpty
(
oldConsumerMember
))
{
IntegralLog
integralLog
=
new
IntegralLog
();
integralLog
.
setConsumerId
(
consumerWallet
.
getConsumerId
());
integralLog
.
setCurrentIntegral
(
oldConsumerWallet
.
getRemainingIntegral
());
integralLog
.
setVariableIntegral
(
consumerWallet
.
getRemainingIntegral
());
integralLog
.
setOperationType
(
YesNoEnum
.
yes
.
getIndex
());
integralLog
.
setOperationTime
(
new
Date
());
integralLog
.
setCreateTime
(
new
Date
());
oldConsumerWallet
.
setRemainingIntegral
(
oldConsumerWallet
.
getRemainingIntegral
().
add
(
consumerWallet
.
getRemainingIntegral
()));
integralLogService
.
save
(
integralLog
);
consumerWalletService
.
updateById
(
oldConsumerWallet
);
return
1
;
}
else
{
ConsumerWallet
newConsumerWallet
=
new
ConsumerWallet
();
newConsumerWallet
.
setConsumerId
(
consumerWallet
.
getConsumerId
());
newConsumerWallet
.
setBalance
(
BigDecimal
.
ZERO
);
newConsumerWallet
.
setRechargeAmount
(
BigDecimal
.
ZERO
);
newConsumerWallet
.
setGiftAmount
(
BigDecimal
.
ZERO
);
newConsumerWallet
.
setRemainingDuration
(
BigDecimal
.
ZERO
);
IntegralLog
integralLog
=
new
IntegralLog
();
integralLog
.
setConsumerId
(
consumerWallet
.
getConsumerId
());
integralLog
.
setCurrentIntegral
(
newConsumerWallet
.
getRemainingIntegral
());
integralLog
.
setVariableIntegral
(
consumerWallet
.
getRemainingIntegral
());
integralLog
.
setOperationType
(
YesNoEnum
.
yes
.
getIndex
());
integralLog
.
setOperationTime
(
new
Date
());
integralLog
.
setCreateTime
(
new
Date
());
newConsumerWallet
.
setRemainingDuration
(
BigDecimal
.
ZERO
);
newConsumerWallet
.
setRemainingIntegral
(
newConsumerWallet
.
getRemainingIntegral
().
add
(
consumerWallet
.
getRemainingIntegral
()));
newConsumerWallet
.
setEquityFund
(
BigDecimal
.
ZERO
);
newConsumerWallet
.
setAccumulateEquityFund
(
BigDecimal
.
ZERO
);
newConsumerWallet
.
setCreateTime
(
new
Date
());
ConsumerMember
newConsumerMember
=
new
ConsumerMember
();
newConsumerMember
.
setConsumerId
(
consumerWallet
.
getConsumerId
());
newConsumerMember
.
setMembershipLevel
(
0L
);
String
rechargeMembershipExpirationTime
=
sysConfigService
.
selectConfigByKey
(
"rechargeMembershipExpirationTime"
);
newConsumerMember
.
setExpirationDate
(
DateUtils
.
addYears
(
new
Date
(),
Integer
.
parseInt
(
rechargeMembershipExpirationTime
)));
newConsumerMember
.
setMembershipProgress
(
BigDecimal
.
ZERO
);
newConsumerMember
.
setIsRecharge
(
YesNoEnum
.
no
.
getIndex
());
newConsumerMember
.
setIsRights
(
YesNoEnum
.
no
.
getIndex
());
newConsumerMember
.
setCreateTime
(
new
Date
());
consumerWalletService
.
save
(
newConsumerWallet
);
integralLogService
.
save
(
integralLog
);
consumerMemberService
.
save
(
newConsumerMember
);
return
1
;
}
}
}
share-system/src/main/java/share/system/service/impl/WheelGameServiceImpl.java
View file @
dae6d0ea
...
...
@@ -18,11 +18,9 @@ import share.common.utils.DateUtils;
import
share.system.domain.*
;
import
share.system.domain.vo.FrontTokenComponent
;
import
share.system.mapper.WheelGameMapper
;
import
share.system.service.ISConsumerCouponService
;
import
share.system.service.LotteryRecordsLogService
;
import
share.system.service.PrizeService
;
import
share.system.service.WheelGameService
;
import
share.system.service.*
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Objects
;
...
...
@@ -48,6 +46,8 @@ public class WheelGameServiceImpl extends ServiceImpl<WheelGameMapper, WheelGame
private
ISConsumerCouponService
sConsumerCouponService
;
@Autowired
private
LotteryRecordsLogService
lotteryRecordsLogService
;
@Autowired
private
ConsumerWalletService
consumerWalletService
;
/**
* 查询转盘游戏
...
...
@@ -165,6 +165,10 @@ public class WheelGameServiceImpl extends ServiceImpl<WheelGameMapper, WheelGame
lotteryRecordsLogService
.
save
(
log
);
break
;
case
INTEGRAL:
ConsumerWallet
consumerWallet
=
new
ConsumerWallet
();
consumerWallet
.
setConsumerId
(
user
.
getId
());
consumerWallet
.
setRemainingIntegral
(
new
BigDecimal
(
prize
.
getPrizeValue
()));
consumerWalletService
.
giveIntegral
(
consumerWallet
);
log
.
setIsHit
(
YesNoEnum
.
yes
.
getIndex
());
log
.
setIsSend
(
YesNoEnum
.
yes
.
getIndex
());
log
.
setHitPrize
(
PrizeTypeEnum
.
INTEGRAL
.
getName
());
...
...
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