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
b4bd8db2
Commit
b4bd8db2
authored
Sep 13, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'refs/heads/dev' into test
parents
9d98926c
b6c98ee5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
22 deletions
+54
-22
EquityFundLogController.java
.../share/web/controller/system/EquityFundLogController.java
+12
-2
RedisTask.java
share-quartz/src/main/java/share/quartz/task/RedisTask.java
+17
-11
EquityFundLogService.java
.../main/java/share/system/service/EquityFundLogService.java
+2
-0
CallbackServiceImpl.java
...n/java/share/system/service/impl/CallbackServiceImpl.java
+15
-9
EquityFundLogServiceImpl.java
...a/share/system/service/impl/EquityFundLogServiceImpl.java
+8
-0
No files found.
share-front/src/main/java/share/web/controller/system/EquityFundLogController.java
View file @
b4bd8db2
...
...
@@ -30,8 +30,7 @@ public class EquityFundLogController extends BaseController {
/**
* 查询权益金记录列表
*/
@PreAuthorize
(
"@ss.hasPermi('system:equityFundLog:list')"
)
@GetMapping
(
"/list"
)
@PostMapping
(
"/list"
)
public
TableDataInfo
list
(
EquityFundLog
equityFundLog
)
{
startPage
();
List
<
EquityFundLog
>
list
=
equityFundLogService
.
selectEquityFundLogList
(
equityFundLog
);
...
...
@@ -46,4 +45,15 @@ public class EquityFundLogController extends BaseController {
public
AjaxResult
getInfo
(
@PathVariable
(
"id"
)
Long
id
)
{
return
success
(
equityFundLogService
.
selectEquityFundLogById
(
id
));
}
/**
* 查询权益金记录列表
*/
// @PreAuthorize("@ss.hasPermi('system:equityFundLog:listUid')")
@GetMapping
(
"/listUid/{uid}"
)
public
TableDataInfo
equityFundLogListByUid
(
@PathVariable
(
"uid"
)
Long
uid
)
{
startPage
();
List
<
EquityFundLog
>
list
=
equityFundLogService
.
selectEquityFundLogByUid
(
uid
);
return
getDataTable
(
list
);
}
}
share-quartz/src/main/java/share/quartz/task/RedisTask.java
View file @
b4bd8db2
...
...
@@ -361,7 +361,8 @@ public class RedisTask {
if
(
ObjectUtil
.
isNotEmpty
(
consumerWallet
))
{
//添加时长
BigDecimal
anHour
=
new
BigDecimal
(
1.0
);
consumerWallet
.
setRemainingDuration
(
consumerWallet
.
getRemainingDuration
().
add
(
anHour
));
BigDecimal
accumulateEquityFund
=
consumerWallet
.
getAccumulateEquityFund
()
!=
null
?
consumerWallet
.
getAccumulateEquityFund
()
:
BigDecimal
.
ZERO
;
consumerWallet
.
setRemainingDuration
(
accumulateEquityFund
.
add
(
anHour
));
consumerWallet
.
setUpdateTime
(
DateUtils
.
getNowDate
());
consumerWalletService
.
updateConsumerWallet
(
consumerWallet
);
DurationLog
durationLog
=
new
DurationLog
();
...
...
@@ -381,7 +382,7 @@ public class RedisTask {
newConsumerWallet
.
setEquityFund
(
defaultVlue
);
newConsumerWallet
.
setAccumulateEquityFund
(
defaultVlue
);
BigDecimal
anHour
=
new
BigDecimal
(
1.0
);
newConsumerWallet
.
setRemainingDuration
(
newConsumerWallet
.
getRemainingDuration
()
.
add
(
anHour
));
newConsumerWallet
.
setRemainingDuration
(
defaultVlue
.
add
(
anHour
));
newConsumerWallet
.
setUpdateTime
(
DateUtils
.
getNowDate
());
consumerWalletService
.
insertConsumerWallet
(
newConsumerWallet
);
DurationLog
newDurationLog
=
new
DurationLog
();
...
...
@@ -403,18 +404,23 @@ public class RedisTask {
//判断是否为权益会员和会员是否有效
if
(
YesNoEnum
.
yes
.
getIndex
().
equals
(
consumerMember
.
getIsRecharge
())
&&
new
Date
().
getTime
()
<
consumerMember
.
getExpirationDate
().
getTime
()
&&
YesNoEnum
.
yes
.
getIndex
().
equals
(
newConsumerMember
.
getIsRecharge
())
&&
new
Date
().
getTime
()
<
newConsumerMember
.
getExpirationDate
().
getTime
())
{
Boolean
aBoolean
=
redisTemplate
.
hasKey
(
ReceiptRdeisEnum
.
EQUITY_MEMBERS_TIME
+
sharingActivities
.
getUid
().
toString
());
Boolean
newAboolean
=
redisTemplate
.
hasKey
(
ReceiptRdeisEnum
.
EQUITY_MEMBERS_TIME
+
sharingActivities
.
getNewUid
().
toString
());
Boolean
aBoolean
=
redisTemplate
.
hasKey
(
ReceiptRdeisEnum
.
EQUITY_MEMBERS_TIME
.
getValue
()
+
sharingActivities
.
getUid
().
toString
());
Boolean
newAboolean
=
redisTemplate
.
hasKey
(
ReceiptRdeisEnum
.
EQUITY_MEMBERS_TIME
.
getValue
()
+
sharingActivities
.
getNewUid
().
toString
());
if
(
aBoolean
&&
newAboolean
)
{
LambdaQueryWrapper
<
ConsumerWallet
>
consumerWalletLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
consumerWalletLambdaQueryWrapper
.
eq
(
ConsumerWallet:
:
getConsumerId
,
sharingActivities
.
getUid
());
ConsumerWallet
consumerWallet
=
consumerWalletService
.
getOne
(
consumerWalletLambdaQueryWrapper
);
BigDecimal
payPrice
=
sOrder
.
getPayPrice
();
if
(
payPrice
.
signum
()
>
0
)
{
String
equityFund
=
sysConfigService
.
selectConfigByKey
(
"sys.equityFundLog.equityFund"
);
consumerWallet
.
setEquityFund
(
consumerWallet
.
getEquityFund
().
add
(
payPrice
.
multiply
(
new
BigDecimal
(
equityFund
).
setScale
(
2
,
RoundingMode
.
HALF_UP
))));
consumerWallet
.
setAccumulateEquityFund
(
consumerWallet
.
getAccumulateEquityFund
().
add
(
payPrice
.
multiply
(
new
BigDecimal
(
equityFund
).
setScale
(
2
,
RoundingMode
.
HALF_UP
))));
// BigDecimal addEquityFund = payPrice.multiply(new BigDecimal(equityFund)).setScale(2, RoundingMode.HALF_UP);
BigDecimal
addEquityFund
=
new
BigDecimal
(
99
).
multiply
(
new
BigDecimal
(
equityFund
)).
setScale
(
2
,
RoundingMode
.
HALF_UP
);
BigDecimal
aEquityFund
=
consumerWallet
.
getEquityFund
()
!=
null
?
consumerWallet
.
getEquityFund
()
:
BigDecimal
.
ZERO
;
consumerWallet
.
setEquityFund
(
aEquityFund
.
add
(
addEquityFund
));
BigDecimal
accumulateEquityFund
=
consumerWallet
.
getAccumulateEquityFund
()
!=
null
?
consumerWallet
.
getAccumulateEquityFund
()
:
BigDecimal
.
ZERO
;
consumerWallet
.
setAccumulateEquityFund
(
accumulateEquityFund
.
add
(
addEquityFund
));
consumerWallet
.
setUpdateTime
(
DateUtils
.
getNowDate
());
consumerWalletService
.
updateConsumerWallet
(
consumerWallet
);
//添加权益金日志记录
...
...
@@ -423,7 +429,7 @@ public class RedisTask {
//上级用户
SConsumer
consumer
=
consumerService
.
getById
(
sharingActivities
.
getUid
());
EquityFundLog
equityFundLog
=
new
EquityFundLog
();
equityFundLog
.
setEquityFund
(
payPrice
.
multiply
(
new
BigDecimal
(
equityFund
).
setScale
(
2
,
RoundingMode
.
HALF_UP
))
);
equityFundLog
.
setEquityFund
(
addEquityFund
);
equityFundLog
.
setEquityFundType
(
"1"
);
equityFundLog
.
setOutTradeNo
(
sOrder
.
getOutTradeNo
());
equityFundLog
.
setTerminalTrace
(
sOrder
.
getOutTradeNo
());
...
...
@@ -588,7 +594,7 @@ public class RedisTask {
@XxlJob
(
"AutoOrderCancelPay"
)
public
void
AutoOrderCancelPay
()
{
logger
.
debug
(
"AutoOrderCancelPay:延时订单取消支付开始"
);
Set
<
String
>
keys
=
redisTemplate
.
keys
(
ReceiptRdeisEnum
.
ORDER_CANCEL_PAY
+
"*"
);
Set
<
String
>
keys
=
redisTemplate
.
keys
(
ReceiptRdeisEnum
.
ORDER_CANCEL_PAY
.
getValue
()
+
"*"
);
if
(
keys
.
size
()
==
0
)
{
return
;
}
...
...
@@ -619,7 +625,7 @@ public class RedisTask {
@XxlJob
(
"AutoEquityMembersSms"
)
public
void
AutoEquityMembersSms
()
{
logger
.
debug
(
"AutoEquityMembersSms:自动发送权益会员过期短信开始"
);
Set
<
String
>
keys
=
redisTemplate
.
keys
(
ReceiptRdeisEnum
.
EQUITY_MEMBERS_TIME
+
"*"
);
Set
<
String
>
keys
=
redisTemplate
.
keys
(
ReceiptRdeisEnum
.
EQUITY_MEMBERS_TIME
.
getValue
()
+
"*"
);
if
(
keys
.
size
()
==
0
)
{
return
;
}
...
...
@@ -645,7 +651,7 @@ public class RedisTask {
@XxlJob
(
"AutoUpdateEquityMembers"
)
public
void
AutoUpdateEquityMembers
()
{
logger
.
debug
(
"AutoUpdateEquityMembers:权益会员降级开始"
);
Set
<
String
>
keys
=
redisTemplate
.
keys
(
ReceiptRdeisEnum
.
EQUITY_MEMBERS_TIME
+
"*"
);
Set
<
String
>
keys
=
redisTemplate
.
keys
(
ReceiptRdeisEnum
.
EQUITY_MEMBERS_TIME
.
getValue
()
+
"*"
);
if
(
keys
.
size
()
==
0
)
{
return
;
}
...
...
share-system/src/main/java/share/system/service/EquityFundLogService.java
View file @
b4bd8db2
...
...
@@ -59,4 +59,6 @@ public interface EquityFundLogService extends IService<EquityFundLog>
* @return 结果
*/
public
int
deleteEquityFundLogById
(
Long
id
);
List
<
EquityFundLog
>
selectEquityFundLogByUid
(
Long
uid
);
}
share-system/src/main/java/share/system/service/impl/CallbackServiceImpl.java
View file @
b4bd8db2
...
...
@@ -777,29 +777,35 @@ public class CallbackServiceImpl implements CallbackService {
ConsumerMember
consumerMember
=
consumerMemberService
.
getOne
(
consumerMemberLambdaQueryWrapper
);
//判断是否为权益会员和会员是否有效
if
(
YesNoEnum
.
yes
.
getIndex
().
equals
(
consumerMember
.
getIsRights
())
&&
new
Date
().
getTime
()
<
consumerMember
.
getExpirationDate
().
getTime
())
{
Boolean
aBoolean
=
redisTemplate
.
hasKey
(
ReceiptRdeisEnum
.
EQUITY_MEMBERS_TIME
+
sharingActivities
.
getUid
().
toString
());
Boolean
aBoolean
=
redisTemplate
.
hasKey
(
ReceiptRdeisEnum
.
EQUITY_MEMBERS_TIME
.
getValue
()
+
sharingActivities
.
getUid
().
toString
());
if
(
aBoolean
)
{
String
equityFund
=
sysConfigService
.
selectConfigByKey
(
"sys.equityFundLog.equityFund"
);
//计算返佣额度 写死 99 测试
BigDecimal
addEquityFund
=
new
BigDecimal
(
99
).
multiply
(
new
BigDecimal
(
equityFund
)).
setScale
(
2
,
RoundingMode
.
HALF_UP
);
// BigDecimal addEquityFund = payPrice.multiply(new BigDecimal(equityFund)).setScale(2,RoundingMode.HALF_UP);
//查询上级用户是否有钱包
ConsumerWallet
consumerWallet
=
consumerWalletService
.
getOne
(
new
LambdaQueryWrapper
<
ConsumerWallet
>()
.
eq
(
ConsumerWallet:
:
getConsumerId
,
sharingActivities
.
getUid
()));
if
(
ObjectUtil
.
isNotEmpty
(
consumerWallet
))
{
consumerWallet
.
setEquityFund
(
consumerWallet
.
getEquityFund
().
add
(
payPrice
.
multiply
(
new
BigDecimal
(
equityFund
))));
consumerWallet
.
setAccumulateEquityFund
(
consumerWallet
.
getAccumulateEquityFund
().
add
(
payPrice
.
multiply
(
new
BigDecimal
(
equityFund
))));
BigDecimal
aEquityFund
=
consumerWallet
.
getEquityFund
()
!=
null
?
consumerWallet
.
getEquityFund
()
:
BigDecimal
.
ZERO
;
consumerWallet
.
setEquityFund
(
aEquityFund
.
add
(
addEquityFund
));
BigDecimal
accumulateEquityFund
=
consumerWallet
.
getAccumulateEquityFund
()
!=
null
?
consumerWallet
.
getAccumulateEquityFund
()
:
BigDecimal
.
ZERO
;
consumerWallet
.
setAccumulateEquityFund
(
accumulateEquityFund
.
add
(
addEquityFund
));
consumerWallet
.
setUpdateTime
(
DateUtils
.
getNowDate
());
consumerWalletService
.
updateConsumerWallet
(
consumerWallet
);
}
else
{
//新增钱包
ConsumerWallet
newConsumerWallet
=
new
ConsumerWallet
();
BigDecimal
defaultVlue
=
new
BigDecimal
(
0
.0
);
BigDecimal
defaultVlue
=
new
BigDecimal
(
0
);
newConsumerWallet
.
setConsumerId
(
sharingActivities
.
getUid
());
newConsumerWallet
.
setBalance
(
defaultVlue
);
newConsumerWallet
.
setRemainingIntegral
(
defaultVlue
);
newConsumerWallet
.
setRemainingDuration
(
defaultVlue
);
newConsumerWallet
.
setEquityFund
(
consumerWallet
.
getEquityFund
().
add
(
payPrice
.
multiply
(
new
BigDecimal
(
equityFund
).
setScale
(
2
,
RoundingMode
.
HALF_UP
))));
newConsumerWallet
.
setAccumulateEquityFund
(
consumerWallet
.
getAccumulateEquityFund
()
.
add
(
payPrice
.
multiply
(
new
BigDecimal
(
equityFund
).
setScale
(
2
,
RoundingMode
.
HALF_UP
))
));
newConsumerWallet
.
setEquityFund
(
defaultVlue
.
add
(
addEquityFund
));
newConsumerWallet
.
setAccumulateEquityFund
(
defaultVlue
.
add
(
addEquityFund
));
consumerWalletService
.
insertConsumerWallet
(
newConsumerWallet
);
}
//添加权益金日志记录
...
...
@@ -808,7 +814,7 @@ public class CallbackServiceImpl implements CallbackService {
//上级用户
SConsumer
consumer
=
consumerService
.
getById
(
sharingActivities
.
getUid
());
EquityFundLog
equityFundLog
=
new
EquityFundLog
();
equityFundLog
.
setEquityFund
(
payPrice
.
multiply
(
new
BigDecimal
(
equityFund
).
setScale
(
2
,
RoundingMode
.
HALF_UP
))
);
equityFundLog
.
setEquityFund
(
addEquityFund
);
equityFundLog
.
setEquityFundType
(
type
);
equityFundLog
.
setOutTradeNo
(
equityOrderNo
);
equityFundLog
.
setTerminalTrace
(
terminalTrace
);
...
...
share-system/src/main/java/share/system/service/impl/EquityFundLogServiceImpl.java
View file @
b4bd8db2
package
share
.
system
.
service
.
impl
;
import
java.util.List
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
share.common.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -94,4 +96,10 @@ public class EquityFundLogServiceImpl extends ServiceImpl<EquityFundLogMapper, E
{
return
equityFundLogMapper
.
deleteEquityFundLogById
(
id
);
}
@Override
public
List
<
EquityFundLog
>
selectEquityFundLogByUid
(
Long
id
)
{
return
equityFundLogMapper
.
selectList
(
new
LambdaQueryWrapper
<
EquityFundLog
>().
eq
(
EquityFundLog:
:
getUid
,
id
));
}
}
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