From bad5f32046a3de69758a3c360f12dbf7bc9e7deb Mon Sep 17 00:00:00 2001 From: gongbiao Date: Tue, 18 Jun 2019 10:38:54 +0800 Subject: [PATCH] =?UTF-8?q?[BUG][=E4=BF=AE=E6=94=B9][dev=20version:.1465.1?= =?UTF-8?q?929=EF=BC=9A=E5=A4=9A=E7=BB=8F=E7=82=B9=E4=BD=8D=E7=9A=84?= =?UTF-8?q?=E7=89=A9=E4=B8=9A=E8=B4=A6=E5=8D=95-=E7=89=A9=E4=B8=9A?= =?UTF-8?q?=E5=8D=95=E4=BB=B7=E6=8F=90=E4=BA=A4=E5=A4=9A=E9=99=A4=E4=BB=A5?= =?UTF-8?q?100]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WxPropertyContractServiceImpl.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java index 17921d978..091d38a36 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java @@ -118,7 +118,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService if(rentPrice == null){ if(StringUtils.isNotBlank(wxPropertyContract.getRentArea()) && !"0".equals(wxPropertyContract.getRentArea()) && !"0.00".equals(wxPropertyContract.getRentArea())&& !"0.0".equals(wxPropertyContract.getRentArea()) ) { Double rentArea = Double.parseDouble(wxPropertyContract.getRentArea()); - rentPrice = new BigDecimal((float) price / rentArea).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + rentPrice = new BigDecimal((double) price / rentArea).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); rentInfoObject.put("rentPrice", rentPrice); } } @@ -127,9 +127,10 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService }else{ if(StringUtils.isNotBlank(wxPropertyContract.getRentArea()) && !"0".equals(wxPropertyContract.getRentArea()) && !"0.00".equals(wxPropertyContract.getRentArea())&& !"0.0".equals(wxPropertyContract.getRentArea()) ) { if(StringUtils.isNotBlank(wxPropertyContract.getRentArea()) && !"0".equals(wxPropertyContract.getRentArea()) && !"0.00".equals(wxPropertyContract.getRentArea())) { - Long price = wxPropertyContract.getPrice() / 100; - Double rentArea = Double.parseDouble(wxPropertyContract.getRentArea()); - Double rentPrice = new BigDecimal((float) price / rentArea).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + Long price = wxPropertyContract.getPrice(); + Double rentArea = Double.parseDouble(wxPropertyContract.getRentArea()) * 100; + Double rentPrice = new BigDecimal((double) price / rentArea).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + rentPrice = rentPrice * 100; if (rentPrice > 0) { wxPropertyContract.setRentPrice(rentPrice.toString()); } else {