From 58b894e59e3a30fed0fc868192bacbcaa3465c81 Mon Sep 17 00:00:00 2001 From: luozukai Date: Thu, 30 May 2019 15:37:20 +0800 Subject: [PATCH] =?UTF-8?q?[bug][=E4=BF=AE=E6=94=B9][1001653=201001703=201?= =?UTF-8?q?001699]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iformall/service/impl/WxRentContractServiceImpl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java index 9934b7e93..2da0f05d0 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -759,7 +759,13 @@ public class WxRentContractServiceImpl implements WxRentContractService { long[] priceArr = new long[arraySize]; for (int i = 0; i < arraySize; i++) { JSONObject rentInfoObject = rentInfoArray.getJSONObject(i); - priceArr[i] = new BigDecimal(rentInfoObject.getString("price")).multiply(new BigDecimal(100)).longValue(); + //年 需要除12 + if(EnumPriceUnit.Y.getCode().equals(priceUnit)){ + BigDecimal yprice = new BigDecimal(rentInfoObject.getString("price")).divide(new BigDecimal(12),2, BigDecimal.ROUND_HALF_DOWN); + priceArr[i] = yprice.multiply(new BigDecimal(100)).longValue(); + }else{ + priceArr[i] = new BigDecimal(rentInfoObject.getString("price")).multiply(new BigDecimal(100)).longValue(); + } } priceList.add(priceArr); //大于一年