Commit bd7eeeb8 authored by 332784038@qq.com's avatar 332784038@qq.com

除数默认值给1,避免计算错误

parent d7c9b455
...@@ -41,7 +41,7 @@ public class CurrecyApiImpl implements CurrencyApi { ...@@ -41,7 +41,7 @@ public class CurrecyApiImpl implements CurrencyApi {
dto.setTargetCurrencyId(targetId); dto.setTargetCurrencyId(targetId);
if (sourceId == null || targetId == null) { if (sourceId == null || targetId == null) {
dto.setCurrencyRate(BigDecimal.ZERO); dto.setCurrencyRate(BigDecimal.ZERO);
dto.setSourceCurrencyAmount(BigDecimal.ONE); dto.setSourceCurrencyAmount(BigDecimal.ONE);// 除数默认值给1,避免计算错误
dto.setTargetCurrencyAmount(BigDecimal.ZERO); dto.setTargetCurrencyAmount(BigDecimal.ZERO);
} else { } else {
if (sourceId.equals(targetId)){ if (sourceId.equals(targetId)){
...@@ -90,7 +90,7 @@ public class CurrecyApiImpl implements CurrencyApi { ...@@ -90,7 +90,7 @@ public class CurrecyApiImpl implements CurrencyApi {
if (sourceId == null || targetId == null) { if (sourceId == null || targetId == null) {
dto.setCurrencyRate(BigDecimal.ZERO); dto.setCurrencyRate(BigDecimal.ZERO);
dto.setSourceCurrencyAmount(BigDecimal.ONE); dto.setSourceCurrencyAmount(BigDecimal.ONE);// 除数默认值给1,避免计算错误
dto.setTargetCurrencyAmount(BigDecimal.ZERO); dto.setTargetCurrencyAmount(BigDecimal.ZERO);
} else { } else {
if (sourceId.equals(targetId)){ if (sourceId.equals(targetId)){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment