Commit 5c67131a by YG8429

人工审核退款增加删除返佣和删除权益金日志记录

parent ee38c84c
......@@ -431,7 +431,7 @@ public class RedisTask {
EquityFundLog equityFundLog = new EquityFundLog();
equityFundLog.setEquityFund(addEquityFund);
equityFundLog.setEquityFundType("1");
equityFundLog.setOutTradeNo(sOrder.getOutTradeNo());
equityFundLog.setOutTradeNo(sOrder.getOrderNo());
equityFundLog.setTerminalTrace(sOrder.getOutTradeNo());
equityFundLog.setUid(sharingActivities.getUid());
equityFundLog.setNewUid(sharingActivities.getNewUid());
......
......@@ -471,7 +471,7 @@ public class CallbackServiceImpl implements CallbackService {
wechatPayInfoService.updateById(wechatInfo);
//新增权益金日志
addEquityFundLog(recharge.getConsumerId(),
recharge.getRechargeAmount(),recharge.getOutTradeNo(),recharge.getTerminalTrace(),"0");
recharge.getRechargeAmount(),recharge.getRechargeNo(),recharge.getTerminalTrace(),"0");
aFalse = Boolean.TRUE;
} catch (Exception e) {
logger.error("微信支付回调出错");
......
......@@ -173,6 +173,13 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
@Autowired
private RechargeService rechargeService;
@Autowired
private SharingActivitiesService sharingActivitiesService;
@Autowired
private EquityFundLogService equityFundLogService;
private final static Long FIVE = 5L;
......@@ -478,6 +485,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()));
equityFundLog.setEquityFund(equityFundLog.getEquityFund().negate());
equityFundLogService.insertEquityFundLog(equityFundLog);
aConsumerWallet.setEquityFund(aConsumerWallet.getEquityFund().subtract(equityFundLog.getEquityFund()));
consumerWalletService.updateConsumerWallet(aConsumerWallet);
}
}
}
// 退款金额大于0, 微信退款
//退款
if (sOrder.getPayType().equals(PayTypeEnum.WECHAT.getCode())) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment