|
|
@@ -78,11 +78,16 @@ public class DistributePopularizeController {
|
|
|
MapUtils.flatBuilder(request.getParameterMap())
|
|
|
.field(DistributePopularizeOrdersView::getSharedId, userId)
|
|
|
.build());
|
|
|
+ DistributePointsExchangeMoney distributePointsExchangeMoney = distributePointsExchangeMoneyMapper.selectOne(Wrappers.lambdaQuery(DistributePointsExchangeMoney.class).orderByDesc(DistributePointsExchangeMoney::getPoints).last("limit 1"));
|
|
|
+ BigDecimal points = BigDecimal.valueOf(distributePointsExchangeMoney.getPoints());
|
|
|
+ BigDecimal money = distributePointsExchangeMoney.getMoney();
|
|
|
+ BigDecimal oneHundred = BigDecimal.valueOf(100);
|
|
|
search.getDataList().forEach(data -> {
|
|
|
GoodsDon goodsDon = goodsDonMapper.selectById(data.getGoodsId());
|
|
|
GoodsDonSku goodsDonSku = goodsDonSkuMapper.selectById(data.getSkuId());
|
|
|
data.setGoodsTitle(goodsDon.getTitle());
|
|
|
data.setSpecVal(goodsDonSku.getSpecVal());
|
|
|
+ data.setWaitGetMoney(data.getPoints().divide(points).multiply(money).divide(oneHundred));
|
|
|
});
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(search);
|
|
|
}
|
|
|
@@ -138,6 +143,21 @@ public class DistributePopularizeController {
|
|
|
}
|
|
|
}
|
|
|
distributePopularizeView.setWaitingSendPoints(waitingPoints);
|
|
|
+ if (user.getPoints().compareTo(BigDecimal.ZERO) <= 0 && waitingPoints.compareTo(BigDecimal.ZERO) <= 0) {
|
|
|
+ distributePopularizeView.setGotMoney(BigDecimal.ZERO);
|
|
|
+ distributePopularizeView.setWaitingMoney(BigDecimal.ZERO);
|
|
|
+ }else {
|
|
|
+ DistributePointsExchangeMoney distributePointsExchangeMoney = distributePointsExchangeMoneyMapper.selectOne(Wrappers.lambdaQuery(DistributePointsExchangeMoney.class).orderByDesc(DistributePointsExchangeMoney::getPoints).last("limit 1"));
|
|
|
+ BigDecimal points = BigDecimal.valueOf(distributePointsExchangeMoney.getPoints());
|
|
|
+ BigDecimal money = distributePointsExchangeMoney.getMoney();
|
|
|
+ BigDecimal oneHundred = BigDecimal.valueOf(100);
|
|
|
+ if (user.getPoints().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
+ distributePopularizeView.setGotMoney(user.getPoints().divide(points).multiply(money).divide(oneHundred));
|
|
|
+ }
|
|
|
+ if (user.getPoints().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
+ distributePopularizeView.setWaitingMoney(waitingPoints.divide(points).multiply(money).divide(oneHundred));
|
|
|
+ }
|
|
|
+ }
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(distributePopularizeView);
|
|
|
}
|
|
|
|