|
@@ -250,42 +250,42 @@ public class IntegralServiceImpl implements IntegralService {
|
|
|
String bonusYellowIntegral = orderPercentageDO.getBonusYellowIntegral();
|
|
|
String bonusGreenIntegral = orderPercentageDO.getBonusGreenIntegral();
|
|
|
|
|
|
- Long ancestorYellowQuotaAmount = 0L;
|
|
|
- Long ancestorGreenQuotaAmount = 0L;
|
|
|
+
|
|
|
+
|
|
|
Long getYellowHighQuota;
|
|
|
Long getGreenHighQuota;
|
|
|
- if (integralDO.getHighQuota() < amount) {
|
|
|
- ancestorYellowQuotaAmount = calcIntegral((amount - integralDO.getHighQuota()), bonusYellowIntegral);
|
|
|
- getYellowHighQuota = calcIntegral(integralDO.getHighQuota(), bonusYellowIntegral);
|
|
|
-
|
|
|
- ancestorGreenQuotaAmount = calcIntegral((amount - integralDO.getHighQuota()), bonusGreenIntegral);
|
|
|
- getGreenHighQuota = calcIntegral(integralDO.getHighQuota(), bonusGreenIntegral);
|
|
|
- } else {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
getYellowHighQuota = calcIntegral(amount, bonusYellowIntegral);
|
|
|
|
|
|
getGreenHighQuota = calcIntegral(amount, bonusGreenIntegral);
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
integralDO.setYellowCurrentQuota(integralDO.getYellowCurrentQuota() + getYellowHighQuota);
|
|
|
integralDO.setGreenCurrentQuota(integralDO.getGreenCurrentQuota() + getGreenHighQuota);
|
|
|
- integralDO.setHighQuota(integralDO.getHighQuota() - getYellowHighQuota - getGreenHighQuota);
|
|
|
- integralDO.setAncestorQuota(integralDO.getAncestorQuota() + getYellowHighQuota + getGreenHighQuota);
|
|
|
+
|
|
|
+
|
|
|
|
|
|
yellowChangeLog
|
|
|
.setIntegralPoints(getYellowHighQuota)
|
|
|
.setPracticalIntegralPoints(getYellowHighQuota)
|
|
|
- .setAfterIntegralPoints(integralDO.getYellowCurrentQuota())
|
|
|
- .setAncestorQuotaAmount(ancestorYellowQuotaAmount)
|
|
|
- .setMaxAvailablePointsAmount(-getYellowHighQuota)
|
|
|
- .setAfterMaxAvailablePointsAmount(integralDO.getHighQuota() + getGreenHighQuota);
|
|
|
+ .setAfterIntegralPoints(integralDO.getYellowCurrentQuota());
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
greenChangeLog.
|
|
|
setIntegralPoints(getGreenHighQuota)
|
|
|
.setPracticalIntegralPoints(getGreenHighQuota)
|
|
|
- .setAfterIntegralPoints(integralDO.getGreenCurrentQuota())
|
|
|
- .setAncestorQuotaAmount(ancestorGreenQuotaAmount)
|
|
|
- .setMaxAvailablePointsAmount(-getGreenHighQuota)
|
|
|
- .setAfterMaxAvailablePointsAmount(integralDO.getHighQuota() + getYellowHighQuota);
|
|
|
+ .setAfterIntegralPoints(integralDO.getGreenCurrentQuota());
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
integralMapper.updateById(integralDO);
|