|
@@ -25,6 +25,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.math.RoundingMode;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
@@ -98,7 +99,13 @@ public class PerformOrderServiceImpl implements IPerformOrderService {
|
|
|
} else {
|
|
|
map.put("userId", String.valueOf(orderInfo.getUserId()));
|
|
|
}
|
|
|
- map.put("money", orderInfo.getAmount().stripTrailingZeros().toPlainString());
|
|
|
+ //判断是否设置充值打折
|
|
|
+ if (game.getRechargeRebate() != null) {
|
|
|
+ BigDecimal money = orderInfo.getAmount().multiply(game.getRechargeRebate()).setScale(2, RoundingMode.HALF_UP);
|
|
|
+ map.put("money", money.stripTrailingZeros().toPlainString());
|
|
|
+ } else {
|
|
|
+ map.put("money", orderInfo.getAmount().stripTrailingZeros().toPlainString());
|
|
|
+ }
|
|
|
map.put("time", String.valueOf(System.currentTimeMillis()));
|
|
|
map.put("serverId", orderInfo.getServerId());
|
|
|
map.put("roleId", orderInfo.getRoleId());
|