|
@@ -26,7 +26,6 @@ import com.fjhx.common.constant.SourceConstant;
|
|
|
import com.fjhx.common.entity.corporation.po.Corporation;
|
|
|
import com.fjhx.common.service.corporation.CorporationService;
|
|
|
import com.fjhx.common.utils.Assert;
|
|
|
-import com.fjhx.common.utils.ExchangeRateUtil;
|
|
|
import com.fjhx.item.util.excel.util.ExcelUtil;
|
|
|
import com.fjhx.tenant.entity.dict.dto.DictTenantDataSelectDto;
|
|
|
import com.fjhx.tenant.entity.dict.vo.DictTenantDataVo;
|
|
@@ -39,6 +38,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.math.RoundingMode;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -211,12 +211,12 @@ public class AccountRunningWaterServiceImpl extends ServiceImpl<AccountRunningWa
|
|
|
throw new ServiceException("币种不能为空");
|
|
|
}
|
|
|
|
|
|
- //计算汇率如果有填转人民币金额则反推,没填就获取实时的(不赋值转换cny金额,兼容旧代码)
|
|
|
+// dto.setRate(ExchangeRateUtil.getCnyToCodeRate(dto.getCurrency()));
|
|
|
+
|
|
|
+ //计算汇率如果有填转人民币金额则反推
|
|
|
if (ObjectUtil.isNotEmpty(dto.getAmountCny())) {
|
|
|
- BigDecimal divide = dto.getAmountCny().divide(dto.getAmount());
|
|
|
+ BigDecimal divide = dto.getAmountCny().divide(dto.getAmount(), 4, RoundingMode.HALF_UP);
|
|
|
dto.setRate(divide);
|
|
|
- } else {
|
|
|
- dto.setRate(ExchangeRateUtil.getCnyToCodeRate(dto.getCurrency()));
|
|
|
}
|
|
|
|
|
|
// 修改账户余额表的余额
|