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
1e1d4dc8
Commit
1e1d4dc8
authored
Nov 25, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
抽奖增加时长,金额
parent
4af45b18
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
1 deletions
+84
-1
PrizeTypeEnum.java
...ommon/src/main/java/share/common/enums/PrizeTypeEnum.java
+5
-1
ConsumerWalletService.java
...main/java/share/system/service/ConsumerWalletService.java
+2
-0
ConsumerWalletServiceImpl.java
.../share/system/service/impl/ConsumerWalletServiceImpl.java
+55
-0
WheelGameServiceImpl.java
.../java/share/system/service/impl/WheelGameServiceImpl.java
+22
-0
No files found.
share-common/src/main/java/share/common/enums/PrizeTypeEnum.java
View file @
1e1d4dc8
...
@@ -5,7 +5,11 @@ public enum PrizeTypeEnum {
...
@@ -5,7 +5,11 @@ public enum PrizeTypeEnum {
COUPON
(
1
,
"优惠券"
),
COUPON
(
1
,
"优惠券"
),
GOODS
(
2
,
"商品"
),
GOODS
(
2
,
"商品"
),
INTEGRAL
(
3
,
"积分"
),
INTEGRAL
(
3
,
"积分"
),
THANK
(
4
,
"谢谢参与"
);
TIME
(
4
,
"时长"
),
//赠送金额
MONEY
(
5
,
"金额"
),
//赠送时长
THANK
(
6
,
"谢谢参与"
);
private
Integer
code
;
private
Integer
code
;
private
String
name
;
private
String
name
;
...
...
share-system/src/main/java/share/system/service/ConsumerWalletService.java
View file @
1e1d4dc8
...
@@ -74,4 +74,6 @@ public interface ConsumerWalletService extends IService<ConsumerWallet> {
...
@@ -74,4 +74,6 @@ public interface ConsumerWalletService extends IService<ConsumerWallet> {
int
giveDuration
(
ConsumerWallet
consumerWallet
);
int
giveDuration
(
ConsumerWallet
consumerWallet
);
public
int
giveIntegral
(
ConsumerWallet
consumerWallet
);
public
int
giveIntegral
(
ConsumerWallet
consumerWallet
);
int
giveAmount
(
ConsumerWallet
consumerWallet
);
}
}
share-system/src/main/java/share/system/service/impl/ConsumerWalletServiceImpl.java
View file @
1e1d4dc8
...
@@ -583,4 +583,59 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
...
@@ -583,4 +583,59 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
return
1
;
return
1
;
}
}
}
}
@Override
public
int
giveAmount
(
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
))
{
GiftAmountLog
giftAmountLog
=
new
GiftAmountLog
();
giftAmountLog
.
setConsumerId
(
consumerWallet
.
getConsumerId
());
giftAmountLog
.
setCurrentAmount
(
oldConsumerWallet
.
getGiftAmount
());
giftAmountLog
.
setVariableAmount
(
consumerWallet
.
getGiftAmount
());
giftAmountLog
.
setOperationType
(
YesNoEnum
.
yes
.
getIndex
());
giftAmountLog
.
setOperationTime
(
new
Date
());
giftAmountLog
.
setCreateTime
(
new
Date
());
oldConsumerWallet
.
setGiftAmount
(
oldConsumerWallet
.
getGiftAmount
().
add
(
consumerWallet
.
getGiftAmount
()));
oldConsumerWallet
.
setBalance
(
oldConsumerWallet
.
getRechargeAmount
().
add
(
oldConsumerWallet
.
getGiftAmount
()));
giftAmountLogService
.
save
(
giftAmountLog
);
consumerWalletService
.
updateById
(
oldConsumerWallet
);
return
1
;
}
else
{
ConsumerWallet
newConsumerWallet
=
new
ConsumerWallet
();
newConsumerWallet
.
setConsumerId
(
consumerWallet
.
getConsumerId
());
newConsumerWallet
.
setRechargeAmount
(
BigDecimal
.
ZERO
);
newConsumerWallet
.
setRemainingDuration
(
BigDecimal
.
ZERO
);
GiftAmountLog
giftAmountLog
=
new
GiftAmountLog
();
giftAmountLog
.
setConsumerId
(
consumerWallet
.
getConsumerId
());
giftAmountLog
.
setCurrentAmount
(
BigDecimal
.
ZERO
);
giftAmountLog
.
setVariableAmount
(
consumerWallet
.
getGiftAmount
());
giftAmountLog
.
setOperationType
(
YesNoEnum
.
yes
.
getIndex
());
giftAmountLog
.
setOperationTime
(
new
Date
());
giftAmountLog
.
setCreateTime
(
new
Date
());
newConsumerWallet
.
setBalance
(
consumerWallet
.
getGiftAmount
());
newConsumerWallet
.
setGiftAmount
(
consumerWallet
.
getGiftAmount
());
newConsumerWallet
.
setRemainingDuration
(
BigDecimal
.
ZERO
);
newConsumerWallet
.
setRemainingIntegral
(
BigDecimal
.
ZERO
);
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
);
giftAmountLogService
.
save
(
giftAmountLog
);
consumerMemberService
.
save
(
newConsumerMember
);
return
1
;
}
}
}
}
share-system/src/main/java/share/system/service/impl/WheelGameServiceImpl.java
View file @
1e1d4dc8
...
@@ -175,6 +175,28 @@ public class WheelGameServiceImpl extends ServiceImpl<WheelGameMapper, WheelGame
...
@@ -175,6 +175,28 @@ public class WheelGameServiceImpl extends ServiceImpl<WheelGameMapper, WheelGame
log
.
setSendMsg
(
prize
.
getPrizeValue
()
+
":"
+
PrizeTypeEnum
.
INTEGRAL
.
getName
()
+
"以发放"
);
log
.
setSendMsg
(
prize
.
getPrizeValue
()
+
":"
+
PrizeTypeEnum
.
INTEGRAL
.
getName
()
+
"以发放"
);
lotteryRecordsLogService
.
save
(
log
);
lotteryRecordsLogService
.
save
(
log
);
break
;
break
;
case
TIME:
ConsumerWallet
durationrWallet
=
new
ConsumerWallet
();
durationrWallet
.
setConsumerId
(
user
.
getId
());
durationrWallet
.
setRemainingDuration
(
new
BigDecimal
(
prize
.
getPrizeValue
()));
consumerWalletService
.
giveDuration
(
durationrWallet
);
log
.
setIsHit
(
YesNoEnum
.
yes
.
getIndex
());
log
.
setIsSend
(
YesNoEnum
.
yes
.
getIndex
());
log
.
setHitPrize
(
PrizeTypeEnum
.
TIME
.
getName
());
log
.
setSendMsg
(
prize
.
getPrizeValue
()
+
":"
+
PrizeTypeEnum
.
TIME
.
getName
()
+
"以发放"
);
lotteryRecordsLogService
.
save
(
log
);
break
;
case
MONEY:
ConsumerWallet
giveAmountWallet
=
new
ConsumerWallet
();
giveAmountWallet
.
setConsumerId
(
user
.
getId
());
giveAmountWallet
.
setGiftAmount
(
new
BigDecimal
(
prize
.
getPrizeValue
()));
consumerWalletService
.
giveAmount
(
giveAmountWallet
);
log
.
setIsHit
(
YesNoEnum
.
yes
.
getIndex
());
log
.
setIsSend
(
YesNoEnum
.
yes
.
getIndex
());
log
.
setHitPrize
(
PrizeTypeEnum
.
MONEY
.
getName
());
log
.
setSendMsg
(
prize
.
getPrizeValue
()
+
":"
+
PrizeTypeEnum
.
MONEY
.
getName
()
+
"以发放"
);
lotteryRecordsLogService
.
save
(
log
);
break
;
case
THANK:
case
THANK:
log
.
setIsHit
(
YesNoEnum
.
no
.
getIndex
());
log
.
setIsHit
(
YesNoEnum
.
no
.
getIndex
());
log
.
setIsSend
(
YesNoEnum
.
no
.
getIndex
());
log
.
setIsSend
(
YesNoEnum
.
no
.
getIndex
());
...
...
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