From 691059fbb91b51fe6a6751ff38aec478e21fb607 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Thu, 30 May 2019 14:50:18 +0800 Subject: [PATCH] =?UTF-8?q?[=E7=89=A9=E4=B8=9A=E5=90=88=E5=90=8C][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9][=E4=B8=8B=E8=BD=BD]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/WxRentContractServiceImpl.java | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) 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 14c5b9755..9934b7e93 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -1407,8 +1407,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { result.put("unitPriceRentUpper", PriceUtil.digitUppercase(unitPrice)); } else { result.put("unitPriceRent", 0); - result.put("priceRentUpper", "0"); - result.put("unitPriceRentUpper", "0"); + result.put("priceRentUpper", PriceUtil.digitUppercase(0)); + result.put("unitPriceRentUpper", PriceUtil.digitUppercase(0)); } //租赁保证金 @@ -1460,12 +1460,19 @@ public class WxRentContractServiceImpl implements WxRentContractService { double priceProperty = new BigDecimal(wxPropertyContract.get("price").toString()) .divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); result.put("priceProperty", priceProperty); - double unitPriceProperty = new BigDecimal(wxPropertyContract.get("price").toString()) - .divide(new BigDecimal(wxRentContract.getRentArea()), 2, RoundingMode.HALF_EVEN) - .divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); - result.put("unitPriceProperty", unitPriceProperty); - result.put("pricePropertyUpper", PriceUtil.digitUppercase(priceProperty)); - result.put("unitPricePropertyUpper", PriceUtil.digitUppercase(unitPriceProperty)); + if (!wxRentContract.getRentArea().equals("0")) { + double unitPriceProperty = new BigDecimal(wxPropertyContract.get("price").toString()) + .divide(new BigDecimal(wxRentContract.getRentArea()), 2, RoundingMode.HALF_EVEN) + .divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); + result.put("unitPriceProperty", unitPriceProperty); + result.put("pricePropertyUpper", PriceUtil.digitUppercase(priceProperty)); + result.put("unitPricePropertyUpper", PriceUtil.digitUppercase(unitPriceProperty)); + } else { + result.put("unitPriceProperty", 0); + result.put("pricePropertyUpper", PriceUtil.digitUppercase(0)); + result.put("unitPricePropertyUpper", PriceUtil.digitUppercase(0)); + } + //首期物业费 Calendar instance = Calendar.getInstance(); instance.setTime(wxRentContract.getRentalStartDate());