记得上下班打卡 | git大法好,push需谨慎

Commit 827eaf50 authored by jiangxiulong's avatar jiangxiulong

divide add , 2, BigDecimal.ROUND_HALF_UP

parent 8cd0173e
...@@ -97,7 +97,8 @@ public class KylinOrderTicketsRefundServiceImpl { ...@@ -97,7 +97,8 @@ public class KylinOrderTicketsRefundServiceImpl {
if (item.getEnterMobile().length() == 11) { if (item.getEnterMobile().length() == 11) {
item.setEnterMobile(item.getEnterMobile().substring(0, 3) + "****" + item.getEnterMobile().substring(7)); item.setEnterMobile(item.getEnterMobile().substring(0, 3) + "****" + item.getEnterMobile().substring(7));
} }
item.setPriceActual(orderTicketVo.getPriceActual().subtract(orderTicketVo.getPriceExpress()).divide(BigDecimal.valueOf(orderTicketVo.getNumber()))); // setScale(2, BigDecimal.ROUND_HALF_UP)
item.setPriceActual(orderTicketVo.getPriceActual().subtract(orderTicketVo.getPriceExpress()).divide(BigDecimal.valueOf(orderTicketVo.getNumber()), 2, BigDecimal.ROUND_HALF_UP));
item.setPriceCanRefund(dataUtils.getCanRefundOrderEntitiesPrice(orderTicketVo, kylinOrderRefundsVoBaseList, item.getOrderTicketEntitiesId())); item.setPriceCanRefund(dataUtils.getCanRefundOrderEntitiesPrice(orderTicketVo, kylinOrderRefundsVoBaseList, item.getOrderTicketEntitiesId()));
BeanUtils.copyProperties(item, refundVo); BeanUtils.copyProperties(item, refundVo);
kylinOrderTicketEntitiesPreRefundVos.add(refundVo); kylinOrderTicketEntitiesPreRefundVos.add(refundVo);
......
...@@ -527,7 +527,7 @@ public class DataUtils { ...@@ -527,7 +527,7 @@ public class DataUtils {
*/ */
public BigDecimal getCanRefundOrderEntitiesPrice(KylinOrderTicketVo orderTicketVo, List<KylinOrderRefundsVo> kylinOrderRefundsVoBaseList, String orderTicketEntitiesId) { public BigDecimal getCanRefundOrderEntitiesPrice(KylinOrderTicketVo orderTicketVo, List<KylinOrderRefundsVo> kylinOrderRefundsVoBaseList, String orderTicketEntitiesId) {
// 单票实付价格 // 单票实付价格
BigDecimal singlePrice = orderTicketVo.getPriceActual().subtract(orderTicketVo.getPriceExpress()).divide(BigDecimal.valueOf(orderTicketVo.getNumber())); BigDecimal singlePrice = orderTicketVo.getPriceActual().subtract(orderTicketVo.getPriceExpress()).divide(BigDecimal.valueOf(orderTicketVo.getNumber()), 2, BigDecimal.ROUND_HALF_UP);
// 单票剩余未退款金额 // 单票剩余未退款金额
BigDecimal canRefundSinglePrice = BigDecimal.valueOf(0); BigDecimal canRefundSinglePrice = BigDecimal.valueOf(0);
for (KylinOrderTicketEntitiesVo item : orderTicketVo.getEntitiesVoList()) { for (KylinOrderTicketEntitiesVo item : orderTicketVo.getEntitiesVoList()) {
......
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