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
52cb8a7a
Commit
52cb8a7a
authored
Sep 25, 2024
by
YG8429
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
临时权益金增加返佣状态字段,人工退款增加删除临时权益金记录表,绑定关系增加查询
parent
5ba32614
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
77 additions
and
35 deletions
+77
-35
SharingActivitiesController.java
...re/web/controller/system/SharingActivitiesController.java
+2
-1
RedisTask.java
share-quartz/src/main/java/share/quartz/task/RedisTask.java
+7
-4
EquityFundExcess.java
...m/src/main/java/share/system/domain/EquityFundExcess.java
+3
-0
SharingActivitiesService.java
...n/java/share/system/service/SharingActivitiesService.java
+2
-0
EquityFundExcessServiceImpl.java
...hare/system/service/impl/EquityFundExcessServiceImpl.java
+4
-5
SConsumerServiceImpl.java
.../java/share/system/service/impl/SConsumerServiceImpl.java
+8
-1
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+23
-22
SharingActivitiesServiceImpl.java
...are/system/service/impl/SharingActivitiesServiceImpl.java
+20
-1
WechatNewServiceImpl.java
.../java/share/system/service/impl/WechatNewServiceImpl.java
+3
-0
EquityFundExcessMapper.xml
...c/main/resources/mapper/system/EquityFundExcessMapper.xml
+5
-1
No files found.
share-admin/src/main/java/share/web/controller/system/SharingActivitiesController.java
View file @
52cb8a7a
...
...
@@ -65,7 +65,8 @@ public class SharingActivitiesController extends BaseController {
@PreAuthorize
(
"@ss.hasPermi('system:activities:query')"
)
@GetMapping
(
value
=
"/{id}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"id"
)
Long
id
)
{
return
success
(
sharingActivitiesService
.
selectSharingActivitiesById
(
id
));
return
success
(
sharingActivitiesService
.
selectSharingActivitiesUserById
(
id
));
}
/**
...
...
share-quartz/src/main/java/share/quartz/task/RedisTask.java
View file @
52cb8a7a
...
...
@@ -14,6 +14,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import
com.dianping.openapi.sdk.api.oauth.entity.CustomerRefreshTokenResponse
;
import
com.dianping.openapi.sdk.api.tuangou.entity.TuangouReceiptGetConsumedReponseEntity
;
import
com.xxl.job.core.handler.annotation.XxlJob
;
import
lombok.val
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -656,10 +657,11 @@ public class RedisTask {
}
List
<
Long
>
consumerIds
=
list
.
stream
().
map
(
EquityFundExcess:
:
getUid
).
distinct
().
collect
(
Collectors
.
toList
());
Map
<
Long
,
ConsumerWallet
>
consumerWalletMap
=
consumerWalletService
.
list
(
new
LambdaQueryWrapper
<
ConsumerWallet
>()
.
in
(
ConsumerWallet:
:
getConsumerId
,
consumerIds
)).
stream
().
collect
(
Collectors
.
toMap
(
ConsumerWallet:
:
getConsumerId
,
item
->
item
));
.
in
(
ConsumerWallet:
:
getConsumerId
,
consumerIds
)).
stream
()
.
collect
(
Collectors
.
toMap
(
ConsumerWallet:
:
getConsumerId
,
item
->
item
));
List
<
ConsumerWallet
>
consumerWalletList
=
new
ArrayList
<>();
List
<
EquityFundLog
>
equityFundLogList
=
new
ArrayList
<>();
List
<
Long
>
ids
=
new
ArrayList
<>();
List
<
EquityFundExcess
>
ids
=
new
ArrayList
<>();
list
.
stream
().
forEach
(
item
->{
ConsumerWallet
consumerWallet
=
consumerWalletMap
.
get
(
item
.
getUid
());
consumerWallet
.
setEquityFund
(
consumerWallet
.
getEquityFund
().
add
(
item
.
getEquityFund
()));
...
...
@@ -675,7 +677,8 @@ public class RedisTask {
equityFundLogList
.
add
(
equityFundLog
);
item
.
setIsDelete
(
YesNoEnum
.
yes
.
getIndex
());
ids
.
add
(
item
.
getId
());
item
.
setRebateType
(
YesNoEnum
.
yes
.
getIndex
());
ids
.
add
(
item
);
});
if
(
CollectionUtil
.
isNotEmpty
(
consumerWalletList
)){
consumerWalletService
.
updateBatchById
(
consumerWalletList
);
...
...
@@ -684,7 +687,7 @@ public class RedisTask {
equityFundLogService
.
saveBatch
(
equityFundLogList
);
}
if
(
CollectionUtil
.
isNotEmpty
(
ids
)){
equityFundExcessService
.
removeByIds
(
ids
);
equityFundExcessService
.
updateBatchById
(
ids
);
}
logger
.
debug
(
"AutoEquityFundExcess:权益金增加结束"
);
}
...
...
share-system/src/main/java/share/system/domain/EquityFundExcess.java
View file @
52cb8a7a
...
...
@@ -50,6 +50,9 @@ public class EquityFundExcess extends BaseEntity
@TableField
(
select
=
false
)
private
Integer
isDelete
;
@Excel
(
name
=
"返佣状态(0-未返佣,1-已返佣)"
)
private
Integer
rebateType
;
@Override
public
String
toString
()
{
...
...
share-system/src/main/java/share/system/service/SharingActivitiesService.java
View file @
52cb8a7a
...
...
@@ -67,4 +67,6 @@ public interface SharingActivitiesService extends IService<SharingActivities>
int
selectSharingActivitiesCount
(
SharingActivities
sharingActivities
);
TableDataInfo
pageList
(
TableDataInfo
info
,
SharingActivitiesVo
sharingActivities
);
SharingActivitiesVo
selectSharingActivitiesUserById
(
Long
id
);
}
share-system/src/main/java/share/system/service/impl/EquityFundExcessServiceImpl.java
View file @
52cb8a7a
...
...
@@ -159,8 +159,6 @@ public class EquityFundExcessServiceImpl extends ServiceImpl<EquityFundExcessMap
if
(
CollectionUtils
.
isEmpty
(
list
))
return
new
ArrayList
<>();
List
<
Long
>
collect
=
list
.
stream
().
map
(
EquityFundExcess:
:
getNewUid
).
collect
(
Collectors
.
toList
());
SConsumer
sConsumer
=
sConsumerMapper
.
selectSConsumerById
(
id
);
List
<
SConsumer
>
newConsumerList
=
sConsumerMapper
.
selectList
(
new
LambdaQueryWrapper
<
SConsumer
>()
.
in
(
SConsumer:
:
getId
,
collect
));
Map
<
Long
,
SConsumer
>
newUserMap
=
sConsumerMapper
.
selectList
(
new
LambdaQueryWrapper
<
SConsumer
>()
.
in
(
SConsumer:
:
getId
,
collect
))
.
stream
().
collect
(
Collectors
.
toMap
(
SConsumer:
:
getId
,
Function
.
identity
()));
...
...
@@ -259,7 +257,7 @@ public class EquityFundExcessServiceImpl extends ServiceImpl<EquityFundExcessMap
ConsumerWallet
consumerWallet
=
consumerWalletService
.
getOne
(
consumerWalletLambdaQueryWrapper
);
if
(
ObjectUtil
.
isNotEmpty
(
consumerWallet
))
{
//添加时长
BigDecimal
anHour
=
new
BigDecimal
(
1.0
);
BigDecimal
anHour
=
new
BigDecimal
(
"1.0"
);
BigDecimal
accumulateEquityFund
=
ObjectUtil
.
isNotEmpty
(
consumerWallet
.
getRemainingDuration
())
?
consumerWallet
.
getRemainingDuration
()
:
BigDecimal
.
ZERO
;
consumerWallet
.
setRemainingDuration
(
accumulateEquityFund
.
add
(
anHour
));
consumerWallet
.
setUpdateTime
(
DateUtils
.
getNowDate
());
...
...
@@ -275,13 +273,13 @@ public class EquityFundExcessServiceImpl extends ServiceImpl<EquityFundExcessMap
}
else
{
//新增钱包
ConsumerWallet
newConsumerWallet
=
new
ConsumerWallet
();
BigDecimal
defaultVlue
=
new
BigDecimal
(
0.0
);
BigDecimal
defaultVlue
=
new
BigDecimal
(
"0.0"
);
newConsumerWallet
.
setConsumerId
(
sharingActivities
.
getUid
());
newConsumerWallet
.
setBalance
(
defaultVlue
);
newConsumerWallet
.
setRemainingIntegral
(
defaultVlue
);
newConsumerWallet
.
setEquityFund
(
defaultVlue
);
newConsumerWallet
.
setAccumulateEquityFund
(
defaultVlue
);
BigDecimal
anHour
=
new
BigDecimal
(
1.0
);
BigDecimal
anHour
=
new
BigDecimal
(
"1.0"
);
newConsumerWallet
.
setRemainingDuration
(
defaultVlue
.
add
(
anHour
));
newConsumerWallet
.
setUpdateTime
(
DateUtils
.
getNowDate
());
consumerWalletService
.
insertConsumerWallet
(
newConsumerWallet
);
...
...
@@ -336,6 +334,7 @@ public class EquityFundExcessServiceImpl extends ServiceImpl<EquityFundExcessMap
equityFundExcess
.
setOutTradeNo
(
sOrder
.
getOrderNo
());
equityFundExcess
.
setUid
(
sharingActivities
.
getUid
());
equityFundExcess
.
setNewUid
(
sharingActivities
.
getNewUid
());
equityFundExcess
.
setRebateType
(
YesNoEnum
.
no
.
getIndex
());
equityFundExcessService
.
insertEquityFundExcess
(
equityFundExcess
);
}
}
...
...
share-system/src/main/java/share/system/service/impl/SConsumerServiceImpl.java
View file @
52cb8a7a
...
...
@@ -22,6 +22,7 @@ import share.common.exception.base.BaseException;
import
share.common.utils.BaseUtil
;
import
share.common.utils.DateUtil
;
import
share.common.utils.DateUtils
;
import
share.common.utils.StringUtils
;
import
share.system.domain.*
;
import
share.system.domain.vo.*
;
import
share.system.mapper.ConsumerMemberMapper
;
...
...
@@ -355,6 +356,12 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
.
ne
(
ConsumerMember:
:
getConsumerId
,
sConsumer
.
getNewId
()));
List
<
Long
>
collect
=
consumerMembers
.
stream
().
map
(
ConsumerMember:
:
getConsumerId
).
collect
(
Collectors
.
toList
());
LambdaQueryWrapper
<
SConsumer
>
uSConsumer
=
new
LambdaQueryWrapper
<
SConsumer
>();
if
(
StringUtils
.
isNotEmpty
(
sConsumer
.
getPhone
())){
uSConsumer
.
like
(
SConsumer:
:
getPhone
,
sConsumer
.
getPhone
());
}
if
(
StringUtils
.
isNotEmpty
(
sConsumer
.
getNickName
())){
uSConsumer
.
like
(
SConsumer:
:
getNickName
,
sConsumer
.
getNickName
());
}
uSConsumer
.
in
(
SConsumer:
:
getId
,
collect
);
int
count
=
consumerMemberService
.
count
(
new
LambdaQueryWrapper
<
ConsumerMember
>()
...
...
@@ -362,7 +369,7 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
.
ne
(
ConsumerMember:
:
getConsumerId
,
sConsumer
.
getNewId
()));
List
<
SConsumer
>
userMap
=
sConsumerService
.
list
(
uSConsumer
);
int
start
=
(
sConsumer
.
getPageNum
()
-
1
)
*
sConsumer
.
getPageSize
();
int
end
=
Math
.
min
(
start
+
sConsumer
.
getPageSize
(),
count
);
int
end
=
Math
.
min
(
start
+
sConsumer
.
getPageSize
(),
userMap
.
size
()
);
List
<
SConsumer
>
pagedList
=
userMap
.
subList
(
start
,
end
);
TableDataInfo
tableDataInfo
=
new
TableDataInfo
();
tableDataInfo
.
setRows
(
pagedList
);
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
52cb8a7a
...
...
@@ -179,6 +179,9 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
@Autowired
private
EquityFundLogService
equityFundLogService
;
@Autowired
private
EquityFundExcessService
equityFundExcessService
;
private
final
static
Long
FIVE
=
5L
;
...
...
@@ -485,28 +488,26 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
}
}
if
(
request
.
getAmount
().
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
// if (sOrder.getStatus().equals(OrderStatusEnum.USED.getCode())) {
// //查询次订单用户有没有上级用户
// SharingActivities sharingActivities = sharingActivitiesService.getOne(new LambdaQueryWrapper<SharingActivities>()
// .eq(SharingActivities::getNewUid, sOrder.getConsumerId()));
// if (ObjectUtil.isNotEmpty(sharingActivities)) {
// //查询权益金日志记录
// EquityFundLog equityFundLog = equityFundLogService.getOne(new LambdaQueryWrapper<EquityFundLog>()
// .eq(EquityFundLog::getNewUid,sOrder.getConsumerId())
// .eq(EquityFundLog::getOutTradeNo,sOrder.getOrderNo())
// .eq(EquityFundLog::getTerminalTrace,sOrder.getOutTradeNo()));
// if (ObjectUtil.isNotEmpty(equityFundLog)){
// ConsumerWallet aConsumerWallet = consumerWalletService.getOne(new LambdaQueryWrapper<ConsumerWallet>()
// .eq(ConsumerWallet::getConsumerId,sharingActivities.getUid()));
// aConsumerWallet.setEquityFund(aConsumerWallet.getEquityFund().subtract(equityFundLog.getEquityFund()));
// aConsumerWallet.setAccumulateEquityFund(aConsumerWallet.getAccumulateEquityFund().subtract(equityFundLog.getEquityFund()));
// consumerWalletService.updateConsumerWallet(aConsumerWallet);
// equityFundLog.setEquityFundType(EquityFundTypeEnum.ORDER_REFUND.getCode());
// equityFundLog.setEquityFund(equityFundLog.getEquityFund().negate());
// equityFundLogService.insertEquityFundLog(equityFundLog);
// }
// }
// }
if
(
sOrder
.
getStatus
().
equals
(
OrderStatusEnum
.
USED
.
getCode
()))
{
//查询次订单用户有没有上级用户
SharingActivities
sharingActivities
=
sharingActivitiesService
.
getOne
(
new
LambdaQueryWrapper
<
SharingActivities
>()
.
eq
(
SharingActivities:
:
getNewUid
,
sOrder
.
getConsumerId
()));
if
(
ObjectUtil
.
isNotEmpty
(
sharingActivities
))
{
//查询临时权益金记录表
EquityFundExcess
equityFundExcess
=
equityFundExcessService
.
getOne
(
new
LambdaQueryWrapper
<
EquityFundExcess
>()
.
eq
(
EquityFundExcess:
:
getNewUid
,
sOrder
.
getConsumerId
())
.
eq
(
EquityFundExcess:
:
getOutTradeNo
,
sOrder
.
getOrderNo
())
.
eq
(
EquityFundExcess:
:
getRebateType
,
YesNoEnum
.
no
.
getIndex
()));
if
(
ObjectUtil
.
isNotEmpty
(
equityFundExcess
)){
ConsumerWallet
aConsumerWallet
=
consumerWalletService
.
getOne
(
new
LambdaQueryWrapper
<
ConsumerWallet
>()
.
eq
(
ConsumerWallet:
:
getConsumerId
,
sharingActivities
.
getUid
()));
aConsumerWallet
.
setEquityFund
(
aConsumerWallet
.
getEquityFund
().
subtract
(
equityFundExcess
.
getEquityFund
()));
aConsumerWallet
.
setAccumulateEquityFund
(
aConsumerWallet
.
getAccumulateEquityFund
().
subtract
(
equityFundExcess
.
getEquityFund
()));
consumerWalletService
.
updateConsumerWallet
(
aConsumerWallet
);
equityFundExcessService
.
removeById
(
equityFundExcess
.
getId
());
}
}
}
// 退款金额大于0, 微信退款
//退款
if
(
sOrder
.
getPayType
().
equals
(
PayTypeEnum
.
WECHAT
.
getCode
()))
{
...
...
share-system/src/main/java/share/system/service/impl/SharingActivitiesServiceImpl.java
View file @
52cb8a7a
...
...
@@ -8,6 +8,7 @@ import java.util.stream.Collectors;
import
cn.hutool.core.util.ObjectUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.val
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.poi.hssf.record.DVALRecord
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -198,5 +199,23 @@ public class SharingActivitiesServiceImpl extends ServiceImpl<SharingActivitiesM
return
info
;
}
@Override
public
SharingActivitiesVo
selectSharingActivitiesUserById
(
Long
id
)
{
SharingActivities
sharingActivities
=
sharingActivitiesMapper
.
selectSharingActivitiesById
(
id
);
Long
uid
=
sharingActivities
.
getUid
();
Long
newUid
=
sharingActivities
.
getNewUid
();
SharingActivitiesVo
vo
=
new
SharingActivitiesVo
();
SConsumer
sConsumer
=
sConsumerService
.
selectSConsumerById
(
uid
);
SConsumer
newConsumer
=
sConsumerService
.
selectSConsumerById
(
newUid
);
BeanUtils
.
copyProperties
(
sharingActivities
,
vo
);
if
(
ObjectUtil
.
isNotEmpty
(
sConsumer
)){
vo
.
setPhone
(
StringUtils
.
isNotEmpty
(
sConsumer
.
getPhone
())
?
sConsumer
.
getPhone
():
""
);
vo
.
setNickName
(
StringUtils
.
isNotEmpty
(
sConsumer
.
getNickName
())
?
sConsumer
.
getNickName
():
""
);
}
if
(
ObjectUtil
.
isNotEmpty
(
newConsumer
)){
vo
.
setNewPhone
(
StringUtils
.
isNotEmpty
(
newConsumer
.
getPhone
())
?
newConsumer
.
getPhone
():
""
);
vo
.
setNewNickName
(
StringUtils
.
isNotEmpty
(
newConsumer
.
getNickName
())
?
newConsumer
.
getNickName
():
""
);
}
return
vo
;
}
}
share-system/src/main/java/share/system/service/impl/WechatNewServiceImpl.java
View file @
52cb8a7a
...
...
@@ -11,6 +11,9 @@ import com.alibaba.fastjson.JSONArray;
import
com.alibaba.fastjson.JSONObject
;
import
com.wechat.pay.java.core.Config
;
import
com.wechat.pay.java.core.RSAAutoCertificateConfig
;
import
com.wechat.pay.java.core.notification.NotificationConfig
;
import
com.wechat.pay.java.core.notification.NotificationParser
;
import
com.wechat.pay.java.service.payments.model.Transaction
;
import
com.wechat.pay.java.service.transferbatch.TransferBatchService
;
import
com.wechat.pay.java.service.transferbatch.model.InitiateBatchTransferRequest
;
import
com.wechat.pay.java.service.transferbatch.model.InitiateBatchTransferResponse
;
...
...
share-system/src/main/resources/mapper/system/EquityFundExcessMapper.xml
View file @
52cb8a7a
...
...
@@ -17,10 +17,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"updateBy"
column=
"update_by"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"remark"
column=
"remark"
/>
<result
property=
"rebateType"
column=
"rebate_type"
/>
</resultMap>
<sql
id=
"selectEquityFundExcessVo"
>
select id, equity_fund, uid, new_uid, out_trade_no, expire_time, is_delete, create_by, create_time, update_by, update_time, remark from s_equity_fund_excess
select id, equity_fund, uid, new_uid, out_trade_no, expire_time, is_delete, create_by, create_time, update_by, update_time, remark
,rebate_type
from s_equity_fund_excess
</sql>
<select
id=
"selectEquityFundExcessList"
parameterType=
"EquityFundExcess"
resultMap=
"EquityFundExcessResult"
>
...
...
@@ -55,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"updateBy != null"
>
update_by,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
<if
test=
"remark != null"
>
remark,
</if>
<if
test=
"rebateType != null"
>
rebate_type,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"equityFund != null"
>
#{equityFund},
</if>
...
...
@@ -68,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"updateBy != null"
>
#{updateBy},
</if>
<if
test=
"updateTime != null"
>
#{updateTime},
</if>
<if
test=
"remark != null"
>
#{remark},
</if>
<if
test=
"rebateType != null"
>
#{rebate_type},
</if>
</trim>
</insert>
...
...
@@ -85,6 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"updateBy != null"
>
update_by = #{updateBy},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime},
</if>
<if
test=
"remark != null"
>
remark = #{remark},
</if>
<if
test=
"rebateType != null"
>
remark = #{rebate_type},
</if>
</trim>
where id = #{id}
</update>
...
...
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