|
|
@ -22,6 +22,7 @@ import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.web.client.RestTemplate; |
|
|
|
import org.springframework.web.util.UriComponentsBuilder; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Objects; |
|
|
|
import java.util.UUID; |
|
|
@ -184,7 +185,7 @@ public class BeanRechargeServiceImpl implements BeanRechargeService { |
|
|
|
|
|
|
|
// 初始化累加器 |
|
|
|
int countSum = 0; |
|
|
|
Double moneySum = 0.0; |
|
|
|
BigDecimal moneySum = new BigDecimal("0.0"); |
|
|
|
|
|
|
|
// 遍历充值记录并累加金币 |
|
|
|
for (BeanOnlineRechargeInfo info : beanOnlineRechargeInfos) { |
|
|
@ -194,13 +195,13 @@ public class BeanRechargeServiceImpl implements BeanRechargeService { |
|
|
|
} |
|
|
|
// 累加金额 |
|
|
|
if (info.getMoney() != null) { |
|
|
|
moneySum += info.getMoney(); |
|
|
|
moneySum = moneySum.add(new BigDecimal(info.getMoney().toString())); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 将累加结果设置到Gold对象 |
|
|
|
gold.setBeanNum(countSum); |
|
|
|
gold.setMoney(moneySum); |
|
|
|
gold.setMoney(moneySum.doubleValue()); |
|
|
|
return gold; |
|
|
|
} |
|
|
|
|
|
|
|