From 3540bad3014f965d3082a7e2e2b3c58489b87e87 Mon Sep 17 00:00:00 2001 From: sunjiabei Date: Fri, 15 Aug 2025 17:14:22 +0800 Subject: [PATCH] =?UTF-8?q?8=E6=9C=8815=E6=97=A5=E4=BC=A0=E5=85=A5?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/example/demo/domain/vo/coin/Gold.java | 9 +++++++++ .../com/example/demo/serviceImpl/coin/ConsumeServiceImpl.java | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/example/demo/domain/vo/coin/Gold.java b/src/main/java/com/example/demo/domain/vo/coin/Gold.java index 5464d67..a32574e 100644 --- a/src/main/java/com/example/demo/domain/vo/coin/Gold.java +++ b/src/main/java/com/example/demo/domain/vo/coin/Gold.java @@ -6,6 +6,7 @@ import lombok.NoArgsConstructor; import java.io.Serializable; import java.math.BigDecimal; +import java.math.RoundingMode; /** * @program: gold-java @@ -26,4 +27,12 @@ public class Gold implements Serializable { private BigDecimal freeGolds; // 免费金币总数 private BigDecimal taskGolds; // 任务金币总数 private BigDecimal sumGolds; +// public void setPermanentGolds(BigDecimal permanentGolds) { +// if (permanentGolds != null) { +// // 保留两位小数,四舍五入 +// this.permanentGolds = permanentGolds.setScale(2, RoundingMode.HALF_UP); +// } else { +// this.permanentGolds = null; +// } +// } } diff --git a/src/main/java/com/example/demo/serviceImpl/coin/ConsumeServiceImpl.java b/src/main/java/com/example/demo/serviceImpl/coin/ConsumeServiceImpl.java index d4b555c..a959836 100644 --- a/src/main/java/com/example/demo/serviceImpl/coin/ConsumeServiceImpl.java +++ b/src/main/java/com/example/demo/serviceImpl/coin/ConsumeServiceImpl.java @@ -196,8 +196,9 @@ public class ConsumeServiceImpl implements ConsumeService { // if(consumeUser.getJwcode().equals(94226013)){ GoldTistV2.addCoinNew(userGoldRecord.getJwcode().toString(), 65, (double) (userGoldRecord.getPermanentGold() + userGoldRecord.getFreeDecember() + userGoldRecord.getFreeJune() + userGoldRecord.getTaskGold()) / 100, - userGoldRecord.getRemark(), ((double) userGoldRecord.getPermanentGold() / 100), userGoldRecord.getPayPlatform(), userGoldRecord.getGoodsName()); + userGoldRecord.getRemark(), ((double) userGoldRecord.getPermanentGold() / 100), consumeUser.getAdminName(), userGoldRecord.getGoodsName()); // } + System.out.println(consumeUser.getAdminName()); return Result.success(); } }