|
@@ -473,7 +473,7 @@ public class VipOrderDonServiceImpl extends ServiceImpl<VipOrderDonMapper, VipOr
|
|
|
deductGalaxyCoinPayOrderMoney(orderDon, payRequest.getGalaxyCoin(), user, actuallyPayMoney);
|
|
deductGalaxyCoinPayOrderMoney(orderDon, payRequest.getGalaxyCoin(), user, actuallyPayMoney);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private void deductGalaxyCoinPayOrderMoney(VipOrderDon orderDon, BigDecimal toUseGalaxyCoin, User user, BigDecimal actuallyPayMoney) {
|
|
|
|
|
|
|
+ public void deductGalaxyCoinPayOrderMoney(VipOrderDon orderDon, BigDecimal toUseGalaxyCoin, User user, BigDecimal actuallyPayMoney) {
|
|
|
//存在银河币
|
|
//存在银河币
|
|
|
if (toUseGalaxyCoin != null && toUseGalaxyCoin.compareTo(BigDecimal.ZERO) > 0) {
|
|
if (toUseGalaxyCoin != null && toUseGalaxyCoin.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
BigDecimal userGalaxyCoin = user.getGalaxyCoin();
|
|
BigDecimal userGalaxyCoin = user.getGalaxyCoin();
|
|
@@ -521,6 +521,9 @@ public class VipOrderDonServiceImpl extends ServiceImpl<VipOrderDonMapper, VipOr
|
|
|
//需要使用的银河币
|
|
//需要使用的银河币
|
|
|
BigDecimal userFinalUseGalaxyCoin = subGalxyCoin;
|
|
BigDecimal userFinalUseGalaxyCoin = subGalxyCoin;
|
|
|
for (UserGalaxyCoinRecord galaxyCoinRecord : availableGalaxyCoinList) {
|
|
for (UserGalaxyCoinRecord galaxyCoinRecord : availableGalaxyCoinList) {
|
|
|
|
|
+ if (userFinalUseGalaxyCoin.compareTo(BigDecimal.ZERO) <= 0) {
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
BigDecimal remainGalaxyCoin = galaxyCoinRecord.getRemainGalaxyCoin();
|
|
BigDecimal remainGalaxyCoin = galaxyCoinRecord.getRemainGalaxyCoin();
|
|
|
Long galaxyCoinRecordId = galaxyCoinRecord.getId();
|
|
Long galaxyCoinRecordId = galaxyCoinRecord.getId();
|
|
|
//扣完
|
|
//扣完
|
|
@@ -830,7 +833,7 @@ public class VipOrderDonServiceImpl extends ServiceImpl<VipOrderDonMapper, VipOr
|
|
|
return userPlatDistributeRate;
|
|
return userPlatDistributeRate;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private void deductUserGalaxyCoin(Long galaxyCoinRecordId, BigDecimal deductGalaxyCoin, BigDecimal remainGalaxyCoin, boolean isUsed) {
|
|
|
|
|
|
|
+ public void deductUserGalaxyCoin(Long galaxyCoinRecordId, BigDecimal deductGalaxyCoin, BigDecimal remainGalaxyCoin, boolean isUsed) {
|
|
|
Integer update = userGalaxyCoinRecordMapper.update(null, Wrappers.lambdaUpdate(UserGalaxyCoinRecord.class)
|
|
Integer update = userGalaxyCoinRecordMapper.update(null, Wrappers.lambdaUpdate(UserGalaxyCoinRecord.class)
|
|
|
.set(UserGalaxyCoinRecord::getRemainGalaxyCoin, remainGalaxyCoin.subtract(deductGalaxyCoin))
|
|
.set(UserGalaxyCoinRecord::getRemainGalaxyCoin, remainGalaxyCoin.subtract(deductGalaxyCoin))
|
|
|
.set(isUsed, UserGalaxyCoinRecord::getIsUsed, isUsed)
|
|
.set(isUsed, UserGalaxyCoinRecord::getIsUsed, isUsed)
|