From d7903adebd28fae3e87f207e204381feb2d42cad Mon Sep 17 00:00:00 2001 From: luozukai Date: Wed, 5 Jun 2019 11:07:14 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=90=88=E5=90=8C][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E8=AE=A1=E7=A7=9F=E9=9D=A2=E7=A7=AF=E4=B8=BA0=E6=8A=A5?= =?UTF-8?q?=E9=94=99]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WxPropertyContractServiceImpl.java | 6 +++--- .../iformall/service/impl/WxRentContractServiceImpl.java | 4 ++-- 2 files changed, 5 insertions(+), 5 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 b00a73034..59a303c6e 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java @@ -111,7 +111,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService Double rentPrice = rentInfoObject.getDouble("rentPrice"); Long price = wxPropertyContract.getPrice()/100; if(rentPrice == null){ - if(StringUtils.isNotBlank(wxPropertyContract.getRentArea())) { + 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(); rentInfoObject.put("rentPrice", rentPrice); @@ -120,8 +120,8 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService } wxPropertyContract.setRentInfo(rentInfoArray.toJSONString()); }else{ - if(wxPropertyContract.getRentPrice() == null || "0".equals(wxPropertyContract.getRentPrice())){ - if(StringUtils.isNotBlank(wxPropertyContract.getRentArea())) { + 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(); 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 40a39c0d6..c0db34182 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -149,7 +149,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { Double rentPrice = rentInfoObject.getDouble("rentPrice"); Long price = wxRentContract.getPrice()/100; if(rentPrice == null){ - if(StringUtils.isNotBlank(wxRentContract.getRentArea())) { + if(StringUtils.isNotBlank(wxRentContract.getRentArea()) && !"0".equals(wxRentContract.getRentArea()) && !"0.00".equals(wxRentContract.getRentArea()) && !"0.0".equals(wxRentContract.getRentArea()) ) { Double rentArea = Double.parseDouble(wxRentContract.getRentArea()); rentPrice = new BigDecimal((float) price / rentArea).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); rentInfoObject.put("rentPrice", rentPrice); @@ -159,7 +159,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { wxRentContract.setRentInfo(rentInfoArray.toJSONString()); }else{ if(wxRentContract.getRentPrice() == null || "0".equals(wxRentContract.getRentPrice())){ - if(StringUtils.isNotBlank(wxRentContract.getRentArea())) { + if(StringUtils.isNotBlank(wxRentContract.getRentArea()) && !"0".equals(wxRentContract.getRentArea()) && !"0.00".equals(wxRentContract.getRentArea()) && !"0.0".equals(wxRentContract.getRentArea()) ) { Long price = wxRentContract.getPrice()/100; Double rentArea = Double.parseDouble(wxRentContract.getRentArea()); Double rentPrice = new BigDecimal((float)price/rentArea).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();